商品信息列表
parent
2fff485751
commit
4fca053825
|
@ -12,11 +12,14 @@ export function listInfo(query) {
|
|||
// 查询商品信息详细
|
||||
export function getInfo(id) {
|
||||
return request({
|
||||
url: '/product/info/' + id,
|
||||
url: '/product/info/product/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 新增商品信息
|
||||
export function addInfo(data) {
|
||||
return request({
|
||||
|
|
|
@ -67,9 +67,11 @@ import {listAttribute} from "@/api/product/attribute";
|
|||
export default {
|
||||
name: "CheckAttribute",
|
||||
props: {
|
||||
value: {
|
||||
items: {
|
||||
type: Array,
|
||||
default: []
|
||||
default: function() {
|
||||
return ['item1', 'item2', 'item3'];
|
||||
}
|
||||
},
|
||||
checkedList: {
|
||||
type: Array,
|
||||
|
@ -109,6 +111,7 @@ export default {
|
|||
attributeTotal: 0,
|
||||
attributeList: [],
|
||||
total: 0,
|
||||
value: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -67,9 +67,11 @@ import {listAttributeGroup} from "@/api/product/attributeGroup";
|
|||
export default {
|
||||
name: "CheckAttributeGroup",
|
||||
props: {
|
||||
value: {
|
||||
items: {
|
||||
type: Array,
|
||||
default: []
|
||||
default: function() {
|
||||
return ['item1', 'item2', 'item3'];
|
||||
}
|
||||
},
|
||||
checkedList: {
|
||||
type: Array,
|
||||
|
@ -109,6 +111,7 @@ export default {
|
|||
attributeGroupTotal: 0,
|
||||
attributeGroupList: [],
|
||||
total: 0,
|
||||
value:[]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -67,9 +67,11 @@ import {listBrand} from "@/api/product/brand";
|
|||
export default {
|
||||
nam: "CheckBrand",
|
||||
props: {
|
||||
value: {
|
||||
items: {
|
||||
type: Array,
|
||||
default: []
|
||||
default: function() {
|
||||
return ['item1', 'item2', 'item3'];
|
||||
}
|
||||
},
|
||||
checkedList: {
|
||||
type: Array,
|
||||
|
@ -109,6 +111,7 @@ export default {
|
|||
brandTotal: 0,
|
||||
brandList: [],
|
||||
total: 0,
|
||||
value:[]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-tabs value="">
|
||||
<el-tabs>
|
||||
<el-tab-pane label="商品属性" name="attribute">
|
||||
<Attribute v-model="form.attributeIdList" :checked-list="attributeInfoList"/>
|
||||
</el-tab-pane>
|
||||
|
@ -184,6 +184,7 @@ import Treeselect from "@riophae/vue-treeselect";
|
|||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
|
||||
name: "Category",
|
||||
dicts: ['sys_yes_no'],
|
||||
components: {
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['product:info:edit']"
|
||||
v-hasPermi="['product:info:query']"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
|
@ -366,7 +366,6 @@
|
|||
|
||||
|
||||
<div v-if="active==4">
|
||||
|
||||
<el-form-item label="商品备注">
|
||||
<editor v-model="form.remark" :min-height="192"/>
|
||||
</el-form-item>
|
||||
|
@ -438,6 +437,7 @@ export default {
|
|||
templateAttributeGroupList: [],
|
||||
templateAttributeList: [],
|
||||
attributeList: []
|
||||
|
||||
},
|
||||
ruleAddFormStatus: false,
|
||||
addRulePropertyValue: null,
|
||||
|
@ -476,7 +476,13 @@ export default {
|
|||
brandId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
ruleId:[],
|
||||
skuList:[],
|
||||
templateAttributeGroupList:[],
|
||||
attributeCheckedList:[],
|
||||
templateAttributeList:[],
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
|
@ -525,7 +531,6 @@ export default {
|
|||
},
|
||||
"form.type": {
|
||||
handler(value) {
|
||||
console.log(value)
|
||||
if (value != null) {
|
||||
getTemplateAttribute(value).then(response => {
|
||||
console.log(response)
|
||||
|
@ -547,7 +552,6 @@ export default {
|
|||
methods: {
|
||||
onSubmit() {
|
||||
this.skuList.forEach(skuInfo => {
|
||||
console.log(this.oneSettingValue)
|
||||
skuInfo.image = this.oneSettingValue.image;
|
||||
skuInfo.stock = this.oneSettingValue.stock;
|
||||
skuInfo.price = this.oneSettingValue.price;
|
||||
|
@ -557,9 +561,11 @@ export default {
|
|||
this.skuList=[]
|
||||
},
|
||||
changeRule(ruleId) {
|
||||
|
||||
this.titleList = []
|
||||
let ruleInfo = this.ruleList.find(ruleInfo => ruleInfo.id === ruleId);
|
||||
const {ruleAttrList} = ruleInfo;
|
||||
|
||||
let skuTotal = 1;
|
||||
for (let ruleAttrListKey in ruleAttrList) {
|
||||
let ruleAttrInfo = ruleAttrList[ruleAttrListKey];
|
||||
|
@ -597,8 +603,6 @@ export default {
|
|||
let counter = 0;
|
||||
for (let forIndex = 0; forIndex < forSize; forIndex++) {
|
||||
const {ruleList} = ruleAttrInfo;
|
||||
console.log(ruleList)
|
||||
|
||||
ruleList.forEach(value => {
|
||||
for (let continuousIndex = 0; continuousIndex < continuousSize; continuousIndex++) {
|
||||
this.skuList[counter++]["prop" + currentIndex] = value;
|
||||
|
@ -657,7 +661,6 @@ export default {
|
|||
listCategory().then(response => {
|
||||
this.categoryOptions = []
|
||||
this.categoryOptions = this.handleTree(response.data, "id", "parentId");
|
||||
console.log(this.categoryOptions);
|
||||
})
|
||||
},
|
||||
next() {
|
||||
|
@ -728,7 +731,13 @@ export default {
|
|||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
console.log(response)
|
||||
this.form = response.data;
|
||||
this.changeRule(response.data.ruleId)
|
||||
this.form.type=parseInt(response.data.type)
|
||||
this.form.mianType=parseInt(response.data.mianType)
|
||||
this.form.parentType=parseInt(response.data.parentType)
|
||||
this.CategoryTree()
|
||||
this.open = true;
|
||||
this.title = "修改商品信息";
|
||||
});
|
||||
|
@ -744,6 +753,11 @@ export default {
|
|||
this.getList();
|
||||
});
|
||||
} else {
|
||||
this.form.templateAttributeGroupList=this.categoryCommonElement.templateAttributeGroupList
|
||||
this.form.attributeCheckedList=this.attributeCheckedList
|
||||
this.form.skuList=this.skuList
|
||||
this.form.templateAttributeList=this.categoryCommonElement.templateAttributeList
|
||||
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
|
|
Loading…
Reference in New Issue