0ac7b897 by lttnew

调动记录

1 parent e0c6e843
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
17 </view> 17 </view>
18 <view class="info-row"> 18 <view class="info-row">
19 <text class="label">审核状态</text> 19 <text class="label">审核状态</text>
20 <text :class="getStatusClass(form.auditStatus)" class="value"> 20 <text :class="getStatusClass(getCurrentAuditStatus())" class="value">
21 {{ getStatusText(userType == 1 ? form.auditStatus : form.shenAuditStatus) }} 21 {{ getStatusText(getCurrentAuditStatus()) }}
22 </text> 22 </text>
23 </view> 23 </view>
24 <view class="info-row"> 24 <view class="info-row">
25 <text class="label">是否需要</text> 25 <text class="label">是否需要省级协会指派</text>
26 <text class="value">{{ form.selfSelect == 1 ? '否' : '是' }}</text> 26 <text class="value">{{ form.selfSelect == 1 ? '否' : '是' }}</text>
27 </view> 27 </view>
28 <view class="info-row"> 28 <view class="info-row">
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
35 </view> 35 </view>
36 <view class="info-row"> 36 <view class="info-row">
37 <text class="label">审核日期</text> 37 <text class="label">审核日期</text>
38 <text class="value">{{ formatDate(form.auditTime) }}</text> 38 <text class="value">{{ formatDate(getCurrentAuditTime()) }}</text>
39 </view> 39 </view>
40 <view class="info-row"> 40 <view class="info-row">
41 <text class="label">考官</text> 41 <text class="label">考官</text>
...@@ -145,6 +145,14 @@ function getStatusClass(status) { ...@@ -145,6 +145,14 @@ function getStatusClass(status) {
145 return classMap[status] || '' 145 return classMap[status] || ''
146 } 146 }
147 147
148 function getCurrentAuditStatus() {
149 return userType.value == 1 ? form.value.auditStatus : form.value.shenAuditStatus
150 }
151
152 function getCurrentAuditTime() {
153 return userType.value == 1 ? form.value.auditTime : form.value.shenAuditTime
154 }
155
148 function formatDate(dateStr) { 156 function formatDate(dateStr) {
149 if (!dateStr) return '-' 157 if (!dateStr) return '-'
150 return dateStr.substring(0, 10) 158 return dateStr.substring(0, 10)
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
81 <button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(item)" class="btn btn-pay" @click.stop="handleRefund(item)">退款</button> 81 <button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(item)" class="btn btn-pay" @click.stop="handleRefund(item)">退款</button>
82 </template> 82 </template>
83 <template v-else> 83 <template v-else>
84 <button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="handlePay(item)">支付</button> 84 <button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="handlePay(item)">支付</button>
85 <button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button> 85 <button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
86 <template v-if="canShowInvoiceApply(item)"> 86 <template v-if="canShowInvoiceApply(item)">
87 <button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button> 87 <button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
...@@ -160,26 +160,14 @@ ...@@ -160,26 +160,14 @@
160 </view> 160 </view>
161 </view> 161 </view>
162 162
163 <!-- 自定义删除确认弹窗 --> 163 <!-- 自定义确认弹窗 -->
164 <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup"> 164 <view v-if="showConfirmPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeConfirmPopup">
165 <view class="custom-modal" @click.stop> 165 <view class="custom-modal" @click.stop>
166 <view class="modal-title">提示</view> 166 <view class="modal-title">提示</view>
167 <view class="modal-content">{{ delModalContent }}</view> 167 <view class="modal-content">{{ confirmModalContent }}</view>
168 <view class="modal-btns"> 168 <view class="modal-btns">
169 <button class="modal-btn-cancel" @click="closeDelPopup">取消</button> 169 <button class="modal-btn-cancel" @click="closeConfirmPopup">取消</button>
170 <button class="modal-btn-confirm" @click="confirmDel">确定</button> 170 <button class="modal-btn-confirm" @click="confirmPopup">确定</button>
171 </view>
172 </view>
173 </view>
174
175 <!-- 自定义取消订单确认弹窗 -->
176 <view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup">
177 <view class="custom-modal" @click.stop>
178 <view class="modal-title">提示</view>
179 <view class="modal-content">{{ cancelModalContent }}</view>
180 <view class="modal-btns">
181 <button class="modal-btn-cancel" @click="closeCancelPopup">取消</button>
182 <button class="modal-btn-confirm" @click="confirmCancel">确定</button>
183 </view> 171 </view>
184 </view> 172 </view>
185 </view> 173 </view>
...@@ -222,8 +210,7 @@ const queryParams = reactive({ ...@@ -222,8 +210,7 @@ const queryParams = reactive({
222 }); 210 });
223 211
224 // 弹窗控制 212 // 弹窗控制
225 const showDelPopup = ref(false); 213 const showConfirmPopup = ref(false);
226 const showCancelPopup = ref(false);
227 const isPopupOpen = ref(false); 214 const isPopupOpen = ref(false);
228 const showInvoicePopup = ref(false); 215 const showInvoicePopup = ref(false);
229 const showInvoiceWebview = ref(false); 216 const showInvoiceWebview = ref(false);
...@@ -231,8 +218,8 @@ const invoiceWebviewUrl = ref(''); ...@@ -231,8 +218,8 @@ const invoiceWebviewUrl = ref('');
231 const invoiceData = ref({}); 218 const invoiceData = ref({});
232 219
233 // 弹窗内容 220 // 弹窗内容
234 const delModalContent = ref(''); 221 const confirmModalContent = ref('');
235 const cancelModalContent = ref(''); 222 const confirmModalAction = ref(null);
236 223
237 // 当前操作的订单 224 // 当前操作的订单
238 const currentOrder = ref(null); 225 const currentOrder = ref(null);
...@@ -418,12 +405,34 @@ const handelSearch = () => { ...@@ -418,12 +405,34 @@ const handelSearch = () => {
418 initData() 405 initData()
419 } 406 }
420 407
408 const openConfirmPopup = ({ content, action, order = null }) => {
409 currentOrder.value = order
410 confirmModalContent.value = content
411 confirmModalAction.value = action
412 showConfirmPopup.value = true
413 isPopupOpen.value = true
414 }
415
416 const closeConfirmPopup = () => {
417 showConfirmPopup.value = false
418 isPopupOpen.value = false
419 currentOrder.value = null
420 confirmModalContent.value = ''
421 confirmModalAction.value = null
422 }
423
424 const confirmPopup = async () => {
425 if (typeof confirmModalAction.value !== 'function') return
426 await confirmModalAction.value(currentOrder.value)
427 }
428
421 // 删除订单 429 // 删除订单
422 const handleDelete = (item) => { 430 const handleDelete = (item) => {
423 currentOrder.value = item; 431 openConfirmPopup({
424 delModalContent.value = `是否确认删除订单编号为"${item.tradeNo}"的订单?`; 432 order: item,
425 showDelPopup.value = true; 433 content: `是否确认删除订单编号为"${item.tradeNo}"的订单?`,
426 isPopupOpen.value = true; 434 action: confirmDel
435 })
427 }; 436 };
428 437
429 // 确认删除 438 // 确认删除
...@@ -435,7 +444,7 @@ const confirmDel = async () => { ...@@ -435,7 +444,7 @@ const confirmDel = async () => {
435 pageNum.value = 1; 444 pageNum.value = 1;
436 list.value = []; 445 list.value = [];
437 await initData(); 446 await initData();
438 closeDelPopup(); 447 closeConfirmPopup();
439 } catch (e) { 448 } catch (e) {
440 uni.showToast({title: '删除失败', icon: 'error'}); 449 uni.showToast({title: '删除失败', icon: 'error'});
441 } 450 }
...@@ -455,13 +464,6 @@ const goToDetail = (item) => { ...@@ -455,13 +464,6 @@ const goToDetail = (item) => {
455 } 464 }
456 } 465 }
457 466
458 // 关闭删除弹窗
459 const closeDelPopup = () => {
460 showDelPopup.value = false;
461 isPopupOpen.value = false;
462 currentOrder.value = null;
463 };
464
465 // 去缴费 467 // 去缴费
466 const handlePay = async (item) => { 468 const handlePay = async (item) => {
467 if (isPayDisabled(item)) return; 469 if (isPayDisabled(item)) return;
...@@ -493,16 +495,20 @@ const makeInvoiceFN = (item) => { ...@@ -493,16 +495,20 @@ const makeInvoiceFN = (item) => {
493 495
494 const handleReIssue = async (item) => { 496 const handleReIssue = async (item) => {
495 if (isReIssueDisabled(item)) return 497 if (isReIssueDisabled(item)) return
496 const { confirm } = await uni.showModal({ 498 openConfirmPopup({
497 title: '提示', 499 order: item,
498 content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。' 500 content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。',
501 action: confirmReIssue
499 }) 502 })
500 if (!confirm) return 503 }
501 504
505 const confirmReIssue = async (item) => {
506 if (!item) return
502 try { 507 try {
503 uni.showLoading({ title: '处理中...' }) 508 uni.showLoading({ title: '处理中...' })
504 await api.invoiceFastRed(item.id) 509 await api.invoiceFastRed(item.id)
505 uni.hideLoading() 510 uni.hideLoading()
511 closeConfirmPopup()
506 await initData() 512 await initData()
507 makeInvoiceFN({ ...item, invoiceStatus: '0' }) 513 makeInvoiceFN({ ...item, invoiceStatus: '0' })
508 } catch (e) { 514 } catch (e) {
...@@ -553,10 +559,11 @@ const closeInvoiceWebview = () => { ...@@ -553,10 +559,11 @@ const closeInvoiceWebview = () => {
553 // 取消订单 559 // 取消订单
554 const handleCancel = (item) => { 560 const handleCancel = (item) => {
555 if (isCancelDisabled(item)) return 561 if (isCancelDisabled(item)) return
556 currentOrder.value = item; 562 openConfirmPopup({
557 cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`; 563 order: item,
558 showCancelPopup.value = true; 564 content: `是否确认取消缴费编号为"${item.wfCode}"的订单?`,
559 isPopupOpen.value = true; 565 action: confirmCancel
566 })
560 }; 567 };
561 568
562 // 确认取消订单 569 // 确认取消订单
...@@ -568,30 +575,27 @@ const confirmCancel = async () => { ...@@ -568,30 +575,27 @@ const confirmCancel = async () => {
568 pageNum.value = 1; 575 pageNum.value = 1;
569 list.value = []; 576 list.value = [];
570 await initData(); 577 await initData();
571 closeCancelPopup(); 578 closeConfirmPopup();
572 } catch (e) { 579 } catch (e) {
573 uni.showToast({title: '取消失败', icon: 'error'}); 580 uni.showToast({title: '取消失败', icon: 'error'});
574 } 581 }
575 }; 582 };
576 583
577 // 关闭取消订单弹窗
578 const closeCancelPopup = () => {
579 showCancelPopup.value = false;
580 isPopupOpen.value = false;
581 currentOrder.value = null;
582 };
583
584 const handleRefund = async (item) => { 584 const handleRefund = async (item) => {
585 if (isRefundDisabled(item)) return 585 if (isRefundDisabled(item)) return
586 const { confirm } = await uni.showModal({ 586 openConfirmPopup({
587 title: '提示', 587 order: item,
588 content: `缴费编号为"${item.wfCode}"的订单是否确认退款?` 588 content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`,
589 action: confirmRefund
589 }) 590 })
590 if (!confirm) return 591 }
591 592
593 const confirmRefund = async (item) => {
594 if (!item) return
592 try { 595 try {
593 uni.showLoading({ title: '处理中...' }) 596 uni.showLoading({ title: '处理中...' })
594 await api.refundOrder(item.id) 597 await api.refundOrder(item.id)
598 closeConfirmPopup()
595 uni.showToast({ title: '操作成功', icon: 'success' }) 599 uni.showToast({ title: '操作成功', icon: 'success' })
596 pageNum.value = 1 600 pageNum.value = 1
597 list.value = [] 601 list.value = []
......
...@@ -453,6 +453,13 @@ ...@@ -453,6 +453,13 @@
453 } 453 }
454 }, 454 },
455 { 455 {
456 "path": "mobilizeRecord",
457 "style": {
458 "navigationBarTitleText": "调动记录",
459 "enablePullDownRefresh": false
460 }
461 },
462 {
456 "path": "order", 463 "path": "order",
457 "style": { 464 "style": {
458 "navigationBarTitleText": "订单列表", 465 "navigationBarTitleText": "订单列表",
......
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
113 <button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(item)" class="btn btn-danger" @click.stop="handleRefund(item)">退款</button> 113 <button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(item)" class="btn btn-danger" @click.stop="handleRefund(item)">退款</button>
114 </template> 114 </template>
115 <template v-else> 115 <template v-else>
116 <button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="handlePay(item)">支付</button> 116 <button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="handlePay(item)">支付</button>
117 <button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button> 117 <button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
118 <template v-if="canShowInvoiceApply(item)"> 118 <template v-if="canShowInvoiceApply(item)">
119 <button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button> 119 <button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
...@@ -192,26 +192,14 @@ ...@@ -192,26 +192,14 @@
192 </view> 192 </view>
193 </view> 193 </view>
194 194
195 <!-- 自定义删除确认弹窗 --> 195 <!-- 自定义确认弹窗 -->
196 <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup"> 196 <view v-if="showConfirmPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeConfirmPopup">
197 <view class="custom-modal" @click.stop> 197 <view class="custom-modal" @click.stop>
198 <view class="modal-title">提示</view> 198 <view class="modal-title">提示</view>
199 <view class="modal-content">{{ delModalContent }}</view> 199 <view class="modal-content">{{ confirmModalContent }}</view>
200 <view class="modal-btns"> 200 <view class="modal-btns">
201 <button class="modal-btn-cancel" @click="closeDelPopup">取消</button> 201 <button class="modal-btn-cancel" @click="closeConfirmPopup">取消</button>
202 <button class="modal-btn-confirm" @click="confirmDel">确定</button> 202 <button class="modal-btn-confirm" @click="confirmPopup">确定</button>
203 </view>
204 </view>
205 </view>
206
207 <!-- 自定义取消订单确认弹窗 -->
208 <view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup">
209 <view class="custom-modal" @click.stop>
210 <view class="modal-title">提示</view>
211 <view class="modal-content">{{ cancelModalContent }}</view>
212 <view class="modal-btns">
213 <button class="modal-btn-cancel" @click="closeCancelPopup">取消</button>
214 <button class="modal-btn-confirm" @click="confirmCancel">确定</button>
215 </view> 203 </view>
216 </view> 204 </view>
217 </view> 205 </view>
...@@ -267,8 +255,7 @@ const queryParams = reactive({ ...@@ -267,8 +255,7 @@ const queryParams = reactive({
267 }); 255 });
268 256
269 // 弹窗控制 257 // 弹窗控制
270 const showDelPopup = ref(false); 258 const showConfirmPopup = ref(false);
271 const showCancelPopup = ref(false);
272 const isPopupOpen = ref(false); 259 const isPopupOpen = ref(false);
273 const showInvoicePopup = ref(false); 260 const showInvoicePopup = ref(false);
274 const showInvoiceWebview = ref(false); 261 const showInvoiceWebview = ref(false);
...@@ -276,8 +263,8 @@ const invoiceWebviewUrl = ref(''); ...@@ -276,8 +263,8 @@ const invoiceWebviewUrl = ref('');
276 const invoiceData = ref({}); 263 const invoiceData = ref({});
277 264
278 // 弹窗内容 265 // 弹窗内容
279 const delModalContent = ref(''); 266 const confirmModalContent = ref('');
280 const cancelModalContent = ref(''); 267 const confirmModalAction = ref(null);
281 268
282 // 当前操作的订单 269 // 当前操作的订单
283 const currentOrder = ref(null); 270 const currentOrder = ref(null);
...@@ -504,12 +491,34 @@ const handelSearch = () => { ...@@ -504,12 +491,34 @@ const handelSearch = () => {
504 initData() 491 initData()
505 } 492 }
506 493
494 const openConfirmPopup = ({ content, action, order = null }) => {
495 currentOrder.value = order
496 confirmModalContent.value = content
497 confirmModalAction.value = action
498 showConfirmPopup.value = true
499 isPopupOpen.value = true
500 }
501
502 const closeConfirmPopup = () => {
503 showConfirmPopup.value = false
504 isPopupOpen.value = false
505 currentOrder.value = null
506 confirmModalContent.value = ''
507 confirmModalAction.value = null
508 }
509
510 const confirmPopup = async () => {
511 if (typeof confirmModalAction.value !== 'function') return
512 await confirmModalAction.value(currentOrder.value)
513 }
514
507 // 删除订单 515 // 删除订单
508 const handleDelete = (item) => { 516 const handleDelete = (item) => {
509 currentOrder.value = item; 517 openConfirmPopup({
510 delModalContent.value = `是否确认删除订单编号为"${item.tradeNo}"的订单?`; 518 order: item,
511 showDelPopup.value = true; 519 content: `是否确认删除订单编号为"${item.tradeNo}"的订单?`,
512 isPopupOpen.value = true; 520 action: confirmDel
521 })
513 }; 522 };
514 523
515 // 确认删除 524 // 确认删除
...@@ -521,7 +530,7 @@ const confirmDel = async () => { ...@@ -521,7 +530,7 @@ const confirmDel = async () => {
521 pageNum.value = 1; 530 pageNum.value = 1;
522 list.value = []; 531 list.value = [];
523 await initData(); 532 await initData();
524 closeDelPopup(); 533 closeConfirmPopup();
525 } catch (e) { 534 } catch (e) {
526 uni.showToast({title: '删除失败', icon: 'error'}); 535 uni.showToast({title: '删除失败', icon: 'error'});
527 } 536 }
...@@ -546,13 +555,6 @@ const goToDetail = (item) => { ...@@ -546,13 +555,6 @@ const goToDetail = (item) => {
546 // uni.navigateTo({url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${queryParams.type}`}); 555 // uni.navigateTo({url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${queryParams.type}`});
547 } 556 }
548 557
549 // 关闭删除弹窗
550 const closeDelPopup = () => {
551 showDelPopup.value = false;
552 isPopupOpen.value = false;
553 currentOrder.value = null;
554 };
555
556 // 去支付:个人会员订单走 payOrder,再次支付携带 common/order 的 id;单位会员订单走 goPay;级位/段位/越段考试走 paymentDetail。 558 // 去支付:个人会员订单走 payOrder,再次支付携带 common/order 的 id;单位会员订单走 goPay;级位/段位/越段考试走 paymentDetail。
557 const handlePay = async (item) => { 559 const handlePay = async (item) => {
558 if (isPayDisabled(item)) return; 560 if (isPayDisabled(item)) return;
...@@ -605,16 +607,20 @@ const makeInvoiceFN = (item) => { ...@@ -605,16 +607,20 @@ const makeInvoiceFN = (item) => {
605 607
606 const handleReIssue = async (item) => { 608 const handleReIssue = async (item) => {
607 if (isReIssueDisabled(item)) return 609 if (isReIssueDisabled(item)) return
608 const { confirm } = await uni.showModal({ 610 openConfirmPopup({
609 title: '提示', 611 order: item,
610 content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。' 612 content: '开票后30天内仅可重开一次,是否确认重新开票?原发票将作废且无法恢复。',
613 action: confirmReIssue
611 }) 614 })
612 if (!confirm) return 615 }
613 616
617 const confirmReIssue = async (item) => {
618 if (!item) return
614 try { 619 try {
615 uni.showLoading({ title: '处理中...' }) 620 uni.showLoading({ title: '处理中...' })
616 await api.invoiceFastRed(item.id) 621 await api.invoiceFastRed(item.id)
617 uni.hideLoading() 622 uni.hideLoading()
623 closeConfirmPopup()
618 await initData() 624 await initData()
619 makeInvoiceFN({ ...item, invoiceStatus: '0' }) 625 makeInvoiceFN({ ...item, invoiceStatus: '0' })
620 } catch (e) { 626 } catch (e) {
...@@ -665,10 +671,11 @@ const closeInvoiceWebview = () => { ...@@ -665,10 +671,11 @@ const closeInvoiceWebview = () => {
665 // 取消订单 671 // 取消订单
666 const handleCancel = (item) => { 672 const handleCancel = (item) => {
667 if (isCancelDisabled(item)) return 673 if (isCancelDisabled(item)) return
668 currentOrder.value = item; 674 openConfirmPopup({
669 cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`; 675 order: item,
670 showCancelPopup.value = true; 676 content: `是否确认取消缴费编号为"${item.wfCode}"的订单?`,
671 isPopupOpen.value = true; 677 action: confirmCancel
678 })
672 }; 679 };
673 680
674 // 确认取消订单 681 // 确认取消订单
...@@ -680,30 +687,27 @@ const confirmCancel = async () => { ...@@ -680,30 +687,27 @@ const confirmCancel = async () => {
680 pageNum.value = 1; 687 pageNum.value = 1;
681 list.value = []; 688 list.value = [];
682 await initData(); 689 await initData();
683 closeCancelPopup(); 690 closeConfirmPopup();
684 } catch (e) { 691 } catch (e) {
685 uni.showToast({title: '取消失败', icon: 'error'}); 692 uni.showToast({title: '取消失败', icon: 'error'});
686 } 693 }
687 }; 694 };
688 695
689 // 关闭取消订单弹窗
690 const closeCancelPopup = () => {
691 showCancelPopup.value = false;
692 isPopupOpen.value = false;
693 currentOrder.value = null;
694 };
695
696 const handleRefund = async (item) => { 696 const handleRefund = async (item) => {
697 if (isRefundDisabled(item)) return 697 if (isRefundDisabled(item)) return
698 const { confirm } = await uni.showModal({ 698 openConfirmPopup({
699 title: '提示', 699 order: item,
700 content: `缴费编号为"${item.wfCode}"的订单是否确认退款?` 700 content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`,
701 action: confirmRefund
701 }) 702 })
702 if (!confirm) return 703 }
703 704
705 const confirmRefund = async (item) => {
706 if (!item) return
704 try { 707 try {
705 uni.showLoading({ title: '处理中...' }) 708 uni.showLoading({ title: '处理中...' })
706 await api.refundOrder(item.id) 709 await api.refundOrder(item.id)
710 closeConfirmPopup()
707 uni.showToast({ title: '操作成功', icon: 'success' }) 711 uni.showToast({ title: '操作成功', icon: 'success' })
708 pageNum.value = 1 712 pageNum.value = 1
709 list.value = [] 713 list.value = []
......
...@@ -199,6 +199,7 @@ ...@@ -199,6 +199,7 @@
199 <image :src="config.baseUrl_api+'/fs/static/icon/28.png'"/> 199 <image :src="config.baseUrl_api+'/fs/static/icon/28.png'"/>
200 订单列表 200 订单列表
201 </view> 201 </view>
202
202 </view> 203 </view>
203 <view class="ttt">单位会员</view> 204 <view class="ttt">单位会员</view>
204 <view class="girdBox"> 205 <view class="girdBox">
...@@ -398,6 +399,10 @@ ...@@ -398,6 +399,10 @@
398 <image :src="config.baseUrl_api+'/fs/static/icon/6.png'"/> 399 <image :src="config.baseUrl_api+'/fs/static/icon/6.png'"/>
399 订单列表 400 订单列表
400 </view> 401 </view>
402 <view @click="goPath('/personalVip/mobilizeRecord')">
403 <image :src="config.baseUrl_api+'/fs/static/icon/1.png'"/>
404 调动记录
405 </view>
401 </view> 406 </view>
402 407
403 <view class="ttt">单位会员</view> 408 <view class="ttt">单位会员</view>
......
...@@ -223,8 +223,8 @@ console.log(333, perInfo.value) ...@@ -223,8 +223,8 @@ console.log(333, perInfo.value)
223 223
224 // 是否已绑定学员(根据会员卡号判断) 224 // 是否已绑定学员(根据会员卡号判断)
225 const isBound = computed(() => { 225 const isBound = computed(() => {
226 const perCode = perInfo.value?.perCode 226 const perName = perInfo.value?.perName
227 return perCode !== undefined && perCode !== null && perCode !== '' 227 return perName !== undefined && perName !== null && perName !== ''
228 }) 228 })
229 229
230 const bindPopup = ref(null) 230 const bindPopup = ref(null)
......
...@@ -58,8 +58,9 @@ ...@@ -58,8 +58,9 @@
58 <view class="data-header"> 58 <view class="data-header">
59 <text class="value"> 59 <text class="value">
60 <text class="tradeNo">订单编号:</text> 60 <text class="tradeNo">订单编号:</text>
61 {{ item.tradeNo || '——' }} 61
62 </text> 62 </text>
63 <text> {{ item.tradeNo || '——' }}</text>
63 </view> 64 </view>
64 </view> 65 </view>
65 </view> 66 </view>
...@@ -124,22 +125,15 @@ ...@@ -124,22 +125,15 @@
124 <button class="btn btn-pay" @click.stop="goPay(item)">去缴费</button> 125 <button class="btn btn-pay" @click.stop="goPay(item)">去缴费</button>
125 </template> --> 126 </template> -->
126 127
127 <button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button> 128 <!-- <button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button> -->
128 <button v-if="item.auditStatus == 9" class="btn btn-info" @click.stop="handleCancel(item)">取消</button> 129 <button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="goPay(item)">去支付</button>
129 <template v-if="item.auditStatus == 9"> 130 <button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-info" @click.stop="handleCancel(item)">取消订单</button>
130 <button class="btn btn-pay" @click.stop="goPay(item)">支付</button>
131 </template>
132 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> 131 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) -->
133 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1 && item.auditStatus == 2 && item.price > 0"> 132 <template v-if="canShowInvoiceApply(item)">
134 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice" 133 <button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">
135 @click.stop="makeInvoiceFN(item)"> 134 申请开票
136 开票
137 </button> 135 </button>
138 </template> 136 </template>
139 <!-- 已开票:查看发票 -->
140 <template v-if="item.invoiceStatus == 1">
141 <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button>
142 </template>
143 </view> 137 </view>
144 </view> 138 </view>
145 </view> 139 </view>
...@@ -278,6 +272,28 @@ const getAuditStatusText = (status) => { ...@@ -278,6 +272,28 @@ const getAuditStatusText = (status) => {
278 }; 272 };
279 return map[status] || ''; 273 return map[status] || '';
280 }; 274 };
275
276 const hasInvoice = (item) => String(item?.invoiceStatus) === '1';
277
278 const isPayDisabled = (item) => {
279 return String(item?.auditStatus) !== '9';
280 };
281
282 const canShowCancel = (item) => {
283 return String(item?.auditStatus) === '9';
284 };
285
286 const isCancelDisabled = (item) => {
287 return String(item?.auditStatus) !== '9';
288 };
289
290 const canShowInvoiceApply = (item) => !hasInvoice(item);
291
292 const isInvoiceDisabled = (item) => {
293 if (hasInvoice(item)) return true;
294 return String(item?.auditStatus) !== '2' || String(item?.payStatus) === '4';
295 };
296
281 onLoad((options) => { 297 onLoad((options) => {
282 // queryParams.perId = options.perId || userInfo.value.perId 298 // queryParams.perId = options.perId || userInfo.value.perId
283 initData(); 299 initData();
...@@ -382,6 +398,7 @@ const goToDetail = (item) => { ...@@ -382,6 +398,7 @@ const goToDetail = (item) => {
382 398
383 // 去缴费 399 // 去缴费
384 const goPay = (item) => { 400 const goPay = (item) => {
401 if (isPayDisabled(item)) return;
385 const baseFormData = { 402 const baseFormData = {
386 rangeId: item.sourceId || item.id, 403 rangeId: item.sourceId || item.id,
387 payYear: item.content?.yearCount || 1, 404 payYear: item.content?.yearCount || 1,
...@@ -440,6 +457,7 @@ const handlePay = async (item) => { ...@@ -440,6 +457,7 @@ const handlePay = async (item) => {
440 457
441 // 申请开票 458 // 申请开票
442 const makeInvoiceFN = (item) => { 459 const makeInvoiceFN = (item) => {
460 if (isInvoiceDisabled(item)) return;
443 needRefresh.value = true; 461 needRefresh.value = true;
444 uni.navigateTo({ 462 uni.navigateTo({
445 url: `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}&type=1` 463 url: `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}&type=1`
...@@ -466,6 +484,7 @@ const closeInvoicePopup = () => { ...@@ -466,6 +484,7 @@ const closeInvoicePopup = () => {
466 484
467 // 取消订单 485 // 取消订单
468 const handleCancel = (item) => { 486 const handleCancel = (item) => {
487 if (isCancelDisabled(item)) return;
469 currentOrder.value = item; 488 currentOrder.value = item;
470 cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`; 489 cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`;
471 showCancelPopup.value = true; 490 showCancelPopup.value = true;
...@@ -781,9 +800,12 @@ const closeCancelPopup = () => { ...@@ -781,9 +800,12 @@ const closeCancelPopup = () => {
781 border: 1rpx solid #c30d23; 800 border: 1rpx solid #c30d23;
782 } 801 }
783 802
784 &:disabled { 803 &:disabled,
804 &.disabled {
785 opacity: 0.6; 805 opacity: 0.6;
786 pointer-events: none; 806 color: #999;
807 border-color: #ddd;
808 background: #f5f5f5;
787 } 809 }
788 } 810 }
789 } 811 }
......
1 <template>
2 <view>
3 <view class="appList">
4 <view class="appItem" v-for="(item,index) in list" :key="index" @click="goDetail(item)">
5 <view class="status">
6 <text :class="statusClass(item)">{{ statusText(item) }}</text>
7 </view>
8
9 <view class="name mt0">
10 {{ item.name || '调动记录' }}
11 </view>
12
13 <view class="flexbox" v-if="deptType == 1 || deptType == 2 || deptType == 3">
14 <view class="w50">
15 申请调入单位
16 <view><text>{{ item.targetDeptName || '-' }}</text></view>
17 </view>
18 <view class="w50">
19 会员合计
20 <view>{{ item.personCount || 0 }}</view>
21 </view>
22 </view>
23
24 <view v-else class="pp">
25 会员合计:
26 <text class="text-primary">{{ item.personCount || 0 }}</text>
27 </view>
28 </view>
29 </view>
30
31 <view class="nodata" v-if="list.length==0 && !loading">
32 <image mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image>
33 <text>暂无数据</text>
34 </view>
35 </view>
36 </template>
37
38 <script setup>
39 import * as api from '@/common/api.js'
40 import config from '@/config.js'
41 import { ref } from 'vue'
42 import { onLoad, onShow } from '@dcloudio/uni-app'
43
44 const app = getApp()
45 const queryParams = ref({})
46 const list = ref([])
47 const total = ref(0)
48 const deptType = ref('')
49 const loading = ref(false)
50 const hasInited = ref(false)
51
52 onLoad(() => {
53 if (app.globalData.isLogin) {
54 init()
55 } else {
56 app.firstLoadCallback = () => {
57 init()
58 }
59 }
60 })
61
62 onShow(() => {
63 if (hasInited.value) {
64 getList()
65 }
66 })
67
68 function init() {
69 deptType.value = app.globalData.deptType
70 queryParams.value = {}
71 if (deptType.value == 2 || deptType.value == 3) {
72 queryParams.value.dgId = -1
73 }
74 if (deptType.value == 1) {
75 queryParams.value.dgId = -2
76 }
77 if (deptType.value == 6) {
78 queryParams.value.dgId = 1
79 }
80 hasInited.value = true
81 getList()
82 }
83
84 function getList() {
85 loading.value = true
86 uni.showLoading({
87 title: '加载中',
88 mask: true
89 })
90 api.getMobilizelist(queryParams.value).then(res => {
91 list.value = res.rows || []
92 total.value = res.total || 0
93 }).finally(() => {
94 loading.value = false
95 uni.hideLoading()
96 })
97 }
98
99 function statusText(item) {
100 if (deptType.value == 1) {
101 const map = {
102 0: '审核中',
103 1: '审核通过',
104 2: '审核拒绝',
105 3: '撤销申请'
106 }
107 return map[item.ztxRes] || '-'
108 }
109 if (deptType.value == 2 || deptType.value == 3) {
110 const map = {
111 0: '审核中',
112 1: '审核通过',
113 2: '审核拒绝',
114 3: '撤销申请'
115 }
116 return map[item.shenRes] || '-'
117 }
118 const map = {
119 0: '待提交',
120 1: '审核中',
121 2: '审核拒绝',
122 3: '审核通过',
123 4: '已撤回'
124 }
125 return map[item.status] || '-'
126 }
127
128 function statusClass(item) {
129 const value = deptType.value == 1 ? item.ztxRes : (deptType.value == 2 || deptType.value == 3 ? item.shenRes : item.status)
130 if (value == 1 || value == 3) return 'text-success'
131 if (value == 2 || value == 4) return 'text-danger'
132 return 'text-primary'
133 }
134
135 function goDetail(item) {
136 const auditLog = encodeURIComponent(JSON.stringify(item.auditLog))
137 const form = encodeURIComponent(JSON.stringify(item))
138 uni.navigateTo({
139 url: `/personalVip/mobilizeDetail?rangeId=${item.id}&auditLog=${auditLog}&form=${form}`
140 })
141 }
142 </script>
143
144 <style scoped lang="scss">
145 .mt0 {
146 margin-top: 0 !important;
147 }
148
149 .appList .appItem .name {
150 width: 80%;
151 word-break: break-all;
152 }
153 </style>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!