8fb19fdf by lttnew

订单

1 parent cfd67a49
......@@ -39,3 +39,16 @@ export function AESDecrypt(str) {
return aesStr
}
}
export function isDaoGuanRole() {
const app = getApp()
const deptType = app.globalData?.deptType
const userType = app.globalData?.userType
return deptType == 6 || deptType == '6' || userType == '4'
}
export function reLaunchHomeByRole() {
uni.reLaunch({
url: isDaoGuanRole() ? '/pages/index/daoGuanPerson' : '/pages/index/home'
})
}
......
......@@ -78,18 +78,18 @@
<view class="btn-group">
<template v-if="isZtxRole">
<button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(item)" class="btn btn-pay" @click.stop="handleRefund(item)">退款</button>
<button v-if="canShowRefund(item)" class="btn btn-pay" @click.stop="handleRefund(item)">退款</button>
</template>
<template v-else>
<button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="handlePay(item)">去支付</button>
<button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
<button v-if="canShowPay(item)" class="btn btn-pay" @click.stop="handlePay(item)">去支付</button>
<button v-if="canShowCancel(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
<template v-if="canShowInvoiceApply(item)">
<button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
<button class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
</template>
<template v-if="hasInvoice(item)">
<button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button>
</template>
<button v-if="canShowReIssue(item)" :class="{ disabled: isReIssueDisabled(item) }" :disabled="isReIssueDisabled(item)" class="btn btn-view-invoice" @click.stop="handleReIssue(item)">重新开票</button>
<button v-if="canShowReIssue(item)" class="btn btn-view-invoice" @click.stop="handleReIssue(item)">换开</button>
</template>
</view>
</view>
......@@ -325,11 +325,13 @@ const hasInvoice = (item) => String(item?.invoiceStatus) === '1'
const isPayDisabled = (item) => String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
const canShowCancel = (item) => String(item?.auditStatus) === '9'
const canShowPay = (item) => !isPayDisabled(item)
const canShowCancel = (item) => !isCancelDisabled(item)
const isCancelDisabled = (item) => String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
const canShowInvoiceApply = (item) => !hasInvoice(item)
const canShowInvoiceApply = (item) => !isInvoiceDisabled(item)
const isInvoiceDisabled = (item) => {
return String(item?.payStatus) !== '1' ||
......@@ -345,7 +347,7 @@ const isWithinCalendarMonth = (dateValue) => {
return date.isSame(dayjs(), 'month')
}
const canShowReIssue = (item) => !isZtxRole.value && String(item?.auditStatus) !== '9'
const canShowReIssue = (item) => !isZtxRole.value && String(item?.auditStatus) !== '9' && !isReIssueDisabled(item)
const isReIssueDisabled = (item) => {
return !hasInvoice(item) ||
......@@ -357,6 +359,8 @@ const isReIssueDisabled = (item) => {
const isRefundDisabled = (item) => String(item?.payStatus) !== '1' || hasInvoice(item)
const canShowRefund = (item) => !isRefundDisabled(item)
// 数据请求核心方法
const initData = async () => {
......@@ -481,14 +485,17 @@ const makeInvoiceFN = (item) => {
// }
// 设置刷新标记,从开票页面返回时刷新列表
needRefresh.value = true;
const isB2B = String(item.payType) === '3'
const payTypeQuery = `&payType=${encodeURIComponent(item.payType || '')}`
const ziZhangBu = isB2B ? '&ziZhangBu=1' : ''
// 根据tab类型决定跳转页面:个人/单位会员开非税票,级位/段位/越段考试开增值税票
let url = '';
if (currentTab.value === '0' || currentTab.value === '1') {
// 个人/单位会员 - 非税开票
url = `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}`;
url = `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}${payTypeQuery}${ziZhangBu}`;
} else {
// 级位/段位/越段考试 - 增值税开票
url = `/pages/invoice/apply?orderId=${item.id}&amount=${item.price}`;
url = `/pages/invoice/apply?orderId=${item.id}&amount=${item.price}${payTypeQuery}${ziZhangBu}`;
}
uni.navigateTo({ url });
};
......@@ -923,7 +930,7 @@ const confirmRefund = async (item) => {
.btn {
width: 140rpx;
height: 48rpx;
line-height: 48rpx;
line-height: 46rpx;
padding: 0;
border-radius: 10rpx;
font-size: 24rpx;
......
......@@ -146,6 +146,7 @@
onShow
} from '@dcloudio/uni-app';
import config from '@/config.js'
import { reLaunchHomeByRole } from '@/common/utils.js'
const app = getApp();
const verifyPopup = ref(null)
......@@ -654,9 +655,7 @@
content: '激活成功,返回首页',
success: function(resp) {
if (resp.confirm) {
uni.reLaunch({
url: `/pages/index/home`
})
reLaunchHomeByRole()
} else {
uni.navigateBack()
}
......
......@@ -43,6 +43,7 @@ import {
} from '@dcloudio/uni-app'
import to from 'await-to-js'
import * as api from '@/common/api.js'
import { reLaunchHomeByRole } from '@/common/utils.js'
const orderInfo = ref({
orderId: '',
......@@ -52,9 +53,7 @@ const orderInfo = ref({
})
const goBack = () => {
uni.reLaunch({
url: '/pages/index/home'
})
reLaunchHomeByRole()
}
onLoad(async (option) => {
......
......@@ -393,7 +393,7 @@ const isPayDisabled = (item) => {
}
const isCancelDisabled = (item) => {
if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9'
if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
if (isLevelOrder(item)) {
return String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
}
......
......@@ -617,6 +617,7 @@ import * as api from '@/common/api.js';
import * as loginServer from '@/common/login.js';
import config from '@/config.js'
import {getInfo} from '@/common/login'
import { reLaunchHomeByRole } from '@/common/utils.js'
import {
onLoad,
onShow,
......@@ -998,7 +999,7 @@ async function submitBindingPhone() {
uni.showToast({title: '修改成功', icon: 'success'})
closeBindingPhoneDialog()
setTimeout(() => {
uni.reLaunch({url: '/pages/index/home'})
reLaunchHomeByRole()
}, 1500)
} catch (e) {
// 错误已由 request.js 处理
......
......@@ -12,6 +12,7 @@
import {
useUserStore
} from '../../store/modules/user';
import { reLaunchHomeByRole } from '@/common/utils.js'
const userStore = useUserStore()
const app = getApp()
......@@ -29,18 +30,8 @@
console.log('userName', userName)
console.log('app.globalData.userType ', app.globalData.userType )
if (userName) {
if(app.globalData.userType == 4){
uni.reLaunch({
url: '/pages/index/daoGuanPerson'
})
reLaunchHomeByRole()
return
}else{
uni.reLaunch({
url: '/pages/index/home'
})
return
}
}
let webUserName = uni.getStorageSync('webUserName')
......
......@@ -90,6 +90,16 @@
</view>
</view>
<view class="fixedBottom"><button class="btn-red" @click="goSubmit">确 定</button></view>
<view v-if="showCustomModal" class="custom-modal-mask" @touchmove.stop.prevent @click.stop>
<view class="custom-modal" @click.stop>
<view class="custom-modal-title">{{ customModalTitle }}</view>
<view class="custom-modal-content">{{ customModalContent }}</view>
<view class="custom-modal-btns">
<button v-if="customModalShowCancel" class="custom-modal-cancel" @click="handleCustomCancel">{{ customModalCancelText }}</button>
<button class="custom-modal-confirm" @click="handleCustomConfirm">{{ customModalConfirmText }}</button>
</view>
</view>
</view>
</view>
</template>
......@@ -110,6 +120,14 @@
const regionsList = ref([])
const cardObj = ref({})
const disabledName = ref(true)
const showCustomModal = ref(false)
const customModalTitle = ref('提示')
const customModalContent = ref('')
const customModalConfirmText = ref('确定')
const customModalCancelText = ref('取消')
const customModalShowCancel = ref(false)
const customModalConfirmAction = ref(null)
const customModalCancelAction = ref(null)
const baseFormData = ref({
photo: '',
sex: '',
......@@ -166,6 +184,35 @@
width: '500rpx',
height: '316rpx'
});
function openCustomModal(options = {}) {
customModalTitle.value = options.title || '提示'
customModalContent.value = options.content || ''
customModalConfirmText.value = options.confirmText || '确定'
customModalCancelText.value = options.cancelText || '取消'
customModalShowCancel.value = !!options.showCancel
customModalConfirmAction.value = typeof options.onConfirm === 'function' ? options.onConfirm : null
customModalCancelAction.value = typeof options.onCancel === 'function' ? options.onCancel : null
showCustomModal.value = true
}
function closeCustomModal() {
showCustomModal.value = false
customModalConfirmAction.value = null
customModalCancelAction.value = null
}
function handleCustomConfirm() {
const action = customModalConfirmAction.value
closeCustomModal()
if (action) action()
}
function handleCustomCancel() {
const action = customModalCancelAction.value
closeCustomModal()
if (action) action()
}
onLoad((option) => {
if (option.tab == '1') {
current.value = 1
......@@ -259,11 +306,8 @@
} else {
uni.hideLoading()
uni.showModal({
content: res.msg,
success: function(modalRes) {
}
openCustomModal({
content: res.msg
})
}
......@@ -471,10 +515,10 @@
return
}
//信息确认弹出
uni.showModal({
openCustomModal({
content: '请确认信息正确',
success: function(res) {
if (res.confirm) {
showCancel: true,
onConfirm: function() {
if (baseFormData.value.idcType == '4') {
baseFormData.value.idcType = '0'
}
......@@ -489,43 +533,41 @@
api.addPersonToMyDept(baseFormData.value).then(Response => {
if (Response.data == 0) {
let msg = '该成员,实名认证未通过,注册失败!'
uni.showModal({
openCustomModal({
content: msg,
title: '提示',
success: function() {}
title: '提示'
})
return
}
if (Response.data * 1 < 0) {
// 会员调入弹出
uni.showModal({
openCustomModal({
content: '该会员已存在其他道馆,如需添加,请发起会员调动',
title: '提示',
success: function() {}
title: '提示'
})
return
}
// let msg = '保存成功'
uni.showModal({
openCustomModal({
content: '保存成功',
title: '提示',
confirmText: '继续添加',
cancelText: '返回首页',
success: function(res) {
showCancel: true,
onConfirm: function() {
uni.redirectTo({
url: `/personalVip/addVip?tab=${current.value}&idcType=${baseFormData.value.idcType}`
});
},
fail: function() {
onCancel: function() {
uni.reLaunch({
url: `/pages/index/home`
url: `/pages/index/daoGuanPerson`
})
}
})
})
}
}
});
}
......@@ -662,7 +704,6 @@
opacity: 0;
}
:deep(.item-text-overflow) {
text-align: left;
}
......@@ -676,4 +717,74 @@
:deep(.fixUniFormItemStyle .uni-data-picker__text) {
text-align: left !important;
}
.custom-modal-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
}
.custom-modal {
width: 600rpx;
background: #fff;
border-radius: 20rpx;
padding: 40rpx 30rpx;
box-sizing: border-box;
text-align: center;
box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.2);
}
.custom-modal-title {
font-size: 36rpx;
font-weight: 600;
color: #333;
margin-bottom: 30rpx;
}
.custom-modal-content {
font-size: 30rpx;
color: #666;
line-height: 1.6;
margin-bottom: 40rpx;
word-break: break-word;
}
.custom-modal-btns {
display: flex;
justify-content: space-between;
gap: 20rpx;
}
.custom-modal-cancel,
.custom-modal-confirm {
flex: 1;
height: 80rpx;
line-height: 80rpx;
border-radius: 40rpx;
font-size: 32rpx;
border: none;
margin: 0;
padding: 0;
&::after {
border: none;
}
}
.custom-modal-cancel {
background: #f5f5f5;
color: #666;
}
.custom-modal-confirm {
background: #C4121B;
color: #fff;
}
</style>
......
......@@ -107,6 +107,18 @@
</view>
</view>
<!-- 自定义退款确认弹窗 -->
<view v-if="showRefundPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeRefundPopup">
<view class="custom-modal" @click.stop>
<view class="modal-title">提示</view>
<view class="modal-content">{{ refundModalContent }}</view>
<view class="modal-btns">
<button class="modal-btn-cancel" @click="closeRefundPopup">取消</button>
<button class="modal-btn-confirm" @click="confirmRefund">确定</button>
</view>
</view>
</view>
<!-- 票据信息弹窗(级位/段位/越段考试) -->
<view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup">
<view class="invoice-popup-content" @click.stop>
......@@ -185,6 +197,7 @@ const queryParams = reactive({
// 弹窗控制
const showDelPopup = ref(false);
const showCancelPopup = ref(false);
const showRefundPopup = ref(false);
const isPopupOpen = ref(false);
const showInvoicePopup = ref(false);
const invoiceData = ref({});
......@@ -192,6 +205,7 @@ const invoiceData = ref({});
// 弹窗内容
const delModalContent = ref('');
const cancelModalContent = ref('');
const refundModalContent = ref('');
// 当前操作的订单
const currentOrder = ref(null);
......@@ -491,19 +505,23 @@ const confirmCancel = async () => {
};
const handleRefund = async (item) => {
const { confirm } = await uni.showModal({
title: '提示',
content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`
})
if (!confirm) return
currentOrder.value = item
refundModalContent.value = `缴费编号为"${item.wfCode}"的订单是否确认退款?`
showRefundPopup.value = true
isPopupOpen.value = true
}
const confirmRefund = async () => {
if (!currentOrder.value) return
try {
uni.showLoading({ title: '处理中...' })
await api.refundOrder(item.id)
await api.refundOrder(currentOrder.value.id)
uni.showToast({ title: '操作成功', icon: 'success' })
pageNum.value = 1
list.value = []
hasMore.value = true
await initData()
closeRefundPopup()
} catch (e) {
uni.showToast({ title: '退款失败', icon: 'none' })
} finally {
......@@ -518,6 +536,13 @@ const closeCancelPopup = () => {
currentOrder.value = null;
};
const closeRefundPopup = () => {
showRefundPopup.value = false;
isPopupOpen.value = false;
refundModalContent.value = '';
currentOrder.value = null;
};
// 关闭发票弹窗
const closeInvoicePopup = () => {
showInvoicePopup.value = false;
......@@ -934,7 +959,7 @@ const goToDetail = (item) => {
.btn {
width: 140rpx;
height: 48rpx;
line-height: 46rpx;
line-height: 44rpx;
padding: 0;
border-radius: 10rpx;
font-size: 24rpx;
......
......@@ -62,15 +62,15 @@
<view class="summary-row">
<view class="summary-item">
<text class="summary-label">人数合计</text>
<text class="summary-value">{{ item.allCount || 0 }}</text>
<text class="summary-value">{{ item.allCount ? item.allCount +'人' : '/' }}</text>
</view>
<view class="summary-item">
<text class="summary-label">新会员合计</text>
<text class="summary-value">{{ item.newCount || 0 }}</text>
<text class="summary-value">{{ item.newCount ? item.newCount + '人' : '/' }}</text>
</view>
<view class="summary-item">
<text class="summary-label">年限合计</text>
<text class="summary-value">{{ item.yearCount || 0 }}</text>
<text class="summary-value">{{ item.yearCount ? item.yearCount +'年' : '/' }}</text>
</view>
</view>
......@@ -592,10 +592,12 @@ onUnmounted(() => {
align-items: center;
margin-top: 14rpx;
padding: 16rpx 0 0;
border-top: 1rpx dashed #f0f0f0;
// border-top: 1rpx dashed #f0f0f0;
margin-bottom: 10rpx;
padding-bottom: 14rpx;
border-bottom: 1rpx dashed #f0f0f0;
// border-bottom: 1rpx dashed #f0f0f0;
border: 20rpx;
background-color: #f0f0f0;
}
.summary-item {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!