| | |
| | | <template> |
| | | <CompGenericWrapper type="dialog"> |
| | | <CompGenericWrapper type="dialog" append-to-body> |
| | | <template #content> |
| | | <div class="main-container"> |
| | | <el-form |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="onSubmit" v-show="!readonly" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="onCancel" v-show="!readonly" |
| | | >取消</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-row justify="end"> |
| | | <el-button |
| | | type="primary" |
| | | @click="onSubmit" |
| | | v-show="!readonly" |
| | | :loading="loading" |
| | | >保存</el-button |
| | | > |
| | | <el-button @click="onCancel" v-show="!readonly">取消</el-button> |
| | | </el-row> |
| | | <ArbitraryPhoto |
| | | :max-select="maxSelectImgCount - fileList.length" |
| | | v-model:dialog-visible="anyPhotoDialog" |
| | |
| | | </CompGenericWrapper> |
| | | </template> |
| | | <script> |
| | | import CompGenericWrapper from './CompGenericWrapper.vue'; |
| | | import ArbitraryPhoto from './ArbitraryPhoto.vue'; |
| | | import CompLedgerPhoto from './CompLedgerPhoto.vue'; |
| | | import CompDevicePhoto from './CompDevicePhoto.vue'; |
| | |
| | | components: { |
| | | ArbitraryPhoto, |
| | | CompDevicePhoto, |
| | | CompLedgerPhoto, |
| | | CompGenericWrapper |
| | | CompLedgerPhoto |
| | | }, |
| | | props: { |
| | | readonly: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | // fixme 2024.11.20 子组件初始化时机问题 |
| | | initPropsCount: 0, |
| | | // 初始预览图片index |
| | | initialIndex: -1, |
| | |
| | | { id: 0, label: '监控设备' }, |
| | | { id: 1, label: '治理设备' }, |
| | | { id: 2, label: '生产设备' } |
| | | ] |
| | | ], |
| | | loading: false |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | districtCode: this.topTask.districtcode |
| | | }; |
| | | problemApi.fetchProblemType(data).then((res) => { |
| | | this.problemTypeList = res.data; |
| | | this.problemTypeList = res; |
| | | |
| | | if (this.type == 1) { |
| | | let currProName = String(this.problem.problemname); |
| | |
| | | onProAdviseEditChange(value) {}, |
| | | onProTypeChange(value) { |
| | | // 默认问题描述和问题建议为第一个 |
| | | this.currProTypeGuid = this.descriptionOptions[0].guid; |
| | | this.deepCopyProblem.description = this.descriptionOptions[0].description; |
| | | this.onProDesChange(this.deepCopyProblem.description); |
| | | this.onProDesChange(this.descriptionOptions[0].description); |
| | | this.deepCopyProblem.advice = this.adviseOptions[0].adName; |
| | | this.deepCopyProblem._adviseEdit = this.deepCopyProblem.advice; |
| | | }, |
| | |
| | | onProDesChange(value) { |
| | | let currPro = this.findProByProDesName(value); |
| | | this.currProTypeGuid = currPro.guid; |
| | | // this.deepCopyProblem.description = currPro.description; |
| | | this.deepCopyProblem.description = currPro.description; |
| | | this.deepCopyProblem.ptguid = this.currProTypeGuid; |
| | | this.changeProblemname(); |
| | | var adName = |
| | | this.adviseOptions.length == 0 ? '' : this.adviseOptions[0].adName; |
| | |
| | | return true; |
| | | }, |
| | | onCancel() { |
| | | this.$emit("cancel") |
| | | this.$emit('cancel'); |
| | | this.$emit('update:visible', false); |
| | | }, |
| | | onSubmit() { |
| | | this.loading = true; |
| | | this.$refs.formRef.validate((valid) => { |
| | | if (valid && this.pictureValidate()) { |
| | | // 数据准备 |
| | |
| | | }); |
| | | if (this.type == 1) { |
| | | let deleteImgCopy = this.deleteImg; |
| | | fileUtil.getImageFiles(picUrls, function (files) { |
| | | fileUtil.getImageFiles(picUrls, (files) => { |
| | | data.append('deleteImg', deleteImgCopy); |
| | | deepCopyPro.advise = deepCopyPro.advice; |
| | | deepCopyPro.advise = deepCopyPro._adviseEdit; |
| | | delete deepCopyPro['advice']; |
| | | delete deepCopyPro['mediafileList']; |
| | | delete deepCopyPro['description']; |
| | |
| | | files.forEach((image) => { |
| | | data.append('images', image); |
| | | }); |
| | | problemApi.updateProblem(data).then((res) => {}); |
| | | problemApi |
| | | .updateProblem(data) |
| | | .then((res) => { |
| | | this.$emit('submit', false); |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }); |
| | | this.$emit('submit', false); |
| | | } else { |
| | | const deepCopySubTask = useCloned(this.subtask).cloned.value; |
| | | const that = this; |
| | | fileUtil.getImageFiles(picUrls, function (files) { |
| | | fileUtil.getImageFiles(picUrls, (files) => { |
| | | deepCopyPro.insGuid = deepCopySubTask.insGuid; |
| | | delete deepCopyPro['description']; |
| | | deepCopyPro.proName = deepCopyPro.problemname; |
| | | delete deepCopyPro['problemname']; |
| | | deepCopyPro.ptGuid = that.findProTypeByGuid( |
| | | that.currProTypeGuid |
| | | ).guid; |
| | | deepCopyPro.ptGuid = this.currProTypeGuid; |
| | | delete deepCopyPro['ptguid']; |
| | | deepCopyPro.locationId = deepCopyPro.locationid; |
| | | delete deepCopyPro['locationid']; |
| | | delete deepCopyPro['_adviseEdit']; |
| | |
| | | files.forEach((image) => { |
| | | data.append('images', image); |
| | | }); |
| | | problemApi.newProblem(data).then((res) => {}); |
| | | problemApi |
| | | .newProblem(data) |
| | | .then((res) => { |
| | | this.$emit('submit', true); |
| | | }) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }); |
| | | this.$emit('submit', true); |
| | | } |
| | | } |
| | | }); |
| | |
| | | .row { |
| | | width: 100%; |
| | | } |
| | | ::v-deep .el-upload-list--picture-card .el-upload-list__item-thumbnail { |
| | | :deep(.el-upload-list--picture-card .el-upload-list__item-thumbnail) { |
| | | object-fit: cover !important; |
| | | } |
| | | .preview-pic { |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | ::v-deep .el-upload--picture-card { |
| | | :deep(.el-upload--picture-card) { |
| | | display: none; |
| | | } |
| | | /* 隐藏el-upload上传成功组件 */ |
| | | ::v-deep .el-upload-list__item-status-label { |
| | | :deep(.el-upload-list__item-status-label) { |
| | | display: none !important; |
| | | } |
| | | </style> |