|
@@ -44,6 +44,30 @@
|
|
|
<template #status>
|
|
|
<el-option v-for="i in goodsStatusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
</template>
|
|
|
+ <template #is_cashBack>
|
|
|
+ <el-option v-for="i in statusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
+ </template>
|
|
|
+ <template #cb_config>
|
|
|
+ <el-form :model="cb_config" ref="cb_config" label-width="180px" @save="toSave">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="返现金额类型" prop="back_type">
|
|
|
+ <el-select v-model="cb_config.back_type" clearable filterable placeholder="请选择返现金额类型" size="small" style="width: 100%">
|
|
|
+ <el-option v-for="i in typeList" :key="i.label" :label="i.label" :value="i.label"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="cb_config.back_type == '固定金额'">
|
|
|
+ <el-form-item label="具体返现金额设置" prop="money">
|
|
|
+ <el-input v-model="cb_config.money" placeholder="请输入金额" type="number" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" v-if="cb_config.back_type == '百分比'">
|
|
|
+ <el-form-item label="具体返现金额设置" prop="money">
|
|
|
+ <el-input v-model="cb_config.money" placeholder="请输入百分比" type="number" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
<template #brief>
|
|
|
<editor v-model="form.brief" url="/files/point/goods/upload" />
|
|
|
</template>
|
|
@@ -118,12 +142,16 @@ export default {
|
|
|
{ label: '商品来源', model: 'source' },
|
|
|
{ label: '网址', model: 'url' },
|
|
|
{ label: '排序', model: 'sort', type: 'number' },
|
|
|
+ { label: '是否返现', model: 'is_cashBack', type: 'select' },
|
|
|
+ { label: '返现设置', model: 'cb_config', custom: true },
|
|
|
{ label: '商品图片', model: 'file', type: 'upload', url: '/files/point/goods/upload' },
|
|
|
{ label: '商品介绍', model: 'brief', custom: true },
|
|
|
],
|
|
|
rules: {
|
|
|
shop: [{ required: true, message: '请选择商铺名称', trigger: 'change' }],
|
|
|
},
|
|
|
+ // 返现设置
|
|
|
+ cb_config: {},
|
|
|
form: {},
|
|
|
// 商品分类
|
|
|
tagsList: [],
|
|
@@ -136,6 +164,10 @@ export default {
|
|
|
shopList: [],
|
|
|
// 店铺远程搜索加载
|
|
|
loading: false,
|
|
|
+ // 是否返现
|
|
|
+ statusList: [],
|
|
|
+ // 返现金额类型
|
|
|
+ typeList: [{ label: '固定金额' }, { label: '百分比' }],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -163,6 +195,8 @@ export default {
|
|
|
async toEdit({ data }) {
|
|
|
const res = await this.fetch(data._id);
|
|
|
if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
+ this.cb_config = res.data.cb_config;
|
|
|
if (data.shop) {
|
|
|
let list = [];
|
|
|
let res = await this.shopFetch(data.shop._id);
|
|
@@ -238,6 +272,9 @@ export default {
|
|
|
if (this.$checkRes(res)) this.$set(this, `goodsStatusList`, res.data);
|
|
|
res = await this.actQuery();
|
|
|
if (this.$checkRes(res)) this.$set(this, `act_tagsList`, res.data);
|
|
|
+ // 是否返现
|
|
|
+ res = await this.getDict({ code: 'use' });
|
|
|
+ if (this.$checkRes(res)) this.$set(this, `statusList`, res.data);
|
|
|
},
|
|
|
// 商品状态
|
|
|
getStatus(data) {
|
|
@@ -276,9 +313,13 @@ export default {
|
|
|
let res;
|
|
|
if (data == '' || data == undefined) {
|
|
|
let form = this.form;
|
|
|
+ form.cb_config = this.cb_config;
|
|
|
+ form.cb_config.money = Number(form.cb_config.money);
|
|
|
if (form.id) res = await this.update(form);
|
|
|
else res = await this.create(form);
|
|
|
} else {
|
|
|
+ data.cb_config = this.cb_config;
|
|
|
+ data.cb_config.money = Number(data.cb_config.money);
|
|
|
if (data.id) res = await this.update(data);
|
|
|
else res = await this.create(data);
|
|
|
}
|