Commit ddf97a9f by 吕明尚

优惠卷字段修改

parent 0f504466
...@@ -274,6 +274,15 @@ ...@@ -274,6 +274,15 @@
<dict-tag :options="dict.type.store_platform_type" :value="scope.row.platformType"/> <dict-tag :options="dict.type.store_platform_type" :value="scope.row.platformType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="适用套餐" align="center" prop="packIds">
<template slot-scope="scope">
<div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div>
</template>
</el-table-column>
<el-table-column label="适用星期" align="center" prop="weeks" width="250px"> <el-table-column label="适用星期" align="center" prop="weeks" width="250px">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sunday_type" :value="scope.row.weeks"/> <dict-tag :options="dict.type.sunday_type" :value="scope.row.weeks"/>
...@@ -329,6 +338,7 @@ import { listConsumer, getConsumer, delConsumer, addConsumer, updateConsumer } f ...@@ -329,6 +338,7 @@ import { listConsumer, getConsumer, delConsumer, addConsumer, updateConsumer } f
import {listDuration} from "../../../api/system/coupon"; import {listDuration} from "../../../api/system/coupon";
import {give} from "../../../api/system/consumerCoupon"; import {give} from "../../../api/system/consumerCoupon";
import moment from "moment"; import moment from "moment";
import {query} from '@/api/system/pack';
export default { export default {
name: "Consumer", name: "Consumer",
...@@ -397,8 +407,28 @@ export default { ...@@ -397,8 +407,28 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.onPackList();
}, },
methods: { methods: {
onPackList() {
query().then(res => {
this.packList = res.data.map(obj => {
return {
...obj,
raw: {
dictSort: 1,
dictValue: "1",
listClass: "primary",
cssClass: ''
},
value: obj.id.toString(),
label: obj.name,
}
})
this.$forceUpdate();
this.getList();
})
},
/** 查询会员用户列表 */ /** 查询会员用户列表 */
getList() { getList() {
this.loading = true; this.loading = true;
......
...@@ -57,16 +57,16 @@ ...@@ -57,16 +57,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="适用套餐" prop="packageId"> <!-- <el-form-item label="适用套餐" prop="packageId">-->
<el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable> <!-- <el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>-->
<el-option <!-- <el-option-->
v-for="dict in packList" <!-- v-for="dict in packList"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="dict.value" <!-- :value="dict.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="使用状态" prop="useStatus"> <el-form-item label="使用状态" prop="useStatus">
<el-select v-model="queryParams.useStatus" placeholder="请选择使用状态" clearable> <el-select v-model="queryParams.useStatus" placeholder="请选择使用状态" clearable>
<el-option <el-option
...@@ -198,10 +198,10 @@ ...@@ -198,10 +198,10 @@
<dict-tag :options="dict.type.store_order_type" :value="scope.row.orderType"/> <dict-tag :options="dict.type.store_order_type" :value="scope.row.orderType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="套餐" align="center" prop="packageId"> <el-table-column label="适用套餐" align="center" prop="packageId">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.packageId"> <div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packageId"/> <dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -24,16 +24,16 @@ ...@@ -24,16 +24,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="适用套餐" prop="packageId"> <!-- <el-form-item label="适用套餐" prop="packageId">-->
<el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable> <!-- <el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>-->
<el-option <!-- <el-option-->
v-for="dict in packList" <!-- v-for="dict in packList"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="dict.value" <!-- :value="dict.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="有效期开始" prop="startDate"> <el-form-item label="有效期开始" prop="startDate">
<el-date-picker clearable <el-date-picker clearable
...@@ -132,11 +132,12 @@ ...@@ -132,11 +132,12 @@
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.sunday_type" :value="scope.row.weeks"/> <dict-tag :options="dict.type.sunday_type" :value="scope.row.weeks"/>
</template> </template>
---------------
</el-table-column> </el-table-column>
<el-table-column label="套餐" align="center" prop="packageId"> <el-table-column label="适用套餐" align="center" prop="packIds">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.packageId"> <div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packageId"/> <dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -242,7 +243,7 @@ ...@@ -242,7 +243,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="套餐" prop="packageId"> <el-form-item label="套餐" prop="packageId">
<el-select v-model="form.packageId" placeholder="请选择套餐" clearable> <el-select v-model="form.packIds" placeholder="请选择套餐" multiple clearable>
<el-option <el-option
v-for="dict in packList" v-for="dict in packList"
:key="dict.value" :key="dict.value"
...@@ -431,7 +432,8 @@ export default { ...@@ -431,7 +432,8 @@ export default {
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
remark: null remark: null,
packIds: []
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -480,6 +482,7 @@ export default { ...@@ -480,6 +482,7 @@ export default {
if (this.form.weeks) { if (this.form.weeks) {
this.weeks = this.form.weeks.split(",") this.weeks = this.form.weeks.split(",")
} }
this.form.packIds = this.form.packIds ? this.form.packIds.split(",") : []
this.open = true; this.open = true;
this.title = "修改优惠券"; this.title = "修改优惠券";
}); });
...@@ -491,6 +494,9 @@ export default { ...@@ -491,6 +494,9 @@ export default {
if (this.weeks.length) { if (this.weeks.length) {
this.form.weeks = this.weeks.join(); this.form.weeks = this.weeks.join();
} }
if (this.form.packIds.length) {
this.form.packIds = this.form.packIds.join();
}
if (this.form.id != null) { if (this.form.id != null) {
updateCoupon(this.form).then(response => { updateCoupon(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
......
...@@ -23,16 +23,16 @@ ...@@ -23,16 +23,16 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="适用套餐" prop="packageId"> <!-- <el-form-item label="适用套餐" prop="packageId">-->
<el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable> <!-- <el-select v-model="queryParams.packageId" placeholder="请选择适用套餐" clearable>-->
<el-option <!-- <el-option-->
v-for="dict in packList" <!-- v-for="dict in packList"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.label" <!-- :label="dict.label"-->
:value="dict.value" <!-- :value="dict.value"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="有效期开始" prop="startDate"> <el-form-item label="有效期开始" prop="startDate">
...@@ -127,10 +127,10 @@ ...@@ -127,10 +127,10 @@
<dict-tag :options="dict.type.store_order_type" :value="scope.row.orderType"/> <dict-tag :options="dict.type.store_order_type" :value="scope.row.orderType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="套餐" align="center" prop="packageId"> <el-table-column label="适用套餐" align="center" prop="packIds">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.packageId"> <div v-if="scope.row.packIds">
<dict-tag :options="packList" :value="scope.row.packageId"/> <dict-tag :options="packList" :value="scope.row.packIds.split(',')"/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -251,7 +251,7 @@ ...@@ -251,7 +251,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="套餐" prop="packageId"> <el-form-item label="套餐" prop="packageId">
<el-select v-model="form.packageId" placeholder="请选择套餐" clearable> <el-select v-model="form.packIds" placeholder="请选择套餐" multiple clearable>
<el-option <el-option
v-for="dict in packList" v-for="dict in packList"
:key="dict.value" :key="dict.value"
...@@ -484,7 +484,8 @@ export default { ...@@ -484,7 +484,8 @@ export default {
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
remark: null remark: null,
packIds: []
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -540,7 +541,7 @@ export default { ...@@ -540,7 +541,7 @@ export default {
if (this.form.weeks) { if (this.form.weeks) {
this.weeks = this.form.weeks.split(",") this.weeks = this.form.weeks.split(",")
} }
this.form.packIds = this.form.packIds ? this.form.packIds.split(",") : []
this.open = true; this.open = true;
this.title = "修改优惠券"; this.title = "修改优惠券";
}); });
...@@ -552,6 +553,9 @@ export default { ...@@ -552,6 +553,9 @@ export default {
if (this.weeks.length) { if (this.weeks.length) {
this.form.weeks = this.weeks.join(); this.form.weeks = this.weeks.join();
} }
if (this.form.packIds.length) {
this.form.packIds = this.form.packIds.join();
}
this.form.storeIds = this.form.storeIds && this.form.storeIds.length ? this.form.storeIds.join() : '' this.form.storeIds = this.form.storeIds && this.form.storeIds.length ? this.form.storeIds.join() : ''
if (this.form.id != null) { if (this.form.id != null) {
if (this.form.platformType === "美团") { if (this.form.platformType === "美团") {
...@@ -565,10 +569,13 @@ export default { ...@@ -565,10 +569,13 @@ export default {
}); });
} else { } else {
addCoupon(this.form).then(response => { addCoupon(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); if (response.data.code) {
this.open = false; this.$modal.msgSuccess("新增成功");
this.getList(); this.open = false;
this.reset(); this.getList();
this.reset();
}
}); });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment