Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-06-07 09:43:37 +07:00
commit 56452db4e7
20 changed files with 642 additions and 443 deletions

View file

@ -60,6 +60,8 @@ export default {
// clear Position // clear Position
clearPosition: (personalId: string) => clearPosition: (personalId: string) =>
`${placement}/position/clear/${personalId}`, `${placement}/position/clear/${personalId}`,
clearDate: (personalId: string) =>
`${placement}/date/update/${personalId}`,
// Document // Document
documentByid: (personalId: string) => `${placement}/doc/${personalId}`, documentByid: (personalId: string) => `${placement}/doc/${personalId}`,
documentDelid: (personalId: string, docid: string) => documentDelid: (personalId: string, docid: string) =>

View file

@ -154,6 +154,14 @@ const menuList = readonly<any[]>([
path: "registryNew", path: "registryNew",
role: "organization", role: "organization",
}, },
{
key: 4,
icon: "o_contact_page",
activeIcon: "registry_employee_page",
label: "ทะเบียนประวัติลูกจ้าง",
path: "registry-employee",
role: "registryEmployee",
},
{ {
key: 4, key: 4,
icon: "verified", icon: "verified",
@ -665,14 +673,6 @@ const menuList = readonly<any[]>([
path: "registry", path: "registry",
role: "registry", role: "registry",
}, },
{
key: 13.0,
icon: "o_contact_page",
activeIcon: "registry_employee_page",
label: "ทะเบียนประวัติลูกจ้าง",
path: "registry-employee",
role: "registryEmployee",
},
], ],
}, },
]); ]);

View file

@ -158,6 +158,10 @@ const visibleColumns = ref<string[]>([
function closeDialog() { function closeDialog() {
dialog.value = false; dialog.value = false;
name.value = "";
isActive.value = false;
shortName.value = "";
note.value = "";
} }
function validateForm() { function validateForm() {
@ -210,7 +214,7 @@ async function addData() {
name: name.value, name: name.value,
isActive: isActive.value, isActive: isActive.value,
shortName: shortName.value, shortName: shortName.value,
note: note.value == "" ? "-" : note.value, note: note.value == "" || note.value == null ? "" : note.value,
insigniaTypeId: id.value, insigniaTypeId: id.value,
}) })
.then(() => { .then(() => {
@ -226,12 +230,14 @@ async function addData() {
} }
async function editData(idData: string) { async function editData(idData: string) {
console.log(note.value);
await http await http
.put(config.API.insigniaNewIdOrg(idData), { .put(config.API.insigniaNewIdOrg(idData), {
name: name.value, name: name.value,
isActive: isActive.value, isActive: isActive.value,
shortName: shortName.value, shortName: shortName.value,
note: note.value == "" ? "-" : note.value, note: note.value == "" || note.value == null ? "" : note.value,
insigniaTypeId: id.value, insigniaTypeId: id.value,
}) })
.then(() => { .then(() => {
@ -403,101 +409,105 @@ const dialogOrder = ref<boolean>(false);
</q-tr> </q-tr>
</template> </template>
</d-table> </d-table>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="min-width: 350px">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="q-pa-none">
<div class="col-12 q-ma-md">
<q-input
outlined
:model-value="insigniaTypeId"
label="ลำดับชั้นเครื่องราชฯ"
dense
lazy-rules
borderless
hide-bottom-space
readonly
/>
</div>
<div class="col-12 q-ma-md">
<q-input
ref="nameRef"
outlined
v-model="name"
label="ชื่อเครื่องราชฯ"
dense
lazy-rules
borderless
:rules="[
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
]"
hide-bottom-space
/>
</div>
<div class="col-12 q-ma-md">
<q-input
ref="shortNameRef"
outlined
v-model="shortName"
label="ชื่อย่อ"
dense
lazy-rules
borderless
:rules="[
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
]"
hide-bottom-space
/>
</div>
<div class="col-12 q-ma-md">
<q-input
outlined
v-model="note"
label="หมายเหตุ"
dense
type="textarea"
borderless
hide-bottom-space
/>
</div>
<div
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
>
<div class="row items-center q-my-sm justify-between">
<p class="q-ma-none">สถานะการใชงาน</p>
<label class="toggle-control">
<input type="checkbox" dense v-model="isActive" @change="" />
<span class="control"></span>
</label>
</div>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</div> </div>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="min-width: 350px">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="q-pa-none">
<div class="col-12 q-ma-md">
<q-input
outlined
:model-value="insigniaTypeId"
label="ลำดับชั้นเครื่องราชฯ"
dense
lazy-rules
borderless
hide-bottom-space
readonly
class="inputgreen"
/>
</div>
<div class="col-12 q-ma-md">
<q-input
ref="nameRef"
outlined
v-model="name"
label="ชื่อเครื่องราชฯ"
dense
lazy-rules
borderless
:rules="[
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
]"
hide-bottom-space
class="inputgreen"
/>
</div>
<div class="col-12 q-ma-md">
<q-input
ref="shortNameRef"
outlined
v-model="shortName"
label="ชื่อย่อ"
dense
lazy-rules
borderless
:rules="[
(val) => val.length > 0 || 'กรุณากรอกลำดับชั้นเครื่องราชฯ',
]"
hide-bottom-space
class="inputgreen"
/>
</div>
<div class="col-12 q-ma-md">
<q-input
outlined
v-model="note"
label="หมายเหตุ"
dense
type="textarea"
borderless
hide-bottom-space
class="inputgreen"
/>
</div>
<div
class="col q-ma-md q-pa-sm bg-white border_custom text-weight-medium"
>
<div class="row items-center q-my-sm justify-between">
<p class="q-ma-none">สถานะการใชงาน</p>
<label class="toggle-control">
<input type="checkbox" dense v-model="isActive" @change="" />
<span class="control"></span>
</label>
</div>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View file

@ -181,7 +181,6 @@ function copyDetiail(data: RowDetailPositions) {
* @param data อมลตำแหน * @param data อมลตำแหน
*/ */
function editDetiail(data: RowDetailPositions) { function editDetiail(data: RowDetailPositions) {
console.log(data);
formPositionSelect.positionId = data.id; formPositionSelect.positionId = data.id;
formPositionSelect.posTypeId = data.posTypeId; formPositionSelect.posTypeId = data.posTypeId;
formPositionSelect.positionName = data.positionName; formPositionSelect.positionName = data.positionName;

View file

@ -162,6 +162,8 @@ onMounted(async () => {
function closeDialog() { function closeDialog() {
dialog.value = false; dialog.value = false;
posTypeName.value = "";
posTypeRank.value = null;
} }
function onclickDetail(id: string) { function onclickDetail(id: string) {
@ -322,6 +324,7 @@ async function onSubmit() {
borderless borderless
:rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']" :rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']"
hide-bottom-space hide-bottom-space
class="inputgreen"
/> />
</div> </div>
<div class="col-12 q-ma-md"> <div class="col-12 q-ma-md">
@ -337,6 +340,7 @@ async function onSubmit() {
:rules="[(val) => val != undefined || 'กรุณากรอกระดับตำแหน่ง']" :rules="[(val) => val != undefined || 'กรุณากรอกระดับตำแหน่ง']"
hide-bottom-space hide-bottom-space
mask="############" mask="############"
class="inputgreen"
/> />
</div> </div>
</q-card-section> </q-card-section>

View file

@ -374,102 +374,106 @@ onMounted(async () => {
</q-tr> </q-tr>
</template> </template>
</d-table> </d-table>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="width: 350px">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="row q-gutter-y-md">
<div class="col-12">
<q-input
outlined
ref="posLevelNameRef"
v-model="posLevelName"
label="ชื่อระดับตำแหน่ง"
dense
lazy-rules
borderless
bg-color="white"
hide-bottom-space
:rules="[(val) => val.length > 0 || 'กรุณากรอกระดับตำแหน่ง']"
/>
</div>
<div class="col-12">
<q-input
ref="posLevelRankRef"
outlined
v-model="posLevelRank"
label="ระดับ"
dense
lazy-rules
borderless
min="1"
bg-color="white"
:rules="[(val) => val > 0 || 'กรุณากรอกระดับ']"
hide-bottom-space
mask="############"
/>
</div>
<div class="col-12">
<q-select
ref="posLevelAuthorityRef"
outlined
v-model="posLevelAuthority"
emit-value
map-options
:options="storeOption.posLevelAuthorityOption"
option-value="id"
label="ผู้มีอำนาจสั่งบรรจุ"
dense
lazy-rules
:rules="[(val) => !!val || 'กรุณาเลือกผู้มีอำนาจสั่งบรรจุ']"
borderless
bg-color="white"
hide-bottom-space
/>
</div>
<div class="col-12">
<q-select
ref="posTypeIdRef"
v-model="posName"
label="ประเภทตำแหน่ง"
outlined
dense
bg-color="white"
options-cover
hide-bottom-space
readonly
/>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</div> </div>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="width: 350px">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="row q-gutter-y-md">
<div class="col-12">
<q-input
outlined
ref="posLevelNameRef"
v-model="posLevelName"
label="ชื่อระดับตำแหน่ง"
dense
lazy-rules
borderless
bg-color="white"
hide-bottom-space
:rules="[(val) => val.length > 0 || 'กรุณากรอกระดับตำแหน่ง']"
class="inputgreen"
/>
</div>
<div class="col-12">
<q-input
ref="posLevelRankRef"
outlined
v-model="posLevelRank"
label="ระดับ"
dense
lazy-rules
borderless
min="1"
bg-color="white"
:rules="[(val) => val > 0 || 'กรุณากรอกระดับ']"
hide-bottom-space
mask="############"
class="inputgreen"
/>
</div>
<div class="col-12">
<q-select
ref="posLevelAuthorityRef"
outlined
v-model="posLevelAuthority"
emit-value
map-options
:options="storeOption.posLevelAuthorityOption"
option-value="id"
label="ผู้มีอำนาจสั่งบรรจุ"
dense
lazy-rules
:rules="[(val) => !!val || 'กรุณาเลือกผู้มีอำนาจสั่งบรรจุ']"
borderless
bg-color="white"
hide-bottom-space
class="inputgreen"
/>
</div>
<div class="col-12">
<q-select
ref="posTypeIdRef"
v-model="posName"
label="ประเภทตำแหน่ง"
outlined
dense
bg-color="white"
options-cover
hide-bottom-space
readonly
class="inputgreen"
/>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View file

@ -39,7 +39,7 @@ const props = defineProps({
const { dialogConfirm, showLoader, success, hideLoader, messageError } = const { dialogConfirm, showLoader, success, hideLoader, messageError } =
useCounterMixin(); useCounterMixin();
const isReadonly = ref<boolean>(false); // const isReadonly = ref<boolean>(true); //
const modal = defineModel<boolean>("addPosition", { required: true }); const modal = defineModel<boolean>("addPosition", { required: true });
const formData = defineModel<any>("formData", { required: true }); const formData = defineModel<any>("formData", { required: true });
const editCheck = defineModel<boolean>("editCheck", { required: true }); const editCheck = defineModel<boolean>("editCheck", { required: true });
@ -85,8 +85,6 @@ function validateFormPositionEdit() {
/** ฟังชั่น บันทึก */ /** ฟังชั่น บันทึก */
function saveSelectEdit() { function saveSelectEdit() {
console.log(formPositionSelect.positionExecutive);
console.log(formPositionSelect.positionArea);
dialogConfirm( dialogConfirm(
$q, $q,
async () => { async () => {
@ -197,7 +195,9 @@ async function fetchType() {
messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
hideLoader(); setTimeout(() => {
hideLoader();
}, 1000);
}); });
} }
@ -217,7 +217,9 @@ async function fetchExecutive() {
messageError($q, err); messageError($q, err);
}) })
.finally(() => { .finally(() => {
hideLoader(); setTimeout(() => {
hideLoader();
}, 1000);
}); });
} }
@ -227,7 +229,7 @@ watch(
if (modal.value == true) { if (modal.value == true) {
fetchType(); fetchType();
fetchExecutive(); fetchExecutive();
if (formData.value) { if (editCheck.value) {
const dataList = formData.value; const dataList = formData.value;
setTimeout(() => { setTimeout(() => {
updateSelectType(dataList.posTypeId); updateSelectType(dataList.posTypeId);
@ -259,6 +261,7 @@ function updateSelectType(val: string) {
function close() { function close() {
modal.value = false; modal.value = false;
editCheck.value = false; editCheck.value = false;
clearFormPositionSelect();
} }
</script> </script>
@ -386,7 +389,11 @@ function close() {
</div> </div>
<div class="col-6 self-center"> <div class="col-6 self-center">
<q-checkbox size="md" v-model="isSpecial" label="เฉพาะสายงานที่กำหนด" /> <q-checkbox
size="md"
v-model="isSpecial"
label="เฉพาะสายงานที่กำหนด"
/>
</div> </div>
</div> </div>
</q-card-section> </q-card-section>

View file

@ -190,7 +190,7 @@ watch(
<template> <template>
<div class="col-12 row q-pb-sm q-col-gutter-sm items-center"> <div class="col-12 row q-pb-sm q-col-gutter-sm items-center">
<div> <div v-if="empType === 'officer'">
<q-btn <q-btn
round round
flat flat

View file

@ -17,7 +17,7 @@ export const useRegistryNewDataStore = defineStore("registryNew", () => {
const employeeClassOps = ref<DataOption[]>([ const employeeClassOps = ref<DataOption[]>([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" }, { id: "officer", name: "ข้าราชการ กทม.สามัญ" },
{ id: "perm", name: "ลูกจ้างประจำ" }, { id: "perm", name: "ลูกจ้างประจำ" },
{ id: "temp", name: "ลูกจ้างชั่วคราว" }, // { id: "temp", name: "ลูกจ้างชั่วคราว" },
]); ]);
const posTypeOps = ref<DataOption[]>([]); const posTypeOps = ref<DataOption[]>([]);
const posTypeMain = ref<DataType[]>([]); const posTypeMain = ref<DataType[]>([]);

View file

@ -48,43 +48,43 @@ let dataForm = reactive({
}); });
onMounted(async () => { onMounted(async () => {
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
}); });
const fetchPublishFile = async () => { // const fetchPublishFile = async () => {
await http // await http
.get(config.API.getPublishFileHistory) // .get(config.API.getPublishFileHistory)
.then((res) => { // .then((res) => {
let data = res.data.result; // let data = res.data.result;
selectedFile.value = data[0].fileName; // selectedFile.value = data[0].fileName;
}) // })
.catch((e) => { // .catch((e) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(async () => { // .finally(async () => {
hideLoader(); // hideLoader();
}); // });
}; // };
// json // json
const loadTreeData = async () => { // const loadTreeData = async () => {
expanded.value = []; // expanded.value = [];
await http // await http
.get(`${config.s3ClusterUrl}${selectedFile.value}`) // .get(`${config.s3ClusterUrl}${selectedFile.value}`)
.then((res: any) => { // .then((res: any) => {
treeData.value = res.data; // treeData.value = res.data;
dataRespone.value = res.data; // dataRespone.value = res.data;
// Filter objects with "name" null // // Filter objects with "name" null
const filteredData = res.data.filter(filterByPersonIdNull); // const filteredData = res.data.filter(filterByPersonIdNull);
treeData.value = filteredData; // treeData.value = filteredData;
}) // })
.catch((e: any) => { // .catch((e: any) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(() => { // .finally(() => {
hideLoader(); // hideLoader();
}); // });
}; // };
function filterByPersonIdNull(obj: any) { function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) { if (obj.name === null && obj.isCondition != true) {
return true; return true;
@ -171,8 +171,8 @@ const saveAppoint = async () => {
}) })
.finally(async () => { .finally(async () => {
await closeAndClear(); await closeAndClear();
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
hideLoader(); hideLoader();
}); });

View file

@ -47,42 +47,41 @@ let dataForm = reactive({
positionTypeId: "", positionTypeId: "",
}); });
const fetchPublishFile = async () => { // const fetchPublishFile = async () => {
await http // await http
.get(config.API.getPublishFileHistory) // .get(config.API.getPublishFileHistory)
.then((res) => { // .then((res) => {
let data = res.data.result; // let data = res.data.result;
selectedFile.value = data[0].fileName; // selectedFile.value = data[0].fileName;
}) // })
.catch((e) => { // .catch((e) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(async () => { // .finally(async () => {
hideLoader(); // hideLoader();
}); // });
}; // };
// json // json
// const loadTreeData = async () => {
// expanded.value = [];
// await http
// .get(`${config.s3ClusterUrl}${selectedFile.value}`)
// .then((res: any) => {
// treeData.value = res.data;
// dataRespone.value = res.data;
const loadTreeData = async () => { // // Filter objects with "name" null
expanded.value = []; // const filteredData = res.data.filter(filterByPersonIdNull);
await http // treeData.value = filteredData;
.get(`${config.s3ClusterUrl}${selectedFile.value}`) // })
.then((res: any) => { // .catch((e: any) => {
treeData.value = res.data; // messageError($q, e);
dataRespone.value = res.data; // })
// .finally(() => {
// Filter objects with "name" null // hideLoader();
const filteredData = res.data.filter(filterByPersonIdNull); // });
treeData.value = filteredData; // };
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
function filterByPersonIdNull(obj: any) { function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) { if (obj.name === null && obj.isCondition != true) {
@ -177,8 +176,8 @@ const saveAppoint = async () => {
}) })
.finally(async () => { .finally(async () => {
await closeAndClear(); await closeAndClear();
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
hideLoader(); hideLoader();
}); });
@ -393,8 +392,8 @@ function findByPerson(element: any): any {
} }
onMounted(async () => { onMounted(async () => {
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
// await fetchplacementPosition(); // await fetchplacementPosition();
}); });
</script> </script>

View file

@ -258,26 +258,23 @@ const openModalTree = (data: any, type: string) => {
posLevel.value = data.positionLevelOld; posLevel.value = data.positionLevelOld;
position.value = data.positionOld; position.value = data.positionOld;
}; };
// //
const clickDelete = (id: string) => { const clickDelete = (id: string) => {
dialogRemove($q, () => deleteAppoint(id)); dialogRemove($q, () => {
}; showLoader();
http
// .delete(config.API.appointmentDelete(id))
const deleteAppoint = async (id: string) => { .then(() => {
showLoader(); success($q, "ลบข้อมูลสำเร็จ");
await http })
.delete(config.API.appointmentDelete(id)) .catch((e) => {
.then(() => { messageError($q, e);
success($q, "ลบข้อมูลสำเร็จ"); })
}) .finally(() => {
.catch((e) => { fecthlistappointment();
messageError($q, e); hideLoader();
}) });
.finally(() => { });
fecthlistappointment();
hideLoader();
});
}; };
// //
@ -546,7 +543,7 @@ onMounted(() => {
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
@click="clickDelete(props.row.personalId)" @click="clickDelete(props.row.id)"
> >
<q-item-section <q-item-section
style="min-width: 0px" style="min-width: 0px"

View file

@ -198,11 +198,13 @@ async function fetchPosFind(level: number, id: string) {
.post(config.API.orgPosFind, body) .post(config.API.orgPosFind, body)
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
console.log(data);
expanded.value = data; expanded.value = data;
nodeId.value = id; nodeId.value = id;
positionId.value = props?.dataRow?.posmasterId; positionId.value = props?.dataRow?.posmasterId;
seletcId.value = props?.dataRow?.positionId; seletcId.value = props?.dataRow?.positionId;
datePos.value = props?.dataRow?.reportingDateFullDate; datePos.value = props?.dataRow?.reportingDate;
fetchDataTable(nodeId.value, level); fetchDataTable(nodeId.value, level);
}) })
@ -277,7 +279,10 @@ watch(
async () => { async () => {
if (modal.value) { if (modal.value) {
await fetchOrganizationActive(); await fetchOrganizationActive();
console.log(props?.dataRow);
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) { if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId); await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
} else { } else {
expanded.value = []; expanded.value = [];

View file

@ -61,41 +61,41 @@ let dataForm = reactive({
}); });
/** ฟังชั่น get file*/ /** ฟังชั่น get file*/
async function fetchPublishFile() { // async function fetchPublishFile() {
await http // await http
.get(config.API.getPublishFileHistory) // .get(config.API.getPublishFileHistory)
.then((res) => { // .then((res) => {
let data = res.data.result; // let data = res.data.result;
selectedFile.value = data[0].fileName; // selectedFile.value = data[0].fileName;
}) // })
.catch((e) => { // .catch((e) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(async () => { // .finally(async () => {
hideLoader(); // hideLoader();
}); // });
} // }
/** โหลดข้อมูลโครงสร้างจาก json */ /** โหลดข้อมูลโครงสร้างจาก json */
const loadTreeData = async () => { // const loadTreeData = async () => {
expanded.value = []; // expanded.value = [];
await http // await http
.get(`${config.s3ClusterUrl}${selectedFile.value}`) // .get(`${config.s3ClusterUrl}${selectedFile.value}`)
.then((res: any) => { // .then((res: any) => {
treeData.value = res.data; // treeData.value = res.data;
dataRespone.value = res.data; // dataRespone.value = res.data;
// Filter objects with "name" null // // Filter objects with "name" null
const filteredData = res.data.filter(filterByPersonIdNull); // const filteredData = res.data.filter(filterByPersonIdNull);
treeData.value = filteredData; // treeData.value = filteredData;
}) // })
.catch((e: any) => { // .catch((e: any) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(() => { // .finally(() => {
hideLoader(); // hideLoader();
}); // });
}; // };
/** /**
* งกนกรองขอมลท personId เป null * งกนกรองขอมลท personId เป null
@ -202,8 +202,8 @@ async function saveAppoint() {
}) })
.finally(async () => { .finally(async () => {
await closeAndClear(); await closeAndClear();
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
hideLoader(); hideLoader();
}); });
@ -419,8 +419,8 @@ watch(props, () => {
}); });
onMounted(async () => { onMounted(async () => {
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
}); });
</script> </script>

View file

@ -83,6 +83,7 @@ const {
dateText, dateText,
success, success,
dialogConfirm, dialogConfirm,
date2Thai,
} = mixin; } = mixin;
const route = useRoute(); const route = useRoute();
@ -239,9 +240,9 @@ function convertContainStatus(val: string, type: string = "") {
case "UN-CONTAIN": case "UN-CONTAIN":
return "ยังไม่บรรจุ"; return "ยังไม่บรรจุ";
case "PREPARE-CONTAIN": case "PREPARE-CONTAIN":
return "เตรียม" + (type != "" ? type : "บรรจุ"); return "เตรียม" + (!type ? type : "บรรจุ");
case "CONTAIN": case "CONTAIN":
return (type != "" ? type : "บรรจุ") + "แล้ว"; return (!type ? type : "บรรจุ") + "แล้ว";
case "DISCLAIM": case "DISCLAIM":
return "สละสิทธิ์"; return "สละสิทธิ์";
default: default:
@ -336,6 +337,7 @@ async function getTable() {
posLevelCandidateId: data.posLevelCandidateId, posLevelCandidateId: data.posLevelCandidateId,
posLevelCandidateName: data.posLevelCandidateName, posLevelCandidateName: data.posLevelCandidateName,
posmasterId: data.posmasterId, posmasterId: data.posmasterId,
statusNameCheck: convertContainStatus(data.statusId),
statusName: statusName:
convertContainStatus(data.statusId) + convertContainStatus(data.statusId) +
@ -357,18 +359,18 @@ async function getTable() {
}); });
// //
rows.value = roleAdmin.value rows.value = await (roleAdmin.value
? rowsAll.value ? rowsAll.value
: rowsAll.value.filter((x: any) => x.statusId !== "CONTAIN"); : rowsAll.value.filter((x: any) => x.statusId !== "CONTAIN"));
// //
rowsFilter.value = rows.value.filter( rowsFilter.value = await rows.value.filter(
(e: any) => (e: any) =>
e.draft == "รอส่งตัว" && e.draft == "รอส่งตัว" &&
e.positionNumber !== null && e.nodeName !== null &&
e.statusName == "เตรียมบรรจุ" e.reportingDate !== null
); );
insertAvatar(rowsAll.value); insertAvatar(rows.value);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -390,13 +392,13 @@ function insertAvatar(items: any) {
) )
) )
.then((img) => { .then((img) => {
rowsAll.value[index] = { rows.value[index] = {
...x, ...x,
avatar: img.data.downloadUrl, avatar: img.data.downloadUrl,
}; };
}) })
.catch(() => { .catch(() => {
rowsAll.value[index] = { rows.value[index] = {
...x, ...x,
avatar: avatar, avatar: avatar,
}; };
@ -623,6 +625,7 @@ async function clickClose() {
modalDefermentDisclaim.value = false; modalDefermentDisclaim.value = false;
modalwaitInfo.value = false; modalwaitInfo.value = false;
modal.value = false; modal.value = false;
modalDate.value = false;
} }
} }
@ -677,6 +680,59 @@ watch(containStatus, () => {
} }
}); });
function onRestorePos(id: string) {
dialogConfirm(
$q,
async () => {
showLoader();
await http
.post(config.API.clearPosition(id), {})
.then(() => {
success($q, "คืนตำแหน่งสำเร็จ");
getTable();
props.statCard();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
},
"ยืนยันการคืนตำแหน่ง",
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
);
}
const modalDate = ref<boolean>(false);
const reportingDate = ref<Date | null>(null);
const rowId = ref<string>("");
function onSelectDate(id: string, date: Date) {
modalDate.value = true;
rowId.value = id;
reportingDate.value = date;
}
function onSubmitDate() {
dialogConfirm($q, () => {
showLoader();
http
.put(config.API.clearDate(rowId.value), { date: reportingDate.value })
.then(() => {
getTable();
props.statCard();
success($q, "บันทึกข้อมูลสำเร็จ");
modalDate.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
});
}
onMounted(async () => { onMounted(async () => {
if (keycloak.tokenParsed != null) { if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1"); roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
@ -830,7 +886,7 @@ onMounted(async () => {
</q-td> </q-td>
<q-td auto-width> <q-td auto-width>
<q-btn <q-btn
v-if="roleAdmin && props.row.statusId !== 'CONTAIN'" v-if="props.row.statusId !== 'CONTAIN'"
icon="mdi-dots-vertical" icon="mdi-dots-vertical"
size="12px" size="12px"
color="grey-7" color="grey-7"
@ -842,9 +898,9 @@ onMounted(async () => {
<q-list dense style="min-width: 100px"> <q-list dense style="min-width: 100px">
<q-item <q-item
v-if=" v-if="
(roleAdmin && props.row.statusId === 'UN-CONTAIN') || roleAdmin &&
(props.row.draft === 'รอส่งตัว' && props.row.draft !== 'ส่งตัวแล้ว' &&
props.row.statusId !== 'DISCLAIM') props.row.statusId !== 'DISCLAIM'
" "
clickable clickable
v-close-popup v-close-popup
@ -873,11 +929,61 @@ onMounted(async () => {
</q-item> </q-item>
<q-item <q-item
v-if=" v-if="
(props.row.bmaOfficer !== 'บุคคลภายนอก' && roleAdmin &&
roleAdmin && props.row.draft === 'รอส่งตัว' &&
props.row.statusId === 'UN-CONTAIN') || props.row.nodeName !== null
(props.row.draft === 'รอส่งตัว' && "
props.row.statusId !== 'DISCLAIM') clickable
v-close-popup
@click="
onSelectDate(
props.row.personalId,
props.row.reportingDate
)
"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
color="blue-7"
size="xs"
name="mdi-calendar-account"
/>
</q-item-section>
<q-item-section>เลอกวนรายงานต</q-item-section>
</q-item>
<q-item
v-if="
roleAdmin &&
props.row.draft === 'รอส่งตัว' &&
props.row.nodeName !== null
"
clickable
v-close-popup
@click="onRestorePos(props.row.personalId)"
>
<q-item-section
style="min-width: 0px"
avatar
class="q-py-sm"
>
<q-icon
color="orange-7"
size="xs"
name="mdi-backup-restore"
/>
</q-item-section>
<q-item-section>นตำแหน</q-item-section>
</q-item>
<q-item
v-if="
props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin &&
props.row.draft !== 'ส่งตัวแล้ว' &&
props.row.statusId !== 'DISCLAIM'
" "
clickable clickable
v-close-popup v-close-popup
@ -905,11 +1011,10 @@ onMounted(async () => {
<q-item <q-item
v-if=" v-if="
(props.row.bmaOfficer !== 'บุคคลภายนอก' && props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin && roleAdmin &&
props.row.statusId === 'UN-CONTAIN') || props.row.draft !== 'ส่งตัวแล้ว' &&
(props.row.draft === 'รอส่งตัว' && props.row.statusId !== 'DISCLAIM'
props.row.statusId !== 'DISCLAIM')
" "
clickable clickable
v-close-popup v-close-popup
@ -933,11 +1038,10 @@ onMounted(async () => {
<q-item <q-item
v-if=" v-if="
(props.row.bmaOfficer !== 'บุคคลภายนอก' && props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin && roleAdmin &&
props.row.statusId === 'UN-CONTAIN') || props.row.draft !== 'ส่งตัวแล้ว' &&
(props.row.draft === 'รอส่งตัว' && props.row.statusId !== 'DISCLAIM'
props.row.statusId !== 'DISCLAIM')
" "
clickable clickable
v-close-popup v-close-popup
@ -1243,7 +1347,7 @@ onMounted(async () => {
:props="props" :props="props"
class="cursor-pointer" class="cursor-pointer"
> >
<template v-if="col.name === 'position'"> <template v-if="col.name === 'no'">
{{ props.rowIndex + 1 }} {{ props.rowIndex + 1 }}
</template> </template>
<template <template
@ -1252,8 +1356,13 @@ onMounted(async () => {
> >
<q-item v-ripple style="padding: 0"> <q-item v-ripple style="padding: 0">
<q-item-section avatar> <q-item-section avatar>
<q-avatar size="32px" color="grey-4"> <q-avatar size="30px" color="grey-4">
<q-img :src="props.row.avatar" class="photo-profile" /> <q-img
:src="props.row.avatar"
class="photo-profile"
v-if="props.row.avatar"
/>
<q-img :src="avatar" class="photo-profile" v-else"/>
</q-avatar> </q-avatar>
</q-item-section> </q-item-section>
@ -1396,6 +1505,67 @@ onMounted(async () => {
:fetchStatCard="statCard" :fetchStatCard="statCard"
:typeCommand="typeCommand" :typeCommand="typeCommand"
/> />
<!-- dialog นรายงานต-->
<q-dialog v-model="modalDate" persistent>
<q-card style="width: 500px; max-width: 300px">
<q-form
ref="myForm"
greedy
@submit.prevent
@validation-success="onSubmitDate"
>
<DialogHeader :tittle="`เลือกวันรายงานตัว`" :close="clickClose" />
<q-separator />
<q-card-section class="q-p-sm">
<datepicker
menu-class-name="modalfix"
v-model="reportingDate"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
:min-date="new Date()"
>
<template #year="{ year }">
{{ year + 543 }}
</template>
<template #year-overlay-value="{ value }">
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
ref="dateRef"
outlined
dense
hide-bottom-space
:model-value="
reportingDate != null ? date2Thai(reportingDate) : null
"
label="วันที่รายงานตัว"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
style="color: var(--q-primary)"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -118,40 +118,40 @@ let dataForm = reactive({
positionTypeId: "", positionTypeId: "",
}); });
const fetchPublishFile = async () => { // const fetchPublishFile = async () => {
await http // await http
.get(config.API.getPublishFileHistory) // .get(config.API.getPublishFileHistory)
.then((res) => { // .then((res) => {
let data = res.data.result; // let data = res.data.result;
selectedFile.value = data[0].fileName; // selectedFile.value = data[0].fileName;
}) // })
.catch((e) => { // .catch((e) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(async () => { // .finally(async () => {
hideLoader(); // hideLoader();
}); // });
}; // };
// json // json
const loadTreeData = async () => { // const loadTreeData = async () => {
expanded.value = []; // expanded.value = [];
await http // await http
.get(`${config.s3ClusterUrl}${selectedFile.value}`) // .get(`${config.s3ClusterUrl}${selectedFile.value}`)
.then((res: any) => { // .then((res: any) => {
treeData.value = res.data; // treeData.value = res.data;
dataRespone.value = res.data; // dataRespone.value = res.data;
// Filter objects with "name" null // // Filter objects with "name" null
const filteredData = res.data.filter(filterByPersonIdNull); // const filteredData = res.data.filter(filterByPersonIdNull);
treeData.value = filteredData; // treeData.value = filteredData;
}) // })
.catch((e: any) => { // .catch((e: any) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(() => { // .finally(() => {
hideLoader(); // hideLoader();
}); // });
}; // };
function filterByPersonIdNull(obj: any) { function filterByPersonIdNull(obj: any) {
if (obj.name === null && obj.isCondition != true) { if (obj.name === null && obj.isCondition != true) {
@ -234,8 +234,8 @@ const saveAppoint = async () => {
}) })
.finally(async () => { .finally(async () => {
await closeAndClear(); await closeAndClear();
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
// await fetchplacementPosition(); // await fetchplacementPosition();
hideLoader(); hideLoader();
}); });
@ -634,8 +634,8 @@ watch(
); );
onMounted(async () => { onMounted(async () => {
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); // await loadTreeData();
// await fetchplacementPosition(); // await fetchplacementPosition();
}); });
</script> </script>

View file

@ -43,24 +43,24 @@ let dataForm = reactive({
}); });
onMounted(async () => { onMounted(async () => {
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
}); });
const fetchPublishFile = async () => { // const fetchPublishFile = async () => {
await http // await http
.get(config.API.getPublishFileHistory) // .get(config.API.getPublishFileHistory)
.then((res) => { // .then((res) => {
let data = res.data.result; // let data = res.data.result;
selectedFile.value = data[0].fileName; // selectedFile.value = data[0].fileName;
}) // })
.catch((e) => { // .catch((e) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(async () => { // .finally(async () => {
hideLoader(); // hideLoader();
}); // });
}; // };
// json // json
const treeData = ref<Array<any>>([]); const treeData = ref<Array<any>>([]);
@ -192,7 +192,7 @@ const saveAppoint = async () => {
.finally(async () => { .finally(async () => {
await closeAndClear(); await closeAndClear();
// await resetFilter(); // await resetFilter();
await fetchPublishFile(); // await fetchPublishFile();
await loadTreeData(); await loadTreeData();
await fetchplacementPosition(); await fetchplacementPosition();
hideLoader(); hideLoader();

View file

@ -883,7 +883,7 @@ function removeFile(fileName: string) {
<q-card bordered class="row col-12 text-dark q-mt-sm"> <q-card bordered class="row col-12 text-dark q-mt-sm">
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"> <div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
<div class="q-pl-sm text-weight-bold text-dark"> <div class="q-pl-sm text-weight-bold text-dark">
ผลการพจารณาของการเจาหนาท ผลการพจารณาของการเจาหนาทของหนวยงาน
</div> </div>
</div> </div>
<q-separator /> <q-separator />

View file

@ -172,6 +172,7 @@ function fetchDataDetail(id: string) {
.then((res) => { .then((res) => {
const data: DataSholarship = res.data.result; const data: DataSholarship = res.data.result;
console.log(data); console.log(data);
formBody.profileId = data.profileId;
formBody.rank = data.rank; formBody.rank = data.rank;
formBody.prefix = data.prefix; formBody.prefix = data.prefix;
formBody.firstName = data.firstName; formBody.firstName = data.firstName;
@ -483,25 +484,25 @@ async function checkFileBackReceived(id: string) {
function downloadFileBackReceived() { function downloadFileBackReceived() {
showLoader(); showLoader();
if (scholarshipId.value !== null && fileBackReceived.value !== null) { if (scholarshipId.value !== null && fileBackReceived.value !== null) {
http http
.get( .get(
config.API.fileByFile( config.API.fileByFile(
"ระบบพัฒนาบุคคล", "ระบบพัฒนาบุคคล",
"ฟอร์มรายงานตัวกลับเข้ารับราชการ", "ฟอร์มรายงานตัวกลับเข้ารับราชการ",
scholarshipId.value, scholarshipId.value,
fileBackReceived.value fileBackReceived.value
)
) )
) .then((res) => {
.then((res) => { const data = res.data.downloadUrl;
const data = res.data.downloadUrl; window.open(data, "_blank");
window.open(data, "_blank"); })
}) .catch((e) => {
.catch((e) => { messageError($q, e);
messageError($q, e); })
}) .finally(async () => {
.finally(async () => { hideLoader();
hideLoader(); });
});
} }
} }

View file

@ -9,6 +9,7 @@ interface ListSholarship {
} }
interface DataSholarship { interface DataSholarship {
profileId: string
rank: string; //ยศ rank: string; //ยศ
prefix: string; //คำนำหน้าชื่อ prefix: string; //คำนำหน้าชื่อ
firstName: string; //ชื่อ firstName: string; //ชื่อ