1
This commit is contained in:
parent
b6ce2139c9
commit
5505656d59
@ -1,9 +1,9 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 创建用户卡券
|
// 卡券核销
|
||||||
export function createCustomerCoupon(data) {
|
export function couponVerification(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/customer-coupon/create',
|
url: '/base/customer-coupon/couponVerification',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
:options="options"
|
:options="options"
|
||||||
v-model="selectedValues"
|
v-model="selectedValues"
|
||||||
filterable
|
filterable
|
||||||
:props="{checkStrictly:true}"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -105,14 +105,19 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
height="200"
|
height="200"
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-table-column show-overflow-tooltip prop="couponName" label="卡券名称" >
|
<el-table-column prop="couponName" label="卡券名称" >
|
||||||
</el-table-column>
|
</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">
|
<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="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">
|
<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"/>
|
||||||
@ -133,14 +138,11 @@
|
|||||||
<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">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<el-button size="mini" type="text" icon="el-icon-goods" @click="couponVerification(scope.row)">核销</el-button>
|
||||||
</template>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
</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>
|
||||||
@ -199,8 +201,8 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<ReceiveCouponForm @success="getById(param.id)" ref="receiveCouponForm"/>
|
<ReceiveCouponForm @success="successCallback()" ref="receiveCouponForm"/>
|
||||||
<RuchForm @success="getById(param.id)" ref="RuchFormRef"/>
|
<RuchForm @success="successCallback()" ref="RuchFormRef"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -208,6 +210,7 @@
|
|||||||
<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 {
|
||||||
@ -256,6 +259,11 @@ 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'){
|
||||||
@ -264,7 +272,38 @@ 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 {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,16 @@
|
|||||||
<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><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 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>
|
||||||
@ -28,21 +34,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>
|
||||||
@ -83,7 +89,8 @@ 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,
|
||||||
@ -93,20 +100,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();
|
||||||
@ -129,9 +136,10 @@ 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("参与成功");
|
||||||
@ -143,9 +151,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
reset() {
|
reset() {
|
||||||
this.formData = {
|
this.formData = {
|
||||||
@ -155,8 +160,10 @@ 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: '',
|
||||||
}],
|
}],
|
||||||
|
@ -43,7 +43,8 @@
|
|||||||
</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 :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>
|
</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">
|
||||||
|
@ -32,7 +32,12 @@
|
|||||||
<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"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user