diff --git a/src/components/Workflow/Main.vue b/src/components/Workflow/Main.vue index 6dd412840..9ec341255 100644 --- a/src/components/Workflow/Main.vue +++ b/src/components/Workflow/Main.vue @@ -53,8 +53,9 @@ const typeSelectPerson = ref(""); //รายการระบบที่ต้องการ disable step 3 หรือรองสุดท้าย const displayArray = [ "REGISTRY_PROFILE", - "SYS_RETIREMENT", + "SYS_RESIGN", "SYS_LEAVE_LIST", + "SYS_LEAVE_EMP", ]; async function fetchCheckState() { diff --git a/src/modules/02_organization/views/main.vue b/src/modules/02_organization/views/main.vue index c786c035b..d9b7d0dd8 100644 --- a/src/modules/02_organization/views/main.vue +++ b/src/modules/02_organization/views/main.vue @@ -56,7 +56,13 @@ async function fetchOrganizationActive() { const data = await res.data.result; if (data) { await store.fetchDataActive(data); - await fetchCheckIslock(data.draftId); + // ต้องมี id ของแบบร่างถึงจะเช็ค isLock + if (data.draftId) { + await fetchCheckIslock(data.draftId); + } else { + store.isLosck = false; + } + if (data.activeName === null && data.draftName === null) { isStatusData.value = false; } else { diff --git a/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue b/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue index ca7a51a0e..9145b22d0 100644 --- a/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue +++ b/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue @@ -1,5 +1,5 @@ @@ -261,8 +276,14 @@ onMounted(async () => { { { {
บันทึก { :readonly="!edit" :borderless="!edit" :model-value="date !== null ? date2Thai(date) : null" - :rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]" + :rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วันที่'}`]" hide-bottom-space - :label="`${'ตั้งแต่วัน'}`" + :label="`${'ตั้งแต่วันที่'}`" > diff --git a/src/modules/06_retirement/components/resignEMP/ResignByid.vue b/src/modules/06_retirement/components/resignEMP/ResignByid.vue index e1073f294..30bb41fa2 100644 --- a/src/modules/06_retirement/components/resignEMP/ResignByid.vue +++ b/src/modules/06_retirement/components/resignEMP/ResignByid.vue @@ -70,6 +70,8 @@ const dataDetail = ref({ status: "", statustext: "", fullname: "", + statusMain: "", + cancelReason: "", }); const workflowRef = ref(null); @@ -516,10 +518,29 @@ function removeFile(fileName: string) { }); } +const isDirector = ref(false); +const isStaff = ref(false); + +function fetchCheckIsofficer() { + http + .get(config.API.workflowKeycloakSystem("SYS_RESIGN_EMP")) + .then((res) => { + isStaff.value = res.data.result.isStaff; + isDirector.value = res.data.result.isDirector; + }) + .catch((err) => { + messageError($q, err); + }); +} + /** Hook */ onMounted(async () => { showLoader(); - await Promise.all([fetchData(id.value), fetchFile()]).finally(() => { + await Promise.all([ + fetchData(id.value), + fetchFile(), + fetchCheckIsofficer(), + ]).finally(() => { hideLoader(); }); }); @@ -628,6 +649,18 @@ onMounted(async () => {
+ +
+
+
เหตุผลการขอยกเลิก
+
+ {{ dataDetail.cancelReason }} +
+
+
@@ -742,8 +775,14 @@ onMounted(async () => { เงื่อนไขต่าง ๆ - -
+ +
{
- {
{
{
{ แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
- -
+
{ ref="workflowRef" v-model:is-check-data="isCheckData" :id="id" - sys-name="SYS_RETIREMENT" + sys-name="SYS_RESIGN" /> -->
diff --git a/src/modules/06_retirement/components/resignEMP/ResignReject.vue b/src/modules/06_retirement/components/resignEMP/ResignReject.vue index f59ab94a8..d427f4e86 100644 --- a/src/modules/06_retirement/components/resignEMP/ResignReject.vue +++ b/src/modules/06_retirement/components/resignEMP/ResignReject.vue @@ -67,6 +67,7 @@ const dataDetail = ref({ status: "", statustext: "", fullname: "", + statusMain: "", }); const workflowRef = ref(null); @@ -176,7 +177,10 @@ function onSubmit() { reject: !actionPass.value, }; await http - .put(config.API.resignRejectEMP(`${roleUser.value}-cancel`, id.value), body) + .put( + config.API.resignRejectEMP(`${roleUser.value}-cancel`, id.value), + body + ) .then(async () => { await fetchData(id.value); closeModal(); @@ -255,9 +259,24 @@ function statusOrder(val: boolean) { } } +const isDirector = ref(false); +const isStaff = ref(false); + +function fetchCheckIsofficer() { + http + .get(config.API.workflowKeycloakSystem("RETIREMENT_CANCEL_EMP")) + .then((res) => { + isStaff.value = res.data.result.isStaff; + isDirector.value = res.data.result.isDirector; + }) + .catch((err) => { + messageError($q, err); + }); +} + /** Hook */ onMounted(async () => { - await fetchData(id.value); + await Promise.all([fetchData(id.value), fetchCheckIsofficer()]); }); @@ -379,8 +398,9 @@ onMounted(async () => {
{
{
-
+
({ approveStep: "", dear: "", leaveRange: "", + profileType: "", }); +const isLoadData = ref(false); + /** * Function fetch รายละเอียดของข้อมูล * @param paramsId รับ ID จาก paramID */ async function fetchDetailLeave(paramsId: string) { + isLoadData.value = false; showLoader(); await http .get(config.API.leaveListById(paramsId)) @@ -264,6 +268,9 @@ async function fetchDetailLeave(paramsId: string) { : "-"; formData.approveStep = data.approveStep ? data.approveStep : "-"; formData.dear = data.dear ? data.dear : "-"; + formData.profileType = data.profileType; + + isLoadData.value = true; /** ส่งประเภทของการลาไป Function เช็คประเภทการลา*/ await fectOptionType(); @@ -802,12 +809,16 @@ onMounted(async () => {
-
+
diff --git a/src/modules/09_leave/components/2_Leave/DetailLeaveReject.vue b/src/modules/09_leave/components/2_Leave/DetailLeaveReject.vue index 68adf2d30..aad0434ea 100644 --- a/src/modules/09_leave/components/2_Leave/DetailLeaveReject.vue +++ b/src/modules/09_leave/components/2_Leave/DetailLeaveReject.vue @@ -147,8 +147,11 @@ const formData = reactive({ coupleDaySumTotalHistory: "", //ประวัติ ในกรณีลาติดต่อกับครั้งก่อน รวมทั้งนี้ด้วย เป็นเวลา กี่ปี กี่เดือน กี่วัน (ลาติดตามคู่สมรส) approveStep: "", dear: "", + profileType: "", }); +const isLoadData = ref(false); + onMounted(async () => { if (paramsId) { showLoader(); @@ -192,6 +195,7 @@ async function fetchDetailDeleteLeave(paramsId: string) { } async function fetchDetailLeave(paramsId: string) { + isLoadData.value = false; await http .get(config.API.leaveListById(paramsId)) .then(async (res) => { @@ -275,6 +279,8 @@ async function fetchDetailLeave(paramsId: string) { formData.coupleDaySumTotalHistory = data.coupleDaySumTotalHistory; formData.approveStep = data.approveStep; formData.dear = data.dear ? data.dear : "-"; + formData.profileType = data.profileType; + isLoadData.value = true; await fectOptionType(); }) .catch((err) => { @@ -708,11 +714,15 @@ async function onClickDownloadFile(id: string, fileName: string, type: string) {
-
+
diff --git a/src/modules/09_leave/interface/request/leave.ts b/src/modules/09_leave/interface/request/leave.ts index b59049338..78c464741 100644 --- a/src/modules/09_leave/interface/request/leave.ts +++ b/src/modules/09_leave/interface/request/leave.ts @@ -90,6 +90,7 @@ interface FremData { approveStep: string; dear: string; leaveRange?: string; + profileType: string; } export type { ListsData, FremData, QuerySting, DateFilter };