This commit is contained in:
zlwu committed 2026-05-28 07:37:16 +08:00
1 parent b6c63591ea
commit 4ff289a8cf
54 files changed
+16835 -12208

No files matched your search

@@ -117,7 +117,7 @@
align="right"
>
<template #default="{ row }">
<span v-if="row.orderType === 'yfk'" class="amount-text">
<span v-if="row.orderType === 'yfk' || row.orderType === 'gmcp'" class="amount-text">
¥{{ formatAmount(row.currentBalance) }}
</span>
<span v-else>-</span>
@@ -133,6 +133,9 @@
<span v-if="row.orderType === 'gmcp'" class="amount-text">
¥{{ formatAmount(row.purchaseTotalAmount) }}
</span>
<span v-else-if="row.orderType === 'yfk'" class="amount-text">
¥{{ formatAmount(row.totalRechargeAmount) }}
</span>
<span v-else>-</span>
</template>
</el-table-column>
@@ -1152,6 +1155,7 @@
title: '金额信息',
fields: [
{ label: '购买总额(元)', value: `¥${formatAmount(d.purchaseTotalAmount)}` },
{ label: '当前余额(元)', value: `¥${formatAmount(d.currentBalance)}` },
{ label: '渠道协议', value: viewAgreementLabel.value || d.channelAgreementId }
]
})
@@ -27,8 +27,16 @@
</div>
<div class="section-card" style="margin-bottom: 16px">
<div class="section-title section-title--mint-bar">
<div class="section-title section-title--mint-bar section-title--with-action">
<h3>实际项目</h3>
<div class="checkup-item-actions">
<el-button size="small" type="primary" @click="handleOpenProjectSelector">
<el-icon><Plus /></el-icon>添加单项
</el-button>
<el-button size="small" @click="handleOpenPackageSelector">
<el-icon><Suitcase /></el-icon>从套餐添加
</el-button>
</div>
</div>
<el-alert
v-if="duplicateNames.length"
@@ -154,6 +162,278 @@
</el-button>
</template>
</el-dialog>
<!-- 单项:选择体检项目 -->
<el-dialog
v-model="projectSelectorVisible"
title="选择体检项目"
width="960px"
class="dialog-form-layout checkup-picker-dialog"
align-center
append-to-body
destroy-on-close
:close-on-click-modal="false"
>
<div class="list-toolbar checkup-picker-toolbar">
<div class="list-toolbar-row">
<div class="list-toolbar-selected">
已选 <span class="sel-num">{{ projectSelectorSelected.length }}</span> 项
</div>
<el-input
v-model="projectSelectorKeyword"
placeholder="项目名称模糊检索"
clearable
class="checkup-picker-search"
/>
</div>
</div>
<div class="list-body list-wrap checkup-picker-list-wrap">
<el-table
:data="filteredProjectOptions"
v-loading="projectLoading"
class="list-table"
stripe
row-key="id"
max-height="620"
@selection-change="(rows) => (projectSelectorSelected = rows)"
>
<el-table-column
type="selection"
min-width="55"
align="center"
header-align="center"
:selectable="(row) => !isProjectAlreadyInActual(row)"
/>
<el-table-column
type="index"
label="序号"
min-width="68"
align="center"
header-align="center"
/>
<el-table-column
prop="projectName"
label="项目名称"
min-width="180"
align="center"
header-align="center"
/>
<el-table-column
label="项目费用(元)"
min-width="120"
align="center"
header-align="center"
>
<template #default="{ row }">{{
row.projectFee != null ? formatMoneyDisplay(row.projectFee) : '—'
}}</template>
</el-table-column>
<el-table-column label="状态" min-width="90" align="center" header-align="center">
<template #default="{ row }">
<el-tag :type="projectStatusTagType(row.status)" size="small">{{
projectStatusLabel(row.status)
}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="remark"
label="备注"
min-width="140"
align="center"
header-align="center"
show-overflow-tooltip
/>
</el-table>
</div>
<template #footer>
<el-button class="btn-ghost" @click="projectSelectorVisible = false">
<el-icon><Close /></el-icon>取消
</el-button>
<el-button class="btn-main" type="primary" @click="confirmProjectSelect">
<el-icon><Check /></el-icon>确认添加({{ projectSelectorSelected.length }})
</el-button>
</template>
</el-dialog>
<!-- 套餐:选择体检套餐 -->
<el-dialog
v-model="packageSelectorVisible"
title="选择体检套餐"
width="1080px"
class="dialog-form-layout checkup-picker-dialog"
align-center
append-to-body
destroy-on-close
:close-on-click-modal="false"
>
<div class="list-toolbar checkup-picker-toolbar">
<div class="list-toolbar-row">
<div class="list-toolbar-selected">
已选 <span class="sel-num">{{ packageSelectorSelected.length }}</span> 项
</div>
<el-input
v-model="packageSelectorKeyword"
placeholder="套餐名称模糊检索"
clearable
class="checkup-picker-search"
/>
</div>
</div>
<div class="list-body list-wrap checkup-picker-list-wrap">
<el-table
:data="filteredPackageOptions"
v-loading="packageLoading"
class="list-table"
stripe
row-key="id"
max-height="620"
@selection-change="(rows) => (packageSelectorSelected = rows)"
>
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
<el-table-column
type="index"
label="序号"
min-width="68"
align="center"
header-align="center"
/>
<el-table-column
prop="packageName"
label="套餐名称"
min-width="140"
align="center"
header-align="center"
/>
<el-table-column
prop="packageCode"
label="套餐编码"
min-width="120"
align="center"
header-align="center"
/>
<el-table-column
prop="itemCount"
label="项目数"
min-width="80"
align="center"
header-align="center"
>
<template #default="{ row }">{{ row.itemCount ?? '—' }}</template>
</el-table-column>
<el-table-column
label="合计费用(元)"
min-width="120"
align="center"
header-align="center"
>
<template #default="{ row }">{{
row.totalFee != null ? formatMoneyDisplay(row.totalFee) : '—'
}}</template>
</el-table-column>
<el-table-column label="状态" min-width="90" align="center" header-align="center">
<template #default="{ row }">
<el-tag :type="projectStatusTagType(row.status)" size="small">{{
projectStatusLabel(row.status)
}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="remark"
label="备注"
min-width="120"
align="center"
header-align="center"
show-overflow-tooltip
/>
<el-table-column
label="操作"
min-width="100"
fixed="right"
align="center"
header-align="center"
>
<template #default="{ row }">
<el-button class="btn-op-item" @click="handlePackageView(row)">
<el-icon><View /></el-icon>查看
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<template #footer>
<el-button class="btn-ghost" @click="packageSelectorVisible = false">
<el-icon><Close /></el-icon>取消
</el-button>
<el-button
class="btn-main"
type="primary"
:loading="packageConfirmLoading"
@click="confirmPackageSelect"
>
<el-icon><Check /></el-icon>确认添加({{ packageSelectorSelected.length }})
</el-button>
</template>
</el-dialog>
<!-- 套餐项目明细(查看) -->
<el-dialog
v-model="packageViewVisible"
:title="packageViewTitle"
width="900px"
class="dialog-form-layout"
align-center
append-to-body
destroy-on-close
:close-on-click-modal="false"
>
<el-table
:data="packageViewItems"
v-loading="packageViewLoading"
class="list-table"
stripe
max-height="420"
>
<el-table-column
type="index"
label="序号"
min-width="68"
align="center"
header-align="center"
/>
<el-table-column
prop="projectName"
label="项目名称"
min-width="180"
align="center"
header-align="center"
/>
<el-table-column label="项目费用(元)" min-width="120" align="center" header-align="center">
<template #default="{ row }">{{
row.projectFee != null ? formatMoneyDisplay(row.projectFee) : '—'
}}</template>
</el-table-column>
<el-table-column label="状态" min-width="90" align="center" header-align="center">
<template #default="{ row }">
<el-tag :type="projectStatusTagType(row.status)" size="small">{{
projectStatusLabel(row.status)
}}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="remark"
label="备注"
min-width="140"
align="center"
header-align="center"
show-overflow-tooltip
/>
</el-table>
<template #footer>
<el-button class="btn-ghost" @click="packageViewVisible = false">
<el-icon><Close /></el-icon>关闭
</el-button>
</template>
</el-dialog>
</template>
<script setup lang="ts">
@@ -166,12 +446,18 @@
Delete,
Download,
Document,
Loading
Loading,
Check,
Suitcase,
View
} from '@element-plus/icons-vue'
import {
fetchPilotCheckupDetail,
fetchPilotCheckupReserveItems,
fetchPilotCheckupActualItems,
fetchCheckupInstitutionProjects,
fetchCheckupInstitutionPackages,
fetchCheckupInstitutionPackageDetail,
savePilotCheckup,
savePilotCheckupActualItems,
markPilotCheckupChecked
@@ -185,7 +471,9 @@
parseProjectFee,
dedupeCheckupActualItems,
findDuplicateActualItemNames,
mapReserveRowsToActualItems
mapReserveRowsToActualItems,
appendCheckupActualItems,
actualItemExists
} from './checkup-reserve-items'
const props = defineProps<{
@@ -202,6 +490,157 @@
const checkupRemark = ref('')
const reportFiles = ref<any[]>([])
const reportUploadRef = ref()
const checkupInstitutionId = ref('')
function parseList(res: unknown): any[] {
return Array.isArray(res) ? res : (res as any)?.list || []
}
function projectStatusLabel(status: string | undefined) {
return status === '1' ? '正常' : '停用'
}
function projectStatusTagType(status: string | undefined) {
return status === '1' ? 'success' : 'info'
}
const projectOptions = ref<any[]>([])
const packageOptions = ref<any[]>([])
const projectLoading = ref(false)
const packageLoading = ref(false)
const loadInstitutionCatalog = async (instId: string) => {
projectLoading.value = true
packageLoading.value = true
try {
const [projRes, pkgRes] = await Promise.all([
fetchCheckupInstitutionProjects(instId),
fetchCheckupInstitutionPackages(instId)
])
projectOptions.value = parseList(projRes)
packageOptions.value = parseList(pkgRes)
} catch {
projectOptions.value = []
packageOptions.value = []
} finally {
projectLoading.value = false
packageLoading.value = false
}
}
const requireInstitution = () => {
if (!checkupInstitutionId.value) {
ElMessage.warning('该记录未关联体检机构,请先在「编辑体检信息」中选择机构')
return false
}
return true
}
const projectSelectorVisible = ref(false)
const projectSelectorKeyword = ref('')
const projectSelectorSelected = ref<any[]>([])
const filteredProjectOptions = computed(() => {
const kw = projectSelectorKeyword.value.trim().toLowerCase()
if (!kw) return projectOptions.value
return projectOptions.value.filter((row) => (row.projectName || '').toLowerCase().includes(kw))
})
const handleOpenProjectSelector = async () => {
if (!requireInstitution()) return
projectSelectorKeyword.value = ''
projectSelectorSelected.value = []
if (projectOptions.value.length === 0) {
await loadInstitutionCatalog(checkupInstitutionId.value)
}
projectSelectorVisible.value = true
}
const isProjectAlreadyInActual = (row: any) =>
actualItemExists(actualItems.value, { projectName: row.projectName || '' })
const confirmProjectSelect = () => {
if (projectSelectorSelected.value.length === 0) {
ElMessage.warning('请至少选择一个项目')
return
}
const added = appendCheckupActualItems(actualItems.value, projectSelectorSelected.value)
projectSelectorVisible.value = false
if (added > 0) {
ElMessage.success(`已添加 ${added} 个项目`)
} else {
ElMessage.info('所选项目均已存在,未重复添加')
}
}
const packageSelectorVisible = ref(false)
const packageSelectorKeyword = ref('')
const packageSelectorSelected = ref<any[]>([])
const packageConfirmLoading = ref(false)
const filteredPackageOptions = computed(() => {
const kw = packageSelectorKeyword.value.trim().toLowerCase()
if (!kw) return packageOptions.value
return packageOptions.value.filter((row) => (row.packageName || '').toLowerCase().includes(kw))
})
const handleOpenPackageSelector = async () => {
if (!requireInstitution()) return
packageSelectorKeyword.value = ''
packageSelectorSelected.value = []
if (packageOptions.value.length === 0) {
await loadInstitutionCatalog(checkupInstitutionId.value)
}
packageSelectorVisible.value = true
}
const confirmPackageSelect = async () => {
if (packageSelectorSelected.value.length === 0) {
ElMessage.warning('请至少选择一个套餐')
return
}
packageConfirmLoading.value = true
try {
const allItems: any[] = []
for (const pkg of packageSelectorSelected.value) {
const detail: any = await fetchCheckupInstitutionPackageDetail(pkg.id)
const items = detail?.items ?? detail?.detailItems ?? []
allItems.push(...items)
}
const added = appendCheckupActualItems(actualItems.value, allItems)
packageSelectorVisible.value = false
if (added > 0) {
ElMessage.success(`已从套餐添加 ${added} 个项目`)
} else {
ElMessage.info('套餐中的项目均已存在,未重复添加')
}
} catch {
ElMessage.error('加载套餐项目失败')
} finally {
packageConfirmLoading.value = false
}
}
const packageViewVisible = ref(false)
const packageViewTitle = ref('')
const packageViewItems = ref<any[]>([])
const packageViewLoading = ref(false)
const handlePackageView = async (row: any) => {
packageViewTitle.value = `套餐项目 — ${row.packageName || ''}`
packageViewItems.value = []
packageViewVisible.value = true
packageViewLoading.value = true
try {
const detail: any = await fetchCheckupInstitutionPackageDetail(row.id)
packageViewItems.value = detail?.items ?? detail?.detailItems ?? []
} catch {
ElMessage.error('加载套餐明细失败')
packageViewVisible.value = false
} finally {
packageViewLoading.value = false
}
}
const actualTotal = computed(() =>
actualItems.value.reduce((s, i) => s + (Number(i.projectFee) || 0), 0)
@@ -258,6 +697,12 @@
checkupRemark.value = detail.checkupRemark || ''
actualCheckupTime.value = detail.actualCheckupTime || formatNowDatetime()
reportFiles.value = parseAttachmentUrls(detail.reportAttachments || '')
checkupInstitutionId.value = detail.checkupInstitutionId || ''
projectOptions.value = []
packageOptions.value = []
if (checkupInstitutionId.value) {
await loadInstitutionCatalog(checkupInstitutionId.value)
}
const reserveList = Array.isArray(reserveRes) ? reserveRes : (reserveRes?.list ?? [])
const actualList = Array.isArray(actualRes) ? actualRes : (actualRes?.list ?? [])
@@ -388,6 +833,9 @@
actualCheckupTime.value = ''
checkupRemark.value = ''
reportFiles.value = []
checkupInstitutionId.value = ''
projectOptions.value = []
packageOptions.value = []
loadData()
}
}
@@ -401,6 +849,20 @@
}
}
.section-title--with-action {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
}
.checkup-item-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.section-title--mint-bar {
margin-bottom: 12px;
@@ -429,6 +891,72 @@
margin-bottom: 12px;
}
:deep(.checkup-picker-dialog.el-dialog.dialog-form-layout) {
.el-dialog__body {
min-height: min(680px, calc(100vh - 160px));
padding-top: 16px;
}
}
.checkup-picker-toolbar {
margin-bottom: 0;
background: var(--mint-table-head, #f8fafc);
border: 1px solid var(--mint-border, #e2e8f0);
border-bottom: none;
border-radius: var(--mint-radius, 10px) var(--mint-radius, 10px) 0 0;
.list-toolbar-row {
padding: 8px 16px;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.list-toolbar-selected {
display: inline-flex;
align-items: center;
min-height: 36px;
padding: 0 10px 0 0;
margin-right: 4px;
border-right: 1px solid var(--mint-border, #e2e8f0);
font-size: 12px;
color: var(--mint-text-muted, #64748b);
font-weight: 600;
}
.sel-num {
color: var(--mint-primary-dark, #059669);
font-weight: 700;
margin: 0 2px;
}
.checkup-picker-search {
width: 280px;
}
}
.checkup-picker-list-wrap.list-body.list-wrap {
border: 1px solid var(--mint-border, #e2e8f0);
border-top: 1px solid var(--mint-border, #e2e8f0);
border-radius: 0 0 var(--mint-radius, 10px) var(--mint-radius, 10px);
overflow: hidden;
background: #fff;
:deep(.el-table) {
--el-table-header-bg-color: var(--mint-table-head, #f8fafc);
--el-table-border-color: var(--mint-border, #e2e8f0);
--el-table-row-hover-bg-color: var(--mint-row-hover, #f0fdf4);
font-size: 14px;
}
:deep(.el-table th.el-table__cell) {
font-size: 12px;
font-weight: 600;
color: var(--mint-text-muted, #64748b);
}
}
.checkup-inner-list-wrap.list-body.list-wrap {
border: 1px solid var(--mint-border, #e2e8f0);
border-radius: var(--mint-radius, 10px);
@@ -148,6 +148,29 @@ export function findDuplicateActualItemNames(items: CheckupActualItem[]): string
return [...dups]
}
export function actualItemExists(
target: CheckupActualItem[],
candidate: { projectName: string }
): boolean {
return target.some((item) => isSameActualItem(item, candidate))
}
/** 追加实际项目(按名称去重,保留首次出现项) */
export function appendCheckupActualItems(target: CheckupActualItem[], projects: any[]): number {
let added = 0
for (const proj of projects) {
const projectName = (proj.projectName || '').trim()
if (!projectName) continue
if (actualItemExists(target, { projectName })) continue
target.push({
projectName,
projectFee: parseProjectFee(proj.projectFee)
})
added++
}
return added
}
export function mapReserveRowsToActualItems(rows: any[]): CheckupActualItem[] {
return dedupeCheckupActualItems(
rows.map((r) => ({
@@ -226,7 +226,7 @@
</el-table-column>
<el-table-column
label="操作"
min-width="380"
min-width="480"
fixed="right"
align="center"
header-align="center"
@@ -7,7 +7,7 @@
<el-form-item label="关键词">
<el-input
v-model="searchForm.keyword"
placeholder="任务号/所属工单号/协议号/样本编码"
placeholder="任务号/所属工单号/协议号/申请单号/样本编码"
clearable
@keyup.enter="handleSearch"
/>
@@ -100,8 +100,8 @@
<el-table-column prop="receptionSource" label="来源类型" min-width="110" align="center">
<template #default="{ row }">
<span v-if="!showReceptionSourceType(row)">—</span>
<el-tag v-else :type="receptionSourceTagType(row.receptionSource)" size="small">
{{ row.receptionSourceLabel || receptionSourceLabel(row.receptionSource) }}
<el-tag v-else :type="receptionSourceTypeTag(row)" size="small">
{{ receptionSourceTypeLabel(row) }}
</el-tag>
</template>
</el-table-column>
@@ -116,14 +116,16 @@
:type="
protocolStatusTagTypeBySource(
String(row.protocolStatus || ''),
row.receptionSource || 'cell_storage'
row.receptionSource || 'cell_storage',
row.orderSource
)
"
size="small"
>{{
protocolStatusLabelBySource(
String(row.protocolStatus || ''),
row.receptionSource || 'cell_storage'
row.receptionSource || 'cell_storage',
row.orderSource
)
}}</el-tag
>
@@ -338,7 +340,11 @@
donationStatusLabel,
donationStatusTagType,
receptionSourceLabel,
receptionSourceTagType
receptionSourceTagType,
applicationStatusLabel,
applicationStatusTagType,
bizTypeLabel,
bizTypeTagType
} from '@/utils/status-tag-registry'
import type { TagType } from '@/utils/status-tag-registry'
import TaskExecutionDialog from './TaskExecutionDialog.vue'
@@ -351,26 +357,84 @@
productionTaskTypeTag
} from '@/utils/production-labels'
/** 根据来源类型返回协议状态标签 */
function protocolStatusLabelBySource(status: string, source: string): string {
/** 根据来源类型返回协议状态标签(出库任务按申请单状态展示) */
function isOutboundBizSource(row: { orderSource?: string }) {
return row.orderSource === 'outbound'
}
function isApplicationBizSource(source: string, orderSource?: string) {
return (
orderSource === 'outbound' ||
source === 'pilot_service' ||
source === 'clinical_application'
)
}
function protocolStatusLabelBySource(
status: string,
source: string,
orderSource?: string
): string {
if (isApplicationBizSource(source, orderSource)) {
return applicationStatusLabel(status)
}
return source === 'research_donation'
? donationStatusLabel(status)
: protocolStatusLabel(status)
}
function protocolStatusTagTypeBySource(status: string, source: string): TagType {
function protocolStatusTagTypeBySource(
status: string,
source: string,
orderSource?: string
): TagType {
if (isApplicationBizSource(source, orderSource)) {
return applicationStatusTagType(status) as TagType
}
return source === 'research_donation'
? donationStatusTagType(status)
: protocolStatusTagType(status)
}
function receptionSourceTypeLabel(row: {
orderSource?: string
bizType?: string
bizTypeLabel?: string
receptionSource?: string
receptionSourceLabel?: string
}) {
if (isOutboundBizSource(row)) {
return row.bizTypeLabel || bizTypeLabel(row.bizType || row.receptionSource || '')
}
return row.receptionSourceLabel || receptionSourceLabel(row.receptionSource || '')
}
function receptionSourceTypeTag(row: {
orderSource?: string
bizType?: string
receptionSource?: string
}) {
if (isOutboundBizSource(row)) {
return bizTypeTagType(row.bizType || row.receptionSource || '')
}
return receptionSourceTagType(row.receptionSource || '')
}
/** 临时工单无关联协议/样本时,空字段展示为 — */
function shouldShowTempEmptyField(row: { orderSource?: string }, value?: string | null) {
return row.orderSource === 'temporary' && !String(value || '').trim()
}
/** 入库任务展示工单来源类型(细胞存储 / 科研捐赠) */
function showReceptionSourceType(row: { orderSource?: string; receptionSource?: string }) {
if (row.orderSource === 'temporary' || row.orderSource === 'outbound') return false
/** 入库任务展示工单来源类型;出库任务展示业务类型 */
function showReceptionSourceType(row: {
orderSource?: string
receptionSource?: string
bizType?: string
}) {
if (row.orderSource === 'temporary') return false
if (row.orderSource === 'outbound') {
return !!(row.bizType || row.receptionSource)
}
const src = (row.receptionSource || '').trim()
return src === 'cell_storage' || src === 'research_donation'
}
@@ -64,7 +64,7 @@
<el-option label="已作废" value="yzf" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-form-item :label="filterTimeLabel">
<el-date-picker
v-model="createTimeRange"
type="daterange"
@@ -77,7 +77,7 @@
</el-form-item>
</div>
<div class="filter-actions-row">
<span class="filter-hint">默认展示近 30 天内创建的工单。</span>
<span class="filter-hint">{{ filterTimeHint }}</span>
<div class="filter-actions-end">
<el-button class="btn-ghost" @click="handleReset"
><el-icon><RefreshLeft /></el-icon>重置</el-button
@@ -181,6 +181,31 @@
>
<template #default="{ row }">{{ row.applicationNo || '—' }}</template>
</el-table-column>
<el-table-column
v-if="activeTypeTab === 'outbound'"
prop="patientName"
label="用户名称"
min-width="100"
align="center"
>
<template #default="{ row }">{{ row.patientName || '—' }}</template>
</el-table-column>
<el-table-column
v-if="activeTypeTab === 'outbound'"
label="第几次"
min-width="88"
align="center"
>
<template #default="{ row }">{{ formatOutboundScheduleSortNo(row) }}</template>
</el-table-column>
<el-table-column
v-if="activeTypeTab === 'outbound'"
label="总次数"
min-width="88"
align="center"
>
<template #default="{ row }">{{ formatOutboundScheduleTotalCount(row) }}</template>
</el-table-column>
<el-table-column
v-if="activeTypeTab === 'outbound'"
prop="infusionTime"
@@ -658,6 +683,18 @@
function formatTempEmptyField(row: { workOrderType?: string }, value?: string | null) {
return shouldShowTempEmptyField(row, value) ? '—' : String(value || '')
}
function formatOutboundScheduleSortNo(row: Record<string, unknown>) {
const n = row.sortNo ?? row.orderNum
if (n == null || n === '' || Number(n) <= 0) return '—'
return `第${Number(n)}次`
}
function formatOutboundScheduleTotalCount(row: Record<string, unknown>) {
const n = row.totalCourseCount
if (n == null || n === '' || Number(n) <= 0) return '—'
return `共${Number(n)}次`
}
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import type { ViewSection } from '@/components/business/system-view-dialog/index.vue'
@@ -684,6 +721,14 @@
if (activeTypeTab.value === 'outbound') return '工单号/申请单号'
return '工单号/协议号/样本编码'
})
const filterTimeLabel = computed(() =>
activeTypeTab.value === 'outbound' ? '输注时间' : '创建时间'
)
const filterTimeHint = computed(() =>
activeTypeTab.value === 'outbound'
? '默认展示近 30 天内输注的工单。'
: '默认展示近 30 天内创建的工单。'
)
const addMode = ref<'inbound' | 'temporary'>('inbound')
// ── 新增工单 ──────────────────────────────────────────
@@ -903,14 +948,23 @@
async function loadData() {
loading.value = true
try {
const timeParams =
activeTypeTab.value === 'outbound'
? {
infusionTimeStart: createTimeRange.value?.[0] || undefined,
infusionTimeEnd: createTimeRange.value?.[1] || undefined
}
: {
createTimeStart: createTimeRange.value?.[0] || undefined,
createTimeEnd: createTimeRange.value?.[1] || undefined
}
const res = await fetchProductionWorkOrderList({
page: pagination.page,
pageSize: pagination.pageSize,
keyword: searchForm.keyword || undefined,
workOrderStatus: searchForm.workOrderStatus || undefined,
workOrderType: activeTypeTab.value,
createTimeStart: createTimeRange.value?.[0] || undefined,
createTimeEnd: createTimeRange.value?.[1] || undefined
...timeParams
})
tableData.value = res.list || []
pagination.total = res.total ?? 0
@@ -80,7 +80,7 @@
<el-option label="临床应用" value="clinical_application" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-form-item :label="filterTimeLabel">
<el-date-picker
v-model="createTimeRange"
type="daterange"
@@ -93,7 +93,7 @@
</el-form-item>
</div>
<div class="filter-actions-row">
<span class="filter-hint">默认展示近 30 天内创建的工单。</span>
<span class="filter-hint">{{ filterTimeHint }}</span>
<div class="filter-actions-end">
<el-button class="btn-ghost" @click="handleReset"
><el-icon><RefreshLeft /></el-icon>重置</el-button
@@ -167,6 +167,31 @@
align="center"
show-overflow-tooltip
/>
<el-table-column
v-if="showOutboundCols"
prop="patientName"
label="用户名称"
min-width="100"
align="center"
>
<template #default="{ row }">{{ row.patientName || '—' }}</template>
</el-table-column>
<el-table-column
v-if="showOutboundCols"
label="第几次"
min-width="88"
align="center"
>
<template #default="{ row }">{{ formatOutboundScheduleSortNo(row) }}</template>
</el-table-column>
<el-table-column
v-if="showOutboundCols"
label="总次数"
min-width="88"
align="center"
>
<template #default="{ row }">{{ formatOutboundScheduleTotalCount(row) }}</template>
</el-table-column>
<el-table-column
v-if="showOutboundCols"
prop="applicationName"
@@ -774,6 +799,18 @@
function formatTempEmptyField(row: QcWorkOrder, value?: string | null) {
return shouldShowTempEmptyField(row, value) ? '—' : String(value || '')
}
function formatOutboundScheduleSortNo(row: Record<string, unknown>) {
const n = row.sortNo ?? row.orderNum
if (n == null || n === '' || Number(n) <= 0) return '—'
return `第${Number(n)}次`
}
function formatOutboundScheduleTotalCount(row: Record<string, unknown>) {
const n = row.totalCourseCount
if (n == null || n === '' || Number(n) <= 0) return '—'
return `共${Number(n)}次`
}
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import type { ViewField, ViewSection } from '@/components/business/system-view-dialog/index.vue'
@@ -792,6 +829,14 @@
const showReceptionCols = computed(() => activeTypeTab.value !== 'temporary' && activeTypeTab.value !== 'outbound')
const showTempProductCols = computed(() => activeTypeTab.value !== 'inbound' && activeTypeTab.value !== 'outbound')
const showOutboundCols = computed(() => activeTypeTab.value === 'outbound')
const filterTimeLabel = computed(() =>
activeTypeTab.value === 'outbound' ? '输注时间' : '创建时间'
)
const filterTimeHint = computed(() =>
activeTypeTab.value === 'outbound'
? '默认展示近 30 天内输注的工单。'
: '默认展示近 30 天内创建的工单。'
)
const addMode = ref<'inbound' | 'temporary'>('inbound')
const editingId = ref('')
const editingWorkOrderNo = ref('')
@@ -1521,6 +1566,16 @@
async function loadData() {
loading.value = true
try {
const timeParams =
activeTypeTab.value === 'outbound'
? {
infusionTimeStart: createTimeRange.value?.[0] || undefined,
infusionTimeEnd: createTimeRange.value?.[1] || undefined
}
: {
createTimeStart: createTimeRange.value?.[0] || undefined,
createTimeEnd: createTimeRange.value?.[1] || undefined
}
const res = await fetchQcWorkOrderList({
page: pagination.page,
pageSize: pagination.pageSize,
@@ -1528,8 +1583,7 @@
workOrderStatus: searchForm.workOrderStatus || undefined,
workOrderType: activeTypeTab.value === 'all' ? undefined : activeTypeTab.value,
bizType: searchForm.bizType || undefined,
createTimeStart: createTimeRange.value?.[0] || undefined,
createTimeEnd: createTimeRange.value?.[1] || undefined
...timeParams
})
tableData.value = res.list || []
pagination.total = res.total ?? 0