汇总近期业务改动:催缴菜单与后端、样本信息快捷登记与进度、运费关联、客户档案扩展、协议优惠/期次与押金划转,并同步 SQL 迁移与管理端页面收敛。 Co-authored-by: Cursor <cursoragent@cursor.com>
62 lines
1.8 KiB
Vue
62 lines
1.8 KiB
Vue
<template>
|
||
<div class="unified-protocol-page">
|
||
<div class="panel-pill-tabs">
|
||
<div class="panel-pill-tabs__track" role="tablist" aria-label="协议来源">
|
||
<button
|
||
v-for="item in tabs"
|
||
:key="item.key"
|
||
type="button"
|
||
role="tab"
|
||
class="panel-pill-tabs__btn"
|
||
:class="{ 'is-active': activeSource === item.key }"
|
||
:aria-selected="activeSource === item.key"
|
||
@click="switchSource(item.key)"
|
||
>
|
||
{{ item.title }}
|
||
</button>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- v-if:仅挂载当前 Tab,避免双列表同时请求 -->
|
||
<ProtocolAuditTab v-if="activeSource === 'cell_storage'" />
|
||
<DonationProtocolTab v-else />
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import ProtocolAuditTab from './ProtocolAuditTab.vue'
|
||
import DonationProtocolTab from './DonationProtocolTab.vue'
|
||
|
||
defineOptions({ name: 'UnifiedProtocolPage' })
|
||
|
||
const props = defineProps<{
|
||
defaultSource: 'cell_storage' | 'research_donation'
|
||
}>()
|
||
|
||
type SourceKey = 'cell_storage' | 'research_donation'
|
||
|
||
const tabs: Array<{ key: SourceKey; title: string }> = [
|
||
{ key: 'cell_storage', title: '细胞存储' },
|
||
{ key: 'research_donation', title: '科研捐赠' }
|
||
]
|
||
|
||
const route = useRoute()
|
||
const router = useRouter()
|
||
const activeSource = ref<SourceKey>(props.defaultSource)
|
||
|
||
function switchSource(key: SourceKey) {
|
||
if (activeSource.value === key) return
|
||
activeSource.value = key
|
||
router.replace({ query: { ...route.query, tab: key } })
|
||
}
|
||
|
||
onMounted(() => {
|
||
const tab = String(route.query.tab || '')
|
||
if (tab === 'cell_storage' || tab === 'research_donation') {
|
||
activeSource.value = tab
|
||
return
|
||
}
|
||
activeSource.value = props.defaultSource
|
||
})
|
||
</script>
|