Explorar o código

禅道bug修复

jingshuyong hai 10 meses
pai
achega
48426b4c44

+ 40 - 17
src/views/saleOrder/components/order-search.vue

@@ -431,7 +431,10 @@
 </template>
 </template>
 
 
 <script>
 <script>
-  import { findBomCategoryByCategoryId } from '@/api/productionPlan/index';
+  import {
+    findBomCategoryByCategoryId,
+    listBomType
+  } from '@/api/productionPlan/index';
   import ImportException from '../components/import-exception.vue';
   import ImportException from '../components/import-exception.vue';
   import CreateOrder from '../components/create-order.vue';
   import CreateOrder from '../components/create-order.vue';
   import GroupOrder from '../components/group-order.vue';
   import GroupOrder from '../components/group-order.vue';
@@ -634,23 +637,43 @@
         }
         }
         console.log(this.selection, 'this.selection 3333');
         console.log(this.selection, 'this.selection 3333');
         let categoryId = this.selection[0].categoryId;
         let categoryId = this.selection[0].categoryId;
-        const res = await findBomCategoryByCategoryId(categoryId);
+        let params = { categoryId: categoryId };
+        const res = await listBomType(params);
+        console.log(res, 'res 000');
+        let bomMap = {
+          1: { code: 1, name: 'PBOM' },
+          2: { code: 2, name: 'MBOM' },
+          3: { code: 3, name: 'ABOM' }
+        };
         let arr = [];
         let arr = [];
-        if (res.length > 0) {
-          let obj = res.find((item) => item.id === bomCategoryId);
-          produceType = obj ? obj.bomType : produceType;
-          let listMap = {
-            1: { code: 1, name: 'PBOM' },
-            2: { code: 2, name: 'MBOM' },
-            3: { code: 3, name: 'ABOM' }
-          };
-          res.forEach((el) => {
-            if (listMap[el.bomType]) {
-              arr.push(listMap[el.bomType]);
-              delete listMap[el.bomType];
-            }
-          });
+        res.map((item) => {
+          if (bomMap[item.bomType]) {
+            arr.push(bomMap[item.bomType]);
+            delete bomMap[item.bomType];
+          }
+        });
+        if (arr.length > 0 && produceType) {
+          let obj = arr.find((el) => el.code == produceType);
+          produceType = obj ? produceType : arr[0].code;
         }
         }
+        console.log(arr, 'arr 222');
+        // const res = await findBomCategoryByCategoryId(categoryId);
+        // let arr = [];
+        // if (res.length > 0) {
+        //   let obj = res.find((item) => item.id === bomCategoryId);
+        //   produceType = obj ? obj.bomType : produceType;
+        //   let listMap = {
+        //     1: { code: 1, name: 'PBOM' },
+        //     2: { code: 2, name: 'MBOM' },
+        //     3: { code: 3, name: 'ABOM' }
+        //   };
+        //   res.forEach((el) => {
+        //     if (listMap[el.bomType]) {
+        //       arr.push(listMap[el.bomType]);
+        //       delete listMap[el.bomType];
+        //     }
+        //   });
+        // }
         this.$router
         this.$router
           .push({
           .push({
             path: '/saleOrder/salesToProduction',
             path: '/saleOrder/salesToProduction',
@@ -767,7 +790,7 @@
       },
       },
       // payBudget() {},
       // payBudget() {},
       homogeneityInspect(val) {
       homogeneityInspect(val) {
-        console.log(val,'val')
+        console.log(val, 'val');
         this.$emit('check', val);
         this.$emit('check', val);
       }
       }
     }
     }

+ 3 - 0
src/views/saleOrder/salesToProductionNewTwo.vue

@@ -1096,7 +1096,9 @@
           bomType: this.form.produceType || null,
           bomType: this.form.produceType || null,
           categoryId: categoryId
           categoryId: categoryId
         };
         };
+        console.log(param,'param')
         bomListByPlan(param).then((res) => {
         bomListByPlan(param).then((res) => {
+          console.log(res,'res 查出来没')
           this.bomVersionList = res || [];
           this.bomVersionList = res || [];
           if (res.length) {
           if (res.length) {
             let o = res[0];
             let o = res[0];
@@ -1190,6 +1192,7 @@
           this.form.produceType = this.$route.query.produceType
           this.form.produceType = this.$route.query.produceType
             ? parseInt(this.$route.query.produceType)
             ? parseInt(this.$route.query.produceType)
             : res.produceType;
             : res.produceType;
+          console.log(this.form.produceType,'这里吗')
           this.changeProduceType('init');
           this.changeProduceType('init');
           this.form.bomCategoryId =
           this.form.bomCategoryId =
             res.bomCategoryId || this.$route.query.bomCategoryId;
             res.bomCategoryId || this.$route.query.bomCategoryId;