|
|
|
@ -25,9 +25,9 @@
|
|
|
|
<el-option label="下架" value="1"/>
|
|
|
|
<el-option label="下架" value="1"/>
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="创建时间" prop="createTime">
|
|
|
|
<el-form-item label="创建时间">
|
|
|
|
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
|
|
|
|
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
|
|
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
|
|
|
|
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
|
@ -193,7 +193,7 @@
|
|
|
|
label="条形码"
|
|
|
|
label="条形码"
|
|
|
|
width="250" v-if="skuTags.length">
|
|
|
|
width="250" v-if="skuTags.length">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-input v-model="scope.row.barCode" type="textarea" :disabled="scope.row.status===1"></el-input>
|
|
|
|
<el-input v-model="scope.row.barCode" type="textarea" :disabled="scope.row.status==1"></el-input>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
|
@ -207,7 +207,7 @@
|
|
|
|
:precision="2"
|
|
|
|
:precision="2"
|
|
|
|
:max="1000000000"
|
|
|
|
:max="1000000000"
|
|
|
|
:min="0.01"
|
|
|
|
:min="0.01"
|
|
|
|
:disabled="scope.row.status===1">
|
|
|
|
:disabled="scope.row.status==1">
|
|
|
|
</el-input-number>
|
|
|
|
</el-input-number>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
@ -222,7 +222,7 @@
|
|
|
|
:precision="2"
|
|
|
|
:precision="2"
|
|
|
|
:max="1000000000"
|
|
|
|
:max="1000000000"
|
|
|
|
:min="0.01"
|
|
|
|
:min="0.01"
|
|
|
|
:disabled="scope.row.status===1">
|
|
|
|
:disabled="scope.row.status==1">
|
|
|
|
</el-input-number>
|
|
|
|
</el-input-number>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
@ -237,14 +237,15 @@
|
|
|
|
:precision="2"
|
|
|
|
:precision="2"
|
|
|
|
:max="1000000000"
|
|
|
|
:max="1000000000"
|
|
|
|
:min="0.01"
|
|
|
|
:min="0.01"
|
|
|
|
:disabled="scope.row.status===1">
|
|
|
|
:disabled="scope.row.status==1">
|
|
|
|
</el-input-number>
|
|
|
|
</el-input-number>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
|
label="操作">
|
|
|
|
label="操作">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)" v-if="scope.row.status===0">
|
|
|
|
<el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)"
|
|
|
|
|
|
|
|
v-if="scope.row.status===0">
|
|
|
|
正常
|
|
|
|
正常
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)" v-else>已禁用</el-button>
|
|
|
|
<el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)" v-else>已禁用</el-button>
|
|
|
|
@ -319,6 +320,7 @@
|
|
|
|
propertyId: '',
|
|
|
|
propertyId: '',
|
|
|
|
selectValues: [],
|
|
|
|
selectValues: [],
|
|
|
|
selectValueIds: [],
|
|
|
|
selectValueIds: [],
|
|
|
|
|
|
|
|
selectObect:[],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
skuTags: [],
|
|
|
|
skuTags: [],
|
|
|
|
propName: {
|
|
|
|
propName: {
|
|
|
|
@ -341,6 +343,7 @@
|
|
|
|
title: "",
|
|
|
|
title: "",
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
dateRangeCreateTime: [],
|
|
|
|
// 查询参数
|
|
|
|
// 查询参数
|
|
|
|
queryParams: {
|
|
|
|
queryParams: {
|
|
|
|
pageNo: 1,
|
|
|
|
pageNo: 1,
|
|
|
|
@ -355,7 +358,6 @@
|
|
|
|
price: null,
|
|
|
|
price: null,
|
|
|
|
quantity: null,
|
|
|
|
quantity: null,
|
|
|
|
status: null,
|
|
|
|
status: null,
|
|
|
|
createTime: []
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单参数
|
|
|
|
// 表单参数
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
@ -388,7 +390,8 @@
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
this.getPropertyPageList();
|
|
|
|
|
|
|
|
this.getListCategory();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
getTableSpecData() {
|
|
|
|
getTableSpecData() {
|
|
|
|
@ -398,7 +401,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
changeSkuStatus(tagIndex) {
|
|
|
|
changeSkuStatus(tagIndex) {
|
|
|
|
if(this.form.skus[tagIndex].status === 0){
|
|
|
|
if (this.form.skus[tagIndex].status == 0) {
|
|
|
|
this.form.skus[tagIndex].status = 1;
|
|
|
|
this.form.skus[tagIndex].status = 1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.form.skus[tagIndex].status = 0;
|
|
|
|
this.form.skus[tagIndex].status = 0;
|
|
|
|
@ -426,28 +429,48 @@
|
|
|
|
this.$emit('input', skuList)
|
|
|
|
this.$emit('input', skuList)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleTagClose(tagIndex, tagItemIndex) {
|
|
|
|
handleTagClose(tagIndex, tagItemIndex) {
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//确定添加sku规格
|
|
|
|
//确定添加sku规格
|
|
|
|
addTag() {
|
|
|
|
addTag() {
|
|
|
|
|
|
|
|
|
|
|
|
let skus = this.unUseTags.map(function (item, index) {
|
|
|
|
let skus = this.unUseTags.map(function (item, index) {
|
|
|
|
return item.name
|
|
|
|
return item.name
|
|
|
|
});
|
|
|
|
});
|
|
|
|
console.log("skus=="+JSON.stringify(skus))
|
|
|
|
|
|
|
|
let index = skus.indexOf(this.addTagInput.name);
|
|
|
|
let index = skus.indexOf(this.addTagInput.name);
|
|
|
|
console.log("index=="+index)
|
|
|
|
|
|
|
|
console.log("skus[index].id=="+this.unUseTags[index].id)
|
|
|
|
|
|
|
|
console.log("this.unUseTags[index].propertyValueList=="+JSON.stringify(this.unUseTags[index].propertyValueList))
|
|
|
|
|
|
|
|
this.addTagInput.propertyId = this.unUseTags[index].id;
|
|
|
|
this.addTagInput.propertyId = this.unUseTags[index].id;
|
|
|
|
for (let i = 0; i < this.addTagInput.selectValues.length; i++) {
|
|
|
|
for (let i = 0; i < this.addTagInput.selectValues.length; i++) {
|
|
|
|
for (let j = 0; j < this.unUseTags[index].propertyValueList.length; j++) {
|
|
|
|
for (let j = 0; j < this.unUseTags[index].propertyValueList.length; j++) {
|
|
|
|
if (this.addTagInput.selectValues[i] === this.unUseTags[index].propertyValueList[j].name) {
|
|
|
|
if (this.addTagInput.selectValues[i] === this.unUseTags[index].propertyValueList[j].name) {
|
|
|
|
this.addTagInput.selectValueIds.push(this.unUseTags[index].propertyValueList[j].id)
|
|
|
|
this.addTagInput.selectValueIds.push(this.unUseTags[index].propertyValueList[j].id)
|
|
|
|
|
|
|
|
this.addTagInput.selectObect.push({
|
|
|
|
|
|
|
|
id:this.unUseTags[index].propertyValueList[j].id,
|
|
|
|
|
|
|
|
name:this.unUseTags[index].propertyValueList[j].name,
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let addTagInput = JSON.parse(JSON.stringify(this.addTagInput))
|
|
|
|
let addTagInput = JSON.parse(JSON.stringify(this.addTagInput))
|
|
|
|
console.log("addTagInput=="+JSON.stringify(addTagInput))
|
|
|
|
|
|
|
|
this.skuTags.push(addTagInput);
|
|
|
|
this.skuTags.push(addTagInput);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (this.skuTags.length > 1) {
|
|
|
|
|
|
|
|
this.skuTags = this.skuTags.sort((a, b) => a.propertyId - b.propertyId);
|
|
|
|
|
|
|
|
this.skuTags.forEach(function (item,index) {
|
|
|
|
|
|
|
|
item.selectObect = item.selectObect.sort((a, b) => a.id - b.id)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i <this.skuTags.length ; i++) {
|
|
|
|
|
|
|
|
let selectValueIds=[];
|
|
|
|
|
|
|
|
let selectValues=[];
|
|
|
|
|
|
|
|
for (let j = 0; j < this.skuTags[i].selectObect.length; j++) {
|
|
|
|
|
|
|
|
selectValueIds.push(this.skuTags[i].selectObect[j].id);
|
|
|
|
|
|
|
|
selectValues.push(this.skuTags[i].selectObect[j].name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.skuTags[i].selectValues = selectValues;
|
|
|
|
|
|
|
|
this.skuTags[i].selectValueIds = selectValueIds;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.unUseTags.splice(index, 1);
|
|
|
|
this.unUseTags.splice(index, 1);
|
|
|
|
this.isShowTagInput = false;
|
|
|
|
this.isShowTagInput = false;
|
|
|
|
this.getTable();
|
|
|
|
this.getTable();
|
|
|
|
@ -465,19 +488,19 @@
|
|
|
|
propertyIds.push(skuTags[i].propertyId);
|
|
|
|
propertyIds.push(skuTags[i].propertyId);
|
|
|
|
propertyNames.push(skuTags[i].name);
|
|
|
|
propertyNames.push(skuTags[i].name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let skuAll = sku1s.reduce((x, y) => {
|
|
|
|
let skuAll = sku1s.reduce((x, y) => {
|
|
|
|
let arr = [];
|
|
|
|
let arr = [];
|
|
|
|
x.forEach(m => y.forEach(y => arr.push(m.concat([y]))))
|
|
|
|
x.forEach(m => y.forEach(y => arr.push(m.concat([y]))))
|
|
|
|
return arr;
|
|
|
|
return arr;
|
|
|
|
}, [[]])
|
|
|
|
}, [[]])
|
|
|
|
console.log(skuAll);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let skuIdAll = skuIds.reduce((x, y) => {
|
|
|
|
let skuIdAll = skuIds.reduce((x, y) => {
|
|
|
|
let arr = [];
|
|
|
|
let arr = [];
|
|
|
|
x.forEach(m => y.forEach(y => arr.push(m.concat([y]))))
|
|
|
|
x.forEach(m => y.forEach(y => arr.push(m.concat([y]))))
|
|
|
|
return arr;
|
|
|
|
return arr;
|
|
|
|
}, [[]])
|
|
|
|
}, [[]])
|
|
|
|
console.log(skuIdAll);
|
|
|
|
|
|
|
|
for (let i = 0; i < skuAll.length; i++) {
|
|
|
|
for (let i = 0; i < skuAll.length; i++) {
|
|
|
|
let han = {
|
|
|
|
let han = {
|
|
|
|
propertyNames: propertyNames,
|
|
|
|
propertyNames: propertyNames,
|
|
|
|
@ -506,7 +529,6 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
console.log("this.skus=="+JSON.stringify(this.form.skus))
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
hideTagInput() {
|
|
|
|
hideTagInput() {
|
|
|
|
this.isShowTagInput = false;
|
|
|
|
this.isShowTagInput = false;
|
|
|
|
@ -515,6 +537,7 @@
|
|
|
|
propertyId: '',
|
|
|
|
propertyId: '',
|
|
|
|
selectValues: [],
|
|
|
|
selectValues: [],
|
|
|
|
selectValueIds: [],
|
|
|
|
selectValueIds: [],
|
|
|
|
|
|
|
|
selectObect: [],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
shopTagInput() {
|
|
|
|
shopTagInput() {
|
|
|
|
@ -527,6 +550,7 @@
|
|
|
|
propertyId: '',
|
|
|
|
propertyId: '',
|
|
|
|
selectValues: [],
|
|
|
|
selectValues: [],
|
|
|
|
selectValueIds: [],
|
|
|
|
selectValueIds: [],
|
|
|
|
|
|
|
|
selectObect: [],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//删除已选的规格
|
|
|
|
//删除已选的规格
|
|
|
|
@ -556,7 +580,6 @@
|
|
|
|
return item
|
|
|
|
return item
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.allhistoryTags = JSON.parse(JSON.stringify(this.unUseTags));
|
|
|
|
this.allhistoryTags = JSON.parse(JSON.stringify(this.unUseTags));
|
|
|
|
console.log(this.propertyPageList)
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 查询分类 */
|
|
|
|
/** 查询分类 */
|
|
|
|
@ -570,8 +593,11 @@
|
|
|
|
/** 查询列表 */
|
|
|
|
/** 查询列表 */
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
// 处理查询参数
|
|
|
|
|
|
|
|
let params = {...this.queryParams};
|
|
|
|
|
|
|
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
|
|
|
// 执行查询
|
|
|
|
// 执行查询
|
|
|
|
getSpuPage(this.queryParams).then(response => {
|
|
|
|
getSpuPage(params).then(response => {
|
|
|
|
this.list = response.data.list;
|
|
|
|
this.list = response.data.list;
|
|
|
|
this.total = response.data.total;
|
|
|
|
this.total = response.data.total;
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
@ -620,14 +646,13 @@
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "添加商品spu";
|
|
|
|
this.title = "添加商品spu";
|
|
|
|
this.getListCategory();
|
|
|
|
|
|
|
|
this.getPropertyPageList();
|
|
|
|
this.getPropertyPageList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
handleUpdate(row) {
|
|
|
|
handleUpdate(row) {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
getSpu(row.id).then(response => {
|
|
|
|
const id = row.id;
|
|
|
|
console.log(">>>>>> response.data:" + JSON.stringify(response.data))
|
|
|
|
getSpu(id).then(response => {
|
|
|
|
let dataSpu = response.data;
|
|
|
|
let dataSpu = response.data;
|
|
|
|
this.form = {
|
|
|
|
this.form = {
|
|
|
|
id: dataSpu.id,
|
|
|
|
id: dataSpu.id,
|
|
|
|
@ -643,17 +668,100 @@
|
|
|
|
quantity: dataSpu.quantity,
|
|
|
|
quantity: dataSpu.quantity,
|
|
|
|
status: dataSpu.status,
|
|
|
|
status: dataSpu.status,
|
|
|
|
isShowTagInput: undefined,
|
|
|
|
isShowTagInput: undefined,
|
|
|
|
skus:dataSpu.skus
|
|
|
|
skus: [],
|
|
|
|
|
|
|
|
skusList: dataSpu.skus,
|
|
|
|
|
|
|
|
productPropertyViews: dataSpu.productPropertyViews,
|
|
|
|
// skus:dataSpu.productSkuRespVOS,
|
|
|
|
// skus:dataSpu.productSkuRespVOS,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
this.getDataHandle();
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "修改商品spu";
|
|
|
|
this.title = "修改商品spu";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
getDataHandle() {
|
|
|
|
|
|
|
|
let that = this;
|
|
|
|
|
|
|
|
let productPropertyViews = JSON.parse(JSON.stringify(this.form.productPropertyViews));
|
|
|
|
|
|
|
|
productPropertyViews = productPropertyViews.sort((a, b) => a.propertyId - b.propertyId);
|
|
|
|
|
|
|
|
productPropertyViews.forEach(item => {
|
|
|
|
|
|
|
|
item.propertyValues = item.propertyValues.sort((a, b) => a.v1 - b.v1);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
let skuIds = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < productPropertyViews.length; i++) {
|
|
|
|
|
|
|
|
let han = {
|
|
|
|
|
|
|
|
name: productPropertyViews[i].name,
|
|
|
|
|
|
|
|
propertyId: productPropertyViews[i].propertyId,
|
|
|
|
|
|
|
|
selectValues: [],
|
|
|
|
|
|
|
|
selectValueIds: [],
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (let j = 0; j < productPropertyViews[i].propertyValues.length; j++) {
|
|
|
|
|
|
|
|
han.selectValues.push(productPropertyViews[i].propertyValues[j].v2);
|
|
|
|
|
|
|
|
han.selectValueIds.push(productPropertyViews[i].propertyValues[j].v1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
skuIds.push(han)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.skuTags = skuIds;
|
|
|
|
|
|
|
|
this.unUseTags = this.allhistoryTags.filter((v) =>
|
|
|
|
|
|
|
|
skuIds.every((val) => val.name != v.name)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
this.getHandleTable();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getHandleTable() {
|
|
|
|
|
|
|
|
this.form.skus = [];
|
|
|
|
|
|
|
|
let skuTags = JSON.parse(JSON.stringify(this.skuTags));
|
|
|
|
|
|
|
|
let sku1s = [];
|
|
|
|
|
|
|
|
let skuIds = [];
|
|
|
|
|
|
|
|
let propertyIds = [];
|
|
|
|
|
|
|
|
let propertyNames = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < skuTags.length; i++) {
|
|
|
|
|
|
|
|
sku1s.push(skuTags[i].selectValues);
|
|
|
|
|
|
|
|
skuIds.push(skuTags[i].selectValueIds);
|
|
|
|
|
|
|
|
propertyIds.push(skuTags[i].propertyId);
|
|
|
|
|
|
|
|
propertyNames.push(skuTags[i].name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
let skuAll = sku1s.reduce((x, y) => {
|
|
|
|
|
|
|
|
let arr = [];
|
|
|
|
|
|
|
|
x.forEach(m => y.forEach(y => arr.push(m.concat([y]))))
|
|
|
|
|
|
|
|
return arr;
|
|
|
|
|
|
|
|
}, [[]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let skuIdAll = skuIds.reduce((x, y) => {
|
|
|
|
|
|
|
|
let arr = [];
|
|
|
|
|
|
|
|
x.forEach(m => y.forEach(y => arr.push(m.concat([y]))))
|
|
|
|
|
|
|
|
return arr;
|
|
|
|
|
|
|
|
}, [[]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < skuAll.length; i++) {
|
|
|
|
|
|
|
|
let han = {
|
|
|
|
|
|
|
|
propertyNames: propertyNames,
|
|
|
|
|
|
|
|
propertyIds: propertyIds,
|
|
|
|
|
|
|
|
propertyChildNames: skuAll[i],
|
|
|
|
|
|
|
|
propertyChildIds: skuIdAll[i],
|
|
|
|
|
|
|
|
properties: this.form.skusList[i].properties,
|
|
|
|
|
|
|
|
picUrl: this.form.skusList[i].picUrl,
|
|
|
|
|
|
|
|
costPrice: this.form.skusList[i].costPrice,
|
|
|
|
|
|
|
|
originalPrice: this.form.skusList[i].originalPrice,
|
|
|
|
|
|
|
|
spuId: this.form.skusList[i].spuId,
|
|
|
|
|
|
|
|
prodName: this.form.skusList[i].prodName,
|
|
|
|
|
|
|
|
price: this.form.skusList[i].price,
|
|
|
|
|
|
|
|
barCode: this.form.skusList[i].barCode,
|
|
|
|
|
|
|
|
status: this.form.skusList[i].status,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.form.skus.push(han);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.form.skus.forEach(x => {
|
|
|
|
|
|
|
|
x.properties = [];
|
|
|
|
|
|
|
|
for (let i = 0; i < x.propertyIds.length; i++) {
|
|
|
|
|
|
|
|
x.properties.push({
|
|
|
|
|
|
|
|
propertyId: x.propertyIds[i],
|
|
|
|
|
|
|
|
valueId: x.propertyChildIds[i]
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
/** 提交按钮 */
|
|
|
|
/** 提交按钮 */
|
|
|
|
submitForm() {
|
|
|
|
submitForm() {
|
|
|
|
console.log(this.form.picUrls.split(','));
|
|
|
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
if (!valid) {
|
|
|
|
if (!valid) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
@ -695,6 +803,7 @@
|
|
|
|
let params = {...this.queryParams};
|
|
|
|
let params = {...this.queryParams};
|
|
|
|
params.pageNo = undefined;
|
|
|
|
params.pageNo = undefined;
|
|
|
|
params.pageSize = undefined;
|
|
|
|
params.pageSize = undefined;
|
|
|
|
|
|
|
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
|
|
|
|
// 执行导出
|
|
|
|
// 执行导出
|
|
|
|
this.$modal.confirm('是否确认导出所有商品spu数据项?').then(() => {
|
|
|
|
this.$modal.confirm('是否确认导出所有商品spu数据项?').then(() => {
|
|
|
|
this.exportLoading = true;
|
|
|
|
this.exportLoading = true;
|
|
|
|
|