fix: drop 付款确认中 from sample payment progressStatus
Sample-level 缴费进度 is now only 待缴费 / 部分已缴 / 已缴清. Transfer jfqrz still blocks canConfirm but no longer surfaces as progress. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
cc0b217c89
commit
af992b5680
6 files changed
+25
-15
No files matched your search
@@ -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"
|
||||
|
||||
@@ -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=[
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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' }
|
||||
}
|
||||
|
||||
@@ -447,7 +447,6 @@
|
||||
|
||||
const progressStatusOptions = [
|
||||
{ value: 'dfj', label: '待缴费' },
|
||||
{ value: 'jfqrz', label: '付款确认中' },
|
||||
{ value: 'bfyj', label: '部分已缴' },
|
||||
{ value: 'yjq', label: '已缴清' }
|
||||
]
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
<template #default="{ row }">{{ row.motherPhone || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="protocolNo"
|
||||
label="合同编号"
|
||||
prop="sampleCode"
|
||||
label="样本编码"
|
||||
min-width="130"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
@@ -325,7 +325,6 @@
|
||||
|
||||
const progressStatusOptions = [
|
||||
{ value: 'dfj', label: samplePaymentProgressLabel('dfj') },
|
||||
{ value: 'jfqrz', label: samplePaymentProgressLabel('jfqrz') },
|
||||
{ value: 'bfyj', label: samplePaymentProgressLabel('bfyj') },
|
||||
{ value: 'yjq', label: samplePaymentProgressLabel('yjq') }
|
||||
]
|
||||
@@ -522,7 +521,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
const tab = String(route.query.tab || '')
|
||||
if (['dfj', 'jfqrz', 'bfyj', 'yjq'].includes(tab)) {
|
||||
if (['dfj', 'bfyj', 'yjq'].includes(tab)) {
|
||||
searchForm.progressStatus = tab
|
||||
}
|
||||
loadData()
|
||||
|
||||
Reference in new issue
Block a user