Commit e74ff109 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/moly'

parents e683dced a91dc695
......@@ -166,7 +166,7 @@
<tr>
<td>权重(<font color="red">必填</font>):</td>
<td><input type="number" class="form-control" name="descTd" id="kpiWeightTd" style="display: inline;" />
<td><input type="number" 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>
......@@ -277,7 +277,7 @@
}
//修改一条参数
function updateRow(elementTag){
/* function updateRow(elementTag){
$("#addParam").text("修改参数");
$("#addTr").find("tr").removeClass("orange-tr");
$(elementTag).parents("tr").eq(0).addClass("orange-tr");
......@@ -288,7 +288,7 @@
$("#paramDataType").change();
$("#paramName").val(paramName);
$("#paramValue").val(paramValue);
}
}*/
//添加/修改参数
$("#addParam").click(function(){
......@@ -318,24 +318,37 @@
function updateRow(e){
var pro=prompt("请输入",$(e).parent().prev()[0].innerHTML);
var initK=Number($(e).parent().prev()[0].innerHTML);
pro=$.trim(pro);
if($.isNumeric(pro)){
pro=parseFloat(pro);
if(pro >0){
$(e).parent().prev()[0].innerHTML=parseFloat(pro);
if(initK >= pro){
$(e).parent().prev()[0].innerHTML=parseFloat(pro);
sumkpiWeightTdVal-=initK;
sumkpiWeightTdVal+=pro;
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV);
}else{
var k=sumkpiWeightTdVal-initK+pro;
if(k <=1.00){
$(e).parent().prev()[0].innerHTML=parseFloat(pro);
sumkpiWeightTdVal-=initK;
sumkpiWeightTdVal+=pro;
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV);
}
}
}
}
}
//删除一条参数
function deleteRow(e){
var v=$(e).parent().prev().text();
sumkpiWeightTdVal=sumkpiWeightTdVal-v;
$("#kpiWeightTd").val( (1.00-sumkpiWeightTdVal).toFixed(2));
var id=Number(e.title);
dimKpiSelected.splice($.inArray(id,dimKpiSelected),1);
$(e).parent().parent().remove();
......@@ -363,21 +376,23 @@
//form表单提交
$("#modelSubmit").click(function(){
sumkpiWeightTdVal=sumkpiWeightTdVal.toFixed(2);
if(sumkpiWeightTdVal <1.00){
$.alert("权限总和需 为 1");
return;
}
var anainfoShallSaveArr= getAnainfoShallSave();
var arrDimKpiChecked=getArrDimKpiChecked();
var provinceDetailChecked=getDetailProvinceCheckedValues();
if(provinceDetailChecked.length < 1){
$.alert("省份需选");
return;
}else if($.trim($("#descTd").val())==""){
$.alert("描述不能为空");
}
/*else if ($.trim($("#kpiWeightTd").val())==""){
$.alert("权重不能为空");
}*//*else if (arrDimKpiChecked.length < 1){
$.alert("指标需选");
}*/else if(anainfoShallSaveArr.length < 1){
return;
}else if(anainfoShallSaveArr.length < 1){
$.alert("指标需选");
return;
}
else{
......@@ -399,6 +414,7 @@
success: function(data){
$.alert(data);
sumkpiWeightTdVal=0.00;
setTimeout(function () {
location.href="${ctx}/MonitorOperation/AssociateDiagosisConfiguration";
},2000);
......@@ -407,7 +423,6 @@
});
}
});
......@@ -638,7 +653,7 @@
});
sumkpiWeightTdVal=0.00;
// 添加 '勾选指标指标'按钮 点击事件
$("#addAnaInfo").click(function(){
var arrDimKpiChecked=getArrDimKpiChecked();
......@@ -655,6 +670,15 @@
$.alert("权重不能为负");
return;
}
if(kpiWeightTdVal >1.00){
$.alert("权重超值 1");
return ;
}
var k=sumkpiWeightTdVal+Number(kpiWeightTdVal);
if(k > 1.00){
$.alert("权重和 超值 1");
return;
}
// 勾选指标 的 名称 和 value
var arrDimKpiidAndNameChecked=getArrDimKpiidAndNameChecked();
......@@ -677,8 +701,10 @@
}
});
$("#kpiWeightTd").val('');
sumkpiWeightTdVal+=Number(kpiWeightTdVal);
var maxV=(1-Number(sumkpiWeightTdVal)).toFixed(2);
$("#kpiWeightTd").val(maxV);
//$("#kpiWeightTd").attr("max",maxV);
});
dimKpiSelected=new Array();
......
......@@ -272,7 +272,8 @@
$("#updateAnaInf").click(function () {//跟新指标按钮
$(this).hide();
// $("#kpiWeightTd").val(1-Number(sumkpiWeightTdVal));
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
$("#tr_id_dimkpi").show();
$("#tr_id_weight").show();
$("#addAnaInfo").show();
......@@ -343,7 +344,14 @@
// 更新
$("#updateAnaInfo").click(function () {
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
var kk=parseFloat((sumkpiWeightTdVal).toFixed(2));
if( kk <1.00){
$.alert("权值总和必须为1");
return;
}
return;
var kpiId_weight=getkpiIDAndWeightShallSave();
var associationId = $("#associationId").val();
......@@ -696,24 +704,37 @@
}
function deleteRow(e) {
var initK=Number($(e).parent().prev()[0].innerHTML).toFixed(2);
sumkpiWeightTdVal-=initK;
// $("#kpiWeightTd").val(1-Number(sumkpiWeightTdVal));
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
$(e).parent().parent().remove();
}
sumkpiWeightTdVal=1.00;
function updateRow(e){
var initK=Number($(e).parent().prev()[0].innerHTML).toFixed(2);
var pro=prompt("请输入",$(e).parent().prev()[0].innerHTML);
pro=$.trim(pro);
if($.isNumeric(pro)){
pro=parseFloat(pro);
pro=Number(pro);
if(pro >0){
$(e).parent().prev()[0].innerHTML=parseFloat(pro);
var k=sumkpiWeightTdVal-initK;
k=k+pro;
if(k <= 1.00){
$(e).parent().prev()[0].innerHTML=parseFloat(pro);
sumkpiWeightTdVal-=initK;
sumkpiWeightTdVal+=pro;
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
//$("#kpiWeightTd").text((1-Number(sumkpiWeightTdVal)).toFixed(2));
}
}
}
}
// '添加勾选指标' 按钮 点击事件
$("#addAnaInfo").click(function () {
// $("#kpiWeightTd").val(1-Number(sumkpiWeightTdVal));
var arrdimKpiChecked=getValueOfNamedimKpiCheck();
if(arrdimKpiChecked.length <= 0){
......@@ -721,11 +742,18 @@
return;
}
id_kpiWeightTd_value=getValueBykpiWeightTd();
if(id_kpiWeightTd_value == 0){
$.alert("权值不能为空");
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
return;
}
id_kpiWeightTd_value=Number(id_kpiWeightTd_value);
if(id_kpiWeightTd_value+Number(sumkpiWeightTdVal) > 1.00){
$.alert("权值总和 不能大于 1");
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
return;
}
var kpiId_Name=getkpiid_NameOfNamedimKpiCheck();
for(var i=0;i<kpiId_Name.length;i++){
......@@ -740,7 +768,8 @@
}
});
}
$("#kpiWeightTd").val("");
sumkpiWeightTdVal=Number(id_kpiWeightTd_value)+Number(sumkpiWeightTdVal);
$("#kpiWeightTd").val(parseFloat((1-sumkpiWeightTdVal).toFixed(2)));
});
......@@ -762,7 +791,7 @@
}
function getValueBykpiWeightTd(){
var val=$("#kpiWeightTd").val();
return Number(val);
return parseFloat(val);
}
$("#modelReset").click(function(){
window.location.reload();
......@@ -770,6 +799,8 @@
});
//删除所有参数
function deleteAllTr(){
sumkpiWeightTdVal=0.00;
$("#kpiWeightTd").val(1.00);
$("#addTr").empty();
}
......
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