แก้วินัย

This commit is contained in:
setthawutttty 2025-04-21 16:29:32 +07:00
parent 456cf574f6
commit 91502f6d8b
8 changed files with 80 additions and 9 deletions

View file

@ -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}`
};

View file

@ -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<number>(0);
const totalList = ref<number>(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(
<div class="full-width">
<d-table
ref="table"
:columns="mainStore.columnsRespondent?.filter((item:any)=>item.name !== 'profileType')"
:columns="mainStore.columnsRespondent?.filter((item:any)=>item.name !== 'profileType' && item.name !== 'isSend' && item.name !== 'remarkReject')"
:rows="rows"
row-key="personId"
flat

View file

@ -554,7 +554,7 @@ onMounted(async () => {
<div class="col-12 row q-pa-sm">
<d-table
ref="table"
:columns="mainStore.columnsRespondent"
:columns="mainStore.columnsRespondent?.filter((item:any)=>item.name !== 'isSend' && item.name !== 'remarkReject')"
:rows="mainStore.rowsAdd"
row-key="idcard"
flat

View file

@ -686,6 +686,8 @@ watch(props.data, async () => {
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 () => {
>
<q-tooltip>อมลในทะเบยนประว</q-tooltip>
</q-btn>
<q-btn
v-if="props.row.disciplineRejectDoc.length > 0"
flat
round
dense
color="blue"
icon="mdi-download"
@click="
onLoadFile(props.row.disciplineRejectDoc[0])
"
><q-tooltip
>ไฟลเอกสารทเกยวของกบการยเรอง</q-tooltip
></q-btn
>
<q-btn
v-if="
(!isReadonly &&
props.row.isSend == 'NEW' &&
!checkRoutePermisson &&
props.row.isAncestorDNA === false) ||
!mainStore.rowsAddCheck.some(

View file

@ -917,7 +917,7 @@ onMounted(async () => {
<div class="col-xs-12 q-pa-sm">
<d-table
ref="table"
:columns="mainStore.columnsRespondent"
:columns="mainStore.columnsRespondent?.filter((item:any)=> item.name !== 'isSend' && item.name !== 'remarkReject')"
:rows="mainStore.rowsAdd"
row-key="personId"
flat

View file

@ -62,6 +62,7 @@ const nameFault = ref<string>("");
const modalFault = ref<boolean>(false);
const remark = ref<string>("");
const idRow = ref<string>("");
const checkValue = ref<FaultTypeOption[]>(
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(
<div class="col-xs-12 q-pa-sm">
<d-table
ref="table"
:columns="mainStore.columnsRespondent"
:columns="mainStore.columnsRespondent?.filter((item:any)=>item.name !== 'isSend' && item.name !== 'remarkReject')"
:rows="mainStore.rowsAdd"
row-key="idcard"
flat

View file

@ -183,7 +183,7 @@ watch(
</div>
<d-table
ref="table"
:columns="props.columns"
:columns="props.columns.filter((item:any)=>item.name !== 'isSend' && item.name !== 'remarkReject')"
:rows="rows"
row-key="personId"
flat

View file

@ -133,6 +133,15 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
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",
]);
/** หัวตารางกรรมการ */