diff --git a/backend/app/services/sample_payment_progress.py b/backend/app/services/sample_payment_progress.py index 7a1fb345..33497a3a 100644 --- a/backend/app/services/sample_payment_progress.py +++ b/backend/app/services/sample_payment_progress.py @@ -25,9 +25,9 @@ def compute_sample_payment_progress( transfers: Iterable[Mapping[str, Any]], ) -> Dict[str, Any]: """ - progressStatus 优先级:jfqrz > yjq > bfyj > dfj + progressStatus 优先级:yjq > bfyj > dfj(不含付款确认中) 已缴仅计 pay_status=yjf;有效期排除 schedule_status=void - canConfirm:无 jfqrz,且存在有效未清期(欠缴>0)或可编辑的 dfj 草稿 + canConfirm:无 jfqrz,且存在有效未清期 """ sch_list: List[Mapping[str, Any]] = list(schedules or []) tr_list: List[Mapping[str, Any]] = list(transfers or []) @@ -59,9 +59,7 @@ def compute_sample_payment_progress( has_jfqrz = any(_status(t, "payStatus", "pay_status") == "jfqrz" for t in tr_list) - if has_jfqrz: - progress = "jfqrz" - elif active_schedule_count > 0 and cleared_schedule_count == active_schedule_count: + if active_schedule_count > 0 and cleared_schedule_count == active_schedule_count: progress = "yjq" elif paid > 0: progress = "bfyj" diff --git a/backend/tests/test_sample_payment_progress.py b/backend/tests/test_sample_payment_progress.py index 3401a9c9..7e6fa65c 100644 --- a/backend/tests/test_sample_payment_progress.py +++ b/backend/tests/test_sample_payment_progress.py @@ -23,7 +23,8 @@ class TestSamplePaymentProgress(unittest.TestCase): self.assertEqual(r["activeScheduleCount"], 1) self.assertTrue(r["canConfirm"]) - def test_confirming_wins_over_partial(self): + def test_confirming_does_not_set_progress_status(self): + """付款确认中不再作为样本缴费进度;有 yjf 则部分已缴,仍不可再提交确认。""" r = compute_sample_payment_progress( schedules=[ {"id": "s1", "scheduleStatus": "open", "dueAmount": Decimal("1000")}, @@ -33,10 +34,24 @@ class TestSamplePaymentProgress(unittest.TestCase): {"scheduleId": "s1", "payStatus": "jfqrz", "transferAmount": Decimal("100")}, ], ) - self.assertEqual(r["progressStatus"], "jfqrz") + self.assertEqual(r["progressStatus"], "bfyj") self.assertEqual(r["paidAmount"], Decimal("200")) self.assertFalse(r["canConfirm"]) + def test_confirming_only_stays_pending(self): + """仅有付款确认中、尚无 yjf 时,缴费进度仍为待缴费。""" + r = compute_sample_payment_progress( + schedules=[ + {"id": "s1", "scheduleStatus": "open", "dueAmount": Decimal("1000")}, + ], + transfers=[ + {"scheduleId": "s1", "payStatus": "jfqrz", "transferAmount": Decimal("100")}, + ], + ) + self.assertEqual(r["progressStatus"], "dfj") + self.assertEqual(r["paidAmount"], Decimal("0")) + self.assertFalse(r["canConfirm"]) + def test_partial_paid(self): r = compute_sample_payment_progress( schedules=[ diff --git a/mobile-oa-h5/src/market/modules/payment.js b/mobile-oa-h5/src/market/modules/payment.js index f5f49fec..aa5624c0 100644 --- a/mobile-oa-h5/src/market/modules/payment.js +++ b/mobile-oa-h5/src/market/modules/payment.js @@ -4,7 +4,7 @@ const PROTOCOL_STATUS = Object.freeze({ yzf: '已作废', sdfq: '属地废弃', zckc: '转细胞存储', zky: '转科研' }) const PAYMENT_PROGRESS = Object.freeze({ - dfj: '待缴费', jfqrz: '付款确认中', bfyj: '部分已缴', yjq: '已缴清', + dfj: '待缴费', bfyj: '部分已缴', yjq: '已缴清', 待缴费: '待缴费', 部分缴费: '部分缴费', 已缴清: '已缴清' }) const SCHEDULE_STATUS = Object.freeze({ diff --git a/web-admin/src/utils/status-tag-registry.ts b/web-admin/src/utils/status-tag-registry.ts index 2a21c8e7..46d46b3a 100644 --- a/web-admin/src/utils/status-tag-registry.ts +++ b/web-admin/src/utils/status-tag-registry.ts @@ -179,10 +179,9 @@ export const periodFinanceAudit: StatusRegistry = { export const periodFinanceAuditLabel = createLabelGetter(periodFinanceAudit) export const periodFinanceAuditTagType = createTagTypeGetter(periodFinanceAudit) -/** 按样本列表整体进度(勿与转账笔 payStatus 混用:payStatus.dfj=已付款) */ +/** 样本缴费进度 Tag(勿与转账笔 payStatus 混用:payStatus.dfj=已付款) */ export const samplePaymentProgress: StatusRegistry = { dfj: { label: '待缴费', tagType: 'info' }, - jfqrz: { label: '付款确认中', tagType: 'warning' }, bfyj: { label: '部分已缴', tagType: 'primary' }, yjq: { label: '已缴清', tagType: 'success' } } diff --git a/web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue b/web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue index 454022bc..64d00d62 100644 --- a/web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue +++ b/web-admin/src/views/cell-storage/payment-info/PaymentBySampleTab.vue @@ -447,7 +447,6 @@ const progressStatusOptions = [ { value: 'dfj', label: '待缴费' }, - { value: 'jfqrz', label: '付款确认中' }, { value: 'bfyj', label: '部分已缴' }, { value: 'yjq', label: '已缴清' } ] diff --git a/web-admin/src/views/cell-storage/payment-info/PaymentExcelList.vue b/web-admin/src/views/cell-storage/payment-info/PaymentExcelList.vue index 418c7be6..61e7789a 100644 --- a/web-admin/src/views/cell-storage/payment-info/PaymentExcelList.vue +++ b/web-admin/src/views/cell-storage/payment-info/PaymentExcelList.vue @@ -84,8 +84,8 @@ { const tab = String(route.query.tab || '') - if (['dfj', 'jfqrz', 'bfyj', 'yjq'].includes(tab)) { + if (['dfj', 'bfyj', 'yjq'].includes(tab)) { searchForm.progressStatus = tab } loadData()