695593266@qq.com 3 日 前
コミット
c638cd621e

+ 31 - 0
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -851,6 +851,7 @@
           console.log('aaaaaa1', newVal);
 
           if (newVal.length) {
+            this.normalizeProductSequences(newVal);
             console.log(newVal);
             this.newList = newVal;
             // if(this.taskObj.type != 4){
@@ -1389,6 +1390,36 @@
     },
 
     methods: {
+      normalizeProductSequenceValue(value) {
+        if (value === null || value === undefined) {
+          return '';
+        }
+
+        if (typeof value !== 'string') {
+          return value;
+        }
+
+        return value.replace(/^(null|undefined)/i, '');
+      },
+
+      normalizeProductSequences(list = []) {
+        if (!Array.isArray(list)) {
+          return;
+        }
+
+        list.forEach((item) => {
+          if (!item || !item.extInfo) {
+            return;
+          }
+
+          this.$set(
+            item.extInfo,
+            'productSequence',
+            this.normalizeProductSequenceValue(item.extInfo.productSequence)
+          );
+        });
+      },
+
       async getReelSpecification() {
         await parameterGetByCode({
           code: 'dishware_specifications'

+ 12 - 0
src/views/produce/components/jobBooking/components/jobBom.vue

@@ -238,6 +238,10 @@
       warehouseList: {
         type: Array,
         default: () => []
+      },
+      beforeCreateInProduct: {
+        type: Function,
+        default: () => true
       }
     },
 
@@ -488,6 +492,10 @@
         )
           return this.$message.info('请输入不合格品数');
 
+        if (!this.beforeCreateInProduct(this.item)) {
+          return;
+        }
+
         const req = {
           formedNum: this.item.workReportInfo.formedNum,
           notFormedNum: this.item.workReportInfo.notFormedNum || 0,
@@ -515,6 +523,10 @@
         )
           return this.$message.info('请输入不合格品数');
 
+        if (!this.beforeCreateInProduct(this.item)) {
+          return;
+        }
+
         const req = {
           formedNum: this.item.workReportInfo.formedNum,
           notFormedNum: this.item.workReportInfo.notFormedNum || 0,

+ 8 - 0
src/views/produce/components/jobBooking/components/jobDdBom.vue

@@ -188,6 +188,10 @@
       warehouseList: {
         type: Array,
         default: () => []
+      },
+      beforeCreateInProduct: {
+        type: Function,
+        default: () => true
       }
     },
 
@@ -380,6 +384,10 @@
         )
           return this.$message.info('请输入不合格品数');
 
+        if (!this.beforeCreateInProduct(this.item)) {
+          return;
+        }
+
         const req = {
           formedNum: this.item.workReportInfo.formedNum,
           notFormedNum: this.item.workReportInfo.notFormedNum || 0,

+ 19 - 6
src/views/produce/components/jobBooking/index.vue

@@ -279,6 +279,7 @@
             ref="jobBomRef"
             :notFormed="item.notFormedList"
             :warehouseList="warehouseList"
+            :before-create-in-product="validateTaskReportForCreateInProduct"
           ></jobBom>
         </div>
         <div v-if="item.singleReport == 1">
@@ -287,6 +288,7 @@
             ref="jobRef"
             :notFormed="item.notFormedList"
             :warehouseList="warehouseList"
+            :before-create-in-product="validateTaskReportForCreateInProduct"
           ></jobDdBom>
         </div>
 
@@ -752,8 +754,7 @@
       },
 
       clientEnvironmentId() {
-        // return this.$store.state.user.info.clientEnvironmentId;
-        return 9;
+        return this.$store.state.user.info.clientEnvironmentId;
       }
     },
 
@@ -795,12 +796,24 @@
         }
       },
 
-      validateTaskReportForOneClick() {
+      validateTaskReportForCreateInProduct(item) {
+        return this.validateTaskReportForOneClick(item, 'createInProduct');
+      },
+
+      validateTaskReportForOneClick(
+        targetItem,
+        validateType = 'oneClickReport'
+      ) {
         if (this.clientEnvironmentId != 9) {
           return true;
         }
 
-        for (const item of this.List) {
+        const actionName =
+          validateType == 'createInProduct' ? '创建在制品' : '一键报工';
+        const quantityName =
+          validateType == 'createInProduct' ? '在制品数量' : '报工数量';
+        const list = targetItem ? [targetItem] : this.List;
+        for (const item of list) {
           const taskReportInfo = item.taskReportInfo || {};
           if (Object.keys(taskReportInfo).length == 0) {
             continue;
@@ -812,7 +825,7 @@
 
           if (taskReportInfo.reportCheck != 1) {
             this.$message.warning(
-              `工单${item.code || ''}未完成任务报工,不能一键报工`
+              `工单${item.code || ''}未完成任务报工,不能${actionName}`
             );
             return false;
           }
@@ -824,7 +837,7 @@
           const taskReportNum = Number(taskReportInfo.reportQuantity || 0);
           if (Math.abs(Number(workReportNum) - taskReportNum) > 0.000001) {
             this.$message.warning(
-              `工单${item.code || ''}报工数量需等于任务报工数量`
+              `工单${item.code || ''}${quantityName}需等于任务报工数量`
             );
             return false;
           }

+ 19 - 2
src/views/produce/components/warehousing/components/detailsBom.vue

@@ -424,7 +424,12 @@
             prop: 'extInfo.productSequence',
             label: '序列号',
             align: 'center',
-            showOverflowTooltip: true
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return this.normalizeProductSequenceValue(
+                row.extInfo && row.extInfo.productSequence
+              );
+            }
           },
           {
             minWidth: 120,
@@ -492,7 +497,19 @@
     mounted() {
       console.log(this.list, 'list');
     },
-    methods: {}
+    methods: {
+      normalizeProductSequenceValue(value) {
+        if (value === null || value === undefined) {
+          return '';
+        }
+
+        if (typeof value !== 'string') {
+          return value;
+        }
+
+        return value.replace(/^(null|undefined)/i, '');
+      }
+    }
   };
 </script>
 

+ 33 - 0
src/views/produce/components/warehousing/index.vue

@@ -496,6 +496,36 @@
     },
 
     methods: {
+      normalizeProductSequenceValue(value) {
+        if (value === null || value === undefined) {
+          return '';
+        }
+
+        if (typeof value !== 'string') {
+          return value;
+        }
+
+        return value.replace(/^(null|undefined)/i, '');
+      },
+
+      normalizeReportProductSequence(list = []) {
+        if (!Array.isArray(list)) {
+          return;
+        }
+
+        list.forEach((item) => {
+          if (!item || !item.extInfo) {
+            return;
+          }
+
+          this.$set(
+            item.extInfo,
+            'productSequence',
+            this.normalizeProductSequenceValue(item.extInfo.productSequence)
+          );
+        });
+      },
+
       getCategoryIdFromWarehouseItem(item) {
         if (!item) {
           return null;
@@ -605,6 +635,9 @@
                 }
               ];
 
+              this.normalizeReportProductSequence(obj.semiProductList);
+              this.normalizeReportProductSequence(obj.product);
+
               if (obj.semiProductList.length != 0) {
                 // 预制体报工
                 obj.workReportInfo.formedNum = obj.semiProductList.length;

+ 3 - 18
src/views/produce/index.vue

@@ -1205,33 +1205,18 @@
         }
       },
 
-      /** 投料前首件两检校验(与报工逻辑一致) */
-      async validateFeedFirstArticle() {
+      /** 投料前仅校验是否已选择任务/工单 */
+      validateFeedSelection() {
         if (this.activeName === '1') {
           const row = this.taskData;
           if (!row) {
             this.$message.warning('请选择一条任务单进行投料');
             return false;
           }
-          if (
-            this.taskObj.id != '-1' &&
-            row.hasFirstArticleDualInspection == '1' &&
-            row.totalFirstArticleDualInspectionStatus != '2'
-          ) {
-            this.$message.warning('请先完成首件两检再投料');
-            return false;
-          }
           return true;
         }
 
         if (!this.checkWorkOrder({ min: 1 })) return false;
-        if (this.taskObj.id != '-1') {
-          const result = await this.checkQualityResult();
-          if (!result?.firstArticleDualInspectionResult) {
-            this.$message.warning('请完成首件两检再投料!');
-            return false;
-          }
-        }
         return true;
       },
 
@@ -1260,7 +1245,7 @@
         if (!this.checkTaskSelected()) return;
 
         if (t === 'feed') {
-          if (!(await this.validateFeedFirstArticle())) return;
+          if (!this.validateFeedSelection()) return;
           this.operationType = 'feed';
         }
 

+ 2 - 2
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.125:18086',
-        target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086', // 开发环境
         // target: 'http://192.168.1.103:18086',192.168.1.116
@@ -45,7 +45,7 @@ module.exports = {
         // target: 'http://192.168.1.251:18186', // 测试环境
         // target: 'http://192.168.1.251:18087',
         // target: 'http://116.163.22.90:86/api', // 嘉实生产
-        // target: 'http://aiot.zoomwin.com.cn:51001/api',
+        target: 'http://aiot.zoomwin.com.cn:51001/api',
         // target: 'http://f222326r53.imwork.net',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {