ysy 1 年間 前
コミット
4c9cde66c5

+ 11 - 0
src/api/productionPlan/index.js

@@ -121,3 +121,14 @@ export async function getBom(params) {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
+
+
+// 计划分解 (保存)
+
+export async function batchSave(data) {
+  const res = await request.post(`/aps/productionplan/batchSave`,  data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 53 - 5
src/views/productionPlan/components/disassemblePlanPop.vue

@@ -95,9 +95,21 @@
           tool-class="ele-toolbar-actions"
           tool-class="ele-toolbar-actions"
           max-height="360px"
           max-height="360px"
         >
         >
+          <template v-slot:produceRoutingName="{ row }">
+            <el-select v-model="row.produceRoutingId" filterable size="mini">
+              <el-option
+                v-for="item of routingList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.name"
+              ></el-option>
+            </el-select>
+          </template>
+
           <template v-slot:requiredFormingNum="{ row }">
           <template v-slot:requiredFormingNum="{ row }">
             <el-input
             <el-input
-              v-if="row.isManual"
+              v-if="row.resourceType"
+              size="mini"
               v-model.number="row.requiredFormingNum"
               v-model.number="row.requiredFormingNum"
             ></el-input>
             ></el-input>
             <span v-else>{{ row.requiredFormingNum }}</span>
             <span v-else>{{ row.requiredFormingNum }}</span>
@@ -117,7 +129,7 @@
 <script>
 <script>
   import { deepClone } from '@/utils';
   import { deepClone } from '@/utils';
   import { getBom } from '@/api/productionPlan/index.js';
   import { getBom } from '@/api/productionPlan/index.js';
-
+  import { routeList } from '@/api/saleOrder';
   import EquipmentDialog from './EquipmentDialog.vue';
   import EquipmentDialog from './EquipmentDialog.vue';
 
 
   export default {
   export default {
@@ -145,6 +157,7 @@
           { code: 3, name: '装配' }
           { code: 3, name: '装配' }
         ],
         ],
 
 
+        routingList: [],
         columns: [
         columns: [
           {
           {
             columnKey: 'selection',
             columnKey: 'selection',
@@ -263,6 +276,7 @@
 
 
           {
           {
             prop: 'produceRoutingName',
             prop: 'produceRoutingName',
+            slot: 'produceRoutingName',
             label: '工艺路线',
             label: '工艺路线',
             align: 'center',
             align: 'center',
             minWidth: 120
             minWidth: 120
@@ -287,6 +301,7 @@
         this.formData = deepClone(row);
         this.formData = deepClone(row);
 
 
         this.getBomList();
         this.getBomList();
+        this.getRouteListFn();
       },
       },
 
 
       getBomList() {
       getBomList() {
@@ -322,7 +337,7 @@
             produceRoutingName: '',
             produceRoutingName: '',
             requiredFormingNum: _num,
             requiredFormingNum: _num,
             unit: this.unit,
             unit: this.unit,
-            isManual: false
+            resourceType: 0
           };
           };
         });
         });
         this.jhList = _arr;
         this.jhList = _arr;
@@ -351,7 +366,7 @@
             produceRoutingName: '',
             produceRoutingName: '',
             requiredFormingNum: '',
             requiredFormingNum: '',
             unit: this.unit,
             unit: this.unit,
-            isManual: true
+            resourceType: 1
           };
           };
         });
         });
 
 
@@ -363,7 +378,40 @@
         this.visible = false;
         this.visible = false;
       },
       },
 
 
-      confirm() {}
+      getRouteListFn() {
+        let params = {
+          pageNum: 1,
+          size: -1
+        };
+
+        routeList(params).then((res) => {
+          this.routingList = res?.list || [];
+        });
+      },
+
+      confirm() {
+        let bol = this.jhList.every((m) => m.produceRoutingId);
+        if (!bol) {
+          return this.$message.warning('请选择工艺路线');
+        }
+
+        let bol2 = this.jhList.every((m) => m.requiredFormingNum);
+        if (!bol2) {
+          return this.$message.warning('请填写生产数量');
+        }
+
+        let param = {
+          addPOList: this.jhList,
+          produceType: this.formData.produceType,
+          id: this.formData.id
+        };
+        return false
+        batchSave(param).then((res) => {
+       
+           this.$emit('close', true);
+           this.visible = false;
+        });
+      }
     }
     }
   };
   };
 </script>
 </script>

+ 1 - 1
src/views/productionPlan/index.vue

@@ -199,7 +199,7 @@
 
 
     <unpackDetails ref="DetailsRef"></unpackDetails>
     <unpackDetails ref="DetailsRef"></unpackDetails>
 
 
-    <disassemblePlanPop ref="disassemblePlanRef"></disassemblePlanPop>
+    <disassemblePlanPop ref="disassemblePlanRef" @close="reload"></disassemblePlanPop>
   </div>
   </div>
 </template>
 </template>