|
@@ -39,6 +39,12 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="规格:">
|
|
|
+ <el-input v-model="value.spec"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="保质期:">
|
|
|
+ <el-input v-model="value.qualityGuaranteePeriod"></el-input>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="商品介绍:">
|
|
|
<el-input
|
|
|
:autoSize="true"
|
|
@@ -60,10 +66,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="计量单位:">
|
|
|
<el-input v-model="value.unit"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="规格:">
|
|
|
- <el-input v-model="value.spec"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="商品重量:">
|
|
|
<el-input v-model="value.weight" style="width: 300px"></el-input>
|
|
|
<span style="margin-left: 20px">克</span>
|
|
@@ -133,12 +136,14 @@
|
|
|
this.handleEditCreated();
|
|
|
},
|
|
|
selectProductCateValue: function (newValue) {
|
|
|
- console.log('newValue',newValue);
|
|
|
+ // console.log('newValue',newValue);
|
|
|
if (newValue != null && newValue.length === 2) {
|
|
|
this.value.productCategoryId = newValue[1];
|
|
|
this.value.productCategoryName= this.getCateNameById(this.value.productCategoryId);
|
|
|
// 大类ID
|
|
|
this.value.productBigCategoryId = newValue[0];
|
|
|
+ // 大类名称
|
|
|
+ this.value.productBigCategoryName= this.getBigCateNameById(this.value.productBigCategoryId);
|
|
|
} else {
|
|
|
this.value.productCategoryId = null;
|
|
|
this.value.productCategoryName=null;
|
|
@@ -171,6 +176,7 @@
|
|
|
this.productCateOptions.push({label: list[i].name, value: list[i].id, children: children});
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
},
|
|
|
getBrandList() {
|
|
|
fetchBrandList({pageNum: 1, pageSize: 100}).then(response => {
|
|
@@ -183,7 +189,7 @@
|
|
|
},
|
|
|
getOriginList() {
|
|
|
fetchOriginList({pageNum: 1, pageSize: 100}).then(response => {
|
|
|
- console.log('getOriginList',response);
|
|
|
+ // console.log('getOriginList',response);
|
|
|
this.originOptions = [];
|
|
|
let originList = response.data;
|
|
|
for (let i = 0; i < originList.length; i++) {
|
|
@@ -203,6 +209,16 @@
|
|
|
}
|
|
|
return name;
|
|
|
},
|
|
|
+ getBigCateNameById(id){
|
|
|
+ let bigName=null;
|
|
|
+ for(let i=0;i<this.productCateOptions.length;i++){
|
|
|
+ if(this.productCateOptions[i].value===id){
|
|
|
+ bigName=this.productCateOptions[i].label;
|
|
|
+ return bigName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return bigName;
|
|
|
+ },
|
|
|
handleNext(formName){
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
console.log('this.$refs[formName]',this.$refs[formName]);
|