简单汉化

This commit is contained in:
Cheng Zhou
2025-12-17 19:23:34 +08:00
parent 1e6cae6b6e
commit 4f50237f56
41 changed files with 2123 additions and 92 deletions
+18 -4
View File
@@ -4,8 +4,8 @@
<div class="filters">
<el-input v-model="filters.site_id" placeholder="中心ID" clearable @change="load" style="width: 160px" />
<el-input v-model="filters.batch_id" placeholder="批次ID" clearable @change="load" style="width: 160px" />
<el-select v-model="filters.tx_type" placeholder="类型" clearable @change="load" style="width: 160px">
<el-option v-for="t in txTypes" :key="t" :label="t" :value="t" />
<el-select v-model="filters.tx_type" placeholder="交易类型" clearable @change="load" style="width: 160px">
<el-option v-for="t in txTypes" :key="t" :label="txTypeLabel(t)" :value="t" />
</el-select>
<el-date-picker
v-model="filters.date_from"
@@ -23,14 +23,18 @@
/>
<div class="spacer" />
<PermissionAction action="imp.transaction">
<el-button type="primary" @click="showForm = true">交易</el-button>
<el-button type="primary" @click="showForm = true">交易</el-button>
</PermissionAction>
</div>
</el-card>
<el-card>
<el-table :data="txs" v-loading="loading" style="width: 100%">
<el-table-column prop="tx_date" label="日期" width="120" />
<el-table-column prop="tx_type" label="类型" width="140" />
<el-table-column prop="tx_type" label="类型" width="140">
<template #default="scope">
{{ txTypeLabel(scope.row.tx_type) }}
</template>
</el-table-column>
<el-table-column prop="site_id" label="中心" width="180" />
<el-table-column prop="batch_id" label="批次" width="180" />
<el-table-column prop="subject_id" label="受试者" width="180" />
@@ -115,6 +119,16 @@ const onPageChange = (p: number) => {
load();
};
const txTypeLabel = (t: string) =>
({
RECEIPT: "入库",
DISPENSE: "发放",
RETURN: "回收",
DESTROY: "销毁",
TRANSFER_IN: "调入",
TRANSFER_OUT: "调出",
}[t] || t);
onMounted(async () => {
if (!auth.user && auth.token) {
await auth.fetchMe().catch(() => {});