ysy пре 1 година
родитељ
комит
4e94cf1aed

+ 12 - 1
src/views/material/BOMmanage/components/baseInfoSave.vue

@@ -1,5 +1,6 @@
 <template>
   <el-dialog
+  :title="title"
     v-if="visible"
     :visible.sync="visible"
     :before-close="handleClose"
@@ -93,8 +94,9 @@
           code: '',
           name: '',
           versions: '',
-          status: 0
+          status: '0'
         },
+        title: '新建BOM',
         rules: {
           name: [
             {
@@ -129,6 +131,7 @@
     },
     created() {
       if (this.isEdit) {
+        this.title = '编辑BOM';
         this.formData = {
           code: this.categoryObj.code,
           name: this.categoryObj.name,
@@ -137,6 +140,14 @@
           id: this.categoryObj.id,
  
         };
+      } else {
+        this.title = '新建BOM';
+        this.formData = {
+          code: '',
+          name: '',
+          versions: '',
+          status: '0'
+        };
       }
     },
 

+ 7 - 1
src/views/material/BOMmanage/components/workmanship.vue

@@ -62,6 +62,7 @@
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
           <el-button
+           v-if="attributeData.status != 1"
             size="small"
             type="primary"
             icon="el-icon-plus"
@@ -143,6 +144,7 @@
                 >
                   <template v-slot:reference>
                     <el-link
+                     v-if="attributeData.status != 1"
                       type="danger"
                       :underline="false"
                       icon="el-icon-delete"
@@ -245,7 +247,11 @@
       workingStep
     },
     props: {
-      taskParam: Object
+      taskParam: Object,
+      attributeData: {
+        type: Object,
+        default: {}
+      },
     },
     data() {
       return {

+ 79 - 42
src/views/material/BOMmanage/detailsPop.vue

@@ -17,8 +17,22 @@
           >
             <el-radio-button :label="4">EBOM </el-radio-button>
             <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="2"
+              v-if="
+                searchObj.isProduct ||
+                [1, 9].includes(searchObj.rootPathIdParent)
+              "
+              >MBOM
+            </el-radio-button>
+            <el-radio-button
+              :label="3"
+              v-if="
+                searchObj.isProduct ||
+                [1, 9].includes(searchObj.rootPathIdParent)
+              "
+              >ABOM
+            </el-radio-button>
           </el-radio-group>
 
           <div style="margin-left: 100px">
@@ -69,8 +83,6 @@
               >转换PBOM</el-button
             >
 
-
-            
             <el-button
               type="primary"
               size="mini"
@@ -81,15 +93,17 @@
               >转换EBOM</el-button
             >
 
-
-
             <el-button
               type="primary"
               size="mini"
               icon="el-icon-refresh"
               plain
               @click="transformation('M')"
-              v-if="currentNodeData.bomType == 1"
+              v-if="
+                currentNodeData.bomType == 1 &&
+                (searchObj.isProduct ||
+                  [1, 9].includes(searchObj.rootPathIdParent))
+              "
               >转换MBOM</el-button
             >
 
@@ -99,7 +113,11 @@
               icon="el-icon-refresh"
               plain
               @click="transformation('A')"
-              v-if="currentNodeData.bomType == 1"
+              v-if="
+                currentNodeData.bomType == 1 &&
+                (searchObj.isProduct ||
+                  [1, 9].includes(searchObj.rootPathIdParent))
+              "
               >转换ABOM</el-button
             >
 
@@ -170,24 +188,23 @@
           :responsive="false"
         >
           <div class="ele-border-lighter sys-organization-list">
-          
             <div>
               版本号: &nbsp; &nbsp;
-            <el-select
-              size="mini"
-              style="width: 72%; margin: 6px 0"
-              v-model="searchObj.versions"
-              placeholder="请选择bom版本"
-              @change="getTreeData"
-            >
-              <el-option
-                v-for="item in versList"
-                :label="item.versions"
-                :value="item.versions"
-                :key="item.id"
+              <el-select
+                size="mini"
+                style="width: 72%; margin: 6px 0"
+                v-model="searchObj.versions"
+                placeholder="请选择bom版本"
+                @change="getTreeData"
               >
-              </el-option>
-            </el-select>
+                <el-option
+                  v-for="item in versList"
+                  :label="item.versions"
+                  :value="item.versions"
+                  :key="item.id"
+                >
+                </el-option>
+              </el-select>
             </div>
 
             <el-tree
@@ -217,8 +234,10 @@
               @tab-click="handleClick"
             >
               <el-tab-pane label="属性" name="属性">
-    
-                <attribute  v-if="activeName == '属性'" :attributeData="currentNodeData"></attribute>
+                <attribute
+                  v-if="activeName == '属性'"
+                  :attributeData="currentNodeData"
+                ></attribute>
               </el-tab-pane>
 
               <el-tab-pane
@@ -233,20 +252,21 @@
                 "
                 name="明细表"
               >
-                <detailedList :attributeData="currentNodeData" :treeId="treeId"></detailedList>
+                <detailedList
+                  :attributeData="currentNodeData"
+                  :treeId="treeId"
+                ></detailedList>
               </el-tab-pane>
 
               <el-tab-pane
                 label="工艺路线"
                 name="工艺路线"
-                v-if="
-                  currentNodeData.bomType != 4
-                "
+                v-if="currentNodeData.bomType != 4"
               >
                 <routing
-                 v-if="activeName == '工艺路线'"
+                  v-if="activeName == '工艺路线'"
                   ref="routingRef"
-                 :attributeData="currentNodeData"
+                  :attributeData="currentNodeData"
                   :taskParam="currentNodeData"
                 ></routing>
               </el-tab-pane>
@@ -254,16 +274,18 @@
                 label="工序配置"
                 name="工序配置"
                 v-if="
-                  currentNodeData.bomType != 1
+                  currentNodeData.bomType != 4 &&
+                  (searchObj.isProduct ||
+                    [1, 9].includes(searchObj.rootPathIdParent))
                 "
               >
                 <workmanship
                   v-if="activeName == '工序配置'"
                   ref="workmanshipRef"
+                    :attributeData="currentNodeData"
                   :taskParam="currentNodeData"
                 ></workmanship>
               </el-tab-pane>
-
             </el-tabs>
           </template>
 
@@ -362,7 +384,6 @@
           bomType: 1,
           children: []
         },
-        isProduct: false,
 
         current: {},
         treeList: [],
@@ -416,6 +437,12 @@
       },
 
       handleClose() {
+        this.searchObj = {
+          versions: '',
+          categoryId: '',
+          isProduct: false,
+          isTemp: 0
+        };
         this.drawer = false;
       },
 
@@ -530,15 +557,25 @@
           text: '转换中...',
           background: 'rgba(0, 0, 0, 0.7)'
         });
-        let ULR = tt == 'M' ? convert : tt == 'A' ? convertABom : tt == 'E' ? convertEBOM :  tt == 'P' ?  convertEBomToPBOM : '';
-        ULR({ versions: this.searchObj.versions, categoryId: this.searchObj.categoryId }).then(
-          (data) => {
-            if (data.code == '0') {
-              this.loadingInstance.close();
-              this.$message.success('转换成功');
-            }
+        let ULR =
+          tt == 'M'
+            ? convert
+            : tt == 'A'
+            ? convertABom
+            : tt == 'E'
+            ? convertEBOM
+            : tt == 'P'
+            ? convertEBomToPBOM
+            : '';
+        ULR({
+          versions: this.searchObj.versions,
+          categoryId: this.searchObj.categoryId
+        }).then((data) => {
+          if (data.code == '0') {
+            this.loadingInstance.close();
+            this.$message.success('转换成功');
           }
-        );
+        });
       },
 
       handleAdd() {

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

@@ -288,7 +288,7 @@
           categoryId: row.id,
           code: row.code,
           versions: row.versions,
-          categoryLevelPathIdParent: row.categoryLevelPathIdParent,
+          rootPathIdParent: row.categoryLevelPathIdParent,
           isProduct:true,
           isTemp: 1
         };

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

@@ -404,7 +404,7 @@
         let rowData = {
           categoryId: row.id,
           code: row.code,
-          categoryLevelPathIdParent: row.categoryLevelPathIdParent,
+          rootPathIdParent: row.categoryLevelPathIdParent,
           isProduct: row.isProduct == 1
         };
         this.$refs.bomDrawer.open(rowData);