Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-04-29 09:33:17 +07:00
commit 67a726fcdf
2 changed files with 49 additions and 10 deletions

View file

@ -30,6 +30,7 @@ const {
date2Thai,
dialogRemove,
onSearchDataTable,
findChildNameHtml,
} = useCounterMixin();
const modal = ref<boolean>(false);
@ -130,7 +131,7 @@ const columns = ref<QTableProps["columns"]>([
sortable: true,
field: "organizationPositionReturn",
format(val, row) {
return row.organizationPositionOld.replace(/\n/g, " ");
return row.organizationPositionReturn.replace(/\n/g, " ");
},
headerStyle: "font-size: 14px",
style: "font-size: 14px",
@ -480,29 +481,27 @@ onMounted(() => {
<div v-else-if="col.name === 'organizationPositionReturn'">
<div class="col-4">
<div>
{{
props.row.position !== null ? props.row.position : ""
}}{{
<!-- {{
(props.row.posTypeName !== null &&
props.row.posTypeName === "บริหาร") ||
props.row.posTypeName === "อำนวยการ"
? `${props.row.posTypeName}`
: ""
}} -->
{{
props.row.position !== null ? props.row.position : ""
}}{{
props.row.posLevelName !== null
? `${props.row.posLevelName}`
: ""
}}
</div>
<div>
{{ props.row.root !== null ? props.row.root : "-" }}
{{
props.row.rootShortName !== null
? `(${props.row.rootShortName})`
props.row.nodeShortName !== null
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
: ""
}}
</div>
<div>
<!-- <div>
{{
props.row.nodeName !== null ? props.row.nodeName : ""
}}
@ -511,6 +510,9 @@ onMounted(() => {
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
: ""
}}
</div> -->
<div class="text-html">
{{ findChildNameHtml(props.row) }}
</div>
</div>
</div>

View file

@ -1228,6 +1228,42 @@ export const useCounterMixin = defineStore("mixin", () => {
}
}
function findChildNameHtml(obj: any) {
if (obj) {
let name =
obj.child4 != null && obj.child3 != null
? obj.child4 + (obj.child3 ? "\n" : "")
: obj.child4 != null
? obj.child4
: "";
name +=
obj.child3 != null && obj.child2 != null
? obj.child3 + (obj.child2 ? "\n" : "")
: obj.child3 !== null
? obj.child3
: "";
name +=
obj.child2 != null && obj.child1 != null
? obj.child2 + (obj.child1 ? "\n" : "")
: obj.child2 != null
? obj.child2
: "";
name +=
obj.child1 != null && obj.root != null
? obj.child1 + (obj.root ? "\n" : "")
: obj.child1 != null
? obj.child1
: "";
name += obj.root != null ? obj.root : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findPosMasterNoOld(obj: any) {
if (obj) {
let shortName =
@ -1391,5 +1427,6 @@ export const useCounterMixin = defineStore("mixin", () => {
findOrgNameHtml,
findOrgNameOldHtml,
findOrgChildNameHtml,
findChildNameHtml,
};
});