回显优化
parent
246109ddca
commit
a7640afbc0
|
@ -36,7 +36,7 @@ export function addInfo(data) {
|
|||
// 修改商品信息
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/product/info/'+data.id,
|
||||
url: '/product/info/'+data.projectAddModel.id,
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
|
|
@ -153,14 +153,15 @@
|
|||
<CheckAttribute v-model="form.attributeIdList" :checked-list="attributeInfoList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="商品属性组" name="attributeGroup">
|
||||
<CheckAttributeGroup v-model="form.attributeGroupIdList" :checked-list="form.attributeGroupList"/>
|
||||
<CheckAttributeGroup v-model="form.attributeGroupIdList" :checked-list="attributeGroupList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="商品品牌" name="brand">
|
||||
<CheckBrand v-model="form.brandIdList" :checked-list="brandInfoList"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
{{form}}
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
|
@ -198,9 +199,7 @@ export default {
|
|||
// 品类信息树选项
|
||||
categoryOptions: [],
|
||||
|
||||
// attributeInfoList:[],
|
||||
// attributeGroupList:[],
|
||||
// brandInfoList:[],
|
||||
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
@ -363,7 +362,7 @@ export default {
|
|||
this.reset();
|
||||
this.getTreeselect();
|
||||
if (row != null) {
|
||||
this.form.parentId = row.parentId;
|
||||
this.form.parentId = row.id;
|
||||
}
|
||||
getCategory(row.id).then(response => {
|
||||
this.form = response.data;
|
||||
|
|
|
@ -92,9 +92,9 @@
|
|||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="商品名称" align="center" prop="name" />
|
||||
<el-table-column label="商品描述" align="center" prop="introduction" />
|
||||
<el-table-column label="主类型" align="center" prop="mianType" />
|
||||
<el-table-column label="父类型" align="center" prop="parentType" />
|
||||
<el-table-column label="商品类型" align="center" prop="type" />
|
||||
<el-table-column label="主类型" align="center" prop="mianTypeName" />
|
||||
<el-table-column label="父类型" align="center" prop="parentTypeName" />
|
||||
<el-table-column label="商品类型" align="center" prop="typeName" />
|
||||
<el-table-column label="商品图片" align="center" prop="image" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.image" :width="50" :height="50"/>
|
||||
|
@ -110,8 +110,8 @@
|
|||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格" align="center" prop="ruleId" />
|
||||
<el-table-column label="品牌" align="center" prop="brandId" />
|
||||
<el-table-column label="规格" align="center" prop="ruleName" />
|
||||
<el-table-column label="品牌" align="center" prop="brandName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
@ -233,8 +233,8 @@
|
|||
</div>
|
||||
<div style="height: 200px; width: 100%;">
|
||||
<el-form ref="templateAttributeGroupForm" label-width="80px">
|
||||
<el-form-item :label="attribute.name" v-for="attribute in templateAttributeGroup.attributeList">
|
||||
<el-input v-model="attribute.value"></el-input>
|
||||
<el-form-item :label="attribute.code" v-for="attribute in templateAttributeGroup.attributeList">
|
||||
<el-input v-model="attribute.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
@ -723,6 +723,11 @@ export default {
|
|||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.categoryOptionValue = [
|
||||
this.form.mianType ,
|
||||
this.form.parentType ,
|
||||
this.form.type ,
|
||||
]
|
||||
this.open = true;
|
||||
this.title = "修改商品信息";
|
||||
});
|
||||
|
@ -733,11 +738,11 @@ export default {
|
|||
if (valid) {
|
||||
let attrValueList = [];
|
||||
for (const templateAttributeGroup of this.categoryCommonElement.templateAttributeGroupList) {
|
||||
templateAttributeGroup.attributeList.map(attribute => attrValueList.push({id: attribute.id, value: attribute.value}))
|
||||
templateAttributeGroup.attributeList.map(attribute => attrValueList.push({id: attribute.id, name: attribute.name}))
|
||||
}
|
||||
|
||||
this.categoryCommonElement.templateAttributeList.map(attribute => attrValueList.push({id: attribute.id, value: attribute.value}))
|
||||
this.attributeCheckedList.map(attribute => attrValueList.push({id: attribute.id, value: attribute.value}))
|
||||
this.categoryCommonElement.templateAttributeList.map(attribute => attrValueList.push({id: attribute.id, name: attribute.name}))
|
||||
this.attributeCheckedList.map(attribute => attrValueList.push({id: attribute.id, name: attribute.name}))
|
||||
let ruleInfo = this.ruleList.find(ruleInfo => ruleInfo.id === this.form.ruleId);
|
||||
const {ruleAttrList} = ruleInfo;
|
||||
let ruleAttrSize = ruleAttrList.length;
|
||||
|
@ -766,13 +771,13 @@ export default {
|
|||
console.log(productAddReq)
|
||||
if (this.form.id != null) {
|
||||
updateInfo(productAddReq).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(productAddReq).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue