feat(qc): 样本接收已接收支持按样本类型与是否废弃筛选
已接收列表增加 sampleTypeId、isVoided 查询参数与前端检索栏,便于质检进一步筛选样本。
This commit is contained in:
1 parent
c22a0d1eb0
commit
7792c28893
5 files changed
+198
-2
No files matched your search
@@ -27,6 +27,9 @@ export function fetchSampleReceptionReceivedList(params?: {
|
||||
pageSize?: number
|
||||
keyword?: string
|
||||
sourceType?: string
|
||||
sampleTypeId?: string
|
||||
/** true=已作废(yzf),false=非已作废,不传=全部 */
|
||||
isVoided?: boolean
|
||||
receptionTimeStart?: string
|
||||
receptionTimeEnd?: string
|
||||
}) {
|
||||
|
||||
@@ -58,6 +58,27 @@
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="activeTab === 'received'" label="样本类型">
|
||||
<el-select
|
||||
v-model="searchForm.sampleTypeId"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in sampleTypeOptions"
|
||||
:key="opt.id"
|
||||
:label="opt.label"
|
||||
:value="opt.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="activeTab === 'received'" label="是否废弃">
|
||||
<el-select v-model="searchForm.isVoided" placeholder="全部" clearable>
|
||||
<el-option label="是" value="true" />
|
||||
<el-option label="否" value="false" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<div class="filter-actions-end">
|
||||
@@ -727,7 +748,8 @@
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Close, Check, Search, RefreshLeft, Files } from '@element-plus/icons-vue'
|
||||
import { fetchUserOptions } from '@/api/admin'
|
||||
import { fetchUserOptions, fetchCellSampleTypeList } from '@/api/admin'
|
||||
import { fetchAllPagedRecords } from '@/utils/fetch-paged-list'
|
||||
import {
|
||||
fetchSampleReceptionPendingList,
|
||||
fetchSampleReceptionReceivedList,
|
||||
@@ -831,7 +853,13 @@
|
||||
] as const
|
||||
|
||||
const activeTab = ref(props.receivedOnly ? 'received' : 'pending')
|
||||
const searchForm = reactive({ keyword: '', sourceType: '' })
|
||||
const searchForm = reactive({
|
||||
keyword: '',
|
||||
sourceType: '',
|
||||
sampleTypeId: '',
|
||||
isVoided: '' as '' | 'true' | 'false'
|
||||
})
|
||||
const sampleTypeOptions = ref<Array<{ id: string; label: string }>>([])
|
||||
|
||||
const etaDateRange = ref<[string, string] | null>(null)
|
||||
const receptionTimeRange = ref<[string, string] | null>(null)
|
||||
@@ -1405,6 +1433,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function loadSampleTypeOptions() {
|
||||
try {
|
||||
const list = await fetchAllPagedRecords((page, pageSize) =>
|
||||
fetchCellSampleTypeList({ page, pageSize })
|
||||
)
|
||||
sampleTypeOptions.value = list
|
||||
.map((row) => ({
|
||||
id: String(row.id || '').trim(),
|
||||
label: String(row.typeName || '').trim()
|
||||
}))
|
||||
.filter((opt) => opt.id && opt.label)
|
||||
} catch {
|
||||
sampleTypeOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -1423,6 +1467,13 @@
|
||||
})
|
||||
: await fetchSampleReceptionReceivedList({
|
||||
...baseParams,
|
||||
sampleTypeId: searchForm.sampleTypeId || undefined,
|
||||
isVoided:
|
||||
searchForm.isVoided === 'true'
|
||||
? true
|
||||
: searchForm.isVoided === 'false'
|
||||
? false
|
||||
: undefined,
|
||||
receptionTimeStart: receptionTimeRange.value?.[0] || undefined,
|
||||
receptionTimeEnd: receptionTimeRange.value?.[1] || undefined
|
||||
})
|
||||
@@ -1435,6 +1486,8 @@
|
||||
|
||||
function handleStatusTabChange() {
|
||||
selectedPendingRows.value = []
|
||||
searchForm.sampleTypeId = ''
|
||||
searchForm.isVoided = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
@@ -1453,6 +1506,8 @@
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
searchForm.sourceType = ''
|
||||
searchForm.sampleTypeId = ''
|
||||
searchForm.isVoided = ''
|
||||
if (activeTab.value === 'pending') {
|
||||
etaDateRange.value = null
|
||||
} else {
|
||||
@@ -1625,6 +1680,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
loadUserOptions()
|
||||
void loadSampleTypeOptions()
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user