| | |
| | | <div class="t-card_item"> |
| | | 整改图片 |
| | | <div> |
| | | <el-button @click="chosePicFromAnyPic">从任意图片选取</el-button> |
| | | <!-- <el-button @click="chosePicFromAnyPic">从任意图片选取</el-button> --> |
| | | <!-- <el-button type="primary" @click="chosePicFromLedgerPic">从台账选取</el-button> --> |
| | | <el-button @click="choseChangePic">从文件夹选取</el-button> |
| | | </div> |
| | |
| | | } |
| | | }, |
| | | props: { |
| | | changeType: { |
| | | type: Number |
| | | }, |
| | | problemId: { |
| | | type: String |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | pictureValidate() { |
| | | if (this.fileList.length < 1) { |
| | | if (this.changeType == 1 && this.fileList.length < 1) { |
| | | ElMessage({ |
| | | message: '至少上传一张图片', |
| | | type: 'error' |
| | |
| | | message: '超过三张, 已删除多出的图片', |
| | | type: 'error' |
| | | }); |
| | | this.fileList = this.fileList.slice(0, 3); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | initParams() { |
| | | if (this.changeType == 0) { |
| | | return; |
| | | } |
| | | let beforeEditImgList = []; |
| | | useCloned(this.oldChangeFileList).cloned.value.forEach((oldChangeFileitem) => { |
| | | if (oldChangeFileitem.ischanged == 1) { |
| | |
| | | |
| | | const that = this; |
| | | let deleteImgCopy = this.deleteImg; |
| | | |
| | | if (this.changeType == 1) { |
| | | fileUtil.getImageFiles(picUrls, function (files) { |
| | | data.append('deleteImg', deleteImgCopy); |
| | | data.append('problemId', that.problemId); |
| | | files.forEach((image) => { |
| | | data.append('images', image); |
| | | }); |
| | | |
| | | problemApi.updateChange(data).then((res) => {}); |
| | | }); |
| | | this.$emit('submited', true); |
| | | that.$emit('submited', true); |
| | | }else { |
| | | fileUtil.getImageFiles(picUrls, function (files) { |
| | | data.append('problemId', that.problemId); |
| | | files.forEach((image) => { |
| | | data.append('images', image); |
| | | }); |
| | | problemApi.changeProblem(data).then((res) => {}); |
| | | that.$emit('submited', true); |
| | | }); |
| | | } |
| | | }, |
| | | beforeRemoveFile(file, fileList) { |
| | | if (file.remark == '已上传') { |