Browse Source

add tid1523 refund logic

master
刘嘉炜 7 months ago
parent
commit
606e8dd78c
  1. 28
      src/components/order_refund/fixed.vue
  2. 3
      src/components/order_refund/modal.vue
  3. 1
      src/js/api.js
  4. 8
      src/store/actions.js
  5. 16
      src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue
  6. 8
      src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue
  7. 9
      src/subpackage/device/pages/order_details/order_details.vue
  8. 47
      src/subpackage/order/pages/curriculum/detail/detail.vue

28
src/components/order_refund/fixed.vue

@ -1,5 +1,5 @@
<template>
<fixed-bar>
<fixed-bar v-if="isShow">
<view class="order-refund-fixed">
<or-button @click="$emit('click:button')"></or-button>
</view>
@ -9,11 +9,35 @@
<script>
import fixedBar from "../fixed_bar/fixed_bar.vue";
import orButton from "./button.vue";
/**
* 全部订单都能退两次, 所有订单最多只能退2次款
* 只要订单金额是未全退的都能退
* 0元订单不能退
*
*/
export default {
components: {
fixedBar,
orButton
}
},
props: [ 'pay_amount', 'refund_amount', 'refund_times' ],
computed: {
payAmount(){
let { pay_amount } = this;
return +pay_amount || 0
},
refundAmount(){
let { refund_amount } = this;
return +refund_amount || 0
},
isShow(){
let { payAmount, refundAmount, refund_times } = this;
if(payAmount - refundAmount > 0 && [0, 1].includes(refund_times)){
return true
}
return false
}
},
}
</script>

3
src/components/order_refund/modal.vue

@ -57,6 +57,8 @@
<script>
/**
* PM:
* 什么状态下都能退
* 全部订单都能退两次, 所有订单最多只能退2次款
* 只要订单金额是未全退的都能退
* 0元订单不能退
@ -107,6 +109,7 @@ export default {
this.$emit('click:confirm');
this.refundInfo?.confirm?.(iptInfo);
this.hide();
}
}
}

1
src/js/api.js

@ -152,6 +152,7 @@ API['writeOff'] = {
API['order'] = {
reservationDetail:`${ORIGIN}/admin/assistant/stadiumOrder/detail`, //k-订单管理-场馆预约订单-预约场馆订单详情/ 次卡订单详情
sessionVerify:`${ORIGIN}/admin/person/number/rule/orderinfo/sessionVerify`, // 次票核销,输入二维码数量核销
orderRefundList:`${ORIGIN}/admin/stadium/order/refundList`, // 硬件管理(所有的订单)-退款信息列表(包括预订,计时)
}
// 20240325 后台功能迁移到小程序端

8
src/store/actions.js

@ -13,5 +13,13 @@ export default {
commit('setBrandInfo',res);
return res;
})
},
getOrderRefundList({commit, state}, order_no){
return servers.get({
url: API.order.orderRefundList,
data: { order_no },
isDefaultGet: false
})
}
}

16
src/subpackage/device/components/order/reservation_people_detail/reservation_people_detail.vue

@ -161,6 +161,14 @@
<view>微信交易号<text>{{orderInfo.trade_no || ''}}</text></view>
</view>
</view>
<!-- 退款按钮 -->
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="(orderInfo.refunds&&orderInfo.refunds.length) || 0"
@click:button="refunndBtn"
></order-refund-fixed>
<!-- 弹框 绑定ic卡 -->
<view class="ox-dark-mask" v-if="isShowBindIC" @touchmove.stop.prevent="moveHandle">
<view class="odm-ic-modal">
@ -237,7 +245,11 @@ import util from '@/utils/util';
import deviceServer from '../../../js/device_server';
import deviceApi from '../../../js/device_api';
import { mapState } from 'vuex';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
export default {
components: {
'order-refund-fixed': orderRefundFixed
},
props: {
orderInfo: {
type: Object,
@ -592,6 +604,10 @@ export default {
this.isShowSuccessIC = !this.isShowSuccessIC
this.$emit('okChange');
},
refunndBtn(){
// this.$emit('refundbtn');
this.$emit('click:refund');
}
}
}

8
src/subpackage/device/components/order/reservation_site_detail/reservation_site_detail.vue

@ -135,8 +135,12 @@
</view>
</view>
<!-- 2022/01/04 PM: 禁用退款功能 -->
<order-refund-fixed @click:button="refunndBtn"></order-refund-fixed>
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="(orderInfo.refunds&&orderInfo.refunds.length) || 0"
@click:button="refunndBtn"
></order-refund-fixed>
</view>
</template>

9
src/subpackage/device/pages/order_details/order_details.vue

@ -6,7 +6,7 @@
v-if="pageInfo.order_type == 0"
:orderInfo="pageInfo"
@refundbtn='refundBtn'
@click:refund="siteDetailRefund"
@click:refund="siteAndPeopleDetailRefund"
></reservation-site-detail>
<reservation-people-detail
v-if="pageInfo.order_type == 1"
@ -14,6 +14,7 @@
@recoverBtn="peopleRecoverBtn"
@okChange="okChange"
@verify="verifyBtn"
@click:refund="siteAndPeopleDetailRefund"
></reservation-people-detail>
</block>
<timing-detail :orderInfo="pageInfo" @completeBtn="completeBtn" @refreshPage="refreshPage" v-if="optionsQuery.order_type==1"></timing-detail>
@ -56,7 +57,7 @@
import reservationPeopleDetail from '../../components/order/reservation_people_detail/reservation_people_detail.vue';
import organizeDetail from '../../components/order/organize_detail/organize_detail.vue';
import ticket_check from '../../../../components/order_list/modal/ticket_check.vue';
import orderRefundModal from '../../../../components/order_refund_modal/index.vue';
import orderRefundModal from '../../../../components/order_refund/modal.vue';
import util from '../../../../utils/util';
import deviceServer from '../../js/device_server';
import deviceApi from '../../js/device_api';
@ -110,8 +111,8 @@
})
},
methods: {
// -退
siteDetailRefund(){
// /-退
siteAndPeopleDetailRefund(){
let { pageInfo } = this;
this.$refs.orderRefundModal.show({
stadium_name: pageInfo?.stadium_name ?? '',

47
src/subpackage/order/pages/curriculum/detail/detail.vue

@ -100,7 +100,16 @@
</view>
<order-refund-fixed
:pay_amount="orderInfo.pay_amount || 0"
:refund_amount="orderInfo.refund_amount || 0"
:refund_times="refundTimes"
@click:button="refunndBtn"
></order-refund-fixed>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
@ -109,7 +118,13 @@ import a_line from '../../../../../components/order_list/a_line/a_line.vue';
import util from '../../../../../utils/util';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
import orderRefundModal from '@/components/order_refund/modal.vue';
export default {
components: {
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
},
computed: {
course_period_nums_give(){
let { orderInfo } = this;
@ -125,13 +140,43 @@ export default {
return {
orderInfo: {
user_info: {}
}
},
refundTimes: -1, // 退
}
},
onLoad(options){
this.getInfo(options.order_no);
this.getRefundTimes(options.order_no);
},
methods: {
refunndBtn(){
let { orderInfo, refundTimes } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.extension?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.student_phone ?? '',
refundable_amount: orderInfo?.extension?.refundable_amount ?? 0,
refundable_integral: orderInfo?.extension?.refundable_integral ?? 0,
refund_times: refundTimes,
confirm: e => {
// this.siteAndPeopleRefund({
// order_no: pageInfo?.order_no ?? '',
// amount: e?.refund_amount || 0,
// integral: e?.refund_integral || 0,
// })
}
});
},
async getRefundTimes(order_no){
try{
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
let _refundLs = _refundRes?.data?.data?.list || [];
this.refundTimes = _refundLs.length;
console.log('refundRes', _refundRes);
}catch(err){
console.warn('getRefundTimes err', err);
}
},
getInfo(order_no){
server.get({
url: ORDER_API.venueCourse_orderInfo,

Loading…
Cancel
Save