248f1b5f by renchao@pashanhoo.com

style:登记薄字典转换

1 parent 0feaffa7
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-10-20 10:17:28
* @LastEditTime: 2023-10-20 10:27:25
-->
<template>
<div class="tableBox">
......@@ -143,18 +143,23 @@
},
methods: {
getLable (prop, label) {
let ztObj = {
const ztObj = {
0: '否',
1: '是'
}
if (['sfygdj', 'sfczjzhxz'].includes(prop)) {
return ztObj[label]
} else if (prop == 'dyrlx') {
let arr = this.dictData['A36'].filter(item => item.dcode === label)
return arr[0].dname;
} else {
return label
}
};
const strategies = {
sfygdj: (label) => ztObj[label] || label,
sfczjzhxz: (label) => ztObj[label] || label,
dyrlx: (label) => {
let arr = this.dictData['A36'].filter(item => item.dcode === label);
return arr.length > 0 ? arr[0].dname : label;
},
default: (label) => label
};
const strategy = strategies[prop] || strategies.default;
return strategy(label);
},
openPrint () {
this.render = true;
......
<!--
* @Description:
* @Autor: miaofang
* @LastEditTime: 2023-10-20 10:17:47
* @LastEditTime: 2023-10-20 10:28:07
-->
<template>
<div class="djxxTable">
......@@ -156,18 +156,23 @@
},
methods: {
getLable (prop, label) {
let ztObj = {
const ztObj = {
0: '否',
1: '是'
}
if (['sfygdj', 'sfczjzhxz'].includes(prop)) {
return ztObj[label]
} else if (prop == 'dyrlx') {
let arr = this.dictData['A36'].filter(item => item.dcode === label)
return arr[0].dname;
} else {
return label
}
};
const strategies = {
sfygdj: (label) => ztObj[label] || label,
sfczjzhxz: (label) => ztObj[label] || label,
dyrlx: (label) => {
let arr = this.dictData['A36'].filter(item => item.dcode === label);
return arr.length > 0 ? arr[0].dname : label;
},
default: (label) => label
};
const strategy = strategies[prop] || strategies.default;
return strategy(label);
},
openPrint () {
this.render = true;
......