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
clearPosition: (personalId: string) =>
`${placement}/position/clear/${personalId}`,
clearDate: (personalId: string) =>
`${placement}/date/update/${personalId}`,
// Document
documentByid: (personalId: string) => `${placement}/doc/${personalId}`,
documentDelid: (personalId: string, docid: string) =>

View file

@ -154,6 +154,14 @@ const menuList = readonly<any[]>([
path: "registryNew",
role: "organization",
},
{
key: 4,
icon: "o_contact_page",
activeIcon: "registry_employee_page",
label: "ทะเบียนประวัติลูกจ้าง",
path: "registry-employee",
role: "registryEmployee",
},
{
key: 4,
icon: "verified",
@ -665,14 +673,6 @@ const menuList = readonly<any[]>([
path: "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() {
dialog.value = false;
name.value = "";
isActive.value = false;
shortName.value = "";
note.value = "";
}
function validateForm() {
@ -210,7 +214,7 @@ async function addData() {
name: name.value,
isActive: isActive.value,
shortName: shortName.value,
note: note.value == "" ? "-" : note.value,
note: note.value == "" || note.value == null ? "" : note.value,
insigniaTypeId: id.value,
})
.then(() => {
@ -226,12 +230,14 @@ async function addData() {
}
async function editData(idData: string) {
console.log(note.value);
await http
.put(config.API.insigniaNewIdOrg(idData), {
name: name.value,
isActive: isActive.value,
shortName: shortName.value,
note: note.value == "" ? "-" : note.value,
note: note.value == "" || note.value == null ? "" : note.value,
insigniaTypeId: id.value,
})
.then(() => {
@ -403,101 +409,105 @@ const dialogOrder = ref<boolean>(false);
</q-tr>
</template>
</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>
<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>
<style scoped lang="scss">

View file

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

View file

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

View file

@ -374,102 +374,106 @@ onMounted(async () => {
</q-tr>
</template>
</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>
<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>
<style scoped lang="scss">

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -83,6 +83,7 @@ const {
dateText,
success,
dialogConfirm,
date2Thai,
} = mixin;
const route = useRoute();
@ -239,9 +240,9 @@ function convertContainStatus(val: string, type: string = "") {
case "UN-CONTAIN":
return "ยังไม่บรรจุ";
case "PREPARE-CONTAIN":
return "เตรียม" + (type != "" ? type : "บรรจุ");
return "เตรียม" + (!type ? type : "บรรจุ");
case "CONTAIN":
return (type != "" ? type : "บรรจุ") + "แล้ว";
return (!type ? type : "บรรจุ") + "แล้ว";
case "DISCLAIM":
return "สละสิทธิ์";
default:
@ -336,6 +337,7 @@ async function getTable() {
posLevelCandidateId: data.posLevelCandidateId,
posLevelCandidateName: data.posLevelCandidateName,
posmasterId: data.posmasterId,
statusNameCheck: convertContainStatus(data.statusId),
statusName:
convertContainStatus(data.statusId) +
@ -357,18 +359,18 @@ async function getTable() {
});
//
rows.value = roleAdmin.value
rows.value = await (roleAdmin.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.draft == "รอส่งตัว" &&
e.positionNumber !== null &&
e.statusName == "เตรียมบรรจุ"
e.nodeName !== null &&
e.reportingDate !== null
);
insertAvatar(rowsAll.value);
insertAvatar(rows.value);
})
.catch((e) => {
messageError($q, e);
@ -390,13 +392,13 @@ function insertAvatar(items: any) {
)
)
.then((img) => {
rowsAll.value[index] = {
rows.value[index] = {
...x,
avatar: img.data.downloadUrl,
};
})
.catch(() => {
rowsAll.value[index] = {
rows.value[index] = {
...x,
avatar: avatar,
};
@ -623,6 +625,7 @@ async function clickClose() {
modalDefermentDisclaim.value = false;
modalwaitInfo.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 () => {
if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
@ -830,7 +886,7 @@ onMounted(async () => {
</q-td>
<q-td auto-width>
<q-btn
v-if="roleAdmin && props.row.statusId !== 'CONTAIN'"
v-if="props.row.statusId !== 'CONTAIN'"
icon="mdi-dots-vertical"
size="12px"
color="grey-7"
@ -842,9 +898,9 @@ onMounted(async () => {
<q-list dense style="min-width: 100px">
<q-item
v-if="
(roleAdmin && props.row.statusId === 'UN-CONTAIN') ||
(props.row.draft === 'รอส่งตัว' &&
props.row.statusId !== 'DISCLAIM')
roleAdmin &&
props.row.draft !== 'ส่งตัวแล้ว' &&
props.row.statusId !== 'DISCLAIM'
"
clickable
v-close-popup
@ -873,11 +929,61 @@ onMounted(async () => {
</q-item>
<q-item
v-if="
(props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin &&
props.row.statusId === 'UN-CONTAIN') ||
(props.row.draft === 'รอส่งตัว' &&
props.row.statusId !== 'DISCLAIM')
roleAdmin &&
props.row.draft === 'รอส่งตัว' &&
props.row.nodeName !== null
"
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
v-close-popup
@ -905,11 +1011,10 @@ onMounted(async () => {
<q-item
v-if="
(props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin &&
props.row.statusId === 'UN-CONTAIN') ||
(props.row.draft === 'รอส่งตัว' &&
props.row.statusId !== 'DISCLAIM')
props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin &&
props.row.draft !== 'ส่งตัวแล้ว' &&
props.row.statusId !== 'DISCLAIM'
"
clickable
v-close-popup
@ -933,11 +1038,10 @@ onMounted(async () => {
<q-item
v-if="
(props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin &&
props.row.statusId === 'UN-CONTAIN') ||
(props.row.draft === 'รอส่งตัว' &&
props.row.statusId !== 'DISCLAIM')
props.row.bmaOfficer !== 'บุคคลภายนอก' &&
roleAdmin &&
props.row.draft !== 'ส่งตัวแล้ว' &&
props.row.statusId !== 'DISCLAIM'
"
clickable
v-close-popup
@ -1243,7 +1347,7 @@ onMounted(async () => {
:props="props"
class="cursor-pointer"
>
<template v-if="col.name === 'position'">
<template v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</template>
<template
@ -1252,8 +1356,13 @@ onMounted(async () => {
>
<q-item v-ripple style="padding: 0">
<q-item-section avatar>
<q-avatar size="32px" color="grey-4">
<q-img :src="props.row.avatar" class="photo-profile" />
<q-avatar size="30px" color="grey-4">
<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-item-section>
@ -1396,6 +1505,67 @@ onMounted(async () => {
:fetchStatCard="statCard"
: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>
<style lang="scss" scoped>

View file

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

View file

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

View file

@ -883,7 +883,7 @@ function removeFile(fileName: string) {
<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="q-pl-sm text-weight-bold text-dark">
ผลการพจารณาของการเจาหนาท
ผลการพจารณาของการเจาหนาทของหนวยงาน
</div>
</div>
<q-separator />

View file

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

View file

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