Commit 0a36f3a7 by 吕明尚

更改优惠卷管理页面

parent e15bbb2c
...@@ -136,27 +136,27 @@ ...@@ -136,27 +136,27 @@
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="primary" <!-- type="primary"-->
plain <!-- plain-->
icon="el-icon-plus" <!-- icon="el-icon-plus"-->
size="mini" <!-- size="mini"-->
@click="handleAdd" <!-- @click="handleAdd"-->
v-hasPermi="['system:consumerCoupon:add']" <!-- v-hasPermi="['system:consumerCoupon:add']"-->
>新增</el-button> <!-- >新增</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="success" <!-- type="success"-->
plain <!-- plain-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
size="mini" <!-- size="mini"-->
:disabled="single" <!-- :disabled="single"-->
@click="handleUpdate" <!-- @click="handleUpdate"-->
v-hasPermi="['system:consumerCoupon:edit']" <!-- v-hasPermi="['system:consumerCoupon:edit']"-->
>修改</el-button> <!-- >修改</el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
...@@ -187,17 +187,39 @@ ...@@ -187,17 +187,39 @@
<el-table-column label="用户ID" align="center" prop="consumerId" /> <el-table-column label="用户ID" align="center" prop="consumerId" />
<el-table-column label="优惠券ID" align="center" prop="couponId" /> <el-table-column label="优惠券ID" align="center" prop="couponId" />
<el-table-column label="优惠券编码" align="center" prop="couponCode" /> <el-table-column label="优惠券编码" align="center" prop="couponCode" />
<el-table-column label="优惠券名称" align="center" prop="name" /> <el-table-column label="优惠券名称" align="center" prop="name" width="240px" />
<el-table-column label="优惠房型" align="center" prop="roomType" /> <!-- <el-table-column label="优惠房型" align="center" prop="roomType" />-->
<el-table-column label="优惠房型" align="center" prop="roomType" width="240px" >
<template slot-scope="scope">
<div v-if="scope.row.roomType.length" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.roomType" :key="k" :options="dict.type.store_room_type" :value="item"/>
</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="couponType" /> <!-- <el-table-column label="优惠券类型" align="center" prop="couponType" />-->
<el-table-column label="优惠券类型" align="center" prop="couponType">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_coupon_type" :value="scope.row.couponType"/>
</template>
</el-table-column>
<el-table-column label="折扣最大时长" align="center" prop="maxDuration" /> <el-table-column label="折扣最大时长" align="center" prop="maxDuration" />
<el-table-column label="时长" align="center" prop="duration" /> <el-table-column label="时长" align="center" prop="duration" />
<el-table-column label="门槛金额" align="center" prop="minPrice" /> <el-table-column label="门槛金额" align="center" prop="minPrice" />
<el-table-column label="减去金额" align="center" prop="subPrice" /> <el-table-column label="减去金额" align="center" prop="subPrice" />
<el-table-column label="优惠券来源" align="center" prop="sourceType" /> <!-- <el-table-column label="优惠券来源" align="center" prop="sourceType" />-->
<el-table-column label="平台类型" align="center" prop="platformType" /> <el-table-column label="优惠券来源" align="center" prop="sourceType">
<template slot-scope="scope">
<dict-tag :options="dict.type.consumer_coupon_source_type" :value="scope.row.sourceType"/>
</template>
</el-table-column>
<!-- <el-table-column label="平台类型" align="center" prop="platformType" />-->
<el-table-column label="平台类型" align="center" prop="platformType">
<template slot-scope="scope">
<dict-tag :options="dict.type.consumer_coupon_platform_type" :value="scope.row.platformType"/>
</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>
...@@ -213,8 +235,12 @@ ...@@ -213,8 +235,12 @@
<span>{{ parseTime(scope.row.useDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.useDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="使用状态" align="center" prop="useStatus" /> <!-- <el-table-column label="使用状态" align="center" prop="useStatus" />-->
<el-table-column label="删除状态" align="center" prop="isDelete" /> <el-table-column label="使用状态" align="center" prop="useStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.coupon_use_status" :value="scope.row.useStatus"/>
</template>
</el-table-column>
<el-table-column label="更新者" align="center" prop="deleteBy" /> <el-table-column label="更新者" align="center" prop="deleteBy" />
<el-table-column label="更新时间" align="center" prop="deleteTime" width="180"> <el-table-column label="更新时间" align="center" prop="deleteTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -224,13 +250,13 @@ ...@@ -224,13 +250,13 @@
<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 label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button-->
size="mini" <!-- size="mini"-->
type="text" <!-- type="text"-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
@click="handleUpdate(scope.row)" <!-- @click="handleUpdate(scope.row)"-->
v-hasPermi="['system:consumerCoupon:edit']" <!-- v-hasPermi="['system:consumerCoupon:edit']"-->
>修改</el-button> <!-- >修改</el-button>-->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -338,6 +364,7 @@ import { listConsumerCoupon, getConsumerCoupon, delConsumerCoupon, addConsumerCo ...@@ -338,6 +364,7 @@ import { listConsumerCoupon, getConsumerCoupon, delConsumerCoupon, addConsumerCo
export default { export default {
name: "ConsumerCoupon", name: "ConsumerCoupon",
dicts: ['consumer_coupon_platform_type', 'store_coupon_type','consumer_coupon_source_type','store_room_type','coupon_use_status'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
......
...@@ -116,12 +116,32 @@ ...@@ -116,12 +116,32 @@
<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 label="会员昵称" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="name" /> <el-table-column label="门店类型" align="center" prop="storeType" width="240px">
<template slot-scope="scope">
<div v-if="scope.row.storeType.length" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.storeType" :key="k" :options="dict.type.store_type" :value="item"/>
</div>
</template>
</el-table-column>
<el-table-column label="房间类型" align="center" prop="roomType" width="240px">
<template slot-scope="scope">
<div v-if="scope.row.roomType.length" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag style="margin: 0 3px;" v-for="(item ,k) in scope.row.roomType" :key="k" :options="dict.type.store_room_type" :value="item"/>
</div>
</template>
</el-table-column>
<el-table-column label="门槛时长" align="center" prop="minDuration" />
<el-table-column label="折扣最大时长" align="center" prop="maxDuration" />
<el-table-column label="时长" align="center" prop="duration" /> <el-table-column label="时长" align="center" prop="duration" />
<el-table-column label="满金额" align="center" prop="minPrice" /> <el-table-column label="门槛金额" align="center" prop="minPrice" />
<el-table-column label="金额" align="center" prop="subPrice" /> <el-table-column label="减去金额" align="center" prop="subPrice" />
<el-table-column label="第三方平台名称" align="center" prop="platform" /> <!-- <el-table-column label="第三方平台名称" align="center" prop="platform" />-->
<el-table-column label="第三方平台类型" align="center" prop="platformType">
<template slot-scope="scope">
<dict-tag :options="dict.type.store_platform_type" :value="scope.row.platformType"/>
</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>
...@@ -132,11 +152,6 @@ ...@@ -132,11 +152,6 @@
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="使用状态" align="center" prop="useStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.coupon_use_status" :value="scope.row.useStatus"/>
</template>
</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 label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -168,7 +183,7 @@ ...@@ -168,7 +183,7 @@
<!-- 添加或修改优惠券对话框 --> <!-- 添加或修改优惠券对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="优惠券名称" prop="name"> <el-form-item label="优惠券名称" prop="name">
<el-input v-model="form.name" placeholder="请输入优惠券名称" /> <el-input v-model="form.name" placeholder="请输入优惠券名称" />
</el-form-item> </el-form-item>
...@@ -182,9 +197,36 @@ ...@@ -182,9 +197,36 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="门店类型" prop="storeType">
<el-select style="width: 100%;" v-model="storeType" multiple placeholder="请选择门店类型" @change="onChangeStoreType">
<el-option
v-for="dict in dict.type.store_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="房间类型" prop="roomType">
<el-select style="width: 100%;" v-model="roomType" multiple placeholder="请选择门店类型" @change="onChangeRoomType">
<el-option
v-for="dict in dict.type.store_room_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="时长" prop="duration"> <el-form-item label="时长" prop="duration">
<el-input-number v-model="form.duration" placeholder="请输入时长" /> <el-input-number v-model="form.duration" placeholder="请输入时长" />
</el-form-item> </el-form-item>
<el-form-item label="门槛时长" prop="minDuration">
<el-input-number v-model="form.minDuration" placeholder="请输入门槛时长" />
</el-form-item>
<el-form-item label="折扣最大时长" prop="maxDuration">
<el-input-number v-model="form.maxDuration" placeholder="请输入时长" />
</el-form-item>
<el-form-item label="满金额" prop="minPrice"> <el-form-item label="满金额" prop="minPrice">
<el-input v-model="form.minPrice" placeholder="请输入满减最小可使用金额" /> <el-input v-model="form.minPrice" placeholder="请输入满减最小可使用金额" />
</el-form-item> </el-form-item>
...@@ -234,7 +276,7 @@ import { listCoupon, getCoupon, delCoupon, addCoupon, updateCoupon } from "@/api ...@@ -234,7 +276,7 @@ import { listCoupon, getCoupon, delCoupon, addCoupon, updateCoupon } from "@/api
export default { export default {
name: "Coupon", name: "Coupon",
dicts: ['store_platform_type', 'store_coupon_type','coupon_use_status'], dicts: ['store_coupon_type', 'store_type','store_room_type','store_platform_type'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -249,6 +291,8 @@ export default { ...@@ -249,6 +291,8 @@ export default {
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
storeType: [],
roomType: [],
// 优惠券表格数据 // 优惠券表格数据
couponList: [], couponList: [],
// 弹出层标题 // 弹出层标题
...@@ -289,6 +333,15 @@ export default { ...@@ -289,6 +333,15 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
onChangeStoreType(e){
console.log(e)
this.form.storeType = e.join()
},
onChangeRoomType(e){
console.log(e)
this.form.roomType = e.join()
},
/** 查询优惠券列表 */ /** 查询优惠券列表 */
getList() { getList() {
this.loading = true; this.loading = true;
...@@ -352,6 +405,12 @@ export default { ...@@ -352,6 +405,12 @@ export default {
const id = row.id || this.ids const id = row.id || this.ids
getCoupon(id).then(response => { getCoupon(id).then(response => {
this.form = response.data; this.form = response.data;
if(this.form.storeType){
this.storeType = this.form.storeType.split(",")
}
if(this.form.roomType){
this.roomType = this.form.roomType.split(",")
}
this.open = true; this.open = true;
this.title = "修改优惠券"; this.title = "修改优惠券";
}); });
......
...@@ -150,12 +150,12 @@ ...@@ -150,12 +150,12 @@
</el-table-column> </el-table-column>
<el-table-column label="支付类型" align="center" prop="payType"> <el-table-column label="支付类型" align="center" prop="payType">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.store_pay_ways" :value="scope.row.payWays"/> <dict-tag :options="dict.type.order_pay_type" :value="scope.row.payType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="支付状态" align="center" prop="payStatus"> <el-table-column label="支付状态" align="center" prop="payStatus">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.store_pay_ways" :value="scope.row.payWays"/> <dict-tag :options="dict.type.order_pay_status" :value="scope.row.payStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="门店ID" align="center" prop="storeId" /> <el-table-column label="门店ID" align="center" prop="storeId" />
...@@ -179,8 +179,12 @@ ...@@ -179,8 +179,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="退款金额" align="center" prop="refundPrice" /> <el-table-column label="退款金额" align="center" prop="refundPrice" />
<el-table-column label="退款状态" align="center" prop="refundStatus" /> <!-- <el-table-column label="退款状态" align="center" prop="refundStatus" />-->
<el-table-column label="退款状态" align="center" prop="refundStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.order_refund_status" :value="scope.row.refundStatus"/>
</template>
</el-table-column>
<!-- <el-table-column label="消费描述" align="center" prop="description" />--> <!-- <el-table-column label="消费描述" align="center" prop="description" />-->
<!-- <el-table-column label="应付金额" align="center" prop="originalPrice" />--> <!-- <el-table-column label="应付金额" align="center" prop="originalPrice" />-->
<!-- <el-table-column label="实付金额" align="center" prop="realPrice" />--> <!-- <el-table-column label="实付金额" align="center" prop="realPrice" />-->
...@@ -356,7 +360,7 @@ ...@@ -356,7 +360,7 @@
width="30%" width="30%"
destroy-on-close destroy-on-close
:before-close="handleClose"> :before-close="handleClose">
<el-form ref="form" :model="audioForm" :rules="rules" label-width="80px"> <el-form ref="form" :model="audioForm" label-width="80px">
<el-form-item label="退款说明" maxlength="40px"> <el-form-item label="退款说明" maxlength="40px">
<el-input v-model="audioForm.refundReason" maxlength="40px"/> <el-input v-model="audioForm.refundReason" maxlength="40px"/>
</el-form-item> </el-form-item>
...@@ -389,7 +393,7 @@ import {allList} from "@/api/system/store"; ...@@ -389,7 +393,7 @@ import {allList} from "@/api/system/store";
export default { export default {
name: "Order", name: "Order",
dicts: ['store_order_type', 'store_coupon_type', 'store_is_use_coupon', 'store_order_status'], dicts: ['store_order_type', 'order_pay_type', 'order_pay_status','order_refund_status'],
data() { data() {
return { return {
audioForm: { audioForm: {
...@@ -438,34 +442,12 @@ export default { ...@@ -438,34 +442,12 @@ export default {
startDate: null, startDate: null,
endDate: null, endDate: null,
preStartDate: null, preStartDate: null,
payType: null,
payStatus: null,
preEndDate: null preEndDate: null
}, },
// 表单参数 // 表单参数
form: {}, form: {}
// 表单校验
rules: {
orderType: [
{ required: true, message: "订单类型(0:订房订单,1:续房订单,2:充值订单)不能为空", trigger: "change" }
],
serialNumber: [
{ required: true, message: "订单流水号不能为空", trigger: "blur" }
],
consumerId: [
{ required: true, message: "用户ID不能为空", trigger: "blur" }
],
originalPrice: [
{ required: true, message: "订单总价不能为空", trigger: "blur" }
],
payWays: [
{ required: true, message: "1.余额支付,2:微信支付不能为空", trigger: "blur" }
],
realPrice: [
{ required: true, message: "订单实付不能为空", trigger: "blur" }
],
isUseCoupon: [
{ required: true, message: "是否使用优惠券(0:否,1:是)不能为空", trigger: "change" }
],
}
}; };
}, },
created() { created() {
......
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