ysy hace 1 año
padre
commit
7e1416e9c7

+ 21 - 19
src/views/material/BOMmanage/components/bomTreeDialog.vue

@@ -9,13 +9,13 @@
     width="70%"
   >
     <el-form
-      label-width="100px"
+        label-width="100px"
       ref="form"
       :rules="rules"
       :model="attributeData"
     >
       <el-row>
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="父级节点" prop="parentId">
             <selectTree
               ref="tree"
@@ -35,7 +35,7 @@
             />
           </el-form-item>
         </el-col>
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="类型" prop="bomType">
             <template>
               <el-select
@@ -56,7 +56,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="编码" prop="code">
             <el-input
               placeholder=""
@@ -66,13 +66,13 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="名称" prop="name">
             <el-input placeholder="" v-model="attributeData.name"></el-input>
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="材料" prop="materialsName">
             <el-input
               placeholder=""
@@ -81,7 +81,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="来源" prop="sourceData">
             <el-input
               placeholder=""
@@ -90,7 +90,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="bom路线" prop="bomTypeRouting">
             <el-input
               placeholder=""
@@ -99,19 +99,19 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="用量" prop="dosage">
             <el-input placeholder="" v-model="attributeData.dosage"></el-input>
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="单位" prop="unit">
             <el-input placeholder="" v-model="attributeData.unit"></el-input>
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="状态" prop="status">
             <template>
               <el-select
@@ -131,7 +131,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="物料库路径" prop="materielPath">
             <el-input
               placeholder=""
@@ -140,7 +140,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="12" label-width="100px">
+        <el-col :span="12" >
           <el-form-item label="版本" prop="versions">
             <el-input
               placeholder=""
@@ -150,7 +150,7 @@
           </el-form-item>
         </el-col>
 
-        <el-col :span="24" label-width="100px">
+        <el-col :span="24" >
           <el-form-item label="备注" prop="remake">
             <el-input
               placeholder=""
@@ -162,7 +162,7 @@
         </el-col>
       </el-row>
     </el-form>
-    <div class="btns">
+    <div slot="footer" class="dialog-footer">
       <el-button type="primary" size="small" @click="save">保存</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
@@ -182,6 +182,8 @@
   import userSearch from './user-search.vue';
   import standardOutput from './standardOutput.vue';
   export default {
+    name: 'bomTreeDialog',
+
     components: {
       userSearch,
       selectTree,
@@ -310,8 +312,8 @@
 </script>
 
 <style lang="scss" scoped>
-  .btns {
-    text-align: right;
-    padding: 10px 0;
-  }
+
+.el-form-item {
+    margin-bottom: 20px !important;
+}
 </style>

+ 48 - 8
src/views/material/BOMmanage/components/detailedList.vue

@@ -15,7 +15,8 @@
     >
       <template v-slot:toolbar>
         <div class="toolbar_box">
-          <div
+          <el-button type="primary" size="mini" @click="handleAdd">新增</el-button>
+          <div class="toolbar_box_right"
             ><span>基本数量</span>
             <el-input
               placeholder="请输入"
@@ -99,6 +100,9 @@
         </el-link>
       </template>
     </ele-pro-table>
+
+    <bomTreeDialog ref="bomTreeDialogRef" @reload="bomClose" />
+
   </div>
 </template>
 
@@ -106,9 +110,11 @@
   import BOMSearch from './BOM-search.vue';
   import { getBomPageCategoryId, contactList } from '@/api/material/BOM';
   import { getByCode } from '@/api/system/dictionary-data';
+
+  import bomTreeDialog  from './bomTreeDialog.vue'
   export default {
     name: 'SystemDictionary',
-    components: { BOMSearch },
+    components: { BOMSearch, bomTreeDialog },
 
     data() {
       return {
@@ -232,7 +238,8 @@
 
         gysList: [],
 
-        attrObj: {}
+        attrObj: {},
+        newTreeId: null,
       };
     },
 
@@ -246,9 +253,17 @@
       attributeData: {
         type: Object,
         default: {}
-      }
+      },
+
+      treeId: {
+        type: String,
+        default: ''
+      },
+
     },
 
+  
+
     watch: {
       attributeData(val) {
         this.attrObj = val;
@@ -258,7 +273,11 @@
             pageNum: 1
           });
         });
-      }
+      },
+
+      treeId(val) {
+        this.newTreeId = val;
+      },
     },
 
     methods: {
@@ -306,6 +325,25 @@
         });
       },
 
+      handleAdd() {
+        // 打开树形对话框
+        this.$refs.bomTreeDialogRef.open(
+          this.attributeData.bomType,
+          this.attributeData.versions,
+          this.attributeData.categoryId,
+          this.newTreeId
+        )
+      },
+
+      bomClose() {
+        this.$refs.table.setData([]);
+        this.$nextTick(() => {
+          this.$refs.table.reload({
+            pageNum: 1
+          });
+        });
+      },
+
     }
   };
 </script>
@@ -334,12 +372,14 @@
   }
 
   .toolbar_box {
-    float: right;
-    margin-right: 10px;
-    > div {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .toolbar_box_right {
       display: flex;
       align-items: center;
       justify-content: center;
+      margin-right: 10px;
       > span {
         width: 150px;
       }

+ 18 - 8
src/views/material/BOMmanage/detailsPop.vue

@@ -97,15 +97,24 @@
           </div>
         </div>
         <div>
-          <el-button type="text"  @click="handleDetails()" v-if="isNotData && currentNodeData.approvalStatus == 1" :underline="false">
+          <el-button
+            type="text"
+            @click="handleDetails()"
+            v-if="isNotData && currentNodeData.approvalStatus == 1"
+            :underline="false"
+          >
             {{ approvalStatusOpt[+currentNodeData.approvalStatus] }}
           </el-button>
 
-          <el-button type="text" style="color: #F56C6C;" v-if="isNotData && currentNodeData.approvalStatus == 3" :underline="false">
+          <el-button
+            type="text"
+            style="color: #f56c6c"
+            v-if="isNotData && currentNodeData.approvalStatus == 3"
+            :underline="false"
+          >
             {{ approvalStatusOpt[+currentNodeData.approvalStatus] }}
           </el-button>
 
-
           <el-button
             icon="el-icon-full-screen"
             type="text"
@@ -195,7 +204,7 @@
                 "
                 name="明细表"
               >
-                <detailedList :attributeData="currentNodeData"></detailedList>
+                <detailedList :attributeData="currentNodeData" :treeId="treeId"></detailedList>
               </el-tab-pane>
             </el-tabs>
           </template>
@@ -315,6 +324,8 @@
         isSubmit: false,
         radioSubmit: 1,
 
+        treeId: null,
+
         approvalStatusOpt: {
           0: '未提交',
           1: '审核中',
@@ -386,6 +397,7 @@
       },
 
       handleNodeClick(data) {
+        this.treeId = data.id;
         this.handBomDetails(data.id);
       },
 
@@ -510,7 +522,7 @@
           type: 'warning'
         })
           .then(() => {
-            URL({ businessId:this.currentNodeData.id }).then((res) => {
+            URL({ businessId: this.currentNodeData.id }).then((res) => {
               this.isSubmit = false;
               this.$message.success('发布成功');
               this.getTreeData();
@@ -519,8 +531,6 @@
           .catch(() => {});
       },
 
-
-      
       handleDetails() {
         if (!this.currentNodeData.processInstanceId) {
           this.$message.info('未提交没有审核流程');
@@ -532,7 +542,7 @@
   };
 </script>
 
-<style scoped scoped>
+<style lang="scss" scoped>
   /* 自定义全屏样式 */
   ::v-deep .is-fullscreen {
     width: 100vw !important;