fix: 安全教育培训列表显示BUG修改

This commit is contained in:
kun 2024-06-29 20:37:26 +08:00
parent b8d828d148
commit ab25ce7c04

View File

@ -703,32 +703,32 @@ export default {
},
getWorkerData(data) {
//
var arr = this.cardForm.list;
var arr2 = [];
data.forEach((item2) => {
for(let i = 0;i<data.length;i++){
if (arr.length > 0) {
var onoff = true;
arr.forEach((item) => {
if (item.id == item2.id) {
for(let x = 0;x<arr.length;x++){
if (arr[x].id == data[i].id) {
onoff = false;
break;
}
if (item.workerId == item2.id) {
if (arr[x].workerId == data[i].id) {
onoff = false;
break;
}
});
}
if (onoff) {
item2.isQualified = "";
item2.score = "";
arr2.push(item2);
data[i].isQualified = "";
data[i].score = "";
arr2.push(data[i]);
}
} else {
item2.isQualified = "";
item2.score = "";
arr2.push(item2);
data[i].isQualified = "";
data[i].score = "";
arr2.push(data[i]);
}
});
}
this.cardForm.list = arr.concat(arr2);
// this.cardForm.workernum = this.cardForm.list.length;
},
@ -830,14 +830,13 @@ export default {
return;
}
this.cardForm.workernum = this.cardForm.list.length;
let json = this.cardForm;
let json = {...this.cardForm};
let arr = [];
console.log(json.list);
json.list.forEach((element) => {
let item = {
isQualified: element.isQualified,
score: element.score,
workerId: element.id,
workerId: element.workerId || element.id,
projectSn: this.$store.state.projectSn,
};
if (!this.isAdd) {