diff --git a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue index f7c4917d3..5d39e3105 100644 --- a/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue +++ b/src/modules/06_retirement/components/ExitInterview/exitRegistry.vue @@ -529,7 +529,7 @@ const getData = async () => { fullname.value = data.fullname ?? ""; prefix.value = data.prefix ?? ""; reasonWork.value = data.reasonWork ?? []; - reasonWorkOther.value = data.ReasonWorkOther ?? ""; + reasonWorkOther.value = data.reasonWorkOther ?? ""; timeThink.value = data.TimeThink ?? 0; exitFactor.value = data.exitFactor ?? []; exitFactorOther.value = data.exitFactorOther ?? 0; diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index 62aaf40e3..97525abd7 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -775,9 +775,11 @@ const fetchData = async (id: string) => { pathName: doc.pathName ?? "", fileName: doc.fileName ?? "", }); + console.log(doc.fileName); + }); } - + rows.value = list; dataDetail.value = data; organizationPositionOld.value = data.organizationPositionOld ?? ""; positionTypeOld.value = data.positionTypeOld ?? ""; 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 866b9c7fb..4077f71b1 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 { useBrrowDataStore } from "@/modules/07_insignia/storeBrrow"; 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 = useBrrowDataStore(); const mixin = useCounterMixin(); const { date2Thai, @@ -79,7 +79,7 @@ const fecthInsignia = async () => { .then((res) => { // console.log(res); let data = res.data.result; - DataStore.fetchDatainsignia(data); + DataStore.fetchDataInsignia(data); }) .catch((err) => { console.log(err); @@ -277,6 +277,7 @@ const columns = ref([ watch(tab, async () => { insigniaList.value = await DataStore.insigniaOp.filter((x: any) => x.type == tab.value || x.type == '') + DataStore.insignia = '' fecthlistInsignia(); }); diff --git a/src/modules/07_insignia/storeAllocate.ts b/src/modules/07_insignia/storeAllocate.ts index 86a9bad15..403e30f85 100644 --- a/src/modules/07_insignia/storeAllocate.ts +++ b/src/modules/07_insignia/storeAllocate.ts @@ -1,115 +1,60 @@ -import { defineStore } from "pinia"; -import { ref, } from "vue"; -import { useCounterMixin } from "@/stores/mixin"; - -const mixin = useCounterMixin(); -const { - date2Thai, -} = mixin; - -export const useResultDataStore = 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) => { - rows.value = []; - let alllist = await data.map((e: any) => ({ - id: e.id, - citizenId: e.citizenId, - prefix: e.prefix, - position: e.position, - status: status(e.status), - name: e.fullName, - type: e.requestInsignia, - requestInsigniaId: e.requestInsigniaId, - 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, - borrowOrganization: e.borrowOrganization, - borrowDate: e.borrowDate !== null ? date2Thai(e.borrowDate) : '-', - returnOrganization: e.returnOrganization, - returnDate: e.returnDate !== null ? date2Thai(e.returnDate) : '-', - returnReason: e.returnReason !== null ? e.returnReason : '-', - })); - rows.value = alllist - listInsignia.value = alllist - // selectInvoice(invoiceType.value) - - } - - // 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 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": - return "ข้าราชการ กทม.สามัญ"; - case "employee": - return "ลูกจ้างประจำ"; - } - } - - return { - rows, - listInsignia, - insignia, - insigniaOp, - insigniaOp2, - insigniaType, - invoiceType, - invoiceTypeop, - fetchDatainsignia, - fetchDatainsigniaType, - status, - profileType, - fetchlistinsignia, - // selectInvoice, - insigniaName - }; -}); +import { defineStore } from "pinia"; +import { ref, } from "vue"; + +export const useAllocateDataStore = defineStore("insigniaallocate", () => { + const insigniaName = ref('') + const insignia = ref('') + const insigniaOp = ref([{ name: "ทั้งหมด", id: "", type: "" }]) + const insigniaType = ref() + const rows = ref([]) + const listInsignia = ref([]) + + const fetchDatainsignia = async (data: any) => { + insignia.value = '' + 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 listinsignia = async (data: any) => { + rows.value = []; + let list = await 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, + })) + rows.value = list + listInsignia.value = list + } + const selectInsignia = () => { + console.log(insignia.value); + rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value) + } + const profileType = (val: string) => { + switch (val) { + case "officer": + return "ข้าราชการ กทม.สามัญ"; + case "employee": + return "ลูกจ้างประจำ"; + } + } + return { + rows, + insignia, + insigniaOp, + insigniaType, + fetchDatainsignia, + fetchDatainsigniaType, + listinsignia, + selectInsignia, + profileType, + insigniaName + }; +}); diff --git a/src/modules/07_insignia/storeBrrow.ts b/src/modules/07_insignia/storeBrrow.ts new file mode 100644 index 000000000..4a582d8e0 --- /dev/null +++ b/src/modules/07_insignia/storeBrrow.ts @@ -0,0 +1,97 @@ +import { defineStore } from "pinia"; +import { ref, } from "vue"; +import { useCounterMixin } from "@/stores/mixin"; + +const mixin = useCounterMixin(); +const { + date2Thai, +} = mixin; + +export const useBrrowDataStore = defineStore("insigniaBrrow", () => { + const insignia = ref('') + const insigniaOp = ref([{ name: "ทั้งหมด", id: "", type: "" }]) + const insigniaType = ref() + const rows = ref([]) + const listInsignia = ref([]) + + const fetchDataInsignia = async (data: any) => { + insignia.value = '' + 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) => { + rows.value = []; + let list = await data.map((e: any) => ({ + id: e.id, + citizenId: e.citizenId, + prefix: e.prefix, + position: e.position, + status: status(e.status), + name: e.fullName, + type: e.requestInsignia, + requestInsigniaId: e.requestInsigniaId, + 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, + borrowOrganization: e.borrowOrganization, + borrowDate: e.borrowDate !== null ? date2Thai(e.borrowDate) : '-', + returnOrganization: e.returnOrganization, + returnDate: e.returnDate !== null ? date2Thai(e.returnDate) : '-', + returnReason: e.returnReason !== null ? e.returnReason : '-', + })); + rows.value = list + listInsignia.value = list + // selectInvoice(invoiceType.value) + } + + const status = (val: string) => { + switch (val) { + case "PENDING": + return "รอบันทึกข้อมูล"; + case "REJECT": + return "ยกเลิก"; + case "DELETE": + return "ลบ"; + case "DONE": + return "บันทึกลง ก.พ. 7 แล้ว"; + } + } + + const selectInsignia = () => { + console.log(insignia.value); + rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value) + } + + const profileType = (val: string) => { + switch (val) { + case "officer": + return "ข้าราชการ กทม.สามัญ"; + case "employee": + return "ลูกจ้างประจำ"; + } + } + + return { + rows, + listInsignia, + insignia, + insigniaOp, + insigniaType, + fetchDatainsigniaType, + fetchDataInsignia, + selectInsignia, + profileType, + fetchlistinsignia, + }; +}); 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", () => {