押金抵扣
This commit is contained in:
parent
025397f780
commit
e49cbad804
|
@ -14,3 +14,19 @@ export function appCalcOrderFee(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算应付骑行费用
|
||||
* @param {Object} data - 请求参数
|
||||
* @param {number} data.startTime - 开始时间
|
||||
* @param {number} data.endTime - 结束时间
|
||||
* @returns {Promise} 返回骑行费用信息
|
||||
*/
|
||||
export function appCalcRideFee(data) {
|
||||
return request({
|
||||
url: '/app/order/calcRideFee',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
>
|
||||
<div v-loading="loading">
|
||||
<p>即将进行押金抵扣,请确认。</p>
|
||||
<p>抵扣金额:{{ detail.totalFee | fix2 | dv }} 元</p>
|
||||
<p>抵扣金额:{{ fee.payAmount | fix2 | dv }} 元</p>
|
||||
<p>剩余可抵扣押金:{{ detail.depositDeductRemain | fix2 | dv }} 元</p>
|
||||
<p>若押金不足,则收取最大可抵扣金额</p>
|
||||
</div>
|
||||
|
@ -20,6 +20,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { appCalcRideFee } from '@/api/app/order';
|
||||
import { deductOrder, getOrder } from '@/api/bst/order';
|
||||
|
||||
export default {
|
||||
|
@ -39,6 +40,7 @@ export default {
|
|||
form: {},
|
||||
loading: false,
|
||||
submitLoading: false,
|
||||
fee: {},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
|
@ -62,8 +64,14 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
calcRideFee() {
|
||||
appCalcRideFee({orderId: this.id}).then(res => {
|
||||
this.fee = res.data;
|
||||
})
|
||||
},
|
||||
handleOpen() {
|
||||
this.getDetail();
|
||||
this.calcRideFee();
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
|
@ -74,6 +82,7 @@ export default {
|
|||
},
|
||||
handleSubmit() {
|
||||
this.submitLoading = true;
|
||||
this.form.fee = this.fee;
|
||||
deductOrder(this.form).then((response) => {
|
||||
if (response.code == 200) {
|
||||
this.$message.success('操作成功');
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
<br/>
|
||||
<dict-tag :options="dict.type.suit_type" :value="d.row.suitType" size="mini"/>
|
||||
<dict-tag :options="dict.type.suit_riding_rule" :value="d.row.suitRidingRule" size="mini" style="margin-left: 4px;"/>
|
||||
<el-tag v-if="d.row.suitDepositDeduction" type="success" size="mini" style="margin-left: 4px;">自动抵扣</el-tag>
|
||||
<el-tag v-if="d.row.suitDepositDeduction" type="success" size="mini" style="margin-left: 4px;">允许抵扣</el-tag>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'returnType'">
|
||||
<dict-tag :options="dict.type.order_return_type" :value="d.row.returnType" size="mini"/>
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<div>车损费:{{detail.actualDeductionFee | fix2 | dv}} 元</div>
|
||||
<br/>
|
||||
<div>合计:{{detail.actualAmount | fix2 | dv}} 元</div>
|
||||
<div v-if="detail.depositDeductionAmount">押金抵扣:{{detail.depositDeductionAmount | fix2 | dv}} 元</div>
|
||||
<div v-if="detail.depositDeductionAmount != null">押金抵扣:{{detail.depositDeductionAmount | fix2 | dv}} 元</div>
|
||||
</div>
|
||||
<el-statistic slot="reference"
|
||||
title="实收"
|
||||
|
@ -218,7 +218,7 @@
|
|||
{{ detail.suitName }}
|
||||
<dict-tag :options="dict.type.suit_type" :value="detail.suitType" size="mini" style="margin-left: 4px;"/>
|
||||
<dict-tag :options="dict.type.suit_riding_rule" :value="detail.suitRidingRule" size="mini" style="margin-left: 4px;"/>
|
||||
<el-tag v-if="detail.suitDepositDeduction" type="success" size="mini" style="margin-left: 4px;">自动抵扣</el-tag>
|
||||
<el-tag v-if="detail.suitDepositDeduction" type="success" size="mini" style="margin-left: 4px;">允许抵扣</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="免费骑行时间" :span="3">
|
||||
{{ detail.suitFreeRideTime | dv }} 分钟
|
||||
|
@ -284,7 +284,7 @@
|
|||
<el-descriptions-item label="支付时间">
|
||||
{{ detail.ridePayTime | dv }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="押金抵扣" v-if="detail.depositDeductionAmount">
|
||||
<el-descriptions-item label="押金抵扣" v-if="detail.depositDeductionAmount != null">
|
||||
{{ detail.depositDeductionAmount | fix2 | dv }} 元
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
|
|
@ -193,7 +193,7 @@
|
|||
|
||||
<el-row>
|
||||
<collapse-panel title="更多设置" :value="true">
|
||||
<form-col :span="24" label="押金自动抵扣" label-width="8em" prop="depositDeduction" tip="开启后,订单结束后将自动进行押金抵扣,并将剩余金额退还给用户">
|
||||
<form-col :span="24" label="允许用户押金抵扣" label-width="10em" prop="depositDeduction" tip="开启后,订单结束后将允许用户操作押金抵扣,并将剩余金额退还给用户">
|
||||
<el-switch v-model="form.depositDeduction" active-text="开启" inactive-text="关闭"/>
|
||||
</form-col>
|
||||
<form-col :span="24" label="适用车型" prop="modelIds">
|
||||
|
|
|
@ -220,8 +220,8 @@ export default {
|
|||
{key: 'instructions', visible: true, label: '说明', minWidth: null, sortable: true, overflow: true, align: 'center', width: null},
|
||||
{key: 'freeRideTime', visible: true, label: '免费时长', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'orderNum', visible: true, label: '排序', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'seconds', visible: true, label: '可用时长', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
|
||||
{key: 'depositDeduction', visible: true, label: '自动抵扣', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
// {key: 'seconds', visible: true, label: '可用时长', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
|
||||
{key: 'depositDeduction', visible: true, label: '允许抵扣', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'modelNames', visible: true, label: '适用车型', minWidth: "200", sortable: false, overflow: false, align: 'center', width: null},
|
||||
{key: 'createTime', visible: true, label: '创建时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue
Block a user