From a19e6b1a393cf9febc55831ac96e5f5551d231af Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 05 十一月 2025 13:55:57 +0800
Subject: [PATCH] 1. 修复问题修改界面修改问题后,问题的id未同步更新的问题; 2. 修复删除问题时,列表属性错误的问题
---
src/views/fysp/check/components/CompProblemAddOrUpd.vue | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/src/views/fysp/check/components/CompProblemAddOrUpd.vue b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
index bc0ee30..5bf78fb 100644
--- a/src/views/fysp/check/components/CompProblemAddOrUpd.vue
+++ b/src/views/fysp/check/components/CompProblemAddOrUpd.vue
@@ -165,7 +165,11 @@
</el-form-item>
</el-form>
<el-row justify="end">
- <el-button type="primary" @click="onSubmit" v-show="!readonly"
+ <el-button
+ type="primary"
+ @click="onSubmit"
+ v-show="!readonly"
+ :loading="loading"
>淇濆瓨</el-button
>
<el-button @click="onCancel" v-show="!readonly">鍙栨秷</el-button>
@@ -314,7 +318,8 @@
{ id: 0, label: '鐩戞帶璁惧' },
{ id: 1, label: '娌荤悊璁惧' },
{ id: 2, label: '鐢熶骇璁惧' }
- ]
+ ],
+ loading: false
};
},
watch: {
@@ -532,9 +537,7 @@
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;
},
@@ -550,7 +553,8 @@
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;
@@ -588,6 +592,7 @@
this.$emit('update:visible', false);
},
onSubmit() {
+ this.loading = true;
this.$refs.formRef.validate((valid) => {
if (valid && this.pictureValidate()) {
// 鏁版嵁鍑嗗
@@ -616,10 +621,7 @@
let deleteImgCopy = this.deleteImg;
fileUtil.getImageFiles(picUrls, (files) => {
data.append('deleteImg', deleteImgCopy);
- deepCopyPro.advise = deepCopyPro.advice;
- deepCopyPro.ptGuid = this.findProTypeByGuid(
- this.currProTypeGuid
- ).guid;
+ deepCopyPro.advise = deepCopyPro._adviseEdit;
delete deepCopyPro['advice'];
delete deepCopyPro['mediafileList'];
delete deepCopyPro['description'];
@@ -630,9 +632,14 @@
files.forEach((image) => {
data.append('images', image);
});
- problemApi.updateProblem(data).then((res) => {
- this.$emit('submit', false);
- });
+ problemApi
+ .updateProblem(data)
+ .then((res) => {
+ this.$emit('submit', false);
+ })
+ .finally(() => {
+ this.loading = false;
+ });
});
} else {
const deepCopySubTask = useCloned(this.subtask).cloned.value;
@@ -641,9 +648,8 @@
delete deepCopyPro['description'];
deepCopyPro.proName = deepCopyPro.problemname;
delete deepCopyPro['problemname'];
- deepCopyPro.ptGuid = this.findProTypeByGuid(
- this.currProTypeGuid
- ).guid;
+ deepCopyPro.ptGuid = this.currProTypeGuid;
+ delete deepCopyPro['ptguid'];
deepCopyPro.locationId = deepCopyPro.locationid;
delete deepCopyPro['locationid'];
delete deepCopyPro['_adviseEdit'];
@@ -652,9 +658,14 @@
files.forEach((image) => {
data.append('images', image);
});
- problemApi.newProblem(data).then((res) => {
- this.$emit('submit', true);
- });
+ problemApi
+ .newProblem(data)
+ .then((res) => {
+ this.$emit('submit', true);
+ })
+ .finally(() => {
+ this.loading = false;
+ });
});
}
}
--
Gitblit v1.9.3