diff --git a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue index 328b23924..3d6069993 100644 --- a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue +++ b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue @@ -8,8 +8,11 @@ import type { DataOption } from "@/modules/04_registry/components/profileType"; import type { ItemType } from "@/modules/07_insignia/interface/request/Main"; import DialogHeader from "@/components/DialogHeader.vue"; +import { useBrrowDataStore } from "@/modules/07_insignia/storeBrrow"; + const $q = useQuasar(); const myForm = ref(); +const DataStore = useBrrowDataStore(); const mixin = useCounterMixin(); const { date2Thai, @@ -35,7 +38,7 @@ const filterOrgList = ref([]); const insigniaNoteProfileId = ref(""); const filterSelectRound = ref(); const selectRound = ref(); -const type = ref(); +const type = ref(DataStore.type); // เคลียร์ข้อมูลในฟอร์ม const clearData = () => { receivedate.value = null; @@ -88,7 +91,7 @@ const props = defineProps({ // เช็ค props ถ้าเปิด dialog ให้ดึงรายการข้อมูล watch(props, () => { - type.value = props.type; + // type.value = props.type; if (props.modal == true && props.roundId != "all") { roundNo.value = props.roundId; fecthlistInsignia(); @@ -220,25 +223,28 @@ const clickSave = async () => { // ค้นหาคนจากเลขประจำตัวประชาชน const searchcardid = async () => { + showLoader(); if (cardid.value.length === 13) { const node = await listPerson.value.find( (e: any) => e.citizenId === cardid.value ); if (node) { - fullName.value = `${node.prefix} ${node.fullName}`; + fullName.value = ` ${node.fullName}`; brand.value = `${node.requestInsignia} (${ type.value.find((item: any) => item.name === node.requestInsignia) ?.shortName || "" })`; insigniaNoteProfileId.value = node.id; insigniaNoteProfileId.value = node.id; + hideLoader(); } else { notifyError($q, "ไม่พบข้อมูลการได้รับในรอบนี้"); fullName.value = ""; brand.value = ""; OrganazationId.value = ""; reason.value = ""; + hideLoader(); } } }; diff --git a/src/modules/07_insignia/components/5_Borrow/Main.vue b/src/modules/07_insignia/components/5_Borrow/Main.vue index a6963b395..55c0681b0 100644 --- a/src/modules/07_insignia/components/5_Borrow/Main.vue +++ b/src/modules/07_insignia/components/5_Borrow/Main.vue @@ -22,7 +22,7 @@ const selectRoundOption = ref([]); const filterSelectRoundOption = ref([]); const selectRoundAllOption = ref([]); const filterSelectRoundAllOption = ref([]); -const type = ref(DataStore.type) +const type = ref(DataStore.type); const modal = ref(false); const action = ref(""); const profileId = ref(""); @@ -64,7 +64,6 @@ const fecthRound = async () => { filterSelectRoundAllOption.value = selectRoundAllOption.value; selectRound.value = data[0].id; filterSelectRoundOption.value = selectRoundOption.value; - console.log(filterSelectRoundOption.value); yearRound.value = data[0].year; roundYear.value = data[0].year; if (roundYear.value) { @@ -109,7 +108,7 @@ const fecthInsigniaType = async () => { .catch((err) => { messageError($q, err); }) - .finally(() => { }); + .finally(() => {}); }; const visibleColumns = ref([ @@ -438,23 +437,54 @@ const clearInsigniaFilters = (name: string) => {
ยืม-คืนเครื่องราชฯ
- - + +
- +
- + )" + >