Commit b32e612c authored by 姬鋆屾's avatar 姬鋆屾

fixed:提交绩效汇总备注2最后一级删除数据无法覆盖的问题

parent c60cb8d2
......@@ -76,10 +76,12 @@ export default {
this.urls.currUrl.indexOf("attendance/leave/record") == 0
? (data.processStatus = 2)
: "";
data.remarkAdd = data.remarkAdd.filter((v) => v.name != "");
if (data.remarkAdd && data.remarkAdd.length > 0) {
data.remarkAdd = JSON.stringify(data.remarkAdd);
} else {
data.remarkAdd = "--";
}
console.log(data);
data.remark == "迟到:0 次,\n早退:0 次,\n缺卡:0 次,\n请假:0 次"
? (data.remark = "")
: "";
......
......@@ -143,7 +143,6 @@
<i
class="el-icon-remove-outline"
@click="handleRemove(i)"
v-if="form.remarkAdd.length > 1 && i != 0"
style="
width: 100%;
height: 100%;
......@@ -216,12 +215,12 @@ export default {
this.form.remarkAdd && this.form.remarkAdd.length > 0
? this.form.remarkAdd.forEach((v) => {
v.score ? v.score : (v.score = 0);
this.form.addTotalScore += v.score;
if (v.name && v.name != "") {
v.score ? v.score : (v.score = 0);
this.form.addTotalScore += v.score;
}
})
: "";
console.log(this.form.remarkAdd);
this.form.addTotalScore = this.form.addTotalScore.toFixed(2);
this.$forceUpdate();
},
......@@ -232,9 +231,18 @@ export default {
});
},
handleRemove(i) {
this.form.remarkAdd = this.form.remarkAdd.filter(
(v, index) => index != i
);
if (i == 0 && this.form.remarkAdd.length == 1) {
this.form.remarkAdd = [
{
name: "",
score: 0,
},
];
} else {
this.form.remarkAdd = this.form.remarkAdd.filter(
(v, index) => index != i
);
}
this.handleBlur();
},
handleClear(val) {
......
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