เครื่องราชฯ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-08 16:01:15 +07:00
parent ff7b22f1d6
commit 2c924d24d5
7 changed files with 310 additions and 312 deletions

View file

@ -39,7 +39,7 @@ const returndate = ref<Date | null>();
const reason = ref<string>("");
const listPerson = ref<any>([]);
const OrgList = ref<DataOption[]>([]);
const filterOrgList = ref<any>([]);
const filterOrgList = ref<DataOption[]>([]);
const insigniaNoteProfileId = ref<string>("");
const filterSelectRound = ref<any>();
const selectRound = ref<any>();
@ -124,25 +124,32 @@ async function fecthlistInsignia() {
}
/** 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;
// filterOrgList.value = OrgList.value;
// })
// .catch((err) => {
// messageError($q, err);
// })
// .finally(() => {
// hideLoader();
// });
// }
/** funcion เรียกข้อมูลหน่วยงานจัดสรรเครื่องราชอิสริยาภรณ์ */
async function fetchOrgList() {
http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
http
.get(config.API.orgByid(data.activeId))
.then(async (res) => {
const data = await res.data.result.map((item: any) => ({
id: item.orgTreeId,
name: item.orgName,
}));
OrgList.value = data;
filterOrgList.value = data;
})
.catch((err) => {
messageError($q, err);
});
})
.catch((err) => {
messageError($q, err);
});
}
// -
// const fetchData = async () => {
@ -172,7 +179,6 @@ async function onSubmit() {
.then(async () => {
await props.closeAndFecth();
await clearData();
// await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
@ -189,7 +195,6 @@ async function onSubmit() {
.then(async () => {
await props.closeAndFecth();
await clearData();
// await hideLoader();
await success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
@ -215,7 +220,6 @@ async function searchcardid() {
?.shortName || ""
})`;
insigniaNoteProfileId.value = node.id;
insigniaNoteProfileId.value = node.id;
hideLoader();
} else {
notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้");
@ -229,7 +233,6 @@ async function searchcardid() {
fullName.value = "";
brand.value = "";
receivedate.value = null;
// OrganazationId.value = "";
}
}
@ -281,11 +284,13 @@ onMounted(() => {
/** function callback เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล */
watch(props, () => {
// type.value = props.type;
if (props.modal == true && props.roundId != "all") {
roundNo.value = props.roundId;
fecthlistInsignia();
// fetchOrgList();
if (props.action === "editData") {
fetchOrgList();
} else {
fecthlistInsignia();
}
}
});
</script>
@ -484,27 +489,27 @@ watch(props, () => {
</datepicker>
</div>
<!-- <div class="col-xs-12 col-sm-6">
<q-select
hide-bottom-space
:options="filterOrgList"
dense
lazy-rules
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
use-input
v-model="OrganazationId"
:label="`เลือกหน่วยงานที่ส่งคืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
@filter="(inputValue:any,
<div class="col-xs-12 col-sm-6">
<q-select
hide-bottom-space
:options="filterOrgList"
dense
lazy-rules
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
use-input
v-model="OrganazationId"
:label="`เลือกหน่วยงานที่ส่งคืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
) "
/>
</div> -->
/>
</div>
<div class="col-12">
<q-input