|
@@ -30,6 +30,16 @@
|
|
<template #tags="{ item }">
|
|
<template #tags="{ item }">
|
|
<el-cascader v-model="form[item.model]" :options="tagsList" :props="props" clearable filterable :show-all-levels="false"></el-cascader>
|
|
<el-cascader v-model="form[item.model]" :options="tagsList" :props="props" clearable filterable :show-all-levels="false"></el-cascader>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #act_tags="{ item }">
|
|
|
|
+ <el-cascader
|
|
|
|
+ v-model="form[item.model]"
|
|
|
|
+ :options="act_tagsList"
|
|
|
|
+ :props="act_tagsProps"
|
|
|
|
+ clearable
|
|
|
|
+ filterable
|
|
|
|
+ :show-all-levels="false"
|
|
|
|
+ ></el-cascader>
|
|
|
|
+ </template>
|
|
<template #status>
|
|
<template #status>
|
|
<el-option v-for="i in goodsStatusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
<el-option v-for="i in goodsStatusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
</template>
|
|
</template>
|
|
@@ -58,7 +68,8 @@ export default {
|
|
fields: [
|
|
fields: [
|
|
{ label: '商品名称', model: 'name' },
|
|
{ label: '商品名称', model: 'name' },
|
|
{ label: '店铺名称', model: 'shop.name' },
|
|
{ label: '店铺名称', model: 'shop.name' },
|
|
- { label: '商品标签', model: 'tags', format: (i) => this.getTags(i) },
|
|
|
|
|
|
+ { label: '商品分类', model: 'tags', format: (i) => this.getTags(i) },
|
|
|
|
+ { label: '活动标签', model: 'act_tags', format: (i) => this.getAct_tags(i) },
|
|
{ label: '商品状态', model: 'status', format: (i) => this.getStatus(i) },
|
|
{ label: '商品状态', model: 'status', format: (i) => this.getStatus(i) },
|
|
],
|
|
],
|
|
opera: [
|
|
opera: [
|
|
@@ -78,7 +89,8 @@ export default {
|
|
// info部分
|
|
// info部分
|
|
infoFields: [
|
|
infoFields: [
|
|
{ label: '商品名称', model: 'name' },
|
|
{ label: '商品名称', model: 'name' },
|
|
- { label: '商品标签', model: 'tags', custom: true },
|
|
|
|
|
|
+ { label: '商品分类', model: 'tags', custom: true },
|
|
|
|
+ { label: '活动标签', model: 'act_tags', custom: true },
|
|
{ label: '简短简介', model: 'shot_brief', maxLength: 50 },
|
|
{ label: '简短简介', model: 'shot_brief', maxLength: 50 },
|
|
{ label: '预计发货时间', model: 'send_time' },
|
|
{ label: '预计发货时间', model: 'send_time' },
|
|
{ label: '商品图片', model: 'file', type: 'upload', url: '/files/point/goods/upload' },
|
|
{ label: '商品图片', model: 'file', type: 'upload', url: '/files/point/goods/upload' },
|
|
@@ -87,10 +99,14 @@ export default {
|
|
],
|
|
],
|
|
rules: {},
|
|
rules: {},
|
|
form: {},
|
|
form: {},
|
|
-
|
|
|
|
|
|
+ // 商品分类
|
|
tagsList: [],
|
|
tagsList: [],
|
|
- goodsStatusList: [],
|
|
|
|
props: { multiple: true, label: 'label', value: 'code' },
|
|
props: { multiple: true, label: 'label', value: 'code' },
|
|
|
|
+ // 活动标签
|
|
|
|
+ act_tagsList: [],
|
|
|
|
+ act_tagsProps: { multiple: true, label: 'label', value: 'value' },
|
|
|
|
+
|
|
|
|
+ goodsStatusList: [],
|
|
|
|
|
|
shop: {},
|
|
shop: {},
|
|
};
|
|
};
|
|
@@ -128,6 +144,8 @@ export default {
|
|
if (this.$checkRes(res)) this.$set(this, `goodsStatusList`, res.data);
|
|
if (this.$checkRes(res)) this.$set(this, `goodsStatusList`, res.data);
|
|
res = await this.getInfo();
|
|
res = await this.getInfo();
|
|
if (this.$checkRes(res)) this.$set(this, `shop`, res.data);
|
|
if (this.$checkRes(res)) this.$set(this, `shop`, res.data);
|
|
|
|
+ res = await this.getDict({ code: 'act_tags' });
|
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `act_tagsList`, res.data);
|
|
},
|
|
},
|
|
getStatus(data) {
|
|
getStatus(data) {
|
|
const res = this.goodsStatusList.find((f) => f.value === data);
|
|
const res = this.goodsStatusList.find((f) => f.value === data);
|
|
@@ -150,6 +168,22 @@ export default {
|
|
}
|
|
}
|
|
return arr.join(';');
|
|
return arr.join(';');
|
|
},
|
|
},
|
|
|
|
+ getAct_tags(data) {
|
|
|
|
+ let list = this.act_tagsList;
|
|
|
|
+ const getChildren = (list) =>
|
|
|
|
+ list.map((i) => {
|
|
|
|
+ if (i.children) return getChildren(i.children);
|
|
|
|
+ return i;
|
|
|
|
+ });
|
|
|
|
+ list = _.flattenDeep(getChildren(list));
|
|
|
|
+ const arr = [];
|
|
|
|
+ for (const ts of data) {
|
|
|
|
+ const last = _.last(ts);
|
|
|
|
+ const r = list.find((f) => f.value === last);
|
|
|
|
+ if (r) arr.push(r.label);
|
|
|
|
+ }
|
|
|
|
+ return arr.join(';');
|
|
|
|
+ },
|
|
toSpec({ data }) {
|
|
toSpec({ data }) {
|
|
this.$router.push({ path: `/selfShop/spec/${data._id}` });
|
|
this.$router.push({ path: `/selfShop/spec/${data._id}` });
|
|
},
|
|
},
|