商品模板修改

master
mabo 2021-06-24 16:41:04 +08:00
parent 7b2054206a
commit 84f3eaea10
1 changed files with 12 additions and 27 deletions

View File

@ -405,11 +405,9 @@
<Button type="primary" @click="save" :loading="submitLoading" v-if="activestep === 1">
{{ this.goodsId ? "保存" : "保存商品" }}
</Button>
<Button type="primary" @click="saveToDraft('TEMPLATE')" v-if="activestep === 1">
<Button type="primary" @click="saveToDraft" v-if="activestep === 1">
保存为模版
</Button>
<!-- <Button type="primary" @click="saveToDraft('DRAFT')" v-if="activestep === 1 && !isOperationGoods">稿
</Button> -->
</ButtonGroup>
</div>
@ -1286,7 +1284,6 @@ export default {
});
cloneTemp.splice(0, 1);
result = this.specIterator(result, cloneTemp);
// result = this.defaultParams(result);
this.skuTableData = result;
}
},
@ -1297,7 +1294,8 @@ export default {
if(res.length) {
res.forEach(e => {
this.skuData.push(e.specName)
this.skuVals.push(e.specValue ? e.specValue.split(',') : [])
const vals = e.specValue ? e.specValue.split(',') : []
this.skuVals.push(Array.from(new Set(vals)))
})
}
}
@ -1306,14 +1304,9 @@ export default {
},
/** 自动完成表单所需方法*/
filterMethod(value, option) {
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
},
/**
* 添加固有属性
*/
// defaultParams(tableData) {
// return tableData;
// },
/**
* 迭代属性形成表格
* result 渲染的数据
@ -1324,7 +1317,6 @@ export default {
if (cloneTemp.length > 0) {
let table = [];
result.forEach((resItem) => {
let tableItem = [];
cloneTemp[0].spec_values.forEach((valItem) => {
let obj = cloneObj(resItem);
obj[valItem.name] = valItem.value;
@ -1560,29 +1552,22 @@ export default {
});
},
/** 保存为模板 */
saveToDraft(saveType) {
let showType = saveType === "TEMPLATE" ? "模版" : "草稿";
saveToDraft() {
this.baseInfoForm.skuList = this.skuTableData;
if (this.baseInfoForm.goodsGalleryFiles.length > 0) {
this.baseInfoForm.goodsGalleryList =
this.baseInfoForm.goodsGalleryFiles.map((i) => i.url);
}
this.baseInfoForm.categoryName = [];
this.baseInfoForm.saveType = saveType;
this.baseInfoForm.saveType = 'TEMPLATE';
if (this.draftId) {
this.baseInfoForm.id = this.draftId;
this.$Modal.confirm({
title: "当前" + showType + "已存在",
content:
"当前" +
showType +
"已存在,是否保存为新" +
showType +
"或替换原" +
showType,
okText: "保存新" + showType,
cancelText: "替换旧" + showType,
title: "当前模板已存在",
content: "当前模板已存在,保存为新模板或替换原模板",
okText: "保存新模板",
cancelText: "替换旧模板",
closable: true,
onOk: () => {
delete this.baseInfoForm.id;
@ -1598,7 +1583,7 @@ export default {
}
this.$Modal.confirm({
title: "保存" + showType,
title: "保存模板",
content: "是否确定保存",
okText: "保存",
closable: true,