diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index 4d807f4..5f03cb9 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -251,7 +251,7 @@ - {{ item.hdTermName }} + {{ item.hdTermName||item.dangerProblem }} @@ -312,17 +312,20 @@ - + - + - + @@ -700,9 +703,16 @@ // console.log(this.hiddenDangerList2) if (v.hdPic) { - this.fileList = [{ - url: v.hdPic - }]; + this.fileList = []; + let arr = [] + try { + arr=v.hdPic.split(',') + } catch (error) { + console.error(error) + } + for (let item of arr) { + this.fileList.push({ url: item, name: '' }) + } } else { this.fileList = []; } @@ -725,7 +735,7 @@ this.fileList = []; }, addFL() { - if(this.type == 'add'){ + if (this.type == 'add') { return false } this.showProblemTreeSelect = true; @@ -921,6 +931,15 @@ } }, investigationHandle2() { + let hdPic = '' + for (let i = 0; i < this.fileList.length; i++) { + if (i == this.fileList.length - 1) { + hdPic += this.fileList[i].url + } else { + hdPic += this.fileList[i].url + ',' + } + + } if (this.hiddenDangerList2.length > 0) { let form = { bigCategory: this.hiddenDangerList2[0].id, @@ -930,7 +949,7 @@ hdTerm: this.hiddenDangerList2[2].id, hdTermName: this.hiddenDangerList2[2].itemname, hdDesc: this.describe.hdDesc, - hdPic: this.fileList.length > 0 ? this.fileList : '', + hdPic: hdPic, hdInfo: this.describe.hdInfo, dangerProblem: this.hiddenDangerList2[0].itemname + '/' + this.hiddenDangerList2[1].itemname + '/' + this.hiddenDangerList2[2].itemname @@ -1008,14 +1027,14 @@ status: "uploading", message: "上传中", }); - const result = await this.uploadFilePromise(this[key][0].url); + const result = await this.uploadFilePromise(event.file.url); const resultInfo = JSON.parse(result); const index = this[key].findIndex((v) => v.id === id); if (resultInfo.code == 200) { this[key].splice( index, 1, - Object.assign(this[key][0], { + Object.assign(event.file, { status: "success", message: "", result: resultInfo, @@ -1028,10 +1047,7 @@ this[key].splice( index, 1, - Object.assign(this[key][0], { - status: "error", - message: "失败", - }) + ); } }, @@ -1142,11 +1158,11 @@ } else { this.$.toast("暂存成功"); } - setTimeout(() => { - uni.navigateBack({ - delta: 2, // 默认值是1,表示返回的页面层数 - }); - }, 1000); + // setTimeout(() => { + // uni.navigateBack({ + // delta: 2, // 默认值是1,表示返回的页面层数 + // }); + // }, 1000); // this.data = res.result; // this.rname = this.data[0].name;