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