Commit 69434d51 by 吕明尚

时长券增加适用门店,售卖金额,原始金额

parent 13675afd
...@@ -290,6 +290,14 @@ ...@@ -290,6 +290,14 @@
<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 align="center" label="适用门店" prop="storeIds" width="350px">
<template slot-scope="scope">
<div v-if="scope.row.storeIds" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag v-for="(item ,k) in scope.row.storeIds" :key="k" :options="storeList" :value="item"
style="margin: 0 3px;"/>
</div>
</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>
...@@ -304,7 +312,7 @@ ...@@ -304,7 +312,7 @@
<el-table-column label="有效结束时段" align="center" prop="validEndTime" width="180"/> <el-table-column label="有效结束时段" align="center" prop="validEndTime" width="180"/>
<el-table-column label="数量" align="center" prop="number"/> <el-table-column label="数量" align="center" prop="number"/>
<el-table-column label="备注" align="center" prop="remark"/> <el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->
<!-- size="mini"--> <!-- size="mini"-->
...@@ -343,6 +351,7 @@ import {listDuration} from "../../../api/system/coupon"; ...@@ -343,6 +351,7 @@ 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'; import {query} from '@/api/system/pack';
import {storeList} from "../../../api/system/store";
export default { export default {
name: "Consumer", name: "Consumer",
...@@ -366,6 +375,7 @@ export default { ...@@ -366,6 +375,7 @@ export default {
// 会员用户表格数据 // 会员用户表格数据
consumerList: [], consumerList: [],
couponList: [], couponList: [],
storeList: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
couponTitle: "", couponTitle: "",
...@@ -412,6 +422,7 @@ export default { ...@@ -412,6 +422,7 @@ export default {
created() { created() {
this.getList(); this.getList();
this.onPackList(); this.onPackList();
this.onStoreList();
}, },
methods: { methods: {
onPackList() { onPackList() {
...@@ -433,6 +444,24 @@ export default { ...@@ -433,6 +444,24 @@ export default {
this.getList(); this.getList();
}) })
}, },
onStoreList() {
storeList().then(res => {
this.storeList = res.data.map(obj => {
return {
...obj,
raw: {
dictSort: 1,
dictValue: "1",
listClass: "primary",
cssClass: ''
},
value: obj.id.toString(),
label: obj.name,
}
})
this.$forceUpdate();
})
},
/** 查询会员用户列表 */ /** 查询会员用户列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -448,7 +477,9 @@ export default { ...@@ -448,7 +477,9 @@ export default {
this.couponList = response.rows.map(item => { this.couponList = response.rows.map(item => {
return { return {
...item, ...item,
storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : [],
weeks: item.weeks ? item.weeks.split(",") : [] weeks: item.weeks ? item.weeks.split(",") : []
} }
}); });
this.couponTotal = response.total; this.couponTotal = response.total;
......
...@@ -229,6 +229,14 @@ ...@@ -229,6 +229,14 @@
<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 align="center" label="适用门店" prop="storeIds" width="350px">
<template slot-scope="scope">
<div v-if="scope.row.storeIds" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag v-for="(item ,k) in scope.row.storeIds" :key="k" :options="storeList" :value="item"
style="margin: 0 3px;"/>
</div>
</template>
</el-table-column>
<el-table-column label="有效开始时段" align="center" prop="couponTimeStart"/> <el-table-column label="有效开始时段" align="center" prop="couponTimeStart"/>
<el-table-column label="有效结束时段" align="center" prop="couponTimeEnd"/> <el-table-column label="有效结束时段" align="center" prop="couponTimeEnd"/>
<el-table-column label="有效期开始" align="center" prop="startDate" width="180"> <el-table-column label="有效期开始" align="center" prop="startDate" width="180">
...@@ -264,7 +272,7 @@ ...@@ -264,7 +272,7 @@
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="说明" align="center" prop="remark"/> <el-table-column label="说明" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button--> <!-- <el-button-->
<!-- size="mini"--> <!-- size="mini"-->
...@@ -510,6 +518,7 @@ export default { ...@@ -510,6 +518,7 @@ export default {
this.consumerCouponList = response.rows.map(item => { this.consumerCouponList = response.rows.map(item => {
return { return {
...item, ...item,
storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : [],
weeks: item.weeks ? item.weeks.split(",") : [] weeks: item.weeks ? item.weeks.split(",") : []
} }
}); });
...@@ -561,8 +570,21 @@ export default { ...@@ -561,8 +570,21 @@ export default {
this.getList() this.getList()
}, },
onStoreList() { onStoreList() {
storeList().then(response => { storeList().then(res => {
this.storeList = response.data; this.storeList = res.data.map(obj => {
return {
...obj,
raw: {
dictSort: 1,
dictValue: "1",
listClass: "primary",
cssClass: ''
},
value: obj.id.toString(),
label: obj.name,
}
})
this.$forceUpdate();
}) })
}, },
onPackList() { onPackList() {
......
...@@ -116,6 +116,8 @@ ...@@ -116,6 +116,8 @@
<dict-tag :options="dict.type.store_coupon_type" :value="scope.row.couponType"/> <dict-tag :options="dict.type.store_coupon_type" :value="scope.row.couponType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="优惠券原始金额" prop="subPrice"/>
<el-table-column align="center" label="优惠券售卖金额" prop="couponPayPrice"/>
<el-table-column label="时长" align="center" prop="duration"/> <el-table-column label="时长" align="center" prop="duration"/>
<el-table-column label="门槛时长" align="center" prop="minDuration"/> <el-table-column label="门槛时长" align="center" prop="minDuration"/>
<el-table-column label="平台类型" align="center" prop="platformType"> <el-table-column label="平台类型" align="center" prop="platformType">
...@@ -128,16 +130,23 @@ ...@@ -128,16 +130,23 @@
<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="weeks" width="250px"> <el-table-column label="适用套餐" align="center" prop="packIds" width="250px">
<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 align="center" label="适用星期" 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"/>
</template> </template>
---------------
</el-table-column> </el-table-column>
<el-table-column label="适用套餐" align="center" prop="packIds" width="250px"> <el-table-column align="center" label="适用门店" prop="storeIds" width="350">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.packIds"> <div v-if="scope.row.storeIds" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag :options="packList" :value="scope.row.packIds.split(',')"/> <dict-tag v-for="(item ,k) in scope.row.storeIds" :key="k" :options="storeList" :value="item"
style="margin: 0 3px;"/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -163,7 +172,7 @@ ...@@ -163,7 +172,7 @@
</el-table-column> </el-table-column>
<el-table-column label="说明" align="center" prop="remark"/> <el-table-column label="说明" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
...@@ -209,6 +218,12 @@ ...@@ -209,6 +218,12 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="优惠券原始金额" prop="subPrice">
<el-input v-model="form.subPrice" placeholder="请输入优惠券原始金额"/>
</el-form-item>
<el-form-item label="优惠券售卖金额" prop="couponPayPrice">
<el-input v-model="form.couponPayPrice" placeholder="请输入优惠券售卖金额"/>
</el-form-item>
<el-form-item label="时长" prop="duration"> <el-form-item label="时长" prop="duration">
<el-input-number v-model="form.duration" :max="24" :min="0.5" :step="0.5" placeholder="请输入时长"/> <el-input-number v-model="form.duration" :max="24" :min="0.5" :step="0.5" placeholder="请输入时长"/>
</el-form-item> </el-form-item>
...@@ -261,6 +276,16 @@ ...@@ -261,6 +276,16 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="适用门店" prop="storeIds">
<el-select v-model="form.storeIds" clearable multiple placeholder="请选择适用门店">
<el-option
v-for="dict in storeList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="有效期开始" prop="startDate"> <el-form-item label="有效期开始" prop="startDate">
<el-date-picker clearable <el-date-picker clearable
v-model="form.startDate" v-model="form.startDate"
...@@ -317,6 +342,7 @@ ...@@ -317,6 +342,7 @@
</template> </template>
<script> <script>
import {storeList} from '@/api/system/store'
import {listDuration, getCoupon, delCoupon, addCoupon, updateCoupon} from "@/api/system/coupon"; import {listDuration, getCoupon, delCoupon, addCoupon, updateCoupon} from "@/api/system/coupon";
import {query} from '@/api/system/pack' import {query} from '@/api/system/pack'
...@@ -341,6 +367,7 @@ export default { ...@@ -341,6 +367,7 @@ export default {
roomType: [], roomType: [],
// 优惠券表格数据 // 优惠券表格数据
couponList: [], couponList: [],
storeList: [],
packList: [], packList: [],
weeks: [], weeks: [],
// 弹出层标题 // 弹出层标题
...@@ -391,6 +418,7 @@ export default { ...@@ -391,6 +418,7 @@ export default {
created() { created() {
this.getList(); this.getList();
this.onPackList(); this.onPackList();
this.onStoreList();
}, },
methods: { methods: {
onNavToCouponRecord(row){ onNavToCouponRecord(row){
...@@ -424,7 +452,8 @@ export default { ...@@ -424,7 +452,8 @@ export default {
this.couponList = response.rows.map(item => { this.couponList = response.rows.map(item => {
return { return {
...item, ...item,
weeks: item.weeks ? item.weeks.split(",") : [] weeks: item.weeks ? item.weeks.split(",") : [],
storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : []
} }
}); });
this.total = response.total; this.total = response.total;
...@@ -450,6 +479,24 @@ export default { ...@@ -450,6 +479,24 @@ export default {
this.getList(); this.getList();
}) })
}, },
onStoreList() {
storeList().then(res => {
this.storeList = res.data.map(obj => {
return {
...obj,
raw: {
dictSort: 1,
dictValue: "1",
listClass: "primary",
cssClass: ''
},
value: obj.id.toString(),
label: obj.name,
}
})
this.$forceUpdate();
})
},
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
...@@ -520,6 +567,9 @@ export default { ...@@ -520,6 +567,9 @@ 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.storeIds) {
this.form.storeIds = this.form.storeIds.split(",")
}
if (this.form.weeks) { if (this.form.weeks) {
this.weeks = this.form.weeks.split(",") this.weeks = this.form.weeks.split(",")
} }
...@@ -535,6 +585,7 @@ export default { ...@@ -535,6 +585,7 @@ export default {
if (this.weeks.length) { if (this.weeks.length) {
this.form.weeks = this.weeks.join(); this.form.weeks = this.weeks.join();
} }
this.form.storeIds = this.form.storeIds && this.form.storeIds.length ? this.form.storeIds.join() : ''
this.form.packIds = this.form.packIds && this.form.packIds.length ? this.form.packIds.join() : '' this.form.packIds = this.form.packIds && this.form.packIds.length ? this.form.packIds.join() : ''
if (this.form.id != null) { if (this.form.id != null) {
updateCoupon(this.form).then(response => { updateCoupon(this.form).then(response => {
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
<!-- <el-table-column label="数量" align="center" prop="number"/>--> <!-- <el-table-column label="数量" align="center" prop="number"/>-->
<el-table-column label="说明" align="center" prop="remark"/> <el-table-column label="说明" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
<!-- <el-table-column label="数量" align="center" prop="number"/>--> <!-- <el-table-column label="数量" align="center" prop="number"/>-->
<el-table-column label="说明" align="center" prop="remark"/> <el-table-column label="说明" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
......
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
<!-- <dict-tag :options="dict.type.order_pay_status" :value="scope.row.payStatus"/>--> <!-- <dict-tag :options="dict.type.order_pay_status" :value="scope.row.payStatus"/>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="100"> <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="scope.row.payStatus == 1 && scope.row.status != 3" <el-button v-if="scope.row.payStatus == 1 && scope.row.status != 3"
size="mini" size="mini"
......
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