Browse Source

add tid1523 refund login

master
刘嘉炜 7 months ago
parent
commit
57eeb47094
  1. 1
      src/components/end_billing_modal/end_billing_modal.vue
  2. 4
      src/components/timing_order/timing_order.vue
  3. 6
      src/pages.json
  4. 37
      src/subpackage/device/pages/order_details/order_details.vue
  5. 6
      src/subpackage/order/js/api.js
  6. 47
      src/subpackage/order/pages/curriculum/detail/detail.vue
  7. 54
      src/subpackage/order/pages/stored_value_card/detail/detail.vue
  8. 172
      src/subpackage/order/pages/timing/detail.vue
  9. 2
      src/utils/util.js

1
src/components/end_billing_modal/end_billing_modal.vue

@ -76,6 +76,7 @@ export default {
// setTimeout(()=>uni.navigateBack(),1200);
this.$emit('timeEndBtn');
})
.catch(util.hideLoad)
},
selectBtn(type){

4
src/components/timing_order/timing_order.vue

@ -80,8 +80,8 @@ export default {
// _query["stadium_id"] = orderInfo.stadium_id
// _query["order_no"] = orderInfo.order_no
// _query["order_type"] = 1
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}&order_type=1`
util.routeTo(`/subpackage/device/pages/order_details/order_details?${_str}`,'nT');
let _str = `stadium_id=${orderInfo.stadium_id || ''}&order_no=${orderInfo.order_no || ''}`
util.routeTo(`/subpackage/order/pages/timing/detail?${_str}`,'nT');
// this.$emit('orderDetailChange');
},
timeEndBtn(){

6
src/pages.json

@ -610,6 +610,12 @@
"style" : {
"navigationBarTitleText": "租球机订单详情"
}
},
{
"path": "pages/timing/detail",
"style" : {
"navigationBarTitleText": "计时订单详情"
}
}
]
},

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

@ -17,7 +17,6 @@
@click:refund="siteAndPeopleDetailRefund"
></reservation-people-detail>
</block>
<timing-detail :orderInfo="pageInfo" @completeBtn="completeBtn" @refreshPage="refreshPage" v-if="optionsQuery.order_type==1"></timing-detail>
<organize-detail :orderInfo="pageInfo" v-if="optionsQuery.order_type==10"></organize-detail>
<!-- 次卡订场退款弹窗 -->
@ -52,7 +51,6 @@
</template>
<script>
import timingDetail from '../../components/order/timing_detail/timing_detail.vue'
import reservationSiteDetail from '../../components/order/reservation_site_detail/reservation_site_detail.vue';
import reservationPeopleDetail from '../../components/order/reservation_people_detail/reservation_people_detail.vue';
import organizeDetail from '../../components/order/organize_detail/organize_detail.vue';
@ -64,7 +62,6 @@
import { mapState } from 'vuex';
export default {
components: {
'timing-detail': timingDetail,
'reservation-site-detail': reservationSiteDetail,
'reservation-people-detail': reservationPeopleDetail,
'organize-detail': organizeDetail,
@ -74,7 +71,6 @@
computed:{
titleName(){
let { optionsQuery } = this;
if(optionsQuery.order_type == 1)return '计时订单详情'; //PM: 2021/4/19
if(optionsQuery.order_type == 3)return '预约订单详情'; //PM: 2021/4/19
if(optionsQuery.order_type == 4)return '储值卡订单详情';
if(optionsQuery.order_type == 5)return '积分商城订单详情';
@ -199,7 +195,6 @@
this.okChange(); //
},
getApiUrl(type){
if(type == 1)return deviceApi.timeOrderDetail;
if(type == 3)return deviceApi.reservationDetail;
if(type == 10)return deviceApi.organizeOrderDetail;
@ -233,38 +228,6 @@
order_no: optionsQuery.order_no,
})
},
// -
completeBtn(){
let { pageInfo } = this
util.showModal({
title: '提示',
content: '是否确认完结订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm){
util.showLoad();
deviceServer.get({
url: deviceApi.timeOrderComplete, //
data: {
brand_id: pageInfo.brand_id,
order_no: pageInfo.order_no,
},
failMsg: '请求失败!'
})
.then(res=>{
util.hideLoad();
util.showNone('操作成功!');
this.refreshPage()
util.previousPageFunction({
fnName: 'refreshList',
query: { isLoad: false},
});
})
}
}
})
},
}
}
</script>

6
src/subpackage/order/js/api.js

@ -35,6 +35,12 @@ export const ORDER_API = {
rentballEndBilling:`${ORIGIN}/admin/stadium/rentball/order/end`, // 结束订单-后台
// 20220727
rentBallOrderDetails:`${ORIGIN}/admin/stadium/hardware/order/rentBallOrderDetails`, // 硬件管理-订单详情_copy
// 20240614 tid1523 统一退款
venueCourseOrderRefund:`${ORIGIN}/admin/venueCourse/orderRefund`, // 课程订单-退款
userValueCardRefundFixed:`${ORIGIN}/admin/userValueCard/refundFixed`, // 储值卡订单-退款
timeOrderDetail:`${ORIGIN}/admin/assistant/timeOrder/detail`, //k-订单管理-计时订单详情
timeOrderComplete:`${ORIGIN}/admin/assistant/timeOrder/complete`, //【20220208】k-订单管理-计时订单完结
orderRefund:`${ORIGIN}/admin/stadium/order/refund`, // A订单管理-场馆预订订单-订单退款
}
export default ORDER_API;

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

@ -121,10 +121,6 @@ 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;
@ -135,6 +131,8 @@ export default {
// (' 0- 1- 2- 3-退 4-')
components: {
'a-line': a_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
},
data(){
return {
@ -159,14 +157,32 @@ export default {
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,
// })
this.venueCourseOrderRefund({
order_no: orderInfo?.order_no ?? '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0
})
}
});
},
venueCourseOrderRefund({ order_no = '', amount = 0, integral = 0}){
util.showLoad();
server.get({
url: ORDER_API.venueCourseOrderRefund,
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.getInfo(order_no), 1200));
},
async getRefundTimes(order_no){
try{
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
@ -178,26 +194,19 @@ export default {
}
},
getInfo(order_no){
util.showLoad();
server.get({
url: ORDER_API.venueCourse_orderInfo,
data: { order_no },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad();
this.orderInfo = res || {};
})
.catch(util.hideLoad)
},
getPayType: util.order_pay_type_txt,
// getPayType(type){
// // [012, 3]
// let _obj = {
// 0: '',
// 1: '',
// 2: '',
// 3: '',
// }
// return _obj[type] || '-'
// }
}
}
</script>

54
src/subpackage/order/pages/stored_value_card/detail/detail.vue

@ -83,6 +83,16 @@
<view class="sl-txt"><text>退款原因</text>{{ e.reason || '-' }}</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>
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
@ -91,9 +101,13 @@ import s_line from '../../../components/s_line/s_line.vue';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import util from '../../../../../utils/util';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
import orderRefundModal from '@/components/order_refund/modal.vue';
export default {
components: {
's-line': s_line,
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
},
computed: {
cardInfo(){
@ -116,6 +130,46 @@ export default {
this.getOrderInfo({ order_no: options.order_no });
},
methods: {
refunndBtn(){
let { orderInfo } = this;
let _pay_amount = +orderInfo?.pay_amount || 0;
let _refund_amount = +orderInfo?.refund_amount || 0;
let _deduction_integral = +orderInfo?.deduction_integral || 0;
let _refund_integral = +orderInfo?.refund_integral || 0;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.stadium?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: _pay_amount - _refund_amount,
refundable_integral: _deduction_integral - _refund_integral,
refund_times: orderInfo?.refunds?.length || 0,
confirm: e => {
this.userValueCardRefundFixed({
order_no: orderInfo?.order_no ?? '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0
})
}
});
},
userValueCardRefundFixed({ order_no = '', amount = 0, integral = 0}){
util.showLoad();
server.get({
url: ORDER_API.userValueCardRefundFixed,
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.getOrderInfo({ order_no }), 1200));
},
payStatus(status){
if(status == 1)return '已付款';
if(status == 4)return '已退款';

172
src/subpackage/device/components/order/timing_detail/timing_detail.vue → src/subpackage/order/pages/timing/detail.vue

@ -68,6 +68,13 @@
</view>
<view class="td-btn" @click="isEndBill = true" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==false">结束计费</view>
<view class="td-btn" @click="completeBtn" v-if="orderInfo.pay_status == 0&&orderInfo.early_end_timing==true">完结订单</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>
<!-- 结束计费弹框 -->
<end-billing-modal
@ -76,25 +83,26 @@
@timeEndBtn="timeEndBtn"
:orderInfo="orderInfo"
></end-billing-modal>
<!-- 退款弹窗 -->
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
<script>
import util from '@/utils/util';
import deviceServer from '../../../js/device_server';
import deviceApi from '../../../js/device_api';
import { ORDER_API } from '../../js/api';
import server from '../../js/server';
import { mapState } from 'vuex';
import end_billing_modal from '../../../../../components/end_billing_modal/end_billing_modal.vue';
import end_billing_modal from '@/components/end_billing_modal/end_billing_modal.vue';
import orderRefundFixed from '@/components/order_refund/fixed.vue'
import orderRefundModal from '@/components/order_refund/modal.vue';
export default {
components: {
'end-billing-modal': end_billing_modal,
},
props: {
orderInfo: {
type: Object,
default: ()=>({})
}
'order-refund-fixed': orderRefundFixed,
'order-refund-modal': orderRefundModal,
},
computed: {
...mapState(['brandInfo']),
@ -110,38 +118,140 @@ export default {
return _obj[`${status}`] || '-'
}
},
zh_pay_type(){
// 012
return status =>{
const _obj = {
'0': '微信支付',
'1': '支付宝支付',
'2': '储值卡支付',
'3': '商家主动结束计费',
}
return _obj[`${status}`] || '-'
}
},
},
data() {
return {
isEndBill: false,
orderInfo: {},
refundTimes: -1, // 退
}
},
onLoad(options){
this.getOrderInfo({
order_no: options?.order_no || '',
stadium_id: options?.stadium_id || ''
})
this.getRefundTimes(options?.order_no || '');
},
methods: {
refunndBtn(){
let { orderInfo, refundTimes } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: orderInfo?.extension?.refundable_amount ?? 0,
refundable_integral: orderInfo?.extension?.refundable_integral ?? 0,
refund_times: refundTimes,
confirm: e => {
this.orderRefund({
order_no: orderInfo?.order_no || '',
amount: e.refund_amount || 0,
integral: e.refund_integral || 0,
stadium_id: orderInfo?.stadium_id || ''
})
}
});
},
orderRefund({ order_no = '', amount = 0, integral = 0, stadium_id = ''}){
util.showLoad();
server.get({
url: ORDER_API.orderRefund,
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.getOrderInfo({ order_no, stadium_id });
this.getRefundTimes(order_no);
}, 1200));
},
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);
}
},
getOrderInfo({ order_no, stadium_id }){
util.showLoad();
server.get({
url: ORDER_API.timeOrderDetail,
data: { order_no, stadium_id },
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
this.orderInfo = res || {}
})
.catch(util.hideLoad)
},
zh_pay_type: util.order_pay_type_txt,
completeBtn(){
this.$emit('completeBtn');
},
timeEndBtn(){
this.$emit('refreshPage');
let { orderInfo } = this;
this.getOrderInfo({
order_no: orderInfo?.order_no || '',
stadium_id: orderInfo?.stadium_id || ''
})
},
// -
completeBtn(){
let { orderInfo } = this
util.showModal({
title: '提示',
content: '是否确认完结订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm)this.timeOrderComplete({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || '',
stadium_id: orderInfo?.stadium_id || ''
})
}
})
},
//
timeOrderComplete({ brand_id, order_no, stadium_id }){
util.showLoad();
server.get({
url: ORDER_API.timeOrderComplete, //
data: { brand_id, order_no },
failMsg: '请求失败!'
})
.then(res=>{
util.hideLoad();
util.showNone('操作成功!');
setTimeout(_=>{
this.getOrderInfo({ order_no, stadium_id });
util.previousPageFunction({
fnName: 'refreshList',
query: { isLoad: false},
});
}, 1200)
})
.catch(util.hideLoad)
}
}
}
</script>
<style lang="scss" >
@import '~style/public.scss';
.timing-details{
margin-bottom: 24rpx;
.td-head{
@ -159,8 +269,6 @@ export default {
flex-shrink: 0;
width: 40rpx;
height: 40rpx;
background-color: skyblue;
}
>view{
flex-grow: 1;
@ -171,7 +279,7 @@ export default {
}
.th-line{
margin-top: 8rpx;
@include centerFlex(space-between);
@include ctf(space-between);
>view{
line-height: 40rpx;
font-size: 28rpx;
@ -186,7 +294,7 @@ export default {
color: #9A9A9D;
}
.tl-active{
color: #009874;
color: $mColor;
}
}
}
@ -218,7 +326,7 @@ export default {
border-top: 2rpx solid #D8D8D8;
.ts-line{
margin-top: 26rpx;
@include centerFlex(space-between);
@include ctf(space-between);
>view{
color: #333333;
&:first-child{
@ -232,7 +340,7 @@ export default {
}
.ts-total{
margin-top: 22rpx;
@include centerFlex(flex-end);
@include ctf(flex-end);
>view{
color: #333333;
font-size: 28rpx;
@ -252,9 +360,9 @@ export default {
}
.td-btn{
height: 112rpx;
margin: 80rpx 24rpx;
margin: 80rpx 24rpx 10upx;
border-radius: 10rpx;
background-color: #009874;
background-color: $mColor;
color: #FFF;
font-size: 32rpx;
line-height: 112rpx;

2
src/utils/util.js

@ -395,7 +395,7 @@ function order_pay_type_txt(status = ''){
0: '微信支付',
1: '支付宝支付',
2: '会员卡支付',
3: '商家主动',
3: '商家主动结束计费',
};
return _obj[status] || '-'
}

Loading…
Cancel
Save