Commit c4f8720e by 吕明尚

更改优惠卷显示

parent fc95c407
...@@ -268,12 +268,17 @@ ...@@ -268,12 +268,17 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="时长" align="center" prop="duration"/> <el-table-column label="时长" align="center" prop="duration"/>
<el-table-column label="优惠金额" align="center" prop="subPrice"/> <el-table-column label="门槛时长" align="center" prop="minDuration"/>
<el-table-column label="平台类型" align="center" prop="platformType"> <el-table-column label="平台类型" align="center" prop="platformType">
<template slot-scope="scope"> <template slot-scope="scope">
<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="weeks" width="250px">
<template slot-scope="scope">
<dict-tag :options="dict.type.sunday_type" :value="scope.row.weeks"/>
</template>
</el-table-column>
<el-table-column label="有效期开始" align="center" prop="startDate" width="180"> <el-table-column label="有效期开始" align="center" prop="startDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
...@@ -327,7 +332,7 @@ import moment from "moment"; ...@@ -327,7 +332,7 @@ import moment from "moment";
export default { export default {
name: "Consumer", name: "Consumer",
dicts: ['sys_user_sex', 'wechat_role_type', 'store_coupon_type', 'store_platform_type', 'store_platform_type'], dicts: ['sys_user_sex', 'wechat_role_type', 'store_coupon_type', 'store_platform_type', 'store_platform_type', 'sunday_type'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -406,7 +411,12 @@ export default { ...@@ -406,7 +411,12 @@ export default {
getCouponList() { getCouponList() {
this.couponQueryParams.endDate = moment().format('YYYY-MM-DD') this.couponQueryParams.endDate = moment().format('YYYY-MM-DD')
listDuration(this.couponQueryParams).then(response => { listDuration(this.couponQueryParams).then(response => {
this.couponList = response.rows; this.couponList = response.rows.map(item => {
return {
...item,
weeks: item.weeks ? item.weeks.split(",") : []
}
});
this.couponTotal = response.total; this.couponTotal = response.total;
}); });
}, },
......
...@@ -205,9 +205,9 @@ ...@@ -205,9 +205,9 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="适用星期" align="center" prop="sundays" 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.sundays"/> <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="couponTimeStart"/> <el-table-column label="有效开始时段" align="center" prop="couponTimeStart"/>
...@@ -465,7 +465,7 @@ export default { ...@@ -465,7 +465,7 @@ export default {
this.consumerCouponList = response.rows.map(item => { this.consumerCouponList = response.rows.map(item => {
return { return {
...item, ...item,
sundays: item.sundays ? item.sundays.split(",") : [] weeks: item.weeks ? item.weeks.split(",") : []
} }
}); });
this.total = response.total this.total = response.total
......
...@@ -128,9 +128,9 @@ ...@@ -128,9 +128,9 @@
<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="sundays" 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.sundays"/> <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="packageId">
...@@ -229,9 +229,9 @@ ...@@ -229,9 +229,9 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="适用星期" prop="sundays"> <el-form-item label="适用星期" prop="weeks">
<div style="display: flex;flex-direction: row;align-items: center;width: 100%;"> <div style="display: flex;flex-direction: row;align-items: center;width: 100%;">
<el-select style="width: 100%;" v-model="sundays" multiple placeholder="选择星期" @change="onChangeSundays"> <el-select style="width: 100%;" v-model="weeks" multiple placeholder="选择星期" @change="onChangeweeks">
<el-option <el-option
v-for="dict in dict.type.sunday_type" v-for="dict in dict.type.sunday_type"
:key="dict.value" :key="dict.value"
...@@ -310,7 +310,7 @@ export default { ...@@ -310,7 +310,7 @@ export default {
// 优惠券表格数据 // 优惠券表格数据
couponList: [], couponList: [],
packList: [], packList: [],
sundays: [], weeks: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -367,19 +367,20 @@ export default { ...@@ -367,19 +367,20 @@ export default {
console.log(e) console.log(e)
this.form.roomType = e.join() this.form.roomType = e.join()
}, },
onChangeSundays(e) { onChangeweeks(e) {
console.log(e) console.log(e)
this.form.sundays = e.join() this.form.weeks = e.join()
}, },
/** 查询优惠券列表 */ /** 查询优惠券列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.weeks = [];
listDuration(this.queryParams).then(response => { listDuration(this.queryParams).then(response => {
this.couponList = response.rows.map(item => { this.couponList = response.rows.map(item => {
return { return {
...item, ...item,
sundays: item.sundays ? item.sundays.split(",") : [] weeks: item.weeks ? item.weeks.split(",") : []
} }
}); });
this.total = response.total; this.total = response.total;
...@@ -412,6 +413,7 @@ export default { ...@@ -412,6 +413,7 @@ export default {
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.weeks = []
this.form = { this.form = {
id: null, id: null,
name: null, name: null,
...@@ -473,8 +475,8 @@ export default { ...@@ -473,8 +475,8 @@ export default {
if (this.form.roomType) { if (this.form.roomType) {
this.roomType = this.form.roomType.split(",") this.roomType = this.form.roomType.split(",")
} }
if (this.form.sundays) { if (this.form.weeks) {
this.sundays = this.form.sundays.split(",") this.weeks = this.form.weeks.split(",")
} }
this.open = true; this.open = true;
this.title = "修改优惠券"; this.title = "修改优惠券";
...@@ -484,8 +486,8 @@ export default { ...@@ -484,8 +486,8 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.sundays.length) { if (this.weeks.length) {
this.form.sundays = this.sundays.join(); this.form.weeks = this.weeks.join();
} }
if (this.form.id != null) { if (this.form.id != null) {
updateCoupon(this.form).then(response => { updateCoupon(this.form).then(response => {
......
...@@ -134,9 +134,9 @@ ...@@ -134,9 +134,9 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="适用星期" align="center" prop="sundays" 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.sundays"/> <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="storeIds" width="350"> <el-table-column label="适用门店" align="center" prop="storeIds" width="350">
...@@ -238,9 +238,9 @@ ...@@ -238,9 +238,9 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="适用星期" prop="sundays"> <el-form-item label="适用星期" prop="weeks">
<div style="display: flex;flex-direction: row;align-items: center;width: 100%;"> <div style="display: flex;flex-direction: row;align-items: center;width: 100%;">
<el-select style="width: 100%;" v-model="sundays" multiple placeholder="选择星期" @change="onChangeSundays"> <el-select style="width: 100%;" v-model="weeks" multiple placeholder="选择星期" @change="onChangeweeks">
<el-option <el-option
v-for="dict in dict.type.sunday_type" v-for="dict in dict.type.sunday_type"
:key="dict.value" :key="dict.value"
...@@ -346,7 +346,7 @@ export default { ...@@ -346,7 +346,7 @@ export default {
couponList: [], couponList: [],
packList: [], packList: [],
storeList: [], storeList: [],
sundays: [], weeks: [],
storeIds: [], storeIds: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
...@@ -402,9 +402,9 @@ export default { ...@@ -402,9 +402,9 @@ export default {
console.log(e) console.log(e)
this.form.roomType = e.join() this.form.roomType = e.join()
}, },
onChangeSundays(e) { onChangeweeks(e) {
console.log(e) console.log(e)
this.form.sundays = e.join() this.form.weeks = e.join()
}, },
/** 查询优惠券列表 */ /** 查询优惠券列表 */
...@@ -415,7 +415,7 @@ export default { ...@@ -415,7 +415,7 @@ export default {
return { return {
...item, ...item,
storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : [], storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : [],
sundays: item.sundays ? item.sundays.split(",") : [] weeks: item.weeks ? item.weeks.split(",") : []
} }
}); });
this.total = response.total; this.total = response.total;
...@@ -466,6 +466,7 @@ export default { ...@@ -466,6 +466,7 @@ export default {
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.weeks = []
this.form = { this.form = {
id: null, id: null,
name: null, name: null,
...@@ -534,8 +535,8 @@ export default { ...@@ -534,8 +535,8 @@ export default {
if (this.form.storeIds) { if (this.form.storeIds) {
this.form.storeIds = this.form.storeIds.split(",") this.form.storeIds = this.form.storeIds.split(",")
} }
if (this.form.sundays) { if (this.form.weeks) {
this.sundays = this.form.sundays.split(",") this.weeks = this.form.weeks.split(",")
} }
this.open = true; this.open = true;
...@@ -546,8 +547,8 @@ export default { ...@@ -546,8 +547,8 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.sundays.length) { if (this.weeks.length) {
this.form.sundays = this.sundays.join(); this.form.weeks = this.weeks.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) {
......
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