0ac7b897 by lttnew

调动记录

1 parent e0c6e843
......@@ -17,12 +17,12 @@
</view>
<view class="info-row">
<text class="label">审核状态</text>
<text :class="getStatusClass(form.auditStatus)" class="value">
{{ getStatusText(userType == 1 ? form.auditStatus : form.shenAuditStatus) }}
<text :class="getStatusClass(getCurrentAuditStatus())" class="value">
{{ getStatusText(getCurrentAuditStatus()) }}
</text>
</view>
<view class="info-row">
<text class="label">是否需要</text>
<text class="label">是否需要省级协会指派</text>
<text class="value">{{ form.selfSelect == 1 ? '否' : '是' }}</text>
</view>
<view class="info-row">
......@@ -35,7 +35,7 @@
</view>
<view class="info-row">
<text class="label">审核日期</text>
<text class="value">{{ formatDate(form.auditTime) }}</text>
<text class="value">{{ formatDate(getCurrentAuditTime()) }}</text>
</view>
<view class="info-row">
<text class="label">考官</text>
......@@ -145,6 +145,14 @@ function getStatusClass(status) {
return classMap[status] || ''
}
function getCurrentAuditStatus() {
return userType.value == 1 ? form.value.auditStatus : form.value.shenAuditStatus
}
function getCurrentAuditTime() {
return userType.value == 1 ? form.value.auditTime : form.value.shenAuditTime
}
function formatDate(dateStr) {
if (!dateStr) return '-'
return dateStr.substring(0, 10)
......
......@@ -63,12 +63,12 @@
scroll-y
@scrolltolower="loadMore"
>
<view class="appList">
<view class="order-list">
<view
v-for="(item, index) in infoList"
:key="index"
:class="{ 'item-checked': isSelected(item) }"
class="appItem"
class="order-card-new"
>
<!-- 选择框(保留原逻辑+适配截图样式) -->
<!-- <view class="checkbox-wrap" v-if="item.auditStatus == 1" @click="toggleSelect(item)">
......@@ -77,59 +77,58 @@
</view>
</view> -->
<!-- 主内容区(点击跳详情,保留原所有字段) -->
<view class="item-content" @click="goDetail(item)">
<!-- 状态标签+提交时间(截图风格顶部) -->
<view class="item-top">
<text class="submit-time">{{ formatDate(item.commitTime) }} 提交</text>
<view class="item-content">
<view class="card-header">
<view class="date">
<view class="data-header">
<text class="member-label">{{ item.shenMemName || '-' }} ·</text>
<text class="value ml10">{{ item.memName || '-' }}</text>
</view>
<text :class="getStatusClass(userType==1? item.auditStatus:item.shenAuditStatus)" class="status-tag">
{{ getStatusText(userType == 1 ? item.auditStatus : item.shenAuditStatus) }}
</text>
</view>
</view>
<!-- 缴费单位名称(原name字段,截图风格标题) -->
<view class="mem-name">{{ item.shenMemName }}</view>
<!-- 第一行信息:所属协会/会员有效期/是否需要(原flexbox1,截图风格) -->
<view class="info-row">
<view class="info-item">
<text class="info-label">申请单位</text>
<text class="info-value">{{ item.memName || '-' }}</text>
<view class="member-time">
<view class="label">
<!-- <text class="star"></text> -->
<!-- {{ `${formatDate(item.commitTime)}` }} -->
</view>
<view class="info-item">
<text class="info-label">会员有效期</text>
<text class="info-value">{{ formatDate(item.memValidDate) }}</text>
<view class="price">
<view></view>
<!-- <view class="person">所属协会</view> -->
</view>
<!-- <view class="info-item">
<text class="info-label">是否需要</text>
<text class="info-value">{{ item.selfSelect == 1 ? '否' : '是' }}</text>
</view> -->
</view>
<!-- 第二行信息:申请日期/审核日期(原flexbox2,截图风格) -->
<!-- <view class="info-row">
<view class="info-item two-col">
<text class="info-label">申请日期</text>
<view class="info-section">
<view class="single-info">
<view class="label">会员有效期</view>
<view class="value">{{ formatDate(item.memValidDate) }}</view>
</view>
<view class="line"></view>
<view class="single-info">
<view class="label">申请日期</view>
<text class="info-value">{{ formatDate(item.commitTime) }}</text>
</view>
<view class="info-item two-col">
<text class="info-label">审核日期</text>
<text class="info-value">{{ formatDate(item.auditTime) }}</text>
<view class="line"></view>
<view class="single-info">
<view class="label">审核日期</view>
<text class="info-value">{{ formatDate(userType == 1 ? item.auditTime : item.shenAuditTime) }}</text>
</view>
</view>
</view> -->
</view>
<!-- 操作按钮区(保留原所有按钮:查看/审核/机构资料,截图风格) -->
<view class="func">
<!-- <button class="btn-info" >查看</button> -->
<view class="btn-group">
<button class="btn btn-info" @click.stop="goView(item)">查看</button>
<button
v-if=" userType==1? item.auditStatus == 1:item.shenAuditStatus == 1 "
class="btn-info"
class="btn btn-pay"
@click.stop="goAudit(item)"
>审核
</button>
<button class="btn-info" @click.stop="goInstitution(item)">机构资料</button>
<button class="btn btn-view-invoice" @click.stop="goInstitution(item)">机构资料</button>
</view>
</view>
</view>
......@@ -149,7 +148,6 @@
</template>
<script setup>
// 完全保留你原代码的所有JS逻辑、方法、字段,未做任何修改
import * as api from '@/common/api_exam.js'
import config from '@/config.js'
import {ref} from 'vue'
......@@ -333,7 +331,7 @@ function toggleSelect(item) {
}
}
function goDetail(item) {
function goView(item) {
const itemStr = encodeURIComponent(JSON.stringify(item))
uni.navigateTo({
url: `/level/ztx/examinationDetail?item=${itemStr}`
......@@ -385,8 +383,8 @@ function formatDate(dateStr) {
<style lang="scss" scoped>
.exam-verification-page {
min-height: 100vh;
background-color: #f5f5f5;
height: 100vh;
background-color: #ededf0;
display: flex;
flex-direction: column;
}
......@@ -401,10 +399,10 @@ function formatDate(dateStr) {
.tab-item {
flex: 1;
height: 88rpx;
line-height: 88rpx;
height: 84rpx;
line-height: 84rpx;
text-align: center;
font-size: 32rpx;
font-size: 28rpx;
color: #666;
position: relative;
transition: all 0.2s;
......@@ -419,8 +417,8 @@ function formatDate(dateStr) {
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 120rpx;
height: 6rpx;
width: 72rpx;
height: 5rpx;
background-color: #C4121B;
border-radius: 3rpx;
}
......@@ -456,184 +454,192 @@ function formatDate(dateStr) {
/* 列表滚动区(适配Tab+批量按钮高度) */
.scroll-list {
flex: 1;
height: 0;
min-height: 0;
width: 100%;
box-sizing: border-box;
padding-bottom: 20rpx;
overflow: hidden;
background: #ededf0;
}
/* 列表容器 */
.appList {
padding: 0 20rpx;
width: 100%;
.order-list {
min-height: 100%;
box-sizing: border-box;
padding: 18rpx 24rpx calc(80rpx + env(safe-area-inset-bottom));
}
/* 列表项(截图风格:白色卡片+圆角+阴影+红色顶边) */
.appItem {
background-color: #fff;
// border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
position: relative;
// border-top: 4rpx solid #C4121B;
.order-card-new {
background: #fff;
margin-bottom: 22rpx;
padding: 22rpx 18rpx 18rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
border-radius: 18rpx;
display: flex;
flex-direction: column;
gap: 24rpx;
width: 100%;
box-sizing: border-box;
&.item-checked {
// border: 2rpx solid #13B5B1;
border-top: 4rpx solid #C4121B;
}
/* 选择框(保留原位置+适配截图样式) */
.checkbox-wrap {
position: absolute;
top: 20rpx;
right: 20rpx;
z-index: 10;
.checkbox {
width: 36rpx;
height: 36rpx;
border: 2rpx solid #ddd;
border-radius: 8rpx;
.card-header {
display: flex;
align-items: center;
justify-content: center;
background: #fff;
transition: all 0.2s;
&.selected {
background: #13B5B1;
border-color: #13B5B1;
}
}
}
justify-content: space-between;
padding-bottom: 10rpx;
/* 主内容区 */
.item-content {
.date {
width: 100%;
display: flex;
flex-direction: column;
gap: 16rpx;
}
align-items: center;
justify-content: space-between;
gap: 8rpx;
font-size: 26rpx;
/* 状态+提交时间(截图风格顶部) */
.item-top {
.data-header {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
min-width: 0;
}
.member-label {
color: #c30d23;
font-size: 28rpx;
font-weight: bold;
}
.value {
color: #000;
font-size: 27rpx;
font-weight: bold;
max-width: 430rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.status-tag {
padding: 6rpx 20rpx;
border-radius: 20rpx;
flex-shrink: 0;
font-size: 24rpx;
color: #999;
.text-warning {
background-color: #fff3e0;
color: #ff9800;
&.text-warning {
color: #faad14;
}
.text-success {
background-color: #e8f5e9;
color: #4caf50;
&.text-success {
color: #52c41a;
}
.text-danger {
background-color: #ffebee;
color: #f44336;
&.text-danger {
color: #ff4d4f;
}
}
}
}
.submit-time {
font-size: 24rpx;
color: #999;
.member-time {
width: 100%;
display: flex;
justify-content: space-between;
padding-bottom: 4rpx;
.label {
max-width: 430rpx;
color: #555;
font-size: 26rpx;
line-height: 1.4;
.star {
color: #777;
font-size: 26rpx;
}
}
/* 缴费单位名称(截图风格标题) */
.mem-name {
font-size: 28rpx;
font-weight: 600;
.price {
min-width: 160rpx;
color: #333;
padding-bottom: 8rpx;
// border-bottom: 1px dashed #eee;
}
font-size: 26rpx;
font-weight: 500;
text-align: right;
/* 信息行(截图风格:浅灰背景+圆角+均匀分布) */
.info-row {
display: flex;
justify-content: space-between;
background-color: #f8f9fa;
border-radius: 12rpx;
padding: 20rpx;
gap: 16rpx;
width: 100%;
box-sizing: border-box;
.person {
font-size: 24rpx;
color: #999;
text-align: right;
}
}
}
.info-item {
flex: 1;
.info-section {
display: flex;
flex-direction: column;
align-items: center;
gap: 8rpx;
background: #f8f8f8;
border-radius: 12rpx;
padding: 16rpx 8rpx;
margin-top: 14rpx;
&.two-col {
.single-info {
flex: 1;
max-width: 48%;
}
text-align: center;
min-width: 0;
.info-label {
.label {
font-size: 24rpx;
color: #999;
margin-bottom: 8rpx;
}
.value,
.info-value {
font-size: 28rpx;
font-size: 24rpx;
color: #333;
font-weight: 500;
text-align: center;
word-break: break-all;
}
}
.line {
width: 1rpx;
height: 54rpx;
background: #e8e8e8;
}
}
/* 操作按钮区(保留原三个按钮+截图风格优化) */
.func {
.btn-group {
display: flex;
gap: 20rpx;
width: 100%;
box-sizing: border-box;
justify-content: flex-end;
align-items: center;
gap: 16rpx;
width: 100%;
margin-top: 16rpx;
flex-wrap: wrap;
button {
// flex: 1;
width: 100px;
height: 72rpx;
line-height: 72rpx;
font-size: 28rpx;
border-radius: 36rpx;
.btn {
width: 140rpx;
height: 48rpx;
line-height: 48rpx;
padding: 0;
border-radius: 10rpx;
font-size: 24rpx;
white-space: nowrap;
font-weight: bold;
border: none;
transition: all 0.2s;
}
background: transparent;
text-align: center;
margin: 0;
.btn-view {
background-color: #f5f5f5;
color: #666;
&::after {
border: none;
display: none;
}
.btn-audit {
background: linear-gradient(135deg, #13B5B1, #15c5c1);
color: #fff;
&.btn-info {
color: #444;
border: 1rpx solid #d7d7d7;
background: #fff;
}
.btn-info {
border: 2rpx solid #C4121B;
// background: linear-gradient(135deg, #ff9800, #ffb74d);
color: #C4121B;
&.btn-pay,
&.btn-view-invoice {
color: #c30d23;
border: 1rpx solid #c30d23;
background: #fff;
}
}
}
}
......
......@@ -81,7 +81,7 @@
<button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(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 :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>
<template v-if="canShowInvoiceApply(item)">
<button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
......@@ -160,26 +160,14 @@
</view>
</view>
<!-- 自定义删除确认弹窗 -->
<view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup">
<!-- 自定义确认弹窗 -->
<view v-if="showConfirmPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeConfirmPopup">
<view class="custom-modal" @click.stop>
<view class="modal-title">提示</view>
<view class="modal-content">{{ delModalContent }}</view>
<view class="modal-content">{{ confirmModalContent }}</view>
<view class="modal-btns">
<button class="modal-btn-cancel" @click="closeDelPopup">取消</button>
<button class="modal-btn-confirm" @click="confirmDel">确定</button>
</view>
</view>
</view>
<!-- 自定义取消订单确认弹窗 -->
<view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup">
<view class="custom-modal" @click.stop>
<view class="modal-title">提示</view>
<view class="modal-content">{{ cancelModalContent }}</view>
<view class="modal-btns">
<button class="modal-btn-cancel" @click="closeCancelPopup">取消</button>
<button class="modal-btn-confirm" @click="confirmCancel">确定</button>
<button class="modal-btn-cancel" @click="closeConfirmPopup">取消</button>
<button class="modal-btn-confirm" @click="confirmPopup">确定</button>
</view>
</view>
</view>
......@@ -222,8 +210,7 @@ const queryParams = reactive({
});
// 弹窗控制
const showDelPopup = ref(false);
const showCancelPopup = ref(false);
const showConfirmPopup = ref(false);
const isPopupOpen = ref(false);
const showInvoicePopup = ref(false);
const showInvoiceWebview = ref(false);
......@@ -231,8 +218,8 @@ const invoiceWebviewUrl = ref('');
const invoiceData = ref({});
// 弹窗内容
const delModalContent = ref('');
const cancelModalContent = ref('');
const confirmModalContent = ref('');
const confirmModalAction = ref(null);
// 当前操作的订单
const currentOrder = ref(null);
......@@ -418,12 +405,34 @@ const handelSearch = () => {
initData()
}
const openConfirmPopup = ({ content, action, order = null }) => {
currentOrder.value = order
confirmModalContent.value = content
confirmModalAction.value = action
showConfirmPopup.value = true
isPopupOpen.value = true
}
const closeConfirmPopup = () => {
showConfirmPopup.value = false
isPopupOpen.value = false
currentOrder.value = null
confirmModalContent.value = ''
confirmModalAction.value = null
}
const confirmPopup = async () => {
if (typeof confirmModalAction.value !== 'function') return
await confirmModalAction.value(currentOrder.value)
}
// 删除订单
const handleDelete = (item) => {
currentOrder.value = item;
delModalContent.value = `是否确认删除订单编号为"${item.tradeNo}"的订单?`;
showDelPopup.value = true;
isPopupOpen.value = true;
openConfirmPopup({
order: item,
content: `是否确认删除订单编号为"${item.tradeNo}"的订单?`,
action: confirmDel
})
};
// 确认删除
......@@ -435,7 +444,7 @@ const confirmDel = async () => {
pageNum.value = 1;
list.value = [];
await initData();
closeDelPopup();
closeConfirmPopup();
} catch (e) {
uni.showToast({title: '删除失败', icon: 'error'});
}
......@@ -455,13 +464,6 @@ const goToDetail = (item) => {
}
}
// 关闭删除弹窗
const closeDelPopup = () => {
showDelPopup.value = false;
isPopupOpen.value = false;
currentOrder.value = null;
};
// 去缴费
const handlePay = async (item) => {
if (isPayDisabled(item)) return;
......@@ -493,16 +495,20 @@ const makeInvoiceFN = (item) => {
const handleReIssue = async (item) => {
if (isReIssueDisabled(item)) return
const { confirm } = await uni.showModal({
title: '提示',
content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。'
openConfirmPopup({
order: item,
content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。',
action: confirmReIssue
})
if (!confirm) return
}
const confirmReIssue = async (item) => {
if (!item) return
try {
uni.showLoading({ title: '处理中...' })
await api.invoiceFastRed(item.id)
uni.hideLoading()
closeConfirmPopup()
await initData()
makeInvoiceFN({ ...item, invoiceStatus: '0' })
} catch (e) {
......@@ -553,10 +559,11 @@ const closeInvoiceWebview = () => {
// 取消订单
const handleCancel = (item) => {
if (isCancelDisabled(item)) return
currentOrder.value = item;
cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`;
showCancelPopup.value = true;
isPopupOpen.value = true;
openConfirmPopup({
order: item,
content: `是否确认取消缴费编号为"${item.wfCode}"的订单?`,
action: confirmCancel
})
};
// 确认取消订单
......@@ -568,30 +575,27 @@ const confirmCancel = async () => {
pageNum.value = 1;
list.value = [];
await initData();
closeCancelPopup();
closeConfirmPopup();
} catch (e) {
uni.showToast({title: '取消失败', icon: 'error'});
}
};
// 关闭取消订单弹窗
const closeCancelPopup = () => {
showCancelPopup.value = false;
isPopupOpen.value = false;
currentOrder.value = null;
};
const handleRefund = async (item) => {
if (isRefundDisabled(item)) return
const { confirm } = await uni.showModal({
title: '提示',
content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`
openConfirmPopup({
order: item,
content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`,
action: confirmRefund
})
if (!confirm) return
}
const confirmRefund = async (item) => {
if (!item) return
try {
uni.showLoading({ title: '处理中...' })
await api.refundOrder(item.id)
closeConfirmPopup()
uni.showToast({ title: '操作成功', icon: 'success' })
pageNum.value = 1
list.value = []
......
......@@ -453,6 +453,13 @@
}
},
{
"path": "mobilizeRecord",
"style": {
"navigationBarTitleText": "调动记录",
"enablePullDownRefresh": false
}
},
{
"path": "order",
"style": {
"navigationBarTitleText": "订单列表",
......
......@@ -113,7 +113,7 @@
<button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(item)" class="btn btn-danger" @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 :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>
<template v-if="canShowInvoiceApply(item)">
<button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
......@@ -192,26 +192,14 @@
</view>
</view>
<!-- 自定义删除确认弹窗 -->
<view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup">
<!-- 自定义确认弹窗 -->
<view v-if="showConfirmPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeConfirmPopup">
<view class="custom-modal" @click.stop>
<view class="modal-title">提示</view>
<view class="modal-content">{{ delModalContent }}</view>
<view class="modal-content">{{ confirmModalContent }}</view>
<view class="modal-btns">
<button class="modal-btn-cancel" @click="closeDelPopup">取消</button>
<button class="modal-btn-confirm" @click="confirmDel">确定</button>
</view>
</view>
</view>
<!-- 自定义取消订单确认弹窗 -->
<view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup">
<view class="custom-modal" @click.stop>
<view class="modal-title">提示</view>
<view class="modal-content">{{ cancelModalContent }}</view>
<view class="modal-btns">
<button class="modal-btn-cancel" @click="closeCancelPopup">取消</button>
<button class="modal-btn-confirm" @click="confirmCancel">确定</button>
<button class="modal-btn-cancel" @click="closeConfirmPopup">取消</button>
<button class="modal-btn-confirm" @click="confirmPopup">确定</button>
</view>
</view>
</view>
......@@ -267,8 +255,7 @@ const queryParams = reactive({
});
// 弹窗控制
const showDelPopup = ref(false);
const showCancelPopup = ref(false);
const showConfirmPopup = ref(false);
const isPopupOpen = ref(false);
const showInvoicePopup = ref(false);
const showInvoiceWebview = ref(false);
......@@ -276,8 +263,8 @@ const invoiceWebviewUrl = ref('');
const invoiceData = ref({});
// 弹窗内容
const delModalContent = ref('');
const cancelModalContent = ref('');
const confirmModalContent = ref('');
const confirmModalAction = ref(null);
// 当前操作的订单
const currentOrder = ref(null);
......@@ -504,12 +491,34 @@ const handelSearch = () => {
initData()
}
const openConfirmPopup = ({ content, action, order = null }) => {
currentOrder.value = order
confirmModalContent.value = content
confirmModalAction.value = action
showConfirmPopup.value = true
isPopupOpen.value = true
}
const closeConfirmPopup = () => {
showConfirmPopup.value = false
isPopupOpen.value = false
currentOrder.value = null
confirmModalContent.value = ''
confirmModalAction.value = null
}
const confirmPopup = async () => {
if (typeof confirmModalAction.value !== 'function') return
await confirmModalAction.value(currentOrder.value)
}
// 删除订单
const handleDelete = (item) => {
currentOrder.value = item;
delModalContent.value = `是否确认删除订单编号为"${item.tradeNo}"的订单?`;
showDelPopup.value = true;
isPopupOpen.value = true;
openConfirmPopup({
order: item,
content: `是否确认删除订单编号为"${item.tradeNo}"的订单?`,
action: confirmDel
})
};
// 确认删除
......@@ -521,7 +530,7 @@ const confirmDel = async () => {
pageNum.value = 1;
list.value = [];
await initData();
closeDelPopup();
closeConfirmPopup();
} catch (e) {
uni.showToast({title: '删除失败', icon: 'error'});
}
......@@ -546,13 +555,6 @@ const goToDetail = (item) => {
// uni.navigateTo({url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${queryParams.type}`});
}
// 关闭删除弹窗
const closeDelPopup = () => {
showDelPopup.value = false;
isPopupOpen.value = false;
currentOrder.value = null;
};
// 去支付:个人会员订单走 payOrder,再次支付携带 common/order 的 id;单位会员订单走 goPay;级位/段位/越段考试走 paymentDetail。
const handlePay = async (item) => {
if (isPayDisabled(item)) return;
......@@ -605,16 +607,20 @@ const makeInvoiceFN = (item) => {
const handleReIssue = async (item) => {
if (isReIssueDisabled(item)) return
const { confirm } = await uni.showModal({
title: '提示',
content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。'
openConfirmPopup({
order: item,
content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。',
action: confirmReIssue
})
if (!confirm) return
}
const confirmReIssue = async (item) => {
if (!item) return
try {
uni.showLoading({ title: '处理中...' })
await api.invoiceFastRed(item.id)
uni.hideLoading()
closeConfirmPopup()
await initData()
makeInvoiceFN({ ...item, invoiceStatus: '0' })
} catch (e) {
......@@ -665,10 +671,11 @@ const closeInvoiceWebview = () => {
// 取消订单
const handleCancel = (item) => {
if (isCancelDisabled(item)) return
currentOrder.value = item;
cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`;
showCancelPopup.value = true;
isPopupOpen.value = true;
openConfirmPopup({
order: item,
content: `是否确认取消缴费编号为"${item.wfCode}"的订单?`,
action: confirmCancel
})
};
// 确认取消订单
......@@ -680,30 +687,27 @@ const confirmCancel = async () => {
pageNum.value = 1;
list.value = [];
await initData();
closeCancelPopup();
closeConfirmPopup();
} catch (e) {
uni.showToast({title: '取消失败', icon: 'error'});
}
};
// 关闭取消订单弹窗
const closeCancelPopup = () => {
showCancelPopup.value = false;
isPopupOpen.value = false;
currentOrder.value = null;
};
const handleRefund = async (item) => {
if (isRefundDisabled(item)) return
const { confirm } = await uni.showModal({
title: '提示',
content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`
openConfirmPopup({
order: item,
content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`,
action: confirmRefund
})
if (!confirm) return
}
const confirmRefund = async (item) => {
if (!item) return
try {
uni.showLoading({ title: '处理中...' })
await api.refundOrder(item.id)
closeConfirmPopup()
uni.showToast({ title: '操作成功', icon: 'success' })
pageNum.value = 1
list.value = []
......
......@@ -199,6 +199,7 @@
<image :src="config.baseUrl_api+'/fs/static/icon/28.png'"/>
订单列表
</view>
</view>
<view class="ttt">单位会员</view>
<view class="girdBox">
......@@ -398,6 +399,10 @@
<image :src="config.baseUrl_api+'/fs/static/icon/6.png'"/>
订单列表
</view>
<view @click="goPath('/personalVip/mobilizeRecord')">
<image :src="config.baseUrl_api+'/fs/static/icon/1.png'"/>
调动记录
</view>
</view>
<view class="ttt">单位会员</view>
......
......@@ -223,8 +223,8 @@ console.log(333, perInfo.value)
// 是否已绑定学员(根据会员卡号判断)
const isBound = computed(() => {
const perCode = perInfo.value?.perCode
return perCode !== undefined && perCode !== null && perCode !== ''
const perName = perInfo.value?.perName
return perName !== undefined && perName !== null && perName !== ''
})
const bindPopup = ref(null)
......
......@@ -58,8 +58,9 @@
<view class="data-header">
<text class="value">
<text class="tradeNo">订单编号:</text>
{{ item.tradeNo || '——' }}
</text>
<text> {{ item.tradeNo || '——' }}</text>
</view>
</view>
</view>
......@@ -124,22 +125,15 @@
<button class="btn btn-pay" @click.stop="goPay(item)">去缴费</button>
</template> -->
<button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button>
<button v-if="item.auditStatus == 9" class="btn btn-info" @click.stop="handleCancel(item)">取消</button>
<template v-if="item.auditStatus == 9">
<button class="btn btn-pay" @click.stop="goPay(item)">支付</button>
</template>
<!-- <button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button> -->
<button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="goPay(item)">去支付</button>
<button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-info" @click.stop="handleCancel(item)">取消订单</button>
<!-- 已缴费:申请开票/已开票(需要审核通过才能开票) -->
<template v-if="item.payStatus == 1 && item.invoiceStatus != 1 && item.auditStatus == 2 && item.price > 0">
<button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice"
@click.stop="makeInvoiceFN(item)">
开票
<template v-if="canShowInvoiceApply(item)">
<button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">
申请开票
</button>
</template>
<!-- 已开票:查看发票 -->
<template v-if="item.invoiceStatus == 1">
<button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button>
</template>
</view>
</view>
</view>
......@@ -278,6 +272,28 @@ const getAuditStatusText = (status) => {
};
return map[status] || '';
};
const hasInvoice = (item) => String(item?.invoiceStatus) === '1';
const isPayDisabled = (item) => {
return String(item?.auditStatus) !== '9';
};
const canShowCancel = (item) => {
return String(item?.auditStatus) === '9';
};
const isCancelDisabled = (item) => {
return String(item?.auditStatus) !== '9';
};
const canShowInvoiceApply = (item) => !hasInvoice(item);
const isInvoiceDisabled = (item) => {
if (hasInvoice(item)) return true;
return String(item?.auditStatus) !== '2' || String(item?.payStatus) === '4';
};
onLoad((options) => {
// queryParams.perId = options.perId || userInfo.value.perId
initData();
......@@ -382,6 +398,7 @@ const goToDetail = (item) => {
// 去缴费
const goPay = (item) => {
if (isPayDisabled(item)) return;
const baseFormData = {
rangeId: item.sourceId || item.id,
payYear: item.content?.yearCount || 1,
......@@ -440,6 +457,7 @@ const handlePay = async (item) => {
// 申请开票
const makeInvoiceFN = (item) => {
if (isInvoiceDisabled(item)) return;
needRefresh.value = true;
uni.navigateTo({
url: `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}&type=1`
......@@ -466,6 +484,7 @@ const closeInvoicePopup = () => {
// 取消订单
const handleCancel = (item) => {
if (isCancelDisabled(item)) return;
currentOrder.value = item;
cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`;
showCancelPopup.value = true;
......@@ -781,9 +800,12 @@ const closeCancelPopup = () => {
border: 1rpx solid #c30d23;
}
&:disabled {
&:disabled,
&.disabled {
opacity: 0.6;
pointer-events: none;
color: #999;
border-color: #ddd;
background: #f5f5f5;
}
}
}
......
<template>
<view>
<view class="appList">
<view class="appItem" v-for="(item,index) in list" :key="index" @click="goDetail(item)">
<view class="status">
<text :class="statusClass(item)">{{ statusText(item) }}</text>
</view>
<view class="name mt0">
{{ item.name || '调动记录' }}
</view>
<view class="flexbox" v-if="deptType == 1 || deptType == 2 || deptType == 3">
<view class="w50">
申请调入单位
<view><text>{{ item.targetDeptName || '-' }}</text></view>
</view>
<view class="w50">
会员合计
<view>{{ item.personCount || 0 }}</view>
</view>
</view>
<view v-else class="pp">
会员合计:
<text class="text-primary">{{ item.personCount || 0 }}</text>
</view>
</view>
</view>
<view class="nodata" v-if="list.length==0 && !loading">
<image mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image>
<text>暂无数据</text>
</view>
</view>
</template>
<script setup>
import * as api from '@/common/api.js'
import config from '@/config.js'
import { ref } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
const app = getApp()
const queryParams = ref({})
const list = ref([])
const total = ref(0)
const deptType = ref('')
const loading = ref(false)
const hasInited = ref(false)
onLoad(() => {
if (app.globalData.isLogin) {
init()
} else {
app.firstLoadCallback = () => {
init()
}
}
})
onShow(() => {
if (hasInited.value) {
getList()
}
})
function init() {
deptType.value = app.globalData.deptType
queryParams.value = {}
if (deptType.value == 2 || deptType.value == 3) {
queryParams.value.dgId = -1
}
if (deptType.value == 1) {
queryParams.value.dgId = -2
}
if (deptType.value == 6) {
queryParams.value.dgId = 1
}
hasInited.value = true
getList()
}
function getList() {
loading.value = true
uni.showLoading({
title: '加载中',
mask: true
})
api.getMobilizelist(queryParams.value).then(res => {
list.value = res.rows || []
total.value = res.total || 0
}).finally(() => {
loading.value = false
uni.hideLoading()
})
}
function statusText(item) {
if (deptType.value == 1) {
const map = {
0: '审核中',
1: '审核通过',
2: '审核拒绝',
3: '撤销申请'
}
return map[item.ztxRes] || '-'
}
if (deptType.value == 2 || deptType.value == 3) {
const map = {
0: '审核中',
1: '审核通过',
2: '审核拒绝',
3: '撤销申请'
}
return map[item.shenRes] || '-'
}
const map = {
0: '待提交',
1: '审核中',
2: '审核拒绝',
3: '审核通过',
4: '已撤回'
}
return map[item.status] || '-'
}
function statusClass(item) {
const value = deptType.value == 1 ? item.ztxRes : (deptType.value == 2 || deptType.value == 3 ? item.shenRes : item.status)
if (value == 1 || value == 3) return 'text-success'
if (value == 2 || value == 4) return 'text-danger'
return 'text-primary'
}
function goDetail(item) {
const auditLog = encodeURIComponent(JSON.stringify(item.auditLog))
const form = encodeURIComponent(JSON.stringify(item))
uni.navigateTo({
url: `/personalVip/mobilizeDetail?rangeId=${item.id}&auditLog=${auditLog}&form=${form}`
})
}
</script>
<style scoped lang="scss">
.mt0 {
margin-top: 0 !important;
}
.appList .appItem .name {
width: 80%;
word-break: break-all;
}
</style>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!