เครื่องราช
This commit is contained in:
parent
08455521f2
commit
249ec6c9ee
7 changed files with 53 additions and 48 deletions
|
|
@ -909,7 +909,7 @@ onMounted(async () => {
|
|||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 180px"
|
||||
style="min-width: 320px"
|
||||
@update:model-value="
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ onMounted(async () => {
|
|||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 180px"
|
||||
style="min-width: 320px"
|
||||
@update:model-value="
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ onMounted(async () => {
|
|||
:borderless="false"
|
||||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 180px"
|
||||
style="min-width: 320px"
|
||||
@update:model-value="
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
|
|
|
|||
|
|
@ -177,13 +177,27 @@ const formFilter = reactive({
|
|||
* function เรียกรายชื่อลูกจ้างตาม id หน่วยงาน
|
||||
* @param id id หน่วยงาน
|
||||
*/
|
||||
async function findlist(id: string) {
|
||||
showLoader();
|
||||
|
||||
async function findlist(id: string = "", idCard: string) {
|
||||
formFilter.searchKeyword = idCard;
|
||||
http
|
||||
.get(config.API.registryNew(""), { params: formFilter })
|
||||
.get(
|
||||
config.API.registryNew(
|
||||
employeeClass.value === "officer" ? "" : "-employee"
|
||||
),
|
||||
{
|
||||
params: formFilter,
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
console.log();
|
||||
const data = res.data.result.data[0];
|
||||
if (data) {
|
||||
fullName.value = `${data.prefix}${data.firstName} ${data.lastName}`; // ชื่อ;
|
||||
position.value = data.position; // ตำแหน่ง
|
||||
} else {
|
||||
notifyError($q, "ไม่พบข้อมูลเลขประจำตัวประชาชนนี้");
|
||||
}
|
||||
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -224,7 +238,8 @@ async function findlist(id: string) {
|
|||
async function fectDataByid(id: string) {
|
||||
showLoader();
|
||||
if (props.profileType !== undefined) {
|
||||
employeeClass.value = props.profileType.toString();
|
||||
// employeeClass.value = props.profileType.toString();
|
||||
employeeClass.value = "officer";
|
||||
}
|
||||
await http
|
||||
.get(config.API.noteByid(id))
|
||||
|
|
@ -298,11 +313,7 @@ async function onSubmit() {
|
|||
/** function หาเลขประจำตัวประชาชน*/
|
||||
function searchcardid() {
|
||||
if (cardid.value.length === 13) {
|
||||
let data = listPerson.value.find((e: any) => e.citizenId === cardid.value);
|
||||
if (data) {
|
||||
fullName.value = data.fullname; // ชื่อ
|
||||
position.value = data.positionEmployeePosition; // ตำแหน่ง
|
||||
} else notifyError($q, "ไม่พบข้อมูลเลขประจำตัวประชาชนนี้");
|
||||
findlist("", cardid.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
div
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { QForm, useQuasar } from "quasar";
|
||||
|
|
@ -112,39 +111,36 @@ 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.insigniaOrg)
|
||||
.then(async (response: any) => {
|
||||
const orgArr = response.data.result.map((e: any) => ({
|
||||
id: e.id,
|
||||
name: e.name + `(${e.shortName})`,
|
||||
}));
|
||||
OrgList.value = orgArr;
|
||||
OrgList2.value = orgArr;
|
||||
// [
|
||||
// {
|
||||
// id: "00000000-0000-0000-0000-000000000000",
|
||||
// name: "สำนักนายกรัฐมนตรี",
|
||||
// },
|
||||
// ...orgArr,
|
||||
// ];
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** hook*/
|
||||
onMounted(() => {
|
||||
fetchOrgList();
|
||||
});
|
||||
|
||||
/** callback function จำทำงานเมื่อ props มีการเปลี่ยนแปลง*/
|
||||
watch(props, () => {
|
||||
if (props.dataModal) {
|
||||
fetchOrgList();
|
||||
Datereceive.value = props.dataModal.dateReceiveInsignia;
|
||||
Datereturn.value = props.dataModal.dateReturnInsignia;
|
||||
OrganazationId.value = props.dataModal.orgReceiveInsignia;
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ async function fecthRound() {
|
|||
DataStore.roundId = selectRound.value;
|
||||
}
|
||||
if (roundYear.value) {
|
||||
await fecthInsignia();
|
||||
await fecthInsigniaType();
|
||||
}
|
||||
}
|
||||
|
|
@ -159,7 +160,6 @@ const fecthInsigniaType = async () => {
|
|||
tab.value = DataStore.mainTab;
|
||||
} else tab.value = DataStore.insigniaType[0].name;
|
||||
loadView.value = true;
|
||||
fecthInsignia();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -245,8 +245,6 @@ async function fecthRound() {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
@ -436,12 +434,12 @@ async function perviewfile(event: any, actionType: string) {
|
|||
typepay: e.typePayment,
|
||||
address: e.address,
|
||||
}));
|
||||
modelPerview.value = true;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
modelPerview.value = true;
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
@ -661,7 +659,7 @@ onMounted(async () => {
|
|||
option-value="id"
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
style="width: 280px"
|
||||
style="width: 300px"
|
||||
@update:model-value="selectorInsignia"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'insigniaTypeFilter'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue