ysy 1 жил өмнө
parent
commit
cd1344d5a2

+ 10 - 7
src/views/material/BOMmanage/components/baseInfoSave.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-  :title="title"
+    :title="title"
     v-if="visible"
     :visible.sync="visible"
     :before-close="handleClose"
@@ -70,7 +70,7 @@
 </template>
 
 <script>
-  import { saveBomTreeList , bomCategoryUpdate} from '@/api/material/BOM.js';
+  import { saveBomTreeList, bomCategoryUpdate } from '@/api/material/BOM.js';
   export default {
     data() {
       return {
@@ -123,10 +123,14 @@
         }
       },
 
+      categoryId: {
+        type: [Number, String],
+        default: ''
+      },
+
       isEdit: {
         type: Boolean,
         default: false
-
       }
     },
     created() {
@@ -137,8 +141,7 @@
           name: this.categoryObj.name,
           versions: this.categoryObj.versions,
           status: this.categoryObj.status,
-          id: this.categoryObj.id,
- 
+          id: this.categoryObj.id
         };
       } else {
         this.title = '新建BOM';
@@ -161,12 +164,12 @@
           if (valid) {
             let param = {
               ...this.formData,
-              category: this.categoryObj.category,
+              categoryId: this.categoryId,
               bomType: this.categoryObj.bomType
             };
             let URL = this.isEdit ? bomCategoryUpdate : saveBomTreeList;
             URL(param).then((res) => {
-              this.$message.success( this.isEdit ? '修改成功': '保存成功');
+              this.$message.success(this.isEdit ? '修改成功' : '保存成功');
               this.$emit('close', true);
               this.handleClose();
             });

+ 1 - 0
src/views/material/BOMmanage/detailsPop.vue

@@ -311,6 +311,7 @@
       v-if="baseInfoShow"
       @close="baseClose"
       :categoryObj="currentNodeData"
+        :categoryId="categoryObj.categoryId"
     ></baseInfoSave>
 
     <importDialog