Commit 8c7af64c by 吕明尚

增加赠送抽奖次数

parent e0809f71
...@@ -57,3 +57,12 @@ export function delConsumer(id) { ...@@ -57,3 +57,12 @@ export function delConsumer(id) {
method: 'delete' method: 'delete'
}) })
} }
export function giveNumber(data) {
return request({
url: '/system/consumer/giveNumber',
method: 'post',
data: data
})
}
...@@ -153,12 +153,13 @@ ...@@ -153,12 +153,13 @@
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/> <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="抽奖次数" prop="prizeDrawNumbr"/>
<el-table-column align="center" label="车牌" prop="numberplate" width="100"/> <el-table-column align="center" label="车牌" prop="numberplate" width="100"/>
<el-table-column label="详细地址" align="center" prop="addres" /> <!-- <el-table-column label="详细地址" align="center" prop="addres" />-->
<el-table-column label="充值余额" align="center" prop="amount" /> <!-- <el-table-column label="充值余额" align="center" prop="amount" />-->
<el-table-column label="赠送余额" align="center" prop="freeAmount" /> <!-- <el-table-column label="赠送余额" align="center" prop="freeAmount" />-->
<el-table-column label="消费次数" align="center" prop="totalTimes" /> <!-- <el-table-column label="消费次数" align="center" prop="totalTimes" />-->
<el-table-column align="center" label="总消费时长" prop="duration" width="100"/> <!-- <el-table-column align="center" label="总消费时长" prop="duration" width="100"/>-->
<el-table-column label="账号状态" align="center" prop="status" > <el-table-column label="账号状态" align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status === 1"> <span v-if="scope.row.status === 1">
...@@ -199,14 +200,22 @@ ...@@ -199,14 +200,22 @@
@click="give(scope.row)" @click="give(scope.row)"
>赠送优惠卷 >赠送优惠卷
</el-button> </el-button>
<!-- <el-button--> <el-button
<!-- v-hasPermi="['system:consumer:give']"--> v-hasPermi="['system:consumer:give']"
<!-- icon="el-icon-delete"--> icon="el-icon-s-finance"
<!-- size="mini"--> size="mini"
<!-- type="text"--> type="text"
<!-- @click="giveDuration(scope.row)"--> @click="giveDuration(scope.row)"
<!-- >赠送时长--> >赠送时长
<!-- </el-button>--> </el-button>
<el-button
v-hasPermi="['system:consumer:give']"
icon="el-icon-s-finance"
size="mini"
type="text"
@click="giveNumber(scope.row)"
>赠送抽奖次数
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -270,7 +279,7 @@ ...@@ -270,7 +279,7 @@
</el-dialog> </el-dialog>
<!-- 添加或修改会员用户对话框 --> <!-- 赠送时长 -->
<el-dialog :title="durationTitle" :visible.sync="durationOpen" append-to-body width="500px"> <el-dialog :title="durationTitle" :visible.sync="durationOpen" append-to-body width="500px">
<el-form ref="durationForm" :model="durationForm" :rules="durationRules"> <el-form ref="durationForm" :model="durationForm" :rules="durationRules">
<el-form-item label="时长(单位:小时)" prop="remainingDuration"> <el-form-item label="时长(单位:小时)" prop="remainingDuration">
...@@ -284,6 +293,20 @@ ...@@ -284,6 +293,20 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 赠送抽奖次数 -->
<el-dialog :title="numberTitle" :visible.sync="numberOpen" append-to-body width="500px">
<el-form ref="numberForm" :model="numberForm" :rules="numberRules">
<el-form-item label="抽奖次数" prop="prizeDrawNumbr">
<el-input-number v-model="numberForm.prizeDrawNumbr" :max="100" :min="0" :step="1"
placeholder="请输入抽奖次数"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitNumberForm"> </el-button>
<el-button @click="numberCancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="couponTitle" :visible.sync="couponOpen" width="80%" append-to-bod> <el-dialog :title="couponTitle" :visible.sync="couponOpen" width="80%" append-to-bod>
<el-table v-loading="couponLoading" :data="couponList"> <el-table v-loading="couponLoading" :data="couponList">
...@@ -378,7 +401,7 @@ ...@@ -378,7 +401,7 @@
</template> </template>
<script> <script>
import { listConsumer, getConsumer, delConsumer, addConsumer, updateConsumer } from "@/api/system/consumer"; import {listConsumer, getConsumer, delConsumer, addConsumer, updateConsumer, giveNumber} from "@/api/system/consumer";
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";
...@@ -413,11 +436,13 @@ export default { ...@@ -413,11 +436,13 @@ export default {
// 弹出层标题 // 弹出层标题
title: "", title: "",
durationTitle: "", durationTitle: "",
numberTitle: "",
couponTitle: "", couponTitle: "",
// 是否显示弹出层 // 是否显示弹出层
couponOpen: false, couponOpen: false,
open: false, open: false,
durationOpen: false, durationOpen: false,
numberOpen: false,
consumerId: null, consumerId: null,
giveConsumerId: null, giveConsumerId: null,
// 查询参数 // 查询参数
...@@ -442,6 +467,7 @@ export default { ...@@ -442,6 +467,7 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
durationForm: {}, durationForm: {},
numberForm: {},
couponForm: {}, couponForm: {},
// 表单校验 // 表单校验
rules: { rules: {
...@@ -456,8 +482,8 @@ export default { ...@@ -456,8 +482,8 @@ export default {
], ],
}, },
// 表单校验 // 表单校验
durationRules: { durationRules: {},
} numberRules: {}
}; };
}, },
created() { created() {
...@@ -553,6 +579,10 @@ export default { ...@@ -553,6 +579,10 @@ export default {
this.durationOpen = false; this.durationOpen = false;
this.durationReset(); this.durationReset();
}, },
numberCancel() {
this.numberOpen = false;
this.numberReset();
},
// 表单重置 // 表单重置
durationReset() { durationReset() {
this.durationForm = { this.durationForm = {
...@@ -560,9 +590,12 @@ export default { ...@@ -560,9 +590,12 @@ export default {
}; };
this.resetForm("durationForm"); this.resetForm("durationForm");
}, },
numberReset() {
this.numberForm = {
prizeDrawNumbr: null
};
this.resetForm("numberForm");
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -628,6 +661,18 @@ export default { ...@@ -628,6 +661,18 @@ export default {
} }
}); });
}, },
submitNumberForm() {
this.$refs["numberForm"].validate(valid => {
if (valid) {
this.numberForm.id = this.giveConsumerId;
giveNumber(this.numberForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.numberOpen = false;
this.getList();
});
}
});
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
...@@ -657,6 +702,12 @@ export default { ...@@ -657,6 +702,12 @@ export default {
this.durationOpen = true; this.durationOpen = true;
this.durationTitle = "添加时长"; this.durationTitle = "添加时长";
}, },
giveNumber(row) {
this.giveConsumerId = row.id;
this.numberOpen = true;
this.numberTitle = "添加抽奖次数";
},
submitcouponGive(row) { submitcouponGive(row) {
const consumerId = this.consumerId; const consumerId = this.consumerId;
this.$modal.confirm('是否赠送' + row.name + '优惠卷').then(function () { this.$modal.confirm('是否赠送' + row.name + '优惠卷').then(function () {
......
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