1、合作商余额查询
2、分油账户司机可用额度
This commit is contained in:
@@ -81,6 +81,25 @@
|
||||
>{{ item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="企油通发放态">
|
||||
<a-select v-decorator="['oil_status_zsy', { initialValue: -1 }]">
|
||||
<a-select-option :value="-1">全部</a-select-option>
|
||||
<a-select-option :value="0">未提交</a-select-option>
|
||||
<a-select-option :value="1">发放中</a-select-option>
|
||||
<a-select-option :value="2">发放成功</a-select-option>
|
||||
<a-select-option :value="3">发放失败</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="退款状态">
|
||||
<a-select v-decorator="['refund_status', { initialValue: -1 }]">
|
||||
<a-select-option :value="-1">全部</a-select-option>
|
||||
<a-select-option :value="0">未退款</a-select-option>
|
||||
<a-select-option :value="1">退款中</a-select-option>
|
||||
<a-select-option :value="2">已退款</a-select-option>
|
||||
<a-select-option :value="3">退款失败</a-select-option>
|
||||
<a-select-option :value="4">待人工确认</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品编码">
|
||||
<a-input v-decorator="['goods_no']" placeholder="商品编码" />
|
||||
</a-form-item>
|
||||
@@ -133,10 +152,10 @@
|
||||
<tbody class="ant-table-tbody">
|
||||
<template v-for="(item) in orderList.data">
|
||||
<tr class="order-empty" :key="`order_${item.order_id}_1`">
|
||||
<td colspan="15"></td>
|
||||
<td colspan="16"></td>
|
||||
</tr>
|
||||
<tr :key="`order_${item.order_id}_2`">
|
||||
<td colspan="15">
|
||||
<td colspan="16">
|
||||
<span class="mr-20">{{ item.create_time }}</span>
|
||||
<span class="mr-20">订单号:{{ item.order_no }}</span>
|
||||
<platform-icon :name="item.platform" :showTips="true" />
|
||||
@@ -163,47 +182,58 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="actions">
|
||||
<!--<router-link
|
||||
v-if="$auth('/order/detail')"
|
||||
:to="{ path: '/order/detail', query: { orderId: item.order_id } }"
|
||||
>详情</router-link>
|
||||
<a
|
||||
v-action:deliver
|
||||
v-if="(
|
||||
item.pay_status == PayStatusEnum.SUCCESS.value
|
||||
&& item.delivery_type == DeliveryTypeEnum.EXPRESS.value
|
||||
&& item.delivery_status == DeliveryStatusEnum.NOT_DELIVERED.value
|
||||
&& !inArray(item.order_status, [OrderStatusEnum.CANCELLED.value, OrderStatusEnum.APPLY_CANCEL.value])
|
||||
)"
|
||||
@click="handleDelivery(item)"
|
||||
>发货</a>
|
||||
<a
|
||||
v-action:cancel
|
||||
v-if="item.order_status == OrderStatusEnum.APPLY_CANCEL.value"
|
||||
@click="handleCancel(item)"
|
||||
>审核取消</a>
|
||||
<a v-action:delete @click="handleDelete(item)">删除</a>
|
||||
<a
|
||||
v-if="$auth('/order/cancelshare') && (goodsItm.oilCardType !== 'zsy_ticket') && (
|
||||
inArray(item.order_status, [OrderStatusEnum.COMPLETED.value])
|
||||
)"
|
||||
@click="handleCancelShare(goodsItm)"
|
||||
>分油撤销</a>-->
|
||||
<!--有付款权限,订单状态为进行中,已支付,并且未使用-->
|
||||
<a
|
||||
v-if="$auth('/order/pay') && (
|
||||
inArray(item.order_status, [OrderStatusEnum.NORMAL.value])
|
||||
) && inArray(item.pay_status, [PayStatusEnum.SUCCESS.value]) && goodsItm.use_status === 0 && goodsItm.oil_status === 1 && goodsItm.oilCardType === 'zsy_ticket'"
|
||||
@click="handlePay(goodsItm)"
|
||||
>付款码</a>
|
||||
<a
|
||||
v-if="$auth('/order/pay') && (
|
||||
inArray(item.order_status, [OrderStatusEnum.NORMAL.value])
|
||||
) && inArray(item.pay_status, [PayStatusEnum.SUCCESS.value]) && goodsItm.oil_status === 0 && goodsItm.oilCardType === 'zsy_ticket'"
|
||||
@click="handleShare(goodsItm)"
|
||||
>手动分油</a>
|
||||
<!-- 企油通:发放/加油/退款/发票,与合作商订单页同一套接口 -->
|
||||
<template v-if="goodsItm.qyt">
|
||||
<a
|
||||
v-if="goodsItm.qyt.oil_status_zsy === 3 && goodsItm.qyt.oil_status === 0"
|
||||
@click="handleShare(goodsItm.qyt)"
|
||||
>重新发放</a>
|
||||
<a
|
||||
v-if="goodsItm.qyt.oil_status_zsy === 2 && goodsItm.qyt.oil_status === 1
|
||||
&& goodsItm.qyt.refund_status !== 2 && Number(remainAmount(goodsItm.qyt)) > 0"
|
||||
@click="handlePay(goodsItm.qyt)"
|
||||
>加油链接</a>
|
||||
<a
|
||||
v-if="goodsItm.qyt.oil_status_zsy === 2 && goodsItm.qyt.oil_status === 1"
|
||||
@click="handleOil(goodsItm.qyt)"
|
||||
>重推发放结果</a>
|
||||
<a
|
||||
v-if="goodsItm.qyt.oil_status_zsy === 2 && goodsItm.qyt.use_status === 1"
|
||||
@click="handleUse(goodsItm.qyt)"
|
||||
>重推加油结果</a>
|
||||
<a v-if="canRefund(goodsItm.qyt)" @click="handleRefund(goodsItm.qyt)">{{ refundLabel(goodsItm.qyt) }}</a>
|
||||
<a v-if="goodsItm.qyt.use_status === 1" @click="handleInvoice(goodsItm.qyt)">发票</a>
|
||||
</template>
|
||||
<span v-else-if="goodsItm.oilCardType === 'zsy_ticket'" class="c-muted-1">未生成发放单</span>
|
||||
</div>
|
||||
</td>
|
||||
<!-- 司机(实名信息随单固化) -->
|
||||
<td>
|
||||
<template v-if="goodsItm.qyt">
|
||||
<p class="mtb-2">{{ goodsItm.qyt.driver_name || '-' }}</p>
|
||||
<p class="mtb-2 f-13">{{ goodsItm.qyt.mobile }}</p>
|
||||
<p class="mtb-2 f-13">{{ goodsItm.qyt.id_card_mask || '-' }}</p>
|
||||
<p class="mtb-2 f-13">车牌:{{ goodsItm.qyt.plate_no || '-' }}</p>
|
||||
</template>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<!-- 企油通单号 -->
|
||||
<td>
|
||||
<template v-if="goodsItm.qyt">
|
||||
<p class="mtb-2 f-13">批次:{{ goodsItm.qyt.batch_no || '-' }}</p>
|
||||
<p class="mtb-2 f-13">运单:{{ goodsItm.qyt.waybill_no || '-' }}</p>
|
||||
</template>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<!-- 加油信息 -->
|
||||
<td>
|
||||
<template v-if="goodsItm.qyt && goodsItm.qyt.use_status === 1">
|
||||
<p class="mtb-2 f-13">已加油:¥{{ goodsItm.qyt.used_amount }}({{ goodsItm.qyt.used_num }} 次)</p>
|
||||
<p class="mtb-2 f-13">剩余:¥{{ remainAmount(goodsItm.qyt) }}</p>
|
||||
<p class="mtb-2 f-13">最近:{{ goodsItm.qyt.station_name || '-' }} {{ goodsItm.qyt.oil_name }} {{ goodsItm.qyt.litter }}L</p>
|
||||
</template>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<template v-if="goodsIdx===0">
|
||||
<td :rowspan="item.goods.length">
|
||||
<p>¥{{ item.pay_price }}</p>
|
||||
@@ -252,6 +282,17 @@
|
||||
:color="goodsItm.use_status == UseStatusEnum.USE.value ? 'green' : ''"
|
||||
>{{ UseStatusEnum[goodsItm.use_status].name }}</a-tag>
|
||||
</p>
|
||||
<template v-if="goodsItm.qyt">
|
||||
<p class="mtb-2">
|
||||
<span class="f-13">企油通:</span>
|
||||
<a-tag :color="qytColor(goodsItm.qyt.oil_status_zsy)">{{ qytText(goodsItm.qyt.oil_status_zsy) }}</a-tag>
|
||||
</p>
|
||||
<p v-if="goodsItm.qyt.oil_text" class="mtb-2 f-13 order-remark">{{ goodsItm.qyt.oil_text }}</p>
|
||||
<p v-if="goodsItm.qyt.refund_status > 0" class="mtb-2">
|
||||
<span class="f-13">退款:</span>
|
||||
<a-tag :color="refundColor(goodsItm.qyt.refund_status)">{{ refundText(goodsItm.qyt.refund_status) }}</a-tag>
|
||||
</p>
|
||||
</template>
|
||||
<p
|
||||
v-if="[OrderStatusEnum.CANCELLED.value,OrderStatusEnum.APPLY_CANCEL.value].includes(item.order_status)"
|
||||
class="mtb-2"
|
||||
@@ -284,8 +325,13 @@
|
||||
<DeliveryForm ref="DeliveryForm" @handleSubmit="handleRefresh" />
|
||||
<CancelForm ref="CancelForm" @handleSubmit="handleRefresh" />
|
||||
<CancelShareForm ref="CancelShareForm" @handleSubmit="handleRefresh" />
|
||||
<!-- 企油通相关弹窗直接复用合作商订单页的组件,底层调的是 /partners.order/* -->
|
||||
<ShareForm ref="ShareForm" @handleSubmit="handleRefresh" />
|
||||
<PayForm ref="PayForm" @handleSubmit="handleRefresh" />
|
||||
<OilForm ref="OilForm" @handleSubmit="handleRefresh" />
|
||||
<UseForm ref="UseForm" @handleSubmit="handleRefresh" />
|
||||
<RefundForm ref="RefundForm" @handleSubmit="handleRefresh" />
|
||||
<InvoiceModal ref="InvoiceModal" />
|
||||
</a-spin>
|
||||
</a-card>
|
||||
</template>
|
||||
@@ -312,7 +358,9 @@ import {
|
||||
OilStatusEnum,
|
||||
UseStatusEnum
|
||||
} from '@/common/enum/order'
|
||||
import { DeliveryForm, CancelForm, CancelShareForm, ShareForm, PayForm } from './modules'
|
||||
import { DeliveryForm, CancelForm, CancelShareForm } from './modules'
|
||||
// 企油通的发放/加油/退款/发票与合作商订单完全同构,组件和接口都直接复用
|
||||
import { OilForm, UseForm, ShareForm, PayForm, RefundForm, InvoiceModal } from '@/views/partners/order/modules'
|
||||
|
||||
// 表格字段
|
||||
const columns = [
|
||||
@@ -330,9 +378,24 @@ const columns = [
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: '180px',
|
||||
width: '220px',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
},
|
||||
{
|
||||
title: '司机',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'driver' }
|
||||
},
|
||||
{
|
||||
title: '企油通单号',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'qyt' }
|
||||
},
|
||||
{
|
||||
title: '加油信息',
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'consume' }
|
||||
},
|
||||
{
|
||||
title: '实付款',
|
||||
align: 'center',
|
||||
@@ -407,7 +470,11 @@ export default {
|
||||
CancelForm,
|
||||
CancelShareForm,
|
||||
ShareForm,
|
||||
PayForm
|
||||
PayForm,
|
||||
OilForm,
|
||||
UseForm,
|
||||
RefundForm,
|
||||
InvoiceModal
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
@@ -565,14 +632,68 @@ export default {
|
||||
handleCancelShare (record) {
|
||||
this.$refs.CancelShareForm.show(record)
|
||||
},
|
||||
// 手动分油
|
||||
// ================================================================
|
||||
// 企油通:发放 / 加油 / 退款 / 发票
|
||||
// 这些操作的对象是订单商品行上挂的发放单(goodsItm.qyt,即 partners_order 记录),
|
||||
// 调的接口与合作商订单页是同一套 /partners.order/*
|
||||
// ================================================================
|
||||
|
||||
// 重新发放(仅「发放失败」可用;会重新扣减下单用户余额)
|
||||
handleShare (record) {
|
||||
this.$refs.ShareForm.show(record)
|
||||
},
|
||||
// 付款码
|
||||
// 加油链接(企油通 7.15 免登 H5)
|
||||
handlePay (record) {
|
||||
this.$refs.PayForm.show(record)
|
||||
},
|
||||
// 重推发放结果(小程序单没有下游平台,等于把状态重新同步到用户端)
|
||||
handleOil (record) {
|
||||
this.$refs.OilForm.show(record)
|
||||
},
|
||||
// 重推加油结果
|
||||
handleUse (record) {
|
||||
this.$refs.UseForm.show(record)
|
||||
},
|
||||
// 退款
|
||||
handleRefund (record) {
|
||||
this.$refs.RefundForm.show(record)
|
||||
},
|
||||
// 企业发票(企油通 7.14)
|
||||
handleInvoice (record) {
|
||||
this.$refs.InvoiceModal.show(record)
|
||||
},
|
||||
|
||||
// 企油通发放态文案 / 颜色
|
||||
qytText (v) {
|
||||
return { 0: '未提交', 1: '发放中', 2: '发放成功', 3: '发放失败' }[v] || '未知'
|
||||
},
|
||||
qytColor (v) {
|
||||
return { 1: 'blue', 2: 'green', 3: 'red' }[v] || ''
|
||||
},
|
||||
|
||||
// 退款状态文案 / 颜色
|
||||
refundText (v) {
|
||||
return { 0: '未退款', 1: '退款中', 2: '已退款', 3: '退款失败', 4: '待人工确认' }[v] || '未知'
|
||||
},
|
||||
refundColor (v) {
|
||||
return { 1: 'blue', 2: 'green', 3: 'red', 4: 'orange' }[v] || ''
|
||||
},
|
||||
// 发放成功才可能退款;已经有退款记录的单总是可以打开看流水
|
||||
canRefund (item) {
|
||||
if (item.oilCardType !== 'zsy_ticket' || item.oil_status_zsy !== 2 || item.oil_status !== 1) {
|
||||
return false
|
||||
}
|
||||
return item.refund_status > 0 || Number(this.remainAmount(item)) > 0
|
||||
},
|
||||
// 剩余未加油金额:发放金额 − 已加油 −(已退款时)退款金额
|
||||
remainAmount (item) {
|
||||
const refunded = item.refund_status === 2 ? Number(item.refund_amount || 0) : 0
|
||||
const remain = Number(item.total_price || 0) - Number(item.used_amount || 0) - refunded
|
||||
return Math.max(0, remain).toFixed(2)
|
||||
},
|
||||
refundLabel (item) {
|
||||
return { 2: '退款记录', 4: '确认退款' }[item.refund_status] || '退款'
|
||||
},
|
||||
formatTime (timestamp) {
|
||||
const date = new Date(timestamp)
|
||||
const year = date.getFullYear()
|
||||
@@ -649,4 +770,15 @@ export default {
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
}
|
||||
// 操作栏:按钮较多会换行,横向纵向都留出间距(覆盖全局 .actions>a 的 8px 右边距)
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 16px;
|
||||
|
||||
& > a {
|
||||
margin-right: 0 !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<a-spin :spinning="isLoading">
|
||||
<div class="info">
|
||||
<p>油卡编号:{{ record.oilCardNo }}</p>
|
||||
<p>司机:{{ record.driver_name || '-' }} {{ record.mobile }}</p>
|
||||
<p>司机:{{ record.driver_name || '-' }} {{ record.mobile }}<a-tag v-if="record.source === 'mall'" class="ml-10">小程序订单</a-tag></p>
|
||||
<p>订单金额:¥{{ record.total_price }} 已加油:¥{{ record.used_amount || '0.00' }}({{ record.used_num || 0 }} 次)</p>
|
||||
<p>
|
||||
退款金额:<b class="amount">¥{{ refundAmount }}</b>
|
||||
@@ -28,7 +28,7 @@
|
||||
<a-alert type="info" show-icon class="block">
|
||||
<div slot="message">
|
||||
一张订单可以分多次加油,<b>退款金额固定为剩余未加油金额</b>,已加油的部分不退,每单只能成功退一次。
|
||||
<br>退款会先用企油通 7.17 查询司机支付凭证,再用 7.16 把凭证额度调低退款金额;成功后原路回补合作商余额,并推送油卡变动通知。
|
||||
<br>退款会先用企油通 7.17 查询司机支付凭证,再用 7.16 把凭证额度调低退款金额;成功后{{ backText }}。
|
||||
<br>额度在凭证上按司机累计,若凭证可用余额不足退款金额(被该司机其他订单用掉),会直接拒绝。
|
||||
</div>
|
||||
</a-alert>
|
||||
@@ -113,6 +113,12 @@ export default {
|
||||
statusColor () {
|
||||
return STATUS_COLOR[this.status] || ''
|
||||
},
|
||||
// 退款成功后钱退到哪里:合作商单回补合作商余额,小程序单退回下单用户余额
|
||||
backText () {
|
||||
return this.record.source === 'mall'
|
||||
? '把钱退回下单用户的账户余额(按实付金额折算),并同步订单状态到用户端'
|
||||
: '原路回补合作商余额,并推送油卡变动通知'
|
||||
},
|
||||
// 已退款显示实际退款金额;否则为剩余未加油金额(后端同口径计算)
|
||||
refundAmount () {
|
||||
if (this.status === 2) {
|
||||
|
||||
@@ -55,7 +55,23 @@
|
||||
<a-form-item label="消费回调地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="https://你的域名/qytconsume.php" v-decorator="['consume_notify_url']" />
|
||||
<div class="form-item-help">
|
||||
<p class="extra">此处仅作记录留档,实际生效需在企油通后台配置同一地址。</p>
|
||||
<p class="extra">企油通 7.10 加油明细推送。此处仅作记录留档,实际生效需在企油通后台配置同一地址。</p>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="发放结果通知地址" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-input placeholder="https://你的域名/qytwaybill.php" v-decorator="['waybill_notify_url']" />
|
||||
<div class="form-item-help">
|
||||
<p class="extra">企油通 3.10 发放结果通知(场景 scene=oil 运单油费下发)。同样需要在企油通后台配置同一地址才会生效。</p>
|
||||
</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="发放结果通知已生效" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-switch checked-children="开" un-checked-children="关" v-decorator="['waybill_notify', { valuePropName: 'checked' }]" />
|
||||
<div class="form-item-help">
|
||||
<p class="extra">
|
||||
确认企油通后台已配好上面的地址、并且能正常收到通知后再打开。
|
||||
打开后发放结果以推送为准,7.8 轮询退为安全网(间隔放长,只兜底漏推的单)。
|
||||
</p>
|
||||
<p class="extra warning-tip">对方还没配好就打开,分油结果会要等轮询才能拿到,反而变慢。</p>
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
@@ -127,6 +143,8 @@ export default {
|
||||
'h5_base_url': record.h5_base_url,
|
||||
'h5_app_id': record.h5_app_id,
|
||||
'consume_notify_url': record.consume_notify_url,
|
||||
'waybill_notify_url': record.waybill_notify_url,
|
||||
'waybill_notify': !!Number(record.waybill_notify),
|
||||
'log': !!Number(record.log)
|
||||
})
|
||||
})
|
||||
@@ -144,7 +162,7 @@ export default {
|
||||
// 提交到后端api
|
||||
onFormSubmit (values) {
|
||||
this.isLoading = true
|
||||
const form = { ...values, log: values.log ? 1 : 0 }
|
||||
const form = { ...values, log: values.log ? 1 : 0, waybill_notify: values.waybill_notify ? 1 : 0 }
|
||||
Api.update(this.key, { form })
|
||||
.then(result => {
|
||||
this.$message.success(result.message, 1.5)
|
||||
@@ -177,4 +195,7 @@ export default {
|
||||
.input-inst {
|
||||
width: 70%;
|
||||
}
|
||||
.warning-tip {
|
||||
color: #faad14;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user