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