Browse Source

add tid 1523 refund logic

master
刘嘉炜 7 months ago
parent
commit
6325ddbbfc
  1. 3
      src/store/index.js
  2. 1
      src/subpackage/order/js/api.js
  3. 397
      src/subpackage/order/pages/retail/detail/detail.vue
  4. 87
      src/subpackage/order/pages/ym_card/detail/detail.vue

3
src/store/index.js

@ -44,7 +44,8 @@ export default new Vuex.Store({
'1014': '储值卡管理',
'1015': '进场人数异常',
'1016': '系统工具',
'1017': '钱包提现'
'1017': '钱包提现',
'1018': '退款权限'
},
// 场地占用提交页面信息
occupyInfo: {

1
src/subpackage/order/js/api.js

@ -41,6 +41,7 @@ export const ORDER_API = {
timeOrderDetail:`${ORIGIN}/admin/assistant/timeOrder/detail`, //k-订单管理-计时订单详情
timeOrderComplete:`${ORIGIN}/admin/assistant/timeOrder/complete`, //【20220208】k-订单管理-计时订单完结
orderRefund:`${ORIGIN}/admin/stadium/order/refund`, // A订单管理-场馆预订订单-订单退款
userMonthlyCardRefundFixed:`${ORIGIN}/admin/userMonthlyCard/refundFixed`, // 年月卡订单-订单退款
}
export default ORDER_API;

397
src/subpackage/order/pages/retail/detail/detail.vue

@ -2,36 +2,36 @@
<view class="retail-container">
<view class="rc-header">
<view class="ra-header">
<image mode="aspectFit" src="/static/images/icon/retail/storeIcon.png"></image>
<text>{{ orderInfo.stadium_name || '-' }}</text>
<view></view>
</view>
<view class="rh-name">
<view class="rh-name-line">
<view>
<view>微信昵称</view>
<text>{{ orderInfo.nickname || '-' }}</text>
</view>
<view :style="{color:getStatus(orderInfo.pay_status)==='已退款'?'#EA5061':'#9C9C9F'}">{{ getStatus(orderInfo.pay_status) }}</view>
</view>
<view class="rh-name-line">
<view>
<view>手机号码</view>
<text>{{ orderInfo.mobile || '-' }}</text>
</view>
</view>
<!-- <view class="rh-name-line">
<view>
<view>身份</view>
<text>{{ orderInfo.sys_optuname || '-' }}</text>
</view>
</view> -->
<view class="rh-name-line">
<view>
<view>下单途径</view>
<text>{{ orderInfo.retail_source || '-' }}</text>
</view>
</view>
<image mode="aspectFit" src="/static/images/icon/retail/storeIcon.png"></image>
<text>{{ orderInfo.stadium_name || '-' }}</text>
<view></view>
</view>
<view class="rh-name">
<view class="rh-name-line">
<view>
<view>微信昵称</view>
<text>{{ orderInfo.nickname || '-' }}</text>
</view>
<view :style="{color:getStatus(orderInfo.pay_status)==='已退款'?'#EA5061':'#9C9C9F'}">{{ getStatus(orderInfo.pay_status) }}</view>
</view>
<view class="rh-name-line">
<view>
<view>手机号码</view>
<text>{{ orderInfo.mobile || '-' }}</text>
</view>
</view>
<!-- <view class="rh-name-line">
<view>
<view>身份</view>
<text>{{ orderInfo.sys_optuname || '-' }}</text>
</view>
</view> -->
<view class="rh-name-line">
<view>
<view>下单途径</view>
<text>{{ orderInfo.retail_source || '-' }}</text>
</view>
</view>
</view>
</view>
<view class="rc-goods-info" v-if="orderInfo.retail_order_goods&&orderInfo.retail_order_goods.length">
@ -39,37 +39,37 @@
<view class="rgi-goods-ls">
<view class="rgl-item" v-for="(e, i) in orderInfo.retail_order_goods" :key="i">
<view class="rgl-item-desc">
<view>{{ e.erp_retail_goods ? (e.erp_retail_goods.goods_name || '-') : (e.name || '-') }}</view>
<view>{{ e.price || 0 }}</view>
</view>
<view class="rgl-item-sku">sku{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_sku : '-') : '-' }}</view>
<view class="rgl-item-type-spec">
<view>型号{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_type : '-') : '-' }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规格{{ e.spec || '-' }}</view>
<text>x{{ e.nums || 0 }}</text>
</view>
<view v-if="orderInfo.retail_order_goods.length - 1 == i ? false : true" class="rgl-item-bottom-line"></view>
<view>{{ e.erp_retail_goods ? (e.erp_retail_goods.goods_name || '-') : (e.name || '-') }}</view>
<view>{{ e.price || 0 }}</view>
</view>
<view class="rgl-item-sku">sku{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_sku : '-') : '-' }}</view>
<view class="rgl-item-type-spec">
<view>型号{{ e.erp_retail_goods ? (e.erp_retail_goods.erp_goods ? e.erp_retail_goods.erp_goods.erp_goods_type : '-') : '-' }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;规格{{ e.spec || '-' }}</view>
<text>x{{ e.nums || 0 }}</text>
</view>
<view v-if="orderInfo.retail_order_goods.length - 1 == i ? false : true" class="rgl-item-bottom-line"></view>
</view>
</view>
</view>
<view class="rc-total-amount-info">
<view class="rc-total-amount-line">
<view>金额小计</view>
<text>{{ orderInfo.amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>积分抵扣</view>
<text>{{ orderInfo.deduction_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>折扣金额</view>
<text>-{{ orderInfo.discount_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>优惠券优惠</view>
<text>-{{ orderInfo.coupons_amount || 0 }}</text>
</view>
<view class="rgi-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</view>
<view class="rc-total-amount-info">
<view class="rc-total-amount-line">
<view>金额小计</view>
<text>{{ orderInfo.amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>积分抵扣</view>
<text>{{ orderInfo.deduction_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>折扣金额</view>
<text>-{{ orderInfo.discount_amount || 0 }}</text>
</view>
<view class="rc-total-amount-line">
<view>优惠券优惠</view>
<text>-{{ orderInfo.coupons_amount || 0 }}</text>
</view>
<view class="rgi-total"><text>合计支付</text>{{ orderInfo.pay_amount || 0 }}</view>
</view>
<view class="rc-pay-info">
<!-- 订单编号 -->
<view class="rpi-tit">支付详情</view>
@ -78,33 +78,44 @@
<p-line :keyname="'支付方式'" :value="orderInfo.extension ? orderInfo.extension.pay_type_text || '-' : '-'"></p-line>
<p-line :keyname="'支付时间'" :value="orderInfo.pay_time || '-'"></p-line>
</view>
<!-- <view v-if="orderInfo.refunds&&orderInfo.refunds.length">
<view class="rc-refund-info" v-for="(item, index) in orderInfo.refunds" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="item.refund_amount ? '¥' + item.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.refund_reason || '-'"></p-line>
</view>
</view> -->
<!-- <view v-if="orderInfo.refund_no">
<view class="rc-refund-info">
<view class="rpi-tit">退款信息</view>
<p-line :keyname="'退款金额:'" :value="orderInfo.refund_amount ? '¥' + orderInfo.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="orderInfo.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="orderInfo.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="orderInfo.refund_reason || '商家主动退款'"></p-line>
</view>
</view> -->
<view v-if="refundList.length">
<view class="rc-refund-info" v-for="(item, index) in refundList" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="`¥${item.amount}`"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.reason || '商家主动退款'"></p-line>
</view>
</view>
<!-- <view v-if="orderInfo.refunds&&orderInfo.refunds.length">
<view class="rc-refund-info" v-for="(item, index) in orderInfo.refunds" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="item.refund_amount ? '¥' + item.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.refund_reason || '-'"></p-line>
</view>
</view> -->
<!-- <view v-if="orderInfo.refund_no">
<view class="rc-refund-info">
<view class="rpi-tit">退款信息</view>
<p-line :keyname="'退款金额:'" :value="orderInfo.refund_amount ? '¥' + orderInfo.refund_amount : '¥0'"></p-line>
<p-line :keyname="'退款单号:'" :value="orderInfo.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="orderInfo.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="orderInfo.refund_reason || '商家主动退款'"></p-line>
</view>
</view> -->
<view v-if="refundList.length">
<view class="rc-refund-info" v-for="(item, index) in refundList" :key="index">
<view class="rpi-tit">退款信息{{ index + 1 }}</view>
<p-line :keyname="'退款金额:'" :value="`¥${item.amount}`"></p-line>
<p-line :keyname="'退款单号:'" :value="item.refund_no || '-'"></p-line>
<p-line :keyname="'退款时间:'" :value="item.refund_time || '-'"></p-line>
<p-line :keyname="'退款原因:'" :value="item.reason || '商家主动退款'"></p-line>
</view>
</view>
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="refundList&&refundList.length"
@click:button="refunndBtn"
></order-refund-fixed>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
@ -114,16 +125,20 @@ import server from '../../../js/server';
import util from '../../../../../utils/util';
import s_line from '../../../components/s_line/s_line.vue';
import p_line from '../../../components/p_line/p_line.vue';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
import orderRefundModal from '@/components/order_refund/modal.vue';
import { mapState } from 'vuex';
export default {
components: {
's-line': s_line,
'p-line': p_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
},
data(){
return {
orderInfo: {},
refundList: []
refundList: []
}
},
computed:{
@ -133,17 +148,35 @@ export default {
this.getOrderInfo(options.order_no);
},
methods: {
refunndBtn(){
let { orderInfo, refundList } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.refundList ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.refundList ?? '',
refundable_amount: orderInfo?.extension?.refundable_amount ?? 0,
refundable_integral: orderInfo?.extension?.refundable_integral ?? 0,
refund_times: refundList?.length || 0,
confirm: e => {
// this.venueCourseOrderRefund({
// order_no: orderInfo?.order_no ?? '',
// amount: e.refund_amount || 0,
// integral: e.refund_integral || 0
// })
}
});
},
// payTypeTxt: util.order_pay_type_txt,
payTypeTxt(payType, cardNo) {
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: `储值卡支付 ${cardNo ? '(' + cardNo + ')' : ''}`,
3: '现金支付',
4: '其他'
};
return _obj[payType] || '-'
},
payTypeTxt(payType, cardNo) {
let _obj = {
0: '微信支付',
1: '支付宝支付',
2: `储值卡支付 ${cardNo ? '(' + cardNo + ')' : ''}`,
3: '现金支付',
4: '其他'
};
return _obj[payType] || '-'
},
getStatus(status){
let _obj = {
1: '交易成功',
@ -160,19 +193,19 @@ export default {
})
.then(res=>{
this.orderInfo = res || {};
// this.orderInfo.refunds = [
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason },
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason }
// ];
server.get({
url: ORDER_API.retailOrderInfoRefundList,
data: { order_no, brand_id: this.brandInfo.brand.id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.refundList = res.list;
});
// this.orderInfo.refunds = [
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason },
// { refund_amount: this.orderInfo.refund_amount, refund_no: this.orderInfo.refund_no, refund_time: this.orderInfo.refund_time, refund_reason: this.orderInfo.refund_reason }
// ];
server.get({
url: ORDER_API.retailOrderInfoRefundList,
data: { order_no, brand_id: this.brandInfo.brand.id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.refundList = res?.list || [];
});
});
},
@ -189,57 +222,57 @@ export default {
margin-bottom: 26upx;
padding: 0 24upx;
background-color: #fff;
.ra-header {
position: relative;
padding: 30upx 0;
@include centerFlex(flex-start);
>image {
width: 32upx;
height: 30upx;
margin-right: 14upx;
}
>text {
font-size: 28upx;
font-weight: 500;
color: #1A1A1A;
.ra-header {
position: relative;
padding: 30upx 0;
@include centerFlex(flex-start);
>image {
width: 32upx;
height: 30upx;
margin-right: 14upx;
}
>text {
font-size: 28upx;
font-weight: 500;
color: #1A1A1A;
}
>view {
position: absolute;
bottom: 0%;
width: 100%;
height: 2upx;
background-color: #D8D8D8;
}
}
.rh-name{
padding: 18upx 0;
.rh-name-line {
@include centerFlex(space-between);
font-size: 28upx;
font-weight: 400;
margin-bottom: 10upx;
>view {
&:first-child {
color: #9C9C9F;
@include centerFlex(flex-start);
flex-grow: 1;
>view {
width: 152upx;
flex-shrink: 0;
}
>text {
color: #1A1A1A;
@include textHide(1);
}
}
>view {
position: absolute;
bottom: 0%;
width: 100%;
height: 2upx;
background-color: #D8D8D8;
&:nth-child(2) {
flex-shrink: 0;
}
}
.rh-name{
padding: 18upx 0;
.rh-name-line {
@include centerFlex(space-between);
font-size: 28upx;
font-weight: 400;
margin-bottom: 10upx;
>view {
&:first-child {
color: #9C9C9F;
@include centerFlex(flex-start);
flex-grow: 1;
>view {
width: 152upx;
flex-shrink: 0;
}
>text {
color: #1A1A1A;
@include textHide(1);
}
}
&:nth-child(2) {
flex-shrink: 0;
}
}
}
}
}
}
.rc-goods-info{
@ -256,32 +289,32 @@ export default {
.rgl-item{
padding-top: 30upx;
// border-bottom: 2upx solid #D8D8D8;
color: #9C9C9F;
font-size: 28upx;
.rgl-item-desc {
display: flex;
justify-content: space-between;
margin-bottom: 20upx;
color: #1A1A1A;
}
.rgl-item-sku {
margin-bottom: 10upx;
}
.rgl-item-type-spec {
display: flex;
justify-content: space-between;
align-items: flex-end;
>text {
color: #1A1A1A;
}
}
.rgl-item-bottom-line {
width: 100%;
height: 2upx;
background-color: #D8D8D8;
margin-top: 18upx;
}
color: #9C9C9F;
font-size: 28upx;
.rgl-item-desc {
display: flex;
justify-content: space-between;
margin-bottom: 20upx;
color: #1A1A1A;
}
.rgl-item-sku {
margin-bottom: 10upx;
}
.rgl-item-type-spec {
display: flex;
justify-content: space-between;
align-items: flex-end;
>text {
color: #1A1A1A;
}
}
.rgl-item-bottom-line {
width: 100%;
height: 2upx;
background-color: #D8D8D8;
margin-top: 18upx;
}
}
}
}

87
src/subpackage/order/pages/ym_card/detail/detail.vue

@ -54,6 +54,17 @@
</view>
</view>
<order-refund-fixed
:pay_amount="1"
:refund_amount="0"
:refund_times="0"
@click:button="refunndBtn"
></order-refund-fixed>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
@ -67,6 +78,8 @@
import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import s_line from '../../../components/s_line/s_line.vue';
import p_line from '../../../components/p_line/p_line.vue';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
import orderRefundModal from '@/components/order_refund/modal.vue';
import util from '../../../../../utils/util';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
@ -75,7 +88,13 @@ export default {
'a-line': a_line,
's-line': s_line,
'p-line': p_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
},
computed: {
_extension(){
return this.orderInfo?.extension || {}
}
},
data(){
return {
@ -84,16 +103,70 @@ export default {
extension: {}
},
optionsQuery: {},
refundInfo: {}
}
},
onLoad(options){
this.getCardInfo({
id: options.id,
card_no: options.card_no
});
this.optionsQuery = options || {};
})
.then(res=>{
if(res.order_no)this.getRefundInfo(res.order_no || '');
})
},
methods: {
refunndBtn(){
let { orderInfo, _extension } = this;
this.$refs.orderRefundModal.show({
stadium_name: _extension?.name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: +_extension?.pay_amount || 0,
refundable_integral: 0,
refund_times: 0,
confirm: e => {
this.userMonthlyCardRefundFixed({
order_no: orderInfo?.order_no || '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0
});
}
});
},
async getRefundInfo(order_no){
try{
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
console.log('refundRes', _refundRes);
}catch(err){
console.warn('getRefundTimes err', err);
}
},
// -退
userMonthlyCardRefundFixed({ order_no = '', amount = 0, integral = 0 }){
util.showLoad();
server.get({
url: ORDER_API.userMonthlyCardRefundFixed,
data: { order_no, amount, integral },
isDefaultGet: false
})
.then(res=>{
util.hideLoad();
if(res.data.code == 0){
util.showNone(res.data.message || '操作成功!');
}else{
util.showNone(res.data.message || '操作失败!');
}
})
.catch(util.hideLoad)
.finally(_=>setTimeout(_=>this.getCardInfo({
id: this.optionsQuery?.id,
card_no: this.optionsQuery?.card_no
}), 1200));
},
previewImg(url){
if(!url)return
uni.previewImage({ urls: [ url ] });
@ -166,14 +239,18 @@ export default {
},
getCardInfo({id, card_no}){
util.showLoad();
server.get({
return server.get({
url: ORDER_API.userMonthlyCardInfo,
data: { id, card_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.orderInfo = res || {};
return this.orderInfo = res || {};
})
.catch(err=>{
util.hideLoad();
console.warn('getCardInfo err', err);
})
},
toRecord(){

Loading…
Cancel
Save