Преглед изворни кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yijing пре 1 година
родитељ
комит
1c0c98b262

+ 8 - 0
src/api/material/BOM.js

@@ -375,3 +375,11 @@ export async function hasNewVersion(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+export async function sourceBomVersion(data) {
+  const res = await request.post(`/main/bomCategory/sourceBomVersion`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 13 - 3
src/views/material/BOMmanage/components/attribute.vue

@@ -128,7 +128,7 @@
           <el-form-item label="生产类型:" prop="produceType">
             <el-select
               v-model="attributeData.produceType"
-               :disabled="attributeData.approvalStatus != 0"
+               disabled
               filterable
               multiple
               class="ele-block"
@@ -147,7 +147,7 @@
           <el-form-item label="属性类型:" prop="attributeType">
             <el-select
               v-model="attributeData.attributeType"
-               :disabled="attributeData.approvalStatus != 0"
+              disabled
               filterable
               multiple
               class="ele-block"
@@ -263,7 +263,17 @@
           </el-form-item>
         </el-col>
       </el-row>
- 
+      <el-col :span="8" label-width="100px">
+         
+         <el-form-item label="来源版本号" prop="name">
+           <!-- {{ attributeData }} -->
+           <el-input
+             placeholder=""
+             disabled
+             v-model="attributeData.resourceBomVersion"
+           ></el-input>
+         </el-form-item>
+       </el-col>
 
       <div class="btn_box" v-if="attributeData.status != 1">
         <el-button type="primary" @click="handleUpdate">保存</el-button>

+ 110 - 14
src/views/material/BOMmanage/components/detailedList.vue

@@ -1,7 +1,6 @@
 <template>
   <div class="ele-body">
     <BOMSearch @search="reload" :statusOpt="statusOpt" />
-
     <ele-pro-table
       ref="table"
       :columns="columns"
@@ -9,6 +8,7 @@
       class="dict-table"
       tool-class="ele-toolbar-actions"
     >
+
       <template v-slot:toolbar>
         <div class="toolbar_box">
           <div v-if="attributeData.status != 1">
@@ -34,8 +34,9 @@
           </div>
         </div>
       </template>
-
+      <!-- 用量 -->
       <template v-slot:dosage="{ row }">
+      
         <el-input
           v-model="row.dosage"
           placeholder="请输入"
@@ -48,10 +49,12 @@
       <template v-slot:versions="{ row }"> V{{ row.versions }}.0 </template>
 
       <template v-slot:produceType="{ row }">
+
         <el-select
           v-model="row.produceType"
           filterable
           multiple
+          disabled
           class="ele-block"
           size="mini"
         >
@@ -68,7 +71,7 @@
         <el-select
           v-model="row.attributeType"
           filterable
-          multiple
+          disabled
           class="ele-block"
           size="mini"
         >
@@ -81,6 +84,30 @@
         </el-select>
       </template>
 
+
+      <template v-slot:resourceBomVersion="{ row }">
+        <div>
+          {{ row.resourceBomVersionList }}
+        <el-select
+          v-model="row.resourceBomVersion"
+          filterable
+          class="ele-block"
+          size="mini"
+          @change="resourceBomVersionFn"
+        >
+          
+          <el-option
+            v-for="item in row.resourceBomVersionList"
+            :key="item.versions"
+            :value="item.versions"
+            :label="'V'+item.versions+'.0'"
+          ></el-option>
+        </el-select>
+        </div>
+       
+        
+      </template>
+
       <template v-slot:materielDesignation="{ row }">
         <el-input
           v-model="row.materielDesignation"
@@ -148,7 +175,8 @@
     getBomPageCategoryId,
     contactList,
     deleteBomTreeList,
-    updateBatchBOM
+    updateBatchBOM,
+    sourceBomVersion
   } from '@/api/material/BOM';
   import { getByCode } from '@/api/system/dictionary-data';
 
@@ -253,7 +281,12 @@
             label: '生产厂家',
             width: 180
           },
-
+          {
+            prop: 'resourceBomVersion',
+            slot: 'resourceBomVersion',
+            label: '来源版本',
+            width: 180
+          },
           {
             prop: 'versions',
             slot: 'versions',
@@ -310,7 +343,8 @@
             value: 4
           }
         ],
-
+        list:[],//表格数据
+        newList: [],
         gysList: [],
 
         newTreeId: null,
@@ -359,7 +393,17 @@
         },
         deep: true,
         immediate: true
-      }
+      },
+      data: {
+        handler(val) {
+          console.log(val);
+          this.$nextTick(() => {
+            this.reload();
+          });
+        },
+        deep: true,
+        immediate: true
+      },
     },
 
     methods: {
@@ -416,18 +460,62 @@
         let _list = this.$refs.table.getData() ?? [];
 
         this.$refs.standardOutputRefs.open(_list);
+
       },
 
-      chooseStandardList(data) {
-        data.map((m) => {
+      // 勾选
+      async chooseStandardList(data) {
+        const that = this;
+       const arrays = []
+       data.map((m) => {
           m.parentId = this.newTreeId;
+          m.createTime = '';
+          m.bomType = this.attributeData.bomType;
+          m.level =Number(this.attributeData.level)+1;
+          m.versions =this.attributeData.versions;
+          m.categoryId = this.attributeData.categoryId;
+          m.rootCategoryLevelId = this.attributeData.rootCategoryLevelId;
+          arrays.push(that.getResourceBomVersionListFn(m.id))
+          Promise.all(arrays).then(responses => {
+            // 默认选择第一个
+            console.log(responses,responses[0].length,66666666);
+
+            if(responses[0].length){
+              m.resourceBomVersionList=responses[0];
+              m.resourceBomVersion = responses[0][0].versions;
+              m.resourceBomId = responses[0][0].resourceBomId;
+            }else{
+              m.resourceBomVersionList=[];
+              m.resourceBomVersion = '';
+              m.resourceBomId = '';
+            }
+           
+
+          })
+          m.id = '';
+        });
+       
+        this.$nextTick(() => {
+          this.list = [...data, ...this.$refs.table.getData()];
+          console.log(this.list);
+          this.$refs.table.setData(this.list);
         });
-        console.log(
-          data,
-          555555555555555555555555555555555555555555555555555555555555555555555555555555
-        );
+       
+      },
 
-        this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
+      resourceBomVersionFn(e){
+        console.log(e);
+      },
+
+      async getResourceBomVersionListFn (id){
+        return new Promise((resolve, reject) => {
+          sourceBomVersion({
+            bomType: this.attributeData.bomType,
+            categoryId: id
+          }).then((res) => {
+            resolve(res.data);
+          });
+        });
       },
 
       bomClose() {
@@ -467,6 +555,14 @@
         }
         let list = JSON.parse(JSON.stringify(_list));
         console.log(list, 'list');
+
+      const arr = list.every(v=>{
+        return v.dosage&& v.quantity !== ''
+      })
+      
+      if(!arr){
+        return this.$message.info('用量不能为空')
+      }
         updateBatchBOM(list).then((res) => {
           this.$message.success('保存成功');
           this.$refs.table.reload({

+ 4 - 1
src/views/material/BOMmanage/components/standardOutput.vue

@@ -9,6 +9,8 @@
     append-to-body
     width="75%"
   >
+
+    <!-- 选择产品分类 -->
     <el-card shadow="never">
       <ProductSearch @search="reload" ref="searchRef" />
 
@@ -53,7 +55,7 @@
 <script>
   import ProductSearch from '@/components/select/bom/product-search.vue';
   import { getMaterialList } from '@/api/material/list.js';
-
+  import { sourceBomVersion } from '@/api/material/BOM';
   import { getTreeByGroup } from '@/api/classifyManage';
   export default {
     components: { ProductSearch },
@@ -230,6 +232,7 @@
         this.current = null;
         this.radio = '';
       },
+
       selected() {
         if (this.selection.length <= 0) {
           return this.$message.warning('请至少选择一条数据');

+ 526 - 52
src/views/material/product/detail.vue

@@ -213,6 +213,23 @@
               </template>
             </el-form-item>
           </el-col>
+
+          <el-col :span="8">
+            <el-form-item label="属性类型:" prop="attributeType">
+              <el-select
+                v-model="form.attributeType"
+                filterable
+                class="ele-block"
+              >
+                <el-option
+                  v-for="item in attributeList"
+                  :key="item.value"
+                  :value="item.value"
+                  :label="item.label"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
     </el-card>
@@ -227,6 +244,7 @@
     <!-- 分类选择弹窗 -->
     <CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
     <!-- 仓储配置 -->
+    <<<<<<< HEAD
     <WarehouseInfo
       ref="warehouseRefs"
       v-if="isShow"
@@ -236,6 +254,16 @@
       :packageDispositionVOList="packageDispositionVOList"
       @change="changePackagingSpecification"
     />
+    =======
+    <WarehouseInfo
+      ref="warehouseRefs"
+      :form="categoryWms"
+      :measuringUnit="form.measuringUnit"
+      :packingUnit="form.packingUnit"
+      :packageDispositionVOList="packageDispositionVOList"
+      @change="changePackagingSpecification"
+    />
+    >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
     <!-- 销售配置 -->
     <SalesInfos ref="salesRefs" :form="categorySales" />
     <!-- 采购信息 -->
@@ -295,6 +323,39 @@
   import { deepClone } from '@/utils/index';
   import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
 
+  <<<<<<< HEAD
+    export default {
+      name: 'product',
+      components: {
+        SalesInfos,
+        PurchasingInfo,
+        linkMsg,
+        GroupDialog,
+        deptSelect,
+        personSelect,
+        WarehouseInfo,
+        ProcureInfo,
+        ProductionInfo,
+        PlanInfo,
+        SalesInfo,
+        QualityInfo,
+        BoatInfo,
+        TurnoverInfo,
+        MoldInfo,
+        RemarkInfo,
+        CategoryDialog,
+        CodeDialog
+      },
+      data() {
+        return {
+          isShow: true,
+          packagingSpecificationList: [],
+          loading: false,
+          levelOptions: [
+            {
+              label: '特级',
+              value: '特级'
+  =======
   export default {
     name: 'product',
     components: {
@@ -319,7 +380,6 @@
     },
     data() {
       return {
-        isShow: true,
         packagingSpecificationList: [],
         loading: false,
         levelOptions: [
@@ -340,6 +400,24 @@
             value: '三级'
           }
         ],
+        attributeList: [
+          {
+              label: '总装',
+              value: 1
+  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
+            },
+            {
+              label: '部件',
+              value: 2
+            },
+            {
+              label: '零',
+              value: 3
+            },{
+              label: '原材料',
+              value: 4
+            }
+          ],
         form: {
           categoryLevelGroupName: '',
           categoryLevelName: '',
@@ -347,7 +425,7 @@
           measuringUnit: '',
           weightUnit: '',
           packingUnit: '',
-
+          attributeType:'',
           extField: {}
         },
 
@@ -355,24 +433,39 @@
           remarkAttach: []
         },
         categorySales: {},
-        categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
+        categoryPurchase: { purchaseMultiplier: 1 },
         categoryAps: {},
         categoryMes: {},
         categoryMold: {},
         categoryPallet: {},
-        categoryQms: {
-          isComeCheck: '1'
-        },
+        categoryQms: {},
         categoryVehicle: {},
         categoryWms: {
-          isUnpack: 1,
-          isWarn: 1,
-          inventoryMode: ''
+          isUnpack: 1
         },
         packageDispositionVOList: [],
         categoryLevelPathId: null,
 
-        dictList: [],
+          remarkform: {
+            remarkAttach: []
+          },
+          categorySales: {},
+          categoryPurchase: { purchaseMultiplier: 1, measuringUnit: '' },
+          categoryAps: {},
+          categoryMes: {},
+          categoryMold: {},
+          categoryPallet: {},
+          categoryQms: {
+            isComeCheck: '1'
+          },
+          categoryVehicle: {},
+          categoryWms: {
+            isUnpack: 1,
+            isWarn: 1,
+            inventoryMode: ''
+          },
+          packageDispositionVOList: [],
+          categoryLevelPathId: null,
 
         fileList: [],
         // 表单验证规则
@@ -428,7 +521,6 @@
               packingUnit: '',
               extField: {}
             };
-            this.categorySales = {};
             this.purchaseInfo = {};
             this.remarkform = {
               remarkAttach: []
@@ -440,16 +532,140 @@
             this.categoryQms = {};
             this.categoryVehicle = {};
             this.categoryWms = {
-              isUnpack: 1,
-              isWarn: 1,
-              inventoryMode: this.form.isConsumable
+              isUnpack: 1
             };
             this.packageDispositionVOList = [];
             this.categoryLevelPathId = null;
 
-            this.dictList = [];
+          status: null
+        };
+      },
+      watch: {
+        '$route.query.id': {
+          handler(id) {
+            if (id) {
+              this._getDetails();
+            } else {
+              this.form = {
+                categoryLevelGroupName: '',
+                // categoryLevelName: '',
+                isConsumable: 1,
+                measuringUnit: '',
+                weightUnit: '',
+                packingUnit: '',
+                extField: {}
+              };
+              this.categorySales = {};
+              this.purchaseInfo = {};
+              this.remarkform = {
+                remarkAttach: []
+              };
+              this.categoryAps = {};
+              this.categoryMes = {};
+              this.categoryMold = {};
+              this.categoryPallet = {};
+              this.categoryQms = {};
+              this.categoryVehicle = {};
+              this.categoryWms = {
+                isUnpack: 1,
+                isWarn: 1,
+                inventoryMode: this.form.isConsumable
+              };
+              this.packageDispositionVOList = [];
+              this.categoryLevelPathId = null;
+
+              this.dictList = [];
+
+              this.fileList = [];
+            }
+        },
+          deep: true,
+          immediate: true
+
+      },
+      async activated() {
+        this.status = this.$route.query.status;
+        this.form.categoryLevelId = this.$route.query.categoryLevelId;
+        this.form.categoryLevelName = this.$route.query.categoryLevelName;
+        this.form.categoryLevelPath = this.$route.query.categoryLevelPath;
+        this.form.categoryLevelPathId = this.$route.query.categoryLevelPathId;
+
+        this.ruleCode = this.$route.query.ruleCode;
+        if (this.ruleCode && this.ruleCode != '自定义' && this.status != 0) {
+          const code = await getCode(this.ruleCode);
+          this.$set(this.form, 'code', code);
+        }
+
+        this.getFieldModel();
+
+        this.getDictList('productionType');
+      },
+      async created() {
+        //新增
+
+        this.$set(
+          this.form,
+          'categoryLevelId',
+          this.$route.query.categoryLevelId
+        );
+        this.$set(
+          this.form,
+          'categoryLevelName',
+          this.$route.query.categoryLevelName
+        );
+        this.$set(
+          this.form,
+          'categoryLevelPath',
+          this.$route.query.categoryLevelPath
+        );
+        this.$set(
+          this.form,
+          'categoryLevelPathId',
+          this.$route.query.categoryLevelPathId
+        );
+        this.status = this.$route.query.status;
+        this.ruleCode = this.$route.query.ruleCode;
+        if (this.ruleCode && this.ruleCode != '自定义' && this.status != 0) {
+          const code = await getCode(this.ruleCode);
+          this.$set(this.form, 'code', code);
+        }
+
+        this.getFieldModel();
+
+        this.getDictList('productionType');
+      },
+      methods: {
+        handleInputPublicHasPoint(value) {
+          const filteredValue = value.replace(/[^0-9.]/g, '');
+          let finalValue = '';
+          const dotIndex = filteredValue.indexOf('.');
+          if (dotIndex !== -1) {
+            finalValue = filteredValue.slice(0, dotIndex + 3);
+          } else {
+            finalValue = filteredValue;
+          }
+          this.form.volume = finalValue;
+        },
+        changeConsumable() {
+          this.categoryWms.inventoryMode = this.form.isConsumable;
+        },
+        changeUnit() {
+          if (this.$route.query.id == '' || this.$route.query.id == null) {
+            if (this.form.measuringUnit) {
+              this.categoryPurchase.measuringUnit = this.form.measuringUnit;
+              // 如果有计量单位和包装单位 默认添加包装组
+              if (this.form.packingUnit) {
+                this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
+              }
+            }
+          } else {
+            this.isShow = false;
+            if (this.form.measuringUnit && this.form.packingUnit) {
+              console.log(this.form.measuringUnit, 'this.form.measuringUnit');
+              console.log(this.form.packingUnit, 'this.form.packingUnit');
+            }
 
-            this.fileList = [];
+            this.isShow = true;
           }
         },
         deep: true,
@@ -505,40 +721,15 @@
 
       this.getFieldModel();
 
+      // if (this.$route.query.id) {
+      //   this._getDetails();
+      // }
       this.getDictList('productionType');
     },
     methods: {
-      handleInputPublicHasPoint(value) {
-        const filteredValue = value.replace(/[^0-9.]/g, '');
-        let finalValue = '';
-        const dotIndex = filteredValue.indexOf('.');
-        if (dotIndex !== -1) {
-          finalValue = filteredValue.slice(0, dotIndex + 3);
-        } else {
-          finalValue = filteredValue;
-        }
-        this.form.volume = finalValue;
-      },
-      changeConsumable() {
-        this.categoryWms.inventoryMode = this.form.isConsumable;
-      },
       changeUnit() {
-        if (this.$route.query.id == '' || this.$route.query.id == null) {
-          if (this.form.measuringUnit) {
-            this.categoryPurchase.measuringUnit = this.form.measuringUnit;
-            // 如果有计量单位和包装单位 默认添加包装组
-            if (this.form.packingUnit) {
-              this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
-            }
-          }
-        } else {
-          this.isShow = false;
-          if (this.form.measuringUnit && this.form.packingUnit) {
-            console.log(this.form.measuringUnit, 'this.form.measuringUnit');
-            console.log(this.form.packingUnit, 'this.form.packingUnit');
-          }
-
-          this.isShow = true;
+        if (this.form.measuringUnit && this.form.packingUnit) {
+          this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
         }
       },
       changePackagingSpecification(val) {
@@ -553,9 +744,6 @@
           ...info.category
         };
 
-        // if (this.form.measuringUnit && this.form.packingUnit) {
-        //   this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
-        // }
         this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
         this.judgeSet(info);
 
@@ -572,7 +760,6 @@
       // 判断字段类型并赋值
       judgeSet(info) {
         console.log('info-------', info);
-
         if (typeof info.categoryAps == 'string') {
           this.categoryAps = {};
         } else {
@@ -679,9 +866,17 @@
         });
       },
 
+  <<<<<<< HEAD
+          // if (this.form.measuringUnit && this.form.packingUnit) {
+          //   this.$refs.warehouseRefs.defaultBuild(this.form.packingUnit);
+          // }
+          this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
+          this.judgeSet(info);
+  =======
       openCategory() {
         this.$refs.categoryRefs.open();
       },
+  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
 
       openCode() {
         this.codeShow = true;
@@ -693,6 +888,78 @@
         this.$forceUpdate();
       },
 
+  <<<<<<< HEAD
+          this.$forceUpdate();
+        },
+        // 判断字段类型并赋值
+        judgeSet(info) {
+          console.log('info-------', info);
+
+          if (typeof info.categoryAps == 'string') {
+            this.categoryAps = {};
+          } else {
+            this.categoryAps = info.categoryAps;
+          }
+          if (typeof info.categoryMes == 'string') {
+            this.categoryMes = {};
+          } else {
+            this.categoryMes = info.categoryMes;
+          }
+          if (typeof info.categoryMold == 'string') {
+            this.categoryMold = {};
+          } else {
+            this.categoryMold = info.categoryMold;
+          }
+          if (typeof info.categoryPallet == 'string') {
+            this.categoryPallet = {};
+          } else {
+            this.categoryPallet = info.categoryPallet;
+          }
+          if (typeof info.categorySales == 'string') {
+            this.categorySales = {};
+          } else {
+            this.categorySales = info.categorySales;
+          }
+
+          if (typeof info.categoryPurchase == 'string') {
+            this.categoryPurchase = {};
+          } else {
+            this.categoryPurchase = info.categoryPurchase;
+          }
+          if (typeof info.categoryQms == 'string') {
+            this.categoryQms = {};
+          } else {
+            this.categoryQms = info.categoryQms;
+          }
+          if (typeof info.categoryVehicle == 'string') {
+            this.categoryVehicle = {};
+          } else {
+            this.categoryVehicle = info.categoryVehicle;
+          }
+          if (typeof info.categoryWms == 'string') {
+            this.categoryWms = {};
+          } else {
+            this.categoryWms = info.categoryWms;
+          }
+          if (typeof info.packageDispositionVOList == 'string') {
+            this.packageDispositionVOList = [];
+          } else {
+            this.packageDispositionVOList = info.packageDispositionVOList;
+            console.log(
+              'this.packageDispositionVOList---!!!----',
+              this.packageDispositionVOList
+            );
+          }
+        },
+
+        getFieldModel() {
+          fieldModel({ relevance: 't_main_category' }).then((res) => {
+            this.fileList = res;
+
+            this.fileList.forEach((f) => {
+              this.$set(this.form.extField, f.prop, ''); // 初始化动态模型属性
+            });
+  =======
       cancel() {
         // finishPageTab();
         // this.$router.go(-1);
@@ -702,6 +969,7 @@
             query: {
               categoryLevelId: this.form.categoryLevelId
             }
+  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
           });
         } else {
           this.$router.push({
@@ -709,6 +977,213 @@
             query: {
               categoryLevelId: this.form.categoryLevelId
             }
+  <<<<<<< HEAD
+          }
+
+          this.$forceUpdate();
+        },
+
+        async getDictList(code) {
+          let { data: res } = await getByCode(code);
+          this.dictList = res.map((item) => {
+            let values = Object.keys(item);
+            return {
+              value: Number(values[0]),
+              label: item[values[0]]
+            };
+          });
+        },
+
+        openCategory() {
+          this.$refs.categoryRefs.open();
+        },
+
+        openCode() {
+          this.codeShow = true;
+        },
+
+        chooseCode(code) {
+          this.$set(this.form, 'code', code);
+          this.codeShow = false;
+          this.$forceUpdate();
+        },
+
+        cancel() {
+          // finishPageTab();
+          // this.$router.go(-1);
+          if (this.$route.query.rootTreeId == 9) {
+            this.$router.push({
+              path: '/product/oneProduct',
+              query: {
+                categoryLevelId: this.form.categoryLevelId
+              }
+            });
+          } else {
+            this.$router.push({
+              path: '/material/product',
+              query: {
+                categoryLevelId: this.form.categoryLevelId
+              }
+            });
+          }
+        },
+
+        // 保存
+        submit() {
+          this.$refs.manageForm.validate(async (valid) => {
+            let productionValid = await this.$refs.productionRefs.getFormValid();
+            let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
+
+            if (!valid || !productionValid || !warehouseValid) {
+              return false;
+            }
+
+            let packageDispositionVOList = [];
+            if (this.packagingSpecificationList.length > 0) {
+              packageDispositionVOList = this.packagingSpecificationList.map(
+                (item) => {
+                  let obj = {
+                    code: item.code,
+                    name: item.name
+                  };
+                  return [
+                    {
+                      ...obj,
+                      id: item.id0,
+                      sort: 0,
+                      status: item.status,
+                      packageCell: 1,
+                      packageUnit: item.packageUnit,
+                      conversionUnit: item.packageUnit
+                    },
+                    {
+                      ...obj,
+                      id: item.id1,
+                      sort: 1,
+                      packageCell: item.minPackageCell,
+                      packageUnit: item.packageUnit,
+                      conversionUnit: item.minConversionUnit,
+                      status: item.status
+                    },
+                    {
+                      ...obj,
+                      id: item.id2,
+                      sort: 2,
+                      packageCell: item.inPackageCell,
+                      packageUnit: item.minConversionUnit,
+                      conversionUnit: item.inConversionUnit,
+                      status: item.status
+                    },
+                    {
+                      ...obj,
+                      id: item.id3,
+                      sort: 3,
+                      packageCell: item.outPackageCell,
+                      packageUnit: item.inConversionUnit,
+                      conversionUnit: item.outConversionUnit,
+                      status: item.status
+                    }
+                  ];
+                }
+              );
+              let packagingSpecificationList =
+                this.packagingSpecificationList.filter(
+                  (item) => item.status == 1
+                );
+              this.form.extField.packingSpecification = packagingSpecificationList
+                .map((item) => {
+                  return [
+                    `${item.minPackageCell}${item.packageUnit}/${item.minConversionUnit}`,
+                    `${item.inPackageCell}${item.minConversionUnit}/${item.inConversionUnit}`,
+                    `${item.outPackageCell}${item.inConversionUnit}/${item.outConversionUnit}`
+                  ];
+                })
+                .flat()
+                .join(',');
+            } else {
+              this.form.extField.packingSpecification = '';
+            }
+
+            this.loading = true;
+            // const imgList = this.remarkform.imgList;
+            // const arr = [];
+            // if (imgList.length) {
+            //   imgList.map((item) => {
+            //     arr.push(item.storePath);
+            //   });
+            //   this.form.remarkAttach = arr.join(',');
+            // }
+            // this.form.remark = this.remarkform.remark
+            //   ? this.remarkform.remark
+            //   : '';
+
+            const data = {
+              categorySales: this.categorySales,
+              categoryPurchase: this.categoryPurchase,
+              categoryWms: this.categoryWms,
+              categoryAps: this.categoryAps,
+              categoryMes: this.categoryMes,
+              categoryMold: this.categoryMold,
+              categoryPallet: this.categoryPallet,
+              categoryQms: this.categoryQms,
+              categoryVehicle: this.categoryVehicle,
+              category: {
+                ...this.form,
+                ...this.remarkform,
+                ...this.PathInfo
+              },
+              packageDispositionVOList: packageDispositionVOList.flat()
+            };
+
+            if (this.$route.query.status == 1) {
+              data.categorySales.id = null;
+              data.categoryPurchase.id = null;
+              data.category.id = null;
+              data.categoryWms.id = null;
+              data.categoryAps.id = null;
+              data.categoryMes.id = null;
+              data.categoryMold.id = null;
+              data.categoryPallet.id = null;
+              data.categoryQms.id = null;
+              data.categoryVehicle.id = null;
+              data.packageDispositionVOList = data.packageDispositionVOList.map(
+                (item) => {
+                  return {
+                    ...item,
+                    id: null
+                  };
+                }
+              );
+            }
+            console.log('保存', data);
+            addMaterial(data)
+              .then((msg) => {
+                this.loading = false;
+                this.$message.success(msg);
+                // reloadPageTab({ fullPath: '/material/product' });
+                // this.$router.go(-1);
+                this.cancel();
+                // if (this.$route.query.rootTreeId == 9) {
+                //   this.$router.push({
+                //     path: '/product/oneProduct',
+                //     query: {
+                //       categoryLevelId: this.form.categoryLevelId
+                //     }
+                //   });
+                // } else {
+                //   this.$router.push({
+                //     path: '/material/product',
+                //     query: {
+                //       categoryLevelId: this.form.categoryLevelId
+                //     }
+                //   });
+                // }
+              })
+              .catch((e) => {
+                this.loading = false;
+              });
+  =======
+  >>>>>>> 778152e35a1d73386814551d9d6194caae9cf792
           });
         }
       },
@@ -717,9 +1192,8 @@
       submit() {
         this.$refs.manageForm.validate(async (valid) => {
           let productionValid = await this.$refs.productionRefs.getFormValid();
-          let warehouseValid = await this.$refs.warehouseRefs.getFormValid();
 
-          if (!valid || !productionValid || !warehouseValid) {
+          if (!valid || !productionValid) {
             return false;
           }