เครื่ิองราช => fix bug
This commit is contained in:
parent
2475f86608
commit
08455521f2
6 changed files with 262 additions and 133 deletions
|
|
@ -1,6 +1,5 @@
|
|||
divdiv
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, computed } from "vue";
|
||||
import { ref, watch, computed, reactive } from "vue";
|
||||
import { QForm, useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -132,7 +131,7 @@ const disbleStatus = computed(() => {
|
|||
|
||||
/** function เลือกประเภทลูกจ้าง */
|
||||
async function selectType() {
|
||||
showLoader();
|
||||
// showLoader();
|
||||
cardid.value = "";
|
||||
fullName.value = "";
|
||||
position.value = "";
|
||||
|
|
@ -149,53 +148,73 @@ async function selectType() {
|
|||
announced.value = "";
|
||||
invoiceDate.value = null;
|
||||
payment.value = "";
|
||||
await fecthlistPerson();
|
||||
// await fecthlistPerson();
|
||||
}
|
||||
|
||||
/** function เรียกหน่วยงาน*/
|
||||
async function fecthlistPerson() {
|
||||
await http
|
||||
.get(config.API.profileOrganizRoot)
|
||||
.then((res) => {
|
||||
const id = res.data.result[0].id;
|
||||
if (id !== "") {
|
||||
findlist(id); // id หน่วยงานไปเรียกรายชื่อ
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
}
|
||||
// async function fecthlistPerson() {
|
||||
// await http
|
||||
// .get(config.API.profileOrganizRoot)
|
||||
// .then((res) => {
|
||||
// const id = res.data.result[0].id;
|
||||
// if (id !== "") {
|
||||
// findlist(id); // id หน่วยงานไปเรียกรายชื่อ
|
||||
// }
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// });
|
||||
// }
|
||||
|
||||
const formFilter = reactive({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
searchField: "citizenId",
|
||||
searchKeyword: "",
|
||||
});
|
||||
|
||||
/**
|
||||
* function เรียกรายชื่อลูกจ้างตาม id หน่วยงาน
|
||||
* @param id id หน่วยงาน
|
||||
*/
|
||||
async function findlist(id: string) {
|
||||
let data = [{}];
|
||||
// ข้าราชการ
|
||||
if (employeeClass.value === "officer") {
|
||||
data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
|
||||
// ลูกจ้างประจำ
|
||||
} else if (employeeClass.value === "employee") {
|
||||
data = [
|
||||
{ criteriaType: "is_retire", criteriaValue: "false" },
|
||||
{ criteriaType: "employee_class", criteriaValue: "perm" },
|
||||
];
|
||||
}
|
||||
await http
|
||||
.post(config.API.profileSearchNewOcIdType(id, employeeClass.value), {
|
||||
criterias: data,
|
||||
})
|
||||
showLoader();
|
||||
|
||||
http
|
||||
.get(config.API.registryNew(""), { params: formFilter })
|
||||
.then((res) => {
|
||||
listPerson.value = res.data.result;
|
||||
console.log();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
// let data = [{}];
|
||||
// // ข้าราชการ
|
||||
// if (employeeClass.value === "officer") {
|
||||
// data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
|
||||
// // ลูกจ้างประจำ
|
||||
// } else if (employeeClass.value === "employee") {
|
||||
// data = [
|
||||
// { criteriaType: "is_retire", criteriaValue: "false" },
|
||||
// { criteriaType: "employee_class", criteriaValue: "perm" },
|
||||
// ];
|
||||
// }
|
||||
// await http
|
||||
// .post(config.API.profileSearchNewOcIdType(id, employeeClass.value), {
|
||||
// criterias: data,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// listPerson.value = res.data.result;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -112,29 +112,29 @@ async function onSubmit(type: string, id: string) {
|
|||
|
||||
/** function เรียกหน่วยงาน*/
|
||||
async function fetchOrgList() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.typeOc())
|
||||
.then(async (response: any) => {
|
||||
const orgArr = response.data.result.map((e: any) => ({
|
||||
id: e.organizationId,
|
||||
name: e.organizationName,
|
||||
}));
|
||||
OrgList.value = orgArr;
|
||||
OrgList2.value = [
|
||||
{
|
||||
id: "00000000-0000-0000-0000-000000000000",
|
||||
name: "สำนักนายกรัฐมนตรี",
|
||||
},
|
||||
...orgArr,
|
||||
];
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.typeOc())
|
||||
// .then(async (response: any) => {
|
||||
// const orgArr = response.data.result.map((e: any) => ({
|
||||
// id: e.organizationId,
|
||||
// name: e.organizationName,
|
||||
// }));
|
||||
// OrgList.value = orgArr;
|
||||
// OrgList2.value = [
|
||||
// {
|
||||
// id: "00000000-0000-0000-0000-000000000000",
|
||||
// name: "สำนักนายกรัฐมนตรี",
|
||||
// },
|
||||
// ...orgArr,
|
||||
// ];
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
}
|
||||
|
||||
/** hook*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue