|
|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-form label-width="100px" :rules="rules" ref="form" :model="attributeData">
|
|
|
-
|
|
|
+ <el-form
|
|
|
+ label-width="100px"
|
|
|
+ :rules="rules"
|
|
|
+ ref="form"
|
|
|
+ :model="attributeData"
|
|
|
+ >
|
|
|
<el-row>
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
<el-form-item label="名称:" prop="name">
|
|
|
@@ -120,7 +124,7 @@
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
<el-form-item label="生产类型:" prop="produceType">
|
|
|
<el-select
|
|
|
- v-model="category.produceType"
|
|
|
+ v-model="attributeData.produceType"
|
|
|
filterable
|
|
|
multiple
|
|
|
class="ele-block"
|
|
|
@@ -175,7 +179,7 @@
|
|
|
|
|
|
<el-row>
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="基本数量" prop="name">
|
|
|
+ <el-form-item label="基本数量" prop="baseCount">
|
|
|
<el-input
|
|
|
placeholder=""
|
|
|
v-model="attributeData.baseCount"
|
|
|
@@ -239,7 +243,6 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
-
|
|
|
<div class="btn_box" v-if="attributeData.status != 1">
|
|
|
<el-button type="primary" @click="handleUpdate">保存</el-button>
|
|
|
</div>
|
|
|
@@ -287,10 +290,11 @@
|
|
|
dictList: [],
|
|
|
|
|
|
rules: {
|
|
|
- dosage: [{ required: true, message: " ", trigger: "blur" }],
|
|
|
-
|
|
|
+ dosage: [{ required: true, message: ' ', trigger: 'blur' }],
|
|
|
+ baseCount: [{ required: true, message: ' ', trigger: 'blur' }],
|
|
|
+ produceType: [{ required: true, message: ' ', trigger: 'blur' }],
|
|
|
+ },
|
|
|
|
|
|
- },
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -314,9 +318,10 @@
|
|
|
handleUpdate() {
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
+ this.category.produceType = this.attributeData.produceType;
|
|
|
bomCategoryUpdate(this.attributeData).then((res) => {
|
|
|
- this.$message.success('修改成功');
|
|
|
- });
|
|
|
+ this.$message.success('修改成功');
|
|
|
+ });
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -327,9 +332,7 @@
|
|
|
attributeData: {
|
|
|
type: Object,
|
|
|
default: {}
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
@@ -337,8 +340,8 @@
|
|
|
console.log(Object.prototype.hasOwnProperty.call(val, 'category'));
|
|
|
if (Object.prototype.hasOwnProperty.call(val, 'category')) {
|
|
|
this.category = val.category;
|
|
|
- this.category.produceType = val.produceType;
|
|
|
-
|
|
|
+ this.attributeData.produceType = val.category.produceType;
|
|
|
+
|
|
|
this.$forceUpdate();
|
|
|
}
|
|
|
}
|
|
|
@@ -355,5 +358,5 @@
|
|
|
|
|
|
.el-form-item {
|
|
|
margin-bottom: 10px !important;
|
|
|
-}
|
|
|
+ }
|
|
|
</style>
|