From 20557b8c3fc41f2b039fadbba8f0ce8ddc2896d5 Mon Sep 17 00:00:00 2001 From: weikai <123456> Date: Wed, 9 Dec 2020 19:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90pc=E7=AB=AF=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=AE=9E=E4=BD=93=E5=8C=96=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E3=80=91-=E3=80=90=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=91-=EF=BC=88=E9=AD=8F=E5=87=AF?= =?UTF-8?q?=EF=BC=89-2020/12/09?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/kpi/kpisubpositiondetail.vue | 58 +++++++++++++------ 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/src/views/modules/kpi/kpisubpositiondetail.vue b/src/views/modules/kpi/kpisubpositiondetail.vue index d17e5076..d31013fe 100644 --- a/src/views/modules/kpi/kpisubpositiondetail.vue +++ b/src/views/modules/kpi/kpisubpositiondetail.vue @@ -28,7 +28,7 @@ :file-list="item1.images" :limit=6 :on-preview="handlePictureCardPreview" - :on-remove="handleRemove" + :on-remove="(file,fileList) =>handleRemove(file,fileList, index,0,2)" :on-success="(res, file,fileList) => handleAvatarSuccess( res, file,fileList, index,index1,2)" :on-error="handelError" :before-upload="beforeAvatarUpload" @@ -48,7 +48,7 @@ :before-remove="beforeFileRemove" :file-list="item1.files" :before-upload="beforeAvatarFileUpload" - :on-remove="handleFileRemove" + :on-remove="(file,fileList) =>handleFileRemove(file,fileList, index,0,2)" :on-success="(res, file,fileList) =>handleAvatarFileSuccess( res, file,fileList, index,index1,2)" :on-error="handelError" :on-preview="handleFileCardPreview" @@ -78,7 +78,7 @@ :file-list="item.images" :limit=6 :on-preview="handlePictureCardPreview" - :on-remove="handleRemove" + :on-remove="(file,fileList) =>handleRemove(file,fileList, index,0,1)" :on-success="(res, file,fileList) => handleAvatarSuccess( res, file,fileList, index,0,1)" :on-error="handelError" :before-upload="beforeAvatarUpload" @@ -98,7 +98,7 @@ :before-remove="beforeFileRemove" :file-list="item.files" :before-upload="beforeAvatarFileUpload" - :on-remove="handleFileRemove" + :on-remove="(file,fileList) =>handleFileRemove(file,fileList, index,0,1)" :on-success="(res, file,fileList) =>handleAvatarFileSuccess( res, file,fileList, index,0,1)" :on-error="handelError" :on-preview="handleFileCardPreview" @@ -131,7 +131,7 @@ {{"返回"}} - {{ $t('confirm') }} + {{ $t('confirm') }} 初审 验收 @@ -307,14 +307,26 @@ export default { } } }, - handleRemove (file, fileList) { - for (var i = 0; i < this.dataForm.images.length; i++) { - let item = this.dataForm.images[i] - if (item.url === file.url) { - this.dataForm.images.splice(i, 1) + handleRemove (file, fileList,index,index1,type) { + if(type ===2){ + for (var i = 0; i < this.checkDiction[index].childDiction[index1].images.length; i++) { + let item = this.checkDiction[index].childDiction[index1].images[i] + if (item.url === file.url) { + this.checkDiction[index].childDiction[index1].images.splice(i, 1) + this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6 + } + this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6 } - } - this.hideUpload = this.dataForm.images.length >= 6 + }else { + for (var i = 0; i < this.checkDiction[index].images.length; i++) { + let item = this.checkDiction[index].images[i] + if (item.url === file.url) { + this.checkDiction[index].images.splice(i, 1) + } + } + this.hideUpload = this.checkDiction[index].images.length >= 6 + } + }, handlePictureCardPreview (file) { this.dialogImageUrl = file.url @@ -344,13 +356,25 @@ export default { this.checkDiction[index].files.push({ url: res.data.imgUrl, thumbnail: res.data.thumbnail, fileType: 2, fileName: res.data.fileName }) } }, - handleFileRemove (file, fileList) { - for (var i = 0; i < this.dataForm.files.length; i++) { - let item = this.dataForm.files[i] - if (item.url === file.url) { - this.dataForm.files.splice(i, 1) + handleFileRemove (file, fileList,index,index1,type) { + if (type == 2){ + for (var i = 0; i < this.checkDiction[index].childDiction[index1].files.length; i++) { + let item = this.checkDiction[index].childDiction[index1].files[i] + if (item.url === file.url) { + this.checkDiction[index].childDiction[index1].files.splice(i, 1) + } + this.hideUpload = this.checkDiction[index].childDiction[index1].images.length >= 6 + } + }else { + for (var i = 0; i < this.checkDiction[index].files.length; i++) { + let item = this.checkDiction[index].files[i] + if (item.url === file.url) { + this.checkDiction[index].images.splice(i, 1) + } + this.hideUpload = this.checkDiction[index].files.length >= 6 } } + }, beforeAvatarFileUpload (file) { this.fileloading = true