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 &&