fix: BUG修改

This commit is contained in:
kun 2024-05-05 18:38:51 +08:00
parent 2f8967a956
commit d6d2c337be
2 changed files with 35 additions and 4 deletions

View File

@ -3395,6 +3395,7 @@ export default {
projectSn: this.$store.state.projectSn,
workerId: this.userId,
state: "",
photoUrl: "",
fileList: [],
insuranceState: true,
};

View File

@ -1933,14 +1933,14 @@
v-if="scope.row.insuranceState"
class="upload-demo"
:action="uploadUrl"
:on-preview="(file) => handlePreview(file, 6)"
:on-preview="(file) => handlePreview(file, 7)"
:on-remove="
(file) =>
handleRemove({ file: file, index: scope.$index }, 6)
handleRemove({ file: file, index: scope.$index }, 7)
"
:on-success="
(file) =>
handleSuccess({ file: file, index: scope.$index }, 6)
handleSuccess({ file: file, index: scope.$index }, 7)
"
:limit="5"
name="files"
@ -1954,7 +1954,7 @@
v-else
v-for="(item, index) in scope.row.fileList"
@click="
handlePreview({ url: item.url }, { name: item.name }, 6)
handlePreview({ url: item.url }, { name: item.name }, 7)
"
:key="index"
style="cursor: pointer"
@ -2869,6 +2869,12 @@ export default {
data.workerInfo.insuranceInfo = JSON.parse(data.workerInfo.insuranceInfo)
data.workerInfo.insuranceInfo.forEach((item) => {
item.insuranceState = false; //
if (item.photoUrl) {
let arr = item.photoUrl.split("*");
item.fileList = [{ name: arr[0], url: arr[1] }];
} else {
item.fileList = [];
}
});
this.insuranceList = data.workerInfo.insuranceInfo; //
}
@ -3111,6 +3117,14 @@ export default {
file.file.data[0].fileInfo.originalFilename + "*" + file.file.data[0].imageUrl;
} else if (type == 6) {
this.workerInfo.idCardBigPhotoUrl = file.data[0].imageUrl;
} else if(type == 7){
let data = {
name: file.file.data[0].fileInfo.originalFilename,
url: file.file.data[0].imageUrl,
};
this.insuranceList[file.index].fileList = [data];
this.insuranceList[file.index].photoUrl =
file.file.data[0].fileInfo.originalFilename + "*" + file.file.data[0].imageUrl;
}
},
//
@ -3310,6 +3324,9 @@ export default {
} else if (type == 5) {
this.certificateList[file.index].fileList = [];
this.certificateList[file.index].photoUrl = "";
} else if (type == 7) {
this.insuranceList[file.index].fileList = [];
this.insuranceList[file.index].photoUrl = "";
}
},
@ -3464,6 +3481,8 @@ export default {
projectSn: this.$store.state.projectSn,
workerId: this.userId,
state: "",
photoUrl: "",
fileList: [],
insuranceState: true,
};
this.insuranceList.push(data);
@ -3517,6 +3536,17 @@ export default {
if (this.isNew == true) {
this.insuranceList.splice(index, 1)
} else {
if (data.workerInfo.insuranceList) {
JSON.parse(data.workerInfo.insuranceList).forEach((item) => {
item.insuranceState = false; //
if (item.photoUrl) {
let arr = item.photoUrl.split("*");
item.fileList = [{ name: arr[0], url: arr[1] }];
} else {
item.fileList = [];
}
});
}
this.insuranceList[index].insuranceState = false;
}
} else if (type == 4) {