Przeglądaj źródła

fix: 修复表单提交时未清除整改建议的问题

修复表单重置时未正确清除整改建议字段的问题,改用$set确保响应式更新
huoyi 2 miesięcy temu
rodzic
commit
92ff444c63
1 zmienionych plików z 6 dodań i 4 usunięć
  1. 6 4
      src/pages/checklist/index.vue

+ 6 - 4
src/pages/checklist/index.vue

@@ -91,7 +91,8 @@
91 91
                                     <text class="upload-title">上传不合格图片</text>
92 92
                                     <uni-file-picker v-model="formData.baseAttachmentList" limit="8" title="最多上传8张"
93 93
                                         style="height: 350rpx;" :image-styles="imageStyles" fileMediatype="image"
94
-                                        mode="grid" @select="onSelect" :disabled="formDisabled" :readonly="formDisabled"/>
94
+                                        mode="grid" @select="onSelect" :disabled="formDisabled"
95
+                                        :readonly="formDisabled" />
95 96
                                 </view>
96 97
                             </view>
97 98
                         </h-collapse-item>
@@ -142,7 +143,7 @@ import TextSwitch from "@/components/text-switch/text-switch.vue"
142 143
 import { checkedLevelEnums } from "@/utils/enums.js"
143 144
 import UnqualifiedPersonnel from "./components/unqualified.vue"
144 145
 import { treeSelectByType } from "@/api/system/common"
145
-import { buildTeamOptions, buildDepartmentOptions, buildBrigadeOptions,buildManagerOptions } from '@/utils/common'
146
+import { buildTeamOptions, buildDepartmentOptions, buildBrigadeOptions, buildManagerOptions } from '@/utils/common'
146 147
 import useDictMixin from '@/utils/dict'
147 148
 import { getDeptRoleUser } from "@/api/check/checklist.js"
148 149
 import { addDraftInspection, submitInspection, getInspectionListById } from '@/api/check/checkReward.js'
@@ -391,7 +392,8 @@ export default {
391 392
             // 清空整改要求数据
392 393
             this.formData.responsibleUserId = '';
393 394
             this.formData.rectificationDeadline = '';
394
-            this.formData.rectificationSuggestions = '';
395
+            //  this.formData.rectificationSuggestions = '';
396
+            this.$set(this.formData, 'rectificationSuggestions', '')
395 397
 
396 398
             // 重置相关字段
397 399
             this.formData.checkedTeamName = '';
@@ -792,7 +794,7 @@ export default {
792 794
         // 提交表单
793 795
         submitForm() {
794 796
             this.$refs.form.validate().then(res => {
795
-
797
+                debugger
796 798
                 // 检查所有不合格项是否都填写了相关人员
797 799
                 let hasError = false;
798 800
                 let errorMessage = '';