diff --git a/src/api/07_insignia/api.insignia.ts b/src/api/07_insignia/api.insignia.ts
index f125dfe64..0ca44d447 100644
--- a/src/api/07_insignia/api.insignia.ts
+++ b/src/api/07_insignia/api.insignia.ts
@@ -3,27 +3,37 @@
*/
import env from "../index";
const insignia = `${env.API_URI}/insignia`;
-const Organization = `${env.API_URI}/Organization`
+const report = `${env.API_REPORT2_URI}/report`;
+const Organization = `${env.API_URI}/Organization`;
export default {
getRoundInsignia: (id: string) => `${insignia}/period/${id}`,
listRoundInsignia: () => `${insignia}/period/`,
editRoundInsignia: (id: string) => `${insignia}/period/${id}`,
RoundInsignia: (id: string) => `${insignia}/period/${id}`,
- requestInsignia: (insigniaPeriodId: string) => `${insignia}/request/${insigniaPeriodId}`,
+ requestInsignia: (insigniaPeriodId: string) =>
+ `${insignia}/request/${insigniaPeriodId}`,
// Type
typeOc: () => `${Organization}/history/type/หน่วยงาน`,
-
// manage
insigniaManage: (type: string) => `${insignia}/manage/${type}`,
insigniaCreate: () => `${insignia}/request`,
- insigniaList: (insigniaPeriodId: any, ocId: string, role: string, status: any) => `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}`,
- insigniaReject: (profileId: string) => `${insignia}/request/status/reject/${profileId}`,
- insigniaDelete: (profileId: string) => `${insignia}/request/status/delete/${profileId}`,
+ insigniaList: (
+ insigniaPeriodId: any,
+ ocId: string,
+ role: string,
+ status: any
+ ) => `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}`,
+ insigniaReject: (profileId: string) =>
+ `${insignia}/request/status/reject/${profileId}`,
+ insigniaDelete: (profileId: string) =>
+ `${insignia}/request/status/delete/${profileId}`,
insigniaEdit: (profileId: string) => `${insignia}/request/${profileId}`,
- insigniaNosend: (insigniaPeriodId: any) => `${insignia}/request/org/no-send/${insigniaPeriodId}`,
+ insigniaNosend: (insigniaPeriodId: any) =>
+ `${insignia}/request/org/no-send/${insigniaPeriodId}`,
insigniaAgency: () => `${insignia}/request/agency`,
- insigniaDashboard: (insigniaPeriodId: string) => `${insignia}/request/dashboard/${insigniaPeriodId}`,
+ insigniaDashboard: (insigniaPeriodId: string) =>
+ `${insignia}/request/dashboard/${insigniaPeriodId}`,
// record
noteround: () => `${insignia}/request/note`,
requestDocNote: (id: string) => `${insignia}/request/note/doc/${id}`,
@@ -31,31 +41,58 @@ export default {
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
noteByid: (id: string) => `${insignia}/request/note/${id}`,
+ insigniaSendToDirector: (roundId: string, ocId: string) =>
+ `${insignia}/request/officer/approve/${roundId}/${ocId}`,
+ insigniaDirectorBackToEdit: (roundId: string, ocId: string) =>
+ `${insignia}/request/director/reject/${roundId}/${ocId}`,
+ insigniaDirectorApproved: (roundId: string, ocId: string) =>
+ `${insignia}/request/director/approve/${roundId}/${ocId}`,
+ insigniaRequestSendNote: (insigniaPeriodId: string) =>
+ `${insignia}/request/send/note/${insigniaPeriodId}`,
- insigniaSendToDirector: (roundId: string, ocId: string) => `${insignia}/request/officer/approve/${roundId}/${ocId}`,
- insigniaDirectorBackToEdit: (roundId: string, ocId: string) => `${insignia}/request/director/reject/${roundId}/${ocId}`,
- insigniaDirectorApproved: (roundId: string, ocId: string) => `${insignia}/request/director/approve/${roundId}/${ocId}`,
- insigniaRequestSendNote: (insigniaPeriodId: string) => `${insignia}/request/send/note/${insigniaPeriodId}`,
-
// insigniaRequestSendNote: (insigniaPeriodId: string) => `${insignia}/insignia/request/send/note/${insigniaPeriodId}`,
// uploadfile
- uploadfileInsignia: (type: string, noteId: string) => `${insignia}/request/import/${type}/${noteId}`,
- previewfileInsignia: (type: string,noteId: string) => `${insignia}/request/preview/${type}/${noteId}`,
+ uploadfileInsignia: (type: string, noteId: string) =>
+ `${insignia}/request/import/${type}/${noteId}`,
+ previewfileInsignia: (type: string, noteId: string) =>
+ `${insignia}/request/preview/${type}/${noteId}`,
// uploadfileinvoice: (noteId: string) => `${insignia}/request/import/invoice/${noteId}`,
// จัดสรรเครื่องราช
- insigniaManageType: (insigniaTypeId: string, year: number) => `${insignia}/manage/type/${year}/${insigniaTypeId}`,
+ insigniaManageType: (insigniaTypeId: string, year: number) =>
+ `${insignia}/manage/type/${year}/${insigniaTypeId}`,
insigniaManageAdd: () => `${insignia}/manage`,
- insigniaManageById: (insigniaManageId: string) => `${insignia}/manage/${insigniaManageId}`,
+ insigniaManageById: (insigniaManageId: string) =>
+ `${insignia}/manage/${insigniaManageId}`,
- insigniaManageOrg: (insigniaManageId: string) => `${insignia}/manage/org/${insigniaManageId}`,
+ insigniaManageOrg: (insigniaManageId: string) =>
+ `${insignia}/manage/org/${insigniaManageId}`,
insigniaManageOrgAdd: () => `${insignia}/manage/org`,
- insigniaManageOrgDashboard: (insigniaManageId: string) => `${insignia}/manage/org/dashboard/${insigniaManageId}`,
+ insigniaManageOrgDashboard: (insigniaManageId: string) =>
+ `${insignia}/manage/org/dashboard/${insigniaManageId}`,
// ยืม-คืนเครื่องราชฯ
insigniaManageBorrow: () => `${insignia}/manage/borrow`,
- insigniaManageBorrowReturn: (insigniaManageProfileId: string) => `${insignia}/manage/return/${insigniaManageProfileId}`,
- insigniaManageBorrowList: (year: number, insigniaTypeId: string) => `${insignia}/manage/borrow/${year}/${insigniaTypeId}`,
- insigniaManageBorrowById: (insigniaManageProfileId: string) => `${insignia}/manage/borrow/${insigniaManageProfileId}`,
-};
\ No newline at end of file
+ insigniaManageBorrowReturn: (insigniaManageProfileId: string) =>
+ `${insignia}/manage/return/${insigniaManageProfileId}`,
+ insigniaManageBorrowList: (year: number, insigniaTypeId: string) =>
+ `${insignia}/manage/borrow/${year}/${insigniaTypeId}`,
+ insigniaManageBorrowById: (insigniaManageProfileId: string) =>
+ `${insignia}/manage/borrow/${insigniaManageProfileId}`,
+
+ // InsigniaReport API รายงานระบบเครื่องราชอิสริยาภรณ์
+ // ******
+ // type = 39 : 39-แบบ ขร1 บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ ข้าราชการ ชั้นสายสะพาย
+ // type = 40 : 40-แบบ ขร2 บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ ข้าราชการ ชั้นต่ำกว่าสายสะพาย
+ // type = 41 : 41-แบบ ขร3 บัญชีรายชื่อข้าราชการผู้ขอพระราชทานเครื่องราชฯ
+ // type = 42 : 42-แบบ ขร4 บัญชีแสดงคุณสมบัติของข้าราชการซึ่งเสนอขอเครื่องราชฯ
+ // type = 43 : 43-บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี
+ // type = 44 : 44-บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ
+ // type = 45 : 45-บัญชีแสดงรายชื่อผู้ขอพระราชทานเหรียญจักรพรรดิมาลา
+ // type = 46 : 46-ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา
+ // ******
+ // fileType = pdf, docx หรือ xlsx
+ reportInsignia: (type: string, fileType: string, fileId: string) =>
+ `${report}/insignia/${type}/${fileType}/${fileId}`,
+};
diff --git a/src/modules/05_placement/components/PersonalList/TableDetail.vue b/src/modules/05_placement/components/PersonalList/TableDetail.vue
index c4942705d..373a25987 100644
--- a/src/modules/05_placement/components/PersonalList/TableDetail.vue
+++ b/src/modules/05_placement/components/PersonalList/TableDetail.vue
@@ -93,7 +93,6 @@ watch(props, () => {
}
});
-
const validateData = () => {
const selectedIds = personalForm.value.isProperty;
@@ -280,7 +279,7 @@ const putpersonalForm = async () => {
ภาค ค
รวมทั้งหมด
-
+
{{ personalForm.pointTotalA }}
@@ -295,8 +294,12 @@ const putpersonalForm = async () => {
{{ personalForm.pointTotal }}
-
+
-
-
-
- เลือกรูปภาพ
-
-
- ปิดหน้านี้
-
-
-
-
-
-
-
-
-
-
- {{ date2Thai(n.createdDate) }}
-
-
-
-
-
-
-
-
-
-
-
- เลือกรูปภาพ
-
-
-
-
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 027a0f341..470a4cba8 100644
--- a/src/modules/07_insignia/components/4_Allocate/Main.vue
+++ b/src/modules/07_insignia/components/4_Allocate/Main.vue
@@ -4,26 +4,22 @@ 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";
+import DialogEdit from "@/modules/07_insignia/components/4_Allocate/DialogEdit.vue";
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,
-
-} = mixin;
+const { showLoader, hideLoader, messageError, dialogRemove, success } = mixin;
const redirectToPage = (id: string, name: string) => {
- DataStore.insigniaName = name
+ DataStore.insigniaName = name;
router.push(`/insignia/allocate/org/${id}`);
};
const paging = ref
(true);
@@ -63,7 +59,7 @@ const fecthRound = async () => {
selectRoundOption.value = data.map((e: any) => ({
id: e.id,
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
- year: e.year
+ year: e.year,
}));
selectRound.value = data[0].id;
roundYear.value = data[0].year;
@@ -82,10 +78,13 @@ const fecthInsignia = async () => {
DataStore.fetchDatainsignia(data);
})
.catch((err) => {
- messageError($q, err)
- }).finally(async () => {
- insigniaOp.value = await DataStore.insigniaOp.filter((x: any) => x.type == tab.value)
+ messageError($q, err);
})
+ .finally(async () => {
+ insigniaOp.value = await DataStore.insigniaOp.filter(
+ (x: any) => x.type == tab.value || x.type === ""
+ );
+ });
};
const fecthInsigniaType = async () => {
@@ -96,7 +95,7 @@ const fecthInsigniaType = async () => {
DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name;
- fecthlistInsignia()
+ // fecthlistInsignia();
fecthInsignia();
})
.catch((err) => {
@@ -159,19 +158,18 @@ const columns = ref([
style: "font-size: 14px",
},
]);
-const rows = ref([]);
-
watch(tab, () => {
- insigniaOp.value = DataStore.insigniaOp.filter((x: any) => x.type == tab.value)
+ console.log(DataStore.insigniaOp);
+ insigniaOp.value = DataStore.insigniaOp.filter(
+ (x: any) => x.type == tab.value || x.type === ""
+ );
+ DataStore.insignia = "";
fecthlistInsignia();
});
-const selectorInsignia = () => {
- fecthlistInsignia();
-};
const selectorRound = (round: string) => {
selectRound.value = round;
- const yearFilter = selectRoundOption.value.find((x: any) => x.id == round)
+ const yearFilter = selectRoundOption.value.find((x: any) => x.id == round);
roundYear.value = yearFilter?.year;
};
@@ -181,17 +179,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,
- // status: DataStore.status(e.status),
- }));
+ DataStore.listinsignia(data);
})
.catch((err) => {
console.log(err);
@@ -202,12 +190,12 @@ const fecthlistInsignia = async () => {
});
};
-
const filterRef = ref();
const filter = ref("");
const close = () => {
modal.value = false;
+ modalEdit.value = false;
};
const addData = () => {
@@ -215,31 +203,78 @@ 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("");
+const clickEditrow = (data: any) => {
+ rowData.value = data;
+ modalEdit.value = true;
+ actionType.value = "insignia";
};
const save = async (insigniaId: string, total: string) => {
- showLoader()
+ showLoader();
await http
.post(config.API.insigniaManageAdd(), {
insignia: insigniaId,
year: `${roundYear.value}`,
total: total,
})
- .then((res) => {
- fecthlistInsignia();
+ .then(async () => {
+ success($q, "บันทึกข้อมูลสำเร็จ");
+ await fecthlistInsignia();
})
.catch((err) => {
- messageError($q, err)
- }).finally(() => {
+ messageError($q, err);
+ })
+ .finally(() => {
hideLoader();
close();
});
};
+const saveEdit = async (
+ id: string,
+ insigniaId: string,
+ total: Number,
+ year: Number
+) => {
+ showLoader();
+ let body = {
+ insignia: insigniaId,
+ year: year,
+ total: Number(total),
+ };
+ await http
+ .put(config.API.insigniaManageById(id), body)
+ .then(async () => {
+ success($q, "แก้ไขข้อมูลสำเร็จ");
+ await fecthlistInsignia();
+ })
+ .catch((err) => {
+ messageError($q, err);
+ })
+ .finally(() => {
+ hideLoader();
+ close();
+ });
+};
+const clickDelete = async (insigniaId: string) => {
+ dialogRemove($q, async () => {
+ showLoader();
+ await http
+ .delete(config.API.insigniaManageById(insigniaId))
+ .then(async () => {
+ success($q, "ลบข้อมูลสำเร็จ");
+ await fecthlistInsignia();
+ })
+ .catch((err) => {
+ messageError($q, err);
+ })
+ .finally(() => {
+ hideLoader();
+ });
+ });
+};
const resetFilter = () => {
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
@@ -255,66 +290,152 @@ const resetFilter = () => {
-
+
-
-
-
-
+
+
+
-
+
-
+
เพิ่ม
-
-
-
+
-
+
-
+
-
-
-
-
-
-
-
- เพิ่ม
-
-
-
-
-
-
-
-
-
- บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์
-
-
-
- บันทึกผลการจ่ายใบกำกับ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ props.rowIndex + 1 }}
-
-
-
-
- แก้ไขข้อมูล
-
-
-
-
- {{ props.value }}
-
-
-
-
-
-
-
-
-
-
-
- เพิ่ม
-
-
-
-
-
-
-
-
-
- บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์
-
-
-
- บันทึกผลการจ่ายใบกำกับ
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ props.rowIndex + 1 }}
-
-
-
-
- แก้ไขข้อมูล
-
-
-
-
- {{ props.value }}
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
diff --git a/src/modules/07_insignia/components/report/Report_01.vue b/src/modules/07_insignia/components/report/Report_01.vue
index 77a935cca..ecfb4563e 100644
--- a/src/modules/07_insignia/components/report/Report_01.vue
+++ b/src/modules/07_insignia/components/report/Report_01.vue
@@ -1,36 +1,55 @@
@@ -64,30 +172,85 @@ const backHistory = () => {
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+ ไฟล์ .PDF
+
+
+
+ ไฟล์ .docx
+
+
+
+ ไฟล์ .xlsx
+
+
+
+
+
+import { ref, onMounted } from "vue";
+import { VuePDF, usePDF } from "@tato30/vue-pdf";
+import { useCounterMixin } from "@/stores/mixin";
+import { useQuasar } from "quasar";
+import { useInsigniaDataStore } from "@/modules/07_insignia/store";
+
+import http from "@/plugins/http";
+import config from "@/app.config";
+
+import type { QForm } from "quasar";
+
+const store = useInsigniaDataStore();
+const mixin = useCounterMixin();
+const {
+ date2Thai,
+ messageError,
+ showLoader,
+ hideLoader,
+ dialogConfirm,
+ success,
+} = mixin;
+const { typeReport, titleReport } = store;
+const $q = useQuasar();
+
+const myForm = ref();
+const pdfSrc = ref();
+const numOfPages = ref(0);
+const page = ref(1);
+const dialog = ref(false);
+
+onMounted(async () => {
+ await fecthlistRound();
+ // const pdfData = usePDF(
+ // "https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf"
+ // );
+
+ // setTimeout(() => {
+ // pdfSrc.value = pdfData.pdf.value;
+ // numOfPages.value = pdfData.pages.value;
+ // }, 1000);
+ // console.log(pdfData);
+});
+
+const splitterModel = ref(14);
+const fileId = ref("");
+const selectReport = ref({ id: 39, name: "รายงานขร.1" });
+const optionsReport = ref([
+ { id: 39, name: "รายงานขร.1" },
+ { id: 40, name: "รายงานขร.2" },
+ { id: 41, name: "รายงานขร.3" },
+ { id: 42, name: "รายงานขร.4" },
+]);
+const selectList = ref();
+const optionsList = ref([{ id: 0, name: "เลือกกรอบการยื่นขอ" }]);
+
+const nextPage = () => {
+ if (page.value < numOfPages.value) {
+ page.value++;
+ }
+};
+const backPage = () => {
+ if (page.value !== 1) {
+ page.value--;
+ }
+};
+
+const backHistory = () => {
+ window.history.back();
+};
+
+const fecthlistRound = async () => {
+ await http
+ .get(config.API.listRoundInsignia())
+ .then((res: any) => {
+ optionsList.value = res.data.result.map((e: any) => ({
+ id: e.period_id,
+ year: e.period_year,
+ name: e.period_name,
+ }));
+ })
+ .catch((err) => {
+ console.log(err);
+ messageError($q, err);
+ });
+};
+
+const updateSelect = () => {
+ conditionDocument("show");
+};
+
+const conditionDocument = (type: string) => {
+ myForm.value?.validate().then(async (success: boolean) => {
+ if (success) {
+ if (type == "show") {
+ await downloadReport("pdf", false);
+ } else {
+ // await downloadReport("pdf", false);
+ await downloadReport(type, true);
+ }
+ }
+ });
+};
+
+const showDocument = (url: any) => {
+ const pdfData = usePDF(url);
+
+ setTimeout(() => {
+ pdfSrc.value = pdfData.pdf.value;
+ numOfPages.value = pdfData.pages.value;
+ }, 1000);
+};
+
+const downloadFile = (response: any, filename: string) => {
+ const link = document.createElement("a");
+ var fileName = filename;
+ link.href = window.URL.createObjectURL(new Blob([response.data]));
+ link.setAttribute("download", fileName);
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+};
+
+const downloadReport = async (
+ type: string = "pdf",
+ download: boolean = true
+) => {
+ showLoader();
+ await http
+ .get(config.API.reportInsignia(typeReport, type, selectList.value.id), {
+ responseType: "blob",
+ })
+ .then(async (res) => {
+ if (download) {
+ downloadFile(res, `${titleReport} ${selectList.value.name}.${type}`);
+ } else {
+ const url = URL.createObjectURL(new Blob([res.data]));
+ // pdfSrc.value = "";
+ // numOfPages.value = 0;
+ showDocument(url);
+ }
+ })
+ .catch((e) => {
+ messageError($q, e);
+ })
+ .finally(() => {
+ hideLoader();
+ });
+};
+
+
+
+
+
+ {{ titleReport }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ไฟล์ .PDF
+
+
+
+ ไฟล์ .docx
+
+
+
+ ไฟล์ .xlsx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ หน้าที่ {{ page }} จาก {{ numOfPages }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ หน้าที่ {{ page }} จาก {{ numOfPages }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ หน้าที่ {{ page }} จาก {{ numOfPages }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ หน้าที่ {{ page }} จาก {{ numOfPages }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/modules/07_insignia/router.ts b/src/modules/07_insignia/router.ts
index 356a44bea..8d3b0186f 100644
--- a/src/modules/07_insignia/router.ts
+++ b/src/modules/07_insignia/router.ts
@@ -7,6 +7,8 @@ const ReportView = () =>
import("../07_insignia/components/report/ReportView.vue");
const report_01 = () =>
import("../07_insignia/components/report/Report_01.vue");
+const report_02 = () =>
+ import("../07_insignia/components/report/Report_02.vue");
const RecordInsignia = () =>
import("@/modules/07_insignia/views/ResultPage.vue");
const Coin = () => import("@/modules/07_insignia/components/Coin.vue");
@@ -23,7 +25,7 @@ const allocateOrdList = () =>
const VatInsignia = () =>
import("@/modules/07_insignia/components/VatInsignia.vue");
-// ยืม - คืนเครื่องราช
+// ยืม - คืนเครื่องราช
const insigniaBorrow = () =>
import("@/modules/07_insignia/components/5_Borrow/Main.vue");
export default [
@@ -108,6 +110,16 @@ export default [
Role: "insignia",
},
},
+ {
+ path: "/insignia/report/report-02",
+ name: "report-report-02",
+ component: report_02,
+ meta: {
+ Auth: true,
+ Key: [8.5],
+ Role: "insignia",
+ },
+ },
{
path: "/insignia/manage/list-manage",
name: "insigniaManage",
diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts
index 7d6e66843..83fdc9a20 100644
--- a/src/modules/07_insignia/store.ts
+++ b/src/modules/07_insignia/store.ts
@@ -1,27 +1,30 @@
import { defineStore } from "pinia";
-import { ref, } from "vue";
+import { ref } from "vue";
import { useCounterMixin } from "@/stores/mixin";
const mixin = useCounterMixin();
-const {
- date2Thai
-} = mixin;
-
+const { date2Thai } = mixin;
export const useInsigniaDataStore = defineStore("insignia", () => {
let optionsTypeOc = ref([]);
- let typeOc = ref("")
- const agency = ref('')
- let rows = ref([])
- const listinsignia = ref([])
+ let typeOc = ref("");
+ const agency = ref("");
+ let rows = ref([]);
+ const listinsignia = ref([]);
const typeinsignia = ref("all");
let typeinsigniaOptions = ref([{ id: "all", name: "ทั้งหมด" }]);
+ const typeReport = ref("");
+ const titleReport = ref("");
+
+ const setTypeandTitle = (type: string, title: string) => {
+ typeReport.value = type;
+ titleReport.value = title;
+ };
const fetchData = async (data: any) => {
if (data !== null) {
- rows.value = await data.map((e: any) =>
- ({
+ rows.value = await data.map((e: any) => ({
id: e.id,
citizenId: e.citizenId,
profileId: e.profileId,
@@ -34,26 +37,27 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
insigniaSend: e.requestInsignia,
insigniaLevel: e.level,
dateSend: date2Thai(e.requestDate),
- requestNote: e.requestNote
- }))
- listinsignia.value = await rows.value
- filtertypeInsignia()
- } else rows.value = []
- }
+ requestNote: e.requestNote,
+ }));
+ listinsignia.value = await rows.value;
+ filtertypeInsignia();
+ } else rows.value = [];
+ };
const fetchOption = (op: any) => {
if (agency.value !== null) {
- typeOc.value = agency.value
- optionsTypeOc.value = op.filter((e: any) => e.id == agency.value
- )
- } else { optionsTypeOc.value = op, typeOc.value = op[2].id }
- }
+ typeOc.value = agency.value;
+ optionsTypeOc.value = op.filter((e: any) => e.id == agency.value);
+ } else {
+ (optionsTypeOc.value = op), (typeOc.value = op[2].id);
+ }
+ };
const filtertypeInsignia = async () => {
- typeinsignia.value = "all"
+ typeinsignia.value = "all";
if (listinsignia.value.length !== 0) {
const double_name = [
...new Set(listinsignia.value.map((item: any) => item.insigniaSend)),
];
- typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]
+ typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
for (let i = 1; i <= double_name.length; i++) {
const type = double_name[i - 1];
const listtype = {
@@ -61,9 +65,9 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
name: type,
};
// typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]
- typeinsigniaOptions.value.push(listtype)
+ typeinsigniaOptions.value.push(listtype);
}
- } else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]
+ } else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
};
const searchFilterTable = async () => {
@@ -88,5 +92,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
fetchData,
fetchOption,
searchFilterTable,
+ setTypeandTitle,
+ typeReport,
+ titleReport,
};
});
diff --git a/src/modules/07_insignia/storeAllocate.ts b/src/modules/07_insignia/storeAllocate.ts
index 9137c446b..14732def1 100644
--- a/src/modules/07_insignia/storeAllocate.ts
+++ b/src/modules/07_insignia/storeAllocate.ts
@@ -7,80 +7,45 @@ 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
+ const selectInsignia = () => {
+ console.log(insignia.value);
+ if (insignia.value !== "") {
+ rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value)
} 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":
@@ -89,21 +54,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/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", () => {
diff --git a/src/modules/08_registryEmployee/views/Detail.vue b/src/modules/08_registryEmployee/views/Detail.vue
index 6d63b4166..8991ae991 100644
--- a/src/modules/08_registryEmployee/views/Detail.vue
+++ b/src/modules/08_registryEmployee/views/Detail.vue
@@ -6,633 +6,13 @@
v-model:statusEdit="statusEdit"
:profileType="profileType"
/> -->
-
+
-
-
-
-
-
-
-
-
- อัปเดตรูปภาพ
-
-
-
-
-
-
-
-
-
- อัปเดตรูปภาพ
-
-
-
-
-
-
-
-
- เพิ่มข้อมูลทะเบียนประวัติ
-
-
ลูกจ้างชั่วคราว
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- เลือกรูปภาพ
-
-
- ปิดหน้านี้
-
-
-
-
-
-
-
-
-
-
-
- {{ date2Thai(n.createdDate) }}
-
-
-
-
-
-
-
-
-
-
-
-
- เลือกรูปภาพ
-
-
-
-