From 789627a6a908476423d756de0b405f33bf2d3b20 Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Tue, 7 May 2024 11:45:10 +0700 Subject: [PATCH 1/4] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B9=82=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Receive/Dialogbody.vue | 172 ++- .../components/Receive/receiveDetail2.vue | 1093 +++++++++-------- .../components/Receive/receiveMain.vue | 4 +- 3 files changed, 673 insertions(+), 596 deletions(-) diff --git a/src/modules/05_placement/components/Receive/Dialogbody.vue b/src/modules/05_placement/components/Receive/Dialogbody.vue index 134cddaae..a22cf11f8 100644 --- a/src/modules/05_placement/components/Receive/Dialogbody.vue +++ b/src/modules/05_placement/components/Receive/Dialogbody.vue @@ -7,11 +7,14 @@ import type { ResponseRow } from "@/modules/05_placement/interface/response/Rece import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue"; import http from "@/plugins/http"; import config from "@/app.config"; +import { useTransferDataStore } from "@/modules/05_placement/store"; +const transferStore = useTransferDataStore(); +const { statusText } = transferStore; const $q = useQuasar(); const selected = ref([]); const mixin = useCounterMixin(); -const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin; +const { showLoader, success, messageError, dialogConfirm, hideLoader,date2Thai } = mixin; //ค้นหา คอลัมน์ คอลัมน์ที่แสดง const visibleColumns2 = ref([ @@ -19,9 +22,9 @@ const visibleColumns2 = ref([ "citizenId", "fullname", "organizationName", - "birthday", - "dateText", - "statusText", + "dateOfBirth", + "createdAt", + "status", ]); //หัวตาราง const columns2 = ref([ @@ -70,22 +73,22 @@ const columns2 = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "birthday", + name: "dateOfBirth", align: "left", label: "วัน/เดือน/ปี เกิด", sortable: true, - field: "birthday", + field: "dateOfBirth", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { - name: "dateText", + name: "createdAt", align: "left", label: "วันที่ดำเนินการ", sortable: true, - field: "dateText", + field: "createdAt", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -93,11 +96,11 @@ const columns2 = ref([ sortOrder: "da", }, { - name: "statusText", + name: "status", align: "left", label: "สถานะ", sortable: true, - field: "statusText", + field: "status", headerStyle: "font-size: 14px", style: "font-size: 14px", sort: (a: string, b: string) => @@ -174,75 +177,144 @@ watchEffect(() => {
- + - +
- - + - + diff --git a/src/modules/05_placement/components/Receive/receiveDetail2.vue b/src/modules/05_placement/components/Receive/receiveDetail2.vue index 24a5cd8fc..aa2d7a730 100644 --- a/src/modules/05_placement/components/Receive/receiveDetail2.vue +++ b/src/modules/05_placement/components/Receive/receiveDetail2.vue @@ -224,11 +224,11 @@ const getData = async () => { age: "", prefix: "", prefixId: - (data.prefixId == "00000000-0000-0000-0000-000000000000" + (data.prefix == "00000000-0000-0000-0000-000000000000" ? null - : data.prefixId) ?? "", - firstname: data.firstname ?? "", - lastname: data.lastname ?? "", + : data.prefix) ?? "", + firstname: data.firstName ?? "", + lastname: data.lastName ?? "", birthDate: data.dateOfBirth !== null ? new Date(data.dateOfBirth) : null, genderId: @@ -422,46 +422,53 @@ const conditionSave = async () => { } }; -const saveData = async () => { - const body = { - citizenId: informaData.value.cardid, - prefixId: informaData.value.prefixId, - firstname: informaData.value.firstname, - lastname: informaData.value.lastname, - dateOfBirth: - informaData.value.birthDate !== null - ? dateToISO(informaData.value.birthDate) - : null, - genderId: informaData.value.genderId, - nationality: informaData.value.nationality, - race: informaData.value.ethnicity, - religionId: informaData.value.religionId, - bloodGroupId: informaData.value.bloodId, - relationshipId: informaData.value.statusId, - telephoneNumber: informaData.value.tel, - reason: reason.value, - educationOld: educationOld.value, - organizationPositionOld: organizationPositionOld.value, - positionTypeOld: positionTypeOld.value, - positionLevelOld: positionLevelOld.value, - positionNumberOld: posNo.value, - amount: 0, - amountOld: salary.value, - }; - showLoader(); - await http - .put(config.API.receiveDataId(route.params.id.toString()), body) - .then((res: any) => { - success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ"); - edit.value = false; - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - await getData(); - hideLoader(); - }); +function saveData(){ + dialogConfirm( + $q, + () => { + const body = { + citizenId: informaData.value.cardid, + prefix: informaData.value.prefixId, + firstname: informaData.value.firstname, + lastname: informaData.value.lastname, + dateOfBirth: + informaData.value.birthDate !== null + ? dateToISO(informaData.value.birthDate) + : null, + genderId: informaData.value.genderId, + nationality: informaData.value.nationality, + race: informaData.value.ethnicity, + religionId: informaData.value.religionId, + bloodGroupId: informaData.value.bloodId, + relationshipId: informaData.value.statusId, + telephoneNumber: informaData.value.tel, + reason: reason.value, + educationOld: educationOld.value, + organizationPositionOld: organizationPositionOld.value, + positionTypeOld: positionTypeOld.value, + positionLevelOld: positionLevelOld.value, + positionNumberOld: posNo.value, + amount: 0, + amountOld: salary.value, + }; + showLoader(); + http + .put(config.API.receiveDataId(route.params.id.toString()), body) + .then((res: any) => { + success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ"); + edit.value = false; + getData(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + hideLoader(); + }); + }, + "ต้องการแก้ไขข้อมูลหรือไม่?", + "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" + ); }; const getClass = (val: boolean) => { @@ -493,516 +500,514 @@ onMounted(async () => { - -
-
- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย + +
+
+ แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย +
+ +
+ +
+
+ + +
- -
- -
-
- - -
-
-
- -
-
-
-
-
ข้อมูลส่วนตัว
-
-
- -
-
- -
-
- -
-
- -
-
- - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
+ +
+
+
+
+
ข้อมูลส่วนตัว
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + + + + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ -
-
- + -
-
- -
-
- -
-
- -
-
-
ตำแหน่งและหน่วยงานเดิม
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- + clearable + /> +
+
+ +
+
+ +
+
+ +
+
+
ตำแหน่งและหน่วยงานเดิม
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
-
+ - -
-
เอกสารเพิ่มเติม
-
-
-
- - - -
-
+ + +
+
เอกสารเพิ่มเติม
+
+
+
+ + + +
diff --git a/src/modules/05_placement/components/Receive/receiveMain.vue b/src/modules/05_placement/components/Receive/receiveMain.vue index a11841734..ad63f168d 100644 --- a/src/modules/05_placement/components/Receive/receiveMain.vue +++ b/src/modules/05_placement/components/Receive/receiveMain.vue @@ -56,11 +56,11 @@ const { const popup = () => { const row = filters.value.filter( - (r: ResponseRow) => + (r: any) => (r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE") && - r.positionNumber != null && + r.posMasterNo != null && r.educationOld && r.organizationPositionOld && r.positionTypeOld && From ad66cacc1ebfecace8f00e93e645ab5a04cb4bbc Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Tue, 7 May 2024 15:18:52 +0700 Subject: [PATCH 2/4] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20?= =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B8=8A=E0=B8=B5=E0=B9=89=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=94=20=E0=B8=95=E0=B8=B2=E0=B8=A1=E0=B9=81?= =?UTF-8?q?=E0=B8=9C=E0=B8=99=20=E0=B8=A3=E0=B8=AD=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../14_KPI/components/DialogHistory.vue | 65 +++++++ .../indicatorByPlan/IndicatorByPlan.vue | 152 ++++++++-------- .../components/indicatorByRole/DetailView.vue | 66 +++---- src/modules/14_KPI/interface/request/Main.ts | 13 +- src/modules/14_KPI/views/indicatorByPlan.vue | 166 ++++++++++++------ src/modules/14_KPI/views/indicatorByRole.vue | 135 ++++++++------ 6 files changed, 385 insertions(+), 212 deletions(-) create mode 100644 src/modules/14_KPI/components/DialogHistory.vue diff --git a/src/modules/14_KPI/components/DialogHistory.vue b/src/modules/14_KPI/components/DialogHistory.vue new file mode 100644 index 000000000..485d0b4ce --- /dev/null +++ b/src/modules/14_KPI/components/DialogHistory.vue @@ -0,0 +1,65 @@ + + diff --git a/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue b/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue index 3e68d2140..11fda18d8 100644 --- a/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue +++ b/src/modules/14_KPI/components/indicatorByPlan/IndicatorByPlan.vue @@ -28,14 +28,15 @@ const { } = mixin; const id = ref(route.params.id ? route.params.id.toLocaleString() : ""); +const editCheck = ref(route.params.id ? true : false); /**form ตัวชี้วัดตามแผนฯ*/ const planData = reactive({ - kpiPeriodId: "", //รอบการประเมิน(เมษา->APR, ตุลา->OCT) + period: "", //รอบการประเมิน(เมษา->APR, ตุลา->OCT) including: "", //รหัสตัวชี้วัด includingName: "", //ชื่อตัวชี้วัด target: "", //ค่าเป้าหมาย - unit: null, //หน่วยนับ + unit: "", //หน่วยนับ weight: null, //น้ำหนัก achievement1: "", //ผลสำเร็จของงาน 1 achievement2: "", //ผลสำเร็จของงาน 2 @@ -49,10 +50,14 @@ const planData = reactive({ orgRevisionId: "", //RevisionId หน่วยงาน strategy: null, //ระดับยุทธศาสตร์ strategyId: "", //id ยุทธศาสตร์ + documentInfoEvidence: "", //ข้อมูลเอกสารหลักฐาน }); -const year = ref(0); // ปีงยประมาณ -const roundOp = ref([]); +const year = ref(0); // ปีงยประมาณ +const roundOp = ref([ + { id: "APR", name: "รอบเมษายน" }, + { id: "OCT", name: "รอบตุลาคม" }, +]); const nodeplan = ref([]); const nodeAgency = ref([]); @@ -64,36 +69,6 @@ const expandedAgency = ref([]); const editStatus = ref(false); const inputRef = ref(null); -/** functiopn fetch รอบการประเมิน*/ -function fetchRoundOption(isId: number | null = null) { - http - .get( - config.API.kpiPeriod + - `?page=${1}&pageSize=${10}&keyword=${""}&year=${year.value}` - ) - .then((res) => { - const data = res.data.result.data; - const list = data.map((e: any) => ({ - id: e.id, - name: - e.durationKPI === "OCT" - ? "รอบตุลาคม" - : e.durationKPI === "APR" - ? "รอบเมษายน" - : "", - })); - roundOp.value = list; - - if (isId) { - planData.kpiPeriodId = ""; - inputRef.value.resetValidation(); - } - }) - .catch((err) => { - messageError($q, err); - }); -} - /** function fetch หาโครงสร้างที่ใช้งาน*/ function fetchOrganizationActive() { http @@ -147,7 +122,7 @@ function fetchDataById(id: string) { .then((res) => { const data = res.data.result; year.value = data.year; - planData.kpiPeriodId = data.kpiPeriodId; + planData.period = data.round; planData.including = data.including; planData.includingName = data.includingName; planData.target = data.target; @@ -189,8 +164,6 @@ function fetchDataById(id: string) { expandedPlan.value = arrayexpandedPlan .filter((e) => e !== null) .slice(0, -1); - - fetchRoundOption(); }) .catch((err) => { messageError($q, err); @@ -235,6 +208,27 @@ function onSubmit() { dialogConfirm( $q, async () => { + const body = { + year: year.value == 0 ? null : year.value, + period: planData.period, + includingName: planData.includingName, + target: planData.target, + unit: planData.unit, + weight: planData.weight, + achievement1: planData.achievement1, + achievement2: planData.achievement2, + achievement3: planData.achievement3, + achievement4: planData.achievement4, + achievement5: planData.achievement5, + meaning: planData.meaning, + formula: planData.formula, + node: planData.node, + nodeId: planData.nodeId, + orgRevisionId: planData.orgRevisionId, + strategy: planData.strategy, + strategyId: planData.strategyId, + documentInfoEvidence: planData.documentInfoEvidence, + }; showLoader(); // editStatus.value ? editData(id.value) : addData(); try { @@ -242,7 +236,7 @@ function onSubmit() { ? config.API.kpiPlanById(id.value) : config.API.kpiPlan; const method = editStatus.value ? "put" : "post"; - const res = await http[method](url, planData); + const res = await http[method](url, body); success($q, "บันทึกข้อมูลสำเร็จ"); editStatus.value ? fetchDataById(id.value) @@ -272,6 +266,29 @@ onMounted(() => {
+
+ +
+
+ +
{ autoApply year-picker :enableTimePicker="false" - @update:modelValue="fetchRoundOption" + @update:modelValue="planData.period = ''" > + @@ -310,47 +338,17 @@ onMounted(() => {
-
-
- -
-
-
@@ -371,8 +369,8 @@ onMounted(() => { v-model="planData.unit" label="หน่วยนับ" bg-color="white" - type="number" dense + lazy-rules class="inputgreen" :rules="[(val) => !!val || `${'กรุณากรอกหน่วยนับ'}`]" hide-bottom-space @@ -644,6 +642,16 @@ onMounted(() => {
+
+ +
diff --git a/src/modules/14_KPI/components/indicatorByRole/DetailView.vue b/src/modules/14_KPI/components/indicatorByRole/DetailView.vue index faacbbbda..f869a39d2 100644 --- a/src/modules/14_KPI/components/indicatorByRole/DetailView.vue +++ b/src/modules/14_KPI/components/indicatorByRole/DetailView.vue @@ -45,6 +45,7 @@ const form = reactive({ weight: "", //น้ำหนัก meaning: "", //นิยามหรือความหมาย formula: "", //สูตรคำนวณ + documentInfoEvidence: "", //ข้อมูลเอกสารหลักฐาน node: null, nodeId: null, @@ -71,7 +72,10 @@ const positionOp = ref([]); const positionMainOp = ref([]); /** Option รอบการประเมิน*/ -const roundOp = ref([]); +const roundOp = ref([ + { id: "APR", name: "รอบเมษายน" }, + { id: "OCT", name: "รอบตุลาคม" }, +]); /** * function ต้นหาข้อมูลของ Option @@ -121,9 +125,9 @@ function onSubmit() { : config.API.kpiRoleMainList; const body = { + year: form.year == 0 ? null:form.year, position: form.position, //ตำแหน่ง - kpiPeriodId: form.round, //รอบการประเมิน(เมษา->APR, ตุลา->OCT) - including: form.including, //รหัสตัวชี้วัด + period: form.round, //รอบการประเมิน(เมษา->APR, ตุลา->OCT) includingName: form.includingName, //ชื่อตัวชี้วัด target: form.target, //ค่าเป้าหมาย unit: form.unit, //หน่วยนับ @@ -135,6 +139,7 @@ function onSubmit() { achievement5: formScore.score5, //ผลสำเร็จของงาน 5 meaning: form.meaning, //นิยามหรือความหมาย formula: form.formula, //สูตรคำนวณ + documentInfoEvidence: form.documentInfoEvidence, //ข้อมูลเอกสารหลักฐาน node: form.node, //ระดับหน่วยงาน nodeId: form.nodeId, //id หน่วยงาน @@ -171,7 +176,7 @@ function getDetail() { const data = res.data.result; form.position = data.position; form.year = data.year == null ? 0 : data.year; - form.round = data.kpiPeriodId; + form.round = data.round; form.including = data.including; form.includingName = data.includingName; form.target = data.target; @@ -244,21 +249,6 @@ function updateSelected(data: any) { form.orgRevisionId = data.orgRevisionId; } -function getRound() { - showLoader(); - http - .get(config.API.kpiPeriod + `?year=${form.year}`) - .then((res) => { - const data = res.data.result.data; - roundOp.value = data.map((item: any) => ({ - id: item.id, - name: statusTothai(item.durationKPI), - })); - }) - .finally(() => { - hideLoader(); - }); -} function statusTothai(val: string) { switch (val) { @@ -284,7 +274,6 @@ function setModel(val: string) { onMounted(() => { fetchActive(); getOptions(); - getRound(); if (id.value !== "") { getDetail(); } @@ -345,7 +334,7 @@ onMounted(() => { autoApply year-picker :enableTimePicker="false" - @update:model-value="(form.round = ''), getRound()" + @update:model-value="form.round = ''" >
{ input-class="text-red" label="รอบการประเมิน" class="inputgreen" - lazy-rules - :rules="[(val:string) => !!val || `${'กรุณาเลือกรอบการประเมิน'}`,]" - hide-bottom-space />
-
+
@@ -632,6 +626,16 @@ onMounted(() => { type="textarea" />
+
+ +
diff --git a/src/modules/14_KPI/interface/request/Main.ts b/src/modules/14_KPI/interface/request/Main.ts index c8d8f976a..e578c5180 100644 --- a/src/modules/14_KPI/interface/request/Main.ts +++ b/src/modules/14_KPI/interface/request/Main.ts @@ -36,6 +36,7 @@ interface FormDataRole { weight: string; meaning: string; formula: string; + documentInfoEvidence: string; node: number | null; nodeId: string | null; orgRevisionId: string | null; @@ -48,6 +49,15 @@ interface NewPagination { sortBy: string; } +interface FormListMainByRole { + page:number + pageSize:number + position:string + round:string + keyword:string + year:number|null +} + interface ListGroup{ id:string nameGroupKPI:string @@ -66,5 +76,6 @@ export type { FormDataRole, NewPagination, FormQueryCapacity, - ListGroup + ListGroup, + FormListMainByRole }; diff --git a/src/modules/14_KPI/views/indicatorByPlan.vue b/src/modules/14_KPI/views/indicatorByPlan.vue index b263184df..3bfc6252b 100644 --- a/src/modules/14_KPI/views/indicatorByPlan.vue +++ b/src/modules/14_KPI/views/indicatorByPlan.vue @@ -4,6 +4,7 @@ import { useQuasar, type QTableProps } from "quasar"; import { useRouter } from "vue-router"; import type { DataOption } from "@/modules/14_KPI/interface/index/Main"; +import DialogHistory from '@/modules/14_KPI/components/DialogHistory.vue' /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; @@ -11,6 +12,8 @@ import http from "@/plugins/http"; import config from "@/app.config"; /** use*/ +const modalHistory = ref(false) +const isAll = ref(false); const $q = useQuasar(); const router = useRouter(); const { showLoader, hideLoader, dialogRemove, success, messageError } = @@ -22,7 +25,7 @@ const columns = ref([ { name: "including", align: "left", - label: "รหัสตัวชี้วัด", + label: "ลำดับ/รหัสตัวชี้วัด", sortable: true, field: "including", headerStyle: "font-size: 14px", @@ -43,11 +46,14 @@ const expanded = ref([]); const filterMain = ref(""); const visibleColumns = ref(["including", "includingName"]); -const roundOp = ref([]); +const roundOp = ref([ + { id: "APR", name: "รอบเมษายน" }, + { id: "OCT", name: "รอบตุลาคม" }, +]); const totalList = ref(1); -const year = ref(new Date().getFullYear()); +const year = ref(new Date().getFullYear()); const nodeData = reactive({ page: 1, pageSize: 10, @@ -57,41 +63,12 @@ const nodeData = reactive({ keyword: "", }); -function fetchRoundOption() { - showLoader(); - http - .get( - config.API.kpiPeriod + - `?page=${1}&pageSize=${10}&keyword=${""}&year=${year.value}` - ) - .then((res) => { - const data = res.data.result.data; - const list = data.map((e: any) => ({ - id: e.id, - name: - e.durationKPI === "OCT" - ? "รอบตุลาคม" - : e.durationKPI === "APR" - ? "รอบเมษายน" - : "", - })); - roundOp.value = list; - nodeData.round = ""; - fetchListProjectNew(); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); -} function fetchList() { showLoader(); http .get( config.API.kpiPlan + - `?page=${nodeData.page}&pageSize=${nodeData.pageSize}&kpiPeriodId=${nodeData.round}&nodeId=${nodeData.nodeId}&node=${nodeData.node}&keyword=${nodeData.keyword}` + `?page=${nodeData.page}&pageSize=${nodeData.pageSize}&period=${nodeData.round}&nodeId=${nodeData.nodeId}&node=${nodeData.node}&keyword=${nodeData.keyword}&year=${year.value}&isAll=${isAll.value}` ) .then((res) => { const data = res.data.result.data; @@ -178,12 +155,20 @@ async function deleteData(idData: string) { function clearFilter() { nodeData.keyword = ""; fetchActive(); - fetchRoundOption(); + fetchListProjectNew(); } -onMounted(() => { - fetchActive(); - fetchRoundOption(); - // fetchData(); + +/** + * เปิด dialog history + * @param id + */ +function onClickHistory(id:string){ + modalHistory.value = true +} + +onMounted(async () => { + await fetchActive(); + await fetchList(); }); @@ -270,7 +255,7 @@ onMounted(() => { year-picker :enableTimePicker="false" style="width: 150px" - @update:model-value="fetchRoundOption" + @update:model-value="fetchListProjectNew" > @@ -323,7 +317,20 @@ onMounted(() => {
+
+ + แสดงตำแหน่งทั้งหมดภายใต้หน่วยงาน/ส่วนราชการที่เลือก + + { ref="table" :columns="columns" :rows="rows" - row-key="subject" + row-key="id" flat bordered dense class="custom-header-table" + :rows-per-page-options="[10, 25, 50, 100]" :visible-columns="visibleColumns" > @@ -420,6 +465,11 @@ onMounted(() => {
+ + + From 94afaca07be3cb46a32909a4fd8e326714edb5cc Mon Sep 17 00:00:00 2001 From: "STW_TTTY\\stwtt" Date: Tue, 7 May 2024 17:06:34 +0700 Subject: [PATCH 3/4] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=20=E0=B8=9A=E0=B8=A3?= =?UTF-8?q?=E0=B8=A3=E0=B8=88=E0=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AppointMent/Detail.vue | 173 ++-- .../05_placement/components/Other/Detail.vue | 13 +- .../PersonalDetail/DialogFooter.vue | 2 +- .../components/PersonalDetail/Education.vue | 21 +- .../PersonalDetail/Information/Address.vue | 136 +-- .../PersonalDetail/Information/Certicate.vue | 37 +- .../PersonalDetail/Information/Family.vue | 138 +-- .../Information/Information.vue | 99 +- .../PersonalDetail/Information/top.vue | 2 +- .../components/Receive/receiveDetail2.vue | 844 +++++++++--------- .../components/Receive/receiveMain.vue | 10 +- .../components/Repatriate/RepatriatebyId.vue | 12 +- .../components/Transfer/transferRegistry.vue | 17 +- 13 files changed, 770 insertions(+), 734 deletions(-) diff --git a/src/modules/05_placement/components/AppointMent/Detail.vue b/src/modules/05_placement/components/AppointMent/Detail.vue index 8bfbc92c5..968cc3b1d 100644 --- a/src/modules/05_placement/components/AppointMent/Detail.vue +++ b/src/modules/05_placement/components/AppointMent/Detail.vue @@ -67,8 +67,8 @@ const fecthappointmentByid = async () => { const data = res.data.result; profileId.value = data.profileId; - title.value.fullname = `${data.prefix}${data.firstname ?? "-"} ${ - data.lastname ?? "-" + title.value.fullname = `${data.prefix}${data.firstName ?? "-"} ${ + data.lastName ?? "-" }`; title.value.organizationPositionOld = data.organizationPositionOld ?? "-"; title.value.positionLevelOld = data.positionLevelOld ?? "-"; @@ -92,47 +92,39 @@ const fecthappointmentByid = async () => { }); }; -//ยืนยันการเเก้ไข -const clickSave = async () => { - if (myForm.value !== null) { - myForm.value.validate().then((success: any) => { - if (success) { - dialogConfirm( - $q, - async () => await putAppointment(), - "ต้องการแก้ไขข้อมูลหรือไม่?", - "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" - ); - } - }); - } -}; // เเก้ไขข้อมูล -const putAppointment = async () => { - let data = { - educationOld: educationOld.value, - organizationPositionOld: organizationPositionOld.value, - positionTypeOld: positionTypeOld.value, - positionLevelOld: positionLevelOld.value, - positionNumberOld: posNo.value, - amountOld: Number(salary.value), - reason: reason.value, - positionDate: date.value, - }; - showLoader(); - await http - .put(config.API.appointmentByid(paramsId.toString()), data) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - fecthappointmentByid(); - edit.value = false; - }); -}; +function putAppointment() { + dialogConfirm( + $q, + () => { + let data = { + educationOld: educationOld.value, + organizationPositionOld: organizationPositionOld.value, + positionTypeOld: positionTypeOld.value, + positionLevelOld: positionLevelOld.value, + positionNumberOld: posNo.value, + amountOld: Number(salary.value), + reason: reason.value, + positionDate: date.value, + }; + showLoader(); + http + .put(config.API.appointmentByid(paramsId.toString()), data) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + fecthappointmentByid(); + edit.value = false; + }); + }, + "ต้องการแก้ไขข้อมูลหรือไม่?", + "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" + ); +} const cancel = () => { edit.value = false; fecthappointmentByid(); @@ -175,48 +167,54 @@ onMounted(async () => { -
-
- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -
- -
-
- + +
+
+ แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
-
- - + +
+
+ +
+
+ + +
-
-
- +
+
วุฒิการศึกษา
@@ -311,12 +309,19 @@ onMounted(async () => {
-
diff --git a/src/modules/05_placement/components/Other/Detail.vue b/src/modules/05_placement/components/Other/Detail.vue index 3d5506a0c..9a914a036 100644 --- a/src/modules/05_placement/components/Other/Detail.vue +++ b/src/modules/05_placement/components/Other/Detail.vue @@ -304,12 +304,19 @@ onMounted(async () => {
-
diff --git a/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue b/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue index 991f13be7..516a68ec4 100644 --- a/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue +++ b/src/modules/05_placement/components/PersonalDetail/DialogFooter.vue @@ -126,7 +126,7 @@ const clickPrevious = async () => { unelevated :disabled="!editvisible" :color="!editvisible ? 'grey-7' : 'public'" - @click="checkSave" + type="submit" label="บันทึก" > diff --git a/src/modules/05_placement/components/PersonalDetail/Education.vue b/src/modules/05_placement/components/PersonalDetail/Education.vue index 5541abe83..99ed48ec7 100644 --- a/src/modules/05_placement/components/PersonalDetail/Education.vue +++ b/src/modules/05_placement/components/PersonalDetail/Education.vue @@ -448,15 +448,11 @@ const clickAdd = async () => { * กดบันทึกใน dialog */ const clickSave = async () => { - myForm.value.validate().then(async (result: boolean) => { - if (result) { - if (modalEdit.value) { - await editData(); - } else { - await saveData(); - } - } - }); + if (modalEdit.value) { + await dialogConfirm($q, () => editData()); + } else { + await dialogConfirm($q, () => saveData()); + } }; /** @@ -662,10 +658,12 @@ const addData = () => { * ฟังก์ชันปุ่มยกเลิกการแก้ไขข้อมูล */ const clickCancel = async () => { + myForm.value.resetValidation() if (editRow.value == true) { dialogConfirm( $q, async () => { + edit.value = false; await checkRowPage(); await getData(); }, @@ -778,12 +776,12 @@ const getClass = (val: boolean) => { - +
{ (false); const addressData = ref(props.data); const myform = ref(); @@ -138,61 +145,54 @@ const getNewData = async () => { // บันทึกข้อมูล const editData = async () => { - const body = { - registrationSame: addressData.value.registSame == "1", - registrationAddress: addressData.value.registAddress, - registrationSubDistrictId: registAddress.subDistrictId, - registrationDistrictId: registAddress.districtId, - registrationProvinceId: registAddress.provinceId, - registrationZipCode: registAddress.provinceId, - currentAddress: - addressData.value.registSame == "1" - ? addressData.value.registAddress - : addressData.value.currentAddress, - currentSubDistrictId: - addressData.value.registSame == "1" - ? registAddress.subDistrictId - : currentAddress.subDistrictId, - currentDistrictId: - addressData.value.registSame == "1" - ? registAddress.districtId - : currentAddress.districtId, - currentProvinceId: - addressData.value.registSame == "1" - ? registAddress.provinceId - : currentAddress.provinceId, - currentZipCode: - addressData.value.registSame == "1" - ? registAddress.zipCode - : currentAddress.zipCode, - }; - showLoader(); - await http - .put( - config.API.placementAddressId(route.params.personalId.toString()), - body - ) - .then(() => { - success($q, "แก้ไขข้อมูลสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - edit.value = false; - emit("update:statusEdit", false); - await getNewData(); - await props.fetch(); - // await fetchProvince(); - }); -}; - -// เช็คข้อมูลก่อนบันทึก -const saveData = async () => { - myform.value.validate().then((success: boolean) => { - if (success) { - editData(); - } + dialogConfirm($q, async() => { + const body = { + registrationSame: addressData.value.registSame == "1", + registrationAddress: addressData.value.registAddress, + registrationSubDistrictId: registAddress.subDistrictId, + registrationDistrictId: registAddress.districtId, + registrationProvinceId: registAddress.provinceId, + registrationZipCode: registAddress.provinceId, + currentAddress: + addressData.value.registSame == "1" + ? addressData.value.registAddress + : addressData.value.currentAddress, + currentSubDistrictId: + addressData.value.registSame == "1" + ? registAddress.subDistrictId + : currentAddress.subDistrictId, + currentDistrictId: + addressData.value.registSame == "1" + ? registAddress.districtId + : currentAddress.districtId, + currentProvinceId: + addressData.value.registSame == "1" + ? registAddress.provinceId + : currentAddress.provinceId, + currentZipCode: + addressData.value.registSame == "1" + ? registAddress.zipCode + : currentAddress.zipCode, + }; + showLoader(); + await http + .put( + config.API.placementAddressId(route.params.personalId.toString()), + body + ) + .then(() => { + success($q, "แก้ไขข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + edit.value = false; + emit("update:statusEdit", false); + await getNewData(); + await props.fetch(); + // await fetchProvince(); + }); }); }; @@ -440,18 +440,18 @@ const getClass = (val: boolean) => {