diff --git a/src/api/11_discipline/api.discipline.ts b/src/api/11_discipline/api.discipline.ts index 6e0b61e0a..4f993840f 100644 --- a/src/api/11_discipline/api.discipline.ts +++ b/src/api/11_discipline/api.discipline.ts @@ -127,4 +127,6 @@ export default { disciplineDisciplinaryByGetId: (id: string,page?:string) => `${discipline}/${page}/${id}`, disciplineReportByType: (type:string) => `${disciplineReport}/${type}`, + + disciplineFault:(id:string)=>`${disciplineMain}/result/summary/${id}` }; diff --git a/src/components/Dialogs/AddPersonal.vue b/src/components/Dialogs/AddPersonal.vue index 8a43a19d3..4a04ee802 100644 --- a/src/components/Dialogs/AddPersonal.vue +++ b/src/components/Dialogs/AddPersonal.vue @@ -6,6 +6,7 @@ import config from "@/app.config"; import { useCounterMixin } from "@/stores/mixin"; import { useDisciplineMainStore } from "@/modules/11_discipline/store/Main"; +import { useRoute } from "vue-router"; const mainStore = useDisciplineMainStore(); @@ -14,6 +15,7 @@ const total = ref(0); const totalList = ref(1); const $q = useQuasar(); +const route = useRoute(); const mixin = useCounterMixin(); const { dialogMessageNotify, showLoader, hideLoader, messageError } = mixin; @@ -190,7 +192,23 @@ async function getSearch() { child4DnaId: e.child4DnaId, })); - rows.value = list; + if (route.name == "disciplineInvestigatefactsEdit") { + const idIsSend = mainStore.rowsAdd + .filter( + (item: any) => item.isSend === "DONE" || item.isAncestorDNA === true + ) + .map((item: any) => item.personId); + rows.value = list.filter( + (item: any) => !idIsSend.includes(item.personId) + ); + } else { + const idIsSend = mainStore.rowsAdd + .filter((item: any) => item.isAncestorDNA === true) + .map((item: any) => item.personId); + rows.value = list.filter( + (item: any) => !idIsSend.includes(item.personId) + ); + } }) .catch((err) => { messageError($q, err); @@ -301,7 +319,7 @@ watch(
{
{ child3DnaId: person.child3DnaId, child4DnaId: person.child4DnaId, citizenId: person.idcard, + remarkReject: person.remarkReject, + disciplineRejectDoc: person.disciplineRejectDoc, })); mainStore.rowsAdd = listDataMain; mainStore.rowsAddCheck = listDataMain; @@ -720,6 +722,9 @@ watch(props.data, async () => { } }); +function onLoadFile(file: any) { + window.open(file.pathName); +} watch( () => formData.investigationDetail, (newValue, oldValue) => { @@ -963,9 +968,24 @@ onMounted(async () => { > ดูข้อมูลในทะเบียนประวัติ + ไฟล์เอกสารที่เกี่ยวข้องกับการยุติเรื่อง (""); const modalFault = ref(false); const remark = ref(""); +const idRow = ref(""); const checkValue = ref( JSON.parse(JSON.stringify(mainStore.checkValueFaultT)) ); @@ -264,12 +265,20 @@ function updatemodalPersonal(modal: boolean) { } function onFault(data: any) { + idRow.value = data.id; nameFault.value = data.name; modalFault.value = true; personalId.value = data.personId; + remark.value = data.remark ?? ""; + if (data.offense !== null) { + checkValue.value = JSON.parse(data.offense); + } else { + checkValue.value = JSON.parse(JSON.stringify(mainStore.checkValueFaultT)); + } } function close() { + idRow.value = ""; modalFault.value = false; personalId.value = ""; remark.value = ""; @@ -279,9 +288,21 @@ function close() { function onFaultSubmit() { if (checkValue.value.some((item) => item.value)) { dialogConfirm($q, () => { - console.log("onFaultSubmit wait API"); - close(); - props.fetchData(); + showLoader(); + http + .put(config.API.disciplineFault(idRow.value), { + offense: JSON.stringify(checkValue.value), + remark: remark.value, + }) + .then((res) => { + success($q, "ระบุฐานความผิด สำเร็จ"); + close(); + props.fetchData(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); }); } else { dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 มาตรา"); @@ -413,7 +434,7 @@ watch(
{ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "remarkReject", + align: "left", + label: "หมายเหตุการยุติ", + sortable: true, + field: "remarkReject", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, ]); /** หัวข้อที่เเสดงในตารางผู้ถูกร้องเรียน */ @@ -147,6 +156,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => { "salary", "organization", "isSend", + "remarkReject", ]); /** หัวตารางกรรมการ */