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