diff --git a/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue b/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue index ab6721bbe..d9367d099 100644 --- a/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue +++ b/src/modules/07_insignia/components/4_Allocate/DialogEdit.vue @@ -29,7 +29,6 @@ const props = defineProps({ }); watch(props, () => { if (props.modal === true) { - console.log(props.insigniadata); amount.value = props.insigniadata.total; if (props.actionType === "insignia") { title.value = props.insigniadata.insignia; diff --git a/src/modules/07_insignia/components/4_Allocate/DialogForm.vue b/src/modules/07_insignia/components/4_Allocate/DialogForm.vue index bae0b4ea6..f5a54922e 100644 --- a/src/modules/07_insignia/components/4_Allocate/DialogForm.vue +++ b/src/modules/07_insignia/components/4_Allocate/DialogForm.vue @@ -7,9 +7,7 @@ import { useRouter } from "vue-router"; const $q = useQuasar(); const myForm = ref(); const mixin = useCounterMixin(); -const { - dialogConfirm, -} = mixin; +const { dialogConfirm } = mixin; const router = useRouter(); const routeName = router.currentRoute.value.name; const amount = ref(); @@ -31,18 +29,17 @@ const props = defineProps({ }, insigniaList: { type: Array, - default: [] + default: [], }, }); watch(props, () => { - if (props.modal) { - grandCross.value = "" - Org.value = "" - amount.value = null + if (props.modal === false) { + grandCross.value = ""; + Org.value = ""; + amount.value = null; } - console.log("insigniaList===>", props.insigniaList) -}) +}); const clickSave = () => { dialogConfirm($q, () => props.save(grandCross.value, amount.value)); @@ -54,22 +51,53 @@ const clickSave = () => { จัดสรรเครื่องราชฯ - +
-
+
- +
- +
diff --git a/src/modules/07_insignia/components/4_Allocate/Main.vue b/src/modules/07_insignia/components/4_Allocate/Main.vue index b6f8d2840..fd950075e 100644 --- a/src/modules/07_insignia/components/4_Allocate/Main.vue +++ b/src/modules/07_insignia/components/4_Allocate/Main.vue @@ -4,7 +4,7 @@ import { ref, onMounted, watch, useAttrs } from "vue"; import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useResultDataStore } from "@/modules/07_insignia/storeAllocate"; +import { useAllocateDataStore } from "@/modules/07_insignia/storeAllocate"; import type { FormProprsalsRound } from "@/modules/07_insignia/interface/request/Main"; import router from "@/router"; import DialogForm from "@/modules/07_insignia/components/4_Allocate/DialogForm.vue"; @@ -14,7 +14,7 @@ import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main" import type { QTableProps, QInput } from "quasar"; import { useQuasar } from "quasar"; -const DataStore = useResultDataStore(); +const DataStore = useAllocateDataStore(); const mixin = useCounterMixin(); const { showLoader, hideLoader, messageError, dialogRemove, success } = mixin; @@ -95,7 +95,7 @@ const fecthInsigniaType = async () => { DataStore.fetchDatainsigniaType(data); tab.value = DataStore.insigniaType[0].name; - fecthlistInsignia(); + // fecthlistInsignia(); fecthInsignia(); }) .catch((err) => { @@ -158,18 +158,17 @@ const columns = ref([ style: "font-size: 14px", }, ]); -const rows = ref([]); - watch(tab, () => { insigniaOp.value = DataStore.insigniaOp.filter( (x: any) => x.type == tab.value ); + DataStore.insignia = ""; fecthlistInsignia(); }); -const selectorInsignia = () => { - fecthlistInsignia(); -}; +// const selectorInsignia = () => { +// fecthlistInsignia(); +// }; const selectorRound = (round: string) => { selectRound.value = round; const yearFilter = selectRoundOption.value.find((x: any) => x.id == round); @@ -182,18 +181,7 @@ const fecthlistInsignia = async () => { .get(config.API.insigniaManageType(tab.value, Number(roundYear.value))) .then((res) => { let data = res.data.result; - rows.value = []; - // console.log("dsata===>", data); - rows.value = data.map((e: any) => ({ - id: e.id, - insignia: e.insignia, - insigniaId: e.insigniaId, - total: e.total, - allocate: e.allocate, - remain: e.remain, - year: e.year, - // status: DataStore.status(e.status), - })); + DataStore.listinsignia(data); }) .catch((err) => { console.log(err); @@ -217,13 +205,6 @@ const addData = () => { action.value = "addData"; }; -const editData = (data: any) => { - personId.value = data.id; - profileType.value = data.profileType; - action.value = "editData"; - modal.value = true; -}; - const modalEdit = ref(false); const rowData = ref([]); const actionType = ref(""); @@ -231,7 +212,6 @@ const clickEditrow = (data: any) => { rowData.value = data; modalEdit.value = true; actionType.value = "insignia"; - console.log(data); }; const save = async (insigniaId: string, total: string) => { @@ -341,10 +321,14 @@ const resetFilter = () => { - -
-
-
+ + +
{ :readonly="false" :borderless="false" style="min-width: 150px" - @update:model-value="selectorInsignia" + @update:model-value="DataStore.selectInsignia" />
@@ -378,9 +362,7 @@ const resetFilter = () => { เพิ่ม
- -
{ {
- -
-
- -
- - เพิ่ม - -
-
- - - - - - - บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์ - - - - บันทึกผลการจ่ายใบกำกับ - - - - -
- - - -
- - - - - - -
-
- - - - -
- -
-
- -
- - เพิ่ม - -
-
- - - - - - - บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์ - - - - บันทึกผลการจ่ายใบกำกับ - - - - -
- - -
- - - - - - -
-
- - - - -
-
-
- - + + + (); const mixin = useCounterMixin(); diff --git a/src/modules/07_insignia/components/5_Borrow/Main.vue b/src/modules/07_insignia/components/5_Borrow/Main.vue index d7339f75b..6b28dbf69 100644 --- a/src/modules/07_insignia/components/5_Borrow/Main.vue +++ b/src/modules/07_insignia/components/5_Borrow/Main.vue @@ -3,7 +3,7 @@ import { ref, onMounted, watch } from "vue"; import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import { useResultDataStore } from "@/modules/07_insignia/storeAllocate"; +import { useAllocateDataStore } from "@/modules/07_insignia/storeAllocate"; import DialogForm from "@/modules/07_insignia/components/5_Borrow/DialogForm.vue"; @@ -12,7 +12,7 @@ import type { QTableProps, QInput } from "quasar"; import { useQuasar } from "quasar"; // const router = useRouter(); -const DataStore = useResultDataStore(); +const DataStore = useAllocateDataStore(); const mixin = useCounterMixin(); const { date2Thai, diff --git a/src/modules/07_insignia/storeAllocate.ts b/src/modules/07_insignia/storeAllocate.ts index 9137c446b..0267489c0 100644 --- a/src/modules/07_insignia/storeAllocate.ts +++ b/src/modules/07_insignia/storeAllocate.ts @@ -7,80 +7,43 @@ const { date2Thai, } = mixin; -export const useResultDataStore = defineStore("insigniaResult", () => { +export const useAllocateDataStore = defineStore("insigniaallocate", () => { const insigniaName = ref('') const insignia = ref('') const insigniaOp = ref([{ name: "ทั้งหมด", id: "", type: "" }]) - const insigniaOp2 = ref([]) const insigniaType = ref() - const invoiceType = ref('all') - const invoiceTypeop = ref([{ name: "ทั้งหมด", id: "all" }, { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" }, { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" }]) const rows = ref([]) const listInsignia = ref([]) const fetchDatainsignia = async (data: any) => { insignia.value = '' - invoiceType.value = 'all' insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }] data.forEach((e: any) => { insigniaOp.value.push({ name: e.name, id: e.id, type: e.insigniaType.id }) }); } - const fetchDatainsigniaType = async (data: any) => { insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name })) } - - const fetchlistinsignia = async (data: any) => { + const listinsignia = async (data: any) => { rows.value = []; - let alllist = await data.map((e: any) => ({ + let list = await data.map((e: any) => ({ id: e.id, - citizenId: e.citizenId, - prefix: e.prefix, - position: e.position, - status: status(e.status), - dateReceive: date2Thai(e.dateReceive), - name: e.fullName, - type: e.requestInsignia, - employeeType: profileType(e.profileType), - profileType: e.profileType, - page: e.page, - number: e.no, - vatnumber: e.number, - datepay: date2Thai(e.datePayment), - typepay: e.typePayment, - address: e.address, - })); - rows.value = alllist - listInsignia.value = alllist - selectInvoice(invoiceType.value) + insignia: e.insignia, + insigniaId: e.insigniaId, + total: e.total, + allocate: e.allocate, + remain: e.remain, + year: e.year, + })) + rows.value = list + listInsignia.value = list } - - const selectInvoice = (invoice: string) => { - console.log(invoice); - if (invoice === "noDate") { - let list = listInsignia.value.filter((e: any) => e.datepay === null) - rows.value = list - } else if (invoice === "haveDate") { - let list = listInsignia.value.filter((e: any) => e.datepay !== null) - rows.value = list - } else rows.value = listInsignia.value + const selectInsignia = () => { + console.log(insignia.value); + rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value) } - - const status = (val: string) => { - switch (val) { - case "PENDING": - return "รอบันทึกข้อมูล"; - case "REJECT": - return "ยกเลิก"; - case "DELETE": - return "ลบ"; - case "DONE": - return "บันทึกลง ก.พ. 7 แล้ว"; - } - } - const profileType = (val: string) => { switch (val) { case "officer": @@ -89,21 +52,16 @@ export const useResultDataStore = defineStore("insigniaResult", () => { return "ลูกจ้างประจำ"; } } - return { rows, insignia, insigniaOp, - insigniaOp2, insigniaType, - invoiceType, - invoiceTypeop, fetchDatainsignia, fetchDatainsigniaType, - status, + listinsignia, + selectInsignia, profileType, - fetchlistinsignia, - selectInvoice, insigniaName }; }); diff --git a/src/modules/07_insignia/storeResult.ts b/src/modules/07_insignia/storeResult.ts index 1bebf583c..d54d03c2b 100644 --- a/src/modules/07_insignia/storeResult.ts +++ b/src/modules/07_insignia/storeResult.ts @@ -5,11 +5,7 @@ import { useCounterMixin } from "@/stores/mixin"; const mixin = useCounterMixin(); const { date2Thai, - dialogConfirm, - showLoader, - hideLoader, - messageError, - success, + } = mixin; export const useResultDataStore = defineStore("insigniaResult", () => {