diff --git a/src/api/11_discipline/api.discipline.ts b/src/api/11_discipline/api.discipline.ts index 9b684889a..370c0b78c 100644 --- a/src/api/11_discipline/api.discipline.ts +++ b/src/api/11_discipline/api.discipline.ts @@ -1,5 +1,5 @@ import env from "../index"; -const discipline = `${env.API_URI}/discipline`; +const discipline = `${env.API_URI}/discipline/disciplinary`; const investigate = `${env.API_URI}/discipline/investigate`; export default { @@ -46,16 +46,20 @@ export default { investigateApprove: (id: string) => `${investigate}/approve/${id}`, /** ระบบวินัยเรื่องสอบสวน */ - disciplineDisciplinary: () => `${discipline}/disciplinary`, + disciplineDisciplinary: () => `${discipline}`, disciplineDisciplinaryById: (id: string) => - `${discipline}/disciplinary/${id}`, + `${discipline}/${id}`, disciplineInvestigateById: (id: string) => - `${discipline}/disciplinary/investigate/${id}`, + `${discipline}/investigate/${id}`, disciplineComplaintsById: (id: string) => - `${discipline}/disciplinary/complaint/${id}`, + `${discipline}/complaint/${id}`, disciplineDirector: () => `${discipline}/director`, disciplineDoc: (type: string, id: string) => - `${discipline}/disciplinary/${type}/file/${id}`, + `${discipline}/${type}/file/${id}`, disciplineByIdDoc: (type: string, id: string, docId: string) => - `${discipline}/disciplinary/${type}/file/${id}/${docId}`, + `${discipline}/${type}/file/${id}/${docId}`, + + disciplinaryReject: (id: string) => `${discipline}/reject/${id}`, + disciplinaryResume: (id: string) => `${discipline}/resume/${id}`, + disciplinaryApprove: (id: string) => `${discipline}/approve/${id}`, }; diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index e8d42cbd0..587ed991b 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -19,6 +19,7 @@ import http from "@/plugins/http"; const $q = useQuasar(); const route = useRoute(); +const router = useRouter(); const modalPerson = ref(false); const toggleModal = () => (modalPerson.value = !modalPerson.value); /**เรียกใช้ store */ @@ -134,6 +135,15 @@ const initialPagination = ref({ /** หัวตาราง */ const columnsPerson = ref([ + { + name: "info", + align: "center", + label: "", + sortable: false, + field: "info", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "no", align: "left", @@ -210,6 +220,7 @@ const columnsPerson = ref([ /** หัวข้อที่เเสดงในตาราง */ const visibleColumnsPerson = ref([ + "info", "no", "idcard", "name", @@ -715,7 +726,27 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
-
+
+ ดูข้อมูลในทะเบียนประวัติ +
+
+ {{ props.row.organization }} +
+
{{ col.value }}
@@ -1234,9 +1265,15 @@ onMounted(async () => { formData.disciplineInvestigateRelevantDocs.length === 0 " > - ไม่มีรายการเอกสาร + + ไม่มีรายการเอกสาร +
- + {
- +
+ อัปโหลดไฟล์เอกสารหลักฐาน +
+
+ -
- อัปโหลดไฟล์เอกสารหลักฐาน -
-
- - - - -
- อัปโหลดไฟล์ -
-
- ไม่มีรายการเอกสาร -
+ +
-
- - - {{ file.fileName }} - -
-
- - ดาวน์โหลดเอกสารหลักฐาน - -
-
- ลบเอกสารหลักฐาน -
+
+ อัปโหลดไฟล์ +
+
+ + ไม่มีรายการเอกสาร + +
+ +
+ + + {{ file.fileName }} + +
+
+ + ดาวน์โหลดเอกสารหลักฐาน +
- - - -
- - +
+ ลบเอกสารหลักฐาน +
+
+ + + +
+
diff --git a/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue b/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue index a5c962492..6b33faead 100644 --- a/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue +++ b/src/modules/11_discipline/components/3_InvestigateDisciplinary/EditPage.vue @@ -2,23 +2,25 @@ import { onMounted, reactive, ref, watch } from "vue"; import { useQuasar } from "quasar"; import { useRouter, useRoute } from "vue-router"; +import type { QTableProps } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; - +import Popup from "@/modules/11_discipline/components/1_Complaint/Popup.vue"; /**import component*/ import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง import FormDisciplinary from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue"; // สอบสวนความผิดทางวินัย -import type { FormData } from "@/modules/11_discipline/interface/request/disciplinary"; +import type { + FormData, + PersonsArray, +} from "@/modules/11_discipline/interface/request/disciplinary"; import type { FormData as FormDataComplaint, ArrayPerson, ArrayFileList, } from "@/modules/11_discipline/interface/request/complaint"; -import type { - FormData as FormInvestigateFact, -} from "@/modules/11_discipline/interface/request/investigateFact"; +import type { FormData as FormInvestigateFact } from "@/modules/11_discipline/interface/request/investigateFact"; /**import store*/ import { useCounterMixin } from "@/stores/mixin"; @@ -31,9 +33,10 @@ const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin; const router = useRouter(); const route = useRoute(); +const modalPopup = ref(false); const id = ref(route.params.id as string); const data = ref(); -const status = ref("") +const status = ref(""); /** function fetchData สอบสวนความผิดทางวินัย*/ async function fetchDetailDisciplinary() { @@ -42,7 +45,7 @@ async function fetchDetailDisciplinary() { .get(config.API.disciplineDisciplinaryById(id.value)) .then((res) => { data.value = res.data.result; - status.value = res.data.result.status + status.value = res.data.result.status; }) .catch((err) => { messageError($q, err); @@ -64,18 +67,24 @@ async function fetchDetailInvestigate() { dataInvestigatefacts.respondentType = dataList.respondentType; dataInvestigatefacts.persons = dataList.persons; dataInvestigatefacts.investigationDetail = dataList.investigationDetail; - dataInvestigatefacts.investigationDetailOther = dataList.investigationDetailOther; - dataInvestigatefacts.investigationDateStart = dataList.investigationDateStart; + dataInvestigatefacts.investigationDetailOther = + dataList.investigationDetailOther; + dataInvestigatefacts.investigationDateStart = + dataList.investigationDateStart; dataInvestigatefacts.investigationDateEnd = dataList.investigationDateEnd; - dataInvestigatefacts.investigationDescription = dataList.investigationDescription; - dataInvestigatefacts.investigationCauseText = dataList.investigationCauseText; + dataInvestigatefacts.investigationDescription = + dataList.investigationDescription; + dataInvestigatefacts.investigationCauseText = + dataList.investigationCauseText; dataInvestigatefacts.status = dataList.status; dataInvestigatefacts.result = dataList.result; dataInvestigatefacts.directors = dataList.director; - dataInvestigatefacts.disciplineInvestigateDocs = dataList.disciplineInvestigateDocs; + dataInvestigatefacts.disciplineInvestigateDocs = + dataList.disciplineInvestigateDocs; dataInvestigatefacts.disciplineInvestigateRelevantDocs = dataList.disciplineInvestigateRelevantDocs; - dataInvestigatefacts.investigationStatusResult = dataList.investigationStatusResult; + dataInvestigatefacts.investigationStatusResult = + dataList.investigationStatusResult; }) .catch((err) => { messageError($q, err); @@ -155,12 +164,25 @@ const onSubmit = async (id: string) => { /** ยืนยัน ส่งไปออกคำสั่ง */ function sentIssue() { - dialogConfirm( - $q, - () => confirmSentIssue(), - "ยืนยันส่งไปสรุปผลการพิจารณา", - "ต้องการยืนยันส่งไปสรุปผลการพิจารณาใช่หรือไม่?" - ); + console.log("sent"); + modalPopup.value = true; +} + +function sentIssueGate() { + dialogConfirm($q, () => confirmSentIssueGate(),'ยืนยันส่งไปสรุปผลการพิจารณา','ต้องการยืนยันส่งไปสรุปผลการพิจารณาใช่หรือไม่?'); +} + +function confirmSentIssueGate() { + showLoader() + http + .get(config.API.disciplinaryApprove(id.value)) + .then((res) => {}) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + fetchDetailDisciplinary(); + }); } /** ยืนยัน ยุติเรื่อง */ @@ -186,16 +208,41 @@ function cancelInvestigate() { /** ฟังชั่น ส่งไปออกคำสั่ง*/ function confirmSentIssue() { console.log("sent"); + modalPopup.value = true; } /** ฟังชั่น ยุติเรื่อง*/ function confirmEndInvestigate() { console.log("sent"); + showLoader(); + http + .get(config.API.disciplinaryReject(id.value)) + .then((res) => {}) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + fetchDetailDisciplinary(); + }); } /** ฟังชั่น ยกเลิกการยุติเรื่อง*/ function confirmCancelInvestigate() { console.log("sent"); + showLoader(); + http + .get(config.API.disciplinaryResume(id.value)) + .then((res) => {}) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + fetchDetailDisciplinary(); + }); +} + +function closePopup() { + modalPopup.value = false; } /** โหลดข้อมูลเมื่อเข้าหน้านี้ */ @@ -243,6 +290,125 @@ const fileListObjComplaint = reactive({ fileName: "", }); +function emitPerson(data: PersonsArray[]) { + console.log(data); + // const dataMapId = data.map((item: PersonsArray) => item.id); + // console.log(dataMapId); + // showLoader(); + // http + // .put(config.API.investigateApprove(id.value), { + // persons: dataMapId, + // }) + // .then((res) => { + // // router.push(`/discipline/investigatefacts`); + // }) + // .catch((e) => { + // messageError($q, e); + // }) + // .finally(() => { + // hideLoader(); + // fetchDetailDisciplinary(); + // }); +} + +/** หัวตาราง */ +const columns = ref([ + { + name: "info", + align: "left", + label: "", + sortable: false, + field: "info", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "no", + align: "left", + label: "ลำดับ", + sortable: false, + field: "no", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "idcard", + align: "left", + label: "เลขบัตรประชาชน", + sortable: true, + field: "idcard", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "name", + align: "left", + label: "ชื่อ - นามสกุล", + sortable: true, + field: "name", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "posNo", + align: "left", + label: "ตำแหน่งเลขที่", + sortable: true, + field: "posNo", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "position", + align: "left", + label: "ตำแหน่ง", + sortable: true, + field: "position", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "positionLevel", + align: "left", + label: "ระดับ", + sortable: true, + field: "positionLevel", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "salary", + align: "left", + label: "เงินเดือน", + sortable: true, + field: "salary", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "organization", + align: "left", + label: "หน่วยงาน", + sortable: true, + field: "organization", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, +]); + +/** หัวข้อที่เเสดงในตาราง */ +const visibleColumns = ref([ + "info", + "no", + "idcard", + "name", + "posNo", + "position", + "positionLevel", + "salary", + "organization", +]); + const dataComplaints = reactive({ id: "", respondentType: "", @@ -314,7 +480,7 @@ const dataInvestigatefacts = reactive({ v-if="status === 'NEW'" label="ส่งไปสรุปผลการพิจารณา" color="public" - @click="sentIssue" + @click="sentIssueGate" /> ({ - + ({ + +