Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-05-01 18:11:28 +07:00
commit a1c835b70e
12 changed files with 343 additions and 159 deletions

View file

@ -34,6 +34,8 @@ export default {
changestatusProbations: (personalId: string) =>
`${evaluate}/report/change-status?personal_id=${personalId}`,
// probationGetAssignList: (personalId: string) =>
// `${finish}/probation-assign-list?personal_id=${personalId}`,
// clearPosition: (personalId:string) => `${placement}/position/clear/${personalId}`

View file

@ -109,9 +109,8 @@ async function fetchInformation(id: string) {
imformation.age = data.birthDate ? calculateAge(data.birthDate) : "-";
imformation.gender = data.gender ?? "-";
avatar.fullname = data.createdFullName
? `${data.prefix}${data.lastUpdateFullName}`
: "-";
avatar.fullname = `${data.prefix}${data.firstName} ${data.lastName}`;
avatar.position = data.position ? data.position : "-";
})
.catch((err) => {
@ -133,15 +132,19 @@ async function fetchProfileGov(id: string) {
.get(config.API.profileNewGovernmentById(id))
.then((res) => {
const data = res.data.result;
goverment.oc = data.org ?? "-";
goverment.posNo = data.posMasterNo ?? "-";
goverment.position = data.position ?? "-";
goverment.positionPathSide = data.positionArea ?? "-";
goverment.positionLine = data.positionField ?? "-";
goverment.positionType = data.posType ?? "-";
goverment.positionLevel = data.posLevel ?? "-";
goverment.positionExecutive = data.posExecutive ?? "-";
goverment.positionExecutiveSide = data.positionExecutiveField ?? "-";
goverment.oc = data.org !== "" ? data.org : "-";
goverment.posNo = data.posMasterNo !== "" ? data.posMasterNo : "-";
goverment.position = data.position !== "" ? data.position : "-";
goverment.positionPathSide =
data.positionArea !== "" ? data.positionArea : "-";
goverment.positionLine =
data.positionField !== "" ? data.positionField : "-";
goverment.positionType = data.posType !== "" ? data.posType : "-";
goverment.positionLevel = data.posLevel !== "" ? data.posLevel : "-";
goverment.positionExecutive =
data.posExecutive !== "" ? data.posExecutive : "-";
goverment.positionExecutiveSide =
data.positionExecutiveField !== "" ? data.positionExecutiveField : "-";
})
.catch((err) => {
@ -168,11 +171,11 @@ watch(
() => props.modal,
async () => {
modal.value = props.modal ? props.modal : false;
modal.value &&
props.id &&
(await fetchInformation(props.id), await fetchProfileGov(props.id)),
if (modal.value) {
props.id && (fetchInformation(props.id), fetchProfileGov(props.id));
(fileName.value = `profile-${props.id}`),
await fetchProfile(props.id as string);
fetchProfile(props.id as string);
}
}
);
@ -189,9 +192,8 @@ async function fetchProfile(id: string) {
.then(async (res) => {
avatar.avatar = res.data.downloadUrl;
})
.catch(() => {})
.finally(() => {
hideLoader();
statusLoad.value.val = true;
});
}
</script>

View file

@ -112,7 +112,6 @@ function validateFormPositionEdit() {
}
function saveSelectEdit() {
console.log(formPositionSelect.positionExecutive);
dialogConfirm(
$q,
async () => {
@ -133,8 +132,9 @@ function saveSelectEdit() {
posDictField: formPositionSelect.positionField, //
posTypeId: formPositionSelect.positionType, //*
posLevelId: formPositionSelect.positionLevel, //*
posExecutiveId: dataExecutive, //
posDictExecutiveField: formPositionSelect.positionExecutiveField, //
posExecutiveId: dataExecutive ?? "", //
posDictExecutiveField:
formPositionSelect.positionExecutiveField ?? "", //
posDictArea: formPositionSelect.positionArea, ///
isSpecial: isSpecial.value,
}
@ -143,7 +143,7 @@ function saveSelectEdit() {
posDictField: formPositionSelect.positionField, //
posTypeId: formPositionSelect.positionType, //*
posLevelId: formPositionSelect.positionLevel, //*
posExecutive: dataExecutive, //
posExecutive: dataExecutive ?? "", //
posDictExecutiveField: formPositionSelect.positionExecutiveField, //
posDictArea: formPositionSelect.positionArea, ///
isSpecial: isSpecial.value,
@ -169,7 +169,6 @@ function saveSelectEdit() {
}
/** ฟังชั่น บันทึก */
function onSubmitSelectEdit() {
console.log(formPositionSelect.positionExecutive);
dialogConfirm(
$q,
async () => {
@ -182,6 +181,7 @@ function onSubmitSelectEdit() {
? config.API.orgPosPosition
: config.API.orgPosPositionExecutive();
showLoader();
const body =
shape.value == "false"
? {
@ -189,7 +189,7 @@ function onSubmitSelectEdit() {
posDictField: formPositionSelect.positionField, //
posTypeId: formPositionSelect.positionType, //*
posLevelId: formPositionSelect.positionLevel, //*
posExecutiveId: dataExecutive, //
posExecutiveId: dataExecutive ?? "", //
posDictExecutiveField: formPositionSelect.positionExecutiveField, //
posDictArea: formPositionSelect.positionArea, ///
isSpecial: isSpecial.value,
@ -199,11 +199,12 @@ function onSubmitSelectEdit() {
posDictField: formPositionSelect.positionField, //
posTypeId: formPositionSelect.positionType, //*
posLevelId: formPositionSelect.positionLevel, //*
posExecutive: dataExecutive, //
posExecutive: dataExecutive ?? "", //
posDictExecutiveField: formPositionSelect.positionExecutiveField, //
posDictArea: formPositionSelect.positionArea, ///
isSpecial: isSpecial.value,
};
await http
.post(url, body)
.then(() => {
@ -313,10 +314,9 @@ watch(
if (modal.value === true) {
await fetchType();
await fetchExecutive();
if (props.data) {
const dataList = props.data;
console.log(dataList);
updateSelectType(dataList.posTypeId);
formPositionSelect.positionId = dataList.id;
formPositionSelect.positionName = dataList.positionName;

View file

@ -150,7 +150,6 @@
:class="getClass(edit)"
:outlined="edit"
dense
:borderless="!edit"
:model-value="date2Thai(formDataSalary.date)"
:rules="[
@ -198,6 +197,7 @@
<div class="row col-xs-12 col-sm-12 col-md-12">
<q-select
clearable
ref="templatePosRef"
:class="getClass(edit)"
:outlined="edit"
@ -241,6 +241,7 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-select
clearable
ref="typePositionRef"
:class="getClass(edit)"
:outlined="edit"
@ -266,6 +267,7 @@
<div class="col-xs-6 col-sm-6 col-md-6">
<q-select
clearable
ref="levelPositionRef"
:class="getClass(edit)"
:outlined="edit"
@ -321,6 +323,7 @@
<div class="row col-xs-12 col-sm-12 col-md-12">
<q-select
clearable
ref="templateDocRef"
:class="getClass(edit)"
:outlined="edit"
@ -1287,7 +1290,7 @@ function inputPositionLevelBlur() {
if (
!optionStore.optipnLevel.some(
(v) => v.name === tempPositionLevelInput.value
(v:any) => v.name === tempPositionLevelInput.value
)
) {
createValue(tempPositionLevelInput.value);

View file

@ -30,6 +30,8 @@ const {
hideLoader,
success,
dialogRemove,
findOrgName,
findPosMasterNo,
} = mixin;
const visibleColumns = ref<string[]>([
@ -73,7 +75,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -91,7 +93,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ระดับ",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -181,8 +183,13 @@ const getData = async () => {
id: item.id,
fullname: `${item.prefix}${item.firstName} ${item.lastName}`,
position: item.position,
posNo: item.posNo,
positionLevel: item.positionLevel,
posNo: findPosMasterNo(item),
positionLevel:
item.posTypeName == null && item.posLevelName == null
? "-"
: (item.posTypeName != null ? item.posTypeName : "") +
" " +
(item.posLevelName != null ? ` (${item.posLevelName})` : ""),
createdAt: date2Thai(item.createdAt),
organization: item.organization,
reason: item.reason,
@ -323,7 +330,7 @@ onMounted(async () => {
:props="props"
@click="openDetail(props.row.id)"
>
{{ props.row.position }}
{{ props.row.position ?? "-" }}
</q-td>
<q-td
key="positionLevel"

View file

@ -12,7 +12,7 @@ import config from "@/app.config";
import type { QForm } from "quasar";
import type { ResponseData } from "@/modules/05_placement/interface/response/officer";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
const modalPersonal = ref<boolean>(false);
const personalId = ref<string>("");
@ -67,10 +67,10 @@ const getData = async () => {
prefix.value = data.prefix;
firstName.value = data.firstName;
lastName.value = data.lastName;
avatar.value = data.avatar ?? "";
position.value = data.position;
position.value = data.position ?? "-";
posNo.value = data.posNo;
positionLevel.value = data.positionLevel;
positionLevel.value = `${data.posTypeName}(${data.posLevelName})`;
createdAt.value = data.createdAt;
organization.value = data.organization;
reason.value = data.reason;
@ -82,6 +82,7 @@ const getData = async () => {
positionNumberOld.value = data.positionNumberOld;
organizationPositionOld.value = data.organizationPositionOld;
dateRepatriation.value = data.dateRepatriation;
fetchProfile(data.profileId);
})
.catch((e) => {
messageError($q, e);
@ -91,6 +92,27 @@ const getData = async () => {
});
};
function fetchProfile(id: string) {
showLoader();
http
.get(
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
)
.then(async (res) => {
avatar.value = res.data.downloadUrl;
})
.catch((e) => {
if (e.response.data.message === "ไม่พบไฟล์ในระบบ") {
avatar.value = "";
} else {
messageError($q, e);
}
})
.finally(() => {
hideLoader();
});
}
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
@ -200,15 +222,15 @@ onMounted(async () => {
<div class="col-12 q-pl-md">
<div class="col-12 text-top">ตำแหนงในสายงาน</div>
<div class="col-12 text-detail">
{{ positionTypeOld }}
{{ position }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">ระด</div>
<div class="col-12 text-top">ประเภทตำแหน</div>
<div class="col-12 text-detail">
{{ positionLevelOld }}
{{ positionLevel }}
</div>
</div>
</div>
@ -216,7 +238,7 @@ onMounted(async () => {
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail">
{{ organizationPositionOld }}
{{ organization }}
</div>
</div>
</div>

View file

@ -7,7 +7,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import type { QForm } from "quasar";
import type { resHelpDetail } from "@/modules/05_placement/interface/response/officer";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
@ -60,28 +60,52 @@ const getData = async () => {
(id.value = data.id);
profileId.value = data.profileId;
prefix.value = data.prefix;
avatar.value = data.avatar ?? "";
firstName.value = data.firstName;
lastName.value = data.lastName;
position.value = data.position;
position.value = data.position ?? "-";
posNo.value = data.posNo;
positionLevel.value = data.positionLevel;
positionLevel.value = `${data.posTypeName}(${data.posLevelName})`;
createdAt.value = data.createdAt;
organization.value = data.organization;
reason.value = data.reason;
status.value = data.status;
dateStart.value = data.dateStart;
dateEnd.value = data.dateEnd;
positionTypeOld.value = data.positionTypeOld;
positionLevelOld.value = data.positionLevelOld;
positionTypeOld.value = data.position;
positionLevelOld.value = `${data.posTypeName}(${data.posLevelName})`;
positionNumberOld.value = data.positionNumberOld;
organizationPositionOld.value = data.organizationPositionOld;
fetchProfile(data.profileId);
})
.catch((e) => {
messageError($q, e);
})
.catch((e) => {})
.finally(() => {
hideLoader();
});
};
function fetchProfile(id: string) {
showLoader();
http
.get(
config.API.fileByFile("ทะเบียนประวัติ", "โปรไฟล์", id, `profile-${id}`)
)
.then(async (res) => {
avatar.value = res.data.downloadUrl;
})
.catch((e) => {
if (e.response.data.message === "ไม่พบไฟล์ในระบบ") {
avatar.value = "";
} else {
messageError($q, e);
}
})
.finally(() => {
hideLoader();
});
}
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
@ -124,7 +148,7 @@ const saveData = async () => {
showLoader();
await http
.put(config.API.officerMainEdit(dataId), body)
.then((res: any) => {
.then(() => {
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
edit.value = false;
})
@ -190,15 +214,15 @@ onMounted(async () => {
<div class="col-12 q-pl-md">
<div class="col-12 text-top">ตำแหนงในสายงาน</div>
<div class="col-12 text-detail">
{{ positionTypeOld }}
{{ position }}
</div>
</div>
</div>
<div class="col-xs-6 col-sm-3 row items-center">
<div class="col-12">
<div class="col-12 text-top">ระด</div>
<div class="col-12 text-top">ประเภทตำแหน</div>
<div class="col-12 text-detail">
{{ positionLevelOld }}
{{ positionLevel }}
</div>
</div>
</div>
@ -206,7 +230,7 @@ onMounted(async () => {
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail">
{{ organizationPositionOld }}
{{ organization }}
</div>
</div>
</div>

View file

@ -31,6 +31,8 @@ const {
hideLoader,
success,
dialogRemove,
findOrgName,
findPosMasterNo,
} = mixin;
//
@ -71,7 +73,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -89,7 +91,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ระดับ",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -196,9 +198,14 @@ const getData = async () => {
rows.value = data.map((item: officerType) => ({
id: item.id,
fullname: `${item.prefix}${item.firstName} ${item.lastName}`,
position: item.position,
posNo: item.posNo,
positionLevel: item.positionLevel,
position: item.position != null ? item.position : "-",
posNo: findPosMasterNo(item),
positionLevel:
item.posTypeName == null && item.posLevelName == null
? "-"
: (item.posTypeName != null ? item.posTypeName : "") +
" " +
(item.posLevelName != null ? ` (${item.posLevelName})` : ""),
createdAt: date2Thai(item.createdAt),
organization: item.organization,
reason: item.reason,
@ -209,13 +216,14 @@ const getData = async () => {
positionTypeOld: item.positionTypeOld,
positionLevelOld: item.positionLevelOld,
positionNumberOld: item.positionNumberOld,
organizationPositionOld: item.organizationPositionOld,
organizationPositionOld: findOrgName(item),
isActive: item.isActive,
dateEnd: item.dateEnd == null ? "-" : date2Thai(new Date(item.dateEnd)),
dateEnd: item.dateEnd == null ? "" : date2Thai(new Date(item.dateEnd)),
dateStart:
item.dateStart == null ? "-" : date2Thai(new Date(item.dateStart)),
item.dateStart == null ? "" : date2Thai(new Date(item.dateStart)),
}));
})
.catch((e) => {})
.finally(() => {
hideLoader();
@ -243,6 +251,7 @@ onMounted(async () => {
await getData();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">รายการชวยราชการ</div>
<q-card flat bordered class="col-12 q-mt-sm">

View file

@ -87,7 +87,7 @@ const ProductivityArray = computed(() => {
return Array(productivityCount.value).fill("");
});
const OPmain = ref<
Array<{ id: number; title: string; description: string; level: number }>
Array<{ id: number; naem: string; description: string; level: string }>
>([]);
const OPgroup = ref<
Array<{ id: number; title: string; description: string; level: number }>
@ -163,8 +163,8 @@ interface CheckboxItem {
* @param id personal id
*/
async function dataEdit(id: string) {
await myForm.value.validate().then((result: boolean) => {
if (result) {
// await myForm.value.validate().then((result: boolean) => {
// if (result) {
showLoader();
const data = putDataEdit(id);
http
@ -176,10 +176,10 @@ async function dataEdit(id: string) {
getAssign();
hideLoader();
});
} else {
dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
}
});
// } else {
// dialogMessageNotify($q, "");
// }
// });
}
/**
@ -305,6 +305,7 @@ async function getUser() {
.get(config.API.orgProfilePlacement(personalId))
.then((res: any) => {
const data = res.data.result;
OPcaretaker.value = data.caregiver.map((item: any) => ({
id: item.id,
name: item.prefix + item.firstName + " " + item.lastName,
@ -369,6 +370,7 @@ async function getUser() {
async function getAssignNew(id: string) {
await http.get(config.API.newAssign(id)).then((res: any) => {
const data = res.data.data;
const monthOption = {
value: data.assign_month,
label: `${data.assign_month} เดือน`,
@ -388,30 +390,66 @@ async function getAssignNew(id: string) {
* get อม สมรรถนะหล
* @param id personal id
*/
const assign_competencyMain = ref<any>();
async function getcompetency(id: string) {
await http.get(config.API.competencyOptions(id)).then((res: any) => {
const data = res.data.data;
OPmain.value = data;
main.value = data[0];
main2.value = data[1];
main3.value = data[2];
main4.value = data[3];
main5.value = data[4];
});
http
.get(config.API.kpiCapacity + `/head`)
.then((res) => {
const data = res.data.result;
assign_competencyMain.value = data;
main.value = data[0];
main2.value = data[1];
main3.value = data[2];
main4.value = data[3];
main5.value = data[4];
console.log(main.value);
})
.catch((err) => {
messageError($q, err);
});
// await http.get(config.API.competencyOptions(id)).then((res: any) => {
// const data = res.data.data;
// console.log(data);
// OPmain.value = data;
// main.value = data[0];
// main2.value = data[1];
// main3.value = data[2];
// main4.value = data[3];
// main5.value = data[4];
// });
}
/**
* get อม สมรรถนะประจากลมงาน
* @param id personal id
*/
const assign_competencyGroupMain = ref<any>();
async function getCompetencyGroup(id: string) {
await http.get(config.API.competencyGroupOptions(id)).then((res: any) => {
const data = res.data.data;
OPgroup.value = data;
group.value = data[0];
group2.value = data[1];
group3.value = data[2];
});
console.log(position.value);
http
.get(config.API.kpiCapacity + `/group?positionName=${position.value}`)
.then((res) => {
const data = res.data.result;
assign_competencyGroupMain.value = data;
OPgroup.value = data;
group.value = data[0];
group2.value = data[1];
group3.value = data[2];
})
.catch((err) => {
messageError($q, err);
});
// await http.get(config.API.competencyGroupOptions(id)).then((res: any) => {
// const data = res.data.data;
// OPgroup.value = data;
// group.value = data[0];
// group2.value = data[1];
// group3.value = data[2];
// });
}
/**
@ -518,11 +556,11 @@ function putDataEdit(id: string) {
if (skill4.value) allSkills.push({ level: skill4.value.level });
const allCompetency = [];
if (main.value) allCompetency.push({ level: main.value.level });
if (main2.value) allCompetency.push({ level: main2.value.level });
if (main3.value) allCompetency.push({ level: main3.value.level });
if (main4.value) allCompetency.push({ level: main4.value.level });
if (main5.value) allCompetency.push({ level: main5.value.level });
if (main.value) allCompetency.push(main.value);
if (main2.value) allCompetency.push(main2.value);
if (main3.value) allCompetency.push(main3.value);
if (main4.value) allCompetency.push(main4.value);
if (main5.value) allCompetency.push(main5.value);
const assign_director = [
{
@ -603,8 +641,8 @@ function putDataEdit(id: string) {
assign_jobs: assign_job.filter((item) => item !== null),
other_desc: OtherLaw.value,
assign_skill: allSkills,
assign_competency: allCompetency,
assign_competency_group: allGroup,
assign_competency: assign_competencyMain.value,
assign_competency_group: assign_competencyGroupMain.value,
other4_desc: Other.value,
other5_no1_desc: Other5.value,
assign_outputs: Productivity_assign.filter((item) => item !== null),
@ -668,12 +706,7 @@ function putData(id: string) {
if (skill3.value) allSkills.push({ level: skill3.value.level });
if (skill4.value) allSkills.push({ level: skill4.value.level });
const allCompetency = [];
if (main.value) allCompetency.push({ level: main.value.level });
if (main2.value) allCompetency.push({ level: main2.value.level });
if (main3.value) allCompetency.push({ level: main3.value.level });
if (main4.value) allCompetency.push({ level: main4.value.level });
if (main5.value) allCompetency.push({ level: main5.value.level });
const allCompetency = assign_competencyMain.value;
const assign_director = [
{
@ -743,8 +776,8 @@ function putData(id: string) {
assign_jobs: assign_job.filter((item) => item !== null),
other_desc: OtherLaw.value,
assign_skill: allSkills,
assign_competency: allCompetency,
assign_competency_group: allGroup,
assign_competency: assign_competencyMain.value,
assign_competency_group: assign_competencyGroupMain.value,
other4_desc: Other.value,
other5_no1_desc: Other5.value,
assign_outputs: Productivity_assign.filter((item) => item !== null),
@ -768,13 +801,17 @@ function putData(id: string) {
* @param id personal id
*/
async function saveData(id: string) {
await myForm.value.validate().then((result: boolean) => {
if (result) {
dialogConfirm($q, async () => await DataSave(id));
} else {
dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
}
});
console.log("tests");
const data = putData(id);
console.log("data==>", data);
// await myForm.value.validate().then((result: boolean) => {
// if (result) {
dialogConfirm($q, async () => await DataSave(id));
// } else {
// dialogMessageNotify($q, "");
// }
// });
}
/**
@ -1006,12 +1043,12 @@ function filterFnChairman(val: string, update: any) {
/** เมื่อโหลดหน้า เรียกใช้งานฟังชั่น */
onMounted(async () => {
await getUser();
await getAssignNew(personalId);
await getLaw(personalId);
await getcompetency(personalId);
await getCompetencyGroup(personalId);
await getSkill(personalId);
await getKnowledge(personalId);
await getAssignNew(personalId);
await getcompetency(personalId);
await getCompetencyGroup(personalId);
if (assignId.value !== undefined) {
await getAssign();
}
@ -1019,7 +1056,11 @@ onMounted(async () => {
</script>
<template>
<q-form ref="myForm">
<q-form
greedy
@submit.prevent
@validation-success="assignId !== undefined ? saveEdit(assignId) : saveData(personalId)"
>
<div class="q-pa-sm">
<div class="toptitle text-dark col-12 row items-center">
<q-btn
@ -1098,14 +1139,14 @@ onMounted(async () => {
>
<q-tooltip>ยกเล</q-tooltip>
</q-btn>
<!-- @click="saveEdit(assignId)" -->
<q-btn
dense
flat
class="q-ml-md"
round
color="public"
@click="saveEdit(assignId)"
type="submit"
icon="mdi-content-save-outline"
>
<q-tooltip>นทกขอม</q-tooltip>
@ -1820,8 +1861,10 @@ onMounted(async () => {
<div class="col-12 row q-col-gutter-sm">
<div class="col-xs-12 col-sm-6">
<q-select
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๑ ${item.description}`
"
option-value="id"
hide-bottom-space
@ -1838,19 +1881,21 @@ onMounted(async () => {
v-model="main"
label="ตัวที่ 1"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
<div class="col-xs-12 col-sm-6">
<q-select
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๑ ${item.description}`
"
option-value="id"
hide-bottom-space
@ -1867,19 +1912,21 @@ onMounted(async () => {
v-model="main2"
label="ตัวที่ 2"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
<div class="col-xs-12 col-sm-6">
<q-select
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๑ ${item.description}`
"
option-value="id"
hide-bottom-space
@ -1896,19 +1943,21 @@ onMounted(async () => {
v-model="main3"
label="ตัวที่ 3"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
<div class="col-xs-12 col-sm-6">
<q-select
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๑ ${item.description}`
"
option-value="id"
hide-bottom-space
@ -1925,13 +1974,13 @@ onMounted(async () => {
v-model="main4"
label="ตัวที่ 4"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
<div class="col-xs-12 col-sm-6">
@ -1941,8 +1990,10 @@ onMounted(async () => {
:options="
filterMain(OPmain, [main, main2, main3, main4])
"
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๑ ${item.description}`
"
option-value="id"
class="bg-white"
@ -1954,13 +2005,13 @@ onMounted(async () => {
v-model="main5"
label="ตัวที่ 5"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
</div>
</div>
@ -1970,8 +2021,10 @@ onMounted(async () => {
<div class="col-12 row q-col-gutter-sm">
<div class="col-xs-12 col-sm-6">
<q-select
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๒ ${item.description}`
"
option-value="id"
hide-bottom-space
@ -1988,19 +2041,21 @@ onMounted(async () => {
v-model="group"
label="ตัวที่ 1"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
<div class="col-xs-12 col-sm-6">
<q-select
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๒ ${item.description}`
"
option-value="id"
hide-bottom-space
@ -2017,19 +2072,21 @@ onMounted(async () => {
v-model="group2"
label="ตัวที่ 2"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
<div class="col-xs-12 col-sm-6">
<q-select
:options-html="true"
:option-label="
(item) => `${item.title} - ${item.description}`
(item) =>
`${item.name} - ระดับ:๒ ${item.description}`
"
option-value="id"
map-options
@ -2046,13 +2103,13 @@ onMounted(async () => {
v-model="group3"
label="ตัวที่ 3"
>
<template v-slot:selected-item="scope">
<!-- <template v-slot:selected-item="scope">
<div class="ellipsis-2-lines">
{{ scope.opt.title }} -
{{ scope.opt.description }}
</div>
</template></q-select
>
</template> -->
</q-select>
</div>
</div>
</div>
@ -2827,13 +2884,11 @@ onMounted(async () => {
v-show="routeName == 'probationWorkAdd'"
class="flex justify-end q-pa-sm q-gutter-sm"
>
<q-btn
unelevated
label="บันทึก"
color="public"
@click="saveData(personalId)"
/>
<q-btn unelevated label="บันทึก" type="submit" color="public"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</div>
<!-- @click="saveData(personalId)" -->
</div>
</div>
</q-form>

View file

@ -19,7 +19,9 @@ interface officerType {
isActive: boolean;
dateEnd: string;
dateStart: string;
dateRepatriation: Date
dateRepatriation: Date;
posTypeName?: string;
posLevelName?: string;
}
interface ResponseData {
data: {
@ -44,7 +46,9 @@ interface ResponseData {
positionNumberOld: string;
organizationPositionOld: string;
isActive: boolean;
dateRepatriation: Date
dateRepatriation: Date;
posTypeName: string;
posLevelName: string;
};
};
}
@ -71,11 +75,9 @@ interface resHelpDetail {
positionNumberOld: string;
organizationPositionOld: string;
isActive: boolean;
posTypeName: string;
posLevelName: string;
};
};
}
export type {
officerType,
ResponseData,
resHelpDetail
};
export type { officerType, ResponseData, resHelpDetail };

View file

@ -224,7 +224,7 @@ function formBmaofficer(val: string) {
switch (val) {
case "OFFICER":
return "ขรก.กทม. สามัญ";
case "EMPLOYEE_PERM":
case "EMPLOYEE":
return "ลูกจ้างประจำ";
case "EMPLOYEE_TEMP":
return "ลูกจ้างชั่วคราว";

View file

@ -922,6 +922,62 @@ export const useCounterMixin = defineStore("mixin", () => {
return daydiff;
}
function findOrgName(obj: any) {
if (obj) {
let name =
obj.child4 != null && obj.child3 != null
? obj.child4 + "/"
: obj.child4 != null
? obj.child4
: "";
name +=
obj.child3 != null && obj.child2 != null
? obj.child3 + "/"
: obj.child3 !== null
? obj.child3
: "";
name +=
obj.child2 != null && obj.child1 != null
? obj.child2 + "/"
: obj.child2 != null
? obj.child2
: "";
name +=
obj.child1 != null && obj.root != null
? obj.child1 + "/"
: obj.child1 != null
? obj.child1
: "";
name += obj.root != null ? obj.root : "";
return name == "" ? "-" : name;
} else {
return "";
}
}
function findPosMasterNo(obj: any) {
if (obj) {
let shortName =
(obj.child4ShortName != null
? obj.child4ShortName
: obj.child3ShortName != null
? obj.child3ShortName
: obj.child2ShortName != null
? obj.child2ShortName
: obj.child1ShortName != null
? obj.child1ShortName
: obj.rootShortName != null
? obj.rootShortName
: "") + (obj.posMasterNo != null ? obj.posMasterNo : "");
return shortName == "" ? "-" : shortName;
} else {
return "";
}
}
return {
calAge,
date2Thai,
@ -959,5 +1015,7 @@ export const useCounterMixin = defineStore("mixin", () => {
convertDate,
convertDateDisplay,
diffDay,
findOrgName,
findPosMasterNo,
};
});