Przeglądaj źródła

优化弹窗打开逻辑并修复表单校验规则及单位显示问题

yusheng 5 miesięcy temu
rodzic
commit
530b1c8f1b

+ 3 - 1
src/components/workList/wokePopup.vue

@@ -35,7 +35,9 @@
     methods: {
       open(ids) {
         this.visible = true;
-        this.$refs.wokePopupListRef.open(ids);
+        this.$nextTick(() => {
+          this.$refs.wokePopupListRef.open(ids);
+        });
       },
 
       openTwo(req) {

+ 1 - 1
src/views/inspectionTemplate/AddorUpdate.vue

@@ -237,7 +237,7 @@
                 message: ' ',
                 trigger: 'change'
               }"
-              :prop="'inspectionItemVOList.' + $index + '.defaultValue'"
+              :prop="'inspectionItemVOList.' + $index + (row.textType == 3 ? '.minValue' : '.defaultValue')"
             >
               <div style="width: 100%; display: flex">
                 <DictSelection

+ 12 - 3
src/views/sample/sampleRecord/components/addSample.vue

@@ -132,7 +132,7 @@
         :selection.sync="selection"
       >
         <template v-slot:toolbar>
-          累计请样数量:{{ workSampleQuantity }}{{ sampleList[0]?.measureUnit }}
+          累计请样数量:{{ workSampleQuantity }}{{ sampleList[0]?.measureUnit||form.measureUnit }}
         </template>
       </ele-pro-table>
       <header-title title="请样信息"> </header-title>
@@ -645,6 +645,7 @@
         });
       },
       async init(row) {
+        let isPackingUnit = false;
         let data = await samplingRecordsPage({
           qualityWorkOrderId: row.id
         });
@@ -666,10 +667,15 @@
 
           if (!list1?.length) {
             this.form.isFirstSampling = 1;
+            isPackingUnit = true;
+            if (this.form.conditionType == 1) {
+              this.$set(this.form, 'packingUnit', '111');
+            }
           } else {
             this.$set(this.form, 'unit', list1[0].unit);
+            this.$set(this.form, 'measureUnit', list1[0].measureUnit);
           }
-          await this.datasource(list1[0]?.unit);
+          await this.datasource(list1[0]?.unit, isPackingUnit);
           await this.queryQualityTempleContent(
             !list1.length && row.qualityMode == 1
           );
@@ -740,7 +746,7 @@
       changeParent(row) {
         this.init(row);
       },
-      async datasource(unit) {
+      async datasource(unit, isPackingUnit) {
         const res = await queryQualityInventory({
           qualityWorkerId: this.form.qualityWorkOrderId,
           pageNum: 1,
@@ -770,6 +776,9 @@
             listArr.find((item) => unit == item.conversionUnit)?.id
           );
         }
+        if (isPackingUnit) {
+          this.$set(this.form, 'unit', res.list[0]?.measureUnit);
+        }
         this.form.pleaseUnit = res.list[0]?.measureUnit;
         res.list.map((el) => {
           el.weightProportion = el.weight

+ 53 - 53
src/views/unqualifiedProduct/unqualifiedList/components/order-search.vue

@@ -5,58 +5,58 @@
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      statusList: [
-        { name: '待处理', code: 0 },
-        { name: '处理中', code: 1 },
-        { name: '已处理', code: 2 }
-      ]
-    };
-  },
-  computed: {
-    seekList() {
-      return [
-        {
-          label: '来源编码:',
-          value: 'sourceCode',
-          type: 'input',
-          placeholder: '请输入'
-        },
-        {
-          label: '编码:',
-          value: 'unqualifiedProductsCode',
-          type: 'input',
-          placeholder: '请输入'
-        },
-        {
-          label: '创建人:',
-          value: 'reviewerName',
-          type: 'input',
-          placeholder: '请输入'
-        },
-        {
-          label: '工序:',
-          value: 'taskName',
-          type: 'input',
-          placeholder: '请输入'
-        },
-        
-        {
-          label: '状态:',
-          value: 'status',
-          type: 'select',
-          placeholder: '请选择',
-          planList: this.statusList
-        }
-      ];
-    }
-  },
-  methods: {
-    search(e) {
-      this.$emit('search', { ...e });
+  export default {
+    data() {
+      return {
+        statusList: [
+          { name: '待处理', code: 0 },
+          { name: '处理中', code: 1 },
+          { name: '已处理', code: 2 }
+        ]
+      };
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '来源编码:',
+            value: 'sourceCode',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '编码:',
+            value: 'unqualifiedProductsCode',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '创建人:',
+            value: 'reviewerName',
+            type: 'input',
+            placeholder: '请输入'
+          },
+          {
+            label: '工序:',
+            value: 'taskName',
+            type: 'input',
+            placeholder: '请输入'
+          },
+
+          {
+            label: '状态:',
+            value: 'status',
+            placeholder: '请选择',
+            type: 'DictSelection',
+            dictName: '处置状态'
+          }
+        ];
+      }
+    },
+    methods: {
+      search(e) {
+        this.$emit('search', { ...e });
+      }
     }
-  }
-};
+  };
 </script>