Jelajahi Sumber

Merge remote-tracking branch 'origin/dev' into dev

mazheng 1 tahun lalu
induk
melakukan
cd1e143b83

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

@@ -167,6 +167,18 @@ export async function convert(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 转换 ABOM
+export async function convertABom(data) {
+  const res = await request.post(`/main/bomCategory/convertABom`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
 // 文档
 export async function getBomFilePageList(params) {
   const res = await request.get(`/main/bomfile/page`, { params });

+ 124 - 0
src/views/material/BOMmanage/components/BOM-search.vue

@@ -0,0 +1,124 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="BOM编码">
+          <el-input clearable v-model.trim="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="BOM名称">
+          <el-input clearable v-model.trim="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="产品编码">
+          <el-input
+            clearable
+            v-model.trim="where.categoryCode"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="产品名称">
+          <el-input
+            clearable
+            v-model.trim="where.categoryName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item label="状态">
+          <el-select
+            clearable
+            v-model.trim="where.status"
+            placeholder="请选择"
+            class="w100"
+          >
+            <el-option
+              v-for="item in Object.entries(statusOpt)"
+              :key="item[0]"
+              :label="item[1]"
+              :value="item[0]"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="组织机构:">
+          <auth-selection v-model.trim="where.deptIds" style="width: 100%"></auth-selection>
+        </el-form-item>
+      </el-col>
+
+
+
+
+      <el-col v-bind="styleResponsive ? { md: 12 } : { span: 12 }">
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+
+          <el-button @click="reset" icon="el-icon-refresh" class="ele-btn-icon"
+            >重置</el-button
+          >
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    props: {
+      statusOpt: Object,
+      categoryCode: String
+    },
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        categoryCode: this.categoryCode,
+        categoryName: '',
+        status: '',
+
+      };
+      return {
+        defaultWhere,
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 139 - 120
src/views/material/BOMmanage/components/attribute.vue

@@ -1,22 +1,142 @@
 <template>
   <div>
     <el-form label-width="100px" ref="form" :model="attributeData">
-
-
       <el-row>
-        <el-col :span="16" label-width="100px">
-          <el-form-item label="编码" prop="code">
-            <el-input placeholder="" v-model="attributeData.code"></el-input>
+        <el-col :span="8"  label-width="100px">
+          <el-form-item label="名称:" prop="category.name">
+            <el-input
+              placeholder=""
+              v-model="category.name"
+              disabled
+            ></el-input>
           </el-form-item>
         </el-col>
-      </el-row>
 
-      <el-row>
-        <el-col :span="16" label-width="100px">
-          <el-form-item label="名称" prop="name">
-            <el-input placeholder="" v-model="attributeData.name"></el-input>
-          </el-form-item>
-        </el-col>
+ 
+          <el-col :span="8"  label-width="100px">
+            <el-form-item label="编码:" prop="code">
+              <el-input
+                placeholder=""
+                v-model="category.code"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="牌号:" prop="brandNum">
+              <el-input
+                placeholder=""
+                v-model="category.brandNum"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="型号:" prop="modelType">
+              <el-input
+                placeholder=""
+                v-model="category.modelType"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="规格:" prop="specification">
+              <el-input
+                placeholder=""
+                v-model="category.specification"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="计量单位:" prop="measuringUnit">
+              <el-input
+                placeholder=""
+                v-model="category.measuringUnit"
+                disabled
+              ></el-input>
+              
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="重量单位:" prop="weightUnit">
+
+              <el-input
+                placeholder=""
+                v-model="category.weightUnit"
+                disabled
+              ></el-input>
+
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="包装单位:" prop="packingUnit">
+              <el-input
+                placeholder=""
+                v-model="category.packingUnit"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="毛重:" prop="roughWeight">
+              <el-input
+                placeholder=""
+                v-model="category.roughWeight"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="净重:" prop="netWeight">
+              <el-input
+                placeholder=""
+                v-model="category.netWeight"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item
+              label="加工类型:"
+              prop="isConsumable"
+              v-if="
+                [1, 23, 9, 28].includes(Number(category.categoryLevelPathId))
+              "
+            >
+            <el-input
+                placeholder=""
+                :v-model="category.isConsumable == 1 ? '批量' : '单件'"
+                disabled
+              ></el-input>
+   
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="8" label-width="100px">
+            <el-form-item label="生产类型:" prop="produceType">
+              <el-input
+                placeholder=""
+                :v-model="  category.produceType &&
+                ['自制件', '采购件', '装配件', '外协件'][
+                  category.produceType - 1
+                ]"
+                disabled
+              ></el-input>
+          
+            </el-form-item>
+          </el-col>
+       
       </el-row>
 
       <el-row>
@@ -137,106 +257,16 @@
         </el-col>
       </el-row>
 
-      <el-row style="margin-top: 18px">
-        <el-divider>产品信息</el-divider>
-
-        <el-col style="margin-top: 18px" :span="12" label-width="100px">
-          <el-form-item label="产品:" prop="category.name">
-            <el-input
-              placeholder="请选择产品"
-              @click.native="handleProduct()"
-              v-model="category.name"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-
-        <div v-if="category.name">
-          <el-col style="margin-top: 18px" :span="12" label-width="100px">
-            <el-form-item label="编码:" prop="code">
-              {{ category.code }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="牌号:" prop="brandNum">
-              {{ category.brandNum }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="型号:" prop="modelType">
-              {{ category.modelType }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="规格:" prop="specification">
-              {{ category.specification }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="计量单位:" prop="measuringUnit">
-              {{ category.measuringUnit }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="重量单位:" prop="weightUnit">
-              {{ category.weightUnit }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="包装单位:" prop="packingUnit">
-              {{ category.packingUnit }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="毛重:" prop="roughWeight">
-              {{ category.roughWeight }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="净重:" prop="netWeight">
-              {{ category.netWeight }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item
-              label="加工类型:"
-              prop="isConsumable"
-              v-if="
-                [1, 23, 9, 28].includes(Number(category.categoryLevelPathId))
-              "
-            >
-              {{ category.isConsumable == 1 ? '批量' : '单件' }}
-            </el-form-item>
-          </el-col>
-        </div>
-      </el-row>
-
-      <div class="btn_box">
+      <!-- <div class="btn_box">
         <el-button type="primary">修改</el-button>
-      </div>
+      </div> -->
     </el-form>
-
-    <standardOutput
-      ref="standardOutputRefs"
-      @selection="chooseStandardList"
-    ></standardOutput>
   </div>
 </template>
 
 <script>
-  import standardOutput from './standardOutput.vue';
   export default {
-    components: {
-      standardOutput
-    },
+    components: {},
     data() {
       return {
         form: {},
@@ -265,27 +295,16 @@
           {
             label: 'ABOM',
             value: '3'
-          }
+          },
+     
         ]
       };
     },
 
     created() {},
 
-    beforeDestroy() {
-      this.category = { name: '' };
-    },
-    methods: {
-      handleProduct() {
-        this.$refs.standardOutputRefs.open(9);
-      },
-      chooseStandardList(type, data) {
-        if (type == 9) {
-          this.category = data[0];
-          this.$forceUpdate();
-        }
-      }
-    },
+    beforeDestroy() {},
+    methods: {},
     props: {
       attributeData: {
         type: Object,

+ 1 - 1
src/views/material/BOMmanage/components/baseInfo.vue

@@ -8,7 +8,7 @@
       <el-col :span="6" label-width="100px">
       <el-form-item label="类型" prop="type">
 
-        {{ dataInfo.bomType == 1 ? "PBOM" :  dataInfo.bomType == 2 ? 'MBOM' :   dataInfo.bomType == 3 ? 'ABOM' : ''}}
+        {{ dataInfo.bomType == 1 ? "PBOM" :  dataInfo.bomType == 2 ? 'MBOM' :   dataInfo.bomType == 3 ? 'ABOM'  : ''}}
           </el-form-item>
           </el-col>
 

+ 31 - 102
src/views/material/BOMmanage/components/bomTreeDialog.vue

@@ -27,7 +27,7 @@
               :options="bomTreeList"
               @getValue="getTreeValue"
               :props="{
-                value: 'bomId',
+                value: 'id',
                 label: 'name',
                 children: 'children'
               }"
@@ -58,11 +58,14 @@
 
         <el-col :span="12" label-width="100px">
           <el-form-item label="编码" prop="code">
-            <el-input placeholder="" v-model="attributeData.code"></el-input>
+            <el-input
+              placeholder=""
+              @click.native="handleProduct()"
+              v-model="attributeData.code"
+            ></el-input>
           </el-form-item>
         </el-col>
 
-
         <el-col :span="12" label-width="100px">
           <el-form-item label="名称" prop="name">
             <el-input placeholder="" v-model="attributeData.name"></el-input>
@@ -96,10 +99,6 @@
           </el-form-item>
         </el-col>
 
-
-
-        
-
         <el-col :span="12" label-width="100px">
           <el-form-item label="用量" prop="dosage">
             <el-input placeholder="" v-model="attributeData.dosage"></el-input>
@@ -162,88 +161,6 @@
           </el-form-item>
         </el-col>
       </el-row>
-
-      <el-row style="margin-top: 18px">
-        <el-divider>产品信息</el-divider>
-
-        <el-col style="margin-top: 18px" :span="12" label-width="100px">
-          <el-form-item label="产品:" prop="category.name">
-            <el-input
-              placeholder="请选择产品"
-              @click.native="handleProduct()"
-              v-model="category.name"
-            ></el-input>
-          </el-form-item>
-        </el-col>
-
-        <div v-if="category.name">
-          <el-col style="margin-top: 18px" :span="12" label-width="100px">
-            <el-form-item label="编码:" prop="code">
-              {{ category.code }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="牌号:" prop="brandNum">
-              {{ category.brandNum }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="型号:" prop="modelType">
-              {{ category.modelType }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="规格:" prop="specification">
-              {{ category.specification }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="计量单位:" prop="measuringUnit">
-              {{ category.measuringUnit }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="重量单位:" prop="weightUnit">
-              {{ category.weightUnit }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="包装单位:" prop="packingUnit">
-              {{ category.packingUnit }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="毛重:" prop="roughWeight">
-              {{ category.roughWeight }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item label="净重:" prop="netWeight">
-              {{ category.netWeight }}
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12" label-width="100px">
-            <el-form-item
-              label="加工类型:"
-              prop="isConsumable"
-              v-if="
-                [1, 23, 9, 28].includes(Number(category.categoryLevelPathId))
-              "
-            >
-              {{ category.isConsumable == 1 ? '批量' : '单件' }}
-            </el-form-item>
-          </el-col>
-        </div>
-      </el-row>
     </el-form>
     <div class="btns">
       <el-button type="primary" size="small" @click="save">保存</el-button>
@@ -260,7 +177,7 @@
 <script>
   import { getBomTreeList, saveBomTreeList } from '@/api/material/BOM.js';
   import selectTree from '@/components/selectTree';
-  import producetask from '@/api/technology/production';
+
   import userSearch from './user-search.vue';
   import standardOutput from './standardOutput.vue';
   export default {
@@ -283,9 +200,6 @@
         },
 
         rules: {
-          parentId: [
-            { required: true, message: '请选择父级节点', trigger: 'change' }
-          ],
           code: [{ required: true, message: '请选择编码', trigger: 'change' }],
 
           name: [{ required: true, message: '请选择名称', trigger: 'change' }]
@@ -304,24 +218,33 @@
         bomTypeOptions: [
           {
             label: 'PBOM',
-            value: "1"
+            value: '1'
           },
           {
             label: 'MBOM',
-            value: "2"
+            value: '2'
           },
           {
             label: 'ABOM',
-            value: "3"
-          }
+            value: '3'
+          },
+       
         ]
       };
     },
 
     methods: {
       getTreeValue(data) {
-        this.attributeData.parentId = data.id;
-        this.attributeData.level = +data.level + 1;
+        this.category = {};
+        this.$set(this.attributeData, 'code', null);
+        this.$set(this.attributeData, 'name', null);
+        if (data) {
+          this.attributeData.parentId = data.id;
+          this.attributeData.level = +data.level + 1;
+        } else {
+          this.attributeData.parentId = null;
+          this.attributeData.level = null;
+        }
       },
       save() {
         this.$refs.form.validate((valid) => {
@@ -348,21 +271,25 @@
       },
 
       handleProduct() {
-        this.$refs.standardOutputRefs.open(9);
+        this.$refs.standardOutputRefs.open(this.attributeData.parentId ? 1 : 9);
       },
       chooseStandardList(type, data) {
-        if (type == 9) {
+        if (type == 9 || type == 1) {
           this.category = data[0];
+          this.$set(this.attributeData, 'code', data[0].code);
+          this.$set(this.attributeData, 'name', data[0].name);
           this.$forceUpdate();
         }
       },
 
-      async open(type, versions, categoryId) {
+      async open(type, versions, categoryId, treeId) {
         this.attributeData = {};
         this.attributeData.bomType = type;
         this.attributeData.categoryId = categoryId;
         this.attributeData.versions = versions;
         this.versions = versions;
+
+        console.log(treeId);
         const res = await getBomTreeList({
           categoryId,
           versions,
@@ -370,6 +297,8 @@
         });
         console.log(this.attributeData);
         this.bomTreeList = res.data;
+        this.attributeData.parentId = treeId;
+        this.$forceUpdate();
         this.visible = true;
       },
       handleClose() {

+ 40 - 14
src/views/material/BOMmanage/details.vue

@@ -4,7 +4,15 @@
       <ele-split-layout
         width="260px"
         allow-collapse
+        :resizable="true"
+        :min-size="200"
+        :max-size="-200"
+        :left-style="{
+          overflow: 'hidden',
+          width: '100%'
+        }"
         :right-style="{ overflow: 'hidden' }"
+        :responsive="false"
       >
         <div class="ele-border-lighter sys-organization-list">
           <div class="radio_box rx-cc">
@@ -16,6 +24,7 @@
               <el-radio-button :label="1">PBOM</el-radio-button>
               <el-radio-button :label="2">MBOM</el-radio-button>
               <el-radio-button :label="3">ABOM</el-radio-button>
+
             </el-radio-group>
           </div>
 
@@ -36,7 +45,11 @@
             :highlight-current="true"
             node-key="id"
             @node-click="handleNodeClick"
-          ></el-tree>
+          >
+            <span class="custom-tree-node" slot-scope="{ node, data }">
+              {{ node.label }} / {{ data.code }}
+            </span>
+          </el-tree>
         </div>
         <template v-slot:content>
           <div class="pbom-box">
@@ -75,10 +88,22 @@
                 size="mini"
                 icon="el-icon-refresh"
                 plain
-                @click="transformation"
+                @click="transformation('M')"
                 v-if="currentNodeData.bomType == 1"
                 >转换MBOM</el-button
               >
+
+              <el-button
+                type="primary"
+                size="mini"
+                icon="el-icon-refresh"
+                plain
+                @click="transformation('A')"
+                v-if="currentNodeData.bomType == 1"
+                >转换ABOM</el-button
+              >
+
+   
               <div v-if="!noBack" class="back-btn">
                 <el-button size="mini" icon="el-icon-back" @click="back"
                   >返回</el-button
@@ -86,13 +111,7 @@
               </div>
             </div>
 
-     
-
-            <baseInfo
-              :dataInfo="currentNodeData"
-            
-            />
-
+            <baseInfo :dataInfo="currentNodeData" />
 
             <el-tabs
               v-model="activeName"
@@ -140,6 +159,8 @@
     getBomTreeList,
     getBomGetById,
     convert,
+    convertABom,
+    convertCBom,
     deleteBomTreeList
   } from '@/api/material/BOM.js';
   import { getTreeByGroup } from '@/api/classifyManage';
@@ -180,7 +201,8 @@
         categoryId: 1,
         versions: null,
         loadingInstance: null,
-        noBack: false
+        noBack: false,
+        treeId: null
       };
     },
     mounted() {
@@ -205,8 +227,9 @@
         this.versions = this.$route.query.versions;
         this.categoryId = this.$route.query.categoryId;
         this.noBack = this.$route.query.noBack;
+
         (this.currentNodeData = {
-          bomType: 1,
+          bomType: this.$route.query.bType || 1,
           children: []
         }),
           this.getTreeData();
@@ -256,13 +279,14 @@
       back() {
         this.$router.go(-1);
       },
-      transformation() {
+      transformation(tt) {
         this.loadingInstance = this.$loading({
           lock: true,
           text: '转换中...',
           background: 'rgba(0, 0, 0, 0.7)'
         });
-        convert({ versions: this.versions, categoryId: this.categoryId }).then(
+        let ULR = tt == 'M' ? convert : tt == 'A' ? convertABom : ''
+        ULR({ versions: this.versions, categoryId: this.categoryId }).then(
           (data) => {
             if (data.code == '0') {
               this.loadingInstance.close();
@@ -275,7 +299,8 @@
         this.$refs.bomTreeDialogRef.open(
           this.currentNodeData.bomType,
           this.versions,
-          this.categoryId
+          this.categoryId,
+          this.treeId
         );
       },
       async getTreeData() {
@@ -307,6 +332,7 @@
       },
 
       handleNodeClick(data) {
+        this.treeId = data.id;
         this.handBomDetails(data.id);
       },
 

+ 48 - 29
src/views/material/BOMmanage/index.vue

@@ -6,37 +6,43 @@
         :statusOpt="statusOpt"
         :categoryCode="where.categoryCode"
       />
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        :initLoad="false"
-        class="dict-table"
-        tool-class="ele-toolbar-actions"
-      >
-        <!-- 表头工具栏 -->
-        <template v-slot:action="{ row }">
-          <el-link
-            style="margin-right: 20px"
-            type="primary"
-            @click="handelDetail(row)"
-            >详情</el-link
-          >
-          <el-switch
-            :active-value="'1'"
-            :inactive-value="'0'"
-            @change="openBom(row, $event)"
-            v-model="row.status"
-          >
-          </el-switch>
-        </template>
-      </ele-pro-table>
+      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
+        <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"
+          :initLoad="false"
+          class="dict-table"
+          tool-class="ele-toolbar-actions"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:action="{ row }">
+            <el-link
+              style="margin-right: 20px"
+              type="primary"
+              @click="handelDetail(row)"
+              >详情</el-link
+            >
+            <el-switch
+              :active-value="'1'"
+              :inactive-value="'0'"
+              @change="openBom(row, $event)"
+              v-model="row.status"
+            >
+            </el-switch>
+          </template>
+        </ele-pro-table>
+      </el-tabs>
     </el-card>
   </div>
 </template>
 
 <script>
-  import BOMSearch from '../materialBOM/components/BOM-search.vue';
+  import BOMSearch from './components/BOM-search.vue';
   import { getBomPageList, startAndStop } from '@/api/material/BOM';
 
   export default {
@@ -108,7 +114,9 @@
         },
         loading: false,
         loadingInstance: null,
-        where: {}
+        where: {},
+
+        activeName: "1"
       };
     },
     mounted() {
@@ -129,7 +137,6 @@
             pageNum: 1,
             size: 10
           }).then((data) => {
-     
             if (data.count > 1) {
               this.$refs.table.setData(data.list || []);
             } else {
@@ -162,6 +169,7 @@
       datasource({ where, page, limit }) {
         return getBomPageList({
           ...where,
+          bomType:  Number(this.activeName),
           pageNum: page,
           size: limit
         });
@@ -169,7 +177,7 @@
       handelDetail(row, noBack) {
         this.$router.push({
           path: '/material/BOMmanage/details',
-          query: { versions: row.versions, categoryId: row.categoryId, noBack }
+          query: { versions: row.versions, categoryId: row.categoryId, noBack, bType:this.activeName }
         });
       },
       /* 刷新表格 */
@@ -224,6 +232,17 @@
           .catch((e) => {
             this.loading = false;
           });
+      },
+
+      handleClick(tab) {
+        this.activeName = tab.name
+        getBomPageList({
+          pageNum: 1,
+          size: 10,
+          bomType:  Number(this.activeName)
+        }).then((data) => {
+          this.$refs.table.setData(data.list || []);
+        });
       }
     }
   };

+ 1 - 1
vue.config.js

@@ -33,7 +33,7 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.1.124:50001',
         // target: 'http://192.168.1.147:18086',
-        target: 'http://localhost:18086',
+        target: 'http://192.168.1.125:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''