diff --git a/src/api/registry/api.profile.ts b/src/api/registry/api.profile.ts
index 60b262952..cca6712bd 100644
--- a/src/api/registry/api.profile.ts
+++ b/src/api/registry/api.profile.ts
@@ -45,6 +45,7 @@ export default {
`${profile}search/new-employee/oc/${id}`,
profileSearchNewEmOcLeaveId: (id: string) =>
`${profile}search/new-employee/oc/leave/${id}`,
+ profileSearchPersonal: () => `${profile}search-personal`,
profileEmployeeTempId: (id: string) => `${profile}employee/temp/${id}`,
profileCoupleId: (profileId: string) => `${profile}couple/${profileId}`,
@@ -188,10 +189,8 @@ export default {
//ระบบ ลูกจ้างชั่คราว
employmentId: (profileId: string) => `${profile}employment/${profileId}`,
- employmentHistoryId: (employmentId: string) => `${profile}employment/history/${employmentId}`
-
-
-
-
+ employmentHistoryId: (employmentId: string) =>
+ `${profile}employment/history/${employmentId}`,
+ searchPersonal: () => `${profile}search-personal`,
};
diff --git a/src/components/Dialogs/AddPersonal.vue b/src/components/Dialogs/AddPersonal.vue
index 91fa3f1fe..7e45d08c4 100644
--- a/src/components/Dialogs/AddPersonal.vue
+++ b/src/components/Dialogs/AddPersonal.vue
@@ -1,54 +1,58 @@
@@ -304,12 +342,13 @@ onMounted(() => {
@@ -330,7 +369,7 @@ onMounted(() => {
ref="table"
:columns="columns"
:rows="rows"
- row-key="id"
+ row-key="personId"
flat
bordered
:paging="true"
@@ -383,8 +422,8 @@ onMounted(() => {
{{ props.rowIndex + 1 }}
- {{ props.prefix }}
-
+ {{ props.prefix }}
+
{{ col.value }}
diff --git a/src/interface/response/listPerson.ts b/src/interface/response/listPerson.ts
new file mode 100644
index 000000000..47c39277a
--- /dev/null
+++ b/src/interface/response/listPerson.ts
@@ -0,0 +1,16 @@
+interface ResponsePreson {
+ personId: string; //id อ้างอิง profile
+ idcard: string; //รหัสบัตรประชาชน
+ prefix: string; //คำนำหน้า
+ firstName: string; //ชื่อ
+ lastName: string; //นามสกุล
+ posNo: string; //เลขที่ตำแหน่ง
+ position: string; //ตำแหน่ง
+ positionLevel: string; //ระดับ
+ salaries: number; //เงินเดือน
+ organization: string; //สังกัด
+ email: string; //อีเมล
+ phone: string; //เบอร์โทรศัพท์
+}
+
+export type { ResponsePreson };
diff --git a/src/modules/09_leave/components/2_Leave/Tab1.vue b/src/modules/09_leave/components/2_Leave/Tab1.vue
index e28b3c0dd..c40561b04 100644
--- a/src/modules/09_leave/components/2_Leave/Tab1.vue
+++ b/src/modules/09_leave/components/2_Leave/Tab1.vue
@@ -28,11 +28,11 @@ function fecthLeaveList() {
//
const querySting = reactive({
- year: 0, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
+ year: new Date().getFullYear(), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
status: "ALL", //*สถานะการของลา
page: 1, //*หน้า
- pageSize: 5, //*จำนวนแถวต่อหน้า
+ pageSize: 10, //*จำนวนแถวต่อหน้า
keyword: "", //keyword ค้นหา
});
const maxPage = ref(1);
@@ -54,7 +54,6 @@ function updatePaging(
querySting.page = newPage;
querySting.pageSize = pageSize;
querySting.keyword = dateFilter ? dateFilter.keyword : querySting.keyword;
-
console.log(querySting);
}
@@ -102,7 +101,10 @@ onMounted(async () => {
-
+
({
- year: 0, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
+ year: new Date().getFullYear(), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
status: "ALL", //*สถานะการของลา
keyword: "", //keyword ค้นหา
@@ -38,20 +45,14 @@ function updateQuerySting(
/** function ค้นหาข้อมูลใน Table*/
async function filterListLeave() {
- filter.status && filter.type && (await updateQuerySting(1, 10, filter));
+ console.log("test");
+
+ // filter.status &&
+ // filter.type &&
+ // (await updateQuerySting(1, Number(props.rowsPerPage), filter));
}
/** Option*/
-const optionYear = ref([
- {
- id: 0,
- name: "ทั้งหมด",
- },
- {
- id: 2023,
- name: "2566",
- },
-]);
const optionType = ref([
{
id: "00000000-0000-0000-0000-000000000000",
@@ -138,19 +139,52 @@ onMounted(async () => {
-
+ {{ year + 543 }}
+ {{
+ parseInt(value + 543)
+ }}
+
+
+
+
+
+
+
+
+
+
import { ref, reactive, watch } from "vue";
+import { useCounterMixin } from "@/stores/mixin";
+import { useQuasar } from "quasar";
import type {
FormData,
FormRef,
} from "@/modules/11_discipline/interface/request/director";
+import http from "@/plugins/http";
+import config from "@/app.config";
+const $q = useQuasar();
+const mixin = useCounterMixin();
+const {
+ messageError,
+ showLoader,
+ dialogMessageNotify,
+ dialogConfirm,
+ success,
+ hideLoader,
+} = mixin;
/**
* รับ props มาจาก page หลัก
*/
@@ -19,9 +33,7 @@ const props = defineProps({
},
});
-const emit = defineEmits([
- "formDataReturn"
-])
+const emit = defineEmits(["formDataReturn"]);
/**
* ข้อมูลรหัสบัตรประชาชน
*/
@@ -33,13 +45,13 @@ const idCardRef = ref(null);
* ข้อมูลทั้งก้อน form
*/
const formData = reactive({
- personalId:"",
+ personalId: "",
prefix: "",
firstname: "",
lastname: "",
position: "",
phone: "",
- email: ""
+ email: "",
});
/**
@@ -61,8 +73,40 @@ watch(props.data, async () => {
* เพิ่มบุคลากร
*/
function addEmployee() {
- if (idCardRef.value.validate()) {
+ if (idCard.value.length === 13) {
console.log("idCard===>", idCard.value);
+ showLoader();
+ http
+ .post(config.API.profileSearchPersonal(), {
+ fieldName: "idcard",
+ keyword: idCard.value,
+ })
+ .then((res) => {
+ const dataApi = res.data.result;
+ if (dataApi.length > 0) {
+ const dataList = dataApi[0];
+ formData.prefix = dataList.prefix;
+ formData.firstname = dataList.firstName;
+ formData.lastname = dataList.lastName;
+ formData.position = dataList.position;
+ formData.phone = dataList.phone;
+ formData.email = dataList.email;
+ } else {
+ dialogMessageNotify($q, "ไม่มีข้อมูลบุคคลากรที่ต้องการค้นหา");
+ }
+ })
+ .catch((e) => {
+ messageError($q, e);
+ })
+ .finally(async () => {
+ hideLoader();
+ });
+ }
+ if (idCard.value.length !== 13) {
+ hideLoader();
+ dialogMessageNotify($q, "กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก");
+ } else {
+ console.log("nodata");
}
}