ysy 1 year ago
parent
commit
265d296e78

+ 65 - 25
src/views/material/BOMmanage/details.vue

@@ -21,10 +21,19 @@
               v-model="currentNodeData.bomType"
               @change="bomChange"
             >
-              <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="1"
+                >PBOM </el-radio-button
+              >
+              <el-radio-button
+                v-if="[1, 9].includes(rootPathIdParent)"
+                :label="2"
+                >MBOM</el-radio-button
+              >
+              <el-radio-button
+                v-if="[1, 9].includes(rootPathIdParent)"
+                :label="3"
+                >ABOM</el-radio-button
+              >
             </el-radio-group>
           </div>
 
@@ -63,7 +72,8 @@
               >
               <el-button
                 v-if="
-                (currentNodeData.bomType == 2  || currentNodeData.bomType == 3) &&
+                  (currentNodeData.bomType == 2 ||
+                    currentNodeData.bomType == 3) &&
                   currentNodeData.children?.length <= 0
                 "
                 type="danger"
@@ -81,7 +91,13 @@
                 plain
                 >导出</el-button
               >
-              <el-button   @click="uploadFile" v-if="currentNodeData.bomType == 1"  type="primary" size="mini" icon="el-icon-upload2" plain
+              <el-button
+                @click="uploadFile"
+                v-if="currentNodeData.bomType == 1"
+                type="primary"
+                size="mini"
+                icon="el-icon-upload2"
+                plain
                 >导入</el-button
               >
               <el-button
@@ -104,7 +120,6 @@
                 >转换ABOM</el-button
               >
 
-   
               <div v-if="!noBack" class="back-btn">
                 <el-button size="mini" icon="el-icon-back" @click="back"
                   >返回</el-button
@@ -123,14 +138,23 @@
               <el-tab-pane label="属性" name="属性">
                 <attribute :attributeData="currentNodeData"></attribute>
               </el-tab-pane>
-              <el-tab-pane  :label="currentNodeData.bomType == 1 ? 'PBOM明细表' : currentNodeData.bomType == 2 ? 'MBOM明细表' : 'ABOM明细表' " name="明细表">
+              <el-tab-pane
+                :label="
+                  currentNodeData.bomType == 1
+                    ? 'PBOM明细表'
+                    : currentNodeData.bomType == 2
+                    ? 'MBOM明细表'
+                    : 'ABOM明细表'
+                "
+                name="明细表"
+              >
                 <!-- <document></document> -->
-                 <detailedList  :attributeData="currentNodeData"></detailedList>
+                <detailedList :attributeData="currentNodeData"></detailedList>
               </el-tab-pane>
               <el-tab-pane
-           
                 label="工艺路线"
                 name="工艺路线"
+                v-if="[1, 9].includes(rootPathIdParent)"
               >
                 <routing
                   ref="routingRef"
@@ -138,9 +162,9 @@
                 ></routing>
               </el-tab-pane>
               <el-tab-pane
-           
                 label="工序配置"
                 name="工序配置"
+                v-if="[1, 9].includes(rootPathIdParent)"
               >
                 <workmanship
                   ref="workmanshipRef"
@@ -154,7 +178,11 @@
     </el-card>
     <bomTreeDialog ref="bomTreeDialogRef" @reload="bomTreeDialogReload" />
 
-    <importDialog :defModule="moudleName" ref="importDialogRef" @success="reload" />
+    <importDialog
+      :defModule="moudleName"
+      ref="importDialogRef"
+      @success="reload"
+    />
   </div>
 </template>
 
@@ -165,7 +193,7 @@
     convert,
     convertABom,
     convertCBom,
-    deleteBomTreeList,
+    deleteBomTreeList
   } from '@/api/material/BOM.js';
   import { getTreeByGroup } from '@/api/classifyManage';
   import attribute from './components/attribute.vue';
@@ -174,8 +202,8 @@
   // import document from './components/document.vue';
   import workmanship from './components/workmanship.vue';
   import bomTreeDialog from './components/bomTreeDialog.vue';
-  import importDialog from "./qualityTesting/import-dialog.vue";
-  import detailedList from './components/detailedList.vue'
+  import importDialog from './qualityTesting/import-dialog.vue';
+  import detailedList from './components/detailedList.vue';
   export default {
     name: 'BOMmanage',
     components: {
@@ -212,9 +240,19 @@
         noBack: false,
         treeId: null,
 
-        moudleName : "mainUser",
+        moudleName: 'mainUser',
+        rootPathIdParent: null
       };
     },
+    watch: {
+      // 监听$route.query对象的变化
+      '$route.query': {
+        immediate: true, // 启用立即执行
+        handler(newQuery, oldQuery) {
+          this.rootPathIdParent = Number(newQuery.categoryLevelPathIdParent)
+        }
+      }
+    },
     mounted() {
       this.initData();
     },
@@ -233,11 +271,11 @@
         this.getTreeData();
       },
       initData() {
-        console.log('触发了!!!!');
         this.versions = this.$route.query.versions;
         this.categoryId = this.$route.query.categoryId;
         this.noBack = this.$route.query.noBack;
 
+
         (this.currentNodeData = {
           bomType: this.$route.query.bType || 1,
           children: []
@@ -252,7 +290,10 @@
           this.$refs.routingRef.reload();
         }
 
-        if (tab.name === '工序配置' && this.currentNodeData.children?.length < 1) {
+        if (
+          tab.name === '工序配置' &&
+          this.currentNodeData.children?.length < 1
+        ) {
           this.$refs.workmanshipRef.reload();
         }
       },
@@ -295,7 +336,7 @@
           text: '转换中...',
           background: 'rgba(0, 0, 0, 0.7)'
         });
-        let ULR = tt == 'M' ? convert : tt == 'A' ? convertABom : ''
+        let ULR = tt == 'M' ? convert : tt == 'A' ? convertABom : '';
         ULR({ versions: this.versions, categoryId: this.categoryId }).then(
           (data) => {
             if (data.code == '0') {
@@ -378,14 +419,13 @@
         }
       },
 
-      uploadFile () {
-      this.$refs.importDialogRef.open();
-    },
-    
-    reload(where) {
-      this.getTreeData();
+      uploadFile() {
+        this.$refs.importDialogRef.open();
       },
 
+      reload(where) {
+        this.getTreeData();
+      }
     }
   };
 </script>

+ 43 - 9
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -12,11 +12,12 @@
         <div class="content_ll">
           <div class="name">质检类型</div>
           <div>
-            <DictSelection
-              dictName="质检标准类型"
-              v-model="item.qualityStandard.type + ''"
-              disabled
-            ></DictSelection>
+            {{
+              getDictValue(
+                '质检标准类型',
+                item.qualityStandard && item.qualityStandard.type
+              )
+            }}
           </div>
         </div>
 
@@ -122,20 +123,36 @@
               <el-table-column label="质检标准" align="center">
                 <template slot-scope="scope">
                   <el-form-item label-width="0" prop="inspectionStandard">
+
+                    <!-- <el-select
+                      v-model="scope.row.symbol"
+                      style="width: 100px"
+                      clearable
+                    >
+                      <el-option
+                        v-for="item in dictList"
+                        :key="item.value"
+                        :value="item.value"
+                        :label="item.label"
+                      ></el-option>
+                    </el-select>
+                  -->
+                  
                     <el-input
                       clearable
                       v-model="scope.row.toleranceValue"
                       placeholder="请输入"
                     >
-                      <DictSelection
+
+                    <DictSelection
                         style="width: 100px"
                         slot="prepend"
                         clearable
                         dictName="数学字符"
                         v-model="scope.row.symbol"
                       ></DictSelection>
+
                     </el-input>
-                    <!-- </el-form-item> -->
                   </el-form-item>
                 </template>
               </el-table-column>
@@ -165,9 +182,11 @@
 <script>
   import termPop from './inspectionClassify/index.vue';
   import { EventBus } from '@/utils/eventBus';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getByCode } from '@/api/system/dictionary-data';
   export default {
     components: { termPop },
-
+    mixins: [dictMixins],
     props: {
       qualityParam: {
         type: Array
@@ -187,7 +206,8 @@
 
     data() {
       return {
-        list: []
+        list: [],
+        dictList: []
       };
     },
 
@@ -197,6 +217,9 @@
         this.list = JSON.parse(JSON.stringify(_arr));
         this.$forceUpdate();
       });
+
+      this.requestDict('质检标准类型');
+      this.getDictList('mathematical_symbol');
     },
 
     methods: {
@@ -225,6 +248,17 @@
           .catch(() => {});
       },
 
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: Number(values[0]),
+            label: item[values[0]]
+          };
+        });
+      },
+
       handDel2(idx, index) {
         this.list[idx].qualityStandard.parameterStandards.splice(index, 1);
       },

+ 24 - 8
src/views/material/materialBOM/components/edit-dialog.vue

@@ -2,7 +2,7 @@
   <ele-modal custom-class="ele-dialog-form" :visible.sync="visible" v-if="visible" :title="title" width="80%"
     @close="cancel">
     <headerTitle title="基本信息"></headerTitle>
-    <el-form label-width="100px" ref="form" :model="form" :rules="rules">
+    <el-form label-width="100px"  ref="form"  :model="form" :rules="rules">
       <el-row>
         <el-col :span="8" label-width="100px">
           <el-form-item label="BOM编码" prop="code">
@@ -125,7 +125,8 @@
       <el-button @click="cancel">返回</el-button>
     </div
 
-    <ProductModal ref="productRefs" @changeProduct='determineChoose' />
+    <ProductModal ref="productRefs" @changeProduct='determineChoose'  />
+
 
     <!-- 添加工序 -->
 
@@ -156,6 +157,10 @@ export default {
   props: {
     statusOpt: Object
   },
+
+
+
+
   data() {
 
     var baseCountVa = (rule, value, callback) => {
@@ -168,12 +173,8 @@ export default {
       }
     };
 
-    return {
-      visible: false,
-      title: '',
-      row: {},
-      form: {
-        code: '',
+    const defaultForm = {
+      code: '',
         name: '',
         type: 0,
         factoryId: '',
@@ -187,7 +188,16 @@ export default {
         baseCountUnit: '',
         status: '-1',
         taskId: ''
+    };
+ 
 
+    return {
+      defaultForm,
+      visible: false,
+      title: '',
+      row: {},
+      form: {
+        ...defaultForm
       },
       removeSubBomIdList: [],
 
@@ -302,6 +312,12 @@ export default {
       // this.getVersionList()
       this.visible = true;
       if (type == '新建') {
+        this.tableData = []
+
+      this.form = {
+        ...this.defaultForm
+      }
+            
         this._getCode();
       } else {
         this.isUpdate = true

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

@@ -28,7 +28,7 @@
       </ele-pro-table>
     </el-card>
     <ViewDialog ref="detailDialogRef" :statusOpt="statusOpt" />
-    <EditDialog ref="editDialogRef" :statusOpt="statusOpt"       @done="reload"></EditDialog>
+    <EditDialog ref="editDialogRef" :statusOpt="statusOpt"     @done="reload"></EditDialog>
   </div>
 </template>
 

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

@@ -130,9 +130,9 @@
           工艺参数
         </el-link>
 
+    
         <el-link
           type="primary"
-          v-if="row.isProduct == 1 || row.categoryLevelPathIdParent == 1"
           :underline="false"
           @click="toBomManager(row)"
         >
@@ -395,7 +395,9 @@
           path: '/material/BOMmanage/details',
           query: {
             categoryId: row.id,
-            code: row.code
+            code: row.code,
+            categoryLevelPathIdParent: row.categoryLevelPathIdParent
+
           }
         });
       },

+ 2 - 2
vue.config.js

@@ -33,8 +33,8 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.1.124:50001',
         // target: 'http://192.168.1.147:18086',
-        target: 'http://192.168.1.125:18086',
-        // target: 'http://192.168.1.116:18086',
+        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.116:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''