Kaynağa Gözat

销售订单齐套性检查 增加行号显示

jingshuyong 10 ay önce
ebeveyn
işleme
e896a583d3

+ 1 - 1
src/views/saleOrder/components/create-order.vue

@@ -1105,7 +1105,7 @@
           this.$message.warning('请输入订单数量且订单数量不能为0');
           return;
         }
-         this.$refs.orderHomogeneityInspectDialog.open([row], {}, 'new');
+        this.$refs.orderHomogeneityInspectDialog.open([row], this.form, 'new');
         // if (row.productType == 2) {
         //   let data = [];
         //   data.push(row);

+ 7 - 6
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -392,8 +392,8 @@
     watch: {
       leftShow(newVal, oldVal) {
         if (newVal) {
-          this.leftWidth = '230px';
-          this.rightWidth = 'calc(100% - 230px)';
+          this.leftWidth = '250px';
+          this.rightWidth = 'calc(100% - 250px)';
         } else {
           this.leftWidth = '0';
           this.rightWidth = '100%';
@@ -422,14 +422,17 @@
       currentDetail(row) {
         this.$refs.currentDetailDialog.open({ bomCode: row.code });
       },
-      open(dataList, source = 'list') {
+      open(dataList, order, source = 'list') {
         this.source = source;
         this.visible = true;
         this.cardList = dataList.map((el) => {
           return {
-            ...el
+            ...order,
+            ...el,
+            code: `${el.code}--${el.lineNumber}`
           };
         });
+        console.log(this.cardList, '333333333333');
         if (dataList.length === 1) {
           this.leftShow = false;
         } else {
@@ -478,7 +481,6 @@
       },
       // 获取bom 数据
       async getBomData(data) {
-        console.log(data, 'datadatadatadata');
         this.loading = true;
         try {
           this.salesOrderId = data.id;
@@ -533,7 +535,6 @@
         this.formInline.bomId = e;
         let data = this.bomListV.find((el) => el.bomId === e);
         if (!data) return;
-        console.log(data, 'datadatadatadata');
         this.bomCode = data.code;
         await this.getMaterialData(data);
       },

+ 56 - 61
src/views/saleOrder/index.vue

@@ -436,68 +436,63 @@
     },
     methods: {
       async check() {
-        console.log(111111333333);
-
         if (this.selection.length > 0) {
-          // let codeList = [];
-          // this.selection.map((ele) => {
-          //   if (ele.code) {
-          //     codeList.push(ele.code);
-          //   }
-          // });
-          // let res = await getByCodeList(codeList);
-          // console.log(res, '0000000000000000');
-          // let flag = true;
-          // let type = 0;
-          // let data = [];
-          // let data2 = [];
-          // let first = null;
-          // let firstFlag = true;
-          // if (res) {
-          //   for (let ele of res) {
-          //     let list = ele.productInfoList;
-          //     if (firstFlag) {
-          //       first = ele;
-          //       firstFlag = false;
-          //     }
-          //     if (list) {
-          //       let pre = null;
-          //       for (let item of list) {
-          //         if (!item.productType) {
-          //           flag = false;
-          //           this.$message.warning(
-          //             '产品(' + item.productCode + ')未选择生产类型'
-          //           );
-          //           return;
-          //         }
-          //         type = item.productType;
-          //         if (!item.bomCategoryId) {
-          //           flag = false;
-          //           this.$message.warning(
-          //             '产品(' + item.productCode + ')未选择BOM版本'
-          //           );
-          //           return;
-          //         }
-          //         if (pre) {
-          //           if (pre.productType != item.productType) {
-          //             flag = false;
-          //             this.$message.warning('请选择生产类型相同的订单');
-          //             return;
-          //           }
-          //         }
-          //         pre = item;
-          //         JSON.parse(JSON.stringify({}))
-          //         data.push(item.id);
-          //         item.code = ele.code;
-          //         data2.push(item);
-          //       }
-          //     }
-          //   }
-          // }
-          // console.log(this.selection, 'this.selection 333333');
-          // console.log(data2,'data2')
-          // console.log(first,'first 123')
-          this.$refs.orderHomogeneityInspectDialog.open(this.selection);
+          let codeList = [];
+          this.selection.map((ele) => {
+            if (ele.code) {
+              codeList.push(ele.code);
+            }
+          });
+          let res = await getByCodeList(codeList);
+          console.log(res, '0000000000000000');
+          let flag = true;
+          let type = 0;
+          let data = [];
+          let data2 = [];
+          let first = null;
+          let firstFlag = true;
+          if (res) {
+            for (let ele of res) {
+              let list = ele.productInfoList;
+              if (firstFlag) {
+                first = ele;
+                firstFlag = false;
+              }
+              if (list) {
+                let pre = null;
+                for (let item of list) {
+                  // if (!item.productType) {
+                  //   flag = false;
+                  //   this.$message.warning(
+                  //     '产品(' + item.productCode + ')未选择生产类型'
+                  //   );
+                  //   return;
+                  // }
+                  // type = item.productType;
+                  // if (!item.bomCategoryId) {
+                  //   flag = false;
+                  //   this.$message.warning(
+                  //     '产品(' + item.productCode + ')未选择BOM版本'
+                  //   );
+                  //   return;
+                  // }
+                  // if (pre) {
+                  //   if (pre.productType != item.productType) {
+                  //     flag = false;
+                  //     this.$message.warning('请选择生产类型相同的订单');
+                  //     return;
+                  //   }
+                  // }
+                  pre = item;
+                  // JSON.parse(JSON.stringify({}))
+                  data.push(item.id);
+                  item.code = ele.code;
+                  data2.push(item);
+                }
+              }
+            }
+          }
+          this.$refs.orderHomogeneityInspectDialog.open(data2, first);
           // if (flag) {
           //   // 齐料
           //   if (type == 2) {