|
|
@@ -2,7 +2,6 @@ const SEARCH_PLACEHOLDERS = Object.freeze({
|
|
|
protocol: '搜索母亲姓名 / 样本编码',
|
|
|
'payment-chase': '搜索协议号 / 客户 / 样本编码',
|
|
|
payment: '搜索协议号 / 客户 / 样本编码',
|
|
|
- sample: '搜索母亲姓名 / 样本编码',
|
|
|
freight: '搜索批次号 / 母亲姓名 / 样本编码'
|
|
|
})
|
|
|
|
|
|
@@ -19,13 +18,10 @@ const ACTION_LABELS = Object.freeze({
|
|
|
'view-payment': '查看缴费',
|
|
|
'view-payment-detail': '缴费明细',
|
|
|
'view-protocol': '协议单',
|
|
|
- 'view-storage-qc': '储存证质检信息',
|
|
|
'register-transfer': '登记转账',
|
|
|
'edit-transfer': '编辑转账',
|
|
|
submit: '提交财务确认',
|
|
|
withdraw: '撤回转账',
|
|
|
- 'storage-cert': '登记储存证',
|
|
|
- insurance: '登记保险',
|
|
|
link: '关联样本',
|
|
|
unlink: '取消运费'
|
|
|
})
|
|
|
@@ -67,7 +63,7 @@ export function money(value) {
|
|
|
}
|
|
|
|
|
|
export function marketSearchPlaceholder(module, source) {
|
|
|
- if (module === 'protocol' || module === 'sample') {
|
|
|
+ if (module === 'protocol') {
|
|
|
return PROTOCOL_SEARCH_PLACEHOLDERS[source] || SEARCH_PLACEHOLDERS[module]
|
|
|
}
|
|
|
return SEARCH_PLACEHOLDERS[module] || '搜索编号、姓名或关键词'
|
|
|
@@ -82,16 +78,55 @@ function allowed(item, ownActions = []) {
|
|
|
return ownActions.filter((action) => backend.has(action))
|
|
|
}
|
|
|
|
|
|
+function attachmentPresence(urls) {
|
|
|
+ return String(urls || '').trim() ? '有' : '—'
|
|
|
+}
|
|
|
+
|
|
|
function protocolCard(item) {
|
|
|
const actions = allowed(item, ['edit', 'delete'])
|
|
|
+ const isDonation = item.source === 'research_donation'
|
|
|
const status = label(PROTOCOL_STATUS_LABELS, item.protocolStatus || item.donationStatus || item.status)
|
|
|
+ if (isDonation) {
|
|
|
+ const collectDate = String(item.sampleCollectTime || '').slice(0, 10)
|
|
|
+ return {
|
|
|
+ title: text(item.motherName || item.customerName),
|
|
|
+ subtitle: `${label(SOURCE_LABELS, item.source)} · ${text(item.labStorageCode || item.sampleCode)}`,
|
|
|
+ status,
|
|
|
+ fields: [
|
|
|
+ field('采集日期', collectDate || item.donationDate),
|
|
|
+ field('当月核量号', item.monthlyVerifyNo),
|
|
|
+ field('实验室流转编号', item.labStorageCode || item.sampleCode, { wide: true }),
|
|
|
+ field('协议状态', status, { tag: true }),
|
|
|
+ field('废弃原因', item.voidDesc),
|
|
|
+ field('母亲姓名', item.motherName || item.customerName),
|
|
|
+ field('样本类型', item.sampleTypeName),
|
|
|
+ field('采集地区', referenceName(item.regionName, item.regionId)),
|
|
|
+ field('采集医院', referenceName(item.hospitalName, item.hospitalId), { wide: true }),
|
|
|
+ field('分娩时间', item.newbornDeliveryTime, { wide: true }),
|
|
|
+ field('采集时间', item.sampleCollectTime, { wide: true }),
|
|
|
+ field('市场专员', personName(item.salesUserName, item.salesUserId)),
|
|
|
+ field('地区经理', personName(item.regionManagerUserName || item.managerName, item.regionManagerUserId)),
|
|
|
+ field('运输方式', item.transportModeLabel || item.transportMode),
|
|
|
+ field('新生儿性别', label(NEWBORN_SEX_LABELS, item.newbornSex)),
|
|
|
+ field('新生儿体重', item.newbornWeightGram),
|
|
|
+ field('分娩方式', label(DELIVERY_MODE_LABELS, item.deliveryMode)),
|
|
|
+ field('胎次', item.birthOrder),
|
|
|
+ field('母血采集时间', item.maternalBloodCollectTime, { wide: true }),
|
|
|
+ field('知情同意书', attachmentPresence(item.consentFormUrls)),
|
|
|
+ field('传染病检测报告', attachmentPresence(item.infectiousDiseaseReportUrls)),
|
|
|
+ field('协议书', attachmentPresence(item.attachmentUrls)),
|
|
|
+ field('备注', item.remark, { wide: true })
|
|
|
+ ],
|
|
|
+ actions: ['view', ...actions]
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
title: text(item.motherName || item.customerName),
|
|
|
subtitle: `${label(SOURCE_LABELS, item.source)} · ${text(item.sampleCode)}`,
|
|
|
status,
|
|
|
fields: [
|
|
|
field('状态', status, { tag: true }),
|
|
|
- field(item.source === 'research_donation' ? '捐赠日期' : '登记日期', item.registerDate || item.donationDate),
|
|
|
+ field('登记日期', item.registerDate || item.donationDate),
|
|
|
field('母亲姓名', item.motherName || item.customerName),
|
|
|
field('母亲电话', item.motherPhone),
|
|
|
field('母亲身份证号', item.motherIdCard, { wide: true }),
|
|
|
@@ -145,10 +180,10 @@ function paymentCard(item) {
|
|
|
]
|
|
|
})
|
|
|
return {
|
|
|
- title: text(item.motherName), subtitle: text(item.protocolNo), status: progress,
|
|
|
+ title: text(item.motherName), subtitle: text(item.sampleCode), status: progress,
|
|
|
fields: [
|
|
|
field('姓名', item.motherName), field('手机号', item.motherPhone),
|
|
|
- field('合同编号', item.protocolNo, { wide: true }), field('签署日期', item.signDate),
|
|
|
+ field('样本编码', item.sampleCode, { wide: true }), field('签署日期', item.signDate),
|
|
|
field('存储年限', item.storageYears), field('存储项目', item.sampleTypeName, { wide: true }),
|
|
|
field('合同总额', money(item.contractAmount), { money: true }),
|
|
|
field('缴费方式', label(PAY_MODE_LABELS, item.payMode), { tag: true }),
|
|
|
@@ -163,39 +198,6 @@ function paymentCard(item) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function progressLabel(item, key, fallback) {
|
|
|
- const value = item.progress?.[key]?.label
|
|
|
- return value ? label({}, value) : fallback
|
|
|
-}
|
|
|
-
|
|
|
-function sampleCard(item) {
|
|
|
- const status = label(PROTOCOL_STATUS_LABELS, item.protocolStatus || item.donationStatus || item.statusLabel)
|
|
|
- return {
|
|
|
- title: text(item.motherName || item.customerName), subtitle: text(item.sampleCode), status,
|
|
|
- fields: [
|
|
|
- field('协议状态', status, { tag: true }), field('预产期', item.expectedDeliveryDate),
|
|
|
- field('母亲姓名', item.motherName || item.customerName), field('新生儿姓名', item.newbornName),
|
|
|
- field('样本编码', item.sampleCode, { wide: true }), field('实验室入库编码', item.labStorageCode, { wide: true }),
|
|
|
- field('样本类型', referenceName(item.sampleTypeName, item.sampleTypeId), { wide: true })
|
|
|
- ],
|
|
|
- progressTags: [
|
|
|
- `采集 · ${progressLabel(item, 'collection', '未采集')}`,
|
|
|
- `接收 · ${progressLabel(item, 'reception', '未接收')}`,
|
|
|
- `质检 · ${progressLabel(item, 'qc', '未完成')}`,
|
|
|
- `入库 · ${progressLabel(item, 'storage', '未入库')}`,
|
|
|
- ...(item.source === 'cell_storage' ? [
|
|
|
- `储存证 · ${item.storageCert?.label ? label({}, item.storageCert.label) : '未办理'}`,
|
|
|
- `保险 · ${item.insurance?.label ? label({}, item.insurance.label) : '未办理'}`
|
|
|
- ] : [])
|
|
|
- ],
|
|
|
- actions: [
|
|
|
- 'view',
|
|
|
- ...(item.source === 'cell_storage' ? ['view-storage-qc'] : []),
|
|
|
- ...allowed(item, ['storage-cert', 'insurance'])
|
|
|
- ]
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
function freightCard(role, item) {
|
|
|
const first = item.items?.[0] || {}
|
|
|
const transportMode = label({}, item.transportModeLabel || item.transportMode)
|
|
|
@@ -223,7 +225,6 @@ export function buildMarketCard(module, role, item = {}) {
|
|
|
if (module === 'protocol') return protocolCard(item)
|
|
|
if (module === 'payment-chase') return chaseCard(item)
|
|
|
if (module === 'payment') return paymentCard(item)
|
|
|
- if (module === 'sample') return sampleCard(item)
|
|
|
if (module === 'freight') return freightCard(role, item)
|
|
|
return { title: text(item.title || item.name || item.code), subtitle: '', status: '', fields: [], actions: ['view'] }
|
|
|
}
|