ysy 1 rok temu
rodzic
commit
6beb77ff49

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

@@ -176,6 +176,16 @@ export async function convertABom(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 转换 CBOM
+export async function convertCBom(data) {
+  const res = await request.post(`/main/bomCategory/convertCBom`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
 
 // 文档
 export async function getBomFilePageList(params) {

+ 4 - 0
src/views/material/BOMmanage/components/attribute.vue

@@ -295,6 +295,10 @@
           {
             label: 'ABOM',
             value: '3'
+          },
+          {
+            label: 'CBOM',
+            value: '4'
           }
         ]
       };

+ 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' :  dataInfo.bomType == 4 ? 'CBOM' : ''}}
           </el-form-item>
           </el-col>
 

+ 4 - 0
src/views/material/BOMmanage/components/bomTreeDialog.vue

@@ -227,6 +227,10 @@
           {
             label: 'ABOM',
             value: '3'
+          },
+          {
+            label: 'CBOM',
+            value: '4'
           }
         ]
       };

+ 37 - 16
src/views/material/BOMmanage/details.vue

@@ -2,9 +2,17 @@
   <div class="ele-body">
     <el-card shadow="never">
       <ele-split-layout
-        width="260px"
+        width="320px"
         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-button :label="4">CBOM</el-radio-button>
             </el-radio-group>
           </div>
 
@@ -36,7 +45,12 @@
             :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">
@@ -85,11 +99,22 @@
                 size="mini"
                 icon="el-icon-refresh"
                 plain
-              @click="transformation('A')"
+                @click="transformation('A')"
                 v-if="currentNodeData.bomType == 1"
                 >转换ABOM</el-button
               >
 
+              <el-button
+                type="primary"
+                size="mini"
+                icon="el-icon-refresh"
+                plain
+                @click="transformation('C')"
+                v-if="currentNodeData.bomType == 1"
+                >转换CBOM</el-button
+              >
+
+
               <div v-if="!noBack" class="back-btn">
                 <el-button size="mini" icon="el-icon-back" @click="back"
                   >返回</el-button
@@ -97,13 +122,7 @@
               </div>
             </div>
 
-     
-
-            <baseInfo
-              :dataInfo="currentNodeData"
-            
-            />
-
+            <baseInfo :dataInfo="currentNodeData" />
 
             <el-tabs
               v-model="activeName"
@@ -152,6 +171,7 @@
     getBomGetById,
     convert,
     convertABom,
+    convertCBom,
     deleteBomTreeList
   } from '@/api/material/BOM.js';
   import { getTreeByGroup } from '@/api/classifyManage';
@@ -185,7 +205,8 @@
         rootTreeId: null,
         defaultProps: {
           children: 'children',
-          label: 'name'
+          label: 'name',
+      
         },
         loading: false,
         filterText: null,
@@ -220,7 +241,7 @@
         this.noBack = this.$route.query.noBack;
 
         (this.currentNodeData = {
-          bomType:  this.$route.query.bType || 1,
+          bomType: this.$route.query.bType || 1,
           children: []
         }),
           this.getTreeData();
@@ -276,8 +297,8 @@
           text: '转换中...',
           background: 'rgba(0, 0, 0, 0.7)'
         });
-       let ULR = tt == 'M' ? convert : convertABom;
-       ULR({ versions: this.versions, categoryId: this.categoryId }).then(
+        let ULR = tt == 'M' ? convert :  tt == 'A' ? convertABom : convertCBom;
+        ULR({ versions: this.versions, categoryId: this.categoryId }).then(
           (data) => {
             if (data.code == '0') {
               this.loadingInstance.close();
@@ -291,7 +312,7 @@
           this.currentNodeData.bomType,
           this.versions,
           this.categoryId,
-         this.treeId
+          this.treeId
         );
       },
       async getTreeData() {
@@ -323,7 +344,7 @@
       },
 
       handleNodeClick(data) {
-        this.treeId  = data.id;
+        this.treeId = data.id;
         this.handBomDetails(data.id);
       },
 

+ 1 - 1
src/views/material/BOMmanage/index.vue

@@ -10,7 +10,7 @@
         <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>
-
+        <el-tab-pane label="CBOM" name="4"> </el-tab-pane>
         <ele-pro-table
           ref="table"
           :columns="columns"