|
@@ -1,6 +1,6 @@
|
|
|
<!--
|
|
<!--
|
|
|
销售单售后详情
|
|
销售单售后详情
|
|
|
- 用途:refundList 点进查看;样式对齐 ghs pagesOrder/refundDetail;含当天/隔天、原单付款、退回状态。
|
|
|
|
|
|
|
+ 用途:refundList / freeRefundList 点进查看;待审核的商城顾客申请可在本页通过/驳回。
|
|
|
-->
|
|
-->
|
|
|
<template>
|
|
<template>
|
|
|
<view class="refund-page">
|
|
<view class="refund-page">
|
|
@@ -15,7 +15,7 @@
|
|
|
<view class="refund-value">{{ refundTypeLabel }}</view>
|
|
<view class="refund-value">{{ refundTypeLabel }}</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view class="refund-section" v-if="!$util.isEmpty(itemList) || !$util.isEmpty(goodsList)">
|
|
|
|
|
|
|
+ <view class="refund-section" v-if="!$util.isEmpty(itemList) || !$util.isEmpty(goodsList) || showProductSnapshot">
|
|
|
<view class="refund-label refund-section__title">{{ isFreeRefund ? '花材明细' : '退货商品' }}</view>
|
|
<view class="refund-label refund-section__title">{{ isFreeRefund ? '花材明细' : '退货商品' }}</view>
|
|
|
<view class="refund-product-list">
|
|
<view class="refund-product-list">
|
|
|
<view class="refund-product-item" v-for="(res, i) in itemList" :key="'item-' + i">
|
|
<view class="refund-product-item" v-for="(res, i) in itemList" :key="'item-' + i">
|
|
@@ -28,6 +28,19 @@
|
|
|
{{ res.name }} ¥{{ parseFloat(res.unitPrice) }}×{{ res.num }}份=¥{{ parseFloat(res.price) }}
|
|
{{ res.name }} ¥{{ parseFloat(res.unitPrice) }}×{{ res.num }}份=¥{{ parseFloat(res.price) }}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <!-- 待审核尚未写明细行,用顾客勾选快照撑起商品 -->
|
|
|
|
|
+ <block v-if="showProductSnapshot">
|
|
|
|
|
+ <view
|
|
|
|
|
+ class="refund-product-item"
|
|
|
|
|
+ v-for="(p, idx) in productList"
|
|
|
|
|
+ :key="idx"
|
|
|
|
|
+ >
|
|
|
|
|
+ <view class="refund-product-item__name">
|
|
|
|
|
+ {{ p.name || ('商品' + p.productId) }}
|
|
|
|
|
+ ¥{{ parseFloat(p.unitPrice) || 0 }}×{{ p.num }}{{ p.unitName || (p.property == 0 ? '份' : '') }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </block>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -82,6 +95,11 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+ <view class="refund-row refund-row--top" v-if="Number(info.status) === 2 && !$util.isEmpty(info.rejectReason)">
|
|
|
|
|
+ <view class="refund-label">驳回原因</view>
|
|
|
|
|
+ <view class="refund-value refund-value--multiline">{{ info.rejectReason }}</view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<view class="refund-row refund-row--top" v-if="!$util.isEmpty(remark)">
|
|
<view class="refund-row refund-row--top" v-if="!$util.isEmpty(remark)">
|
|
|
<view class="refund-label">备注信息</view>
|
|
<view class="refund-label">备注信息</view>
|
|
|
<view class="refund-value refund-value--multiline">{{ remark }}</view>
|
|
<view class="refund-value refund-value--multiline">{{ remark }}</view>
|
|
@@ -89,6 +107,16 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="refund-actions">
|
|
<view class="refund-actions">
|
|
|
|
|
+ <button
|
|
|
|
|
+ v-if="canAudit"
|
|
|
|
|
+ class="admin-button-com big refund-actions__btn refund-actions__btn--pass"
|
|
|
|
|
+ @click="askPass"
|
|
|
|
|
+ >通过</button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ v-if="canAudit"
|
|
|
|
|
+ class="admin-button-com big refund-actions__btn refund-actions__btn--reject"
|
|
|
|
|
+ @click="openReject"
|
|
|
|
|
+ >驳回</button>
|
|
|
<button
|
|
<button
|
|
|
v-if="canFundAction"
|
|
v-if="canFundAction"
|
|
|
class="admin-button-com big blue refund-actions__btn"
|
|
class="admin-button-com big blue refund-actions__btn"
|
|
@@ -101,11 +129,27 @@
|
|
|
>查看凭证</button>
|
|
>查看凭证</button>
|
|
|
<button class="admin-button-com big default refund-actions__btn" @click="goBack">返回</button>
|
|
<button class="admin-button-com big default refund-actions__btn" @click="goBack">返回</button>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="reject-mask" v-if="showReject" @click="showReject = false">
|
|
|
|
|
+ <view class="refund-popup" @click.stop="">
|
|
|
|
|
+ <textarea
|
|
|
|
|
+ :value="rejectReason"
|
|
|
|
|
+ class="refund-popup__textarea"
|
|
|
|
|
+ placeholder="驳回原因..."
|
|
|
|
|
+ placeholder-class="tui-placeholder"
|
|
|
|
|
+ @input="onRejectInput"
|
|
|
|
|
+ />
|
|
|
|
|
+ <view class="refund-popup__btns">
|
|
|
|
|
+ <button class="admin-button-com big default refund-popup__btn" @click="showReject = false">取消</button>
|
|
|
|
|
+ <button class="admin-button-com big blue refund-popup__btn refund-popup__btn--confirm" @click="confirmReject">确认</button>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { refundDetail } from '@/api/refund/index'
|
|
|
|
|
|
|
+import { refundDetail, passRefund, rejectRefund } from '@/api/refund/index'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'orderRefundDetail',
|
|
name: 'orderRefundDetail',
|
|
@@ -114,9 +158,13 @@ export default {
|
|
|
info: {},
|
|
info: {},
|
|
|
itemList: [],
|
|
itemList: [],
|
|
|
goodsList: [],
|
|
goodsList: [],
|
|
|
|
|
+ productList: [],
|
|
|
refundPrice: 0,
|
|
refundPrice: 0,
|
|
|
refundType: 1,
|
|
refundType: 1,
|
|
|
- remark: ''
|
|
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ busy: false,
|
|
|
|
|
+ showReject: false,
|
|
|
|
|
+ rejectReason: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -175,6 +223,16 @@ export default {
|
|
|
/** 已通过且返充余额时可查看凭证 */
|
|
/** 已通过且返充余额时可查看凭证 */
|
|
|
canShowPoster() {
|
|
canShowPoster() {
|
|
|
return Number(this.info.status) === 1 && Number(this.info.returnBalance) === 1
|
|
return Number(this.info.status) === 1 && Number(this.info.returnBalance) === 1
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 待审核:商城顾客申请,超管可在本页通过/驳回 */
|
|
|
|
|
+ canAudit() {
|
|
|
|
|
+ return Number(this.info.status) === 0
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 待审核尚未生成明细行时,用 product JSON 快照展示勾选商品 */
|
|
|
|
|
+ showProductSnapshot() {
|
|
|
|
|
+ return this.$util.isEmpty(this.itemList)
|
|
|
|
|
+ && this.$util.isEmpty(this.goodsList)
|
|
|
|
|
+ && !this.$util.isEmpty(this.productList)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
@@ -191,6 +249,7 @@ export default {
|
|
|
this.info = info
|
|
this.info = info
|
|
|
this.itemList = res.data.itemList || []
|
|
this.itemList = res.data.itemList || []
|
|
|
this.goodsList = res.data.goodsList || []
|
|
this.goodsList = res.data.goodsList || []
|
|
|
|
|
+ this.productList = res.data.productList || []
|
|
|
this.refundType = info.refundType || 0
|
|
this.refundType = info.refundType || 0
|
|
|
this.refundPrice = info.refundPrice || 0
|
|
this.refundPrice = info.refundPrice || 0
|
|
|
this.remark = info.remark || res.data.remark || ''
|
|
this.remark = info.remark || res.data.remark || ''
|
|
@@ -206,6 +265,64 @@ export default {
|
|
|
goBack() {
|
|
goBack() {
|
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
|
},
|
|
},
|
|
|
|
|
+ onRejectInput(e) {
|
|
|
|
|
+ // textarea 不用 v-model,避免小程序编译 data-event-opts 问题
|
|
|
|
|
+ this.rejectReason = e.detail ? e.detail.value : e
|
|
|
|
|
+ },
|
|
|
|
|
+ openReject() {
|
|
|
|
|
+ this.showReject = true
|
|
|
|
|
+ },
|
|
|
|
|
+ askPass() {
|
|
|
|
|
+ if (this.busy) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$util.confirmModal(
|
|
|
|
|
+ { content: '确认通过并退款 ¥' + (parseFloat(this.info.refundPrice) || 0) + '?' },
|
|
|
|
|
+ () => {
|
|
|
|
|
+ this.doPass()
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ },
|
|
|
|
|
+ doPass() {
|
|
|
|
|
+ this.busy = true
|
|
|
|
|
+ uni.showLoading({ mask: true, title: '处理中' })
|
|
|
|
|
+ passRefund({ id: this.info.id }).then(res => {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ this.busy = false
|
|
|
|
|
+ if (res.code == 1) {
|
|
|
|
|
+ this.$msg(res.msg || '已通过')
|
|
|
|
|
+ this.init()
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ this.busy = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmReject() {
|
|
|
|
|
+ const reason = (this.rejectReason || '').trim()
|
|
|
|
|
+ if (!reason) {
|
|
|
|
|
+ this.$msg('请填写驳回原因')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.showReject = false
|
|
|
|
|
+ this.doReject(reason)
|
|
|
|
|
+ },
|
|
|
|
|
+ doReject(reason) {
|
|
|
|
|
+ this.busy = true
|
|
|
|
|
+ uni.showLoading({ mask: true })
|
|
|
|
|
+ rejectRefund({ id: this.info.id, rejectReason: reason }).then(res => {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ this.busy = false
|
|
|
|
|
+ if (res.code == 1) {
|
|
|
|
|
+ this.$msg(res.msg || '已驳回')
|
|
|
|
|
+ this.rejectReason = ''
|
|
|
|
|
+ this.init()
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
|
+ this.busy = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
/** 组装 forwardResult 所需参数 */
|
|
/** 组装 forwardResult 所需参数 */
|
|
|
buildForwardPayload(mode) {
|
|
buildForwardPayload(mode) {
|
|
|
const info = this.info || {}
|
|
const info = this.info || {}
|
|
@@ -376,6 +493,65 @@ export default {
|
|
|
& + & {
|
|
& + & {
|
|
|
margin-top: 20upx;
|
|
margin-top: 20upx;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ &--pass {
|
|
|
|
|
+ background-color: #19be6b;
|
|
|
|
|
+ border: 1upx solid #19be6b;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &--reject {
|
|
|
|
|
+ background-color: #fa3534;
|
|
|
|
|
+ border: 1upx solid #fa3534;
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.reject-mask {
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ background: rgba(0, 0, 0, 0.45);
|
|
|
|
|
+ z-index: 99;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.refund-popup {
|
|
|
|
|
+ width: 86%;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ border-radius: 16upx;
|
|
|
|
|
+ padding: 30upx;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+
|
|
|
|
|
+ &__textarea {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ border: 1upx solid #dcdfe6;
|
|
|
|
|
+ border-radius: 12upx;
|
|
|
|
|
+ height: 160upx;
|
|
|
|
|
+ padding: 16upx;
|
|
|
|
|
+ font-size: 28upx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &__btns {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ margin-top: 30upx;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &__btn {
|
|
|
|
|
+ width: 45%;
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+
|
|
|
|
|
+ &--confirm {
|
|
|
|
|
+ margin-left: 24upx;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|