Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-06-26 11:36:01 +07:00
commit 91adf997a4
16 changed files with 370 additions and 159 deletions

View file

@ -177,6 +177,7 @@ const coupleData = reactive<FormPerson>({
job: "",
lastNameOld: "",
statusMarital: "",
isCouple: false, // UI
});
const childData = ref<FormChildren[]>([]);
@ -266,6 +267,7 @@ async function fetchDataCouple() {
coupleData.job = data.coupleCareer;
coupleData.lastNameOld = data.coupleLastNameOld;
coupleData.statusMarital = data.relationship;
coupleData.isCouple = data.couple;
}
})
.catch((err) => {
@ -677,7 +679,7 @@ onMounted(async () => {
>
</div>
<q-space />
<div class="row q-col-gutter-sm" v-if="coupleData.statusMarital">
<div class="row q-col-gutter-sm" v-if="coupleData.isCouple">
<q-btn
round
flat
@ -691,11 +693,7 @@ onMounted(async () => {
</div>
</q-toolbar>
<q-card
bordered
class="bg-grey-1 q-pb-md"
v-if="coupleData.statusMarital"
>
<q-card bordered class="bg-grey-1 q-pb-md" v-if="coupleData.isCouple">
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-start">
<div class="text-weight-medium q-pr-md">สมรส</div>
</div>

View file

@ -7,6 +7,7 @@ interface FormPerson {
job: string;
lastNameOld?: string;
statusMarital?: string;
isCouple?: boolean;
}
interface ChildrenFamily {

View file

@ -282,7 +282,6 @@ onMounted(async () => {
<q-space />
<div class="row q-col-gutter-sm">
{{ filterKeyword }}
<q-input
standout
dense

View file

@ -160,14 +160,16 @@ function confirmDelete(id: string) {
showLoader();
http
.delete(config.API.complaintFileDelete(formData.id, id))
.then(async (res) => {
.then(async () => {
await props.getData();
success($q, `ลบไฟล์สำเร็จ`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/**
@ -188,7 +190,7 @@ function upLoadFileDoc() {
showLoader();
http
.put(config.API.complaintFileUpload(formData.id), Data)
.then(async (res) => {
.then(async () => {
await props.getData();
countNum.value = 2;
formData.documentFile = null;
@ -198,7 +200,7 @@ function upLoadFileDoc() {
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
.finally(() => {
hideLoader();
});
}
@ -215,7 +217,6 @@ async function addPerson(data: any, type?: string) {
/** ดึงข้อมูล active */
async function getActive() {
if (!formData.activeId) {
showLoader();
await http
.get(config.API.activeOrganization)
.then(async (res) => {
@ -225,16 +226,12 @@ async function getActive() {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
}
/** ดึงข้อมูลหน่วยงานจาก api */
async function getOc(activeId: string) {
showLoader();
await http
.get(config.API.orgByIdSystem(activeId, route.meta.Key as string))
.then(async (res) => {
@ -246,9 +243,6 @@ async function getOc(activeId: string) {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
@ -264,8 +258,8 @@ function deletePerson(id: string) {
}
/** ช่องทางการร้องเรียน และฟังก์ชั่นการดึงข้อมูลช่องทางการร้องเรียนมาจาก api*/
function getListChannel() {
http
async function getListChannel() {
await http
.get(
config.API.complaintListOp(
mainStore.pathComplaintsChannal(route.name as string)
@ -386,7 +380,12 @@ watch(props.data, async () => {
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(async () => {
mainStore.rowsAdd = [];
await Promise.all([getActive(), getListChannel()]);
try {
showLoader();
await Promise.all([getActive(), getListChannel()]);
} finally {
hideLoader();
}
});
</script>

View file

@ -526,10 +526,10 @@ async function saveDuty(id: string, duty: string, resolution: string) {
duty: duty,
commandNo: resolution,
})
.then((res: any) => {
.then(async () => {
await props.getData?.();
success($q, "บันทึกสำเร็จ");
closeEditDirector();
props.getData?.();
})
.catch((e) => {
messageError($q, e);

View file

@ -619,7 +619,7 @@ function emitPerson(data: PersonsArray[]) {
.post(config.API.disciplinaryReport(), {
Id: dataMapId,
})
.then((res) => {
.then(() => {
getActive();
})
.catch((e) => {
@ -648,10 +648,10 @@ async function saveDuty(id: string, duty: string, resolution: string) {
duty: duty,
commandNo: resolution,
})
.then((res: any) => {
.then(async () => {
await props.fetchData();
success($q, "บันทึกสำเร็จ");
closeEditDirector();
props.fetchData();
})
.catch((e) => {
messageError($q, e);

View file

@ -161,17 +161,20 @@ async function selectComplainant(val: string) {
*/
function onSubmit() {
dialogConfirm($q, async () => {
showLoader();
await http
.put(config.API.listResultById(id.value), formData)
.then(() => {
.then(async () => {
await props.fetchData();
isSave.value = false;
success($q, "บันทึกข้อมูลสำเร็จ");
props.fetchData();
})
.catch((err) => {
messageError($q, err);
})
.finally(async () => {});
.finally(() => {
hideLoader();
});
});
}
@ -194,7 +197,6 @@ function changeFormData() {
/**
* งขอมลจำลองไปย store
*/
function uploadFile() {
/** uploadFile */
const Data = new FormData();
@ -202,7 +204,7 @@ function uploadFile() {
showLoader();
http
.put(config.API.upLoadFileResult(id.value), Data)
.then(async (res) => {
.then(async () => {
await props.fetchData();
countNum.value = 2;
success($q, "อัปโหลดไฟล์สำเร็จ");
@ -229,7 +231,7 @@ function confirmDelete(docid: string) {
showLoader();
http
.delete(config.API.deleteFileResult(id.value, docid))
.then(async (res) => {
.then(async () => {
await props.fetchData();
success($q, `ลบไฟล์สำเร็จ`);
})
@ -294,15 +296,17 @@ function onFaultSubmit() {
offense: JSON.stringify(checkValue.value),
remark: remark.value,
})
.then((res) => {
.then(async () => {
await props.fetchData();
success($q, "ระบุฐานความผิด สำเร็จ");
close();
props.fetchData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
});
} else {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 มาตรา");

View file

@ -364,7 +364,11 @@ function onClickDownload(data: DataOption, type: string = "xlsx") {
data.id === "gov-08" ||
data.id === "gov-10";
const finalUrl = isGovernmentId ? `${url}/${store.tabGroup}` : url;
const finalUrl = isGovernmentId
? `${url}/${store.tabGroup}${
data.id === "gov-04" ? `/${data.typeName}` : ""
}`
: url;
http
.get(finalUrl)
.then(async (res) => {

View file

@ -75,7 +75,13 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
},
{
id: "gov-04",
name: "แบบ 1 กท รอบเมษายน",
name: "แบบ 1 กท รอบเมษายน (0.5 ขั้น)",
typeName: "HAFT",
},
{
id: "gov-04",
name: "แบบ 1 กท รอบเมษายน (1 ขั้น)",
typeName: "FULL",
},
{
id: "gov-05",
@ -121,7 +127,18 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
},
{
id: "gov-04",
name: "แบบ 1 กท รอบตุลาคม",
name: "แบบ 1 กท รอบตุลาคม (0.5 ขั้น)",
typeName: "HAFT",
},
{
id: "gov-04",
name: "แบบ 1 กท รอบตุลาคม (1 ขั้น)",
typeName: "FULL",
},
{
id: "gov-04",
name: "แบบ 1 กท รอบตุลาคม (1.5 ขั้น)",
typeName: "FULLHAFT",
},
{
id: "gov-04-01",

View file

@ -536,6 +536,7 @@ watch(
label="ค้นหาจากชื่อ-นามสกุล หรือเลขประจำตัวประชาชน"
lazy-rules
hide-bottom-space
@keydown.enter.prevent="getSearch()"
/>
</div>
<div class="col-2">
@ -549,6 +550,7 @@ watch(
label="ตำแหน่ง"
lazy-rules
hide-bottom-space
@keydown.enter.prevent="getSearch()"
/>
</div>
<div class="col-2">
@ -560,20 +562,24 @@ watch(
:options="typeOps"
emit-value
dense
@update:model-value="updateSelectType"
@update:model-value="
updateSelectType(formData.positionType), getSearch()
"
map-options
outlined
option-label="name"
option-value="id"
lazy-rules
hide-bottom-space
><template v-if="formData.positionType" v-slot:append>
>
<template v-if="formData.positionType" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="clearPosition()"
@click.stop.prevent="clearPosition(), getSearch()"
class="cursor-pointer"
/> </template
></q-select>
/>
</template>
</q-select>
</div>
<div class="col-2">
<q-select
@ -591,14 +597,18 @@ watch(
option-value="id"
lazy-rules
hide-bottom-space
@update:model-value="getSearch()"
>
<template v-if="formData.positionLevel" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="formData.positionLevel = ''"
@click.stop.prevent="
(formData.positionLevel = ''), getSearch()
"
class="cursor-pointer"
/> </template
></q-select>
/>
</template>
</q-select>
</div>
<div class="col-2">
<q-btn
@ -606,7 +616,7 @@ watch(
color="teal-5"
class="full-height"
icon="search"
@click="getSearch()"
@click.prevent="getSearch()"
/>
</div>

View file

@ -534,6 +534,7 @@ watch(
label="ค้นหาจากชื่อ-นามสกุล หรือเลขประจำตัวประชาชน"
lazy-rules
hide-bottom-space
@keydown.enter.prevent="getSearch()"
/>
</div>
<div class="col-2">
@ -547,6 +548,7 @@ watch(
label="ตำแหน่ง"
lazy-rules
hide-bottom-space
@keydown.enter.prevent="getSearch()"
/>
</div>
<div class="col-2">
@ -564,13 +566,16 @@ watch(
option-value="id"
lazy-rules
hide-bottom-space
><template v-if="formData.positionType" v-slot:append>
@update:model-value="getSearch()"
>
<template v-if="formData.positionType" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="clearPosition()"
@click.stop.prevent="clearPosition(), getSearch()"
class="cursor-pointer"
/> </template
></q-select>
/>
</template>
</q-select>
</div>
<!-- <div class="col-2">
<q-select
@ -607,7 +612,7 @@ watch(
outline
/>
</div>
<q-space />
<q-select
for="#select"
v-model="visibleColumnsResult"

View file

@ -342,7 +342,10 @@ const columns = computed<QTableProps["columns"]>(() => {
{
name: "positionDate",
align: "left",
label: "ระยะเวลาดำรงตำแหน่ง (สายงาน) ปัจจุบัน",
label:
employeeClass.value === "officer"
? "ระยะเวลาดำรงตำแหน่ง (สายงาน) ปัจจุบัน"
: "ระยะเวลาดำรงตำแหน่งปัจจุบัน",
sortable: true,
field: "positionDate",
headerStyle: "font-size: 14px",
@ -379,7 +382,10 @@ const visibleColumns = computed<string[]>(() => {
return employeeClass.value === "officer"
? visibleColumnsBase.value
: visibleColumnsBase.value.filter(
(e: string) => e !== "positionExecutive" && e !== "positionArea"
(e: string) =>
e !== "positionExecutive" &&
e !== "positionArea" &&
e !== "posExecutiveDate"
);
});
@ -598,17 +604,26 @@ async function onSearch() {
gender: item.gender ?? "-",
status: item.relationship ?? "-",
education:
item.Educations.length > 0
? item.Educations.map((e: any) => e.degree)
: [],
item.Educations.length > 0 &&
item.Educations.filter((e: any) => e.degree != null)
? item.Educations.filter((e: any) => e.degree != null).map(
(e: any) => e.degree
)
: null,
educationLevel:
item.Educations.length > 0
? item.Educations.map((e: any) => e.educationLevel)
: [],
item.Educations.length > 0 &&
item.Educations.filter((e: any) => e.educationLevel != null)
? item.Educations.filter((e: any) => e.educationLevel != null).map(
(e: any) => e.educationLevel
)
: null,
field:
item.Educations.length > 0
? item.Educations.map((e: any) => e.field)
: [],
item.Educations.length > 0 &&
item.Educations.filter((e: any) => e.field != null)
? item.Educations.filter((e: any) => e.field != null).map(
(e: any) => e.field
)
: null,
dateAppoint: item.dateAppoint ?? "-",
age: item.age ?? "-",
@ -648,25 +663,68 @@ async function onSearch() {
}
function exportToExcel() {
const newData = rows.value.map((e: any) => {
const { profileId, empType, positionArea, positionExecutive, ...rest } = e;
return {
...rest,
dateAppoint: date2Thai(e.dateAppoint),
dateRetireLaw: date2Thai(e.dateRetireLaw),
education: e.education.map((e: string) => `${e}`).join(", "),
educationLevel: e.educationLevel.map((e: string) => `${e}`).join(", "),
field: e.field.map((e: string) => `${e}`).join(", "),
};
});
const newData =
employeeClass.value === "officer"
? rows.value.map((e: any) => {
const { profileId, empType, ...rest } = e;
return {
...rest,
dateAppoint: date2Thai(e.dateAppoint),
dateRetireLaw: date2Thai(e.dateRetireLaw),
education:
e.education && e.education.length > 0
? e.education.map((e: string) => `${e}`).join(", ")
: "-",
educationLevel:
e.educationLevel && e.educationLevel.length > 0
? e.educationLevel.map((e: string) => `${e}`).join(", ")
: "-",
field:
e.field && e.field.length > 0
? e.field.map((e: string) => `${e}`).join(", ")
: "-",
};
})
: rows.value.map((e: any) => {
const {
profileId,
empType,
positionArea,
positionExecutive,
posExecutiveDate,
...rest
} = e;
return {
...rest,
dateAppoint: date2Thai(e.dateAppoint),
dateRetireLaw: date2Thai(e.dateRetireLaw),
education:
e.education && e.education.length > 0
? e.education.map((e: string) => `${e}`).join(", ")
: "-",
educationLevel:
e.educationLevel && e.educationLevel.length > 0
? e.educationLevel.map((e: string) => `${e}`).join(", ")
: "-",
field:
e.field && e.field.length > 0
? e.field.map((e: string) => `${e}`).join(", ")
: "-",
};
});
const headers =
columns.value
?.filter(
(x: any) =>
x.field !== "positionExecutive" && x.field !== "positionArea"
)
.map((item: any) => item.label) || []; //
employeeClass.value === "officer"
? columns.value?.map((item: any) => item.label) || []
: columns.value
?.filter(
(x: any) =>
x.field !== "positionExecutive" &&
x.field !== "positionArea" &&
x.field !== "posExecutiveDate"
)
.map((item: any) => item.label) || []; //
const worksheet = XLSX.utils.json_to_sheet(newData, {
header: visibleColumns.value,
});
@ -1540,14 +1598,20 @@ watch(
<div class="col-12"><q-separator /></div>
<div class="col-12">
<div class="">
<div>
<q-radio
v-model="typeTerm"
val="position"
label="ระยะเวลาดำรงตำแหน่ง (สายงาน) ปัจจุบัน"
:label="
employeeClass === 'officer'
? 'ระยะเวลาดำรงตำแหน่ง (สายงาน) ปัจจุบัน'
: 'ระยะเวลาดำรงตำแหน่งปัจจุบัน'
"
size="xs"
class="text-grey-8"
/>
</div>
<div>
<q-radio
v-model="typeTerm"
val="level"
@ -1555,7 +1619,10 @@ watch(
size="xs"
class="text-grey-8"
/>
</div>
<div>
<q-radio
v-if="employeeClass === 'officer'"
v-model="typeTerm"
val="tenureType"
label="ระยะเวลาดำรงตำแหน่ง (บริหาร) ปัจจุบัน"
@ -1687,6 +1754,7 @@ watch(
</q-list>
</q-btn-dropdown>
</div>
<d-table
:columns="columns"
:rows="rows"

View file

@ -98,6 +98,8 @@ async function fetchDataRound() {
await fetchDataOrg(roundOptions.value[0].revisionId);
} else {
isRound.value = false;
round.value = "";
roundOptions.value = [];
}
})
.catch((e) => {
@ -176,6 +178,7 @@ async function fetchDataReportUnified(
? `${round.value?.year}-03-31`
: `${round.value?.year}-09-30`,
nodeId: nodeId.value,
revisionId: round.value?.revisionId,
};
if (reportCode === "go2-01") {

View file

@ -88,6 +88,11 @@ async function redirectToLandingPage() {
window.location.href = key_C_Config.landing_PageUrl;
}
async function logoutSSO() {
await deleteCookie(ACCESS_TOKEN);
window.location.href = key_C_Config.landing_PageUrl + `/logout`;
}
export {
getToken,
authenticated,
@ -96,4 +101,5 @@ export {
tokenParsed,
getCookie,
redirectToLandingPage,
logoutSSO,
};

View file

@ -995,33 +995,45 @@ export const useCounterMixin = defineStore("mixin", () => {
function findOrgName(obj: any) {
if (obj) {
let name =
obj.child4 != null && obj.child3 != null
obj.child4 != null &&
obj.child4 !== "" &&
obj.child3 != null &&
obj.child3 !== ""
? obj.child4 + " "
: obj.child4 != null
: obj.child4 != null && obj.child4 !== ""
? obj.child4
: "";
name +=
obj.child3 != null && obj.child2 != null
obj.child3 != null &&
obj.child3 !== "" &&
obj.child2 != null &&
obj.child2 !== ""
? obj.child3 + " "
: obj.child3 !== null
: obj.child3 != null && obj.child3 !== ""
? obj.child3
: "";
name +=
obj.child2 != null && obj.child1 != null
obj.child2 != null &&
obj.child2 !== "" &&
obj.child1 != null &&
obj.child1 !== ""
? obj.child2 + " "
: obj.child2 != null
: obj.child2 != null && obj.child2 !== ""
? obj.child2
: "";
name +=
obj.child1 != null && obj.root != null
obj.child1 != null &&
obj.child1 !== "" &&
obj.root != null &&
obj.root !== ""
? obj.child1 + " "
: obj.child1 != null
: obj.child1 != null && obj.child1 !== ""
? obj.child1
: "";
name += obj.root != null ? obj.root : "";
name += obj.root != null && obj.root !== "" ? obj.root : "";
return name == "" ? "-" : name;
} else {
return "";
@ -1031,33 +1043,45 @@ export const useCounterMixin = defineStore("mixin", () => {
function findOrgNameOld(obj: any) {
if (obj) {
let name =
obj.child4Old != null && obj.child3Old != null
obj.child4Old != null &&
obj.child4Old !== "" &&
obj.child3Old != null &&
obj.child3Old !== ""
? obj.child4Old + " "
: obj.child4Old != null
: obj.child4Old != null && obj.child4Old !== ""
? obj.child4Old
: "";
name +=
obj.child3Old != null && obj.child2Old != null
obj.child3Old != null &&
obj.child3Old !== "" &&
obj.child2Old != null &&
obj.child2Old !== ""
? obj.child3Old + " "
: obj.child3Old !== null
: obj.child3Old != null && obj.child3Old !== ""
? obj.child3Old
: "";
name +=
obj.child2Old != null && obj.child1Old != null
obj.child2Old != null &&
obj.child2Old !== "" &&
obj.child1Old != null &&
obj.child1Old !== ""
? obj.child2Old + " "
: obj.child2Old != null
: obj.child2Old != null && obj.child2Old !== ""
? obj.child2Old
: "";
name +=
obj.child1Old != null && obj.rootOld != null
obj.child1Old != null &&
obj.child1Old !== "" &&
obj.rootOld != null &&
obj.rootOld !== ""
? obj.child1Old + " "
: obj.child1Old != null
: obj.child1Old != null && obj.child1Old !== ""
? obj.child1Old
: "";
name += obj.rootOld != null ? obj.rootOld : "";
name += obj.rootOld != null && obj.rootOld !== "" ? obj.rootOld : "";
return name == "" ? "-" : name;
} else {
return "";
@ -1067,33 +1091,48 @@ export const useCounterMixin = defineStore("mixin", () => {
function findOrgChildName(obj: any) {
if (obj) {
let name =
obj.orgChild4Name != null && obj.orgChild3Name != null
obj.orgChild4Name != null &&
obj.orgChild4Name !== "" &&
obj.orgChild3Name != null &&
obj.orgChild3Name !== ""
? obj.orgChild4Name + " "
: obj.orgChild4Name != null
: obj.orgChild4Name != null && obj.orgChild4Name !== ""
? obj.orgChild4Name
: "";
name +=
obj.orgChild3Name != null && obj.orgChild2Name != null
obj.orgChild3Name != null &&
obj.orgChild3Name !== "" &&
obj.orgChild2Name != null &&
obj.orgChild2Name !== ""
? obj.orgChild3Name + " "
: obj.orgChild3Name !== null
: obj.orgChild3Name != null && obj.orgChild3Name !== ""
? obj.orgChild3Name
: "";
name +=
obj.orgChild2Name != null && obj.orgChild1Name != null
obj.orgChild2Name != null &&
obj.orgChild2Name !== "" &&
obj.orgChild1Name != null &&
obj.orgChild1Name !== ""
? obj.orgChild2Name + " "
: obj.orgChild2Name != null
: obj.orgChild2Name != null && obj.orgChild2Name !== ""
? obj.orgChild2Name
: "";
name +=
obj.orgChild1Name != null && obj.orgRootName != null
obj.orgChild1Name != null &&
obj.orgChild1Name !== "" &&
obj.orgRootName != null &&
obj.orgRootName !== ""
? obj.orgChild1Name + " "
: obj.orgChild1Name != null
: obj.orgChild1Name != null && obj.orgChild1Name !== ""
? obj.orgChild1Name
: "";
name += obj.orgRootName != null ? obj.orgRootName : "";
name +=
obj.orgRootName != null && obj.orgRootName !== ""
? obj.orgRootName
: "";
return name == "" ? "-" : name;
} else {
return "";
@ -1103,17 +1142,20 @@ export const useCounterMixin = defineStore("mixin", () => {
function findPosMasterNo(obj: any) {
if (obj) {
let shortName =
(obj.child4ShortName != null
(obj.child4ShortName != null && obj.child4ShortName !== ""
? obj.child4ShortName
: obj.child3ShortName != null
: obj.child3ShortName != null && obj.child3ShortName !== ""
? obj.child3ShortName
: obj.child2ShortName != null
: obj.child2ShortName != null && obj.child2ShortName !== ""
? obj.child2ShortName
: obj.child1ShortName != null
: obj.child1ShortName != null && obj.child1ShortName !== ""
? obj.child1ShortName
: obj.rootShortName != null
: obj.rootShortName != null && obj.rootShortName !== ""
? obj.rootShortName
: "") + (obj.posMasterNo != null ? obj.posMasterNo : "");
: "") +
(obj.posMasterNo != null && obj.posMasterNo !== ""
? obj.posMasterNo
: "");
return shortName == "" ? "-" : shortName;
} else {
return "";
@ -1123,33 +1165,45 @@ export const useCounterMixin = defineStore("mixin", () => {
function findOrgNameHtml(obj: any) {
if (obj) {
let name =
obj.child4 != null && obj.child3 != null
obj.child4 != null &&
obj.child4 !== "" &&
obj.child3 != null &&
obj.child3 !== ""
? obj.child4 + (obj.child3 ? "\n" : "")
: obj.child4 != null
: obj.child4 != null && obj.child4 !== ""
? obj.child4
: "";
name +=
obj.child3 != null && obj.child2 != null
obj.child3 != null &&
obj.child3 !== "" &&
obj.child2 != null &&
obj.child2 !== ""
? obj.child3 + (obj.child2 ? "\n" : "")
: obj.child3 !== null
: obj.child3 != null && obj.child3 !== ""
? obj.child3
: "";
name +=
obj.child2 != null && obj.child1 != null
obj.child2 != null &&
obj.child2 !== "" &&
obj.child1 != null &&
obj.child1 !== ""
? obj.child2 + (obj.child1 ? "\n" : "")
: obj.child2 != null
: obj.child2 != null && obj.child2 !== ""
? obj.child2
: "";
name +=
obj.child1 != null && obj.root != null
obj.child1 != null &&
obj.child1 !== "" &&
obj.root != null &&
obj.root !== ""
? obj.child1 + (obj.root ? "\n" : "")
: obj.child1 != null
: obj.child1 != null && obj.child1 !== ""
? obj.child1
: "";
name += obj.root != null ? obj.root : "";
name += obj.root != null && obj.root !== "" ? obj.root : "";
return name == "" ? "-" : name;
} else {
return "";
@ -1159,33 +1213,45 @@ export const useCounterMixin = defineStore("mixin", () => {
function findOrgNameOldHtml(obj: any) {
if (obj) {
let name =
obj.child4Old != null && obj.child3Old != null
obj.child4Old != null &&
obj.child4Old !== "" &&
obj.child3Old != null &&
obj.child3Old !== ""
? obj.child4Old + (obj.child3Old ? "\n" : "")
: obj.child4Old != null
: obj.child4Old != null && obj.child4Old !== ""
? obj.child4Old
: "";
name +=
obj.child3Old != null && obj.child2Old != null
obj.child3Old != null &&
obj.child3Old !== "" &&
obj.child2Old != null &&
obj.child2Old !== ""
? obj.child3Old + (obj.child2Old ? "\n" : "")
: obj.child3Old !== null
: obj.child3Old != null && obj.child3Old !== ""
? obj.child3Old
: "";
name +=
obj.child2Old != null && obj.child1Old != null
obj.child2Old != null &&
obj.child2Old !== "" &&
obj.child1Old != null &&
obj.child1Old !== ""
? obj.child2Old + (obj.child1Old ? "\n" : "")
: obj.child2Old != null
: obj.child2Old != null && obj.child2Old !== ""
? obj.child2Old
: "";
name +=
obj.child1Old != null && obj.rootOld != null
obj.child1Old != null &&
obj.child1Old !== "" &&
obj.rootOld != null &&
obj.rootOld !== ""
? obj.child1Old + (obj.rootOld ? "\n" : "")
: obj.child1Old != null
: obj.child1Old != null && obj.child1Old !== ""
? obj.child1Old
: "";
name += obj.rootOld != null ? obj.rootOld : "";
name += obj.rootOld != null && obj.rootOld !== "" ? obj.rootOld : "";
return name == "" ? "-" : name;
} else {
return "";
@ -1195,33 +1261,48 @@ export const useCounterMixin = defineStore("mixin", () => {
function findOrgChildNameHtml(obj: any) {
if (obj) {
let name =
obj.orgChild4Name != null && obj.orgChild3Name != null
obj.orgChild4Name != null &&
obj.orgChild4Name !== "" &&
obj.orgChild3Name != null &&
obj.orgChild3Name !== ""
? obj.orgChild4Name + (obj.orgChild3Name ? "\n" : "")
: obj.orgChild4Name != null
: obj.orgChild4Name != null && obj.orgChild4Name !== ""
? obj.orgChild4Name
: "";
name +=
obj.orgChild3Name != null && obj.orgChild2Name != null
obj.orgChild3Name != null &&
obj.orgChild3Name !== "" &&
obj.orgChild2Name != null &&
obj.orgChild2Name !== ""
? obj.orgChild3Name + (obj.orgChild2Name ? "\n" : "")
: obj.orgChild3Name !== null
: obj.orgChild3Name != null && obj.orgChild3Name !== ""
? obj.orgChild3Name
: "";
name +=
obj.orgChild2Name != null && obj.orgChild1Name != null
obj.orgChild2Name != null &&
obj.orgChild2Name !== "" &&
obj.orgChild1Name != null &&
obj.orgChild1Name !== ""
? obj.orgChild2Name + (obj.orgChild1Name ? "\n" : "")
: obj.orgChild2Name != null
: obj.orgChild2Name != null && obj.orgChild2Name !== ""
? obj.orgChild2Name
: "";
name +=
obj.orgChild1Name != null && obj.orgRootName != null
obj.orgChild1Name != null &&
obj.orgChild1Name !== "" &&
obj.orgRootName != null &&
obj.orgRootName !== ""
? obj.orgChild1Name + (obj.orgRootName ? "\n" : "")
: obj.orgChild1Name != null
: obj.orgChild1Name != null && obj.orgChild1Name !== ""
? obj.orgChild1Name
: "";
name += obj.orgRootName != null ? obj.orgRootName : "";
name +=
obj.orgRootName != null && obj.orgRootName !== ""
? obj.orgRootName
: "";
return name == "" ? "-" : name;
} else {
return "";
@ -1231,33 +1312,45 @@ export const useCounterMixin = defineStore("mixin", () => {
function findChildNameHtml(obj: any) {
if (obj) {
let name =
obj.child4 != null && obj.child3 != null
obj.child4 != null &&
obj.child4 !== "" &&
obj.child3 != null &&
obj.child3 !== ""
? obj.child4 + (obj.child3 ? "\n" : "")
: obj.child4 != null
: obj.child4 != null && obj.child4 !== ""
? obj.child4
: "";
name +=
obj.child3 != null && obj.child2 != null
obj.child3 != null &&
obj.child3 !== "" &&
obj.child2 != null &&
obj.child2 !== ""
? obj.child3 + (obj.child2 ? "\n" : "")
: obj.child3 !== null
: obj.child3 != null && obj.child3 !== ""
? obj.child3
: "";
name +=
obj.child2 != null && obj.child1 != null
obj.child2 != null &&
obj.child2 !== "" &&
obj.child1 != null &&
obj.child1 !== ""
? obj.child2 + (obj.child1 ? "\n" : "")
: obj.child2 != null
: obj.child2 != null && obj.child2 !== ""
? obj.child2
: "";
name +=
obj.child1 != null && obj.root != null
obj.child1 != null &&
obj.child1 !== "" &&
obj.root != null &&
obj.root !== ""
? obj.child1 + (obj.root ? "\n" : "")
: obj.child1 != null
: obj.child1 != null && obj.child1 !== ""
? obj.child1
: "";
name += obj.root != null ? obj.root : "";
name += obj.root != null && obj.root !== "" ? obj.root : "";
return name == "" ? "-" : name;
} else {
return "";
@ -1267,17 +1360,20 @@ export const useCounterMixin = defineStore("mixin", () => {
function findPosMasterNoOld(obj: any) {
if (obj) {
let shortName =
(obj.child4ShortNameOld != null
(obj.child4ShortNameOld != null && obj.child4ShortNameOld !== ""
? obj.child4ShortNameOld
: obj.child3ShortNameOld != null
: obj.child3ShortNameOld != null && obj.child3ShortNameOld !== ""
? obj.child3ShortNameOld
: obj.child2ShortNameOld != null
: obj.child2ShortNameOld != null && obj.child2ShortNameOld !== ""
? obj.child2ShortNameOld
: obj.child1ShortNameOld != null
: obj.child1ShortNameOld != null && obj.child1ShortNameOld !== ""
? obj.child1ShortNameOld
: obj.rootShortNameOld != null
: obj.rootShortNameOld != null && obj.rootShortNameOld !== ""
? obj.rootShortNameOld
: "") + (obj.posMasterNoOld != null ? obj.posMasterNoOld : "");
: "") +
(obj.posMasterNoOld != null && obj.posMasterNoOld !== ""
? obj.posMasterNoOld
: "");
return shortName == "" ? "-" : shortName;
} else {
return "";

View file

@ -11,6 +11,7 @@ import {
logout,
getCookie,
redirectToLandingPage,
logoutSSO,
} from "@/plugins/auth";
import avatar from "@/assets/avatar_user.jpg";
@ -414,7 +415,7 @@ const doLogout = () => {
$q,
async () => {
await http.post(config.API.keycloakLogSSO, { text: "ออกจากระบบ" });
await logout();
await logoutSSO();
},
"ยืนยันการออกจากระบบ",
"ต้องการออกจากระบบใช่หรือไม่?"