feat(web-admin): flatten research donation excel-parity list fields

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-10-13 13:14:09 +08:00
1 parent bee2c0d193
commit aa231ea5f8
2 files changed
+72 -6

No files matched your search

+38 -4
View File
@@ -35,6 +35,20 @@ export type ProtocolAuditFlatRow = {
transportType: string
transportLabel: string
paymentSummary: QcProtocolPaymentSummary | null
monthlyVerifyNo: string
donationStatus: string
voidDesc: string
voidType: string
newbornDeliveryTime: string
newbornSex: string
newbornWeightGram: string
deliveryMode: string
birthOrder: string
maternalBloodCollectTime: string
consentFormUrls: string
infectiousDiseaseReportUrls: string
attachmentUrls: string
remark: string
}
function asRecord(v: unknown): Record<string, unknown> | null {
@@ -97,7 +111,27 @@ export function flattenProtocolAuditRows(
paymentSummary:
protocol.paymentSummary && typeof protocol.paymentSummary === 'object'
? (protocol.paymentSummary as QcProtocolPaymentSummary)
: null
: null,
monthlyVerifyNo: str(protocol.monthlyVerifyNo),
donationStatus: str(protocol.donationStatus),
voidDesc: str(protocol.voidDesc),
voidType: str(protocol.voidType),
newbornDeliveryTime: str(protocol.newbornDeliveryTime),
newbornSex: str(protocol.newbornSex),
newbornWeightGram:
protocol.newbornWeightGram == null || protocol.newbornWeightGram === ''
? ''
: String(protocol.newbornWeightGram),
deliveryMode: str(protocol.deliveryMode),
birthOrder:
protocol.birthOrder == null || protocol.birthOrder === ''
? ''
: String(protocol.birthOrder),
maternalBloodCollectTime: str(protocol.maternalBloodCollectTime),
consentFormUrls: str(protocol.consentFormUrls),
infectiousDiseaseReportUrls: str(protocol.infectiousDiseaseReportUrls),
attachmentUrls: str(protocol.attachmentUrls),
remark: str(protocol.remark)
})
})
}
@@ -118,8 +152,8 @@ export function uniqueProtocolsFromFlatRows(
}
/**
* 首期缴费时间:优先用后端 firstPayTransferTime(第 1 期转账最后一笔);
* 否则从 paymentDetails 中取第 1 期 transferTime 最晚的一笔。
* 首期缴费时间:优先用后端 firstPayTransferTime(第 1 期转账最早一笔);
* 否则从 paymentDetails 中取第 1 期 transferTime 最早的一笔。
* 无转账时间时返回空(不回退应缴日)。
*/
export function firstPayTimeLines(
@@ -149,5 +183,5 @@ export function firstPayTimeLines(
.filter(Boolean)
.sort()
if (!times.length) return []
return [times[times.length - 1]]
return [times[0]]
}