From f8772e460f2ffe7f458b214d170b253fbd037cb4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 4 Sep 2023 13:57:32 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84?= =?UTF-8?q?=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=20step01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/10_order/components/Detail.vue | 12 +- .../10_order/components/step/step01.vue | 405 +++++++++++++++--- 2 files changed, 345 insertions(+), 72 deletions(-) diff --git a/src/modules/10_order/components/Detail.vue b/src/modules/10_order/components/Detail.vue index 57a149cc5..735d88888 100644 --- a/src/modules/10_order/components/Detail.vue +++ b/src/modules/10_order/components/Detail.vue @@ -32,13 +32,14 @@ onUnmounted(() => { }); const nextStep = async () => { - stepper.value!.next(); + // stepper.value!.next(); + localStorage.setItem("currentStep", step.value.toString()); if (orderId.value) { await http .put(config.API.nextStep(orderId.value)) .then(() => { - router.push(`/order/detail/${orderId.value}?step=${step.value}`); + router.push(`/order/detail/${orderId.value}?step=${step.value + 1}`); }) .catch((e) => { console.log(e); @@ -46,13 +47,13 @@ const nextStep = async () => { } }; const previousStep = async () => { - stepper.value!.previous(); + // stepper.value!.previous(); localStorage.setItem("currentStep", step.value.toString()); if (orderId.value) { await http .put(config.API.prevStep(orderId.value)) .then(() => { - router.push(`/order/detail/${orderId.value}?step=${step.value}`); + router.push(`/order/detail/${orderId.value}?step=${step.value - 1}`); }) .catch((e) => { console.log(e); @@ -62,7 +63,6 @@ const previousStep = async () => { const destroyLocalStorage = () => { localStorage.clear(); }; - onMounted(() => { // console.log("route query===>", route.query) if (route.query.step) { @@ -79,7 +79,7 @@ onMounted(() => { if (orderId_params !== undefined) { orderId.value = orderId_params.toString(); - // console.log(orderId.value); + // console.log("orderId.value"); } }); diff --git a/src/modules/10_order/components/step/step01.vue b/src/modules/10_order/components/step/step01.vue index 03006b381..ecf7c3d5b 100644 --- a/src/modules/10_order/components/step/step01.vue +++ b/src/modules/10_order/components/step/step01.vue @@ -10,6 +10,11 @@ import { useQuasar } from "quasar"; import { useRoute, useRouter } from "vue-router"; import http from "@/plugins/http"; import config from "@/app.config"; +import type { treeTab } from "@/modules/05_placement/interface/index/Main"; +import type { ResponseOrganiz } from "@/modules/05_placement/interface/response/Order"; +import type { QTableProps } from "quasar"; + +import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue"; const mixin = useCounterMixin(); const { @@ -19,6 +24,7 @@ const { hideLoader, success, dialogConfirm, + dialogMessageNotify, } = mixin; const $q = useQuasar(); //ใช้ noti quasar const route = useRoute(); @@ -60,66 +66,17 @@ const examRound = ref(""); const examRoundOption = ref([]); const conclusionRegisterNo = ref(""); const conclusionRegisterDate = ref(new Date()); -// const registerOption = ref([ -// { -// name: "รับสมคัรสอบ ครั้งที่ 1", -// id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", -// }, -// ]); + const conclusionResultNo = ref(""); const conclusionResultDate = ref(new Date()); -// const announceOption = ref([ -// { -// name: "ผลการสอบแข่งขั้น ครั้งที่ 1", -// id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", -// }, -// ]); // C-PM-05 - 06 -const conclusion1 = ref(""); -const conclusionDate1 = ref(new Date()); -const conclusion1Option = ref([ - { name: "ครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); -const conclusion2 = ref(""); -const conclusionDate2 = ref(new Date()); -const conclusion2Option = ref([ - { name: "ครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); const meeting = ref(""); const dateMeeting = ref(new Date()); -const meetingOption = ref([ - { name: "การประชุมครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); -// C-PM-07 -const conclusionRelocation1 = ref(""); -const conclusionRelocationDate1 = ref(new Date()); -const RelocationOption1 = ref([ - { name: "ครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); -const conclusionRelocation2 = ref(""); -const conclusionRelocationDate2 = ref(new Date()); -const RelocationOption2 = ref([ - { name: "ครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); - -// C-PM-08 && 14 -const conclusion = ref(""); -const conclusionDate = ref(new Date()); -const conclusionOption = ref([ - { name: "ครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); -const conclusionLeave = ref(""); -const conclusionLeaveDate = ref(new Date()); -const LeaveOption = ref([ - { name: "ครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); -const conclusionReceive = ref(""); -const conclusionReceiveDate = ref(new Date()); -const ReceiveOption = ref([ - { name: "ครั้งที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, -]); +// C-PM-08 +const conclusionReturnNo = ref(""); +const conclusionReturnDate = ref(new Date()); // C-PM-09 const organizations = ref(""); @@ -138,6 +95,7 @@ const bookOption = ref([ ]); // C-PM-10 +const dialogVisible = ref(false); const organizationsOld = ref(""); const organizationsOldOption = ref([ { name: "หน่วยงานที่ 1", id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" }, @@ -193,6 +151,8 @@ const receiveOcOption = ref([ ]); // C-PM-14 const transferOrganizationName = ref(""); +const conclusionReceive = ref(""); +const conclusionReceiveDate = ref(new Date()); // C-PM-16 const orderNumber = ref(); @@ -260,10 +220,10 @@ const fetchdetailOrder = async () => { await http .get(config.API.detailOrder(orderIdString)) .then((res: any) => { - console.log(res); + // console.log(res); const data = res.data.result; - console.log(data); + // console.log(data); typeOrder.value = typeOrderOption.value.find( (e) => e.id === data.orderTypeValue ); @@ -286,17 +246,20 @@ const fetchdetailOrder = async () => { dateMeeting.value = data.conclusionMeetingDate; // 08 - conclusionReceive.value = data.conclusionReturnNo; - conclusionReceiveDate.value = data.conclusionReturnDate; + conclusionReturnNo.value = data.conclusionReturnNo; + conclusionReturnDate.value = data.conclusionReturnDate; //09 organizations.value = data.sourceOrganizationName; order.value = data.conclusionReturnNo; orderDate.value = data.conclusionReturnDate; book.value = data.militaryCommandNo; - bookDate.value = data.militaryCommandDate; + bookDate.value = data.militaryCommanDate; //10 + if (data.orderTypeCode === "c-pm-10") { + nodeTree(); + } organizationsOld.value = data.placementCommandIssuer; orderOld.value = data.placementCommandNo; orderOldDate.value = data.placementCommandDate; @@ -356,6 +319,9 @@ const fecthCommand = async () => { }; const selectCMP = (selectOrder: any) => { fecthExamRoundOption(selectOrder.commandCode); + if (selectOrder.commandCode === "C-PM-10") { + nodeTree(); + } //01-04 examRound.value = ""; conclusionRegisterNo.value = ""; @@ -422,6 +388,8 @@ const submit = async () => { let signBy = null; if (!nameCommand.value.length) { signBy = await nameCommand.value.name; + } else if (nameCommand.value !== "") { + signBy = await nameCommand.value; } else { const name2 = await CommandOption.value.find( (x: any) => x.name == nameCommand.value @@ -429,6 +397,7 @@ const submit = async () => { signBy = await name2?.name; console.log("signBy", signBy); } + console.log(signBy); const orderByOrganizationName = await byOrderOption.value.find( (x: any) => x.id == byOrder.value @@ -470,8 +439,8 @@ const submit = async () => { }); } else if (typeOrder.value.commandCode == "C-PM-08") { Object.assign(formdata, { - conclusionReturnNo: conclusionReceive.value, - conclusionReturnDate: conclusionReceiveDate.value, + conclusionReturnNo: conclusionReturnNo.value, + conclusionReturnDate: conclusionReturnDate.value, }); } else if (typeOrder.value.commandCode == "C-PM-09") { Object.assign(formdata, { @@ -582,6 +551,120 @@ const updateOrder = async (formData: Object, orderId: string, type: string) => { hideLoader(); }); }; +// dialog 10 +const search = ref(""); +const nodesTree = ref([]); +const expanded = ref([]); +const selected = ref(""); +const selectedModal = ref([]); +const visibleColumnsModal = ref(["no", "idCard", "name", "position"]); +const columnsModal = ref([ + { + name: "no", + align: "left", + label: "ลำดับ", + field: "no", + sortable: true, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "idCard", + align: "left", + label: "เลขประจำตัวประชาชน", + field: "idCard", + sortable: true, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "name", + align: "left", + label: "ชื่อ-สกุล", + field: "name", + sortable: true, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "position", + align: "left", + label: "ตำแหน่ง", + field: "position", + sortable: true, + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, +]); +const rowsModal = ref([]); +const clickAction = ref(""); +const filterModal = ref(""); +const nodeTree = async () => { + showLoader(); + await http + .get(config.API.profileOrganizRoot) + .then((res: any) => { + const data = res.data.result; + nodesTree.value = data; + if (data.length > 0) { + expanded.value = [data[0].id]; + } + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +}; +const onSelected = async (id: string) => { + await listModal(id); +}; +const listModal = async (id: string) => { + showLoader(); + await http + .get(config.API.copyOrderPersonsId(id)) + .then((res) => { + const data = res.data.result; + let list: ResponseOrganiz[] = []; + data.map((r: ResponseOrganiz) => { + list.push({ + firstName: r.firstName ?? "", + idCard: r.idCard ?? "", + lastName: r.lastName ?? "", + name: r.name ?? "", + position: r.position ?? "", + prefixId: r.prefixId ?? "", + profileId: r.profileId ?? "", + unit: r.unit ?? "", + }); + }); + rowsModal.value = list; + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + }); +}; +const openDialog = (action: string) => { + dialogVisible.value = true; + clickAction.value = action; + selectedModal.value = []; +}; +const clickSavelist = () => { + if (selectedModal.value.length > 0) { + if (clickAction.value === "chairman") { + chairman.value = selectedModal.value[0].name; + } else if (clickAction.value === "director") { + director.value = selectedModal.value[0].name; + } else if (clickAction.value === "director2") { + director2.value = selectedModal.value[0].name; + } + dialogVisible.value = false; + } else dialogMessageNotify($q, "โปรดเลือกรายชื่อ"); +}; /** * class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ @@ -729,7 +812,10 @@ const getClass = (val: boolean) => { @update:model-value="(nameCommand = ''), (positionCommand = '')" /> -
+
{ hide-bottom-space /> -->
-
+
{ disable />
+
+ +
+
+ +
@@ -1354,7 +1473,7 @@ const getClass = (val: boolean) => { outlined dense lazy-rules - v-model="conclusionReceive" + v-model="conclusionReturnNo" :rules="[ (val) => !!val || @@ -1372,7 +1491,7 @@ const getClass = (val: boolean) => {
{ dense class="full-width datepicker" :model-value=" - conclusionReceiveDate != null - ? date2Thai(conclusionReceiveDate) + conclusionReturnDate != null + ? date2Thai(conclusionReturnDate) : null " :label="`${'ลงวันที่ '}`" @@ -1811,6 +1930,7 @@ const getClass = (val: boolean) => { :rules="[(val) => !!val || `${'กรุณากรอกชื่อประธาน'}`]" :label="`${'ประธาน'}`" hide-bottom-space + @click="openDialog('chairman')" />
@@ -1840,6 +1960,7 @@ const getClass = (val: boolean) => { :rules="[(val) => !!val || `${'กรุณากรอกชื่อกรรมการ'}`]" :label="`${'กรรมการ'}`" hide-bottom-space + @click="openDialog('director')" />
@@ -1869,6 +1990,7 @@ const getClass = (val: boolean) => { :rules="[(val) => !!val || `${'กรุณากรอกชื่อกรรมการ'}`]" :label="`${'กรรมการ'}`" hide-bottom-space + @click="openDialog('director2')" />
@@ -2247,10 +2369,161 @@ const getClass = (val: boolean) => { บันทึก
+ + + + + + +
+
+ + + + + + + + +
+
+
+ +
+ + + + + +
+
+ + + + + +
+
+
+ + + +
+
From d46022d9d6b1a7b93d2e469d3e3bf96f38580bc8 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Mon, 4 Sep 2023 14:20:54 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B8=9B=E0=B8=B4=E0=B8=94=20history=20?= =?UTF-8?q?=E0=B9=83=E0=B8=99=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=97?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=A5?= =?UTF-8?q?=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/Information/Tempinformation.vue | 67 +++--- .../views/topEmployeeTemp.vue | 199 ++++++++++++++++++ 2 files changed, 233 insertions(+), 33 deletions(-) create mode 100644 src/modules/08_registryEmployee/views/topEmployeeTemp.vue diff --git a/src/modules/08_registryEmployee/views/Information/Tempinformation.vue b/src/modules/08_registryEmployee/views/Information/Tempinformation.vue index 05c6f9596..74a1e51b4 100644 --- a/src/modules/08_registryEmployee/views/Information/Tempinformation.vue +++ b/src/modules/08_registryEmployee/views/Information/Tempinformation.vue @@ -5,12 +5,11 @@ header="ข้อมูลลูกจ้างชั่วคราว" icon="mdi-account" :save="saveData" - :history="!statusAdd()" :changeBtn="changeBtn" :disable="statusEdit" :cancel="refreshData" - :historyClick="clickHistory" :addEmployee="statusAdd()" + :history="!statusAdd()" />
@@ -199,7 +198,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import type { DataOption } from "@/modules/04_registry/components/profileType"; import { defaultTempInformation } from "@/modules/04_registry/components/profileType"; -import HeaderTop from "@/modules/04_registry/components/Information/top.vue"; +import HeaderTop from "@/modules/08_registryEmployee/views/topEmployeeTemp.vue"; import HistoryTable from "@/components/TableHistory.vue"; import { useRoute } from "vue-router"; import type { QTableProps } from "quasar"; @@ -421,36 +420,38 @@ const fetchDataSelector = async () => { /** * ฟังชั้นดูข้อมูลประวัติแก้ไขข้อมูลที่เลือก */ -const clickHistory = async () => { - modalHistory.value = true; - showLoader(); - await http - .get(config.API.profileEmployeeTempId(route.params.id.toString())) - .then((res) => { - let data = res.data.result; - rowsHistory.value = []; - data.map((e: any) => { - rowsHistory.value.push({ - EmployeeMoneyIncrease: e.employeeMoneyIncrease, - EmployeeMoneyAllowance: e.employeeMoneyAllowance, - EmployeeMoneyEmployee: e.employeeMoneyEmployee, - EmployeeMoneyEmployer: e.employeeMoneyEmployer, - PositionEmployeeGroupId: e.positionEmployeeGroupId, - PositionEmployeePositionId: e.positionEmployeePositionId, - PositionEmployeeLineId: e.positionEmployeeLineId, - EmployeeTypeIndividual: e.employeeTypeIndividual, - EmployeeOc: e.employeeOc, - EmployeeWage: e.employeeWage, - }); - }); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); -}; +// const clickHistory = async () => { +// modalHistory.value = true; +// showLoader(); +// await http +// .get(config.API.profileEmployeeTempId(route.params.id.toString())) +// .then((res) => { +// let data = res.data.result; +// rowsHistory.value = []; +// data.map((e: any) => { +// rowsHistory.value.push({ +// employeeMoneyIncrease: e.employeeMoneyIncrease, +// employeeMoneyAllowance: e.employeeMoneyAllowance, +// employeeMoneyEmployee: e.employeeMoneyEmployee, +// employeeMoneyEmployer: e.employeeMoneyEmployer, +// positionEmployeeGroupId: e.positionEmployeeGroupId, +// positionEmployeePositionId: e.positionEmployeePositionId, +// positionEmployeeLineId: e.positionEmployeeLineId, +// employeeTypeIndividual: e.employeeTypeIndividual, +// employeeOc: e.employeeOc, +// employeeWage: e.employeeWage, +// createdFullName: e.createdFullName, +// createdAt: new Date(e.createdAt), +// }); +// }); +// }) +// .catch((e) => { +// messageError($q, e); +// }) +// .finally(() => { +// hideLoader(); +// }); +// }; const refreshData = async () => { myform.value.reset(); diff --git a/src/modules/08_registryEmployee/views/topEmployeeTemp.vue b/src/modules/08_registryEmployee/views/topEmployeeTemp.vue new file mode 100644 index 000000000..ac620aba9 --- /dev/null +++ b/src/modules/08_registryEmployee/views/topEmployeeTemp.vue @@ -0,0 +1,199 @@ + + + From 37e411d28603fa4159c76afeaa4ddf5408b017fa Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Mon, 4 Sep 2023 14:56:00 +0700 Subject: [PATCH 3/3] no message --- .../components/probation/FormAssign.vue | 66 +++++++++++-------- .../components/ListRetirement/TableList.vue | 4 +- .../components/1_Proposals/addProposals.vue | 6 +- 3 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 2242da3c3..104ea7f16 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -66,20 +66,26 @@ const OPgroup = ref< >([]); const dataEdit = async (id: string) => { - showLoader(); - const data = putDataEdit(id); - await http - .put(config.API.saveEditAssign(id), data) - .then(() => {}) - .catch(() => {}) - .finally(async () => { - status.value = false; - getAssign(); - hideLoader(); - }); + await myForm.value.validate().then((result: boolean) => { + if (result) { + showLoader(); + const data = putDataEdit(id); + http + .put(config.API.saveEditAssign(id), data) + .then(() => {}) + .catch(() => {}) + .finally(async () => { + status.value = false; + getAssign(); + hideLoader(); + }); + }else { + dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ"); + } + }); }; const saveEdit = (id: string) => { - dialogConfirm($q, () => dataEdit(id)); + dialogConfirm($q, async () => await dataEdit(id)); }; const edit = () => { status.value = true; @@ -392,7 +398,7 @@ const putDataEdit = (id: string) => { const assign_director = [ { - personal_id: caretaker1.value.personal_id, + personal_id: caretaker1.value.id != null ? caretaker1.value.id:caretaker1.value.personal_id, role: "mentor", dated: date2.value instanceof Date @@ -400,15 +406,7 @@ const putDataEdit = (id: string) => { : dateToISO(new Date(date2.value)), }, { - personal_id: caretaker2.value.personal_id, - role: "mentor", - dated: - date3.value instanceof Date - ? dateToISO(date3.value) - : dateToISO(new Date(date3.value)), - }, - { - personal_id: commander.value.personal_id, + personal_id: commander.value.id != null ? commander.value.id:commander.value.personal_id, role: "commander", dated: date4.value instanceof Date @@ -416,10 +414,20 @@ const putDataEdit = (id: string) => { : dateToISO(new Date(date4.value)), }, { - personal_id: chairman.value.personal_id, + personal_id: chairman.value.id != null ? chairman.value.id:chairman.value.personal_id, role: "chairman", }, ]; + if (caretaker2.value) { + assign_director.push({ + personal_id: caretaker2.value.id != null ? caretaker2.value.id:caretaker2.value.personal_id, + role: "mentor", + dated: + date3.value instanceof Date + ? dateToISO(date3.value) + : dateToISO(new Date(date3.value)), + }); + } const data = { personal_id: GUID, fullname: fullname.value, @@ -658,8 +666,11 @@ const getAssign = async () => { date_finish.value = data.assign.date_finish; date1.value = data.assign.experimenter_dated; if (data.mentors.length > 1) { + date2.value = data.mentors[0].dated; + caretaker1.value = data.mentors[0]; date3.value = data.mentors[1].dated; caretaker2.value = data.mentors[1]; + } else { date2.value = data.mentors[0].dated; caretaker1.value = data.mentors[0]; @@ -1000,7 +1011,6 @@ watch(knowledge.value, () => { 2 ผู้ดูแลการทดลองปฏิบัติหน้าที่ราชการ (อาจมีได้มากกว่า 1 คน)
-
{ :disable="!caretaker2" :readonly="status != true" dense - s + :rules=" + caretaker2 + ? [(val) => !!val || 'กรุณาเลือกวันที่'] + : [] + " borderless :outlined="status == true" class="full-width datepicker" - :model-value="date3 != null ? date2Thai(date3) : null" + :model-value="caretaker2 != null ? date2Thai(date3) : null" label="ลงวันที่" >