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. 35
      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;

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

@ -105,6 +105,17 @@
<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,11 +125,15 @@ 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 {
@ -133,6 +148,24 @@ 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 = {
@ -171,7 +204,7 @@ export default {
})
.then(res=>{
util.hideLoad();
this.refundList = res.list;
this.refundList = res?.list || [];
});
});
},

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