1
This commit is contained in:
parent
b6ce2139c9
commit
5505656d59
@ -1,9 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建用户卡券
|
||||
export function createCustomerCoupon(data) {
|
||||
// 卡券核销
|
||||
export function couponVerification(data) {
|
||||
return request({
|
||||
url: '/base/customer-coupon/create',
|
||||
url: '/base/customer-coupon/couponVerification',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
@ -5,7 +5,6 @@
|
||||
:options="options"
|
||||
v-model="selectedValues"
|
||||
filterable
|
||||
:props="{checkStrictly:true}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -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 {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,13 @@
|
||||
<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">
|
||||
@ -84,6 +90,7 @@ export default {
|
||||
//折叠面板默认展开
|
||||
activeNames: ['1', '2'],
|
||||
topUpAmount: 0.00,
|
||||
accountType: '01',
|
||||
// 表单参数
|
||||
formData: {
|
||||
id: undefined,
|
||||
@ -131,7 +138,8 @@ export default {
|
||||
const data = {
|
||||
cusId: this.cusRow.id,
|
||||
activeId: this.formData.id,
|
||||
topUpAmount:this.topUpAmount
|
||||
topUpAmount: this.topUpAmount,
|
||||
accountType: this.accountType
|
||||
}
|
||||
await ActiveMainApi.attendActive(data);
|
||||
this.$modal.msgSuccess("参与成功");
|
||||
@ -143,9 +151,6 @@ export default {
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
@ -155,6 +160,8 @@ export default {
|
||||
beginTime: undefined,
|
||||
endTime: undefined,
|
||||
remark: undefined,
|
||||
topUpAmount: 0.00,
|
||||
accountType: '01',
|
||||
ruleList: [{
|
||||
name: '',
|
||||
rechAmount: '',
|
||||
|
@ -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">
|
||||
|
@ -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"/>
|
||||
|
Loading…
Reference in New Issue
Block a user