소스 검색

产品管理-修改 bom和工艺路线列表接口调试

longfenglin 1 년 전
부모
커밋
0d2f2ca341
2개의 변경된 파일51개의 추가작업 그리고 10개의 파일을 삭제
  1. 13 2
      src/api/material/list.js
  2. 38 8
      src/views/material/product/components/link-msg.vue

+ 13 - 2
src/api/material/list.js

@@ -70,15 +70,26 @@ export async function removeMaterial(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-//根据产品ID获取bom列表、工艺路线列表【产品管理】
+//根据产品ID bom获取工艺路线列表【产品管理】
 export async function getBomRoutingList(categoryId) {
-  const res = await request.get(`/main/category/getSourceList/${categoryId}`);
+  const res = await request.get(`/main/bomCategory/bomRoutingListByCategoryId/${categoryId}`);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
+
+// 根据产品ID获取bom列表
+export async function getBomAssociationList(params) {
+  const res = await request.get(`/main/bomCategory/getList`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
 // 产品工序与模具关联
 export async function categoryTaskPallet(data) {
   const res = await request.post(`/main/category/categoryTaskPallet`, data);

+ 38 - 8
src/views/material/product/components/link-msg.vue

@@ -12,6 +12,9 @@
       ></el-tab-pane>
       <el-tab-pane label="工艺路线">
         <ele-pro-table :columns="pathColumn" :datasource="pathData">
+          <template v-slot:bomCategoryType="{ row }">
+            {{ row.bomCategoryType == 2 ? 'MBOM' : row.bomCategoryType == 1 ? 'PBOM' : row.bomCategoryType == 3 ? 'ABom' : '' }}
+          </template>
         </ele-pro-table
       ></el-tab-pane>
       <!-- <el-tab-pane label="质量标准"></el-tab-pane> -->
@@ -104,7 +107,7 @@
 </template>
 
 <script>
-  import { getBomRoutingList } from '@/api/material/list.js';
+  import { getBomRoutingList, getBomAssociationList } from '@/api/material/list.js';
   import { saveSupplier, deleteSupplie } from '@/api/material/BOM.js';
   import { getRelatesInformationList } from '@/api/material/product.js';
   import dictMixins from '@/mixins/dictMixins';
@@ -176,7 +179,7 @@
           },
           {
             label: '版本号',
-            prop: 'version'
+            prop: 'versions'
           },
           {
             label: '基本数量',
@@ -188,6 +191,23 @@
           }
         ],
         pathColumn: [
+          {
+            label: 'BOM编码',
+            prop: 'bomCategoryCode'
+          },
+          {
+            label: 'BOM名称',
+            prop: 'bomCategoryName'
+          },
+          {
+            slot: 'bomCategoryType',
+            label: 'BOM类型',
+            showOverflowTooltip: true
+          },
+          {
+            label: 'BOM版本',
+            prop: 'bomCategoryVersion'
+          },
           {
             label: '工艺路线编码',
             prop: 'code'
@@ -356,7 +376,8 @@
       id: {
         handler(val) {
           if (val) {
-            this.getData();
+            this.getBomData();
+            this.getRoutingData();
             this.contactQueryByCategoryIdsAPI(2);
             this.contactQueryByCategoryIdsAPI(3);
           }
@@ -377,11 +398,20 @@
       this.requestDict('重量单位');
     },
     methods: {
-      async getData() {
-        const data = await getBomRoutingList(this.id);
-
-        this.bomData = data?.bomList || [];
-        this.pathData = data?.routingList || [];
+      //BOM列表
+      async getBomData() {
+        const data = await getBomAssociationList({
+            categoryId: this.id,
+            versions: '',
+            bomType: 1,
+            isTemp: 0
+        });
+        this.bomData = data || [];
+      },
+      //工艺路线
+      async getRoutingData(){
+        const data =await getBomRoutingList(this.id);
+        this.pathData = data || [];
       },
       // 关联设备
       async getEqData() {