|
|
@ -153,9 +153,18 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="index_massage">
|
|
|
|
<div class="index_massage">
|
|
|
|
<div class="table_title"></div>
|
|
|
|
<div class="table_title"></div>
|
|
|
|
<IndexmassageOne v-show="this.level ==='1'" ref="indexmassageOne"></IndexmassageOne>
|
|
|
|
<IndexmassageOne
|
|
|
|
<IndexmassageTwo v-show="this.level === '2'" ref="indexmassageTwo"></IndexmassageTwo>
|
|
|
|
v-show="this.level === '1'"
|
|
|
|
<IndexmassageThree v-show="this.level === '3'" ref="indexmassageThree"></IndexmassageThree>
|
|
|
|
ref="indexmassageOne"
|
|
|
|
|
|
|
|
></IndexmassageOne>
|
|
|
|
|
|
|
|
<IndexmassageTwo
|
|
|
|
|
|
|
|
v-show="this.level === '2'"
|
|
|
|
|
|
|
|
ref="indexmassageTwo"
|
|
|
|
|
|
|
|
></IndexmassageTwo>
|
|
|
|
|
|
|
|
<IndexmassageThree
|
|
|
|
|
|
|
|
v-show="this.level === '3'"
|
|
|
|
|
|
|
|
ref="indexmassageThree"
|
|
|
|
|
|
|
|
></IndexmassageThree>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -176,7 +185,7 @@ export default {
|
|
|
|
IndexTable,
|
|
|
|
IndexTable,
|
|
|
|
IndexmassageOne,
|
|
|
|
IndexmassageOne,
|
|
|
|
IndexmassageTwo,
|
|
|
|
IndexmassageTwo,
|
|
|
|
IndexmassageThree
|
|
|
|
IndexmassageThree,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -196,6 +205,7 @@ export default {
|
|
|
|
rate_eight: "",
|
|
|
|
rate_eight: "",
|
|
|
|
rate_nine: "",
|
|
|
|
rate_nine: "",
|
|
|
|
}, // 综合指数计算表单数据
|
|
|
|
}, // 综合指数计算表单数据
|
|
|
|
|
|
|
|
all_data: "",
|
|
|
|
disabled: true,
|
|
|
|
disabled: true,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -211,29 +221,28 @@ export default {
|
|
|
|
save_form() {
|
|
|
|
save_form() {
|
|
|
|
// 求总和
|
|
|
|
// 求总和
|
|
|
|
this.btn_loading = true;
|
|
|
|
this.btn_loading = true;
|
|
|
|
const all_data =
|
|
|
|
this.all_data = 0; // 每次计算的时候清空总和
|
|
|
|
Number(this.form.rate_one) +
|
|
|
|
const num_arr = [
|
|
|
|
Number(this.form.rate_two) +
|
|
|
|
this.form.rate_one,
|
|
|
|
Number(this.form.rate_three) +
|
|
|
|
this.form.rate_two,
|
|
|
|
Number(this.form.rate_four) +
|
|
|
|
this.form.rate_three,
|
|
|
|
Number(this.form.rate_five) +
|
|
|
|
this.form.rate_four,
|
|
|
|
Number(this.form.rate_six) +
|
|
|
|
this.form.rate_five,
|
|
|
|
Number(this.form.rate_seven) +
|
|
|
|
this.form.rate_six,
|
|
|
|
Number(this.form.rate_eight) +
|
|
|
|
this.form.rate_seven,
|
|
|
|
Number(this.form.rate_nine);
|
|
|
|
this.form.rate_eight,
|
|
|
|
console.log("all_data", all_data);
|
|
|
|
this.form.rate_nine,
|
|
|
|
if (
|
|
|
|
];
|
|
|
|
Number(this.form.rate_one) > 0 &&
|
|
|
|
console.log("num_arr", num_arr);
|
|
|
|
Number(this.form.rate_two) > 0 &&
|
|
|
|
for (let i = 0; i < num_arr.length; i++) {
|
|
|
|
Number(this.form.rate_three) > 0 &&
|
|
|
|
if (String(num_arr[i]).indexOf(".") <= 1) {
|
|
|
|
Number(this.form.rate_four) > 0 &&
|
|
|
|
this.all_data += Number(num_arr[i]);
|
|
|
|
Number(this.form.rate_five) > 0 &&
|
|
|
|
}
|
|
|
|
Number(this.form.rate_six) > 0 &&
|
|
|
|
}
|
|
|
|
Number(this.form.rate_seven) > 0 &&
|
|
|
|
if (isNaN(this.all_data) || this.all_data.toFixed(2) != 1) {
|
|
|
|
Number(this.form.rate_eight) > 0 &&
|
|
|
|
this.$message.warning("保存失败,各指标占比应大于等于0且总和应等于1");
|
|
|
|
Number(this.form.rate_nine) > 0 &&
|
|
|
|
this.btn_loading = false;
|
|
|
|
all_data === 1
|
|
|
|
} else {
|
|
|
|
) {
|
|
|
|
|
|
|
|
const obj = {
|
|
|
|
const obj = {
|
|
|
|
calculation: [
|
|
|
|
calculation: [
|
|
|
|
{ indexName: "内部治安管理", rate: this.form.rate_one, sort: "1" },
|
|
|
|
{ indexName: "内部治安管理", rate: this.form.rate_one, sort: "1" },
|
|
|
@ -271,13 +280,14 @@ export default {
|
|
|
|
console.log(res);
|
|
|
|
console.log(res);
|
|
|
|
this.btn_loading = false;
|
|
|
|
this.btn_loading = false;
|
|
|
|
this.btn_flag = true;
|
|
|
|
this.btn_flag = true;
|
|
|
|
|
|
|
|
this.$message.success("保存成功");
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
.catch((err) => {
|
|
|
|
console.log(err);
|
|
|
|
console.log(err);
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.warning("保存失败,各指标占比应大于等于0且总和应等于1");
|
|
|
|
|
|
|
|
this.btn_loading = false;
|
|
|
|
this.btn_loading = false;
|
|
|
|
|
|
|
|
this.btn_flag = true;
|
|
|
|
|
|
|
|
this.$message.warning("保存失败");
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 取消修改综合指数 text_form
|
|
|
|
// 取消修改综合指数 text_form
|
|
|
@ -305,7 +315,7 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
back(back) {
|
|
|
|
back(back) {
|
|
|
|
this.level = back.level
|
|
|
|
this.level = back.level;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|