Commit 1c6e4772 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/moly'

parents 6e3f9d96 898d58ea
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<tr> <tr>
<td>权重(<font color="red">必填</font>):</td> <td>权重(<font color="red">必填</font>):</td>
<td><input type="number" class="form-control" name="descTd" id="kpiWeightTd" value="1.00" style="display: inline;" /> <td><input type="number" step="0.01" class="form-control" name="descTd" id="kpiWeightTd" value="1.00" style="display: inline;" />
<span id="writeWarningInfTd" style="color:red;display: inline;padding-left:10px;"></span></td> <span id="writeWarningInfTd" style="color:red;display: inline;padding-left:10px;"></span></td>
</tr> </tr>
...@@ -376,7 +376,8 @@ ...@@ -376,7 +376,8 @@
//form表单提交 //form表单提交
$("#modelSubmit").click(function(){ $("#modelSubmit").click(function(){
sumkpiWeightTdVal=sumkpiWeightTdVal.toFixed(2); //sumkpiWeightTdVal=sumkpiWeightTdVal.toFixed(2);
sumkpiWeightTdVal=parseFloat(2);
if(sumkpiWeightTdVal <1.00){ if(sumkpiWeightTdVal <1.00){
$.alert("权限总和需 为 1"); $.alert("权限总和需 为 1");
return; return;
...@@ -668,15 +669,26 @@ ...@@ -668,15 +669,26 @@
} }
if (kpiWeightTdVal < 0){ if (kpiWeightTdVal < 0){
$.alert("权重不能为负"); $.alert("权重不能为负");
var mmm=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mmm);
return; return;
} }
if(kpiWeightTdVal >1.00){ if(kpiWeightTdVal >1.00){
$.alert("权重超值 1"); $.alert("权重超值 1");
var mmmm=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mmmm);
return ; return ;
} }
var k=sumkpiWeightTdVal+Number(kpiWeightTdVal); var tt=0.00;
for(var jj=0;jj<arrDimKpiChecked.length;jj++){
tt+=Number(kpiWeightTdVal);
}
var k=sumkpiWeightTdVal+tt;
//var k=sumkpiWeightTdVal+Number(kpiWeightTdVal);
if(k > 1.00){ if(k > 1.00){
$.alert("权重和 超值 1"); $.alert("权重和 超值 1");
var mm=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mm);
return; return;
} }
// 勾选指标 的 名称 和 value // 勾选指标 的 名称 和 value
...@@ -701,7 +713,8 @@ ...@@ -701,7 +713,8 @@
} }
}); });
sumkpiWeightTdVal+=Number(kpiWeightTdVal); //sumkpiWeightTdVal+=Number(kpiWeightTdVal);
sumkpiWeightTdVal+=tt;
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2); var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV); $("#kpiWeightTd").val(maxV);
//$("#kpiWeightTd").attr("max",maxV); //$("#kpiWeightTd").attr("max",maxV);
...@@ -718,6 +731,15 @@ ...@@ -718,6 +731,15 @@
return anainfoShallSaveArr; return anainfoShallSaveArr;
} }
/*curTotlakpiWeigh=0.00;
function getCurTotlakpiWeight(){
$("#addTr").find("tr").each(function(){
var weight=$(this).children().eq(1);
alert('weight'+weight);
alert('type weight'+typeof weight);
});
}*/
// 获取勾选指标的 数据 格式 id_名称 // 获取勾选指标的 数据 格式 id_名称
function getArrDimKpiidAndNameChecked(){ function getArrDimKpiidAndNameChecked(){
var arrDimKpiChecked=[]; var arrDimKpiChecked=[];
......
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
</tr> </tr>
<tr id="tr_id_weight"> <tr id="tr_id_weight">
<td>权重(<font color="red">必填</font>):</td> <td>权重(<font color="red">必填</font>):</td>
<td><input type="number" class="form-control" name="descTd" id="kpiWeightTd" style="display: inline;" /> <td><input type="number" step="0.01" class="form-control" name="descTd" id="kpiWeightTd" style="display: inline;" />
<span id="writeWarningInfTd" style="color:red;display: inline;padding-left:10px;"></span></td> <span id="writeWarningInfTd" style="color:red;display: inline;padding-left:10px;"></span></td>
</tr> </tr>
...@@ -351,7 +351,6 @@ ...@@ -351,7 +351,6 @@
$.alert("权值总和必须为1"); $.alert("权值总和必须为1");
return; return;
} }
return;
var kpiId_weight=getkpiIDAndWeightShallSave(); var kpiId_weight=getkpiIDAndWeightShallSave();
var associationId = $("#associationId").val(); var associationId = $("#associationId").val();
...@@ -748,8 +747,14 @@ ...@@ -748,8 +747,14 @@
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
return; return;
} }
id_kpiWeightTd_value=Number(id_kpiWeightTd_value);
if(id_kpiWeightTd_value+Number(sumkpiWeightTdVal) > 1.00){
//id_kpiWeightTd_value=Number(id_kpiWeightTd_value);
var curm01=0.00;
for(var jj=0;jj<arrdimKpiChecked.length;jj++){
curm01+=Number(id_kpiWeightTd_value);
}
if(curm01+Number(sumkpiWeightTdVal) > 1.00){
$.alert("权值总和 不能大于 1"); $.alert("权值总和 不能大于 1");
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
return; return;
...@@ -768,10 +773,9 @@ ...@@ -768,10 +773,9 @@
} }
}); });
} }
sumkpiWeightTdVal=Number(id_kpiWeightTd_value)+Number(sumkpiWeightTdVal); sumkpiWeightTdVal=curm01+Number(sumkpiWeightTdVal);
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2))); $("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
}); });
function getkpiIDAndWeightShallSave(){ function getkpiIDAndWeightShallSave(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment