浏览代码

齐套性检查功能优化完善

jingshuyong 10 月之前
父节点
当前提交
39d3fa3a2d

+ 43 - 1
src/api/productionPlan/index.js

@@ -222,7 +222,38 @@ export async function getOrderBomRoot(data) {
 }
 
 // 根据产品查询BOM分类
-export async function findBomCategoryByCategoryId(categoryId, produceType) {
+export async function findBomCategoryByCategoryIdV2(bomId, produceType) {
+  const res = await request.get(
+    `/aps/productionplan/findBomCategoryByCategoryId/v2/${bomId}?produceType=${produceType}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据产品查询BOM分类
+export async function bomVersionList(params) {
+  const res = await request.get(`/main/bomCategory/versionList`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 根据产品查询bom类型
+export async function listBomType(params) {
+  const res = await request.get(`/main/bomCategory/listBomType`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 根据产品查询BOM分类
+export async function findBomCategoryByCategoryId(
+  categoryId,
+  produceType = ''
+) {
   const res = await request.get(
     `/aps/productionplan/findBomCategoryByCategoryId/${categoryId}?produceType=${produceType}`
   );
@@ -246,6 +277,17 @@ export async function findMaterialInfoByPlanId(params) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 根据产品查询BOM分类
+export async function findBomSalesorderCategoryIdV2(bomId, produceType) {
+  const res = await request.get(
+    `/aps/salesorder/findBomCategoryByCategoryId/v2/${bomId}?produceType=${produceType}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 根据产品查询BOM分类
 export async function findBomSalesorderCategoryId(categoryId, produceType) {
   const res = await request.get(

+ 144 - 138
src/views/productionPlan/components/homogeneityInspectDialog.vue

@@ -12,32 +12,39 @@
       <div v-loading="loading">
         <el-form label-width="80px" :model="planInfo" class="plan_form">
           <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="名称:">
                 <el-input readonly v-model="planInfo.productName"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="计划编号:">
                 <el-input readonly v-model="planInfo.code"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="规格:">
                 <el-input readonly v-model="planInfo.specification"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="型号:">
                 <el-input readonly v-model="planInfo.model"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+          </el-row>
+          <el-row>
+            <el-col :span="6">
+              <el-form-item label="编码:">
+                <el-input readonly v-model="planInfo.productCode"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
               <el-form-item label="牌号:">
                 <el-input readonly v-model="planInfo.brandNo"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="计划数量:">
                 <el-input readonly v-model="planInfo.productNum"></el-input>
               </el-form-item>
@@ -109,9 +116,9 @@
                           >
                             <el-option
                               v-for="item in bomListType"
-                              :key="item.id"
+                              :key="item.bomType"
                               :label="item.bomName"
-                              :value="item.id"
+                              :value="item.bomType"
                             >
                             </el-option>
                           </el-select>
@@ -197,81 +204,6 @@
                       </el-input>
                     </el-form-item>
                   </el-form>
-
-                  <!-- <el-form
-                    :inline="true"
-                    :model="formInline"
-                    class="demo-form-inline"
-                  >
-                    <el-form-item label="BOM类型">
-                      <el-select
-                        size="medium"
-                        v-model="formInline.bomType"
-                        placeholder="BOM类型"
-                        class="select-type"
-                        @change="bomTypeChange"
-                      >
-                        <el-option
-                          v-for="item in bomListType"
-                          :key="item.id"
-                          :label="item.bomName"
-                          :value="item.id"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item label="BOM版本">
-                      <el-select
-                        class="select-type"
-                        size="medium"
-                        v-model="formInline.bomId"
-                        placeholder="BOM版本"
-                        @change="bomVChange"
-                      >
-                        <el-option
-                          v-for="item in bomListV"
-                          :key="item.bomId"
-                          :label="item.versions"
-                          :value="item.bomId"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item label="属性类型" v-if="produceType == 2">
-                      <el-select
-                        size="medium"
-                        v-model="formInline.attributeType"
-                        placeholder="属性类型"
-                        class="select-type"
-                        @change="attributeChange"
-                      >
-                        <el-option
-                          v-for="item in attributeList"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                    <el-form-item label="最终状态">
-                      <el-select
-                        class="select-type"
-                        size="medium"
-                        v-model="formInline.finalState"
-                        placeholder="最终状态"
-                        @change="finalChange"
-                      >
-                        <el-option
-                          v-for="item in finalStateList"
-                          :key="item.value"
-                          :label="item.label"
-                          :value="item.value"
-                        >
-                        </el-option>
-                      </el-select>
-                    </el-form-item>
-                  </el-form> -->
                 </template>
                 <template v-slot:inventoryQuantity="{ row }">
                   <el-link
@@ -387,7 +319,10 @@
 <script>
   import {
     findMaterialInfoByPlanId,
-    findBomCategoryByCategoryId
+    findBomCategoryByCategoryId,
+    findBomCategoryByCategoryIdV2,
+    bomVersionList,
+    listBomType
   } from '@/api/productionPlan/index.js';
   import factoryAdd from './factoryAdd';
   import stockDetailDialog from './stockDetailDialog.vue';
@@ -469,6 +404,13 @@
             showOverflowTooltip: true,
             align: 'center'
           },
+          {
+            prop: 'unit',
+            label: '单位',
+            showOverflowTooltip: true,
+            align: 'center',
+            width: 60
+          },
           {
             prop: 'totalUnshippedQuantity',
             label: '未发总数',
@@ -692,24 +634,58 @@
       // 选择BOM类型
       async bomTypeChange(e, type) {
         this.formInline.bomType = e;
-        let data = this.bomListType.find((el) => el.id === e);
-        if (!data) return;
-        this.bomListV = data.bomList;
-        let idx = 0;
+        const params = {
+          categoryId: this.planInfo.categoryId,
+          bomType: e,
+          isTemp: 0
+        };
+        const res = await bomVersionList(params);
+        if (!res || res.length == 0) {
+          this.bomListV = [];
+          return;
+        }
+        let list = [];
+        console.log(res,'res -01')
+        res.forEach((el) => {
+          if (el.status != 1) return;
+          let obj = {
+            bomId: el.id,
+            id: el.id,
+            versions: `V${el.versions}.0`
+          };
+          list.push(obj);
+        });
+        this.bomListV = list;
+        console.log(this.planInfo, '11111111111111');
         if (type == 'init') {
-          idx = data.bomList.findIndex(
-            (item) => item.bomId == this.planInfo.bomCategoryId
-          );
+          let obj = list.find((el) => el.bomId == this.planInfo.bomCategoryId);
+          let id = obj ? obj.bomId : list[0].bomId;
+          this.formInline.bomId = id;
+          this.bomVChange(id);
+        } else {
+          let id = list[0].bomId;
+          this.formInline.bomId = id;
+          this.bomVChange(id);
         }
-        const index = idx != -1 ? idx : 0;
-        await this.bomVChange(data.bomList[index].bomId);
+        // let data = this.bomListType.find((el) => el.id === e);
+        // if (!data) return;
+        // this.bomListV = data.bomList;
+        // let idx = 0;
+        // if (type == 'init') {
+        //   idx = data.bomList.findIndex(
+        //     (item) => item.bomId == this.planInfo.bomCategoryId
+        //   );
+        // }
+        // const index = idx != -1 ? idx : 0;
+        // await this.bomVChange(data.bomList[index].bomId);
       },
       // 选择BOM版本
       async bomVChange(e) {
-        this.formInline.bomId = e;
-        let data = this.bomListV.find((el) => el.bomId === e);
-        if (!data) return;
-        await this.getMaterialData(data, this.formInline.attributeType);
+        // return
+        // let bomData = list.find((el) => el.bomId == e);
+        // if (!bomData) return;
+        // let data = this.bomListV.find((el) => el.bomId === e);
+        this.getMaterialData({ bomId: e }, this.formInline.attributeType);
       },
       // 查询采购价跟外协件两个类型数据
       async dataMerging() {
@@ -792,7 +768,7 @@
         }
         let first = result[0];
         this.baseCount = first.baseCount;
-        this.baseUnit = first.unit;
+        this.baseUnit = first.measuringUnit;
         result.forEach((item) => {
           item.batchNo = this.planInfo.batchNo;
           item.salesCode = this.planInfo.salesCode;
@@ -881,56 +857,86 @@
       },
       // 获取bom 数据
       async getBomData(data) {
-        this.loading = true;
+        // this.loading = true;
         try {
           this.planId = data.id;
-          const res = await findBomCategoryByCategoryId(
-            data.categoryId,
-            this.produceType
-          );
-          this.loading = false;
-          if (!res || res.length == 0) {
-            this.bomListD = [];
-            this.datasourceList = [];
-            return;
-          }
-          let obj = {};
+          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',
             3: 'ABOM'
           };
-          if (this.produceType == 1) {
-            delete bomMap[1];
-          }
-          let result = res.filter((item) => item.bomType != 1);
-          result.map((el) => {
-            el.bomName = bomMap[el.bomType];
-            let OBMINFO = {
-              bomId: el.bomId,
-              bomType: el.type,
-              versions: `V${el.versions}.0`
+          let list = res.map((item) => {
+            return {
+              bomType: item.bomType,
+              id: item.id,
+              bomId: item.id,
+              bomName: bomMap[item.bomType]
             };
-            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;
+          let bom = list.find((el) => el.bomType == data.produceType);
+          let bomType = bom ? bom.bomType : list[0].bomType;
           this.bomListType = list;
-          let bomObj = res.find(
-            (item) => item.bomId == this.planInfo.bomCategoryId
-          );
-          console.log(bomObj, 'bomObj');
-          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;
+          this.formInline.bomType = bomType;
+          this.bomTypeChange(bomType, 'init');
+          // console.log(res, 'res 333');
+          // const params = {
+          //   categoryId: data.categoryId,
+          //   bomType: data.produceType,
+          //   isTemp: 0
+          // };
+          // const res = bomVersionList(params);
+          return;
+          // const res = await findBomCategoryByCategoryIdV2(
+          //   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'
+          // };
+          // if (this.produceType == 1) {
+          //   delete bomMap[1];
+          // }
+          // let result = res.filter((item) => item.bomType != 1);
+          // result.map((el) => {
+          //   el.bomName = bomMap[el.bomType];
+          //   let OBMINFO = {
+          //     bomId: el.bomId,
+          //     bomType: el.type,
+          //     versions: `V${el.versions}.0`
+          //   };
+          //   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.planInfo.bomCategoryId
+          // );
+          // console.log(bomObj, 'bomObj');
+          // 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;

+ 8 - 2
src/views/productionPlan/index.vue

@@ -398,7 +398,7 @@
         factoryType: 3,
         factoryObj: {},
         cardSpan: 3,
-        columnsVersion: 1,
+        columnsVersion: 1
         // homogeneityDialog: false
       };
     },
@@ -827,7 +827,13 @@
           this.$message.warning('请至少选择一条计划!');
           return;
         }
-        console.log(val,'val')
+        for (let i = 0; i < this.selection.length; i++) {
+          let el = this.selection[i];
+          if(!el.bomCategoryId){
+            return this.$message.warning('请选择有BOM版本的数据');
+          }
+        }
+        console.log(val, 'val');
         // this.homogeneityDialog = true;
         this.$refs.homogeneityInspectDialog.open(this.selection, val);
         // this.$nextTick(() => {

+ 137 - 65
src/views/saleOrder/components/orderHomogeneityInspectDialog.vue

@@ -12,32 +12,39 @@
       <div v-loading="loading">
         <el-form label-width="80px" :model="orderInfo" class="order_form">
           <el-row :gutter="20" type="flex" style="flex-wrap: wrap">
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="销售单号:">
                 <el-input readonly v-model="orderInfo.code"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="编号:">
                 <el-input readonly v-model="orderInfo.productCode"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="名称:">
                 <el-input readonly v-model="orderInfo.productName"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="规格:">
                 <el-input readonly v-model="orderInfo.specification"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+          </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="orderInfo.productCode"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
               <el-form-item label="型号:">
                 <el-input readonly v-model="orderInfo.model"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="8">
+            <el-col :span="6">
               <el-form-item label="订单数量:">
                 <el-input readonly v-model="orderInfo.contractNum"></el-input>
               </el-form-item>
@@ -108,9 +115,9 @@
                           >
                             <el-option
                               v-for="item in bomListType"
-                              :key="item.id"
+                              :key="item.bomType"
                               :label="item.bomName"
-                              :value="item.id"
+                              :value="item.bomType"
                             >
                             </el-option>
                           </el-select>
@@ -278,7 +285,10 @@
   import {
     findBomSalesorderCategoryId,
     findMaterialInfoSalesorder,
-    findMaterialInfoByCategory
+    findMaterialInfoByCategory,
+    findBomSalesorderCategoryIdV2,
+    bomVersionList,
+    listBomType
   } from '@/api/productionPlan/index.js';
   import { orderHomogeneityInspect } from '@/api/saleOrder/index.js';
   import stockDetailDialog from '../../productionPlan/components/stockDetailDialog.vue';
@@ -584,7 +594,7 @@
         this.$refs.currentDetailDialog.open({ bomCode: row.code });
       },
       open(dataList, order, source, produceType) {
-        console.log(produceType,'produceType')
+        console.log(produceType, 'produceType');
         this.produceType = produceType;
         this.source = source;
         this.visible = true;
@@ -647,85 +657,147 @@
       },
       // 获取bom 数据
       async getBomData(data) {
-        this.loading = true;
         try {
           this.salesOrderId = data.id;
-          const res = await findBomSalesorderCategoryId(
-            data.categoryId,
-            this.produceType
-          );
-          this.loading = false;
-          if (!res || res.length == 0) {
-            this.bomListD = [];
-            this.datasourceList = [];
-            return;
-          }
-          let obj = {};
+          let params = { categoryId: data.categoryId };
+          const res = await listBomType(params);
+          if (!res || res.length === 0) return;
           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
+          let list = res.map((item) => {
+            return {
+              bomType: item.bomType,
+              id: item.id,
+              bomId: item.id,
+              bomName: bomMap[item.bomType]
             };
-            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;
+          let bom = list.find((el) => el.bomType == data.produceType);
+          let bomType = bom ? bom.bomType : list[0].bomType;
           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.formInline.bomType = bomType;
+          this.bomTypeChange(bomType, 'init');
+        } catch (e) {
           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) {
         this.formInline.bomType = e;
-        this.bomCode = '';
-        let data = this.bomListType.find((el) => el.id === e);
-        if (!data) return;
-        this.bomListV = data.bomList.map((el) => {
-          return {
-            ...el,
-            name: data.name
+        const params = {
+          categoryId: this.orderInfo.categoryId,
+          bomType: e,
+          isTemp: 0
+        };
+        const res = await bomVersionList(params);
+        if (!res || res.length == 0) {
+          this.bomListV = [];
+          return;
+        }
+        let list = [];
+        res.forEach((el) => {
+          if (el.status != 1) return;
+          let obj = {
+            bomId: el.id,
+            id: el.id,
+            versions: `V${el.versions}.0`
           };
+          list.push(obj);
         });
-        let idx = 0;
+        this.bomListV = list;
+        console.log(this.orderInfo, '11111111111111');
         if (type == 'init') {
-          idx = data.bomList.findIndex(
-            (item) => item.bomId == this.orderInfo.bomCategoryId
-          );
+          let obj = list.find((el) => el.bomId == this.orderInfo.bomCategoryId);
+          let id = obj ? obj.bomId : list[0].bomId;
+          this.formInline.bomId = id;
+          this.bomVChange(id);
+        } else {
+          let id = list[0].bomId;
+          this.formInline.bomId = id;
+          this.bomVChange(id);
         }
-        const index = idx != -1 ? idx : 0;
-        await this.bomVChange(data.bomList[index].bomId);
+        // this.formInline.bomType = e;
+        // this.bomCode = '';
+        // let data = this.bomListType.find((el) => el.id === e);
+        // if (!data) return;
+        // this.bomListV = data.bomList.map((el) => {
+        //   return {
+        //     ...el,
+        //     name: data.name
+        //   };
+        // });
+        // let idx = 0;
+        // if (type == 'init') {
+        //   idx = data.bomList.findIndex(
+        //     (item) => item.bomId == this.orderInfo.bomCategoryId
+        //   );
+        // }
+        // const index = idx != -1 ? idx : 0;
+        // await this.bomVChange(data.bomList[index].bomId);
       },
       // 选择BOM版本
       async bomVChange(e) {
-        this.formInline.bomId = e;
-        let data = this.bomListV.find((el) => el.bomId === e);
-        if (!data) return;
-        this.bomCode = data.code;
-        await this.getMaterialData(data, this.formInline.attributeType);
+        // this.formInline.bomId = e;
+        // let data = this.bomListV.find((el) => el.bomId === e);
+        // if (!data) return;
+        // this.bomCode = data.code;
+        await this.getMaterialData({ bomId: e }, this.formInline.attributeType);
       },
 
       // 查询采购价跟外协件两个类型数据

+ 90 - 74
src/views/saleOrder/index.vue

@@ -29,9 +29,8 @@
         row-key="id"
         @sort-change="onSortChange"
         @columns-change="handleColumnChange"
-      
       >
-      <!--   :cache-key="cacheKeyUrl" -->
+        <!--   :cache-key="cacheKeyUrl" -->
         <template v-slot:code="{ row }">
           <el-link :underline="false" type="primary" @click="openDetails(row)">
             {{ row.code }}
@@ -232,6 +231,19 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          // {
+          //   prop: 'bomCategoryName',
+          //   label: 'BOM版本',
+          //   align: 'center',
+          //   width: 130,
+          //   showOverflowTooltip: true,
+          //   formatter: (row) => {
+          //     if (row.bomCategoryName) {
+          //       return `${row.bomCategoryName} (V${row.bomCategoryVersions}.0)`;
+          //     }
+          //     return '';
+          //   }
+          // },
           {
             prop: 'productName',
             label: '名称',
@@ -448,81 +460,87 @@
     },
     methods: {
       async check(val) {
-        if (this.selection.length > 0) {
-          let codeList = [];
-          this.selection.map((ele) => {
-            if (ele.code) {
-              codeList.push(ele.code);
+        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.bomCategoryId) {
+            return this.$message.warning('请选择有BOM版本的数据');
+          }
+        }
+
+        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;
             }
-          });
-          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);
-                }
+            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,
-            'list',
-            val
-          );
-          // if (flag) {
-          //   // 齐料
-          //   if (type == 2) {
-          //     this.$refs.orderHomogeneityInspectDialog.open(data2, first);
-          //   } else if (type == 3) {
-          //     this.$refs.orderHomogeneityInspectInstallDialog.open(data);
-          //   } else {
-          //     this.$message.warning('请确认生产类型!');
-          //   }
-          // }
-        } else {
-          this.$message.warning('请至少选择一条计划!');
         }
+        this.$refs.orderHomogeneityInspectDialog.open(
+          data2,
+          first,
+          'list',
+          val
+        );
+        // if (flag) {
+        //   // 齐料
+        //   if (type == 2) {
+        //     this.$refs.orderHomogeneityInspectDialog.open(data2, first);
+        //   } else if (type == 3) {
+        //     this.$refs.orderHomogeneityInspectInstallDialog.open(data);
+        //   } else {
+        //     this.$message.warning('请确认生产类型!');
+        //   }
+        // }
       },
       getFieldModel() {
         fieldModel({ fieldModel: 't_main_category' }).then((res) => {
@@ -608,8 +626,6 @@
       },
 
       onSortChange(e) {
-        console.log(111111111, e);
-
         let sort = {
           orderBy: e.order,
           sortName: e.prop