ysy 1 жил өмнө
parent
commit
79bca924b9

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

@@ -35,6 +35,7 @@
         </el-col>
         <el-col :span="4" label-width="80px">
           <el-form-item label="状态" prop="type">
+
             <el-select
               size="mini"
               style="width: 120px"
@@ -68,16 +69,16 @@
         statusOptions: [
           {
             label: '已停用',
-            value: 2
+            value: '2'
           },
           {
             label: '已发布',
-            value: 1
+            value: '1'
           },
 
           {
             label: '草稿',
-            value: 0
+            value: '0'
           }
         ]
       };

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

@@ -69,6 +69,7 @@
 </template>
 
 <script>
+  import { saveBomTreeList } from '@/api/material/BOM.js';
   export default {
     data() {
       return {
@@ -113,7 +114,7 @@
       };
     },
     props: {
-      dataInfo: {
+      categoryObj: {
         type: Object,
         default() {
           return {};
@@ -129,6 +130,16 @@
       handleSave() {
         this.$refs.form.validate((valid) => {
           if (valid) {
+            let param = {
+              ...this.formData,
+              category: this.categoryObj.category,
+              bomType: this.categoryObj.bomType
+            };
+            saveBomTreeList(param).then((res) => {
+              this.$message.success('保存成功');
+              this.$emit('close', true);
+              this.handleClose();
+            });
           } else {
             return false;
           }

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

@@ -141,7 +141,7 @@
               @tab-click="handleClick"
             >
               <el-tab-pane label="属性" name="属性">
-                <attribute :attributeData="currentNodeData"></attribute>
+                <attribute :attributeData="currentNodeData"attribute></attribute>
               </el-tab-pane>
               <el-tab-pane
                 :label="

+ 10 - 4
src/views/material/BOMmanage/detailsPop.vue

@@ -161,7 +161,11 @@
       </div>
     </el-drawer>
 
-    <baseInfoSave v-if="baseInfoShow" @close="baseClose"></baseInfoSave>
+    <baseInfoSave
+      v-if="baseInfoShow"
+      @close="baseClose"
+      :categoryObj="currentNodeData"
+    ></baseInfoSave>
   </div>
 </template>
 
@@ -283,15 +287,14 @@
       getVersion() {
         let param = {
           categoryId: this.searchObj.categoryId,
-          versions: this.searchObj.versions,
           bomType: this.currentNodeData.bomType
         };
         versionList(param).then((res) => {
-          console.log(999, res);
           this.versList = res;
         });
       },
 
+      handleClick(tab) {},
       remove() {
         this.$confirm('是否确认删除?', '提示', {
           confirmButtonText: '确定',
@@ -335,7 +338,10 @@
         this.baseInfoShow = true;
       },
 
-      baseClose() {
+      baseClose(val) {
+        if (val) {
+          this.getVersion();
+        }
         this.baseInfoShow = false;
       }
     }