fix:zt_batch_gx展开行count_*字段后缀翻译为中文
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
33366baef7
commit
0a3f7d7292
|
|
@ -64,7 +64,7 @@
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-descriptions :column="4" size="small" border style="margin: 0 20px;">
|
<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>
|
</el-descriptions>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -148,6 +148,29 @@ export default {
|
||||||
let s = row.data.直通_子批次;
|
let s = row.data.直通_子批次;
|
||||||
return s ? s.split(";").length : 0;
|
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) {
|
getList(val) {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.params.page = val ? val : 1;
|
that.params.page = val ? val : 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue