diff --git a/src/api/11_discipline/api.discipline.ts b/src/api/11_discipline/api.discipline.ts index 1b7ec9f05..514d615b2 100644 --- a/src/api/11_discipline/api.discipline.ts +++ b/src/api/11_discipline/api.discipline.ts @@ -42,6 +42,7 @@ export default { investigateReject: (id: string) => `${investigate}/reject/${id}`, investigateResume: (id: string) => `${investigate}/resume/${id}`, + investigateApprove: (id: string) => `${investigate}/approve/${id}`, /** ระบบวินัยเรื่องสอบสวน */ disciplineDisciplinary: () => `${discipline}/disciplinary`, diff --git a/src/modules/09_leave/components/4_ChangeRound/DialogForm.vue b/src/modules/09_leave/components/4_ChangeRound/DialogForm.vue index 7afec33c1..7becae6a3 100644 --- a/src/modules/09_leave/components/4_ChangeRound/DialogForm.vue +++ b/src/modules/09_leave/components/4_ChangeRound/DialogForm.vue @@ -91,8 +91,8 @@ async function changeRound() { .post(config.API.leaveRound(), { profileId: props.personId, roundId: formData.round, - effectDate: formData.effectiveDate, - remark: formData.round, + effectiveDate: formData.effectiveDate, + remark: formData.reson, }) .then(() => { success($q, "บันทึกข้อมูลเปลี่ยนรอบเวลา"); diff --git a/src/modules/11_discipline/components/1_Complaint/EditPage.vue b/src/modules/11_discipline/components/1_Complaint/EditPage.vue index d4677495c..c2b94d93b 100644 --- a/src/modules/11_discipline/components/1_Complaint/EditPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/EditPage.vue @@ -4,7 +4,7 @@ import Form from "@/modules/11_discipline/components/1_Complaint/Form.vue"; import Popup from "@/modules/11_discipline/components/1_Complaint/Popup.vue"; import { useRouter, useRoute } from "vue-router"; import { useQuasar } from "quasar"; - +import type { QTableProps } from "quasar"; import config from "@/app.config"; import http from "@/plugins/http"; @@ -14,7 +14,8 @@ import type { ArrayFileList, } from "@/modules/11_discipline/interface/request/complaint"; import { useCounterMixin } from "@/stores/mixin"; - +import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore"; +const complainstStore = useComplainstDataStore(); const $q = useQuasar(); const mixin = useCounterMixin(); const { @@ -134,6 +135,92 @@ const data = reactive({ // ]); // }; +const columns = ref([ + { + 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: "positionNo", + align: "left", + label: "ตำแหน่งเลขที่", + sortable: true, + field: "positionNo", + 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([ + "no", + "idcard", + "name", + "positionNo", + "position", + "positionLevel", + "salary", + "organization", +]); + async function getData() { showLoader(); await http @@ -157,7 +244,6 @@ async function getData() { data.persons = dataList.persons; data.result = dataList.result; data.disciplineComplaintDocs = dataList.disciplineComplaintDocs; - }) .catch((e) => { messageError($q, e); @@ -185,7 +271,28 @@ async function onSubmit(data: any) { /** ยืนยัน มีมูลส่งไปสืบสวน */ function sentInvestigate() { - modalPopup.value = true; + if (complainstStore.rowsAdd.length > 0) { + modalPopup.value = true; + } else { + dialogConfirm($q,()=>sentConfirm(),'ยืนยันส่งไปสืบสวน','ต้องการยืนยันยืนยันส่งไปสืบสวนใช่หรือไม่?') + } +} + +function sentConfirm(){ + showLoader(); + http + .put(config.API.complaintApprove(id.value), { + persons: [], + }) + .then((res) => { + router.push(`/discipline/complaints`); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); } function closePopup() { @@ -314,6 +421,9 @@ onMounted(() => { :modal="modalPopup" :close="closePopup" @return-person="emitPerson" + :rows="complainstStore.rowsAdd" + :columns="columns" + :visibleColumns="visibleColumns" /> diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue index 4cd06341a..070f98757 100644 --- a/src/modules/11_discipline/components/1_Complaint/Form.vue +++ b/src/modules/11_discipline/components/1_Complaint/Form.vue @@ -366,7 +366,7 @@ function confirmDelete(id: string) { watch(props.data, async () => { fileList.value = props.data.disciplineComplaintDocs; complainstStore.fetchComplainstAdd(props.data.persons); - + formData.id = props.data.id; formData.respondentType = props.data.respondentType; formData.organizationId = props.data.organizationId; @@ -403,20 +403,22 @@ function upLoadFileDoc() { .then((res) => { console.log(res); success($q, "บันทึกข้อมูลสำเร็จ"); - router.push(`/discipline/complaints`); + props.getData(); }) .catch((e) => { messageError($q, e); }) .finally(async () => { hideLoader(); + formData.documentFile = null }); console.log("file", formData.documentFile, formData.id); } async function addPerson(data: any) { - await complainstStore.fetchComplainstAdd(data); toggleModal(); + console.log(data) + await complainstStore.fetchComplainstAdd(data); } function getOc() { @@ -425,6 +427,19 @@ function getOc() { complainstStore.ocListFn(data); }); } + +function deletePerson(id: string) { + dialogRemove($q, () => removePerson(id)); +} + +function removePerson(id: string) { + const dataRow = complainstStore.rowsAdd; + const updatedRows = dataRow.filter((item: any) => item.id !== id); + success($q,'ลบข้อมูลสำเร็จ') + complainstStore.rowsAdd = updatedRows; + +} + onMounted(() => { getOc(); complainstStore.columns = columns.value; @@ -575,6 +590,7 @@ onMounted(() => { col.label }} + @@ -911,8 +946,7 @@ onMounted(() => { - -
+
{ >ดาวน์โหลดไฟล์ {
+
+ +

+ ไม่มีรายการเอกสาร +

+
+
diff --git a/src/modules/11_discipline/components/1_Complaint/Popup.vue b/src/modules/11_discipline/components/1_Complaint/Popup.vue index c75d6da27..41fcf0a9f 100644 --- a/src/modules/11_discipline/components/1_Complaint/Popup.vue +++ b/src/modules/11_discipline/components/1_Complaint/Popup.vue @@ -3,7 +3,7 @@ import { ref, watch } from "vue"; import { useQuasar } from "quasar"; import DialogHeader from "@/components/DialogHeader.vue"; -import type { QTableProps } from "quasar"; + import { useCounterMixin } from "@/stores/mixin"; import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore"; @@ -31,97 +31,23 @@ const props = defineProps({ type: Function, default: () => "", }, + rows: { + type: Array, + default: [], + }, + columns: { + type: Array, + default: [], + }, + visibleColumns: { + type: Array, + default: [], + }, }); -const emit = defineEmits([ - "returnPerson" -]) +const emit = defineEmits(["returnPerson"]); /** หัวตาราง */ -const columns = ref([ - { - 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: "positionNo", - align: "left", - label: "ตำแหน่งเลขที่", - sortable: true, - field: "positionNo", - 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([ - "no", - "idcard", - "name", - "positionNo", - "position", - "positionLevel", - "salary", - "organization", -]); + const selected = ref([]); const inspectionResults = ref(""); @@ -134,24 +60,18 @@ const initialPagination = ref({ }); function onclickSend() { - // inputRef.value.validate(); - // dialogConfirm($q, () => props.sentApprove()); - - if (selected.value.length > 0) { dialogConfirm( $q, async () => { success($q, `ส่งข้อมูล${props.title}สำเร็จ`); console.log(selected.value); - emit('returnPerson',selected.value) + emit("returnPerson", selected.value); props.close?.(); }, `ยืนยันการส่ง${props.title}`, `ต้องการยืนยันการส่ง${props.title}หรือไม่` ); - } else { - dialogMessageNotify($q, "กรุณาเลือกรายชื่อ"); - } + } function onClickClose() { @@ -161,10 +81,9 @@ function onClickClose() { watch([() => props.modal], () => { inspectionResults.value = props.modal ? "" : ""; selected.value = props.modal ? [] : []; - if(props.modal === true){ - selected.value = complainstStore.rowsAdd; + if (props.modal === true) { + selected.value = props.rows; } - });