Commit 5d32293b by zhangxw

拍卖订单优惠券关联开发

1 parent 02e4599d
......@@ -108,6 +108,11 @@ export class AuctionOrderController{
return axios.delete('auctionOrder/removeAuctionOrderById', {params: {orderId: orderId}});
}
// 获取拍卖订单优惠券使用数据
static getAuctionOrderCouponUseData(axios:AxiosStatic, orderId: number): Promise<AxiosResponse<any>> {
return axios.get(`coupon/order-usage/detail/${orderId}`);
}
// region 前端扩展代码区
// endregion
}
......@@ -23,7 +23,10 @@
<template v-if="column.key === 'carTypeName'">
<a :href="`#/vehicle/view?vehicleId=${record.vehicle.vehicleId}`" target="_blank">{{ record.vehicle.baseInfo.carSeriesName }} {{ record.vehicle.baseInfo.carTypeName }}</a>
</template>
<template v-if="column.key === 'couponDeduction'">
<span style="color: red" v-if="(record.couponDeduction ?? '') !== ''">{{ '¥' + record.couponDeduction }}</span>
<span v-else>-</span>
</template>
<template v-if="column.key === 'action'">
<router-link v-sec="'auction_order_15'" :to="{path:'/auction/order/view',query:{orderId:record.orderId}}">
<a-button type="link" size="small">查看</a-button>
......@@ -118,7 +121,9 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
},
{title: '中拍人姓名', dataIndex: ['account', 'accountName'], key: 'accountName', width: 120, resizable: true, ellipsis: true, sorter: true},
{title: '中拍人电话', dataIndex: ['account', 'mobile'], key: 'mobile', width: 120, resizable: true, ellipsis: true, sorter: true},
{ title: '中拍人电话', dataIndex: ['account', 'mobile'], key: 'mobile', width: 120, resizable: true, ellipsis: true, sorter: true },
{ title: '优惠券名称', dataIndex: ['couponName'], key: 'couponName', width: 150, resizabel: true, ellipsis: true, sorter: false },
{ title: '优惠券抵扣金额', dataIndex: ['couponDeduction'], key: 'couponDeduction', width: 150, align: 'left', resizabel: true, ellipsis: true, sorter: false },
{title: '负责人', dataIndex: ['auction', 'user', 'realName'], key: 'realName', width: 120, resizable: true, ellipsis: true, sorter: true},
......@@ -161,7 +166,8 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
transferredTime: [null, {label: '出库时间', field: 'transferredTime', operator: Operator.dateBetween, type: 'date-range'}],
createTime: [null, {label: '中拍时间', field: 'createTime', operator: Operator.dateBetween, type: 'date-range'}],
newPlateNumber: [null, {label: '新车牌号', field: 'newPlateNumber', operator: Operator.like}],
auctionId: [this.$route.query.auctionId, {label: '拍卖ID', field: 'auction.auctionId', operator: Operator.eq}],
auctionId: [this.$route.query.auctionId, { label: '拍卖ID', field: 'auction.auctionId', operator: Operator.eq }],
isUseCoupon: [null, { label: '是否使用优惠券', field: 'isUseCoupon', operator: Operator.eq, allowClear: true, type: 'select', optionItems: [{ label: '是', value: 1 }, { label: '否', value: 2 }]}],
});
this.pagination.setDefaultSort('createTime', Order.desc);
this.changeTab(this.orderState);
......
......@@ -146,6 +146,9 @@
<template v-else-if="orderTransaction">
<a-button type="link" size="small" @click="viewOrderTransaction(orderTransaction)">查看</a-button>
</template>
<template v-else-if="record.payType === '优惠券抵扣'">
<a-button type="link" size="small" @click="viewCoupon(record)">查看</a-button>
</template>
<template v-else>
-
</template>
......@@ -205,6 +208,7 @@ import DepositStateTag from "@/views/finance/deposit/DepositStateTag.vue";
import AuditStateTag from "@/views/common/AuditStateTag.vue";
import ViewOrderTransaction from "@/views/finance/order-transaction/ViewOrderTransaction.vue";
import CancelAuctionOrder from "@/views/auction/order/CancelAuctionOrder.vue";
import ViewOrderCoupon from "@/views/auction/order/ViewOrderCoupon.vue";
@Component({
components: {AuditStateTag, DepositStateTag, TitleTipIcon, AuctionOrderStateTag, EditFilled, DeleteFilled, VehicleBaseInfo}
......@@ -223,6 +227,8 @@ export default class ViewAuctionOrder extends Vue {
orderTransaction: OrderTransaction = null;
couponUseData: any = null;
/**
* 表格列配置
*/
......@@ -280,6 +286,9 @@ export default class ViewAuctionOrder extends Vue {
TransactionController.getOrderTransactionByOrderId(this.axios, this.orderId).then(response => {
this.orderTransaction = response.data;
});
AuctionOrderController.getAuctionOrderCouponUseData(this.axios, this.orderId).then(response => {
this.couponUseData = response.data?.data;
});
this.loadBreachs();
}
......@@ -301,35 +310,49 @@ export default class ViewAuctionOrder extends Vue {
if (reduceDeposit !== 0) {
reduceAmount = "(已扣违约金:¥" + (-reduceDeposit) + ")";
}
return [
{
payType: '拍卖保证金',
amount: '¥' + (-this.deposit.transaction.amount),
payAmount: '¥' + (-this.deposit.transaction.amount) + reduceAmount,
payState: this.deposit.depositState,
payMethod: '微信',
payEndTime: this.deposit.createTime,
payTime: this.deposit.createTime
},
{
payType: '车辆款',
amount: '¥' + this.auctionOrder.orderPrice,
payAmount: '¥' + this.auctionOrder.orderPrice,
payState: '-',
payMethod: '-',
payEndTime: '-',
payTime: '-'
},
{
payType: '拍卖佣金',
amount: '¥' + this.auctionOrder.commissionPrice,
payAmount: '¥' + this.auctionOrder.commissionPrice,
payState: '-',
payMethod: '-',
payEndTime: '-',
payTime: '-'
}
];
const baozhengjin = {
payType: '拍卖保证金',
amount: '¥' + (-this.deposit.transaction.amount),
payAmount: '¥' + (-this.deposit.transaction.amount) + reduceAmount,
payState: this.deposit.depositState,
payMethod: '微信',
payEndTime: this.deposit.createTime,
payTime: this.deposit.createTime
}
const cheliangkuan = {
payType: '车辆款',
amount: '¥' + this.auctionOrder.orderPrice,
payAmount: '¥' + this.auctionOrder.orderPrice,
payState: '-',
payMethod: '-',
payEndTime: '-',
payTime: '-'
}
const youhuiquan = {
payType: '优惠券抵扣',
amount: '-¥' + this.couponUseData?.faceAmount,
payAmount: '-',
payState: '已抵扣',
payMethod: '-',
payEndTime: '-',
payTime: '-'
}
const yongjin = {
payType: '拍卖佣金',
amount: '¥' + this.auctionOrder.commissionPrice,
payAmount: '¥' + this.auctionOrder.commissionPrice,
payState: '-',
payMethod: '-',
payEndTime: '-',
payTime: '-'
}
console.log(this.couponUseData)
if (Object.keys(this.couponUseData || {}).length > 0) {
return [baozhengjin, cheliangkuan, youhuiquan, yongjin];
} else {
return [baozhengjin, cheliangkuan, yongjin];
}
}
addBreachRecord(): void {
......@@ -436,9 +459,25 @@ export default class ViewAuctionOrder extends Vue {
},
});
}
viewCoupon(): void {
const modal = ModalService.confirm({
title: '优惠券使用详情', component: ViewOrderCoupon, closable: true, appContext: this.$.appContext, width: 650,
props: {
couponData: this.couponUseData
},
onOk: (component): void => {
},
emits: {
handleOk: (e) => {
modal.destroy();
}
},
});
}
}
</script>
<style scoped lang="ts">
<style scoped>
</style>
<template>
<a-descriptions v-if="couponData" :bordered="false" :column="2" size="small">
<a-descriptions-item label="优惠券ID">
{{ couponData?.templateInfo?.templateId }}
</a-descriptions-item>
<a-descriptions-item label="优惠券名称">
{{ couponData?.templateInfo?.templateName }}
</a-descriptions-item>
<a-descriptions-item label="优惠券类型">
{{ couponData?.templateInfo?.couponType === 1 ? '固定面额' : '阶梯满减券' }}
</a-descriptions-item>
<a-descriptions-item label="抵扣金额">
{{ (couponData?.actualDeduction ?? '') !== '' ? '¥' + couponData.actualDeduction : '-' }}
</a-descriptions-item>
<a-descriptions-item label="使用时间">
{{ couponData.usageTime }}
</a-descriptions-item>
<a-descriptions-item label="使用人">
{{ couponData.accountName }}
</a-descriptions-item>
</a-descriptions>
</template>
<script lang="ts">
import {Component, Prop, Vue} from "vue-facing-decorator";
@Component({})
export default class ViewOrderCoupon extends Vue {
@Prop({required: true})
couponData: any;
created(): void {}
mounted() {}
}
</script>
<style scoped>
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!