Browse Source

finish tid1553

tid1731
刘嘉炜 5 months ago
parent
commit
01fca612a7
  1. 2
      package.json
  2. 2
      src/components/fixed_bar/fixed_bar.vue
  3. 7
      src/components/order_refund/modal.vue
  4. 49
      src/components/order_refund/permission_btn.vue
  5. 6
      src/pages.json
  6. 3
      src/store/actions.js
  7. 2
      src/subpackage/order/components/order_list/header.vue
  8. 2
      src/subpackage/order/js/api.js
  9. 18
      src/subpackage/order/pages/order_manage/order_manage.vue
  10. 23
      src/subpackage/order/pages/timekeeping/modules/order_detail/bf_button.vue
  11. 37
      src/subpackage/order/pages/timekeeping/modules/order_detail/bottom_fixed.vue
  12. 23
      src/subpackage/order/pages/timekeeping/modules/order_detail/fixed_button.vue
  13. 8
      src/subpackage/order/pages/timekeeping/modules/order_list/site.vue
  14. 62
      src/subpackage/order/pages/timekeeping/modules/order_search/search_bar.vue
  15. 126
      src/subpackage/order/pages/timekeeping/order_detail/common.js
  16. 108
      src/subpackage/order/pages/timekeeping/order_detail/deposit.vue
  17. 186
      src/subpackage/order/pages/timekeeping/order_detail/person.vue
  18. 212
      src/subpackage/order/pages/timekeeping/order_detail/site.vue
  19. 44
      src/subpackage/order/pages/timekeeping/order_list.vue
  20. 132
      src/subpackage/order/pages/timekeeping/order_search.vue
  21. BIN
      src/subpackage/order/static/images/round_close.png
  22. 20023
      yarn.lock

2
package.json

@ -66,7 +66,7 @@
"flyio": "^0.6.2",
"pinyin-engine": "^1.2.2",
"regenerator-runtime": "^0.12.1",
"sass": "^1.63.3",
"sass": "1.63.3",
"vue": "^2.6.11"
},
"devDependencies": {

2
src/components/fixed_bar/fixed_bar.vue

@ -28,8 +28,8 @@ export default {
}
.fb-fixed{
padding-top: 20upx;
position: fixed;
padding-top: 20upx;
bottom: 0;
left: 0;
width: 100%;

7
src/components/order_refund/modal.vue

@ -94,7 +94,7 @@ export default {
methods: {
show(initData){
let { brandInfo } = this;
if(brandInfo?.permission?.['1018']){
if(!brandInfo?.permission?.['1018']){
this.isShow = true;
this.init(initData);
}else{
@ -121,7 +121,10 @@ export default {
let { iptInfo, refundInfo } = this;
this.$emit('click:confirm');
this.refundInfo?.confirm?.(iptInfo);
this.refundInfo?.confirm?.({
refund_amount: +iptInfo?.refund_amount || 0,
refund_integral: +iptInfo?.refund_integral || 0
});
this.hide();
}
}

49
src/components/order_refund/permission_btn.vue

@ -0,0 +1,49 @@
<template>
<view class="permissinon-btn">
<or-button v-if="isShow" @click="$emit('click:button')"><slot>退款</slot></or-button>
</view>
</template>
<script>
import orButton from "./button.vue";
import { mapState } from 'vuex';
/**
* 全部订单都能退两次, 所有订单最多只能退2次款
* 只要订单金额是未全退的都能退
* 0元订单不能退
*
*/
export default {
components: {
orButton
},
props: [ 'pay_amount', 'refund_amount', 'refund_times' ],
computed: {
...mapState([ 'brandInfo' ]),
payAmount(){
let { pay_amount } = this;
return +pay_amount || 0
},
refundAmount(){
let { refund_amount } = this;
return +refund_amount || 0
},
isShow(){
let { payAmount, refundAmount, refund_times, brandInfo } = this;
console.log('brandInfo', payAmount, refundAmount, refund_times, brandInfo)
if(
payAmount - refundAmount > 0
&&[0, 1].includes(refund_times)
// &&brandInfo?.permission?.['1018'] // 退
){
return true
}
return false
}
},
}
</script>
<style>
</style>

6
src/pages.json

@ -486,6 +486,12 @@
}
},
{
"path": "pages/timekeeping/order_search",
"style" : {
"navigationBarTitleText": "订单搜索"
}
},
{
"path": "pages/timekeeping/order_list",
"style" : {
"navigationBarTitleText": "计时订单"

3
src/store/actions.js

@ -21,5 +21,8 @@ export default {
data: { order_no },
isDefaultGet: false
})
.catch(err=>{
console.warn('actions getOrderRefundList err -->', err);
})
}
}

2
src/subpackage/order/components/order_list/header.vue

@ -17,7 +17,7 @@
<text>成功交易{{ successCount || 0 }}退款{{ refundCount || 0 }}</text>
</view>
<view class="ob-btns">
<image class="ob-icon" src="../../static/images/search.png"></image>
<image @click="$emit('click:search')" class="ob-icon" src="../../static/images/search.png"></image>
<image @click="$emit('click:filter')" class="ob-icon" src="../../static/images/filter.png"></image>
</view>
</view>

2
src/subpackage/order/js/api.js

@ -42,6 +42,8 @@ export const ORDER_API = {
billingOrderDetail: `${ORIGIN}/admin/stadium/billing/order/detail`, // 散客计时订单详情
timeOrderEnd: `${ORIGIN}/admin/assistant/timeOrder/end`, //k-订单管理-订单计时结束
timeOrderComplete:`${ORIGIN}/admin/assistant/timeOrder/complete`, //【20220208】k-订单管理-计时订单完结
subscribeCancel:`${ORIGIN}/admin/stadium/billing/order/subscribeCancel`, //【1000969】取消场时预约订单
// 20240614 tid1523 统一退款
venueCourseOrderRefund:`${ORIGIN}/admin/venueCourse/orderRefund`, // 课程订单-退款
userValueCardRefundFixed:`${ORIGIN}/admin/userValueCard/refundFixed`, // 储值卡订单-退款

18
src/subpackage/order/pages/order_manage/order_manage.vue

@ -15,19 +15,29 @@
</template>
<script>
import util from '../../../../utils/util'
import util from '../../../../utils/util';
import { mapState } from 'vuex';
export default {
data(){
return {
tabList: getTabList()
}
},
computed: {
...mapState([ 'brandInfo' ])
},
methods: {
getIconPath(iconName){
return `../../static/images/order_manage/${iconName}.png`
},
tabClick(ele){
let { brandInfo } = this;
if(!this.isFinish(ele.key))return util.showNone('待开放中!');
// 20240813 tid1553
if([22, 23].includes(ele.key)){
let _qryStr = `order_type=${ele.orderType}&brand_id=${brandInfo?.brand?.id || ''}`;
util.routeTo(`/subpackage/order/pages/timekeeping/order_list?${_qryStr}`, 'nT');
}
if(ele.orderType === 3){ // &
let _type = ele.key - 1; // 0 -> / 1 ->
@ -38,7 +48,7 @@ export default {
util.routeTo(getTabRoutePath() + `?order_type=${ele.orderType}`,'nT');
},
isFinish(key){
let _endKeyArr = [ 1, 2, 3, 4, 5, 7, 9, 10, 14, 16, 15, 13, 6, 8, 11, 12, 18, 19, 22];
let _endKeyArr = [ 1, 2, 3, 4, 5, 7, 9, 10, 14, 16, 15, 13, 6, 8, 11, 12, 18, 19, 22, 23];
return _endKeyArr.includes(key);
}
}
@ -66,8 +76,8 @@ function getTabList(){
{ id: 8, name: '商城订单', key: 8, iconName: 'order_4', orderType: 2 },
{ id: 9, name: '积分兑换订单', key: 9, iconName: 'order_5', orderType: 5 },
{ id: 9, name: '零售订单', key: 18, iconName: 'order_18', orderType: 19 },
{ id: 11, name: '散客计时订单', key: 22, iconName: 'order_22', orderType: 22 },
{ id: 12, name: '场地计时订单', key: 23, iconName: 'order_23', orderType: 23 },
{ id: 11, name: '散客计时订单', key: 22, iconName: 'order_22', orderType: 2 },
{ id: 12, name: '场地计时订单', key: 23, iconName: 'order_23', orderType: 1 },
]
}

23
src/subpackage/order/pages/timekeeping/modules/order_detail/bf_button.vue

@ -1,23 +0,0 @@
<template>
<view class="bf-button">
<slot>取消预约</slot>
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss">
.bf-button{
padding: 0 32upx;
display: inline-block;
min-width: 192upx;
text-align: center;
border-radius: 10upx;
background: #fff;
@include flcw(32upx, 88upx, $mColor, 500);
}
</style>

37
src/subpackage/order/pages/timekeeping/modules/order_detail/bottom_fixed.vue

@ -1,43 +1,24 @@
<template>
<view class="bottom-fixed">
<view class="bf-placeholder" :style="'height:' + placeholderHeight +'px;'"></view>
<view class="bf-content">
<view class="bc-btns">
<slot></slot>
</view>
<fixed-bar>
<view class="bottom-fixed">
<slot></slot>
</view>
</view>
</fixed-bar>
</template>
<script>
import fixed_bar from "@/components/fixed_bar/fixed_bar.vue";
export default {
data(){
return {
placeholderHeight: 0,
}
},
created(){
let query = uni.createSelectorQuery().in(this);
query.select('.bf-content')
.fields(
{ size:true },
data => {
this.placeholderHeight = data.height;
}
);
query.exec()
components: {
'fixed-bar': fixed_bar
}
}
</script>
<style lang="scss">
.bf-content{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
.bottom-fixed{
padding: 10upx 24upx;
background: #f2f2f7;
background: #F2F2F7;
@include ctf(flex-end);
}
</style>

23
src/subpackage/order/pages/timekeeping/modules/order_detail/fixed_button.vue

@ -1,23 +0,0 @@
<template>
<view class="fixed-button">
<slot>click</slot>
</view>
</template>
<script>
export default {
}
</script>
<style lang="scss">
.fixed-button{
padding: 0 32upx;
display: inline-block;
min-width: 192upx;
text-align: center;
border-radius: 10upx;
background: #fff;
@include flcw(32upx, 88upx, $mColor, 500);
}
</style>

8
src/subpackage/order/pages/timekeeping/modules/order_list/site.vue

@ -26,8 +26,8 @@
</template>
<template v-slot:bottom>
<view class="lc-btns">
<view class="lb-item" v-if="order.status_text === '待使用'">取消预约</view>
<view class="lb-item" v-if="order.status_text === '计费中'">结束计费</view>
<view class="lb-item" v-if="order.status_text === '待使用'" @click.stop="cancelBtn">取消预约</view>
<view class="lb-item" v-if="order.status_text === '计费中'" @click.stop="endBilling">结束计费</view>
</view>
</template>
</list-item-temp>
@ -56,6 +56,10 @@ export default {
endBilling(){
let { order } = this;
routeTo(`/subpackage/order/pages/timekeeping/order_detail/site?order_no=${order?.order_no || ''}&brand_id=${order?.brand_id || ''}&is_end=1`, 'nT');
},
cancelBtn(){
let { order } = this;
routeTo(`/subpackage/order/pages/timekeeping/order_detail/site?order_no=${order?.order_no || ''}&brand_id=${order?.brand_id || ''}&is_end=2`, 'nT');
}
}
}

62
src/subpackage/order/pages/timekeeping/modules/order_search/search_bar.vue

@ -0,0 +1,62 @@
<template>
<view class="search-bar">
<view class="sb-box">
<image class="sb-search-icon" mode="aspectFit" src="/subpackage/order/static/images/search.png"></image>
<input class="sb-ipt" placeholder="你输入订单号" v-model="searchTxt" confirm-type="search" @confirm="iptConfirm" />
<image class="sb-clear-icon" v-if="searchTxt!=''" mode="aspectFit" src="/subpackage/order/static/images/round_close.png" @click="clearSearch"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
searchTxt: ''
}
},
methods: {
iptConfirm(){
this.$emit('confirm:search', this.searchTxt);
},
clearSearch(){
this.searchTxt = '';
this.$emit('click:clear', '');
}
}
}
</script>
<style lang="scss">
.search-bar{
margin-bottom: 24upx;
height: 144upx;
background-color: #fff;
@include ctf(center);
.sb-box{
padding: 0 20upx;
height: 92upx;
width: 702upx;
border-radius: 10upx;
background-color: #f2f2f7;
@include ctf(center);
.sb-search-icon{
margin-right: 20upx;
flex-shrink: 0;
width: 40upx;
height: 40upx;
}
.sb-clear-icon{
flex-shrink: 0;
margin-right: 0;
margin-left: 20upx;
width: 32upx;
height: 32upx;
}
.sb-ipt{
flex-grow: 1;
@include flcw(32upx, 44upx, #1A1A1A);
}
}
}
</style>

126
src/subpackage/order/pages/timekeeping/order_detail/common.js

@ -0,0 +1,126 @@
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import { showLoad, hideLoad, showNone, showModal } from '@/utils/util';
// 获取订单详情
export function getOrderDetail({
brand_id = '', order_no = ''
}){
showLoad();
return server.get({
url: ORDER_API.billingOrderDetail,
data: {
brand_id, order_no
},
failMsg: '加载失败!'
})
.then(res=>{
hideLoad();
// this.orderInfo = res || {};
return res;
})
.catch(err=>{
hideLoad();
showNone('加载失败!');
console.warn('getOrderDetail err -->', err);
})
}
// 完结订单
export function endOrderServer({
brand_id, order_no, stadium_id
}){
showLoad();
return server.get({
url: ORDER_API.timeOrderComplete,
data: {
brand_id, order_no, stadium_id
},
failMsg: '操作失败!'
})
.then(res=>{
hideLoad();
showNone('操作成功!');
return res;
})
.catch(err=>{
hideLoad();
showNone('操作失败!');
console.warn('endOrderServer err -->', err);
})
}
// 取消订单
export function cancelOrderServer({
brand_id, order_no, reason = ''
}){
showLoad();
return server.get({
url: ORDER_API.subscribeCancel,
data: {
brand_id, order_no, reason
},
failMsg: '操作失败!'
})
.then(res=>{
hideLoad();
showNone('操作成功!');
return res;
})
.catch(err=>{
hideLoad();
showNone('操作失败!');
console.warn('cancelOrderServer err -->', err);
})
}
// 完结订单弹窗
export function finishOrder({
brand_id, order_no, stadium_id, opts = {}
}){
showModal({
title: '提示',
content: '是否确认完结订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm)endOrderServer({
brand_id: brand_id || '',
order_no: order_no || '',
stadium_id: stadium_id || ''
})
.finally(res=>{
// setTimeout(()=>{
// this.getOrderDetail({
// brand_id: brand_id || '',
// order_no: order_no || ''
// });
// }, 1000);
opts?.finally?.(res);
});
}
})
}
export function siteAndPeopleRefundServer({ order_no = '', amount = 0, integral = 0 }){
showLoad();
return server.post({
url: ORDER_API.orderRefund,
data: {
order_no, amount, integral
},
failMsg: '操作失败!'
})
.then(res=>{
hideLoad();
showNone('操作成功!');
// this.orderInfo = res || {};
return 'success';
})
.catch(err=>{
hideLoad();
showNone('操作失败!');
console.warn('getOrderDetail err -->', err);
})
}

108
src/subpackage/order/pages/timekeeping/order_detail/deposit.vue

@ -52,19 +52,32 @@
<kv-line label="交易流水:">{{ orderInfo.trade_no || '-' }}</kv-line>
</info-temp>
<block v-if="false">
<!-- 退款列表 -->
<view v-for="(e, i) in refundList" :key="i">
<view class="od-margin"></view>
<info-temp title="退款信息2">
<kv-line label="退款金额:">998</kv-line>
<kv-line label="退款单号:">TF-20195171564566</kv-line>
<kv-line label="退款时间:">2019-05-17 11:12:58</kv-line>
<kv-line label="退款原因:">商家主动退款</kv-line>
</info-temp>
</block>
<order-refund-info
:refund_price="e.amount || 0"
:refund_no="e.refund_no || '-'"
:refund_time="e.refund_time || '-'"
:refund_reason="e.reason || '-'"
:nameKey="i + 1"
></order-refund-info>
</view>
<bottom-fixed v-if="false">
<fixed-button>退款</fixed-button>
<bottom-fixed v-if="[ '已完成', '已退款', '已抵扣' ].includes(orderInfo.status_text)">
<refund-button
:pay_amount="orderInfo.pay_amount"
:refund_amount="orderInfo.refund_amount"
:refund_times="refundList.length || 0"
@click:button="refundOrder"
>退款</refund-button>
</bottom-fixed>
<!-- 退款弹窗 -->
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
@ -73,30 +86,38 @@ import headerTemp from "../modules/order_detail/header_temp.vue";
import infoTemp from "../modules/order_detail/info_temp.vue";
import kvLine from "../../../components/kv_line.vue";
import kvsLine from "../../../components/kvs_line.vue";
import bottomFixed from "../modules/order_detail/bottom_fixed.vue";
import fixedButton from "../modules/order_detail/fixed_button.vue";
import refundButton from "@/components/order_refund/permission_btn.vue";
import orderRefundModal from '@/components/order_refund/modal.vue';
import orderRefundInfo from '@/components/order_refund/info.vue';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import { showLoad, hideLoad, formatDate, showNone, showModal, routeTo } from '@/utils/util';
import { getOrderDetail, siteAndPeopleRefundServer } from "./common";
export default {
components: {
'header-temp': headerTemp,
'info-temp': infoTemp,
'kv-line': kvLine,
'kvs-line': kvsLine,
'bottom-fixed': bottomFixed,
'fixed-button': fixedButton,
'refund-button': refundButton,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
},
computed: {
link_order(){
let { orderInfo } = this;
return orderInfo?.extension?.link_order || {};
},
extension(){
return this.orderInfo?.extension || {};
}
},
data(){
return {
orderInfo: {}
orderInfo: {},
refundList: []
}
},
async onLoad(options){
@ -106,26 +127,49 @@ export default {
})
},
methods: {
refundOrder(){
let { orderInfo, extension, refundList } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: extension?.refundable_amount ?? 0,
refundable_integral: extension?.refundable_integral ?? 0,
refund_times: refundList?.length || -1,
confirm: e => {
console.log('e', e)
siteAndPeopleRefundServer({
order_no: orderInfo?.order_no || '',
amount: e?.refund_amount || 0,
integral: e?.refund_integral || 0,
})
.finally(()=>{
setTimeout(()=>{
this.getOrderDetail({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || ''
});
}, 1000);
})
}
});
},
toTimingOrder(){
let { order, link_order } = this;
routeTo(`/subpackage/order/pages/timekeeping/order_detail/site?order_no=${link_order?.order_no || ''}&brand_id=${order?.brand_id || ''}`, 'rT');
},
getOrderDetail({
brand_id = '', order_no = ''
}){
showLoad();
return server.get({
url: ORDER_API.billingOrderDetail,
data: {
brand_id, order_no
},
failMsg: '加载失败!'
})
.then(res=>{
hideLoad();
this.orderInfo = res || {};
return res;
})
//
async getOrderDetail({ brand_id = '', order_no = '' }){
let _detail = await getOrderDetail({ brand_id, order_no });
this.orderInfo = _detail || {};
this.getRefundData({ order_no });
return _detail;
},
// 退
async getRefundData({ order_no }){
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
let _refundLs = _refundRes?.data?.data?.list || [];
this.refundList = _refundLs;
},
}
}

186
src/subpackage/order/pages/timekeeping/order_detail/person.vue

@ -23,7 +23,7 @@
<kv-line label="项目类型:">人时({{ orderInfo.project_type_name || '-' }})</kv-line>
<kv-line label="进场时间:">{{ orderInfo.start_time || '-' }}</kv-line>
<kv-line label="离场时间:">{{ orderInfo.end_time || '-' }}</kv-line>
<kv-line label="时长合计:">{{ orderInfo.extension&&orderInfo.extension.duration || '-' }}</kv-line>
<kv-line label="时长合计:">{{ extension.duration || '-' }}</kv-line>
<block v-if="[ '已完成', '已退款', '待支付' ].includes(orderInfo.status_text)">
<view class="pod-pay-info">
<kvs-line label="金额小计">¥{{ orderInfo.amount || '0' }}</kvs-line>
@ -46,38 +46,52 @@
</info-temp>
</blcok>
<block v-if="orderInfo.status_text === '已退款'">
<!-- 退款列表 -->
<view v-for="(e, i) in refundList" :key="i">
<view class="pod-margin"></view>
<info-temp title="退款信息1">
<kv-line label="退款金额:">7</kv-line>
<kv-line label="退款单号:">TF-20195171564566</kv-line>
<kv-line label="退款时间:">2019-05-17 11:12:58</kv-line>
<kv-line label="退款原因:">商家主动退款</kv-line>
</info-temp>
</block>
<order-refund-info
:refund_price="e.amount || 0"
:refund_no="e.refund_no || '-'"
:refund_time="e.refund_time || '-'"
:refund_reason="e.reason || '-'"
:nameKey="i + 1"
></order-refund-info>
</view>
<view class="pod-margin"></view>
<view class="pod-margin"></view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '待支付'"
@click="finishOrder"
>完结订单</view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '计费中'"
@click="endOrder"
>结束计费</view>
<block v-if="[ '待支付', '计费中' ].includes(orderInfo.status_text)">
<view class="pod-margin"></view>
<view class="pod-margin"></view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '待支付'"
@click="finishOrder"
>完结订单</view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '计费中'"
@click="endOrder"
>结束计费</view>
</block>
<!-- <view class="pod-fixed">
<view class="pf-btn">取消预约</view>
</view> -->
<bottom-fixed v-if="false&&orderInfo.status_text === '已完成'">
<fixed-button>退款</fixed-button>
<bottom-fixed v-if="[ '已完成', '已退款' ].includes(orderInfo.status_text)">
<refund-button
:pay_amount="orderInfo.pay_amount"
:refund_amount="orderInfo.refund_amount"
:refund_times="refundList.length || 0"
@click:button="refundOrder"
>退款</refund-button>
</bottom-fixed>
<!-- 结束计费弹窗 -->
<end-billing-modal ref="endBillingModal"></end-billing-modal>
<!-- 退款弹窗 -->
<order-refund-modal
ref="orderRefundModal"
></order-refund-modal>
</view>
</template>
@ -87,26 +101,35 @@ import infoTemp from "../modules/order_detail/info_temp.vue";
import kvLine from "../../../components/kv_line.vue";
import kvsLine from "../../../components/kvs_line.vue";
import endBillingModal from "../modules/order_detail/end_billing_modal.vue";
import bottomFixed from "../modules/order_detail/bottom_fixed.vue";
import fixedButton from "../modules/order_detail/fixed_button.vue";
import refundButton from "@/components/order_refund/permission_btn.vue";
import orderRefundModal from '@/components/order_refund/modal.vue';
import orderRefundInfo from '@/components/order_refund/info.vue';
// import bottomFixed from "../modules/order_detail/bf_button.vue";
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import { showLoad, hideLoad, formatDate, showNone, showModal } from '@/utils/util';
import { getOrderDetail, finishOrder, siteAndPeopleRefundServer } from "./common";
export default {
components: {
'header-temp': headerTemp,
'info-temp': infoTemp,
'kv-line': kvLine,
'kvs-line': kvsLine,
'end-billing-modal': endBillingModal,
'bottom-fixed': bottomFixed,
'fixed-button': fixedButton,
'end-billing-modal': endBillingModal,
'refund-button': refundButton,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
},
computed: {
extension(){
return this.orderInfo?.extension || {};
}
},
data(){
return {
orderInfo: {}
orderInfo: {},
refundList: []
}
},
async onLoad(options){
@ -121,6 +144,34 @@ export default {
});
},
methods: {
refundOrder(){
let { orderInfo, extension, refundList } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: extension?.refundable_amount ?? 0,
refundable_integral: extension?.refundable_integral ?? 0,
refund_times: refundList?.length || -1,
confirm: e => {
console.log('e', e)
siteAndPeopleRefundServer({
order_no: orderInfo?.order_no || '',
amount: e?.refund_amount || 0,
integral: e?.refund_integral || 0,
})
.finally(()=>{
setTimeout(()=>{
this.getOrderDetail({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || ''
});
}, 1000);
})
}
});
},
//
endOrder(){
let { orderInfo } = this;
this.$refs.endBillingModal.initModal({
@ -139,69 +190,40 @@ export default {
}
});
},
// //
finishOrder(){
let { orderInfo } = this;
showModal({
title: '提示',
content: '是否确认完结订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm)this.endOrderServer({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || '',
stadium_id: orderInfo?.stadium_id || ''
})
.finally(res=>{
finishOrder({
brand_id: orderInfo?.brand_id,
order_no: orderInfo?.order_no,
stadium_id: orderInfo?.stadium_id,
opts: {
finally: ()=> {
setTimeout(()=>{
this.getOrderDetail({
brand_id: orderInfo?.brand_id,
order_no: orderInfo?.order_no
});
}, 1000);
});
}
}
})
},
endOrderServer({
brand_id, order_no, pay_amount, end_type
}){
showLoad();
return server.get({
url: ORDER_API.timeOrderComplete,
data: {
brand_id, order_no, pay_amount, end_type
},
failMsg: '操作失败!'
})
.then(res=>{
hideLoad();
showNone('操作成功!');
return res;
})
.catch(err=>{
hideLoad();
showNone('操作失败!');
console.warn('end billing modal confirmBtn err -->', err);
return Promise.reject(err);
})
},
getOrderDetail({
brand_id = '', order_no = ''
}){
showLoad();
return server.get({
url: ORDER_API.billingOrderDetail,
data: {
brand_id, order_no
},
failMsg: '加载失败!'
})
.then(res=>{
hideLoad();
this.orderInfo = res || {};
return res;
})
//
async getOrderDetail({ brand_id = '', order_no = '' }){
let _detail = await getOrderDetail({ brand_id, order_no });
this.orderInfo = _detail || {};
this.getRefundData({ order_no });
return _detail;
},
// 退
async getRefundData({ order_no }){
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
let _refundLs = _refundRes?.data?.data?.list || [];
this.refundList = _refundLs;
}
}
}
</script>

212
src/subpackage/order/pages/timekeeping/order_detail/site.vue

@ -102,29 +102,54 @@
<kv-line label="退款时间:">2019-05-17 11:12:58</kv-line>
<kv-line label="退款原因:">商家主动退款</kv-line>
</info-temp> -->
<!-- 退款列表 -->
<view v-for="(e, i) in refundList" :key="i">
<view class="od-margin"></view>
<order-refund-info
:refund_price="e.amount || 0"
:refund_no="e.refund_no || '-'"
:refund_time="e.refund_time || '-'"
:refund_reason="e.reason || '-'"
:nameKey="i + 1"
></order-refund-info>
</view>
<view class="od-margin"></view>
<view class="od-margin"></view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '待支付'"
@click="finishOrder"
>完结订单</view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '计费中'"
@click="endOrder"
>结束计费</view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '待使用'"
>取消预约</view>
<block v-if="[ '待支付', '计费中', '待使用' ].includes(orderInfo.status_text)">
<view class="od-margin"></view>
<view class="od-margin"></view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '待支付'"
@click="finishOrder"
>完结订单</view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '计费中'"
@click="endOrder"
>结束计费</view>
<view
class="pod-btn"
v-if="orderInfo.status_text === '待使用'"
@click="cancelOrder"
>取消预约</view>
</block>
<bottom-fixed v-if="[ '使用中', '已失效', '已完成', '已退款' ].includes(orderInfo.status_text)">
<refund-button
:pay_amount="orderInfo.pay_amount"
:refund_amount="orderInfo.refund_amount"
:refund_times="refundList.length || 0"
@click:button="refundOrder"
>退款</refund-button>
</bottom-fixed>
<!-- 结束计费弹窗 -->
<end-billing-modal ref="endBillingModal"></end-billing-modal>
<!-- 退款弹窗 -->
<order-refund-modal ref="orderRefundModal" ></order-refund-modal>
<!-- <bottom-fixed>
<fixed-button>取消预约</fixed-button>
</bottom-fixed> -->
</view>
</template>
@ -149,13 +174,14 @@ import headerTemp from "../modules/order_detail/header_temp.vue";
import infoTemp from "../modules/order_detail/info_temp.vue";
import kvLine from "../../../components/kv_line.vue";
import kvsLine from "../../../components/kvs_line.vue";
import bottomFixed from "../modules/order_detail/bottom_fixed.vue";
import fixedButton from "../modules/order_detail/fixed_button.vue";
import endBillingModal from "../modules/order_detail/end_billing_modal.vue";
import bottomFixed from "../modules/order_detail/bottom_fixed.vue";
import refundButton from "@/components/order_refund/permission_btn.vue";
import orderRefundModal from '@/components/order_refund/modal.vue';
import orderRefundInfo from '@/components/order_refund/info.vue';
import { ORDER_API } from '../../../js/api';
import server from '../../../js/server';
import { showLoad, hideLoad, formatDate, showNone, showModal, routeTo } from '@/utils/util';
import { showModal, routeTo } from '@/utils/util';
import { getOrderDetail, cancelOrderServer, finishOrder, siteAndPeopleRefundServer } from "./common";
export default {
components: {
'header-temp': headerTemp,
@ -163,8 +189,10 @@ export default {
'kv-line': kvLine,
'kvs-line': kvsLine,
'bottom-fixed': bottomFixed,
'fixed-button': fixedButton,
'end-billing-modal': endBillingModal,
'refund-button': refundButton,
'order-refund-modal': orderRefundModal,
'order-refund-info': orderRefundInfo
},
computed: {
extension(){
@ -174,7 +202,8 @@ export default {
},
data(){
return {
orderInfo: {}
orderInfo: {},
refundList: []
}
},
onLoad(options){
@ -182,8 +211,68 @@ export default {
brand_id: options?.brand_id || '',
order_no: options?.order_no || ''
})
.then(res=>{
if(res?.status_text === '计费中'&&options?.is_end === '1'){
this.endOrder();
}
if(res?.status_text === '待使用'&&options?.is_end === '2'){
this.cancelOrder();
}
});
},
methods: {
refundOrder(){
let { orderInfo, extension, refundList } = this;
this.$refs.orderRefundModal.show({
stadium_name: orderInfo?.stadium_name ?? '',
order_no: orderInfo?.order_no ?? '',
mobile: orderInfo?.mobile ?? '',
refundable_amount: extension?.refundable_amount ?? 0,
refundable_integral: extension?.refundable_integral ?? 0,
refund_times: refundList?.length || -1,
confirm: e => {
console.log('e', e)
siteAndPeopleRefundServer({
order_no: orderInfo?.order_no || '',
amount: e?.refund_amount || 0,
integral: e?.refund_integral || 0,
})
.finally(()=>{
setTimeout(()=>{
this.getOrderDetail({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || ''
});
}, 1000);
})
}
});
},
//
cancelOrder(){
let { orderInfo } = this;
showModal({
title: '提示',
content: '是否确认取消订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm)cancelOrderServer({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || ''
})
.finally(res=>{
setTimeout(()=>{
this.getOrderDetail({
brand_id: orderInfo?.brand_id,
order_no: orderInfo?.order_no
});
}, 1000);
});
}
})
},
//
endOrder(){
let { orderInfo } = this;
this.$refs.endBillingModal.initModal({
@ -202,73 +291,42 @@ export default {
}
});
},
// //
finishOrder(){
let { orderInfo } = this;
showModal({
title: '提示',
content: '是否确认完结订单?',
showCancel: true,
success: modalRes=>{
if(modalRes.confirm)this.endOrderServer({
brand_id: orderInfo?.brand_id || '',
order_no: orderInfo?.order_no || '',
stadium_id: orderInfo?.stadium_id || ''
})
.finally(res=>{
finishOrder({
brand_id: orderInfo?.brand_id,
order_no: orderInfo?.order_no,
stadium_id: orderInfo?.stadium_id,
opts: {
finally: ()=> {
setTimeout(()=>{
this.getOrderDetail({
brand_id: orderInfo?.brand_id,
order_no: orderInfo?.order_no
});
}, 1000);
});
}
}
})
},
endOrderServer({
brand_id, order_no, stadium_id
}){
showLoad();
return server.get({
url: ORDER_API.timeOrderComplete,
data: {
brand_id, order_no, stadium_id
},
failMsg: '操作失败!'
})
.then(res=>{
hideLoad();
showNone('操作成功!');
return res;
})
.catch(err=>{
hideLoad();
showNone('操作失败!');
console.warn('end billing modal confirmBtn err -->', err);
return Promise.reject(err);
})
},
toDepoistDetail(){
let { orderInfo } = this;
routeTo(`/subpackage/order/pages/timekeeping/order_detail/deposit?order_no=${orderInfo.deposit_order_no || ''}&brand_id=${orderInfo.brand_id || ''}`, 'rT');
},
getOrderDetail({
brand_id = '', order_no = ''
}){
showLoad();
return server.get({
url: ORDER_API.billingOrderDetail,
data: {
brand_id, order_no
},
failMsg: '加载失败!'
})
.then(res=>{
hideLoad();
this.orderInfo = res || {};
return res;
})
//
async getOrderDetail({ brand_id = '', order_no = '' }){
let _detail = await getOrderDetail({ brand_id, order_no });
this.orderInfo = _detail || {};
this.getRefundData({ order_no });
return _detail;
},
// 退
async getRefundData({ order_no }){
let _refundRes = await this.$store.dispatch('getOrderRefundList', order_no);
let _refundLs = _refundRes?.data?.data?.list || [];
this.refundList = _refundLs;
}
}
}
</script>

44
src/subpackage/order/pages/timekeeping/order_list.vue

@ -5,40 +5,31 @@
@change:stadium="changeStadium"
@click:time="showPeriodModal"
@click:filter="showFilterModal"
@click:search="searchOrder"
:start-time="condition.start"
:end-time="condition.end"
:success-count="countInfo.success_count"
:refund-count="countInfo.refund_count"
></order-list-header>
<view class="tol-list">
<block v-if="order_type === '2'">
<view
class="tl-item"
v-for="(e, i) in orderList"
:key="i"
>
<person-list-item :order="e" ></person-list-item>
<block v-for="(e, i) in orderList" :key="i">
<view class="tl-item" v-if="e.order_type === 1">
<site-list-item :order="e"></site-list-item>
</view>
<view class="tl-item" v-if="e.order_type === 2">
<person-list-item :order="e"></person-list-item>
</view>
<view class="tl-item" v-if="e.order_type === 3">
<deposit-list-item :order="e"></deposit-list-item>
</view>
</block>
<block v-else-if="order_type === '1'">
<block v-for="(e, i) in orderList" :key="i">
<view class="tl-item" v-if="e.order_type === 1">
<site-list-item :order="e"></site-list-item>
</view>
<view class="tl-item" v-if="e.order_type === 3">
<deposit-list-item :order="e"></deposit-list-item>
</view>
</block>
</block>
</view>
<!-- 时间段选择 -->
<period-modal
ref="periodModal"
></period-modal>
<period-modal ref="periodModal" ></period-modal>
<!-- status窗口 -->
<filter-modal ref="filterModal"></filter-modal>
<!-- 散客计时完结订单 -->
</view>
</template>
@ -50,11 +41,10 @@ import filterModal from "../../components/order_list/filter_modal.vue";
import personListItem from "./modules/order_list/person.vue";
import siteListItem from "./modules/order_list/site.vue";
import depositListItem from "./modules/order_list/deposit.vue";
import endBillingModal from "./modules/order_detail/end_billing_modal.vue";
import { ORDER_API } from '../../js/api';
import server from '../../js/server';
import { showLoad, hideLoad, formatDate, showNone } from '@/utils/util';
import { showLoad, hideLoad, formatDate, showNone, routeTo } from '@/utils/util';
const enumOrderType = {
site: '1', //
person: '2' //
@ -64,10 +54,10 @@ export default {
'order-list-header': orderListHeader,
'period-modal': periodModal,
'filter-modal': filterModal,
'person-list-item': personListItem,
'site-list-item': siteListItem,
'deposit-list-item': depositListItem,
'end-billing-modal': endBillingModal
},
watch: {
condition: {
@ -133,6 +123,12 @@ export default {
})
},
methods: {
//
searchOrder(){
let { brand_id, order_type } = this;
let _qryStr = `brand_id=${brand_id || ''}&order_type=${order_type || ''}`;
routeTo(`/subpackage/order/pages/timekeeping/order_search?${_qryStr}`, 'nT');
},
setTitle(type){
let _title = '';
switch(type){

132
src/subpackage/order/pages/timekeeping/order_search.vue

@ -0,0 +1,132 @@
<template>
<view class="order-search">
<search-bar
@confirm:search="searchOrder"
></search-bar>
<view class="os-list">
<block v-for="(e, i) in orderList" :key="i">
<view class="tl-item" v-if="e.order_type === 1">
<site-list-item :order="e"></site-list-item>
</view>
<view class="tl-item" v-if="e.order_type === 2">
<person-list-item :order="e"></person-list-item>
</view>
<view class="tl-item" v-if="e.order_type === 3">
<deposit-list-item :order="e"></deposit-list-item>
</view>
</block>
</view>
</view>
</template>
<script>
import search_bar from './modules/order_search/search_bar.vue';
import personListItem from "./modules/order_list/person.vue";
import siteListItem from "./modules/order_list/site.vue";
import depositListItem from "./modules/order_list/deposit.vue";
import { ORDER_API } from '../../js/api';
import server from '../../js/server';
import { showLoad, hideLoad, showNone } from '@/utils/util';
const enumOrderType = {
site: '1', //
person: '2' //
}
export default {
components: {
'search-bar': search_bar,
'person-list-item': personListItem,
'site-list-item': siteListItem,
'deposit-list-item': depositListItem,
},
data() {
return {
orderList: [],
page: 1,
optionsQuery: {
brand_id: '',
order_type: '',
},
searchTxt: ''
}
},
onLoad(options) {
this.optionsQuery = options;
},
onReachBottom(){
let { page, optionsQuery, searchTxt } = this;
this.getOrderList({
brand_id: optionsQuery?.brand_id || '',
order_type: optionsQuery?.order_type || '',
key: searchTxt || '',
page: ++page
})
},
methods: {
searchOrder(value){
let { optionsQuery } = this;
this.searchTxt = value;
this.getOrderList({
brand_id: optionsQuery.brand_id,
order_type: optionsQuery.order_type,
key: value
})
},
/**
* @param {String} brand_id 品牌id
* @param {String} stadium_id 场馆id
* @param {String} status 支付状态:未支付/已支付/已退款/反馈[0/1/2/3]
* @param {String} start 开始时间
* @param {String} end 结束时间
* @param {String} order_type 订单类型:场时/人时[1/2]
* @param {String} status_text 已关闭/计费中/待支付/待使用/使用中/已失效/已完成/已抵扣/已退款/已取消预约
* @param {String} key 搜索关键字
*
* */
getOrderList({
brand_id = '', stadium_id = '',
status = '', start = '', end = '',
order_type = '', page = 1, page_size = 20,
status_text = '', key = ''
}){
showLoad();
server.get({
url: ORDER_API.billingOrderList,
data: {
brand_id, stadium_id, status,
start, end, order_type: this.getReqOrderType(order_type), page, page_size,
status_text, key
},
failMsg: '加载失败!'
})
.then(res=>{
hideLoad();
let { list, ...info } = res;
let _list = list || [];
if(page == 1)return this.orderList = _list;
if(_list?.length <= 0)return showNone('没有更多数据了!');
this.page = page;
this.orderList = [...this.orderList, ..._list];
})
},
//
getReqOrderType(type){
if(type === enumOrderType.site)return '1,3'; //
return type;
}
}
}
</script>
<style lang="scss">
.os-list{
padding: 24upx;
@include isPd(24upx);
.tl-item + .tl-item{
margin-top: 24upx;
}
}
</style>

BIN
src/subpackage/order/static/images/round_close.png

After

Width: 32  |  Height: 32  |  Size: 369 B

20023
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save