ysy 1 год назад
Родитель
Сommit
7221324b60

+ 12 - 2
src/views/material/BOMmanage/detailsPop.vue

@@ -8,7 +8,7 @@
       :with-header="false"
     >
       <!-- 自定义头部 -->
-      <div class="custom-drawer-header">
+      <div class="custom-drawer-header" v-if="!isWt">
         <div class="radio_box rx-cc">
           <el-radio-group
             size="small"
@@ -201,6 +201,7 @@
                 v-model="searchObj.versions"
                 placeholder="请选择bom版本"
                 @change="getTreeData"
+                :disabled="isWt"
               >
                 <el-option
                   v-for="item in versList"
@@ -425,7 +426,10 @@
           1: '审核中',
           2: '审核通过',
           3: '审核不通过'
-        }
+        },
+
+        isWt: false,
+     
       };
     },
 
@@ -439,6 +443,12 @@
       open(row) {
         this.searchObj = row;
 
+
+        if (Object.prototype.hasOwnProperty.call(row, 'isWt') && row.isWt) {
+          this.isWt = row.isWt;
+          this.isFullscreen = false;
+        }
+
         if (Object.prototype.hasOwnProperty.call(row, 'bomType')) {
           this.currentNodeData.bomType = row.bomType;
         }

+ 4 - 34
src/views/material/BOMmanage/index.vue

@@ -16,7 +16,6 @@
           ref="table"
           :columns="columns"
           :datasource="datasource"
-          :initLoad="false"
           class="dict-table"
           tool-class="ele-toolbar-actions"
         >
@@ -205,41 +204,12 @@
       }
     },
 
-    mounted() {
-      this.initData();
-    },
-    activated() {
-      this.initData();
+    created() {
+
     },
     methods: {
-      initData() {
-        let { categoryId, code } = this.$route.query;
-        if (categoryId && code) {
-          this.where.categoryCode = code;
-          this.where.categoryId = categoryId;
-          getBomPageList({
-            status: 1,
-            categoryCode: this.where.categoryCode,
-            pageNum: 1,
-            size: 10
-          }).then((data) => {
-            this.$refs.table.setData(data.list || []);
-          });
-        } 
-      },
-      /* 启用关闭BOM */
-      openBom(row, boolean) {
-        this.loadingInstance = this.$loading({
-          lock: true,
-          text: boolean ? '启用中...' : '关闭中...',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        startAndStop({ id: row.id, status: row.status }).then(() => {
-          this.$message.success('操作成功');
-          this.loadingInstance.close();
-        });
-        setTimeout(() => {}, 2000);
-      },
+
+
 
       handSubmit(row) {
         if (this.clientEnvironmentId == 4) {

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

@@ -13,6 +13,7 @@
       full-height="calc(100vh - 116px)"
       tool-class="ele-toolbar-form"
       cache-key="systemDictDataTable"
+      v-if="pageShow"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
@@ -240,6 +241,9 @@
     removeMaterial,
     importCategorySparePart
   } from '@/api/material/list.js';
+
+  import { getBomGetById } from '@/api/material/BOM.js';
+
   import MaterialModal from './MaterialModal.vue';
   import ParamEdit from '@/views/technology/productParam/components/user-edit.vue';
   import mouldDialog from './mouldDialog';
@@ -281,6 +285,8 @@
 
         bomShow: false,
 
+        pageShow: false,
+
         // 表格列配置
         columns: [
           {
@@ -403,6 +409,8 @@
           isProduct: row.isProduct == 1
         };
 
+        console.log(rowData);
+
         this.$refs.bomDrawer.open(rowData);
       },
 
@@ -571,21 +579,29 @@
 
       $route: {
         handler(route) {
-          console.log(66, route);
+          this.pageShow = false;
           if (route.query && route.query.isWt) {
-            let rowData = {
-              categoryId: '1871454287584870401',
-              categoryName: 'T8丝杠螺母',
-              code: 'W3000056',
-              rootPathIdParent: '9',
-              isProduct: true,
-              versions: '1'
+
+            getBomGetById(route.query.businessId).then((res) => {
+              let rowData = {
+              categoryId: res.data.categoryId,
+              categoryName: res.data.name,
+              code: res.data.categoryCode,
+              rootPathIdParent: res.data.rootCategoryLevelId,
+              isProduct: res.data.rootCategoryLevelId == 9 ? true : false,
+              versions: res.data.versions,
+              bomType: res.data.bomType,
+              isWt: true
             };
- 
             this.$nextTick(() => {
               this.$refs.bomDrawer.open(rowData);
+              this.pageShow = true; 
             })
-           
+
+            });
+
+          } else {
+            this.pageShow = true; 
           }
         },
         immediate: true