diff --git a/src/components/CardProfile.vue b/src/components/CardProfile.vue index 57f7029a2..38b1cf3b1 100644 --- a/src/components/CardProfile.vue +++ b/src/components/CardProfile.vue @@ -16,7 +16,7 @@ import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue"; import { useCounterMixin } from "@/stores/mixin"; /** use*/ -const { findOrgNameOld, findOrgName } = useCounterMixin(); +const { findOrgNameOld, findOrgName, textTranForm } = useCounterMixin(); /** propsDataProfile*/ const props = defineProps({ @@ -154,7 +154,7 @@ watch( {{ props.type.toLowerCase() == "employee" ? "กลุ่มงาน" - : "ประเภทตำแหน่ง" + : "ตำแหน่งประเภท" }}
@@ -165,8 +165,8 @@ watch(
สังกัด
-
- {{ profile.organization }} +
+ {{ textTranForm(profile.organization) }}
diff --git a/src/components/Dialogs/PopupPersonalNew.vue b/src/components/Dialogs/PopupPersonalNew.vue index fae1f653e..e31059a9a 100644 --- a/src/components/Dialogs/PopupPersonalNew.vue +++ b/src/components/Dialogs/PopupPersonalNew.vue @@ -22,7 +22,7 @@ const mixin = useCounterMixin(); const router = useRouter(); const $q = useQuasar(); const retireDate = ref(); -const { showLoader, hideLoader, messageError, date2Thai } = mixin; +const { showLoader, hideLoader, messageError, date2Thai,textTranForm } = mixin; const isEmployee = defineModel("isEmployee", { type: String }); const empType = ref("officer"); @@ -370,11 +370,11 @@ async function fetchProfile(id: string, avatarName: string) { ข้อมูลราชการ
-
+
diff --git a/src/modules/06_retirement/components/01_retirement/AddList.vue b/src/modules/06_retirement/components/01_retirement/AddList.vue index fbdb99b3f..3b0103091 100644 --- a/src/modules/06_retirement/components/01_retirement/AddList.vue +++ b/src/modules/06_retirement/components/01_retirement/AddList.vue @@ -1,5 +1,5 @@ diff --git a/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue b/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue index b07c69d4a..237c7c437 100644 --- a/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue +++ b/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue @@ -33,7 +33,7 @@ const dataMapToSend = computed(() => { })); }); const mixin = useCounterMixin(); -const { dialogConfirm, date2Thai, onSearchDataTable } = mixin; +const { dialogConfirm, date2Thai, onSearchDataTable, textTranForm } = mixin; /** props*/ const props = defineProps({ @@ -41,11 +41,11 @@ const props = defineProps({ closeModal: { type: Function, requreid: true }, fecthList: { type: Function, requreid: true }, rows: { type: Array as PropType, requreid: true }, - filterKeyword2: { type: String, requreid: true }, mainTabs: { type: String, requreid: true }, }); //Table +const filterKeyword = defineModel("filterKeyword", { required: true }); const rowsData = ref([]); const rowsDataMain = ref([]); const columns = ref([ @@ -84,7 +84,7 @@ const columns = ref([ { name: "positionLevel", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: true, field: "positionLevel", headerStyle: "font-size: 14px", @@ -104,7 +104,7 @@ const columns = ref([ { name: "positionNumberOld", align: "left", - label: "เลขที่", + label: "เลขที่ตำแหน่ง", sortable: true, field: "positionNumberOld", headerStyle: "font-size: 14px", @@ -118,6 +118,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "datetext", @@ -161,7 +164,6 @@ const modalCommand = ref(false); /** popup ยืนยันส่งัว */ function saveOrder() { - console.log(selected.value); dialogConfirm( $q, @@ -181,7 +183,7 @@ function updateInput(value: any) { async function onSearch() { rowsData.value = onSearchDataTable( - props.filterKeyword2 ? props.filterKeyword2 : "", + filterKeyword.value, rowsDataMain.value, columns.value ? columns.value : [] ); @@ -214,8 +216,7 @@ watch( borderless outlined dense - :model-value="filterKeyword2" - @update:model-value="updateInput" + v-model="filterKeyword" @keydown.enter="onSearch" placeholder="ค้นหา" > @@ -269,14 +270,17 @@ watch(
- {{ col.value ? col.value : "" }} + {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
+ {{ col.value ? col.value : "-" }}
diff --git a/src/modules/06_retirement/components/02_resign/ResignByid.vue b/src/modules/06_retirement/components/02_resign/ResignByid.vue index b3cda9a01..fd82d91f4 100644 --- a/src/modules/06_retirement/components/02_resign/ResignByid.vue +++ b/src/modules/06_retirement/components/02_resign/ResignByid.vue @@ -1274,9 +1274,9 @@ onMounted(async () => { :readonly="!edit" :borderless="!edit" v-model="posNo" - :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]" hide-bottom-space - :label="`${'เลขที่'}`" + :label="`${'เลขที่ตำแหน่ง'}`" />
diff --git a/src/modules/06_retirement/components/02_resign/ResignReject.vue b/src/modules/06_retirement/components/02_resign/ResignReject.vue index 9ef57d5f6..1e9967cbd 100644 --- a/src/modules/06_retirement/components/02_resign/ResignReject.vue +++ b/src/modules/06_retirement/components/02_resign/ResignReject.vue @@ -636,9 +636,9 @@ onMounted(async () => { :readonly="!edit" :borderless="!edit" v-model="posNo" - :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]" hide-bottom-space - :label="`${'เลขที่'}`" + :label="`${'เลขที่ตำแหน่ง'}`" />
diff --git a/src/modules/06_retirement/components/02_resign/Table.vue b/src/modules/06_retirement/components/02_resign/Table.vue index c050970f9..b7ef6851c 100644 --- a/src/modules/06_retirement/components/02_resign/Table.vue +++ b/src/modules/06_retirement/components/02_resign/Table.vue @@ -23,8 +23,15 @@ const stroeResign = useDataStore(); const { statusText } = stroe; const router = useRouter(); const mixin = useCounterMixin(); -const { messageError, date2Thai, showLoader, hideLoader, onSearchDataTable } = - mixin; +const { + messageError, + date2Thai, + showLoader, + hideLoader, + onSearchDataTable, + findOrgName, + textTranForm, +} = mixin; /** Table */ const rows = ref([]); @@ -65,7 +72,7 @@ const columns = ref([ { name: "positionLevel", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: true, field: "positionLevel", headerStyle: "font-size: 14px", @@ -85,7 +92,7 @@ const columns = ref([ { name: "positionNumberOld", align: "left", - label: "เลขที่", + label: "เลขที่ตำแหน่ง", sortable: true, field: "positionNumberOld", headerStyle: "font-size: 14px", @@ -99,6 +106,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "datetext", @@ -377,7 +387,19 @@ onMounted(async () => { : '' " > - {{ col.value ? col.value : "-" }} +
+ {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
+ {{ col.value ? col.value : "-" }} +
@@ -389,7 +411,7 @@ onMounted(async () => { { })); }); const mixin = useCounterMixin(); -const { dialogConfirm, date2Thai, onSearchDataTable } = mixin; +const { dialogConfirm, date2Thai, onSearchDataTable, textTranForm } = mixin; /** props*/ const props = defineProps({ @@ -41,10 +41,11 @@ const props = defineProps({ closeModal: { type: Function, requreid: true }, fecthList: { type: Function, requreid: true }, rows: { type: Array as PropType, requreid: true }, - filterKeyword2: { type: String, requreid: true }, mainTabs: { type: String, requreid: true }, }); +const filterKeyword = defineModel("filterKeyword", { required: true }); + //Table const rowsData = ref([]); const rowsDataMain = ref([]); @@ -104,7 +105,7 @@ const columns = ref([ { name: "positionNumberOld", align: "left", - label: "เลขที่", + label: "ตำแหน่งเลขที่", sortable: true, field: "positionNumberOld", headerStyle: "font-size: 14px", @@ -118,6 +119,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "datetext", @@ -179,7 +183,7 @@ function updateInput(value: any) { async function onSearch() { rowsData.value = onSearchDataTable( - props.filterKeyword2 ? props.filterKeyword2 : "", + filterKeyword.value, rowsDataMain.value, columns.value ? columns.value : [] ); @@ -212,8 +216,7 @@ watch( borderless outlined dense - :model-value="filterKeyword2" - @update:model-value="updateInput" + :model-value="filterKeyword" placeholder="ค้นหา" @keydown.enter="onSearch" > @@ -267,14 +270,17 @@ watch(
- {{ col.value ? col.value : "" }} + {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
+ {{ col.value ? col.value : "-" }}
diff --git a/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue b/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue index 8c58a186d..de28f01f6 100644 --- a/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue +++ b/src/modules/06_retirement/components/03_resignEmp/ResignByid.vue @@ -1295,9 +1295,9 @@ onMounted(async () => { :readonly="!edit" :borderless="!edit" v-model="posNo" - :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]" hide-bottom-space - :label="`${'เลขที่'}`" + :label="`${'ตำแหน่งเลขที่'}`" /> diff --git a/src/modules/06_retirement/components/03_resignEmp/ResignReject.vue b/src/modules/06_retirement/components/03_resignEmp/ResignReject.vue index e4df16e86..f94cf4bbc 100644 --- a/src/modules/06_retirement/components/03_resignEmp/ResignReject.vue +++ b/src/modules/06_retirement/components/03_resignEmp/ResignReject.vue @@ -667,9 +667,9 @@ onMounted(async () => { :readonly="!edit" :borderless="!edit" v-model="posNo" - :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]" hide-bottom-space - :label="`${'เลขที่'}`" + :label="`${'ตำแหน่งเลขที่'}`" /> diff --git a/src/modules/06_retirement/components/03_resignEmp/Table.vue b/src/modules/06_retirement/components/03_resignEmp/Table.vue index 1c73be261..b971d0cb4 100644 --- a/src/modules/06_retirement/components/03_resignEmp/Table.vue +++ b/src/modules/06_retirement/components/03_resignEmp/Table.vue @@ -23,8 +23,14 @@ const stroeResign = useDataStore(); const { statusText } = stroe; const router = useRouter(); const mixin = useCounterMixin(); -const { messageError, date2Thai, showLoader, hideLoader, onSearchDataTable } = - mixin; +const { + messageError, + date2Thai, + showLoader, + hideLoader, + onSearchDataTable, + textTranForm, +} = mixin; /** Table */ const rows = ref([]); @@ -85,7 +91,7 @@ const columns = ref([ { name: "positionNumberOld", align: "left", - label: "เลขที่", + label: "ตำแหน่งเลขที่", sortable: true, field: "positionNumberOld", headerStyle: "font-size: 14px", @@ -99,6 +105,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "datetext", @@ -374,13 +383,16 @@ onMounted(async () => {
+ {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
{{ col.value ? col.value : "-" }}
@@ -393,7 +405,7 @@ onMounted(async () => { { :readonly="!edit" :borderless="!edit" v-model="positionTypeOld" - :rules="[(val:string) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]" hide-bottom-space - :label="`${'ประเภทตำแหน่ง'}`" + :label="`${'ตำแหน่งประเภท'}`" /> @@ -306,9 +306,9 @@ onMounted(async () => { :readonly="!edit" :borderless="!edit" v-model="posNo" - :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]" hide-bottom-space - :label="`${'เลขที่'}`" + :label="`${'เลขที่ตำแหน่ง'}`" /> diff --git a/src/modules/06_retirement/components/06_dismissOrder/DetailEMP.vue b/src/modules/06_retirement/components/06_dismissOrder/DetailEMP.vue index 789c789ff..a14700c9d 100644 --- a/src/modules/06_retirement/components/06_dismissOrder/DetailEMP.vue +++ b/src/modules/06_retirement/components/06_dismissOrder/DetailEMP.vue @@ -307,9 +307,9 @@ onMounted(async () => { :readonly="!edit" :borderless="!edit" v-model="posNo" - :rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]" + :rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]" hide-bottom-space - :label="`${'เลขที่'}`" + :label="`${'ตำแหน่งเลขที่'}`" /> diff --git a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue index 5707ac6a0..875c1b4bd 100644 --- a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue +++ b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue @@ -52,6 +52,7 @@ const { hideLoader, date2Thai, onSearchDataTable, + textTranForm, } = mixin; /** คอลัมน์ */ @@ -80,7 +81,7 @@ const columns = ref([ { name: "positionLevel", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: true, field: "positionLevel", headerStyle: "font-size: 14px", @@ -105,6 +106,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "createdAt", @@ -256,10 +260,14 @@ watchEffect(() => { {{ props.rowIndex + 1 }} -
+
+ {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
{{ col.value ? col.value : "-" }}
diff --git a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue index 7dccf04ad..65affb5ea 100644 --- a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue +++ b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue @@ -52,6 +52,7 @@ const { hideLoader, date2Thai, onSearchDataTable, + textTranForm, } = mixin; /** คอลัมน์ */ @@ -105,6 +106,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "createdAt", @@ -257,9 +261,16 @@ watchEffect(() => {
+ {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
{{ col.value ? col.value : "-" }}
diff --git a/src/modules/06_retirement/views/04_exitInterview.vue b/src/modules/06_retirement/views/04_exitInterview.vue index 8044bd885..0f2a6d4dd 100644 --- a/src/modules/06_retirement/views/04_exitInterview.vue +++ b/src/modules/06_retirement/views/04_exitInterview.vue @@ -189,7 +189,6 @@ async function fecthlist() { }); rows.value = list; rowsData.value = list; - console.log(rows.value); filters.value = list; }) diff --git a/src/modules/06_retirement/views/05_deceased.vue b/src/modules/06_retirement/views/05_deceased.vue index c7af1eae3..373ee304d 100644 --- a/src/modules/06_retirement/views/05_deceased.vue +++ b/src/modules/06_retirement/views/05_deceased.vue @@ -23,6 +23,7 @@ const { date2Thai, findOrgName, onSearchDataTable, + findOrgNameHtml, } = mixin; /** คอลัมน์ */ @@ -62,7 +63,7 @@ const columns = ref([ { name: "profileType", align: "left", - label: "สถานภาพ", + label: "ประเภทตำแหน่ง", sortable: true, field: "profileType", headerStyle: "font-size: 14px", @@ -89,7 +90,7 @@ const columns = ref([ { name: "positionType", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: true, field: "positionType", headerStyle: "font-size: 14px", @@ -155,7 +156,6 @@ async function fectListDecased() { .get(config.API.listDeceased()) .then((res) => { const data = res.data.result; - console.log(data); rows.value = data; rowsData.value = data; @@ -214,7 +214,7 @@ onMounted(() => { map-options option-value="id" option-label="name" - label="สถานภาพ" + label="ประเภทตำแหน่ง" :clearable="employeeClass !== ''" style="width: 200px" @clear="employeeClass = ''" @@ -294,10 +294,10 @@ onMounted(() => { {{ props.rowIndex + 1 }} -
+
+ {{ props.row ? findOrgNameHtml(props.row) : "-" }} +
+
{{ col.value ? col.value : "-" }}
diff --git a/src/modules/06_retirement/views/06_dismissOrder.vue b/src/modules/06_retirement/views/06_dismissOrder.vue index 1bc2a4295..bd7f45291 100644 --- a/src/modules/06_retirement/views/06_dismissOrder.vue +++ b/src/modules/06_retirement/views/06_dismissOrder.vue @@ -29,6 +29,7 @@ const { success, onSearchDataTable, dialogRemove, + textTranForm, } = mixin; const modal = ref(false); @@ -79,7 +80,7 @@ const columns = ref([ { name: "positionLevel", align: "left", - label: "ประเภทตำแหน่ง", + label: "ตำแหน่งประเภท", sortable: true, field: "positionLevel", headerStyle: "font-size: 14px", @@ -104,6 +105,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "createdAt", @@ -370,15 +374,17 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
-
+ {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
{{ col.value ? col.value : "-" }}
diff --git a/src/modules/06_retirement/views/08_dismissOrderEmp.vue b/src/modules/06_retirement/views/08_dismissOrderEmp.vue index 41e91aa34..8046deaf5 100644 --- a/src/modules/06_retirement/views/08_dismissOrderEmp.vue +++ b/src/modules/06_retirement/views/08_dismissOrderEmp.vue @@ -29,6 +29,7 @@ const { success, onSearchDataTable, dialogRemove, + textTranForm, } = mixin; const modal = ref(false); @@ -104,6 +105,9 @@ const columns = ref([ field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.organizationPositionOld.replace(/\n/g, " ")}`; + }, }, { name: "createdAt", @@ -160,7 +164,6 @@ async function getData() { .then((res) => { const data = res.data.result; rows.value = data; - console.log("🚀 ~ .then ~ data:", data) rowsData.value = data; filters.value = data; onSearch(); @@ -378,13 +381,16 @@ onMounted(async () => {
+ {{ + props.row.organizationPositionOld + ? textTranForm(props.row.organizationPositionOld) + : "-" + }} +
+
{{ col.value ? col.value : "-" }}
diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index ecd4ac7fc..3a69008af 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -1064,6 +1064,42 @@ export const useCounterMixin = defineStore("mixin", () => { } } + function findOrgChildName(obj: any) { + if (obj) { + let name = + obj.orgChild4Name != null && obj.orgChild3Name != null + ? obj.orgChild4Name + " " + : obj.orgChild4Name != null + ? obj.orgChild4Name + : ""; + + name += + obj.orgChild3Name != null && obj.orgChild2Name != null + ? obj.orgChild3Name + " " + : obj.orgChild3Name !== null + ? obj.orgChild3Name + : ""; + + name += + obj.orgChild2Name != null && obj.orgChild1Name != null + ? obj.orgChild2Name + " " + : obj.orgChild2Name != null + ? obj.orgChild2Name + : ""; + + name += + obj.orgChild1Name != null && obj.orgRootName != null + ? obj.orgChild1Name + " " + : obj.orgChild1Name != null + ? obj.orgChild1Name + : ""; + name += obj.orgRootName != null ? obj.orgRootName : ""; + return name == "" ? "-" : name; + } else { + return ""; + } + } + function findPosMasterNo(obj: any) { if (obj) { let shortName = @@ -1084,6 +1120,114 @@ export const useCounterMixin = defineStore("mixin", () => { } } + function findOrgNameHtml(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 findOrgNameOldHtml(obj: any) { + if (obj) { + let name = + obj.child4Old != null && obj.child3Old != null + ? obj.child4Old + (obj.child3Old ? "\n" : "") + : obj.child4Old != null + ? obj.child4Old + : ""; + + name += + obj.child3Old != null && obj.child2Old != null + ? obj.child3Old + (obj.child2Old ? "\n" : "") + : obj.child3Old !== null + ? obj.child3Old + : ""; + + name += + obj.child2Old != null && obj.child1Old != null + ? obj.child2Old + (obj.child1Old ? "\n" : "") + : obj.child2Old != null + ? obj.child2Old + : ""; + + name += + obj.child1Old != null && obj.rootOld != null + ? obj.child1Old + (obj.rootOld ? "\n" : "") + : obj.child1Old != null + ? obj.child1Old + : ""; + name += obj.rootOld != null ? obj.rootOld : ""; + return name == "" ? "-" : name; + } else { + return ""; + } + } + + function findOrgChildNameHtml(obj: any) { + if (obj) { + let name = + obj.orgChild4Name != null && obj.orgChild3Name != null + ? obj.orgChild4Name + (obj.orgChild3Name ? "\n" : "") + : obj.orgChild4Name != null + ? obj.orgChild4Name + : ""; + + name += + obj.orgChild3Name != null && obj.orgChild2Name != null + ? obj.orgChild3Name + (obj.orgChild2Name ? "\n" : "") + : obj.orgChild3Name !== null + ? obj.orgChild3Name + : ""; + + name += + obj.orgChild2Name != null && obj.orgChild1Name != null + ? obj.orgChild2Name + (obj.orgChild1Name ? "\n" : "") + : obj.orgChild2Name != null + ? obj.orgChild2Name + : ""; + + name += + obj.orgChild1Name != null && obj.orgRootName != null + ? obj.orgChild1Name + (obj.orgRootName ? "\n" : "") + : obj.orgChild1Name != null + ? obj.orgChild1Name + : ""; + name += obj.orgRootName != null ? obj.orgRootName : ""; + return name == "" ? "-" : name; + } else { + return ""; + } + } + function findPosMasterNoOld(obj: any) { if (obj) { let shortName = @@ -1104,6 +1248,11 @@ export const useCounterMixin = defineStore("mixin", () => { } } + function textTranForm(val: string) { + return (val.match(/[^()\s]+(?:\s*\([^()]+\))?|\([^()]+\)/g) || []).join( + "\n" + ); + } function pathRegistryEmp(routeName: string) { return routeName ? routeName === "registryNewByid" @@ -1232,6 +1381,7 @@ export const useCounterMixin = defineStore("mixin", () => { diffDay, findOrgName, findOrgNameOld, + findOrgChildName, findPosMasterNo, findPosMasterNoOld, pathRegistryEmp, @@ -1243,5 +1393,9 @@ export const useCounterMixin = defineStore("mixin", () => { convertDateToAPI, convertDatetimeToAPI, + findOrgNameHtml, + findOrgNameOldHtml, + findOrgChildNameHtml, + textTranForm }; }); diff --git a/src/style/quasar-variables.sass b/src/style/quasar-variables.sass index e3fe39f22..f5aac1211 100644 --- a/src/style/quasar-variables.sass +++ b/src/style/quasar-variables.sass @@ -48,7 +48,8 @@ $activetab: #4a5568 .bg-activetab background: $activetab !important - +.text-html + white-space: pre-line .inputgreen .q-field__prefix, .inputgreen .q-field__suffix,