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

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

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