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

Merge remote-tracking branch 'origin/moly'

parents 6e3f9d96 898d58ea
......@@ -166,7 +166,7 @@
<tr>
<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>
</tr>
......@@ -376,7 +376,8 @@
//form表单提交
$("#modelSubmit").click(function(){
sumkpiWeightTdVal=sumkpiWeightTdVal.toFixed(2);
//sumkpiWeightTdVal=sumkpiWeightTdVal.toFixed(2);
sumkpiWeightTdVal=parseFloat(2);
if(sumkpiWeightTdVal <1.00){
$.alert("权限总和需 为 1");
return;
......@@ -668,15 +669,26 @@
}
if (kpiWeightTdVal < 0){
$.alert("权重不能为负");
var mmm=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mmm);
return;
}
if(kpiWeightTdVal >1.00){
$.alert("权重超值 1");
var mmmm=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mmmm);
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){
$.alert("权重和 超值 1");
var mm=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(mm);
return;
}
// 勾选指标 的 名称 和 value
......@@ -701,7 +713,8 @@
}
});
sumkpiWeightTdVal+=Number(kpiWeightTdVal);
//sumkpiWeightTdVal+=Number(kpiWeightTdVal);
sumkpiWeightTdVal+=tt;
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV);
//$("#kpiWeightTd").attr("max",maxV);
......@@ -718,6 +731,15 @@
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_名称
function getArrDimKpiidAndNameChecked(){
var arrDimKpiChecked=[];
......
......@@ -208,7 +208,7 @@
</tr>
<tr id="tr_id_weight">
<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>
</tr>
......@@ -351,7 +351,6 @@
$.alert("权值总和必须为1");
return;
}
return;
var kpiId_weight=getkpiIDAndWeightShallSave();
var associationId = $("#associationId").val();
......@@ -748,8 +747,14 @@
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
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");
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
return;
......@@ -768,10 +773,9 @@
}
});
}
sumkpiWeightTdVal=Number(id_kpiWeightTd_value)+Number(sumkpiWeightTdVal);
sumkpiWeightTdVal=curm01+Number(sumkpiWeightTdVal);
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
});
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