ข้อความเตือน เครื่องราชฯ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-04 18:15:00 +07:00
parent 3d4e47ca8c
commit 542f4d332e
3 changed files with 114 additions and 49 deletions

View file

@ -12,7 +12,8 @@ import DialogEdit from "@/modules/07_insignia/components/4_Allocate/DialogEdit.v
import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main"; import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main";
import type { QTableProps, QInput } from "quasar"; import type { QTableProps, QInput } from "quasar";
import { useQuasar } from "quasar"; import { Loading, useQuasar } from "quasar";
import type { load } from "@/router/loader";
const DataStore = useAllocateDataStore(); const DataStore = useAllocateDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -45,24 +46,28 @@ const profileType = ref<string>("");
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const roundYear = ref<number>(); const roundYear = ref<number>();
const insigniaOp = ref<any>([]); const insigniaOp = ref<any>([]);
const loadView = ref<boolean>(false);
onMounted(async () => { onMounted(async () => {
await fecthRound(); await fecthRound();
await fecthInsigniaType(); // await fecthInsigniaType();
}); });
const fecthRound = async () => { const fecthRound = async () => {
await http await http
.get(config.API.noteround()) .get(config.API.noteround())
.then((res) => { .then(async (res) => {
let data = res.data.result; let data = res.data.result;
selectRoundOption.value = data.map((e: any) => ({ if (data.length !== 0) {
id: e.id, selectRoundOption.value = data.map((e: any) => ({
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), id: e.id,
year: e.year, name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
})); year: e.year,
selectRound.value = data[0].id; }));
roundYear.value = data[0].year; selectRound.value = data[0].id;
roundYear.value = data[0].year;
await fecthInsigniaType();
}
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -92,6 +97,7 @@ const fecthInsigniaType = async () => {
let data = res.data.result; let data = res.data.result;
DataStore.fetchDatainsigniaType(data); DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name; tab.value = DataStore.insigniaType[0].name;
loadView.value = true;
fecthInsignia(); fecthInsignia();
}) })
.catch((err) => { .catch((err) => {
@ -281,7 +287,12 @@ const resetFilter = () => {
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
ดสรรเครองราชอสรยาภรณ ดสรรเครองราชอสรยาภรณ
</div> </div>
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders"> <q-card
flat
bordered
class="col-12 q-my-md q-mt-sm rounded-borders"
v-if="loadView"
>
<div class="bg-grey-1 col-12 row items-center"> <div class="bg-grey-1 col-12 row items-center">
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div> <div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
<selector <selector
@ -520,6 +531,14 @@ const resetFilter = () => {
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</q-card> </q-card>
<q-card v-else>
<div class="q-pa-md q-gutter-sm">
<q-banner inline-actions rounded class="bg-grey-1 text-center">
ไมอมลรอบการเสนอขอพระราชทานเครองราชอสรยาภรณ
</q-banner>
</div>
</q-card>
<DialogForm <DialogForm
:modal="modal" :modal="modal"
:save="save" :save="save"
@ -535,5 +554,4 @@ const resetFilter = () => {
:actionType="actionType" :actionType="actionType"
/> />
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View file

@ -26,42 +26,50 @@ const action = ref<string>("");
const profileId = ref<string>(""); const profileId = ref<string>("");
const roundYear = ref<any>(); const roundYear = ref<any>();
const insigniaList = ref<any>([]); const insigniaList = ref<any>([]);
const loadView = ref<boolean>(false);
onMounted(async () => { onMounted(async () => {
await fecthRound(); await fecthRound();
await fecthInsigniaType(); // await fecthInsigniaType();
}); });
const fecthRound = async () => { const fecthRound = async () => {
showLoader();
await http await http
.get(config.API.noteround()) .get(config.API.noteround())
.then((res) => { .then(async (res) => {
let data = res.data.result; let data = res.data.result;
selectRoundAllOption.value = [ if (data.length !== 0) {
{ await fecthInsigniaType();
name: "ทั้งหมด", selectRoundAllOption.value = [
id: "0", {
year: 0, name: "ทั้งหมด",
}, id: "0",
]; year: 0,
data.map((e: any) => { },
selectRoundOption.value.push({ ];
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), data.map((e: any) => {
id: e.id, selectRoundOption.value.push({
year: e.year, name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
id: e.id,
year: e.year,
});
selectRoundAllOption.value.push({
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
id: e.id,
year: e.year,
});
}); });
selectRoundAllOption.value.push({
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
id: e.id,
year: e.year,
});
});
selectRound.value = data[0].id; selectRound.value = data[0].id;
yearRound.value = data[0].year; yearRound.value = data[0].year;
roundYear.value = data[0].year; roundYear.value = data[0].year;
}
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader();
}); });
}; };
@ -73,7 +81,7 @@ const fecthInsignia = async () => {
DataStore.fetchDataInsignia(data); DataStore.fetchDataInsignia(data);
}) })
.catch((err) => { .catch((err) => {
console.log(err); messageError($q, err);
}) })
.finally(async () => { .finally(async () => {
insigniaList.value = await DataStore.insigniaOp.filter( insigniaList.value = await DataStore.insigniaOp.filter(
@ -88,11 +96,13 @@ const fecthInsigniaType = async () => {
let data = res.data.result; let data = res.data.result;
DataStore.fetchDatainsigniaType(data); DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name; tab.value = DataStore.insigniaType[0].name;
loadView.value = true;
await fecthInsignia(); await fecthInsignia();
}) })
.catch((err) => { .catch((err) => {
console.log(err); messageError($q, err);
}); })
.finally(() => {});
}; };
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([
@ -367,7 +377,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
-นเครองราชฯ -นเครองราชฯ
</div> </div>
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders"> <q-card
flat
bordered
class="col-12 q-my-md q-mt-sm rounded-borders"
v-if="loadView == tr"
>
<q-tabs <q-tabs
dense dense
v-model="tab" v-model="tab"
@ -553,6 +568,13 @@ const paginationLabel = (start: number, end: number, total: number) => {
:type-id="tab" :type-id="tab"
/> />
</q-card> </q-card>
<q-card v-else>
<div class="q-pa-md q-gutter-sm">
<q-banner inline-actions rounded class="bg-grey-1 text-center">
ไมอมลรอบการเสนอขอพระราชทานเครองราชอสรยาภรณ
</q-banner>
</div>
</q-card>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.arrow { .arrow {

View file

@ -33,24 +33,33 @@ const personId = ref<string>();
const profileType = ref<string>(""); const profileType = ref<string>("");
const fileResult = ref<any>(null); const fileResult = ref<any>(null);
const fileinvoice = ref<any>(null); const fileinvoice = ref<any>(null);
const loadView = ref<boolean>(false);
onMounted(async () => { onMounted(async () => {
await fecthRound(); await fecthRound();
await fecthInsignia(); // await fecthInsignia();
await fecthInsigniaType(); // await fecthInsigniaType();
}); });
const fecthRound = async () => { const fecthRound = async () => {
showLoader();
await http await http
.get(config.API.noteround()) .get(config.API.noteround())
.then((res) => { .then(async (res) => {
let data = res.data.result; let data = res.data.result;
selectRoundOption.value = data.map((e: any) => ({ if (data.length !== 0) {
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543), selectRoundOption.value = data.map((e: any) => ({
id: e.id, name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
})); id: e.id,
selectRound.value = data[0].id; }));
selectRound.value = data[0].id;
await fecthInsignia();
await fecthInsigniaType();
}
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
})
.finally(() => {
hideLoader();
}); });
}; };
const fecthInsignia = async () => { const fecthInsignia = async () => {
@ -62,6 +71,7 @@ const fecthInsignia = async () => {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
console.log("fecthInsignia");
}); });
}; };
const fecthInsigniaType = async () => { const fecthInsigniaType = async () => {
@ -70,9 +80,12 @@ const fecthInsigniaType = async () => {
let data = res.data.result; let data = res.data.result;
DataStore.fetchDatainsigniaType(data); DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name; tab.value = DataStore.insigniaType[0].name;
loadView.value = true;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
console.log("fecthInsigniaType");
}); });
}; };
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([
@ -375,7 +388,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
<div class="toptitle text-dark col-12 row items-center"> <div class="toptitle text-dark col-12 row items-center">
นทกผลการไดบพระราชทานเครองราชอสรยาภรณ/การจายใบกำก นทกผลการไดบพระราชทานเครองราชอสรยาภรณ/การจายใบกำก
</div> </div>
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders"> <q-card
flat
bordered
class="col-12 q-my-md q-mt-sm rounded-borders"
v-if="loadView == true"
>
<div class="bg-grey-1 col-12 row items-center"> <div class="bg-grey-1 col-12 row items-center">
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div> <div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
<div> <div>
@ -655,6 +673,13 @@ const paginationLabel = (start: number, end: number, total: number) => {
:profileType="profileType" :profileType="profileType"
/> />
</q-card> </q-card>
<q-card v-else>
<div class="q-pa-md q-gutter-sm">
<q-banner inline-actions rounded class="bg-grey-1 text-center">
ไมอมลรอบการเสนอขอพระราชทานเครองราชอสรยาภรณ
</q-banner>
</div>
</q-card>
<q-dialog v-model="modelPerview"> <q-dialog v-model="modelPerview">
<q-card style="width: 850px; max-width: 80vw"> <q-card style="width: 850px; max-width: 80vw">