+
diff --git a/src/modules/07_insignia/components/4_Allocate/Main.vue b/src/modules/07_insignia/components/4_Allocate/Main.vue
index b6f8d2840..ad2a6704d 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,14 @@ 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 selectorRound = (round: string) => {
selectRound.value = round;
const yearFilter = selectRoundOption.value.find((x: any) => x.id == round);
@@ -182,18 +178,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 +202,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 +209,6 @@ const clickEditrow = (data: any) => {
rowData.value = data;
modalEdit.value = true;
actionType.value = "insignia";
- console.log(data);
};
const save = async (insigniaId: string, total: string) => {
@@ -254,7 +231,12 @@ const save = async (insigniaId: string, total: string) => {
close();
});
};
-const saveEdit = async (insigniaId: string, total: Number, year: Number) => {
+const saveEdit = async (
+ id: string,
+ insigniaId: string,
+ total: Number,
+ year: Number
+) => {
showLoader();
let body = {
insignia: insigniaId,
@@ -262,7 +244,7 @@ const saveEdit = async (insigniaId: string, total: Number, year: Number) => {
total: Number(total),
};
await http
- .put(config.API.insigniaManageById(insigniaId), body)
+ .put(config.API.insigniaManageById(id), body)
.then(async () => {
success($q, "แก้ไขข้อมูลสำเร็จ");
await fecthlistInsignia();
@@ -341,10 +323,14 @@ const resetFilter = () => {
-
-
-
-
+
+
+
{
:readonly="false"
:borderless="false"
style="min-width: 150px"
- @update:model-value="selectorInsignia"
+ @update:model-value="DataStore.selectInsignia"
/>
@@ -378,9 +364,7 @@ const resetFilter = () => {
เพิ่ม
-
-
{
{
-
-
-
-
-
-
- เพิ่ม
-
-
-
-
-
-
-
-
-
- บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์
-
-
-
- บันทึกผลการจ่ายใบกำกับ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ props.rowIndex + 1 }}
-
-
-
-
- แก้ไขข้อมูล
-
-
-
-
- {{ props.value }}
-
-
-
-
-
-
-
-
-
-
-
- เพิ่ม
-
-
-
-
-
-
-
-
-
- บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์
-
-
-
- บันทึกผลการจ่ายใบกำกับ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ props.rowIndex + 1 }}
-
-
-
-
- แก้ไขข้อมูล
-
-
-
-
- {{ props.value }}
-
-
-
-
-
-
-
-
-
+
+
+
();
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..ace861f76 100644
--- a/src/modules/07_insignia/storeAllocate.ts
+++ b/src/modules/07_insignia/storeAllocate.ts
@@ -7,80 +7,42 @@ 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 +51,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", () => {