fix:zt_batch_gx展开行count_*字段后缀翻译为中文

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
caoqianming 2026-07-14 12:39:08 +08:00
parent 33366baef7
commit 0a3f7d7292
1 changed files with 24 additions and 1 deletions

View File

@ -64,7 +64,7 @@
<el-table-column type="expand">
<template #default="scope">
<el-descriptions :column="4" size="small" border style="margin: 0 20px;">
<el-descriptions-item v-for="(v, k) in scope.row.data" :key="k" :label="k">{{ v }}</el-descriptions-item>
<el-descriptions-item v-for="(v, k) in displayData(scope.row.data)" :key="k" :label="k">{{ v }}</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
@ -148,6 +148,29 @@ export default {
let s = row.data.直通_子批次;
return s ? s.split(";").length : 0;
},
displayData(data) {
// count_* ( _count_ok_full _count_ok )
const map = [
["_count_ok_full", "_完全合格数"],
["_count_notok", "_不合格数"],
["_count_ok", "_合格数"],
["_count_use", "_领用数"],
["_count_real", "_生产数"],
["_count_pn_jgqbl", "_加工前不良"],
];
const out = {};
for (const k in data) {
let nk = k;
for (const [en, cn] of map) {
if (nk.includes(en)) {
nk = nk.replace(en, cn);
break;
}
}
out[nk] = data[k];
}
return out;
},
getList(val) {
let that = this;
that.params.page = val ? val : 1;