Commit 8c7af64c by 吕明尚

增加赠送抽奖次数

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