|
@@ -21,7 +21,7 @@
|
|
<template v-else>
|
|
<template v-else>
|
|
<el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-button icon="el-icon-back" size="mini" @click="toBack()">返回</el-button>
|
|
|
|
|
|
+ <el-button icon="el-icon-back" size="mini" @click="toBackList()">返回</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<data-form :span="12" :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
|
|
<data-form :span="12" :fields="infoFields" :rules="rules" v-model="form" labelWidth="150px" @save="toSave">
|
|
@@ -69,7 +69,7 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{ label: '团购金额', model: 'group_config.money' },
|
|
{ label: '团购金额', model: 'group_config.money' },
|
|
- { label: '团购金额', model: 'group_config.need_person' },
|
|
|
|
|
|
+ { label: '开团人数', model: 'group_config.need_person' },
|
|
],
|
|
],
|
|
opera: [
|
|
opera: [
|
|
{ label: '修改', method: 'edit' },
|
|
{ label: '修改', method: 'edit' },
|
|
@@ -94,7 +94,7 @@ export default {
|
|
{ label: '状态', model: 'status', type: 'select' },
|
|
{ label: '状态', model: 'status', type: 'select' },
|
|
{ label: '是否可以团购', model: 'can_group', type: 'select' },
|
|
{ label: '是否可以团购', model: 'can_group', type: 'select' },
|
|
{ label: '团购金额', model: 'money', type: 'number' },
|
|
{ label: '团购金额', model: 'money', type: 'number' },
|
|
- { label: '团购金额', model: 'need_person', type: 'number' },
|
|
|
|
|
|
+ { label: '开团人数', model: 'need_person', type: 'number' },
|
|
],
|
|
],
|
|
rules: {},
|
|
rules: {},
|
|
form: {},
|
|
form: {},
|
|
@@ -133,12 +133,30 @@ export default {
|
|
else res = await this.create(data);
|
|
else res = await this.create(data);
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
this.$message({ type: `success`, message: `维护信息成功` });
|
|
this.$message({ type: `success`, message: `维护信息成功` });
|
|
- this.toBack();
|
|
|
|
|
|
+ this.search();
|
|
|
|
+ this.toBackList();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async toEdit({ data }) {
|
|
|
|
+ const res = await this.fetch(data._id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ let data = res.data;
|
|
|
|
+ const group_config = _.get(data, 'group_config', {});
|
|
|
|
+ data = { ...data, ...group_config };
|
|
|
|
+ delete data.group_config;
|
|
|
|
+ this.$set(this, `form`, data);
|
|
|
|
+ this.view = 'info';
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('未找到指定数据');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
toBack() {
|
|
toBack() {
|
|
window.history.go('-1');
|
|
window.history.go('-1');
|
|
},
|
|
},
|
|
|
|
+ toBackList() {
|
|
|
|
+ this.view = 'list';
|
|
|
|
+ this.form = {};
|
|
|
|
+ },
|
|
async searchOthers() {
|
|
async searchOthers() {
|
|
// 状态
|
|
// 状态
|
|
let res = await this.getDict({ code: 'status' });
|
|
let res = await this.getDict({ code: 'status' });
|