Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-01-08 14:59:18 +07:00
commit e3fed86699
18 changed files with 806 additions and 407 deletions

View file

@ -35,6 +35,8 @@ export default {
orgPosPositionExecutive: () => `${orgPos}/position/executive`, orgPosPositionExecutive: () => `${orgPos}/position/executive`,
orgPosExecutive: `${orgPos}/executive`, orgPosExecutive: `${orgPos}/executive`,
orgPosType: `${orgPos}/type`, orgPosType: `${orgPos}/type`,
orgPosTypeSearch: `${orgPos}/position/search`,
orgPosTypeId: (id: string) => `${orgPos}/type/${id}`, orgPosTypeId: (id: string) => `${orgPos}/type/${id}`,
orgPosLevel: `${orgPos}/level`, orgPosLevel: `${orgPos}/level`,
orgPosMaster: `${orgPos}/master`, orgPosMaster: `${orgPos}/master`,
@ -66,7 +68,8 @@ export default {
// ค้นหาคนตามเงื่อนไข // ค้นหาคนตามเงื่อนไข
orgSearchPersonal: () => `${organization}/profile/search-personal`, orgSearchPersonal: () => `${organization}/profile/search-personal`,
orgSearchPersonalByType: (type:string) => `${organization}/profile${type}/search-personal`, orgSearchPersonalByType: (type: string) =>
`${organization}/profile${type}/search-personal`,
/** บรรจุแต่งตั้ง*/ /** บรรจุแต่งตั้ง*/
orgPosPlacement: `${orgPos}/placement/search`, orgPosPlacement: `${orgPos}/placement/search`,
@ -158,5 +161,5 @@ export default {
keycloakLogSSO: `${organization}/keycloak/log/sso`, keycloakLogSSO: `${organization}/keycloak/log/sso`,
reportOrgByType:(type:string)=>`${reportOrg}/registry-${type}` reportOrgByType: (type: string) => `${reportOrg}/registry-${type}`,
}; };

View file

@ -76,6 +76,9 @@ export default {
// ประวัติการศึกษา // ประวัติการศึกษา
profileNewEducation: (type: string) => `${registryNew}${type}/educations`, profileNewEducation: (type: string) => `${registryNew}${type}/educations`,
profileNewEducationSort: (type: string) =>
`${registryNew}${type}/educations/sort`,
profileNewEducationByProfileId: (profileId: string, type: string) => profileNewEducationByProfileId: (profileId: string, type: string) =>
`${registryNew}${type}/educations/${profileId}`, `${registryNew}${type}/educations/${profileId}`,
profileNewEducationByEducationId: (educationId: string, type: string) => profileNewEducationByEducationId: (educationId: string, type: string) =>
@ -202,5 +205,6 @@ export default {
developMentPlan: `${registryNew}/development`, developMentPlan: `${registryNew}/development`,
requestInformationbyType:(type:string,id:string)=>`${registryNew}/request-edit/${type}/${id}` requestInformationbyType: (type: string, id: string) =>
`${registryNew}/request-edit/${type}/${id}`,
}; };

View file

@ -14,4 +14,46 @@ interface ResponseObject {
government: String; government: String;
} }
export type { ResponseObject }; interface ResponesePosType {
createdAt: string;
id: string;
lastUpdateFullName: string;
lastUpdatedAt: string;
posTypeName: string;
posTypeRank: number;
posLevels: DataPosLevel[];
}
interface DataPosLevel {
createdAt: string;
id: string;
lastUpdateFullName: string;
lastUpdatedAt: string;
posLevelAuthority: string;
posLevelName: string;
posLevelRank: number;
}
interface ResponesePosition {
createdAt: string;
id: string;
isSpecial: boolean;
lastUpdateFullName: string;
lastUpdatedAt: string;
posLevelId: string;
posLevelName: string;
posTypeId: string;
posTypeName: string;
positionArea: string;
positionExecutiveField: null;
positionField: string;
positionIsSelected: boolean;
positionName: string;
}
export type {
ResponseObject,
ResponesePosType,
DataPosLevel,
ResponesePosition,
};

View file

@ -36,14 +36,16 @@ const number = ref<string>("");
const score_expired = ref<string>(""); const score_expired = ref<string>("");
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin; const { messageError, showLoader, hideLoader } = mixin;
const examID = ref<string>("62150001"); const examID = ref<string>("");
const prefix = ref<string>("นาย"); const prefix = ref<string>("");
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต"); const fullname = ref<string>("");
const importId = ref<string>(route.params.id as string); // Period Import Id const importId = ref<string>(route.params.id as string); // Period Import Id
const examId = ref<string>(route.params.examId as string); // const examId = ref<string>(route.params.examId as string); //
const isData = ref<boolean>(false);
/** ดึงข้อมูล */ /** ดึงข้อมูล */
async function fetchData() { async function fetchData() {
isData.value = false;
showLoader(); showLoader();
await http await http
.get(config.API.getExamDetail(importId.value, examId.value)) .get(config.API.getExamDetail(importId.value, examId.value))
@ -76,6 +78,7 @@ async function fetchData() {
scoreSum.value = data.scoreResult.scoreSum; scoreSum.value = data.scoreResult.scoreSum;
examResultinscore.value = data.scoreResult.examResult; examResultinscore.value = data.scoreResult.examResult;
} }
isData.value = true;
} }
}) })
.catch((e) => { .catch((e) => {
@ -147,7 +150,13 @@ onMounted(async () => {
รายละเอยดของผสมครสอบ {{ examID }} : {{ prefix }}{{ fullname }} รายละเอยดของผสมครสอบ {{ examID }} : {{ prefix }}{{ fullname }}
</div> </div>
<q-card flat bordered class="col-12 row q-mt-sm q-pa-md"> <q-card flat bordered class="col-12 row q-mt-sm q-pa-md">
<div class="row q-col-gutter-md col-12"> <div class="col-12" v-if="!isData">
<q-banner inline-actions rounded class="bg-warning text-center">
ไมพบรายละเอยดการสอบ
</q-banner>
</div>
<div class="row q-col-gutter-md col-12" v-else>
<div class="col-xs-12 col-sm-12 col-md-6"> <div class="col-xs-12 col-sm-12 col-md-6">
<q-card bordered flat class="col-12 q-pa-md"> <q-card bordered flat class="col-12 q-pa-md">
<div class="col-12 q-col-gutter-sm row items-center"> <div class="col-12 q-col-gutter-sm row items-center">

View file

@ -21,6 +21,11 @@ import type {
DataOption2, DataOption2,
UploadType, UploadType,
} from "@/modules/02_organization/interface/index/Main"; } from "@/modules/02_organization/interface/index/Main";
import type {
ResponesePosType,
DataPosLevel,
ResponesePosition,
} from "@/modules/03_recruiting/interface/response/Main";
import ProfileTable from "@/modules/03_recruiting/components/Table1.vue"; import ProfileTable from "@/modules/03_recruiting/components/Table1.vue";
@ -60,10 +65,6 @@ const dateAnnounce = ref<Date | null>(null); //วันประกาศผล
const dateExam = ref<Date | null>(null); // const dateExam = ref<Date | null>(null); //
const myFormPayment = ref<any>(); const myFormPayment = ref<any>();
const myFormPosition = ref<any>(); const myFormPosition = ref<any>();
const positionPathOptions = ref<DataOption2[]>([]);
const positionPathFilters = ref<DataOption2[]>([]);
const positionLevelOptions = ref<DataOption2[]>([]);
const positionLevelFilters = ref<DataOption2[]>([]);
const organizationShortName = ref<DataOption2>(); const organizationShortName = ref<DataOption2>();
const organizationName = ref<DataOption2>(); const organizationName = ref<DataOption2>();
const examTypeOptions = [ const examTypeOptions = [
@ -142,12 +143,13 @@ const columnsPosition = ref<QTableProps["columns"]>([
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "position", name: "highDegree",
align: "left", align: "left",
label: "ตำแหน่ง", label: "ประเภทตำแหน่ง",
sortable: true, sortable: true,
field: "position", field: "highDegree",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
@ -165,16 +167,17 @@ const columnsPosition = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "highDegree", name: "position",
align: "left", align: "left",
label: "ประเภทตำแหน่ง", label: "ตำแหน่ง",
sortable: true, sortable: true,
field: "highDegree", field: "position",
headerStyle: "font-size: 14px", headerStyle: "font-size: 14px",
style: "font-size: 14px", style: "font-size: 14px",
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{ {
name: "type", name: "type",
align: "left", align: "left",
@ -293,83 +296,38 @@ async function fetchData() {
}); });
} }
/**
* get รายการ ตำแหนงในสายงาน
*/
async function fetchPositionPath() {
showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
const data = res.data.result;
let option: DataOption2[] = [];
data.map((r: DataOption2) => {
option.push({
id: r.id.toString(),
name: r.name.toString(),
});
});
positionPathOptions.value = option;
positionPathFilters.value = option;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/**
* get รายการ ตำแหนงระด
*/
async function fetchPositionLevel() {
showLoader();
await http
.get(config.API.positionLevel)
.then((res) => {
const data = res.data.result;
let option: DataOption2[] = [];
data.map((r: DataOption2) => {
option.push({
id: r.id.toString(),
name: r.name.toString(),
level: r.level,
});
});
positionLevelOptions.value = option.filter(
(v: DataOption2) => v.level === 0
);
positionLevelFilters.value = option.filter(
(v: DataOption2) => v.level === 0
);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/** /**
* งช filter * งช filter
* @param val input * @param val input
* @param update Function #quasar * @param update Function #quasar
* @param refData เเยก case * @param refData เเยก case
*/ */
function filterSelector(val: any, update: Function, refData: string) { function filterSelector(val: string, update: Function, refData: string) {
switch (refData) { switch (refData) {
case "positionLevel": case "positionLevel1":
update(() => { update(() => {
positionLevelOptions.value = positionLevelFilters.value.filter( optionPosLevel1.value = filterOptionPosLevel1.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1 (v: DataOption2) => v.name.indexOf(val) > -1
); );
}); });
break; break;
case "position": case "positionLevel2":
update(() => { update(() => {
positionPathOptions.value = positionPathFilters.value.filter( optionPosLevel2.value = filterOptionPosLevel2.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1
);
});
break;
case "position1":
update(() => {
optionPosType1.value = filterOptionPosType1.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1
);
});
break;
case "position2":
update(() => {
optionPosType2.value = filterOptionPosType2.value.filter(
(v: DataOption2) => v.name.indexOf(val) > -1 (v: DataOption2) => v.name.indexOf(val) > -1
); );
}); });
@ -495,16 +453,16 @@ async function editData(id: string) {
showLoader(); showLoader();
await http await http
.put(config.API.periodExamId(id), sendData()) .put(config.API.periodExamId(id), sendData())
.then(async (res) => { .then(async () => {
success($q, "แก้ไขรอบคัดเลือกสำเร็จ");
await uploadImgData(); await uploadImgData();
await uploadDocData(); await uploadDocData();
success($q, "แก้ไขรอบคัดเลือกสำเร็จ");
await clickBack(); await clickBack();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(() => {
hideLoader(); hideLoader();
}); });
} }
@ -656,7 +614,7 @@ function clickAddPosition() {
position: null, position: null,
type: { id: "normol", name: "ทั่วไป" }, type: { id: "normol", name: "ทั่วไป" },
code: null, code: null,
highDegree: "0", highDegree: "",
}); });
} }
}); });
@ -704,6 +662,97 @@ function clearDateAnnounce() {
dateAnnounce.value = null; dateAnnounce.value = null;
} }
const mainDataPosLevel = ref<ResponesePosType[]>([]); //
const optionPosLevel1 = ref<DataOption2[]>([]); //
const filterOptionPosLevel1 = ref<DataOption2[]>([]); //
const optionPosLevel2 = ref<DataOption2[]>([]); //
const filterOptionPosLevel2 = ref<DataOption2[]>([]); //
const optionPosType1 = ref<DataOption2[]>([]); //
const filterOptionPosType1 = ref<DataOption2[]>([]); //
const optionPosType2 = ref<DataOption2[]>([]); //
const filterOptionPosType2 = ref<DataOption2[]>([]); //
/** ฟังก์ชันเรียกข้อมูล ประเภทตำแหน่ง*/
async function fetchPositionType() {
http
.get(config.API.orgPosType)
.then((res) => {
mainDataPosLevel.value = res.data.result.filter(
(e: ResponesePosType) => e.posTypeRank <= 2
);
const getDataByRank = (rank: number) => {
const data =
res.data.result.find((e: ResponesePosType) => e.posTypeRank === rank)
?.posLevels || [];
return data
.filter((e: DataPosLevel) => e.posLevelRank === 1)
.map((e: DataPosLevel) => ({
id: e.id.toString(),
name: e.posLevelName.toString(),
level: e.posLevelRank,
}));
};
optionPosLevel1.value = getDataByRank(1);
filterOptionPosLevel1.value = getDataByRank(1);
optionPosLevel2.value = getDataByRank(2);
filterOptionPosLevel2.value = getDataByRank(2);
fetchPosition(1);
fetchPosition(2);
})
.catch((err) => {
messageError($q, err);
});
}
/**
* งกนเรยกขอมลตำแหน
* @param level ระดบของประเภทตำแหน
*/
function fetchPosition(level: number) {
http
.post(config.API.orgPosTypeSearch, {
posType:
mainDataPosLevel.value?.find(
(e: ResponesePosType) => e.posTypeRank === level
)?.id ?? null,
posLevel:
level === 1 ? optionPosLevel1.value[0].id : optionPosLevel2.value[0].id,
})
.then((res) => {
const option: DataOption2[] = res.data.result.map(
(r: ResponesePosition) => ({
id: r.id.toString(),
name: r.positionName.toString(),
})
);
if (level === 1) {
optionPosType1.value = option;
filterOptionPosType1.value = option;
} else if (level === 2) {
optionPosType2.value = option;
filterOptionPosType2.value = option;
}
})
.catch((err) => {
messageError($q, err);
});
}
/**
* งกนเปลยนประเภทตำแหน
* @param val าประเภทตำแหน 0 = ประเภททวไป ,1 = ประเภทวชาการ
* @param index ตำแหนงของขอม
*/
function onUpdateHighDegree(val: string, index: string) {
rowsPosition.value[index].position = null;
rowsPosition.value[index].level =
val === "0" ? optionPosLevel1.value[0] : optionPosLevel2.value[0];
}
watch(fee, () => { watch(fee, () => {
if (fee.value <= 0) { if (fee.value <= 0) {
pay.value = ""; pay.value = "";
@ -720,8 +769,7 @@ onMounted(async () => {
pay.value = ""; pay.value = "";
edit.value = false; edit.value = false;
} }
await fetchPositionPath(); await fetchPositionType();
await fetchPositionLevel();
}); });
</script> </script>
@ -1093,82 +1141,7 @@ onMounted(async () => {
mask="###" mask="###"
/> />
</q-td> </q-td>
<q-td key="position" :props="props">
<selector
class=""
outlined
:readonly="checkRoutePermisson"
use-input
v-model="props.row.position"
:options="positionPathOptions"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกตำแหน่ง'}`]"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'position'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
<template v-slot:selected-item="scope">
ตำแหน:
<q-chip
dense
square
class="q-my-none q-ml-xs q-mr-none"
>
{{ scope.opt.name }}
</q-chip>
</template>
</selector>
</q-td>
<q-td key="level" :props="props">
<selector
class=""
outlined
use-input
v-model="props.row.level"
:readonly="checkRoutePermisson"
:options="positionLevelOptions"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกระดับ'}`]"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'positionLevel'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
<template v-slot:selected-item="scope">
ระด:
<q-chip
dense
square
class="q-my-none q-ml-xs q-mr-none"
>
{{ scope.opt.name }}
</q-chip>
</template>
</selector>
</q-td>
<q-td key="highDegree" :props="props"> <q-td key="highDegree" :props="props">
<q-radio <q-radio
v-model="props.row.highDegree" v-model="props.row.highDegree"
@ -1176,6 +1149,12 @@ onMounted(async () => {
color="teal" color="teal"
:disable="checkRoutePermisson" :disable="checkRoutePermisson"
val="0" val="0"
@update:model-value="
onUpdateHighDegree(
props.row.highDegree,
props.rowIndex
)
"
/> />
<q-radio <q-radio
v-model="props.row.highDegree" v-model="props.row.highDegree"
@ -1183,8 +1162,82 @@ onMounted(async () => {
color="teal" color="teal"
:disable="checkRoutePermisson" :disable="checkRoutePermisson"
val="1" val="1"
@update:model-value="
onUpdateHighDegree(
props.row.highDegree,
props.rowIndex
)
"
/> />
</q-td> </q-td>
<q-td key="level" :props="props">
<selector
:disable="props.row.highDegree === ''"
class=""
outlined
use-input
v-model="props.row.level"
:readonly="checkRoutePermisson"
:options="
props.row.highDegree === '0'
? optionPosLevel1
: optionPosLevel2
"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกระดับ'}`]"
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn, props.row.highDegree === '0' ? 'positionLevel1':'positionLevel2'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</selector>
</q-td>
<q-td key="position" :props="props">
<selector
:disable="props.row.highDegree === ''"
class=""
outlined
:readonly="checkRoutePermisson"
use-input
v-model="props.row.position"
:options="
props.row.highDegree === '0'
? optionPosType1
: optionPosType2
"
option-value="id"
option-label="name"
input-debounce="0"
dense
hide-bottom-space
lazy-rules
:rules="[(val:any) => !!val || `${'กรุณาเลือกตำแหน่ง'}`]"
@filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn, props.row.highDegree === '0' ? 'position1' :'position2'
) "
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>{{ scope.opt.name }}</q-item-label>
</q-item-section>
</q-item>
</template>
</selector>
</q-td>
<q-td key="type" :props="props"> <q-td key="type" :props="props">
<selector <selector
class="" class=""

View file

@ -792,8 +792,13 @@ onMounted(async () => {
> >
<q-tooltip>เพมขอม</q-tooltip></q-btn <q-tooltip>เพมขอม</q-tooltip></q-btn
> >
<q-btn <q-btn
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate" v-if="
isLeave == false &&
checkPermission($route)?.attrIsUpdate &&
empType === ''
"
round round
flat flat
dense dense

View file

@ -6,6 +6,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useOrganizational } from "@/modules/02_organization/store/organizational"; import { useOrganizational } from "@/modules/02_organization/store/organizational";
import { useRoute } from "vue-router";
/** importType*/ /** importType*/
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -18,6 +19,7 @@ import DialogHeader from "@/components/DialogHeader.vue";
/** use*/ /** use*/
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute();
const store = useOrganizational(); const store = useOrganizational();
const { const {
dialogConfirm, dialogConfirm,
@ -34,21 +36,12 @@ const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({ const props = defineProps({
dataSort: Array as PropType<ResponseObject[]>, dataSort: Array as PropType<ResponseObject[]>,
}); });
const profileId = ref<string>(route.params.id.toString()); //id profile
/** ข้อมูล Table*/ /** ข้อมูล Table*/
const rows = ref<ResponseObject[]>([]); const rows = ref<ResponseObject[]>([]);
const selected = ref<any[]>([]);
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: true,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "educationLevel", name: "educationLevel",
align: "left", align: "left",
@ -234,16 +227,42 @@ const columns = ref<QTableProps["columns"]>([
*/ */
function onDrop(from: number, to: number) { function onDrop(from: number, to: number) {
rows.value.splice(to, 0, rows.value.splice(from, 1)[0]); rows.value.splice(to, 0, rows.value.splice(from, 1)[0]);
selected.value.push(rows.value[0]);
} }
/** function บันทึกการจัดลำดับ*/ /** function บันทึกการจัดลำดับ*/
function onSubmit() { function onSubmit() {
dialogConfirm($q, () => {}); dialogConfirm($q, async () => {
showLoader();
const body = rows.value.map((e: any) => ({
id: e.id,
isUse: selected.value.some((i: any) => i.id === e.id),
}));
await http
.put(config.API.profileNewEducationSort("") + `/${profileId.value}`, {
data: body,
})
.then(async () => {
await success($q, "บันทึกข้อมูลสำเร็จ");
modal.value = false;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
} }
watch(modal, async () => { watch(modal, async () => {
if (modal.value && props.dataSort) { if (modal.value && props.dataSort) {
rows.value = props.dataSort; rows.value = props.dataSort;
selected.value.push(rows.value[0]);
} else {
selected.value = [];
rows.value = [];
} }
}); });
</script> </script>
@ -252,7 +271,7 @@ watch(modal, async () => {
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="min-width: 80vw"> <q-card style="min-width: 80vw">
<DialogHeader <DialogHeader
:tittle="`จัดลำดับการแสดง`" :tittle="`จัดลำดับการแสดงผล`"
:close="() => (modal = false)" :close="() => (modal = false)"
/> />
<q-separator /> <q-separator />
@ -277,26 +296,34 @@ watch(modal, async () => {
hide-bottom hide-bottom
hide-pagination hide-pagination
hide-header hide-header
selection="multiple"
v-model:selected="selected"
> >
<template v-slot:header-selection="scope">
<q-checkbox
keep-color
color="primary"
dense
v-model="scope.checkBox"
/>
</template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props"> <q-tr :props="props">
<q-td>
<q-checkbox
:disable="props.rowIndex === 0"
keep-color
color="primary"
dense
v-model="props.selected"
/>
</q-td>
<q-td <q-td
v-for="col in props.cols" v-for="col in props.cols"
:key="col.id" :key="col.id"
:class="props.rowIndex === 0 ? 'text-primary' : ''" :class="props.rowIndex === 0 ? 'text-primary' : ''"
> >
<div v-if="col.name === 'no'"> <div>
{{
props.rowIndex === 0
? "วุฒิในตำแหน่ง"
: props.rowIndex === 1
? "ลำดับที่ 2"
: props.rowIndex === 2
? "ลำดับที่ 3"
: ""
}}
</div>
<div v-else>
{{ {{
col.value === "" || col.value === null ? "-" : col.value col.value === "" || col.value === null ? "-" : col.value
}} }}

View file

@ -176,7 +176,7 @@ onMounted(async () => {
<q-card flat class="q-pa-sm"> <q-card flat class="q-pa-sm">
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12"> <div class="col-12">
<div class="row"> <div class="row q-col-gutter-sm">
<div class="q-px-sm"> <div class="q-px-sm">
<q-btn <q-btn
v-if="checkPermission($route)?.attrIsUpdate" v-if="checkPermission($route)?.attrIsUpdate"

View file

@ -369,7 +369,7 @@ function clickAdd(data: any) {
}) })
.finally(() => {}); .finally(() => {});
}, },
"ยนยันการเพิ่มข้อมูล", "ยนยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้หรือไม่ ?" "ต้องการเพิ่มข้อมูลนี้หรือไม่ ?"
); );
} }

View file

@ -1,12 +1,19 @@
divdivdivdiv
<script setup lang="ts"> <script setup lang="ts">
import { computed, ref, watch } from "vue"; import { computed, reactive, ref, watch } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import type { OptionPeriod } from "@/modules/07_insignia/interface/index/Main"; import type { QTableProps } from "quasar";
import type {
OptionPeriod,
OptionData,
} from "@/modules/07_insignia/interface/index/Main";
import type { FormQuery } from "@/modules/07_insignia/interface/request/Main";
import type { ResponsePosition } from "@/modules/07_insignia/interface/response/Main";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
@ -59,12 +66,10 @@ const options = ref<OptionPeriod[]>([
{ label: "รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ 2", value: 2 }, { label: "รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ 2", value: 2 },
]); ]);
/** /** Function เรียกข้อมูลของรอบการเสนอขอ*/
* Function เรยกขอมลของรอบการเสนอขอ async function fetchData() {
*/
function fetchData() {
showLoader(); showLoader();
http await http
.get(config.API.getRoundInsignia(roundId.value)) .get(config.API.getRoundInsignia(roundId.value))
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
@ -88,9 +93,7 @@ function fetchData() {
}); });
} }
/** /** Function อัพเดทวันที่เริ่มต้น และ สิ้นสุด*/
* Function พเดทวนทเรมต และ นส
*/
function updateDateRange() { function updateDateRange() {
if (roundInsig.value.value == 1) { if (roundInsig.value.value == 1) {
dateStart.value = new Date(yearly.value, 9, 1); dateStart.value = new Date(yearly.value, 9, 1);
@ -120,12 +123,11 @@ function fileUploadDoc(files: any) {
}); });
} }
/** /** Function บันทึกข้อมูล*/
* Function นทกขอม
*/
function onSubmit() { function onSubmit() {
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
showLoader(); showLoader();
const newEmpPosId = selected.value.map((e) => e.id);
const formData = new FormData(); const formData = new FormData();
const name = `รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ ${ const name = `รอบการเสนอขอพระราชทานเครื่องราชฯ รอบที่ ${
roundInsig.value.value roundInsig.value.value
@ -134,6 +136,7 @@ function onSubmit() {
formData.append("year", yearly.value.toString()); formData.append("year", yearly.value.toString());
formData.append("amount", datelast.value ? datelast.value.toString() : ""); formData.append("amount", datelast.value ? datelast.value.toString() : "");
formData.append("round", roundInsig.value.value); formData.append("round", roundInsig.value.value);
if (dateStart.value !== null) { if (dateStart.value !== null) {
formData.append("startDate", dateToISO(dateStart.value)); formData.append("startDate", dateToISO(dateStart.value));
} }
@ -141,6 +144,7 @@ function onSubmit() {
formData.append("endDate", dateToISO(dateEnd.value)); formData.append("endDate", dateToISO(dateEnd.value));
} }
formData.append("file", files.value); formData.append("file", files.value);
formData.append("empPosId", JSON.stringify(newEmpPosId));
const url = const url =
actionType.value !== "edit" actionType.value !== "edit"
? config.API.listRoundInsignia() ? config.API.listRoundInsignia()
@ -165,7 +169,6 @@ function onSubmit() {
/** /**
* function popup รอบการเสนอขอพระราชทานเครองราชอสรยาภรณ * function popup รอบการเสนอขอพระราชทานเครองราชอสรยาภรณ
*
* และกำหนดตวแปรเปนค Defult * และกำหนดตวแปรเปนค Defult
*/ */
function onCloseDialog() { function onCloseDialog() {
@ -191,17 +194,95 @@ function classInput(val: boolean) {
}; };
} }
//
const optionFilter = ref<OptionData[]>([
{ id: "positionName", name: "ชื่อตำแหน่ง" },
{ id: "positionType", name: "กลุ่มงาน" },
{ id: "positionLevel", name: "ระดับชั้นงาน" },
]);
const formQuery = reactive<FormQuery>({
keyword: "",
type: "positionName",
});
const rows = ref<ResponsePosition[]>([]);
const selected = ref<ResponsePosition[]>([]); //
const columns = ref<QTableProps["columns"]>([
{
name: "posDictName",
align: "left",
label: "ชื่อตำแหน่ง",
sortable: true,
field: "posDictName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posTypeName",
align: "left",
label: "กลุ่มงาน",
sortable: true,
field: "posTypeName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "posLevelName",
align: "left",
label: "ระดับชั้นงาน",
sortable: true,
field: "posLevelName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
]);
const visibleColumns = ref<string[]>([
"posDictName",
"posTypeName",
"posLevelName",
]);
const pagination = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
/** /**
* ทำงานเม modal เป true actionType เป view * งกนดงขอมลรายการตำแหนงจาก API
* * @param statusType สถานะการสงประเภทคนหา (true = ไมงประเภทคนหา)
* * เกบขอมลรายการตำแหนงจากไวใน rows.value
*/ */
async function fetchDataPos(statusType: boolean = false) {
rows.value = [];
showLoader();
await http
.get(
config.API.orgEmployeePos +
`?keyword=${formQuery.keyword}&type=${statusType ? "" : formQuery.type}`
)
.then(async (res) => {
rows.value = await res.data.result;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/** ทำงานเมื่อ modal เป็น true actionType เป็น view*/
watch( watch(
() => modal.value, () => modal.value,
() => { async () => {
if (modal.value) { if (modal.value) {
await fetchDataPos(true);
selected.value = [];
formQuery.keyword = "";
formQuery.type = "positionName";
if (actionType.value !== "") { if (actionType.value !== "") {
fetchData(); await fetchData();
} }
} }
} }
@ -210,192 +291,334 @@ watch(
<template> <template>
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="width: 1200px; max-width: 80vw"> <q-card style="min-width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader :tittle="title" :close="onCloseDialog" /> <DialogHeader :tittle="title" :close="onCloseDialog" />
<q-separator /> <q-separator />
<q-card-section> <q-card-section style="padding: 0px">
<div class="col-12 row q-col-gutter-md"> <div class="col-12 row">
<div class="col-md-10 col-xs-12"> <div class="col-xs-12 col-md-5 row no-wrap">
<q-select <div class="col-12">
:class="classInput(!readonly)" <div class="col-12 row q-col-gutter-md q-pa-md">
:readonly="readonly" <div class="col-md-9 col-xs-12">
dense <q-select
outlined :class="classInput(!readonly)"
v-model="roundInsig" :readonly="readonly"
:options="options" dense
option-value="value" outlined
option-label="label" v-model="roundInsig"
label="รอบการเสนอขอพระราชทานเครื่องราชฯ" :options="options"
@update:model-value="updateDateRange" option-value="value"
:rules="[(val:string) => !!val || `${'กรุณาเลือกรอบที่'}`]" option-label="label"
hide-bottom-space label="รอบการเสนอขอพระราชทานเครื่องราชฯ"
lazy-rules @update:model-value="updateDateRange"
/> :rules="[(val:string) => !!val || `${'กรุณาเลือกรอบที่'}`]"
hide-bottom-space
lazy-rules
/>
</div>
<div class="col-md-3 col-xs-12">
<datepicker
:class="classInput(!readonly)"
:readonly="readonly"
menu-class-name="modalfix"
v-model="yearly"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
@update:modelValue="updateYear"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:class="classInput(!readonly)"
:readonly="readonly"
dense
outlined
hide-bottom-space
:model-value="yearly + 543"
:rules="[(val:string) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]"
:label="`${'ปีที่เสนอ'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-md-4 col-xs-12">
<datepicker
menu-class-name="modalfix"
v-model="dateStart"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:class="classInput(!readonly)"
:readonly="readonly"
:max-date="dateEnd"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
:class="classInput(!readonly)"
:readonly="readonly"
outlined
dense
:model-value="
dateStart != null ? date2Thai(dateStart) : null
"
:label="`${'วันเริ่มต้น'}`"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันเริ่มต้น'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-md-4 col-xs-12">
<datepicker
menu-class-name="modalfix"
v-model="dateEnd"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:class="classInput(!readonly)"
:readonly="readonly"
:min-date="dateStart"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="col-xs-12 col-sm-4"
:model-value="
dateEnd != null ? date2Thai(dateEnd) : null
"
:label="`${'วันสิ้นสุด'}`"
:rules="[
(val:string) => !!val || `${'กรุณาเลือกวันที่วันสิ้นสุด'}`,
]"
:class="classInput(!readonly)"
:readonly="readonly"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-md-4 col-xs-12">
<q-input
:class="classInput(!readonly)"
:readonly="readonly"
dense
outlined
v-model="datelast"
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
mask="###"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกจำนวนวันแจ้งเตือนก่อนวันสิ้นสุด'}`,
]"
lazy-rules
hide-bottom-space
/>
</div>
<div class="col-md-12 col-xs-12">
<q-file
:class="classInput(!readonly)"
:readonly="readonly"
outlined
dense
v-model="files"
@added="fileUploadDoc"
label="อัปโหลดเอกสารประกอบ"
hide-bottom-space
lazy-rules
accept=".pdf,.xlsx,.doc"
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div>
</div>
</div>
<div class="col-12 row">
<q-separator :vertical="!$q.screen.lt.md" />
</div>
</div> </div>
<div class="col-md-2 col-xs-12">
<datepicker <div class="col-xs-12 col-md-7 row">
:class="classInput(!readonly)" <div class="col-12">
:readonly="readonly" <div class="row col-12 q-col-gutter-sm q-pa-md">
menu-class-name="modalfix" <div class="row col-12 q-col-gutter-sm">
v-model="yearly" <div class="row q-col-gutter-sm align-items-center">
:locale="'th'" <div class="col-auto">
autoApply <q-select
year-picker label="ค้นหาจาก"
:enableTimePicker="false" v-model="formQuery.type"
@update:modelValue="updateYear" :options="optionFilter"
> emit-value
<template #year="{ year }">{{ year + 543 }}</template> dense
<template #year-overlay-value="{ value }">{{ map-options
parseInt(value + 543) outlined
}}</template> option-label="name"
<template #trigger> option-value="id"
<q-input />
:class="classInput(!readonly)" </div>
:readonly="readonly"
dense <div class="col">
outlined <q-input
hide-bottom-space ref="searchRef"
:model-value="yearly + 543" v-model="formQuery.keyword"
:rules="[(val:string) => !!val || `${'กรุณาเลือกปีที่เสนอ'}`]" outlined
:label="`${'ปีที่เสนอ'}`" dense
> lazy-rules
<template v-slot:prepend> label="คำค้น"
<q-icon hide-bottom-space
name="event" @keydown.enter="fetchDataPos()"
class="cursor-pointer" >
style="color: var(--q-primary)" <template v-slot:append>
<q-icon
v-if="formQuery.keyword"
name="cancel"
@click="formQuery.keyword = ''"
class="cursor-pointer"
></q-icon>
</template>
</q-input>
</div>
<div class="col-auto">
<q-btn
outline
color="primary"
icon="search"
label="ค้นหา"
class="full-width full-height"
@click="fetchDataPos()"
/>
</div>
</div>
<q-space />
<div class="row q-col-gutter-sm align-items-center">
<div class="col-auto">
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>
</div>
</div>
<div class="col-12">
<q-card
bordered
:class="
pagination.rowsPerPage > 10 ? 'col-12 scroll' : 'col-12'
"
:style="pagination.rowsPerPage > 10 ? 'height: 75vh' : ''"
>
<d-table
:columns="columns"
:rows="rows"
row-key="id"
flat
bordered
:paging="true"
dense
:visible-columns="visibleColumns"
selection="multiple"
v-model:selected="selected"
v-model:pagination="pagination"
> >
</q-icon> <template v-slot:header-selection="scope">
</template> <q-checkbox
</q-input> keep-color
</template> color="primary"
</datepicker> dense
</div> v-model="scope.selected"
<div class="col-md-5 col-xs-12"> />
<datepicker </template>
menu-class-name="modalfix"
v-model="dateStart" <template v-slot:body="props">
:locale="'th'" <q-tr :props="props">
autoApply <q-td auto-width>
borderless <q-checkbox
:enableTimePicker="false" keep-color
week-start="0" color="primary"
:class="classInput(!readonly)" dense
:readonly="readonly" v-model="props.selected"
:max-date="dateEnd" />
> </q-td>
<template #year="{ year }"> <q-td
{{ year + 543 }} v-for="col in props.cols"
</template> :key="col.name"
<template #year-overlay-value="{ value }"> :props="props"
{{ parseInt(value + 543) }} >
</template> <div>
<template #trigger> {{ col.value ? col.value : "-" }}
<q-input </div>
:class="classInput(!readonly)" </q-td>
:readonly="readonly" </q-tr>
outlined </template>
dense </d-table>
:model-value=" </q-card>
dateStart != null ? date2Thai(dateStart) : null </div>
" </div>
:label="`${'วันเริ่มต้น'}`" </div>
:rules="[(val:string) => !!val || `${'กรุณาเลือกวันเริ่มต้น'}`]"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-md-5 col-xs-12">
<datepicker
menu-class-name="modalfix"
v-model="dateEnd"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:class="classInput(!readonly)"
:readonly="readonly"
:min-date="dateStart"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
outlined
dense
class="col-xs-12 col-sm-4"
:model-value="dateEnd != null ? date2Thai(dateEnd) : null"
:label="`${'วันสิ้นสุด'}`"
:rules="[
(val:string) => !!val || `${'กรุณาเลือกวันที่วันสิ้นสุด'}`,
]"
:class="classInput(!readonly)"
:readonly="readonly"
hide-bottom-space
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-md-2 col-xs-12">
<q-input
:class="classInput(!readonly)"
:readonly="readonly"
dense
outlined
v-model="datelast"
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
mask="###"
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกจำนวนวันแจ้งเตือนก่อนวันสิ้นสุด'}`,
]"
lazy-rules
hide-bottom-space
/>
</div>
<div class="col-md-12 col-xs-12">
<q-file
:class="classInput(!readonly)"
:readonly="readonly"
outlined
dense
v-model="files"
@added="fileUploadDoc"
label="อัปโหลดเอกสารประกอบ"
hide-bottom-space
lazy-rules
accept=".pdf,.xlsx,.doc"
>
<template v-slot:prepend>
<q-icon name="attach_file" />
</template>
</q-file>
</div> </div>
</div> </div>
</q-card-section> </q-card-section>

View file

@ -45,9 +45,7 @@ const {
onSearchDataTable, onSearchDataTable,
} = mixin; } = mixin;
/** /** props*/
* props
*/
const props = defineProps({ const props = defineProps({
tab: { tab: {
type: String, type: String,
@ -426,9 +424,9 @@ async function addlistperson(id: string) {
}; };
await http await http
.post(config.API.insigniaCreate(), data) .post(config.API.insigniaCreate(), data)
.then(() => { .then(async () => {
if (props.fecthInsigniaByOc) { if (props.fecthInsigniaByOc) {
props.fecthInsigniaByOc( await props.fecthInsigniaByOc(
props.roundId, props.roundId,
organization.value, organization.value,
"officer", "officer",
@ -440,6 +438,8 @@ async function addlistperson(id: string) {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
} }
@ -577,7 +577,7 @@ async function listreject(profileId: string, reason: string) {
props.tab props.tab
); );
success($q, "ย้ายข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
modelPopupReject.value = false; modelPopupReject.value = false;
}) })
.catch((err) => { .catch((err) => {
@ -633,7 +633,7 @@ async function listdelete(id: string, reason: string) {
"officer", "officer",
props.tab props.tab
); );
success($q, "บข้อมูลสำเร็จ"); success($q, "ันทึกข้อมูลสำเร็จ");
closemodelPopupDelete(); closemodelPopupDelete();
}) })
.catch((err) => { .catch((err) => {
@ -856,7 +856,8 @@ function onClickViewInfo(type: string, id: string, empClass: string) {
infoType.value = type; infoType.value = type;
profileId.value = id; profileId.value = id;
modalDialogInfo.value = true; modalDialogInfo.value = true;
employeeClass.value = empClass === "officer" ? "" : "-employee"; employeeClass.value =
empClass.toLocaleLowerCase() === "officer" ? "" : "-employee";
} }
/** Hook*/ /** Hook*/

View file

@ -187,10 +187,6 @@ function updatemodalPersonal(modal: boolean) {
/** filter table*/ /** filter table*/
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const filterRef = ref<any>(null); const filterRef = ref<any>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
const pagination = ref({ const pagination = ref({
sortBy: "name", sortBy: "name",
descending: false, descending: false,

View file

@ -31,10 +31,16 @@ interface CheckboxData {
name: string; name: string;
val: boolean; val: boolean;
} }
interface FormQuery {
type: string;
keyword: string;
}
export type { export type {
FormProprsalsRound, FormProprsalsRound,
FormProprsalsRound2, FormProprsalsRound2,
ItemType, ItemType,
ColId, ColId,
CheckboxData, CheckboxData,
FormQuery,
}; };

View file

@ -155,6 +155,16 @@ interface ResponseDataInsignia {
items: ResponseManageList[]; items: ResponseManageList[];
} }
interface ResponsePosition {
id: string;
posDictName: string;
posLevelId: string;
posLevelName: number;
posTypeId: string;
posTypeName: string;
posTypeShortName: string;
}
export type { export type {
ResponseObject, ResponseObject,
ResponsePeriod, ResponsePeriod,
@ -166,4 +176,5 @@ export type {
ResponseProfile, ResponseProfile,
ResponseManageList, ResponseManageList,
ResponseDataInsignia, ResponseDataInsignia,
ResponsePosition,
}; };

View file

@ -93,7 +93,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
insigniaLevel: e.level ? e.level : "", insigniaLevel: e.level ? e.level : "",
dateSend: e.requestDate ? date2Thai(e.requestDate) : null, dateSend: e.requestDate ? date2Thai(e.requestDate) : null,
requestNote: e.requestNote ? e.requestNote : "", requestNote: e.requestNote ? e.requestNote : "",
employeeType: profileType(e.profileType) || null, employeeType: profileType(e.profileType.toLocaleLowerCase()) || null,
employeeClass: e.profileType, employeeClass: e.profileType,
reason: e.reason ? e.reason : "", reason: e.reason ? e.reason : "",
markDiscipline: e.markDiscipline, markDiscipline: e.markDiscipline,

View file

@ -315,7 +315,7 @@ async function fetchDataSigner() {
nameOfWork.value = data.subjectDoc2; nameOfWork.value = data.subjectDoc2;
nameOfOwner.value = data.authorDoc2; nameOfOwner.value = data.authorDoc2;
position.value = data.assignedPosition; position.value = data.assignedPosition;
evaluationResult.value = data.evaluationResult evaluationResult.value = data.evaluationResult;
} }
}) })
.catch((e) => { .catch((e) => {
@ -986,7 +986,17 @@ onMounted(async () => {
/> />
</div> </div>
</div> </div>
<div v-if="evaluationResult !== 'PENDING'" align="right" :class="evaluationResult == 'PASS' ? `full-width text-green`:`full-width text-orange` ">ผลการพิจารณา : {{ evaluationResult == 'PASS' ? 'ผ่าน':'ไม่ผ่าน' }}</div> <div v-if="evaluationResult !== 'PENDING'" align="right" class="full-width">
ผลการประเม:
<span
:class="
evaluationResult == 'PASS'
? `full-width text-green`
: `full-width text-red`
"
>{{ evaluationResult == "PASS" ? "ผ่าน" : "ไม่ผ่าน" }}</span
>
</div>
</div> </div>
<q-dialog v-model="modalConfirm" persistent> <q-dialog v-model="modalConfirm" persistent>

View file

@ -5,6 +5,7 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { checkPermissionGet } from "@/utils/permissions"; import { checkPermissionGet } from "@/utils/permissions";
import avatarMain from "@/assets/avatar_user.jpg";
/** /**
* importCOmponents * importCOmponents
@ -43,22 +44,28 @@ const props = defineProps({
const avatar = ref<string>(""); const avatar = ref<string>("");
const fullName = ref<string>(""); const fullName = ref<string>("");
const position = ref<string>(""); const position = ref<string>("");
const isSkeleton = ref<boolean>(false);
/** function เรียกข้อมูลส่วนตัว*/ /** function เรียกข้อมูลส่วนตัว*/
function fetchInformation() { function fetchInformation() {
isSkeleton.value = false;
http http
.get(config.API.orgProfileById(profileId.value, props.employeeClass)) .get(config.API.orgProfileById(profileId.value, props.employeeClass))
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`; fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`;
position.value = data.position; position.value = data.position;
if (data.avatarName) { if (data.avatarName) {
await fetchProfile(data.id as string, data.avatarName); await fetchProfile(data.id as string, data.avatarName);
} else {
avatar.value = avatarMain;
} }
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
isSkeleton.value = true;
}); });
} }
@ -117,12 +124,14 @@ watch(
style="object-fit: cover" style="object-fit: cover"
/> />
<img <img
v-else
src="@/assets/avatar_user.jpg" src="@/assets/avatar_user.jpg"
class="bg-grey-3" class="bg-grey-3"
style="object-fit: cover" style="object-fit: cover"
/> />
</q-avatar> </q-avatar>
</div> </div>
<div <div
class="q-mt-md text-subtitle2 text-bold" class="q-mt-md text-subtitle2 text-bold"
style="font-size: 18px" style="font-size: 18px"

View file

@ -392,7 +392,7 @@ onMounted(async () => {
</q-card> </q-card>
</div> </div>
<div class="col-6" v-if="isAttachment || store.dataCommand"> <div class="col-6" v-if="isAttachment">
<q-card <q-card
bordered bordered
class="row col-12" class="row col-12"