This commit is contained in:
PQZ 2024-09-24 13:30:52 +08:00
parent b6ce2139c9
commit 5505656d59
6 changed files with 136 additions and 85 deletions

View File

@ -1,53 +1,53 @@
import request from '@/utils/request'
// 创建用户卡券
export function createCustomerCoupon(data) {
return request({
url: '/base/customer-coupon/create',
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'
})
}
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,7 +5,6 @@
:options="options"
v-model="selectedValues"
filterable
:props="{checkStrictly:true}"
/>
</div>

View File

@ -105,14 +105,19 @@
size="mini"
height="200"
style="width: 100%">
<el-table-column show-overflow-tooltip prop="couponName" label="卡券名称" >
<el-table-column prop="couponName" label="卡券名称" >
</el-table-column>
<el-table-column label="卡券类型" width="80" align="left" prop="couponType">
<el-table-column label="卡券类型" width="80" align="center" prop="couponType">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.MEMBER_COUPON_TYPE" :value="scope.row.couponType"/>
</template>
</el-table-column>
<el-table-column label="适用车型" width="130" align="center" prop="carModel">
<el-table-column label="剩余金额/次数" width="120" align="right" prop="balance">
<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">
<span v-if="scope.row.carModel == null">不限</span>
<dict-tag :type="DICT_TYPE.MEMBER_CAR" :value="scope.row.carModel"/>
@ -133,14 +138,11 @@
<span>{{ parseTime(scope.row.endTime) }}</span>
</template>
</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">
<span>{{ parseTime(scope.row.createTime) }}</span>
</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>
<el-button size="mini" type="text" icon="el-icon-goods" @click="couponVerification(scope.row)">核销</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -199,8 +201,8 @@
</el-table>
</el-card>
<ReceiveCouponForm @success="getById(param.id)" ref="receiveCouponForm"/>
<RuchForm @success="getById(param.id)" ref="RuchFormRef"/>
<ReceiveCouponForm @success="successCallback()" ref="receiveCouponForm"/>
<RuchForm @success="successCallback()" ref="RuchFormRef"/>
</div>
</template>
@ -208,6 +210,7 @@
<script>
import * as CustomerMainApi from '@/api/base/customer';
import * as ActiveMainApi from '@/api/member/active';
import * as CustomerCouponApi from '@/api/base/coupon';
import ReceiveCouponForm from '@/views/base/customer/ReceiveCouponForm.vue'
import RuchForm from '@/views/base/customer/RuchForm.vue'
export default {
@ -256,6 +259,11 @@ export default {
this.loading = false;
}
},
successCallback(){
this.getById(this.param.id)
this.getActiveList()
},
/**参与活动*/
async openActive(row){
if (row.isCoupon == '1' && row.isRechRule == '0'){
@ -264,7 +272,38 @@ export default {
if (row.isRechRule == '1'){
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,10 +2,16 @@
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body>
<span style="color: red">请输入充值金额</span><el-input-number v-model="topUpAmount" :precision="2" ></el-input-number>
<span style="color: red">请输入充值金额</span>
<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-item name="1">
<el-collapse-item name="1">
<template slot="title">
<div style="font-weight: bold">活动内容</div>
</template>
@ -28,21 +34,21 @@
<template slot="label">
开始时间
</template>
{{parseTime(formData.beginTime)}}
{{ parseTime(formData.beginTime) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
结束时间
</template>
{{parseTime(formData.endTime)}}
{{ parseTime(formData.endTime) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
活动内容
</template>
{{formData.remark}}
{{ formData.remark }}
</el-descriptions-item>
</el-descriptions>
@ -83,7 +89,8 @@ export default {
formLoading: false,
//
activeNames: ['1', '2'],
topUpAmount:0.00,
topUpAmount: 0.00,
accountType: '01',
//
formData: {
id: undefined,
@ -93,20 +100,20 @@ export default {
endTime: undefined,
remark: undefined,
ruleList: [{
name:'',
name: '',
rechAmount: '',
giveAmount: '',
}],
},
//
cusRow:{},
cusRow: {},
//
formRules: {},
};
},
methods: {
/** 打开弹窗 */
async open(id,cusRow) {
async open(id, cusRow) {
this.dialogVisible = true;
this.cusRow = cusRow
this.reset();
@ -129,9 +136,10 @@ export default {
this.formLoading = true;
try {
const data = {
cusId:this.cusRow.id,
activeId:this.formData.id,
topUpAmount:this.topUpAmount
cusId: this.cusRow.id,
activeId: this.formData.id,
topUpAmount: this.topUpAmount,
accountType: this.accountType
}
await ActiveMainApi.attendActive(data);
this.$modal.msgSuccess("参与成功");
@ -143,9 +151,6 @@ export default {
},
/** 表单重置 */
reset() {
this.formData = {
@ -155,8 +160,10 @@ export default {
beginTime: undefined,
endTime: undefined,
remark: undefined,
topUpAmount: 0.00,
accountType: '01',
ruleList: [{
name:'',
name: '',
rechAmount: '',
giveAmount: '',
}],

View File

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

View File

@ -32,7 +32,12 @@
<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="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="cusPhone"/>
<el-table-column label="商品原价(元)" align="center" prop="goodsPrice"/>