diff --git a/src/api/index.ts b/src/api/index.ts index 9b092ddf6..4c46a4e20 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -29,6 +29,7 @@ const config = ref({ // API_PROBATION_URI: "https://ehr.joolsoft.com/v1", API_PROBATION_URI: "https://bmaehr.joolsoft.com/nodeapi/v1", // API_PROBATION_URI: "http://192.168.1.151:7776/v1", + API_REPORT2_URI: "https://bma-ehr.frappet.synology.me/api/v2", }, test: { API_URI: "http://localhost:5010/api/v1", @@ -50,6 +51,7 @@ const config = ref({ MEET_URI: "meet.frappet.com", API_RETIREMENT_URI: `${window.location.protocol}//${window.location.host}/api/v1`, API_PROBATION_URI: "https://bmaehr.joolsoft.com/nodeapi/v1", + API_REPORT2_URI: `${window.location.protocol}//${window.location.host}/api/v2`, }, }); @@ -78,6 +80,9 @@ const API_URI_ORG_TREE = ref(config.value[env.value].API_URI_ORG_TREE); const API_PROBATION_URI = ref( config.value[env.value].API_PROBATION_URI ); +const API_REPORT2_URI = ref( + config.value[env.value].API_REPORT2_URI +); export default { env: env.value, @@ -93,4 +98,5 @@ export default { MEET_URI: MEET_URI.value, API_RETIREMENT_URI: API_RETIREMENT_URI.value, API_PROBATION_URI: API_PROBATION_URI.value, + API_REPORT2_URI: API_REPORT2_URI.value, }; diff --git a/src/api/reports/api.report.ts b/src/api/reports/api.report.ts new file mode 100644 index 000000000..c025232d2 --- /dev/null +++ b/src/api/reports/api.report.ts @@ -0,0 +1,10 @@ +/** + * api รายงานทั้งหมด + */ +import env from "../index"; +const reportOrder = `${env.API_REPORT2_URI}/report/order`; + +export default { + reportOrderCover: (fileType: string, id: string) => `${reportOrder}/cover/${fileType}/${id}`, + reportOrderAttachment: (fileType: string, id: string) => `${reportOrder}/attachment/${fileType}/${id}`, +}; diff --git a/src/app.config.ts b/src/app.config.ts index b8bb88983..801a88941 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -40,6 +40,9 @@ import insignia from "./api/07_insignia/api.insignia"; /** API dashboard */ import message from "./api/00_dashboard/api.message"; +/** API reports */ +import reports from "./api/reports/api.report"; + // environment variables export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL; export const qualifyDisableExamPanel = import.meta.env @@ -80,6 +83,9 @@ const API = { //dashboard ...message, + + //reports + ...reports, }; export default { diff --git a/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue b/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue index ece92154d..83df19af8 100644 --- a/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue +++ b/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue @@ -47,7 +47,7 @@
- แก้ไขข้อมูลเพื่อลงบัญชี + แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index f96c72b1b..418e6ea82 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -21,6 +21,7 @@ const DataStore = useInsigniaDataStore(); const modalNote = ref(false); const modalAdd = ref(false); +const modalEdit = ref(false); const organization = ref(""); const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]); const visibleColumns = ref([ @@ -255,6 +256,7 @@ const props = defineProps({ }); const typeinsignia = ref("all"); const typeinsigniaOptions = reactive([{ id: "all", name: "ทั้งหมด" }]); +const typeinsigniaValues: Set = new Set(); onMounted(async () => { organizationOptions.value = DataStore.optionsTypeOc; organization.value = organizationOptions.value[0].id; @@ -269,7 +271,7 @@ onMounted(async () => { "officer", props.tab ); - + filtertypeInsignia(); } } }); @@ -353,10 +355,10 @@ const addlistperson = async (id: string) => { showLoader(); let data = { profileId: id, - insigniaId: organization.value, + // insigniaId: organization.value, insigniaPeriodId: props.roundId, }; - // console.log(data); + console.log(data); await http .post(config.API.insigniaCreate(), data) .then(() => { @@ -387,7 +389,12 @@ const addlistperson = async (id: string) => { // actionModal.value = action; // modalNote.value = true; // }; -const clickEdit = () => { +const clickmodalEdit = () => { + modalEdit.value = true; + fecthInsignia(); + fecthInsigniaType(); +}; +const clickSave = () => { dialogConfirm( $q, async () => { @@ -449,6 +456,52 @@ const listdelete = async () => { messageError($q, err); }); }; +const insignia = ref(""); +const insigniaOptions = ref([]); +const insigniaType = ref(""); +const insigniaTypeOptions = ref([]); + +const fecthInsignia = async () => { + await http + .get(config.API.insignia) + .then((res) => { + insigniaOptions.value = res.data.result; + }) + .catch((err) => {}); +}; +const fecthInsigniaType = async () => { + await http(config.API.insigniaType) + .then((res) => { + insigniaTypeOptions.value = res.data.result; + }) + .catch((err) => {}); +}; + +const listinsignia = ref([]); +const filtertypeInsignia = async () => { + listinsignia.value = rows.value; + for (const data of listinsignia.value) { + const Type = data.insigniaType; + if (Type !== null && !typeinsigniaValues.has(Type)) { + typeinsigniaOptions.push({ + id: Type.toString(), + name: Type.toString(), + }); + typeinsigniaValues.add(Type); + } + } +}; +const searchFilterTable = async () => { + if (typeinsignia.value !== undefined && typeinsignia.value !== null) { + if (typeinsignia.value === "all") { + rows.value = listinsignia.value; + } else { + rows.value = listinsignia.value.filter( + (e) => e.insigniaType === typeinsignia.value + ); + } + } +}; const filterKeyword = ref(""); const filterKeyword2 = ref(""); @@ -519,7 +572,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => { :outlined="true" :hide-dropdown-icon="false" style="min-width: 150px" - @update:model-value="changtypeOc" + @update:model-value="searchFilterTable" />
@@ -648,7 +701,7 @@ const paginationLabel2 = (start: string, end: string, total: string) => { { + + + + + แก้ไขเครื่องราชฯ ที่ยื่นขอ + + + + + +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+
+ diff --git a/src/modules/07_insignia/components/2_Manage/Tab2.vue b/src/modules/07_insignia/components/2_Manage/Tab2.vue index 15e972d72..9bec42a41 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab2.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab2.vue @@ -1,5 +1,5 @@