提交
This commit is contained in:
1 parent
427bcb1551
commit
31b04575e2
247 files changed
+39284
-20367
No files matched your search
@@ -237,9 +237,15 @@
|
||||
<el-form-item label="细胞产品类型" prop="cellProductTypeId">
|
||||
<el-select
|
||||
v-model="formData.cellProductTypeId"
|
||||
placeholder="请选择细胞产品类型"
|
||||
placeholder="输入名称检索"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
:loading="typeOptionsLoading"
|
||||
:remote-method="remoteSearchTypeOptions"
|
||||
@visible-change="onTypeSelectVisible"
|
||||
@change="handleTypeChange"
|
||||
>
|
||||
<el-option
|
||||
@@ -253,9 +259,15 @@
|
||||
<el-form-item label="规格" prop="specId">
|
||||
<el-select
|
||||
v-model="formData.specId"
|
||||
placeholder="请选择规格"
|
||||
placeholder="输入名称检索"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
:loading="specOptionsLoading"
|
||||
:remote-method="remoteSearchSpecOptions"
|
||||
@visible-change="onSpecSelectVisible"
|
||||
@change="handleSpecChange"
|
||||
>
|
||||
<el-option
|
||||
@@ -356,6 +368,8 @@
|
||||
// --- Dropdown options ---
|
||||
const typeOptions = ref<any[]>([])
|
||||
const specOptions = ref<any[]>([])
|
||||
const typeOptionsLoading = ref(false)
|
||||
const specOptionsLoading = ref(false)
|
||||
|
||||
// --- Form data ---
|
||||
const formData = reactive({
|
||||
@@ -403,13 +417,56 @@
|
||||
})
|
||||
|
||||
// --- Load options ---
|
||||
async function loadOptions() {
|
||||
const [typeRes, specRes] = await Promise.all([
|
||||
fetchCellProductTypeList({ page: 1, pageSize: 100 }),
|
||||
fetchCellProductSpecList({ page: 1, pageSize: 100 })
|
||||
])
|
||||
typeOptions.value = (typeRes as any)?.list || []
|
||||
specOptions.value = (specRes as any)?.list || []
|
||||
async function remoteSearchTypeOptions(query: string) {
|
||||
typeOptionsLoading.value = true
|
||||
try {
|
||||
const typeRes = await fetchCellProductTypeList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query?.trim() || undefined
|
||||
})
|
||||
typeOptions.value = (typeRes as any)?.list || typeRes || []
|
||||
} catch {
|
||||
typeOptions.value = []
|
||||
} finally {
|
||||
typeOptionsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function ensureTypeInOptions(id: string, name?: string) {
|
||||
if (!id) return
|
||||
if (typeOptions.value.some((o) => o.id === id)) return
|
||||
typeOptions.value = [{ id, productTypeName: name || id }, ...typeOptions.value]
|
||||
}
|
||||
|
||||
async function remoteSearchSpecOptions(query: string) {
|
||||
specOptionsLoading.value = true
|
||||
try {
|
||||
const specRes = await fetchCellProductSpecList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query?.trim() || undefined
|
||||
})
|
||||
specOptions.value = (specRes as any)?.list || specRes || []
|
||||
} catch {
|
||||
specOptions.value = []
|
||||
} finally {
|
||||
specOptionsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function ensureSpecInOptions(id: string, name?: string) {
|
||||
if (!id) return
|
||||
if (specOptions.value.some((o) => o.id === id)) return
|
||||
specOptions.value = [{ id, specName: name || id }, ...specOptions.value]
|
||||
}
|
||||
|
||||
function onTypeSelectVisible(visible: boolean) {
|
||||
if (visible) void remoteSearchTypeOptions('')
|
||||
}
|
||||
|
||||
function onSpecSelectVisible(visible: boolean) {
|
||||
if (visible) void remoteSearchSpecOptions('')
|
||||
}
|
||||
|
||||
// --- Load data ---
|
||||
@@ -482,7 +539,7 @@
|
||||
resetForm()
|
||||
dialogVisible.value = true
|
||||
formRef.value?.clearValidate?.()
|
||||
await loadOptions()
|
||||
await Promise.all([remoteSearchTypeOptions(''), remoteSearchSpecOptions('')])
|
||||
}
|
||||
|
||||
// --- Edit ---
|
||||
@@ -499,9 +556,11 @@
|
||||
formData.specText = row.specText || ''
|
||||
formData.unitPrice = row.unitPrice ?? null
|
||||
formData.remark = row.remark || ''
|
||||
ensureTypeInOptions(row.cellProductTypeId, row.cellTypeName)
|
||||
ensureSpecInOptions(row.specId, row.specText)
|
||||
dialogVisible.value = true
|
||||
formRef.value?.clearValidate?.()
|
||||
await loadOptions()
|
||||
await Promise.all([remoteSearchTypeOptions(''), remoteSearchSpecOptions('')])
|
||||
}
|
||||
|
||||
// --- Submit ---
|
||||
|
||||
@@ -990,7 +990,13 @@
|
||||
<el-select
|
||||
v-model="selectedProjectSystemId"
|
||||
class="price-selector-system-select"
|
||||
placeholder="请选择项目价格体系"
|
||||
placeholder="输入名称检索项目价格体系"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
:loading="projectSystemListLoading"
|
||||
:remote-method="remoteSearchProjectSystems"
|
||||
@visible-change="onProjectSystemSelectVisible"
|
||||
@change="handleProjectSystemChange"
|
||||
>
|
||||
<el-option
|
||||
@@ -1454,6 +1460,7 @@
|
||||
const priceSelectorSelected = ref<any[]>([])
|
||||
const priceSelectorTableRef = ref()
|
||||
const projectSystemList = ref<any[]>([])
|
||||
const projectSystemListLoading = ref(false)
|
||||
const selectedProjectSystemId = ref<string>('')
|
||||
|
||||
const priceSelectorTitle = ref('从价格体系添加')
|
||||
@@ -2216,6 +2223,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function remoteSearchProjectSystems(query: string) {
|
||||
projectSystemListLoading.value = true
|
||||
try {
|
||||
const res = await fetchProjectSystemList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query?.trim() || undefined
|
||||
})
|
||||
projectSystemList.value = (res as any)?.list || []
|
||||
} catch {
|
||||
projectSystemList.value = []
|
||||
} finally {
|
||||
projectSystemListLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function onProjectSystemSelectVisible(visible: boolean) {
|
||||
if (visible) void remoteSearchProjectSystems('')
|
||||
}
|
||||
|
||||
async function openProjectPriceSelector() {
|
||||
priceSelectorVisible.value = true
|
||||
priceSelectorSelected.value = []
|
||||
@@ -2223,8 +2250,7 @@
|
||||
priceSelectorKeyword.value = ''
|
||||
selectedProjectSystemId.value = ''
|
||||
try {
|
||||
const res = await fetchProjectSystemList({ page: 1, pageSize: 100 })
|
||||
projectSystemList.value = (res as any)?.list || []
|
||||
await remoteSearchProjectSystems('')
|
||||
const first = projectSystemList.value[0]
|
||||
if (first?.id) {
|
||||
selectedProjectSystemId.value = first.id
|
||||
|
||||
@@ -18,9 +18,15 @@
|
||||
<el-form-item label="体检机构" required>
|
||||
<el-select
|
||||
v-model="formData.checkupInstitutionId"
|
||||
placeholder="请选择体检机构"
|
||||
placeholder="输入机构名称检索"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
:loading="institutionOptionsLoading"
|
||||
:remote-method="remoteSearchInstitutions"
|
||||
@visible-change="onInstitutionSelectVisible"
|
||||
@change="onInstitutionChange"
|
||||
>
|
||||
<el-option
|
||||
@@ -398,15 +404,35 @@
|
||||
|
||||
// ── 体检机构 ──────────────────────────
|
||||
const institutionOptions = ref<any[]>([])
|
||||
const loadInstitutions = async () => {
|
||||
const institutionOptionsLoading = ref(false)
|
||||
|
||||
function ensureInstitutionInOptions(id: string, name?: string) {
|
||||
if (!id) return
|
||||
if (institutionOptions.value.some((o) => o.id === id)) return
|
||||
institutionOptions.value = [{ id, institutionName: name || id }, ...institutionOptions.value]
|
||||
}
|
||||
|
||||
async function remoteSearchInstitutions(query: string) {
|
||||
institutionOptionsLoading.value = true
|
||||
try {
|
||||
const res = await fetchCheckupInstitutionList({ page: 1, pageSize: 100, status: '1' })
|
||||
const res = await fetchCheckupInstitutionList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query?.trim() || undefined,
|
||||
status: '1'
|
||||
})
|
||||
institutionOptions.value = parseList(res)
|
||||
} catch {
|
||||
institutionOptions.value = []
|
||||
} finally {
|
||||
institutionOptionsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function onInstitutionSelectVisible(visible: boolean) {
|
||||
if (visible) void remoteSearchInstitutions('')
|
||||
}
|
||||
|
||||
// ── 表单数据 ──────────────────────────
|
||||
const formData = reactive({
|
||||
checkupInstitutionId: '',
|
||||
@@ -620,7 +646,8 @@
|
||||
try {
|
||||
formData.checkupInstitutionId = row.checkupInstitutionId || ''
|
||||
formData.reserveTime = row.reserveTime || ''
|
||||
await loadInstitutions()
|
||||
ensureInstitutionInOptions(row.checkupInstitutionId, row.checkupInstitutionName)
|
||||
await remoteSearchInstitutions('')
|
||||
if (formData.checkupInstitutionId) {
|
||||
await loadInstitutionCatalog(formData.checkupInstitutionId)
|
||||
}
|
||||
@@ -655,7 +682,7 @@
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
if (!val) return
|
||||
loadInstitutions()
|
||||
void remoteSearchInstitutions('')
|
||||
if (isEditMode.value) {
|
||||
loadEditData()
|
||||
} else {
|
||||
|
||||
@@ -167,9 +167,15 @@
|
||||
<el-form-item label="体检机构" required>
|
||||
<el-select
|
||||
v-model="formData.checkupInstitutionId"
|
||||
placeholder="请选择体检机构"
|
||||
placeholder="输入机构名称检索"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
:loading="institutionOptionsLoading"
|
||||
:remote-method="remoteSearchInstitutions"
|
||||
@visible-change="onInstitutionSelectVisible"
|
||||
@change="onInstitutionChange"
|
||||
>
|
||||
<el-option
|
||||
@@ -579,15 +585,35 @@
|
||||
|
||||
// ── 体检机构 ──────────────────────────
|
||||
const institutionOptions = ref<any[]>([])
|
||||
const loadInstitutions = async () => {
|
||||
const institutionOptionsLoading = ref(false)
|
||||
|
||||
function ensureInstitutionInOptions(id: string, name?: string) {
|
||||
if (!id) return
|
||||
if (institutionOptions.value.some((o) => o.id === id)) return
|
||||
institutionOptions.value = [{ id, institutionName: name || id }, ...institutionOptions.value]
|
||||
}
|
||||
|
||||
async function remoteSearchInstitutions(query: string) {
|
||||
institutionOptionsLoading.value = true
|
||||
try {
|
||||
const res = await fetchCheckupInstitutionList({ page: 1, pageSize: 100, status: '1' })
|
||||
const res = await fetchCheckupInstitutionList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query?.trim() || undefined,
|
||||
status: '1'
|
||||
})
|
||||
institutionOptions.value = parseList(res)
|
||||
} catch {
|
||||
institutionOptions.value = []
|
||||
} finally {
|
||||
institutionOptionsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function onInstitutionSelectVisible(visible: boolean) {
|
||||
if (visible) void remoteSearchInstitutions('')
|
||||
}
|
||||
|
||||
// ── 表单数据 ──────────────────────────
|
||||
const formData = reactive({
|
||||
checkupInstitutionId: '',
|
||||
@@ -832,7 +858,7 @@
|
||||
} else {
|
||||
searchPatients()
|
||||
}
|
||||
loadInstitutions()
|
||||
void remoteSearchInstitutions('')
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -2,46 +2,160 @@
|
||||
<!-- eslint-disable vue/no-v-model-argument -->
|
||||
<template>
|
||||
<div class="refund-confirm-tab">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs" @tab-change="handleStatusTabChange">
|
||||
<el-tab-pane label="待确认" name="pending" />
|
||||
<el-tab-pane label="已确认" name="confirmed" />
|
||||
</el-tabs>
|
||||
<div class="finance-section-head finance-section-head--pending">
|
||||
<h3 class="finance-section-title">
|
||||
待确认
|
||||
<span v-if="pendingPagination.total > 0" class="finance-section-count">{{
|
||||
pendingPagination.total
|
||||
}}</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="refund-confirm-body">
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" label-position="top" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="申请单号/患者姓名"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="filter-block">
|
||||
<el-form :model="pendingSearchForm" class="filter-form" label-position="top" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="pendingSearchForm.keyword"
|
||||
:placeholder="keywordPlaceholder"
|
||||
clearable
|
||||
@keyup.enter="handlePendingSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">{{ filterHint }}</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handlePendingReset">
|
||||
<el-icon><RefreshLeft /></el-icon>重置
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handlePendingSearch">
|
||||
<el-icon><Search /></el-icon>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">支持按申请单号、患者姓名模糊检索。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset">
|
||||
<el-icon><RefreshLeft /></el-icon>重置
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch">
|
||||
<el-icon><Search /></el-icon>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div v-loading="pendingLoading" class="pending-card-section">
|
||||
<div v-if="pendingData.length" class="pending-card-grid">
|
||||
<article v-for="row in pendingData" :key="String(row.id)" class="pending-card">
|
||||
<div class="pending-card__head">
|
||||
<div class="pending-card__identity">
|
||||
<div class="pending-card__name">{{ pendingCardTitle(row) }}</div>
|
||||
<div class="pending-card__sub">
|
||||
{{ row.applicationNo || '-' }}
|
||||
<template v-if="isBasicExperiment && row.customerName">
|
||||
· {{ row.customerName }}
|
||||
</template>
|
||||
<template v-else-if="!isBasicExperiment && row.channelName">
|
||||
· {{ row.channelName }}
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pending-card__amount">
|
||||
<div class="pending-card__amount-val pending-card__amount-val--refund">
|
||||
{{ formatAmount(row.refundAmount) }}
|
||||
</div>
|
||||
<div class="pending-card__amount-label">退费金额</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
<div class="pending-card__grid">
|
||||
<div class="pending-card__field">
|
||||
<label>缴费金额</label>
|
||||
<span>{{ formatAmount(row.paymentAmount) }}</span>
|
||||
</div>
|
||||
<div class="pending-card__field">
|
||||
<label>细胞类型/规格</label>
|
||||
<span>{{ row.cellTypeSpec || '-' }}</span>
|
||||
</div>
|
||||
<div class="pending-card__field">
|
||||
<label>{{ pickupTimeLabel }}</label>
|
||||
<span>{{ row.infusionTime || '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pending-card__foot">
|
||||
<div class="pending-card__meta">
|
||||
<el-tag type="warning" size="small">退费确认中</el-tag>
|
||||
<span>提交 {{ row.createTime || '-' }}</span>
|
||||
</div>
|
||||
<el-button class="btn-op-item primary" @click="openConfirm(row)">
|
||||
<el-icon><Check /></el-icon>确认退费
|
||||
</el-button>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<div v-else-if="!pendingLoading" class="finance-empty">暂无待确认记录</div>
|
||||
<div v-if="pendingPagination.total > 0" class="pagination list-pager-bar pending-pager">
|
||||
<el-pagination
|
||||
:current-page="pendingPagination.page"
|
||||
:page-size="pendingPagination.pageSize"
|
||||
:total="pendingPagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="
|
||||
(val) => (
|
||||
(pendingPagination.page = 1),
|
||||
(pendingPagination.pageSize = val),
|
||||
loadPending()
|
||||
)
|
||||
"
|
||||
@current-change="(val) => ((pendingPagination.page = val), loadPending())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="finance-section-divider" />
|
||||
|
||||
<div class="finance-section-head">
|
||||
<h3 class="finance-section-title">
|
||||
已确认
|
||||
<span v-if="confirmedPagination.total > 0" class="finance-section-count">{{
|
||||
confirmedPagination.total
|
||||
}}</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form
|
||||
:model="confirmedSearchForm"
|
||||
class="filter-form"
|
||||
label-position="top"
|
||||
@submit.prevent
|
||||
>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="confirmedSearchForm.keyword"
|
||||
:placeholder="keywordPlaceholder"
|
||||
clearable
|
||||
@keyup.enter="handleConfirmedSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">{{ filterHint }}</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleConfirmedReset">
|
||||
<el-icon><RefreshLeft /></el-icon>重置
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleConfirmedSearch">
|
||||
<el-icon><Search /></el-icon>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="refund-confirm-body">
|
||||
<div class="list-body list-wrap refund-confirm-table-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
:data="confirmedData"
|
||||
v-loading="confirmedLoading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@row-dblclick="handleRowDblClick"
|
||||
@row-dblclick="openViewConfirm"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
@@ -49,7 +163,9 @@
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
:index="
|
||||
(index) => (confirmedPagination.page - 1) * confirmedPagination.pageSize + index + 1
|
||||
"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="applicationNo"
|
||||
@@ -146,13 +262,10 @@
|
||||
header-align="center"
|
||||
>
|
||||
<template #default>
|
||||
<el-tag :type="activeTab === 'pending' ? 'warning' : 'success'" size="small">
|
||||
{{ activeTab === 'pending' ? '退费确认中' : '已退费' }}
|
||||
</el-tag>
|
||||
<el-tag type="success" size="small">已退费</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="activeTab === 'confirmed'"
|
||||
prop="updateTime"
|
||||
label="确认时间"
|
||||
min-width="170"
|
||||
@@ -160,7 +273,6 @@
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="activeTab === 'confirmed'"
|
||||
prop="refundFinanceRemark"
|
||||
label="财务备注"
|
||||
min-width="120"
|
||||
@@ -170,30 +282,15 @@
|
||||
>
|
||||
<template #default="{ row }">{{ row.refundFinanceRemark || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="activeTab === 'pending'"
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
min-width="170"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="140"
|
||||
min-width="160"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="activeTab === 'pending'"
|
||||
class="btn-op-item primary"
|
||||
@click="openConfirm(row)"
|
||||
>
|
||||
<el-icon><Check /></el-icon>确认退费
|
||||
</el-button>
|
||||
<el-button v-else class="btn-op-item" @click="openViewConfirm(row)">
|
||||
<el-button class="btn-op-item" @click="openViewConfirm(row)">
|
||||
<el-icon><View /></el-icon>查看确认信息
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -201,13 +298,19 @@
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:current-page="confirmedPagination.page"
|
||||
:page-size="confirmedPagination.pageSize"
|
||||
:total="confirmedPagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
@size-change="
|
||||
(val) => (
|
||||
(confirmedPagination.page = 1),
|
||||
(confirmedPagination.pageSize = val),
|
||||
loadConfirmed()
|
||||
)
|
||||
"
|
||||
@current-change="(val) => ((confirmedPagination.page = val), loadConfirmed())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -219,6 +322,8 @@
|
||||
width="900px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
append-to-body
|
||||
modal-class="protocol-dialog-mask"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
@@ -319,6 +424,8 @@
|
||||
width="900px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
append-to-body
|
||||
modal-class="protocol-dialog-mask"
|
||||
destroy-on-close
|
||||
>
|
||||
<ClinicalPaymentSubmitReadonly
|
||||
@@ -386,18 +493,31 @@
|
||||
|
||||
defineOptions({ name: 'ClinicalRefundConfirmTab' })
|
||||
|
||||
const emit = defineEmits<{ actionDone: [] }>()
|
||||
|
||||
const props = defineProps<{ bizType?: string }>()
|
||||
const bizConfig = computed(() => getPilotBizConfig(props.bizType))
|
||||
const isBasicExperiment = computed(
|
||||
() => resolvePilotBizType(props.bizType) === 'basic_experiment'
|
||||
)
|
||||
const pickupTimeLabel = computed(() => bizConfig.value.pickupTimeLabel)
|
||||
const filterHint = computed(() =>
|
||||
isBasicExperiment.value
|
||||
? '支持按申请单号、课题名称、客户名称模糊检索。'
|
||||
: '支持按申请单号、患者姓名模糊检索。'
|
||||
)
|
||||
const keywordPlaceholder = computed(() =>
|
||||
isBasicExperiment.value ? '申请单号/课题名称/客户名称' : '申请单号/患者姓名'
|
||||
)
|
||||
|
||||
const activeTab = ref('pending')
|
||||
const searchForm = reactive({ keyword: '' })
|
||||
const tableData = ref<Record<string, unknown>[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const pendingSearchForm = reactive({ keyword: '' })
|
||||
const confirmedSearchForm = reactive({ keyword: '' })
|
||||
const pendingData = ref<Record<string, unknown>[]>([])
|
||||
const confirmedData = ref<Record<string, unknown>[]>([])
|
||||
const pendingLoading = ref(false)
|
||||
const confirmedLoading = ref(false)
|
||||
const pendingPagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const confirmedPagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const viewDialogVisible = ref(false)
|
||||
@@ -456,40 +576,77 @@
|
||||
window.open(fullFileUrl(url), '_blank')
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
keyword: searchForm.keyword || undefined,
|
||||
bizType: resolvePilotBizType(props.bizType)
|
||||
}
|
||||
const res =
|
||||
activeTab.value === 'pending'
|
||||
? await fetchClinicalRefundPending(params)
|
||||
: await fetchClinicalRefundConfirmed(params)
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
function pendingCardTitle(row: Record<string, unknown>) {
|
||||
if (isBasicExperiment.value) {
|
||||
return String(row.projectTitle || row.applicationNo || '-')
|
||||
}
|
||||
return String(row.patientName || row.applicationNo || '-')
|
||||
}
|
||||
|
||||
function buildPendingParams() {
|
||||
return {
|
||||
page: pendingPagination.page,
|
||||
pageSize: pendingPagination.pageSize,
|
||||
keyword: pendingSearchForm.keyword || undefined,
|
||||
bizType: resolvePilotBizType(props.bizType)
|
||||
}
|
||||
}
|
||||
|
||||
function handleStatusTabChange() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
function buildConfirmedParams() {
|
||||
return {
|
||||
page: confirmedPagination.page,
|
||||
pageSize: confirmedPagination.pageSize,
|
||||
keyword: confirmedSearchForm.keyword || undefined,
|
||||
bizType: resolvePilotBizType(props.bizType)
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
async function loadPending() {
|
||||
pendingLoading.value = true
|
||||
try {
|
||||
const res = await fetchClinicalRefundPending(buildPendingParams())
|
||||
pendingData.value = res.list || []
|
||||
pendingPagination.total = res.total ?? 0
|
||||
} finally {
|
||||
pendingLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
async function loadConfirmed() {
|
||||
confirmedLoading.value = true
|
||||
try {
|
||||
const res = await fetchClinicalRefundConfirmed(buildConfirmedParams())
|
||||
confirmedData.value = res.list || []
|
||||
confirmedPagination.total = res.total ?? 0
|
||||
} finally {
|
||||
confirmedLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function loadAll() {
|
||||
return Promise.all([loadPending(), loadConfirmed()])
|
||||
}
|
||||
|
||||
function handlePendingSearch() {
|
||||
pendingPagination.page = 1
|
||||
loadPending()
|
||||
}
|
||||
|
||||
function handlePendingReset() {
|
||||
pendingSearchForm.keyword = ''
|
||||
pendingPagination.page = 1
|
||||
loadPending()
|
||||
}
|
||||
|
||||
function handleConfirmedSearch() {
|
||||
confirmedPagination.page = 1
|
||||
loadConfirmed()
|
||||
}
|
||||
|
||||
function handleConfirmedReset() {
|
||||
confirmedSearchForm.keyword = ''
|
||||
confirmedPagination.page = 1
|
||||
loadConfirmed()
|
||||
}
|
||||
|
||||
function openConfirm(row: Record<string, unknown>) {
|
||||
@@ -505,10 +662,6 @@
|
||||
viewDialogVisible.value = true
|
||||
}
|
||||
|
||||
function handleRowDblClick(row: Record<string, unknown>) {
|
||||
if (activeTab.value !== 'pending') openViewConfirm(row)
|
||||
}
|
||||
|
||||
async function handleConfirmAttachmentChange(uploadFile: { raw?: File }) {
|
||||
const file = uploadFile.raw
|
||||
if (!file) return
|
||||
@@ -561,27 +714,215 @@
|
||||
refundFinanceRemark: confirmForm.financeRemark.trim() || undefined
|
||||
})
|
||||
dialogVisible.value = false
|
||||
loadData()
|
||||
await loadAll()
|
||||
emit('actionDone')
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
watchDebounced(
|
||||
[searchForm],
|
||||
[pendingSearchForm],
|
||||
() => {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
pendingPagination.page = 1
|
||||
loadPending()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
)
|
||||
|
||||
watchDebounced(
|
||||
[confirmedSearchForm],
|
||||
() => {
|
||||
confirmedPagination.page = 1
|
||||
loadConfirmed()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
loadAll()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.finance-section-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 12px 24px 0;
|
||||
}
|
||||
|
||||
.finance-section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text, #1e293b);
|
||||
line-height: 1.4;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--primary-dark, #059669);
|
||||
}
|
||||
}
|
||||
|
||||
.finance-section-head--pending .finance-section-title::before {
|
||||
background: #d97706;
|
||||
}
|
||||
|
||||
.finance-section-count {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 22px;
|
||||
height: 22px;
|
||||
padding: 0 6px;
|
||||
border-radius: 999px;
|
||||
background: #f1f5f9;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.finance-section-head--pending .finance-section-count {
|
||||
background: #fffbeb;
|
||||
color: #d97706;
|
||||
}
|
||||
|
||||
.finance-section-divider {
|
||||
height: 8px;
|
||||
margin: 8px 0 0;
|
||||
background: #f8fafc;
|
||||
border-top: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-bottom: 1px solid var(--mint-border, #e2e8f0);
|
||||
}
|
||||
|
||||
.pending-card-section {
|
||||
min-height: 80px;
|
||||
padding: 0 0 4px;
|
||||
}
|
||||
|
||||
.pending-card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
|
||||
gap: 12px;
|
||||
padding: 12px 24px 0;
|
||||
}
|
||||
|
||||
.pending-card {
|
||||
border: 1px solid var(--mint-border, #e2e8f0);
|
||||
border-radius: 10px;
|
||||
background: #fff;
|
||||
padding: 16px 18px;
|
||||
transition:
|
||||
border-color 0.15s,
|
||||
box-shadow 0.15s;
|
||||
|
||||
&:hover {
|
||||
border-color: #c5e0d4;
|
||||
box-shadow: 0 2px 8px rgb(15 23 42 / 5%);
|
||||
}
|
||||
}
|
||||
|
||||
.pending-card__head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.pending-card__name {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--text, #1e293b);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.pending-card__sub {
|
||||
margin-top: 2px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.pending-card__amount {
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.pending-card__amount-val {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-dark, #059669);
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 1.3;
|
||||
|
||||
&--refund {
|
||||
color: #d97706;
|
||||
}
|
||||
}
|
||||
|
||||
.pending-card__amount-label {
|
||||
margin-top: 2px;
|
||||
font-size: 11px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.pending-card__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 8px 16px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.pending-card__field label {
|
||||
display: block;
|
||||
margin-bottom: 2px;
|
||||
font-size: 11px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.pending-card__field span {
|
||||
font-size: 13px;
|
||||
color: var(--text, #1e293b);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.pending-card__foot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.pending-card__meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 12px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.pending-pager {
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
||||
.finance-empty {
|
||||
padding: 32px 24px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
|
||||
.filter-form :deep(.el-form-item) {
|
||||
margin-bottom: 0;
|
||||
min-width: 0;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -510,7 +510,7 @@
|
||||
patientName: props.scheduleRow?.patientName,
|
||||
infusionTime: props.scheduleRow?.infusionTime
|
||||
}
|
||||
await materialSectionsRef.value?.ensureMaterialOptions()
|
||||
await materialSectionsRef.value?.remoteSearchMaterials('')
|
||||
await materialSectionsRef.value?.loadFromApiData({
|
||||
remark: data.outboundMaterial?.remark,
|
||||
cells: data.outboundMaterial?.cells as any,
|
||||
|
||||
+59
-7
@@ -116,8 +116,14 @@
|
||||
<el-select
|
||||
v-model="row.materialId"
|
||||
filterable
|
||||
placeholder="搜索并选择物料"
|
||||
remote
|
||||
reserve-keyword
|
||||
clearable
|
||||
placeholder="输入物料名称检索"
|
||||
:loading="materialOptionsLoading"
|
||||
:remote-method="remoteSearchMaterials"
|
||||
class="inner-cell-input"
|
||||
@visible-change="(visible) => visible && remoteSearchMaterials('')"
|
||||
@change="(v) => onMaterialSelect($index, v)"
|
||||
>
|
||||
<el-option
|
||||
@@ -440,7 +446,7 @@
|
||||
} from '@element-plus/icons-vue'
|
||||
import { fetchUploadAttachment } from '@/api/business'
|
||||
import { fetchCellProductList } from '@/api/cell-product'
|
||||
import { fetchQcMaterialOptions, type QcMaterialOption } from '@/api/qc-material'
|
||||
import { fetchQcMaterialList, type QcMaterialOption } from '@/api/qc-material'
|
||||
import {
|
||||
fetchOutboundReleaseMaterial,
|
||||
saveOutboundReleaseMaterial,
|
||||
@@ -506,6 +512,7 @@
|
||||
const materialRows = ref<MaterialRow[]>([])
|
||||
const paperRows = ref<PaperRow[]>([])
|
||||
const materialOptions = ref<QcMaterialOption[]>([])
|
||||
const materialOptionsLoading = ref(false)
|
||||
|
||||
const cellSelectVisible = ref(false)
|
||||
const cellSearchKeyword = ref('')
|
||||
@@ -559,6 +566,54 @@
|
||||
)
|
||||
}
|
||||
|
||||
function mapMaterialListToOptions(list: Array<Record<string, any>>): QcMaterialOption[] {
|
||||
return (list || []).map((m) => ({
|
||||
id: String(m.id || ''),
|
||||
label: `${m.materialName || ''}${m.materialCode ? ` (${m.materialCode})` : ''}`.trim(),
|
||||
materialCode: String(m.materialCode || ''),
|
||||
materialName: String(m.materialName || ''),
|
||||
specModel: String(m.specModel || ''),
|
||||
unit: String(m.unit || ''),
|
||||
stockQty: Number(m.stockQty ?? 0)
|
||||
}))
|
||||
}
|
||||
|
||||
function ensureMaterialsInOptions(rows: MaterialRow[]) {
|
||||
const merged = [...materialOptions.value]
|
||||
for (const row of rows) {
|
||||
const id = String(row.materialId || '')
|
||||
if (!id || merged.some((o) => o.id === id)) continue
|
||||
merged.push({
|
||||
id,
|
||||
label: row.materialName || id,
|
||||
materialCode: '',
|
||||
materialName: row.materialName || '',
|
||||
specModel: row.specModel || '',
|
||||
unit: row.unit || '',
|
||||
stockQty: 0
|
||||
})
|
||||
}
|
||||
materialOptions.value = merged
|
||||
}
|
||||
|
||||
async function remoteSearchMaterials(query: string) {
|
||||
materialOptionsLoading.value = true
|
||||
try {
|
||||
const res = await fetchQcMaterialList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query?.trim() || undefined
|
||||
})
|
||||
materialOptions.value = mapMaterialListToOptions(res.list || [])
|
||||
ensureMaterialsInOptions(materialRows.value)
|
||||
} catch {
|
||||
materialOptions.value = []
|
||||
ensureMaterialsInOptions(materialRows.value)
|
||||
} finally {
|
||||
materialOptionsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function stockQtyDisplay(materialId: string) {
|
||||
const opt = materialOptions.value.find((o) => o.id === materialId)
|
||||
if (!opt || opt.stockQty == null) return '—'
|
||||
@@ -733,11 +788,7 @@
|
||||
if (!props.scheduleId) return
|
||||
loading.value = true
|
||||
try {
|
||||
const [data, opts] = await Promise.all([
|
||||
fetchOutboundReleaseMaterial(props.scheduleId),
|
||||
fetchQcMaterialOptions().catch(() => [] as QcMaterialOption[])
|
||||
])
|
||||
materialOptions.value = opts || []
|
||||
const data = await fetchOutboundReleaseMaterial(props.scheduleId)
|
||||
formRemark.value = data.remark || ''
|
||||
cellRows.value = (data.cells || []).map((c) => ({ ...c }))
|
||||
materialRows.value = (data.qcMaterials || []).map((m) => ({
|
||||
@@ -750,6 +801,7 @@
|
||||
remark: m.remark || ''
|
||||
}))
|
||||
paperRows.value = mapPaperRowsFromApi(data.paperMaterials, data.paperAttachments)
|
||||
await remoteSearchMaterials('')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
@@ -25,9 +25,15 @@
|
||||
<el-form-item label="体检机构">
|
||||
<el-select
|
||||
v-model="searchForm.checkupInstitutionId"
|
||||
placeholder="全部"
|
||||
placeholder="输入机构名称检索"
|
||||
clearable
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
:loading="institutionOptionsLoading"
|
||||
:remote-method="remoteSearchInstitutions"
|
||||
@visible-change="onInstitutionSelectVisible"
|
||||
>
|
||||
<el-option
|
||||
v-for="inst in institutionOptions"
|
||||
@@ -303,8 +309,6 @@
|
||||
checkupInstitutionId: ''
|
||||
})
|
||||
|
||||
const institutionOptions = ref<any[]>([])
|
||||
|
||||
// ── 表格 ─────────────────────────────
|
||||
const loading = ref(false)
|
||||
const tableData = ref<any[]>([])
|
||||
@@ -353,15 +357,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
const loadInstitutions = async () => {
|
||||
const institutionOptions = ref<any[]>([])
|
||||
const institutionOptionsLoading = ref(false)
|
||||
|
||||
async function remoteSearchInstitutions(query: string) {
|
||||
institutionOptionsLoading.value = true
|
||||
try {
|
||||
const res: any = await fetchCheckupInstitutionList({ page: 1, pageSize: 100, status: '1' })
|
||||
const res: any = await fetchCheckupInstitutionList({
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
keyword: query?.trim() || undefined,
|
||||
status: '1'
|
||||
})
|
||||
institutionOptions.value = Array.isArray(res) ? res : (res?.list ?? [])
|
||||
} catch {
|
||||
institutionOptions.value = []
|
||||
} finally {
|
||||
institutionOptionsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function onInstitutionSelectVisible(visible: boolean) {
|
||||
if (visible) void remoteSearchInstitutions('')
|
||||
}
|
||||
|
||||
// ── 事件 ──────────────────────────────
|
||||
const handleSearch = () => {
|
||||
pagination.page = 1
|
||||
@@ -465,7 +484,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
loadInstitutions()
|
||||
void remoteSearchInstitutions('')
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user