Compare commits

..

No commits in common. "5505656d59aeb136711f748e032144b45b862c6f" and "684b950c33cd882ab530d64d75250b1bb01f63e4" have entirely different histories.

6 changed files with 32 additions and 136 deletions

View File

@ -1,53 +0,0 @@
import request from '@/utils/request'
// 卡券核销
export function couponVerification(data) {
return request({
url: '/base/customer-coupon/couponVerification',
method: 'post',
data: data
})
}
// 更新用户卡券
export function updateCustomerCoupon(data) {
return request({
url: '/base/customer-coupon/update',
method: 'put',
data: data
})
}
// 删除用户卡券
export function deleteCustomerCoupon(id) {
return request({
url: '/base/customer-coupon/delete?id=' + id,
method: 'delete'
})
}
// 获得用户卡券
export function getCustomerCoupon(id) {
return request({
url: '/base/customer-coupon/get?id=' + id,
method: 'get'
})
}
// 获得用户卡券分页
export function getCustomerCouponPage(params) {
return request({
url: '/base/customer-coupon/page',
method: 'get',
params
})
}
// 导出用户卡券 Excel
export function exportCustomerCouponExcel(params) {
return request({
url: '/base/customer-coupon/export-excel',
method: 'get',
params,
responseType: 'blob'
})
}

View File

@ -5,6 +5,7 @@
:options="options" :options="options"
v-model="selectedValues" v-model="selectedValues"
filterable filterable
:props="{checkStrictly:true}"
/> />
</div> </div>

View File

@ -105,19 +105,14 @@
size="mini" size="mini"
height="200" height="200"
style="width: 100%"> style="width: 100%">
<el-table-column prop="couponName" label="卡券名称" > <el-table-column show-overflow-tooltip prop="couponName" label="卡券名称" >
</el-table-column> </el-table-column>
<el-table-column label="卡券类型" width="80" align="center" prop="couponType"> <el-table-column label="卡券类型" width="80" align="left" prop="couponType">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag :type="DICT_TYPE.MEMBER_COUPON_TYPE" :value="scope.row.couponType"/> <dict-tag :type="DICT_TYPE.MEMBER_COUPON_TYPE" :value="scope.row.couponType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="剩余金额/次数" width="120" align="right" prop="balance"> <el-table-column label="适用车型" width="130" align="center" prop="carModel">
<template v-slot="scope">
{{scope.row.balance}}{{scope.row.outRule == 'mehx'?'元':'次'}}
</template>
</el-table-column>
<el-table-column label="适用车型" width="80" align="center" prop="carModel">
<template v-slot="scope"> <template v-slot="scope">
<span v-if="scope.row.carModel == null">不限</span> <span v-if="scope.row.carModel == null">不限</span>
<dict-tag :type="DICT_TYPE.MEMBER_CAR" :value="scope.row.carModel"/> <dict-tag :type="DICT_TYPE.MEMBER_CAR" :value="scope.row.carModel"/>
@ -138,11 +133,14 @@
<span>{{ parseTime(scope.row.endTime) }}</span> <span>{{ parseTime(scope.row.endTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="领取时间" align="center" prop="createTime" width="150">
<el-table-column fixed="right" label="操作" width="130" align="center" class-name="small-padding fixed-width">
<template v-slot="scope"> <template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-goods" @click="couponVerification(scope.row)">核销</el-button> <span>{{ parseTime(scope.row.createTime) }}</span>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button> </template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="110" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-goods" @click="openChildForm(scope.row.id)">核销</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -201,8 +199,8 @@
</el-table> </el-table>
</el-card> </el-card>
<ReceiveCouponForm @success="successCallback()" ref="receiveCouponForm"/> <ReceiveCouponForm @success="getById(param.id)" ref="receiveCouponForm"/>
<RuchForm @success="successCallback()" ref="RuchFormRef"/> <RuchForm @success="getById(param.id)" ref="RuchFormRef"/>
</div> </div>
</template> </template>
@ -210,7 +208,6 @@
<script> <script>
import * as CustomerMainApi from '@/api/base/customer'; import * as CustomerMainApi from '@/api/base/customer';
import * as ActiveMainApi from '@/api/member/active'; import * as ActiveMainApi from '@/api/member/active';
import * as CustomerCouponApi from '@/api/base/coupon';
import ReceiveCouponForm from '@/views/base/customer/ReceiveCouponForm.vue' import ReceiveCouponForm from '@/views/base/customer/ReceiveCouponForm.vue'
import RuchForm from '@/views/base/customer/RuchForm.vue' import RuchForm from '@/views/base/customer/RuchForm.vue'
export default { export default {
@ -259,11 +256,6 @@ export default {
this.loading = false; this.loading = false;
} }
}, },
successCallback(){
this.getById(this.param.id)
this.getActiveList()
},
/**参与活动*/ /**参与活动*/
async openActive(row){ async openActive(row){
if (row.isCoupon == '1' && row.isRechRule == '0'){ if (row.isCoupon == '1' && row.isRechRule == '0'){
@ -272,38 +264,7 @@ export default {
if (row.isRechRule == '1'){ if (row.isRechRule == '1'){
this.$refs["RuchFormRef"].open(row.id,this.param); this.$refs["RuchFormRef"].open(row.id,this.param);
} }
}, }
/**删除用户*/
async handleDelete(row) {
const id = row.id;
await this.$modal.confirm('是否确认删除客户卡券"'+row.couponName+"\"" )
try {
await CustomerCouponApi.deleteCustomerCoupon(id);
this.getById(this.param.id)
this.$modal.msgSuccess("删除成功");
} catch {
}
},
/**卡券核销*/
async couponVerification(row) {
console.log(row)
const id = row.id;
if (row.outRule == 'ycxhx'){
await this.$modal.confirm("本卡券为核销规则为一次性核销,核销后卡券将不再有效" )
} else if(row.outRule == 'jche'){
await this.$modal.confirm("本卡券为核销规则为计次核销,本次核销一次" )
} else {
await this.$modal.confirm("本卡券为核销规则为金额核销,本次核销"+row.unitPrice+'元' )
}
try {
await CustomerCouponApi.couponVerification(row);
this.getById(this.param.id)
this.$modal.msgSuccess("核销成功");
} catch {
}
},
} }
} }

View File

@ -2,16 +2,10 @@
<div class="app-container"> <div class="app-container">
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body> <el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body>
<span style="color: red">请输入充值金额</span> <span style="color: red">请输入充值金额</span><el-input-number v-model="topUpAmount" :precision="2" ></el-input-number>
<el-input-number v-model="topUpAmount" :precision="2"></el-input-number>
<span style="color: red">请选择充值类型</span>
<el-select v-model="accountType" class="item__input" >
<el-option v-for="item in getDictDatas(DICT_TYPE.REPAIR_PAY_TYPE)" :key="item.value" :label="item.label"
:value="item.value"/>
</el-select>
<el-collapse v-model="activeNames"> <el-collapse v-model="activeNames">
<!-- 供应商基本信息 --> <!-- 供应商基本信息 -->
<el-collapse-item name="1"> <el-collapse-item name="1">
<template slot="title"> <template slot="title">
<div style="font-weight: bold">活动内容</div> <div style="font-weight: bold">活动内容</div>
</template> </template>
@ -34,21 +28,21 @@
<template slot="label"> <template slot="label">
开始时间 开始时间
</template> </template>
{{ parseTime(formData.beginTime) }} {{parseTime(formData.beginTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
结束时间 结束时间
</template> </template>
{{ parseTime(formData.endTime) }} {{parseTime(formData.endTime)}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
活动内容 活动内容
</template> </template>
{{ formData.remark }} {{formData.remark}}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
@ -89,8 +83,7 @@ export default {
formLoading: false, formLoading: false,
// //
activeNames: ['1', '2'], activeNames: ['1', '2'],
topUpAmount: 0.00, topUpAmount:0.00,
accountType: '01',
// //
formData: { formData: {
id: undefined, id: undefined,
@ -100,20 +93,20 @@ export default {
endTime: undefined, endTime: undefined,
remark: undefined, remark: undefined,
ruleList: [{ ruleList: [{
name: '', name:'',
rechAmount: '', rechAmount: '',
giveAmount: '', giveAmount: '',
}], }],
}, },
// //
cusRow: {}, cusRow:{},
// //
formRules: {}, formRules: {},
}; };
}, },
methods: { methods: {
/** 打开弹窗 */ /** 打开弹窗 */
async open(id, cusRow) { async open(id,cusRow) {
this.dialogVisible = true; this.dialogVisible = true;
this.cusRow = cusRow this.cusRow = cusRow
this.reset(); this.reset();
@ -136,10 +129,9 @@ export default {
this.formLoading = true; this.formLoading = true;
try { try {
const data = { const data = {
cusId: this.cusRow.id, cusId:this.cusRow.id,
activeId: this.formData.id, activeId:this.formData.id,
topUpAmount: this.topUpAmount, topUpAmount:this.topUpAmount
accountType: this.accountType
} }
await ActiveMainApi.attendActive(data); await ActiveMainApi.attendActive(data);
this.$modal.msgSuccess("参与成功"); this.$modal.msgSuccess("参与成功");
@ -151,6 +143,9 @@ export default {
}, },
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.formData = { this.formData = {
@ -160,10 +155,8 @@ export default {
beginTime: undefined, beginTime: undefined,
endTime: undefined, endTime: undefined,
remark: undefined, remark: undefined,
topUpAmount: 0.00,
accountType: '01',
ruleList: [{ ruleList: [{
name: '', name:'',
rechAmount: '', rechAmount: '',
giveAmount: '', giveAmount: '',
}], }],

View File

@ -43,8 +43,7 @@
</el-table-column> </el-table-column>
<el-table-column label="适用车型" width="130" align="center" prop="carModel"> <el-table-column label="适用车型" width="130" align="center" prop="carModel">
<template v-slot="scope"> <template v-slot="scope">
<dict-tag v-if="scope.row.carModel != null" :type="DICT_TYPE.MEMBER_CAR" :value="scope.row.carModel"/> <dict-tag :type="DICT_TYPE.MEMBER_CAR" :value="scope.row.carModel"/>
<span v-else>不限</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="核销规则" width="100" align="center" prop="outRule"> <el-table-column label="核销规则" width="100" align="center" prop="outRule">

View File

@ -32,12 +32,7 @@
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="订单号" align="center" prop="orderNo"/> <el-table-column label="订单号" align="center" prop="orderNo"/>
<el-table-column label="服务名称" align="center" prop="goodsTitle"/> <el-table-column label="服务名称" align="center" prop="goodsTitle"/>
<el-table-column label="消费类型" align="center" prop="goodsType"> <el-table-column label="消费类型" align="center" prop="goodsType"/>
<template v-slot="scope">
<span v-if="scope.row.goodsType == '1'">会员充值</span>
<span v-if="scope.row.goodsType == '2'">维修服务</span>
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="cusName"/> <el-table-column label="客户姓名" align="center" prop="cusName"/>
<el-table-column label="客户手机号" align="center" prop="cusPhone"/> <el-table-column label="客户手机号" align="center" prop="cusPhone"/>
<el-table-column label="商品原价(元)" align="center" prop="goodsPrice"/> <el-table-column label="商品原价(元)" align="center" prop="goodsPrice"/>