|
@@ -28,6 +28,9 @@
|
|
<template #status>
|
|
<template #status>
|
|
<el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
<el-option v-for="i in statusList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #can_group>
|
|
|
|
+ <el-option v-for="i in tfList" :key="i.model" :label="i.label" :value="i.value"></el-option>
|
|
|
|
+ </template>
|
|
</data-form>
|
|
</data-form>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -56,6 +59,17 @@ export default {
|
|
{ label: '划掉销售价格', model: 'flow_money' },
|
|
{ label: '划掉销售价格', model: 'flow_money' },
|
|
{ label: '运费', model: 'freight' },
|
|
{ label: '运费', model: 'freight' },
|
|
{ label: '状态', model: 'status', format: (i) => (i === '0' ? '使用中' : '已禁用') },
|
|
{ label: '状态', model: 'status', format: (i) => (i === '0' ? '使用中' : '已禁用') },
|
|
|
|
+ {
|
|
|
|
+ label: '是否可以团购',
|
|
|
|
+ model: 'can_group',
|
|
|
|
+ format: (i) => {
|
|
|
|
+ let data = this.tfList.find((f) => f.value == i);
|
|
|
|
+ if (data) return data.label;
|
|
|
|
+ else return '暂无';
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ { label: '团购金额', model: 'group_config.money' },
|
|
|
|
+ { label: '团购金额', model: 'group_config.need_person' },
|
|
],
|
|
],
|
|
opera: [
|
|
opera: [
|
|
{ label: '修改', method: 'edit' },
|
|
{ label: '修改', method: 'edit' },
|
|
@@ -78,11 +92,16 @@ export default {
|
|
{ label: '划掉销售价格', model: 'flow_money', type: 'number' },
|
|
{ label: '划掉销售价格', model: 'flow_money', type: 'number' },
|
|
{ label: '运费', model: 'freight', type: 'number' },
|
|
{ label: '运费', model: 'freight', type: 'number' },
|
|
{ label: '状态', model: 'status', type: 'select' },
|
|
{ label: '状态', model: 'status', type: 'select' },
|
|
|
|
+ { label: '是否可以团购', model: 'can_group', type: 'select' },
|
|
|
|
+ { label: '团购金额', model: 'money', type: 'number' },
|
|
|
|
+ { label: '团购金额', model: 'need_person', type: 'number' },
|
|
],
|
|
],
|
|
rules: {},
|
|
rules: {},
|
|
form: {},
|
|
form: {},
|
|
|
|
|
|
statusList: [],
|
|
statusList: [],
|
|
|
|
+ // 是否可以团购
|
|
|
|
+ tfList: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -104,13 +123,29 @@ export default {
|
|
const obj = { goods: this.goods, status: '0' };
|
|
const obj = { goods: this.goods, status: '0' };
|
|
this.$set(this, 'form', obj);
|
|
this.$set(this, 'form', obj);
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ async toSave({ data }) {
|
|
|
|
+ let group_config = {};
|
|
|
|
+ group_config.money = data.money;
|
|
|
|
+ group_config.need_person = data.need_person;
|
|
|
|
+ data.group_config = group_config;
|
|
|
|
+ let res;
|
|
|
|
+ if (data.id) res = await this.update(data);
|
|
|
|
+ else res = await this.create(data);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$message({ type: `success`, message: `维护信息成功` });
|
|
|
|
+ this.toBack();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
toBack() {
|
|
toBack() {
|
|
- this.$router.push('/selfShop/goods');
|
|
|
|
|
|
+ window.history.go('-1');
|
|
},
|
|
},
|
|
async searchOthers() {
|
|
async searchOthers() {
|
|
|
|
+ // 状态
|
|
let res = await this.getDict({ code: 'status' });
|
|
let res = await this.getDict({ code: 'status' });
|
|
if (this.$checkRes(res)) this.$set(this, 'statusList', res.data);
|
|
if (this.$checkRes(res)) this.$set(this, 'statusList', res.data);
|
|
|
|
+ // 是否可以团购
|
|
|
|
+ res = await this.getDict({ code: 'tf' });
|
|
|
|
+ if (this.$checkRes(res)) this.$set(this, 'tfList', res.data);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
metaInfo() {
|
|
metaInfo() {
|