diff --git a/src/api/07_insignia/api.insignia.ts b/src/api/07_insignia/api.insignia.ts index 7d61bbef0..4d996f36f 100644 --- a/src/api/07_insignia/api.insignia.ts +++ b/src/api/07_insignia/api.insignia.ts @@ -26,7 +26,7 @@ export default { insigniaDashboard: (insigniaPeriodId: string) => `${insignia}/request/dashboard/${insigniaPeriodId}`, // record noteround: () => `${insignia}/request/note`, - requestDocNote: (id:string) => `${insignia}/request/note/doc/${id}`, + requestDocNote: (id: string) => `${insignia}/request/note/doc/${id}`, noteSearch: () => `${insignia}/request/note/search`, noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`, noteByid: (id: string) => `${insignia}/request/note/${id}`, @@ -35,4 +35,9 @@ export default { 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}`, + + // uploadfile + uploadfilereceice: (noteId: string) => `${insignia}/request/import/receice/${noteId}`, + uploadfileinvoice: (noteId: string) => `${insignia}/request/import/invoice/${noteId}`, + }; diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 13b719acf..88b911d67 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -8,8 +8,9 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useRouter } from "vue-router"; -const router = useRouter(); +import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; +const router = useRouter(); const mixin = useCounterMixin(); const { dialogRemove, @@ -23,8 +24,11 @@ const $q = useQuasar(); const DataStore = useInsigniaDataStore(); const modalNote = ref(false); +const modelPopupReject = ref(false); +const modelPopupDelete = ref(false); const modalAdd = ref(false); const modalEdit = ref(false); +const rowid = ref(""); const organization = ref(""); const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]); const visibleColumns = ref([ @@ -197,7 +201,9 @@ onMounted(async () => { // // organization.value = DataStore.optionsTypeOc[2].id; // DataStore.typeOc = organization.value; // } else organization.value = DataStore.typeOc; - organization.value = await (DataStore.agency != null ? DataStore.agency : DataStore.typeOc); + organization.value = await (DataStore.agency != null + ? DataStore.agency + : DataStore.typeOc); organizationOptions.value = await DataStore.optionsTypeOc; if (organization.value !== "" || organization.value !== undefined) { if (props.fecthInsigniaByOc) { @@ -372,20 +378,27 @@ const listEdit = async (profileId: string) => { }); }; -const clickReject = (profileId: string) => { +const clickReject = (id: string) => { + modelPopupReject.value = true; + rowid.value = id; +}; +const savaReasonReject = (reason: string) => { dialogConfirm( $q, async () => { - await listreject(profileId); + await listreject(rowid.value, reason); }, "ยืนยันการย้ายข้อมูล", "ต้องการยืนยันการย้ายข้อมูลนี้หรือไม่ ?" ); }; +const closemodelPopupReject = () => { + modelPopupReject.value = false; +}; -const listreject = async (profileId: string) => { +const listreject = async (profileId: string, reason: string) => { await http - .get(config.API.insigniaReject(profileId)) + .put(config.API.insigniaReject(profileId), { reason: reason }) .then(() => { success($q, "ย้ายข้อมูลสำเร็จ"); }) @@ -401,23 +414,31 @@ const listreject = async (profileId: string) => { props.tab ); } + await closemodelPopupReject(); }); }; -const clickDelete = (profileId: string) => { - dialogRemove( +const clickDelete = (id: string) => { + modelPopupDelete.value = true; + rowid.value = id; +}; +const closemodelPopupDelete = () => { + modelPopupDelete.value = false; +}; +const savaReasonDelete = (reason: string) => { + dialogConfirm( $q, async () => { - await listdelete(profileId); + await listdelete(rowid.value, reason); }, "ยืนยันการลบออกข้ออมูล", "ต้องการยืนยันการลบข้อมูลนี้หรือไม่ ?" ); }; -const listdelete = async (profileId: string) => { +const listdelete = async (id: string, reason: string) => { await http - .get(config.API.insigniaDelete(profileId)) + .put(config.API.insigniaDelete(id), { reason: reason }) .then(() => { success($q, "ลบข้อมูลสำเร็จ"); }) @@ -433,6 +454,7 @@ const listdelete = async (profileId: string) => { props.tab ); } + await closemodelPopupDelete(); }); }; @@ -500,40 +522,113 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
- - + +
ดาวน์โหลด - + เพิ่ม
- + - +
- + -
@@ -620,21 +764,44 @@ const paginationLabel2 = (start: number, end: number, total: number) => { เพิ่มรายชื่อ - +
- + - +
@@ -678,18 +858,39 @@ const paginationLabel2 = (start: number, end: number, total: number) => { - แก้ไขเครื่องราชฯ ที่ยื่นขอ + แก้ไขเครื่องราชฯ ที่ยื่นขอ - +
- +
+
+ + อัพโหลดไฟล์บันทึกผลการได้รับพระราชทานเครื่องราชย์อิสริยสภรณ์ + +
{ v-model="fileinvoice" label="บันทึกผลการจ่ายใบกำกับ" style="min-width: auto" - accept=".pdf" + accept=".xlsx" >