408249787@qq.com 15 小時之前
父節點
當前提交
d49a20332d
共有 2 個文件被更改,包括 7 次插入3 次删除
  1. 5 3
      pages/service-add/service-add.vue
  2. 2 0
      pages/service-detail/service-detail.vue

+ 5 - 3
pages/service-add/service-add.vue

@@ -40,7 +40,7 @@
 				</u-form-item> -->
                 <u-form-item label="工单类别" required prop="category" :label-width="150">
                     <u-input v-model="category" disabled @click="categoryState = true" type="select" />
-                    <u-select v-model="categoryState" :list="categoryMap" @confirm="categorySubmit"></u-select>
+                    <m-select v-model="categoryState" :list="categoryMap" @confirm="categorySubmit"></m-select>
                 </u-form-item>
                 <u-form-item label="是否停机" required prop="halt" :label-width="150">
                     <u-input v-model="form.halt" disabled @click="haltState = true" placeholder="请选择是否停机"
@@ -297,8 +297,10 @@ export default {
                 })
                 .then((res) => {
                     this.form.no = res.data.no;
-                    this.form.category = res.data.category
-                    this.category = this.categoryMap.find(item => item.value == res.data.category).label
+                    // 后端返回的 category 为数字,校验规则按字符串校验,统一转字符串,与手动选择赋值类型一致
+                    this.form.category = res.data.category != null ? String(res.data.category) : ''
+                    const categoryItem = this.categoryMap.find(item => item.value == res.data.category)
+                    this.category = categoryItem ? categoryItem.label : ''
                     this.form.userName = res.data.userName;
                     this.form.repairMinutes = res.data.minutes
                     this.form.repairRemark = res.data.repairRemark

+ 2 - 0
pages/service-detail/service-detail.vue

@@ -288,6 +288,7 @@ export default {
         },
         // 提交审批验收
         handleExamine() {
+            const that = this
             uni.showModal({
                 title: '提示',
                 content: '确认提交审核?',
@@ -299,6 +300,7 @@ export default {
                             })
                             .then(res => {
                                 that.infoData.status = that.$DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT
+                                that.initData()
                                 that.toastSuccess('已提交,请等待审核')
                             })
                     }