Răsfoiți Sursa

齐套性检查功能 增加时间查询跟定额计算方法

jingshuyong 10 luni în urmă
părinte
comite
ebfa052f66

+ 174 - 42
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -9,8 +9,29 @@
       :title="'齐套性检查'"
       :maxable="true"
     >
+      <el-form
+        :inline="true"
+        class="demo-form-inline"
+        label-width="107px"
+        style="margin-bottom: 16px"
+      >
+        <el-form-item label="选择日期:">
+          <el-date-picker
+            v-model="startTime"
+            type="date"
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+            size="large"
+            :picker-options="pickerOptions"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onSubmit">查询</el-button>
+        </el-form-item>
+      </el-form>
       <div v-loading="loading">
-        <el-form label-width="80px" :model="planInfo" class="plan_form">
+        <el-form label-width="107px" :model="planInfo" class="plan_form">
           <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
             <el-col :span="6">
               <el-form-item label="名称:">
@@ -49,6 +70,48 @@
                 <el-input readonly v-model="planInfo.productNum"></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="6">
+              <el-form-item label="未发总数:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.totalUnshippedQuantity"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="库存数量:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.inventoryQuantity"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="在制总数:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.totalNumberProduction"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="最终缺料数量:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.finalFilledShortCount"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="最终状态:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.finalFilledShortState"
+                ></el-input>
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-form>
         <div class="form-wrapper">
@@ -195,8 +258,22 @@
                     >下发生产计划</el-button
                   >
                 </template> -->
-
+                <!-- 默认按订单 -->
+                <template v-slot:toolbar v-if="produceType == 1">
+                  <el-form :inline="true">
+                    <el-form-item label="定额计算方法:">
+                      <el-radio-group
+                        v-model="quota_calculation"
+                        @change="selectCalculate"
+                      >
+                        <el-radio :label="1">按订单数量</el-radio>
+                        <el-radio :label="2">按缺料数量</el-radio>
+                      </el-radio-group>
+                    </el-form-item>
+                  </el-form>
+                </template>
                 <template v-slot:toolkit>
+                  <!-- 定额计算方法: 按订单数量 按缺料数量 -->
                   <el-form :inline="true">
                     <el-form-item label="基本数量">
                       <el-input size="medium" v-model="baseCount" disabled>
@@ -322,7 +399,8 @@
     findBomCategoryByCategoryId,
     findBomCategoryByCategoryIdV2,
     bomVersionList,
-    listBomType
+    listBomType,
+    getProductKitting
   } from '@/api/productionPlan/index.js';
   import factoryAdd from './factoryAdd';
   import stockDetailDialog from './stockDetailDialog.vue';
@@ -339,6 +417,9 @@
       factoryAdd
     },
     computed: {
+      fieldShow() {
+        return this.produceType == 1 && this.quota_calculation === 2;
+      },
       columns() {
         return [
           {
@@ -416,7 +497,8 @@
             label: '未发总数',
             showOverflowTooltip: true,
             align: 'center',
-            show: this.produceType == 1
+            show: this.fieldShow
+            // show: this.produceType == 1
           },
           {
             slot: 'inventoryQuantity',
@@ -469,7 +551,8 @@
             label: '在制总数',
             showOverflowTooltip: true,
             align: 'center',
-            show: this.produceType == 1
+            // show: this.produceType == 1
+            show: this.fieldShow
           },
           {
             prop: 'numberProductionStateText',
@@ -477,17 +560,18 @@
             label: '在制齐套',
             showOverflowTooltip: true,
             align: 'center',
-            show: this.produceType == 1
-          },
-          {
-            prop: 'productFinalStateText',
-            slot: 'productFinalStateText',
-            label: '成品的最终齐套',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 160,
-            show: this.produceType == 1
+            // show: this.produceType == 1
+            show: this.fieldShow
           },
+          // {
+          //   prop: 'productFinalStateText',
+          //   slot: 'productFinalStateText',
+          //   label: '成品的最终齐套',
+          //   showOverflowTooltip: true,
+          //   align: 'center',
+          //   minWidth: 160,
+          //   show: this.produceType == 1
+          // },
           {
             label: '最终可用数量',
             prop: 'finalAvailableQuantity',
@@ -534,11 +618,13 @@
     data() {
       return {
         visible: false,
+        kitComInfo: {},
         // requiredFormingNum: 0,
         formInline: {
           finalState: 0,
           attributeType: 2,
-          bomId:'',
+          bomId: '',
+          time: ''
         },
         finalStateList: [
           {
@@ -590,7 +676,27 @@
           }
         ],
         baseCount: '',
-        baseUnit: ''
+        baseUnit: '',
+        quota_calculation: 1,
+        pickerOptions: {
+          disabledDate: (time) => {
+            // 获取三个月前的日期(修正版)
+            const threeMonthsAgo = new Date();
+            threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
+            // 获取当前日期
+            const today = new Date();
+            // 禁用三个月前的日期之前的日期和当前日期之后的日期
+            // 注意:这里使用setHours(0,0,0,0)来确保只比较日期部分
+            const threeMonthsAgoDate = new Date(threeMonthsAgo);
+            threeMonthsAgoDate.setHours(0, 0, 0, 0);
+            const todayDate = new Date(today);
+            todayDate.setHours(0, 0, 0, 0);
+            const timeDate = new Date(time);
+            timeDate.setHours(0, 0, 0, 0);
+            return timeDate < threeMonthsAgoDate || timeDate > todayDate;
+          }
+        },
+        startTime: ''
       };
     },
     watch: {
@@ -606,26 +712,47 @@
     },
     mounted() {},
     methods: {
-      handleNodeClick(data) {
+      onSubmit() {},
+      async handleNodeClick(data) {
         this.planInfo = data;
-        this.clearData();
-        this.getBomData(data);
-        this.selectNodeId = data.id;
+        try {
+          await this.getKitting();
+          await this.getBomData(data);
+          this.selectNodeId = data.id;
+        } catch (e) {
+          console.log(e, '错误');
+        }
+      },
+      async getKitting() {
+        let params = {
+          categoryId: this.planInfo.categoryId,
+          startTime: this.startTime
+        };
+        const res = await getProductKitting(params);
+        if (res) {
+          this.kitComInfo = res;
+        }
+      },
+      initTime() {
+        // 设置默认选中三个月前的日期时间
+        const threeMonthsAgo = new Date();
+        threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
+
+        // 格式化为 YYYY-MM-DD HH:mm:ss
+        const year = threeMonthsAgo.getFullYear();
+        const month = String(threeMonthsAgo.getMonth() + 1).padStart(2, '0');
+        const day = String(threeMonthsAgo.getDate()).padStart(2, '0');
+        const time = `${year}-${month}-${day}`;
+        this.startTime = time;
+      },
+      selectCalculate(val) {
+        this.attributeChange(this.formInline.attributeType);
       },
       reload(where) {
         this.$nextTick(() => {
           this.$refs.table.reload({ page: 1, where });
         });
       },
-      reloads() {},
-      /* 表格数据源 */
-      // datasource({ page, limit, where }) {
-      //   return homogeneityInspect({
-      //     pageNum: page,
-      //     size: limit,
-      //     ...where
-      //   });
-      // },
       stockDetail(row) {
         this.$refs.stockDetailDialog.open({ bomCode: row.code });
       },
@@ -646,7 +773,6 @@
           return;
         }
         let list = [];
-        console.log(res, 'res -01');
         res.forEach((el) => {
           if (el.status != 1) return;
           let obj = {
@@ -657,7 +783,6 @@
           list.push(obj);
         });
         this.bomListV = list;
-        console.log(this.planInfo, '11111111111111');
         if (type == 'init') {
           let obj = list.find((el) => el.bomId == this.planInfo.bomCategoryId);
           let id = obj ? obj.bomId : list[0].bomId;
@@ -683,9 +808,6 @@
       // 选择BOM版本
       async bomVChange(e) {
         this.formInline.bomId = e;
-        console.log(this.bomListV,'1111111111111');
-        console.log(this.formInline,'22222222222222222')
-        console.log(e,'e')
         // return
         // let bomData = list.find((el) => el.bomId == e);
         // if (!bomData) return;
@@ -697,15 +819,20 @@
         if (!this.formInline.bomId) {
           return;
         }
+        let kitting = this.quota_calculation == 1 ? false : true;
         let params1 = {
           planId: this.planId,
           bomVersionId: this.formInline.bomId,
-          produceType: 2
+          produceType: 2,
+          startTime: this.startTime,
+          kitting: kitting
         };
         let params2 = {
           planId: this.planId,
           bomVersionId: this.formInline.bomId,
-          produceType: 3
+          produceType: 3,
+          startTime: this.startTime,
+          kitting: kitting
         };
         this.loading = true;
         try {
@@ -715,7 +842,6 @@
           // 使用Promise.all并行执行多个Promise
           let results = await Promise.all([p1, p2]);
           this.loading = false;
-          console.log(results, 'results');
           // 这里可以继续对results做后续处理,比如解构等
           const [result1, result2] = results;
           // 示例:可以接着处理result1和result2,比如合并数据等
@@ -748,12 +874,15 @@
           this.dataMerging();
           return;
         }
+        let kitting = this.quota_calculation == 1 ? false : true;
         let produceType =
           this.produceType == 1 ? 1 : attributeType == 2 ? 2 : 3;
         let params = {
           planId: this.planId,
           bomVersionId: data.bomId,
-          produceType: produceType
+          produceType: produceType,
+          startTime: this.startTime,
+          kitting: kitting
         };
         this.loading = true;
         try {
@@ -826,6 +955,7 @@
         this.bomVChange(this.formInline.bomId);
       },
       async open(dataList, produceType) {
+        this.initTime();
         this.produceType = produceType;
         this.visible = true;
         this.$nextTick(() => {
@@ -852,7 +982,7 @@
         this.formInline = {
           finalState: 0,
           attributeType: 2,
-          bomId:''
+          bomId: ''
         };
         this.baseCount = '';
         this.baseUnit = '';
@@ -869,7 +999,6 @@
           let params = { categoryId: data.categoryId };
           const res = await listBomType(params);
           if (!res || res.length === 0) return;
-          console.log(res, 'res 333');
           let bomMap = {
             1: 'PBOM',
             2: 'MBOM',
@@ -1004,7 +1133,6 @@
 
       // 字段处理
       fieldProcessing(arr) {
-        console.log(arr, 'arr');
         // return;
         let list = arr.map((item) => {
           return {
@@ -1029,6 +1157,10 @@
       },
       factoryClose(val) {
         // this.factoryObj = {};
+      },
+      onSubmit() {
+        this.getKitting();
+        this.attributeChange(this.formInline.attributeType);
       }
       // confirm() {
       //   this.visible = false;

+ 182 - 119
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -9,8 +9,29 @@
       :title="'齐套性检查'"
       :maxable="true"
     >
+      <el-form
+        label-width="107px"
+        :inline="true"
+        class="demo-form-inline"
+        style="margin-bottom: 16px"
+      >
+        <el-form-item label="选择日期">
+          <el-date-picker
+            v-model="startTime"
+            type="date"
+            placeholder="选择日期"
+            value-format="yyyy-MM-dd"
+            size="large"
+            :picker-options="pickerOptions"
+          >
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item>
+          <el-button class="" type="primary" @click="onSubmit">查询</el-button>
+        </el-form-item>
+      </el-form>
       <div v-loading="loading">
-        <el-form label-width="80px" :model="orderInfo" class="order_form">
+        <el-form label-width="107px" :model="orderInfo" class="order_form">
           <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
             <el-col :span="6">
               <el-form-item label="销售单号:">
@@ -49,19 +70,51 @@
                 <el-input readonly v-model="orderInfo.contractNum"></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="6">
+              <el-form-item label="未发总数:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.totalUnshippedQuantity"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
+            <el-col :span="6">
+              <el-form-item label="库存数量:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.inventoryQuantity"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="在制总数:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.totalNumberProduction"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="最终缺料数量:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.finalFilledShortCount"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="最终状态:">
+                <el-input
+                  readonly
+                  v-model="kitComInfo.finalFilledShortState"
+                ></el-input>
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-form>
         <div class="form-wrapper">
-          <!-- <div>
-            <el-row style="width: 100%">
-              <el-col :span="6"> 销售单号:{{ orderInfo.code }} </el-col>
-              <el-col :span="6"> 编号:{{ orderInfo.productCode }} </el-col>
-              <el-col :span="6"> 名称:{{ orderInfo.productName }} </el-col>
-              <el-col :span="6"> 规格:{{ orderInfo.specification }} </el-col>
-              <el-col :span="6"> 型号:{{ orderInfo.model }} </el-col>
-              <el-col :span="6"> 合同数量:{{ orderInfo.contractNum }} </el-col>
-            </el-row>
-          </div> -->
           <div
             class="left_tree"
             v-show="leftShow"
@@ -177,6 +230,20 @@
                     </div>
                   </div>
                 </template>
+                <!-- 默认按订单 -->
+                <template v-slot:toolbar v-if="produceType == 1">
+                  <el-form :inline="true">
+                    <el-form-item label="定额计算方法:">
+                      <el-radio-group
+                        v-model="quota_calculation"
+                        @change="selectCalculate"
+                      >
+                        <el-radio :label="1">按订单数量</el-radio>
+                        <el-radio :label="2">按缺料数量</el-radio>
+                      </el-radio-group>
+                    </el-form-item>
+                  </el-form>
+                </template>
                 <template v-slot:toolkit>
                   <el-form :inline="true">
                     <el-form-item label="基本数量">
@@ -288,7 +355,8 @@
     findMaterialInfoByCategory,
     findBomSalesorderCategoryIdV2,
     bomVersionList,
-    listBomType
+    listBomType,
+    getProductKitting
   } from '@/api/productionPlan/index.js';
   import { orderHomogeneityInspect } from '@/api/saleOrder/index.js';
   import stockDetailDialog from '../../productionPlan/components/stockDetailDialog.vue';
@@ -305,6 +373,9 @@
       purchaseDialog
     },
     computed: {
+      fieldShow() {
+        return this.produceType == 1 && this.quota_calculation === 2;
+      },
       columns() {
         return [
           {
@@ -382,7 +453,8 @@
             label: '未发总数',
             showOverflowTooltip: true,
             align: 'center',
-            show: this.produceType == 1
+            show: this.fieldShow
+            //   如果按订单状态 的话 隐藏
           },
           {
             prop: 'inventoryQuantity',
@@ -415,27 +487,31 @@
             prop: 'inTransitNum',
             label: '在途数量',
             align: 'center',
-            minWidth: 80
+            minWidth: 80,
+            show: this.produceType == 2
           },
           {
             prop: 'inTransitOrdersNum',
             label: '在途已关联数量	',
             align: 'center',
-            minWidth: 120
+            minWidth: 120,
+            show: this.produceType == 2
           },
           {
             slot: 'inTransitStatusText',
             prop: 'inTransitStatusText',
             label: '在途状态',
             align: 'center',
-            minWidth: 80
+            minWidth: 80,
+            show: this.produceType == 2
           },
           {
             prop: 'totalNumberProduction',
             label: '在制总数',
             showOverflowTooltip: true,
             align: 'center',
-            show: this.produceType == 1
+            show: this.fieldShow
+            //   如果按订单状态 的话 隐藏
           },
           {
             prop: 'numberProductionStateText',
@@ -443,17 +519,18 @@
             label: '在制齐套',
             showOverflowTooltip: true,
             align: 'center',
-            show: this.produceType == 1
-          },
-          {
-            prop: 'productFinalStateText',
-            slot: 'productFinalStateText',
-            label: '成品的最终齐套',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 160,
-            show: this.produceType == 1
+            show: this.fieldShow
+            //   如果按订单状态 的话 隐藏
           },
+          // {
+          //   prop: 'productFinalStateText',
+          //   slot: 'productFinalStateText',
+          //   label: '成品的最终齐套',
+          //   showOverflowTooltip: true,
+          //   align: 'center',
+          //   minWidth: 160,
+          //   show: this.produceType == 1 && this.quota_calculation === 2
+          // },
           {
             label: '最终可用数量',
             prop: 'finalAvailableQuantity',
@@ -489,7 +566,7 @@
     data() {
       return {
         visible: false,
-
+        kitComInfo: {},
         bomIdList: [],
         requiredFormingNum: 0,
         formInline: {
@@ -557,7 +634,28 @@
           }
         ],
         baseCount: '',
-        baseUnit: ''
+        baseUnit: '',
+        quota_calculation: 1,
+        pickerOptions: {
+          disabledDate: (time) => {
+            // 获取三个月前的日期(修正版)
+            const threeMonthsAgo = new Date();
+            threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
+            // 获取当前日期
+            const today = new Date();
+            // 禁用三个月前的日期之前的日期和当前日期之后的日期
+            // 注意:这里使用setHours(0,0,0,0)来确保只比较日期部分
+            const threeMonthsAgoDate = new Date(threeMonthsAgo);
+            threeMonthsAgoDate.setHours(0, 0, 0, 0);
+            const todayDate = new Date(today);
+            todayDate.setHours(0, 0, 0, 0);
+            const timeDate = new Date(time);
+            timeDate.setHours(0, 0, 0, 0);
+            return timeDate < threeMonthsAgoDate || timeDate > todayDate;
+          }
+        },
+        startTime: '',
+        kitting: false
       };
     },
     watch: {
@@ -593,9 +691,21 @@
       currentDetail(row) {
         this.$refs.currentDetailDialog.open({ bomCode: row.code });
       },
+      initTime() {
+        // 设置默认选中三个月前的日期时间
+        const threeMonthsAgo = new Date();
+        threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
+
+        // 格式化为 YYYY-MM-DD HH:mm:ss
+        const year = threeMonthsAgo.getFullYear();
+        const month = String(threeMonthsAgo.getMonth() + 1).padStart(2, '0');
+        const day = String(threeMonthsAgo.getDate()).padStart(2, '0');
+        const time = `${year}-${month}-${day}`;
+        this.startTime = time;
+      },
       open(dataList, order, source, produceType) {
-        console.log(produceType, 'produceType');
         this.produceType = produceType;
+        this.initTime();
         this.source = source;
         this.visible = true;
         this.cardList = dataList.map((el) => {
@@ -647,14 +757,29 @@
         this.visible = false;
       },
 
-      handleNodeClick(data) {
-        this.clearData();
-        this.getBomData(data);
-        // this.selectNodeId = data.id;
+      async handleNodeClick(data) {
         this.orderInfo = data;
-        // console.log(data);
-        // this.reload({planIds: [data.id]});
+        try {
+          await this.getKitting();
+          await this.getBomData(data);
+        } catch (e) {
+          console.log(e, 'eeeeeeeeeeeeeeeeeee');
+        }
       },
+      async getKitting() {
+        let params = {
+          categoryId: this.orderInfo.categoryId,
+          startTime: this.startTime
+        };
+        const res = await getProductKitting(params);
+        if (res) {
+          this.kitComInfo = res;
+        }
+      },
+      selectCalculate(val) {
+        this.attributeChange(this.formInline.attributeType);
+      },
+
       // 获取bom 数据
       async getBomData(data) {
         try {
@@ -684,58 +809,6 @@
           this.$message.error(err.message);
           this.loading = false;
         }
-
-        // this.loading = true;
-        // try {
-        //   this.salesOrderId = data.id;
-        //   console.log(data, 'data 11111111111');
-        //   const res = await findBomSalesorderCategoryIdV2(
-        //     data.bomCategoryId,
-        //     this.produceType
-        //   );
-        //   this.loading = false;
-        //   if (!res || res.length == 0) {
-        //     this.bomListD = [];
-        //     this.datasourceList = [];
-        //     return;
-        //   }
-        //   let obj = {};
-        //   let bomMap = {
-        //     1: 'PBOM',
-        //     2: 'MBOM',
-        //     3: 'ABOM'
-        //   };
-        //   res.map((el) => {
-        //     el.bomName = bomMap[el.bomType];
-        //     let OBMINFO = {
-        //       bomId: el.bomId,
-        //       bomType: el.type,
-        //       versions: `V${el.versions}.0`,
-        //       code: el.code
-        //     };
-        //     if (obj[el.bomType]) {
-        //       obj[el.bomType].bomList.unshift(OBMINFO);
-        //     } else {
-        //       obj[el.bomType] = { ...el, bomList: [OBMINFO] };
-        //     }
-        //   });
-        //   let list = Object.values(obj);
-        //   if (list.length == 0) return;
-        //   this.bomListType = list;
-        //   let bomObj = res.find(
-        //     (item) => item.bomId == this.orderInfo.bomCategoryId
-        //   );
-        //   let idx = 0;
-        //   if (bomObj && bomObj.bomId) {
-        //     idx = list.findIndex((item) => item.bomType == bomObj.bomType);
-        //   }
-        //   const index = idx != -1 ? idx : 0;
-        //   await this.bomTypeChange(list[index].id, 'init');
-        //   this.loading = false;
-        // } catch (err) {
-        //   this.$message.error(err.message);
-        //   this.loading = false;
-        // }
       },
       // 选择BOM类型
       async bomTypeChange(e, type) {
@@ -761,7 +834,6 @@
           list.push(obj);
         });
         this.bomListV = list;
-        console.log(this.orderInfo, '11111111111111');
         if (type == 'init') {
           let obj = list.find((el) => el.bomId == this.orderInfo.bomCategoryId);
           let id = obj ? obj.bomId : list[0].bomId;
@@ -805,15 +877,20 @@
         if (!this.formInline.bomId) {
           return;
         }
+        let kitting = this.quota_calculation == 1 ? false : true;
         let params1 = {
           salesOrderId: this.salesOrderId,
           bomVersionId: this.formInline.bomId,
-          produceType: 2
+          produceType: 2,
+          startTime: this.startTime,
+          kitting: kitting
         };
         let params2 = {
           salesOrderId: this.salesOrderId,
           bomVersionId: this.formInline.bomId,
-          produceType: 3
+          produceType: 3,
+          startTime: this.startTime,
+          kitting: kitting
         };
         this.loading = true;
         try {
@@ -823,12 +900,10 @@
           // 使用Promise.all并行执行多个Promise
           let results = await Promise.all([p1, p2]);
           this.loading = false;
-          console.log(results, 'results');
           // 这里可以继续对results做后续处理,比如解构等
           const [result1, result2] = results;
           // 示例:可以接着处理result1和result2,比如合并数据等
           const mergeData = this.handleMergedData(result1, result2);
-          console.log(mergeData, 'mergeData');
           this.resultProcess(mergeData);
         } catch (error) {
           this.loading = false;
@@ -862,10 +937,13 @@
         if (this.source == 'list') {
           let produceType =
             this.produceType == 1 ? 1 : attributeType == 2 ? 2 : 3;
+          let kitting = this.quota_calculation == 1 ? false : true;
           params = {
             salesOrderId: this.salesOrderId,
             bomVersionId: data.bomId,
-            produceType: produceType
+            produceType: produceType,
+            startTime: this.startTime,
+            kitting: kitting
           };
           api = findMaterialInfoSalesorder;
         } else {
@@ -873,7 +951,9 @@
           params = {
             categoryId: this.orderInfo.categoryId,
             bomVersionId: this.orderInfo.bomCategoryId,
-            requiredFormingNum: this.orderInfo.contractNum
+            requiredFormingNum: this.orderInfo.contractNum,
+            startTime: this.startTime,
+            kitting: kitting
           };
         }
         this.loading = true;
@@ -947,31 +1027,7 @@
       success() {
         this.bomVChange(this.formInline.bomId);
       },
-      // issuePlan() {
-      //   if (this.selection.length == 0) {
-      //     return this.$message.warning('请至少选择一条数据');
-      //   }
-      //   for (let i = 0; i < this.selection.length; i++) {
-      //     let el = this.selection[i];
-      //     if (el.finalState == 1) {
-      //       return this.$message.warning('必须选择最终状态为缺料的数据');
-      //     }
-      //     if (el.hasIssued) {
-      //       return this.$message.warning('必须选择下发状态为未下发的数据');
-      //     }
-      //   }
 
-      //   this.orderShow = true;
-      //   // 获取新建销售订单数据
-      //   const list = this.getSalaOrder();
-      //   console.log(this.$refs, 'this.$refs');
-
-      //   this.$nextTick(() => {
-      //     this.$refs.createDialog.open();
-      //     this.$refs.createDialog.form.productInfoList = list;
-      //     this.$refs.createDialog.getProcessRouteData(list, this.orderInfo.id);
-      //   });
-      // },
       // 获取新建销售订单数据
       getSalaOrder() {
         let obj = {};
@@ -1027,6 +1083,13 @@
         this.bomListType = [];
         this.datasourceList = [];
         this.datasourceAllList = [];
+        this.orderInfo = {};
+        this.kitComInfo = {};
+      },
+
+      onSubmit() {
+        this.getKitting();
+        this.attributeChange(this.formInline.attributeType);
       }
     }
   };