chencc 1 год назад
Родитель
Сommit
bfcdf226a4

+ 20 - 2
src/views/material/BOMmanage/components/attribute.vue

@@ -144,8 +144,9 @@
           </el-form-item>
         </el-col>
    
+
         <el-col :span="8" label-width="100px">
-          <el-form-item label="属性类型:" prop="attributeType">
+          <el-form-item label="物料类型:" prop="attributeType">
             <el-select
               v-model="attributeData.category.attributeType"
               disabled
@@ -160,7 +161,24 @@
             </el-select>
           </el-form-item>
         </el-col>
-
+        <el-col :span="8" label-width="100px">
+          <el-form-item label="属性类型:" prop="componentAttribute">
+            <el-select
+              v-model="attributeData.category.componentAttribute"
+              disabled
+              filterable
+              multiple
+              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-row>

+ 116 - 32
src/views/material/BOMmanage/components/detailedList.vue

@@ -30,6 +30,10 @@
 
       <template v-slot:versions="{ row }"> V{{ row.versions }}.0 </template>
 
+
+      <template v-slot:rootCategoryLevelId="{ row }">{{ rootCategoryLevelIdText(row.rootCategoryLevelId) }} </template>
+
+
       <template v-slot:produceType="{ row }">
 
         <el-select v-model="row.produceType" filterable multiple disabled class="ele-block" size="mini">
@@ -44,6 +48,14 @@
         </el-select>
       </template>
 
+      <template v-slot:componentAttribute="{ row }">
+        <div>
+          <el-select v-model="row.componentAttribute" filterable multiple disabled class="ele-block" size="mini">
+          <el-option v-for="item in sxtList" :key="item.value" :value="item.value" :label="item.label"></el-option>
+        </el-select>
+        </div>
+       
+      </template>
 
       <template v-slot:resourceBomVersion="{ row }">
         <div v-if="!row.id">
@@ -61,6 +73,7 @@
 
       </template>
 
+
       <template v-slot:materielDesignation="{ row }">
         <el-input v-model="row.materielDesignation" placeholder="请输入物料代号" size="mini" style="width: 120px">
         </el-input>
@@ -75,7 +88,8 @@
 
       <template v-slot:factories="{ row }">
         <div style="display: flex;">
-          <el-input v-model="row.factories" disabled :value="row.factories"  placeholder="请选择生产厂家" size="mini" style="width: 120px">
+          <el-input v-model="row.factories" disabled :value="row.factories" placeholder="请选择生产厂家" size="mini"
+            style="width: 120px">
           </el-input>
           <!--  -->
           <el-button type="primary" @click="factoriesFn(row.code)">选择</el-button>
@@ -174,7 +188,13 @@ export default {
           align: 'center',
           showOverflowTooltip: true
         },
-
+        {
+          prop: 'rootCategoryLevelId',
+          slot: 'rootCategoryLevelId',
+          label: '物品分类',
+          align: 'center',
+          showOverflowTooltip: true
+        },
         {
           prop: 'dosage',
           slot: 'dosage',
@@ -194,10 +214,15 @@ export default {
           label: '生产类型',
           width: 260
         },
-
         {
           prop: 'attributeType',
           slot: 'attributeType',
+          label: '物料类型',
+          width: 260
+        },
+        {
+          prop: 'componentAttribute',
+          slot: 'componentAttribute',
           label: '属性类型',
           width: 260
         },
@@ -284,11 +309,50 @@ export default {
           value: 4
         }
       ],
-      isList:false,
+
+      sxtList: [
+        {
+          label: '自制件',
+          value: 1
+        },
+        {
+          label: '采购件',
+          value: 2
+        },
+        {
+          label: '外协件',
+          value: 3
+        },
+        {
+          label: '受托件',
+          value: 4
+        }
+      ],
+
+
+      rootCategoryLevelIdList: [
+        {
+          label: '产品',
+          value: 9
+        },
+        {
+          label: '物料',
+          value: 1
+        },
+        {
+          label: '生产设备',
+          value: 4
+        },
+        {
+          label: '模具',
+          value: 5
+        }
+      ],
+      isList: false,
       isId: null,
-      tableKey:"",
+      tableKey: "",
       list: [],//表格数据
-      listTow:[],
+      listTow: [],
       newList: [],
       gysList: [],
       sccjList: [],
@@ -300,10 +364,11 @@ export default {
 
   created() {
     this.getDictList('productionType');
-
+    // this.getZeroPartPros('zeroPartPros');
     this.getContactList();
   },
   mounted() { },
+
   props: {
     attributeData: {
       type: Object,
@@ -362,6 +427,14 @@ export default {
 
 
   methods: {
+
+    rootCategoryLevelIdText(v) {
+      if (v) {
+        let a = this.rootCategoryLevelIdList.find(item => item.value == v)
+        return a.label
+      }
+    },
+
     factoriesFn(code) {
       this.isId = code;
       this.$refs.clientSelectionRef.open();
@@ -375,23 +448,23 @@ export default {
           v.factories = obj.name;
         }
       });
-      console.log(list,'list');
+      console.log(list, 'list');
       // arr.factories = obj.name;
       this.$nextTick(() => {
         this.list = [...list];
         this.listTow = JSON.parse(JSON.stringify(this.list));
 
-        console.log(this.listTow,'listTowlistTowlistTowlistTow');
+        console.log(this.listTow, 'listTowlistTowlistTowlistTow');
         this.$refs.table.setData(this.list)
         this.updateFn()
         this.tableKey = Date.now();
-        
+
       });
 
       this.$forceUpdate();
     },
 
-    updateFn(list){
+    updateFn(list) {
       this.isList = true;
       this.reload();
       setTimeout(() => {
@@ -451,15 +524,15 @@ export default {
       //     });
       // });
 
-      let data =  getBomPageCategoryId({
+      let data = getBomPageCategoryId({
         ...where,
         pageNum: page,
         size: limit,
         id: this.attributeData.id,
         bomType: this.attributeData.bomType
       });
-      if(this.isList){
-        data= this.listTow;
+      if (this.isList) {
+        data = this.listTow;
       }
       return data;
     },
@@ -480,6 +553,22 @@ export default {
       });
     },
 
+    // async getZeroPartPros(code) {
+    //   let { data: res } = await getByCode(code);
+    //   let sxtList = res.map((item) => {
+    //     let values = Object.keys(item);
+    //     return {
+    //       value: Number(values[0]),
+    //       label: item[values[0]]
+    //     };
+    //   });
+    //   this.$nextTick(() => {
+    //     this.$set(this, 'sxtList', sxtList);
+    //   });
+
+
+    // },
+
     getContactList() {
       let param = {
         pageNum: 1,
@@ -513,8 +602,7 @@ export default {
     async chooseStandardList(data) {
       const that = this;
       const arrays = []
-      console.log(data, '99999999');
-
+      console.log(data, '222222222222222');
       data.map((m) => {
         m.parentId = this.newTreeId;
         m.createTime = '';
@@ -522,27 +610,15 @@ export default {
         m.level = Number(this.attributeData.level) + 1;
         m.versions = this.attributeData.versions;
         m.categoryId = m.id;
+        m.dosage = 1;
+        m.componentAttribute = m.componentAttribute;
         m.rootCategoryLevelId = m.categoryLevelPathIdParent;
         m.resourceBomVersionList = [];
         arrays.push(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 = '';
-        //   }
-        //   this.responsesList = responses;
-        // })
-        // m.id = '';
       });
-      console.log(data);
+
+
 
       this.getResourceBomVersionListFn(arrays).then(v => {
         if (v.length) {
@@ -571,6 +647,7 @@ export default {
           })
 
           this.list = [...data, ...this.$refs.table.getData()];
+
           this.$refs.table.setData(this.list)
         })
 
@@ -654,10 +731,13 @@ export default {
 
     handleSave() {
       let _list = this.$refs.table.getData() ?? [];
+
+
       if (_list.length == 0) {
         return this.$message.info('明细表最少有一条数据');
       }
       let list = JSON.parse(JSON.stringify(_list));
+
       console.log(list, 'list');
 
       const arr = list.every(v => {
@@ -667,6 +747,10 @@ export default {
       if (!arr) {
         return this.$message.info('用量不能为空')
       }
+
+      // console.log(list);
+      // return 
+
       updateBatchBOM(list).then((res) => {
         if (res) {
           this.$message.success('保存成功');

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

@@ -237,6 +237,7 @@
         if (this.selection.length <= 0) {
           return this.$message.warning('请至少选择一条数据');
         }
+        console.log(this.selection,'我是选择数据');
         this.$emit('selection',this.selection);
         this.handleClose();
       }

+ 351 - 260
src/views/material/BOMmanage/index.vue

@@ -1,59 +1,54 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never">
-      <BOMSearch
-        @search="reload"
-        :statusOpt="statusOpt"
-        :categoryCode="where.categoryCode"
-      />
-      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
+      <BOMSearch @search="reload" :statusOpt="statusOpt" :categoryCode="where.categoryCode" />
+
+      <!--  -->
+      <el-tabs v-model="activeName" type="border-card"  @tab-click="handleClick">
         <el-tab-pane label="EBOM" name="4"> </el-tab-pane>
         <el-tab-pane label="PBOM" name="1"> </el-tab-pane>
         <el-tab-pane label="MBOM" name="2"> </el-tab-pane>
         <el-tab-pane label="ABOM" name="3"> </el-tab-pane>
-        <ele-pro-table
-          ref="table"
-          :columns="columns"
-          :datasource="datasource"
-          class="dict-table"
-          tool-class="ele-toolbar-actions"
-        >
+        <ele-pro-table ref="table" :columns="columns" :datasource="datasource" class="dict-table"
+          tool-class="ele-toolbar-actions"  @sort-change="onSortChange">
           <template v-slot:approvalStatus="{ row }">
-            <el-link
-              type="primary"
-              :underline="false"
-              @click="handleDetails(row)"
-            >
+            <el-link type="primary" :underline="false" @click="handleDetails(row)">
               {{ approvalStatusOpt[+row.approvalStatus] }}
             </el-link>
           </template>
 
           <template v-slot:versions="{ row }">
-              V{{ row.versions }}.0
+            V{{ row.versions }}.0
           </template>
-
-
           <template v-slot:isTemp="{ row }">
             <el-tag size="mini" v-if="row.isTemp == 1">主数据</el-tag>
           </template>
 
+          
+          <template v-slot:rootCategoryLevelId="{ row }">
+            {{  rootCategoryLevelIdText(row.rootCategoryLevelId) }}
+          </template>
+
+          <template v-slot:attributeType="{ row }">
+            {{  attributeTypeText(row.attributeType) }}
+          </template>
+
+          <template v-slot:produceType="{ row }">
+            <el-select v-model="row.produceType" filterable multiple disabled class="ele-block" size="mini">
+            <el-option v-for="item in dictList" :key="item.value" :value="item.value" :label="item.label"></el-option>
+          </el-select>
+          </template>
+          
           <!-- 表头工具栏 -->
           <template v-slot:action="{ row }">
             <el-link type="primary" @click="handelDetail(row)">详情</el-link>
 
-            <el-link
-              v-if="row.status != 1 && (row.approvalStatus == 0  || row.approvalStatus == 3)"
-              type="primary"
-              @click="handSubmit(row)"
-              >发布</el-link
-            >
-
-            <el-link
-              type="danger"
-              :underline="false"
-              v-if="activeName == 1 && row.status != 1 && (row.approvalStatus == 0  || row.approvalStatus == 3)"
-              @click="handDel(row)"
-            >
+            <el-link v-if="row.status != 1 && (row.approvalStatus == 0 || row.approvalStatus == 3)" type="primary"
+              @click="handSubmit(row)">发布</el-link>
+
+            <el-link type="danger" :underline="false"
+              v-if="activeName == 1 && row.status != 1 && (row.approvalStatus == 0 || row.approvalStatus == 3)"
+              @click="handDel(row)">
               删除
             </el-link>
           </template>
@@ -61,13 +56,7 @@
       </el-tabs>
     </el-card>
 
-    <el-dialog
-      title="发布"
-      :visible.sync="isSubmit"
-      v-if="isSubmit"
-      width="30%"
-      center
-    >
+    <el-dialog title="发布" :visible.sync="isSubmit" v-if="isSubmit" width="30%" center>
       <div>
         <el-radio v-model="radioSubmit" :label="1">药品</el-radio>
         <el-radio v-model="radioSubmit" :label="2">器械</el-radio>
@@ -80,271 +69,373 @@
 
     <LCdetail ref="detailRef"></LCdetail>
 
-    <BomDetailsPop  ref="bomDrawer"  ></BomDetailsPop>
+    <BomDetailsPop ref="bomDrawer"></BomDetailsPop>
   </div>
 </template>
 
 <script>
-  import BOMSearch from './components/BOM-search.vue';
-  import {
-    getBomPageList,
-    startAndStop,
-    bomSubmit,
-    jsBomSubmit,
-    deviceBomSubmit,
-    deleteBomTreeList
-  } from '@/api/material/BOM';
-  import LCdetail from './components/LCdetail.vue';
-
-    import BomDetailsPop from '../BOMmanage/detailsPop.vue'
-  export default {
-    name: 'SystemDictionary',
-    components: { BOMSearch, LCdetail, BomDetailsPop },
-    data() {
-      return {
-        // 表格列配置
-        columns: [
-          {
-            label: '序号',
-            columnKey: 'index',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'code',
-            label: 'BOM编码',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'name',
-            label: 'BOM名称',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'categoryCode',
-            label: '编码',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'categoryName',
-            label: '名称',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'specification',
-            label: '规格',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'modelType',
-            label: '型号',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'versions',
-            slot: 'versions',
-            label: '版本'
-          },
-          {
-            prop: 'status ',
-            label: '状态',
-            formatter: (row) => {
-              return this.statusOpt[+row.status];
-            }
-          },
-          {
-            prop: 'approvalStatus',
-            label: '审核状态',
-            slot: 'approvalStatus'
-          },
-
-          // {
-          //   width: 100,
-          //   prop: 'isTemp',
-          //   slot: 'isTemp',
-          //   label: '主数据'
-          // },
-
-          {
-            prop: 'createName',
-            label: '创建人',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'createTime',
-            label: '创建日期',
-            showOverflowTooltip: true
-          },
-          {
-            action: 'action',
-            slot: 'action',
-            label: '操作'
-          }
-        ],
-        statusOpt: {
-          0: '草稿',
-          1: '已发布',
-          2: '已停用'
+import BOMSearch from './components/BOM-search.vue';
+import {
+  getBomPageList,
+  startAndStop,
+  bomSubmit,
+  jsBomSubmit,
+  deviceBomSubmit,
+  deleteBomTreeList
+} from '@/api/material/BOM';
+import LCdetail from './components/LCdetail.vue';
+import { getByCode } from '@/api/system/dictionary-data';
+import BomDetailsPop from '../BOMmanage/detailsPop.vue'
+export default {
+  name: 'SystemDictionary',
+  components: { BOMSearch, LCdetail, BomDetailsPop },
+  data() {
+    return {
+      // 表格列配置
+      columns: [
+        {
+          label: '序号',
+          columnKey: 'index',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'code',
+          label: 'BOM编码',
+          showOverflowTooltip: true,
+          slot: 'code',
+          sortable: true
+        },
+        {
+          prop: 'name',
+          label: 'BOM名称',
+          showOverflowTooltip: true,
+          slot: 'name',
+          sortable: true
+        },
+        {
+          prop: 'categoryCode',
+          label: '编码',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'categoryName',
+          label: '名称',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'specification',
+          label: '规格',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'modelType',
+          label: '型号',
+          showOverflowTooltip: true
         },
 
-        approvalStatusOpt: {
-          0: '未提交',
-          1: '审核中',
-          2: '审核通过',
-          3: '审核不通过'
+        {
+          prop: 'rootCategoryLevelId',
+          slot: 'rootCategoryLevelId',
+          label: '物品分类',
+          showOverflowTooltip: true
+        },
+        {
+          slot: 'attributeType',
+          prop: 'attributeType',
+          label: '属性类型',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'produceType',
+          slot: 'produceType',
+          label: '生产类型',
+          showOverflowTooltip: true
         },
-        loading: false,
-        loadingInstance: null,
-        where: {},
 
-        activeName: '1',
 
-        isSubmit: false,
-        JsRId: null,
-        radioSubmit: 1
-      };
-    },
+        {
+          prop: 'versions',
+          slot: 'versions',
+          label: '版本'
+        },
+        {
+          prop: 'status ',
+          label: '状态',
+          formatter: (row) => {
+            return this.statusOpt[+row.status];
+          }
+        },
+        {
+          prop: 'approvalStatus',
+          label: '审核状态',
+          slot: 'approvalStatus'
+        },
 
-    computed: {
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
-      }
-    },
+        // {
+        //   width: 100,
+        //   prop: 'isTemp',
+        //   slot: 'isTemp',
+        //   label: '主数据'
+        // },
 
-    created() {
+        {
+          prop: 'createName',
+          label: '创建人',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'createTime',
+          label: '创建日期',
+          showOverflowTooltip: true,
+          slot: 'createTime',
+          sortable: true
+        },
+        {
+          action: 'action',
+          slot: 'action',
+          label: '操作'
+        }
+      ],
+      statusOpt: {
+        0: '草稿',
+        1: '已发布',
+        2: '已停用'
+      },
 
-    },
-    methods: {
+      approvalStatusOpt: {
+        0: '未提交',
+        1: '审核中',
+        2: '审核通过',
+        3: '审核不通过'
+      },
+      loading: false,
+      loadingInstance: null,
+      dictList:[],
+      where: {},
+      attributeList: [
+        {
+          label: '总装',
+          value: 1
+        },
+        {
+          label: '部件',
+          value: 2
+        },
+        {
+          label: '零件',
+          value: 3
+        },
+        {
+          label: '原材料',
+          value: 4
+        }
+      ],
+      sort:{},
+      rootCategoryLevelIdList: [
+        {
+          label: '产品',
+          value: 9
+        },
+        {
+          label: '物料',
+          value: 1
+        },
+        {
+          label: '生产设备',
+          value: 4
+        },
+        {
+          label: '模具',
+          value: 5
+        }
+      ],
+      activeName: '1',
 
+      isSubmit: false,
+      JsRId: null,
+      radioSubmit: 1
+    };
+  },
 
+  computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    }
+  },
 
-      handSubmit(row) {
-        if (this.clientEnvironmentId == 5) {
-          this.JsRId = row.id;
-          this.isSubmit = true;
-        } else {
-          this.$alert('确定要发布吗?', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          })
-            .then(() => {
-              bomSubmit({ businessId: row.id }).then((res) => {
-                if(res?.code == '0') {
-                  this.$message.success('发布成功');
-                  this.reload();
-                }
-
-              });
-            })
-            .catch(() => {});
-        }
-      },
+  created() {
+    this.getDictList('productionType');
+  },
+  methods: {
+    attributeTypeText(v){
+      if(v){
+        let a = this.attributeList.find(item=>item.value==v)
+        return a.label
+      }
+    },
+    rootCategoryLevelIdText(v){
+      if(v){
+        let a = this.rootCategoryLevelIdList.find(item=>item.value==v)
+        return a.label
+      }
+    },
+
+    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]]
+        };
+      });
+    },
 
-      handJsSubmit() {
-        let URL = this.radioSubmit == 1 ? jsBomSubmit : deviceBomSubmit;
+    handSubmit(row) {
+      if (this.clientEnvironmentId == 5) {
+        this.JsRId = row.id;
+        this.isSubmit = true;
+      } else {
         this.$alert('确定要发布吗?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         })
           .then(() => {
-            URL({ businessId: this.JsRId }).then((res) => {
-              this.isSubmit = false;
-              this.$message.success('发布成功');
-              this.reload();
+            bomSubmit({ businessId: row.id }).then((res) => {
+              if (res?.code == '0') {
+                this.$message.success('发布成功');
+                this.reload();
+              }
 
             });
           })
-          .catch(() => {});
-      },
+          .catch(() => { });
+      }
+    },
 
-      /* 表格数据源 */
-      datasource({ where, page, limit }) {
-        return getBomPageList({
-          ...where,
-          bomType: Number(this.activeName),
-          isTemp: true,
-          pageNum: page,
-          size: limit
-        });
-      },
-      handelDetail(row) {
-        let rowData = {
-          categoryId: row.categoryId,
-          categoryName: row.categoryName,
-          code: row.code,
-          versions: row.versions,
-          rootPathIdParent: row.categoryLevelPathIdParent,
-          isProduct:true,
-          bomType: Number(this.activeName),
-          isTemp: row.isTemp
-        };
-        this.$refs.bomDrawer.open(rowData);
+    handJsSubmit() {
+      let URL = this.radioSubmit == 1 ? jsBomSubmit : deviceBomSubmit;
+      this.$alert('确定要发布吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          URL({ businessId: this.JsRId }).then((res) => {
+            this.isSubmit = false;
+            this.$message.success('发布成功');
+            this.reload();
 
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ where });
-      },
+          });
+        })
+        .catch(() => { });
+    },
+
+    /* 表格数据源 */
+    datasource({ where, page, limit }) {
+      return getBomPageList({
+        ...where,
+        ...this.sort,
+        bomType: Number(this.activeName),
+        isTemp: true,
+        pageNum: page,
+        size: limit
+      });
+    },
+    handelDetail(row) {
+      let rowData = {
+        categoryId: row.categoryId,
+        categoryName: row.categoryName,
+        code: row.code,
+        versions: row.versions,
+        rootPathIdParent: row.categoryLevelPathIdParent,
+        isProduct: true,
+        bomType: Number(this.activeName),
+        isTemp: row.isTemp
+        
+      };
+      this.$refs.bomDrawer.open(rowData);
+
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ where });
+    },
 
-      handleClick(tab) {
-        this.activeName = tab.name;
+    handleClick(tab) {
+      this.activeName = tab.name;
+      this.reload();
+    },
+
+    onSortChange(e) {
+        console.log(111111111,e);
+
+        let sort = {
+          orderBy: e.order,
+          sortName: e.prop,
+        };
+        this.sort = sort;
         this.reload();
       },
 
-      handDel(row) {
-        this.$confirm('是否确认删除?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
+    handDel(row) {
+      this.$confirm('是否确认删除?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          deleteBomTreeList([row.id]).then(() => {
+            this.reload();
+          });
         })
-          .then(() => {
-            deleteBomTreeList([row.id]).then(() => {
-              this.reload();
-            });
-          })
-          .catch(() => {
-            this.$message({
-              type: 'info',
-              message: '已取消删除'
-            });
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
           });
-      },
+        });
+    },
 
-      handleDetails(row) {
-        if (!row.processInstanceId) {
-          this.$message.info('未提交没有审核流程');
-        } else {
-          this.$refs.detailRef.open(row.processInstanceId);
-        }
+    handleDetails(row) {
+      if (!row.processInstanceId) {
+        this.$message.info('未提交没有审核流程');
+      } else {
+        this.$refs.detailRef.open(row.processInstanceId);
       }
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .ele-body {
+.ele-body {
+  height: 100%;
+
+  ::v-deep .el-card {
     height: 100%;
-    ::v-deep .el-card {
+
+    .el-card__body {
       height: 100%;
-      .el-card__body {
-        height: 100%;
+      display: flex;
+      flex-direction: column;
+
+      .dict-table {
+        flex: 1;
+        overflow: hidden;
         display: flex;
         flex-direction: column;
-        .dict-table {
+
+        .el-table {
           flex: 1;
-          overflow: hidden;
-          display: flex;
-          flex-direction: column;
-          .el-table {
-            flex: 1;
-            overflow-y: auto;
-          }
+          overflow-y: auto;
         }
       }
     }
   }
+}
 </style>

+ 2 - 1
src/views/material/product/components/index-data.vue

@@ -273,7 +273,7 @@
       rootId: [Number, String],
 
       rootTreeId: [Number, String],
-
+      lyType:[String],
       oneProduct: Boolean,
       currentData: Object
     },
@@ -500,6 +500,7 @@
         this.$router.push({
           path: '/material/product/detail',
           query: {
+            lyType:this.lyType,
             id: row.id ? row.id : null,
             status: status,
             rootId: this.rootId,

+ 53 - 16
src/views/material/product/detail.vue

@@ -30,22 +30,36 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="属性类型:" prop="attributeType">
+            <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-col :span="8">
+            <div>
+              <el-form-item label="属性类型" prop="produceType">
+                <el-select style="width: 100%" v-model="form.componentAttribute" filterable multiple>
+                  <el-option v-for="item in lbjtList" :key="item.value" :value="item.value"
+                    :label="item.label"></el-option>
+                </el-select>
+              </el-form-item>
+            </div>
 
+          </el-col>
           <el-col :span="8">
-            <el-form-item label="生产类型" prop="produceType">
-              <el-select style="width: 100%" v-model="form.produceType" filterable multiple>
-                <el-option v-for="item in dictList" :key="item.value" :value="item.value"
-                  :label="item.label"></el-option>
-              </el-select>
-            </el-form-item>
+            <div>
+              <el-form-item label="生产类型" prop="produceType">
+                <el-select style="width: 100%" v-model="form.produceType" filterable multiple>
+                  <el-option v-for="item in dictList" :key="item.value" :value="item.value"
+                    :label="item.label"></el-option>
+                </el-select>
+              </el-form-item>
+            </div>
+
           </el-col>
+          
 
           <el-col :span="8">
             <!-- v-if="
@@ -294,16 +308,18 @@ export default {
       ],
       form: {
         categoryLevelGroupName: '',
+        componentAttribute: [],
         categoryLevelName: '',
-        isConsumable: 1,
+        isConsumable: 0,
         measuringUnit: '',
         netWeight: '',
-        attributeType: '',
+        attributeType: 1,
         weightUnit: '',
         packingUnit: '',
 
         extField: {}
       },
+      lbjtList:[],
       attributeList: [
         {
           label: '总装',
@@ -345,8 +361,16 @@ export default {
       packageDispositionVOList: [],
       categoryLevelPathId: null,
 
-      dictList: [],
-
+      dictList: [
+        {
+          label: '自制件',
+          value: 1
+        },
+        {
+          label: '装配件',
+          value: 3
+        },
+      ],
       fileList: [],
       // 表单验证规则
       rules: {
@@ -398,10 +422,22 @@ export default {
         if (id) {
           this._getDetails();
         } else {
+          let { lyType} = this.$route.query;
+
+          let arrId = '';
+          if(lyType=="wp"){
+            arrId = 3
+          }
+          if(lyType=="cp"){
+            arrId = 1
+          }
+          
           this.form = {
             categoryLevelGroupName: '',
             // categoryLevelName: '',
-            isConsumable: 1,
+            componentAttribute: [],
+            isConsumable: 0,
+            attributeType: arrId,
             measuringUnit: '',
             netWeight: '',
             weightUnit: '',
@@ -432,7 +468,7 @@ export default {
           this.packageDispositionVOList = [];
           this.categoryLevelPathId = null;
 
-          this.dictList = [];
+          // this.dictList = [];
 
           this.fileList = [];
         }
@@ -456,7 +492,7 @@ export default {
 
     this.getFieldModel();
 
-    this.getDictList('productionType');
+    this.getDictList('zeroPartPros');
   },
   async created() {
     //新增
@@ -490,7 +526,7 @@ export default {
 
     this.getFieldModel();
 
-    this.getDictList('productionType');
+    this.getDictList('zeroPartPros');
   },
   methods: {
     inputSpe(val) {
@@ -707,7 +743,7 @@ export default {
 
     async getDictList(code) {
       let { data: res } = await getByCode(code);
-      this.dictList = res.map((item) => {
+      this.lbjtList = res.map((item) => {
         let values = Object.keys(item);
         return {
           value: Number(values[0]),
@@ -752,6 +788,7 @@ export default {
 
     // 保存
     submit() {
+
       this.$refs.manageForm.validate(async (valid) => {
         let productionValid = await this.$refs.productionRefs.getFormValid();
         let warehouseValid = await this.$refs.warehouseRefs.getFormValid();

+ 2 - 0
src/views/material/product/index.vue

@@ -76,6 +76,7 @@
 
             <IndexSearch ref="searchRef" @search="reload" />
 
+            <!-- 物品 -->
             <IndexData
               ref="listData"
               v-if="current"
@@ -85,6 +86,7 @@
               :rootId="rootId"
               :oneProduct="false"
               :currentData="currentData"
+              lyType="wp"
             >
             </IndexData>
           </div>

+ 3 - 0
src/views/material/product/oneProduct.vue

@@ -17,6 +17,7 @@
             @node-click="handleNodeClick"
           ></el-tree>
         </div>
+
         <template v-slot:content>
           <div class="ele-border-lighter form-content" v-loading="loading">
             <div class="form-wrapper">
@@ -75,6 +76,7 @@
 
             <IndexSearch  ref="searchRef"  @search="reload" />
             
+            <!-- //产品 -->
             <IndexData
               ref="listData"
               v-if="current"
@@ -84,6 +86,7 @@
               :currentData="currentData"
               :rootId="rootId"
               :oneProduct="true"
+              lyType="cp"
             >
             </IndexData>