ysy 1 سال پیش
والد
کامیت
af35fb395f

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

@@ -79,12 +79,12 @@
       return {
         statusOptions: [
           {
-            label: '默认',
-            value: '0'
+            label: '已停用',
+            value: 0
           },
           {
-            label: '归档',
-            value: '1'
+            label: '已发布',
+            value: 1
           }
         ]
       };

+ 26 - 19
src/views/material/BOMmanage/details.vue

@@ -21,15 +21,16 @@
               v-model="currentNodeData.bomType"
               @change="bomChange"
             >
-        
-              <el-radio-button :label="1" v-if="isProduct">PBOM </el-radio-button>
+              <el-radio-button :label="1"
+                >PBOM
+              </el-radio-button>
               <el-radio-button
-                v-if="[1, 9].includes(rootPathIdParent) || !isProduct"
+                v-if="isProduct || [1, 9].includes(rootPathIdParent)"
                 :label="2"
                 >MBOM</el-radio-button
               >
               <el-radio-button
-                v-if="[1, 9].includes(rootPathIdParent) && isProduct"
+                v-if="isProduct || [1, 9].includes(rootPathIdParent)"
                 :label="3"
                 >ABOM</el-radio-button
               >
@@ -67,9 +68,10 @@
                   新建<i class="el-icon-arrow-down el-icon--right"></i>
                 </el-button>
 
-                <el-dropdown-menu slot="dropdown" >
-                  <el-dropdown-item  command="a">新建BOM</el-dropdown-item>
-                  <el-dropdown-item  command="b">新建物料</el-dropdown-item>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item command="a">新建PBOM</el-dropdown-item>
+                  <el-dropdown-item command="a">新建MBOM</el-dropdown-item>
+                  <el-dropdown-item command="a">新建ABOM</el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
 
@@ -251,7 +253,7 @@
 
         moudleName: 'mainUser',
         rootPathIdParent: null,
-        isProduct: false,
+        isProduct: false
       };
     },
     watch: {
@@ -261,7 +263,6 @@
         handler(newQuery, oldQuery) {
           this.rootPathIdParent = Number(newQuery.categoryLevelPathIdParent);
           this.isProduct = newQuery.isProduct == 'true' ? true : false;
-      
         }
       }
     },
@@ -287,11 +288,19 @@
         this.categoryId = this.$route.query.categoryId;
         this.noBack = this.$route.query.noBack;
 
-        (this.currentNodeData = {
-          bomType: this.$route.query.bType || 1,
-          children: []
-        }),
-          this.getTreeData();
+        if (!this.isProduct) {
+          this.currentNodeData = {
+            bomType: 2,
+            children: []
+          };
+        } else {
+          this.currentNodeData = {
+            bomType: this.$route.query.bType || 1,
+            children: []
+          };
+        }
+
+        this.getTreeData();
       },
       handleClick(tab) {
         if (
@@ -325,7 +334,6 @@
               })
               .catch((e) => {
                 loading.close();
-                // this.$message.error(e.message);
               });
           })
           .catch(() => {
@@ -360,9 +368,7 @@
       },
 
       handleDown(command) {
-       if(command == 'b') {
-        this.add()
-       }
+        this.add();
       },
 
       add() {
@@ -379,7 +385,8 @@
           const res = await getBomTreeList({
             categoryId: this.categoryId,
             versions: this.versions,
-            bomType: this.currentNodeData.bomType
+            bomType: this.currentNodeData.bomType,
+            isTemp: this.$route.query.isTemp == '1' ? 1 : 0
           });
           this.treeLoading = false;
           if (res?.code === '0') {

+ 46 - 53
src/views/material/BOMmanage/index.vue

@@ -29,6 +29,14 @@
             </el-link>
           </template>
 
+          <template v-slot:isTemp="{ row }">
+            <el-tag size="mini" v-if="row.isTemp == 1">主数据</el-tag>
+
+          </template>
+          
+
+          
+
           <!-- 表头工具栏 -->
           <template v-slot:action="{ row }">
             <el-link type="primary" @click="handelDetail(row)">详情</el-link>
@@ -45,6 +53,12 @@
               @click="handSubmit(row)"
               >发布</el-link
             >
+
+             
+            <el-link type="danger" :underline="false"  v-if="activeName == 1 && row.status == 0" @click="handDel(row)">
+                删除
+              </el-link>
+
           </template>
         </ele-pro-table>
       </el-tabs>
@@ -58,7 +72,7 @@
 
 <script>
   import BOMSearch from './components/BOM-search.vue';
-  import { getBomPageList, startAndStop, bomSubmit } from '@/api/material/BOM';
+  import { getBomPageList, startAndStop, bomSubmit, deleteBomTreeList } from '@/api/material/BOM';
   import LCdetail from './components/LCdetail.vue'
   export default {
     name: 'SystemDictionary',
@@ -111,6 +125,15 @@
             label: '审核状态',
             slot: 'approvalStatus'
           },
+
+          {
+            width: 100,
+            prop: 'isTemp',
+            slot: 'isTemp',
+            label: '主数据',
+        
+          },
+
           {
             prop: 'createName',
             label: '创建人',
@@ -212,6 +235,7 @@
         return getBomPageList({
           ...where,
           bomType: Number(this.activeName),
+          isTemp: true,
           pageNum: page,
           size: limit
         });
@@ -225,7 +249,8 @@
             noBack,
             bType: this.activeName,
             categoryLevelPathIdParent: row.rootCategoryLevelId,
-            isProduct: true
+            isProduct: true,
+            isTemp: row.isTemp
           }
         });
       },
@@ -233,67 +258,35 @@
       reload(where) {
         this.$refs.table.reload({ where });
       },
-      /* 显示编辑 */
-      handelEdit(type, row) {
-        this.$refs.editDialogRef.open(type, row);
+
+
+
+
+      handleClick(tab) {
+        this.activeName = tab.name;
+        this.reload();
       },
-      /* 删除 */
-      remove() {
-        this.$confirm('确定要删除选中的字典吗?', '提示', {
+
+      handDel(row) {
+        this.$confirm('是否确认删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
           type: 'warning'
         })
           .then(() => {
-            if (this.$refs.dictData.selection.length == 0) {
-              this.$message({
-                message: '当前未选择数据',
-                type: 'error'
-              });
-              return;
-            }
-            let ids = this.$refs.dictData.selection.map((item) => item.id);
-            const loading = this.$loading({ lock: true });
-
-            removeDictionary(ids, true)
-              .then((msg) => {
-                loading.close();
-                this.$message.success(msg);
+            deleteBomTreeList([row.id])
+              .then(() => {
                 this.reload();
               })
-              .catch((e) => {
-                loading.close();
-                // this.$message.error(e.message);
-              });
-          })
-          .catch(() => {});
-      },
-
-      // 刷新数据
-      refreshData() {
-        this.loading = true;
-        syncBom()
-          .then((res) => {
-            if (res == '0') {
-              this.loading = false;
-              this.$message.success('数据刷新成功!');
-              this.reload();
-            }
           })
-          .catch((e) => {
-            this.loading = false;
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              message: '已取消删除'
+            });
           });
       },
 
-      handleClick(tab) {
-        this.activeName = tab.name;
-        getBomPageList({
-          pageNum: 1,
-          size: 10,
-          bomType: Number(this.activeName)
-        }).then((data) => {
-          this.$refs.table.setData(data.list || []);
-        });
-      },
-
       
     handleDetails(row) {
       if (!row.processInstanceId) {

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

@@ -398,7 +398,6 @@
             code: row.code,
             categoryLevelPathIdParent: row.categoryLevelPathIdParent,
             isProduct: row.isProduct == 1
-
           }
         });
       },