แก้ไขฟอร์มสรุปผลการพิจารณา

This commit is contained in:
Warunee Tamkoo 2023-12-01 17:52:59 +07:00
parent 2c295dbd03
commit d026e7c615
5 changed files with 219 additions and 200 deletions

View file

@ -372,6 +372,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
persons: [], persons: [],
}); });
</script> </script>
<template> <template>
<div class="col-xs-12 col-sm-12 col-md-11"> <div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle col-12 row items-center"> <div class="toptitle col-12 row items-center">

View file

@ -24,7 +24,7 @@ const mainStore = useDisciplineMainStore();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const store = useDisciplineResultStore(); const store = useDisciplineResultStore();
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id as string); const id = ref<string>(route.params.id as string);
@ -51,16 +51,12 @@ function getData() {}
/** ยืนยัน ส่งไปออกคำสั่ง */ /** ยืนยัน ส่งไปออกคำสั่ง */
function sentIssue() { function sentIssue() {
modal.value = true; modal.value = true;
// dialogConfirm(
// $q,
// () => {
// console.log("sent api ");
// },
// "",
// "?"
// );
} }
const idInvestigate = ref<string>("");
const idComplaint = ref<string>("");
const status = ref<string>("");
const dataResult = ref<DataListRow[]>([]); const dataResult = ref<DataListRow[]>([]);
/** function เรียกรายละเอียดผลการพิจารณาทางวินัย*/ /** function เรียกรายละเอียดผลการพิจารณาทางวินัย*/
async function fetchDetailResult() { async function fetchDetailResult() {
@ -69,6 +65,9 @@ async function fetchDetailResult() {
.get(config.API.listResultById(id.value)) .get(config.API.listResultById(id.value))
.then((res) => { .then((res) => {
dataResult.value = res.data.result; dataResult.value = res.data.result;
status.value = res.data.result.status;
idComplaint.value = res.data.result.idComplaint;
idInvestigate.value = res.data.result.idInvestigate;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -86,7 +85,6 @@ async function fetchDetailDisciplinary() {
.get(config.API.disciplineDisciplinaryById(id.value)) .get(config.API.disciplineDisciplinaryById(id.value))
.then((res) => { .then((res) => {
dataDisciplinary.value = res.data.result; dataDisciplinary.value = res.data.result;
// status.value = res.data.result.status;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -107,10 +105,10 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
investigationDetailOther: "", investigationDetailOther: "",
evidenceFiles: null, evidenceFiles: null,
fileComplaint: null, fileComplaint: null,
extendStatus: false, investigationExtendStatus: false,
investigationDateStart: null, investigationDateStart: null,
investigationDateEnd: null, investigationDateEnd: null,
daysExtend: null, investigationDaysExtend: null,
investigationStatusResult: "", investigationStatusResult: "",
investigationCauseText: "", investigationCauseText: "",
complaintStatus: "", complaintStatus: "",
@ -128,7 +126,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
async function fetchDetailInvestigate() { async function fetchDetailInvestigate() {
showLoader(); showLoader();
await http await http
.get(config.API.disciplineInvestigateById(id.value)) .get(config.API.investigateById(idInvestigate.value))
.then((res) => { .then((res) => {
const dataList = res.data.result; const dataList = res.data.result;
dataInvestigatefacts.id = dataList.id; dataInvestigatefacts.id = dataList.id;
@ -154,6 +152,10 @@ async function fetchDetailInvestigate() {
dataList.disciplineInvestigateRelevantDocs; dataList.disciplineInvestigateRelevantDocs;
dataInvestigatefacts.investigationStatusResult = dataInvestigatefacts.investigationStatusResult =
dataList.investigationStatusResult; dataList.investigationStatusResult;
dataInvestigatefacts.investigationExtendStatus =
dataList.investigationExtendStatus;
dataInvestigatefacts.investigationDaysExtend =
dataList.investigationDaysExtend;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -206,7 +208,7 @@ const dataComplaints = reactive<FormDataComplaint>({
async function fetchDetailComplaints() { async function fetchDetailComplaints() {
showLoader(); showLoader();
await http await http
.get(config.API.disciplineComplaintsById(id.value)) .get(config.API.complaintbyId(idComplaint.value))
.then((res) => { .then((res) => {
const dataList = res.data.result; const dataList = res.data.result;
dataComplaints.id = dataList.id; dataComplaints.id = dataList.id;
@ -237,6 +239,7 @@ async function fetchDetailComplaints() {
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */ /** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(async () => { onMounted(async () => {
store.tabMenu = "result";
await fetchDetailResult(); await fetchDetailResult();
}); });

View file

@ -3,10 +3,10 @@ div
import { ref, onMounted, reactive, watch } from "vue"; import { ref, onMounted, reactive, watch } from "vue";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useQuasar, QForm } from "quasar"; import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue"; // import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore"; import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore"; import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
@ -23,7 +23,7 @@ const mainStore = useDisciplineMainStore();
const modalPerson = ref<boolean>(false); const modalPerson = ref<boolean>(false);
const toggleModal = () => (modalPerson.value = !modalPerson.value); const toggleModal = () => (modalPerson.value = !modalPerson.value);
const investigateDis = useInvestigateDisStore(); const investigateDis = useInvestigateDisStore();
const { fecthDirector } = investigateDis; // const { fecthDirector } = investigateDis;
const isReadonly = ref<boolean>(false); // const isReadonly = ref<boolean>(false); //
const dataStore = useDisciplineResultStore(); const dataStore = useDisciplineResultStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -70,7 +70,7 @@ const organizationOption = ref<DataOption[]>([]);
async function addPerson(data: any) { async function addPerson(data: any) {
await mainStore.fetchData(data); await mainStore.fetchData(data);
console.log(mainStore.rowsAdd) console.log(mainStore.rowsAdd);
toggleModal(); toggleModal();
} }
@ -114,8 +114,6 @@ function validateForm() {
} }
if (hasError.every((result) => result === true)) { if (hasError.every((result) => result === true)) {
onSubmit(); onSubmit();
} else {
console.log(hasError);
} }
} }
@ -131,6 +129,7 @@ function onSubmit() {
await http await http
.put(config.API.listResultById(id.value), formData) .put(config.API.listResultById(id.value), formData)
.then(() => { .then(() => {
isSave.value = false;
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((err) => { .catch((err) => {
@ -156,7 +155,6 @@ async function fetchDatadetail() {
watch( watch(
() => props.data, () => props.data,
async () => { async () => {
console.log('pros',props.data);
respondentType.value = props.data.respondentType; respondentType.value = props.data.respondentType;
mainStore.rowsAdd = props.data.persons; mainStore.rowsAdd = props.data.persons;
await fetchDatadetail(); await fetchDatadetail();
@ -169,12 +167,12 @@ function changeFormData() {
isSave.value = true; isSave.value = true;
} }
function deletePerson(id: string) { // function deletePerson(id: string) {
changeFormData(); // changeFormData();
const dataRow = mainStore.rowsAdd; // const dataRow = mainStore.rowsAdd;
const updatedRows = dataRow.filter((item: any) => item.id !== id); // const updatedRows = dataRow.filter((item: any) => item.id !== id);
mainStore.rowsAdd = updatedRows; // mainStore.rowsAdd = updatedRows;
} // }
/** /**
* งขอมลจำลองไปย store * งขอมลจำลองไปย store
@ -182,12 +180,25 @@ function deletePerson(id: string) {
onMounted(async () => {}); onMounted(async () => {});
</script> </script>
<template> <template>
<div class="row col-12">
<div class="col-12">
<div v-if="isSave" class="q-pa-sm q-gutter-sm">
<q-banner
inline-actions
bordered
class="bg-red-1 text-red border-orange"
>
<q-icon name="mdi-information-outline" size="20px" /> แจงเตอน
งไมไดนทกขอม
</q-banner>
</div>
<form @submit.prevent="validateForm"> <form @submit.prevent="validateForm">
<q-card> <q-card>
<div class="q-pa-md"> <div class="q-pa-md">
<div class="row col-12 q-gutter-sm"> <div class="row col-12 q-gutter-sm">
<div class="col-xs-12 col-sm-2"> <div class="col-xs-12 col-sm-2">
<q-select <q-select
readonly
for="SelectrespondentType" for="SelectrespondentType"
v-model="respondentType" v-model="respondentType"
ref="respondentTypeRef" ref="respondentTypeRef"
@ -250,7 +261,7 @@ onMounted(async () => {});
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md" class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
> >
กรองเรยน กรองเรยน
<q-btn <!-- <q-btn
v-if="!isReadonly" v-if="!isReadonly"
size="12px" size="12px"
flat flat
@ -262,7 +273,7 @@ onMounted(async () => {});
icon="mdi-plus" icon="mdi-plus"
> >
<q-tooltip>เพมผกรองเรยน</q-tooltip> <q-tooltip>เพมผกรองเรยน</q-tooltip>
</q-btn> </q-btn> -->
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="col-xs-12 q-pa-sm"> <div class="col-xs-12 q-pa-sm">
@ -286,9 +297,11 @@ onMounted(async () => {});
:props="props" :props="props"
style="color: #000000; font-weight: 500" style="color: #000000; font-weight: 500"
> >
<span class="text-weight-medium">{{ col.label }}</span> <span class="text-weight-medium">{{
col.label
}}</span>
</q-th> </q-th>
<q-th auto-width></q-th> <!-- <q-th auto-width></q-th> -->
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
@ -327,7 +340,7 @@ onMounted(async () => {});
{{ col.value }} {{ col.value }}
</div> </div>
</q-td> </q-td>
<q-td auto-width> <!-- <q-td auto-width>
<q-btn <q-btn
v-if="!isReadonly" v-if="!isReadonly"
size="12px" size="12px"
@ -340,7 +353,7 @@ onMounted(async () => {});
@click="deletePerson(props.row.id)" @click="deletePerson(props.row.id)"
><q-tooltip>ลบผกรองเรยน</q-tooltip></q-btn ><q-tooltip>ลบผกรองเรยน</q-tooltip></q-btn
> >
</q-td> </q-td> -->
</q-tr> </q-tr>
</template> </template>
</d-table> </d-table>
@ -359,6 +372,7 @@ onMounted(async () => {});
hide-bottom-space hide-bottom-space
:rules="[(val) => !!val || `${'กรุณากรอกกรณีมีความผิด'}`]" :rules="[(val) => !!val || `${'กรุณากรอกกรณีมีความผิด'}`]"
lazy-rules lazy-rules
@update:model-value="changeFormData()"
/> />
</div> </div>
</div> </div>
@ -375,7 +389,7 @@ onMounted(async () => {});
> >
</div> </div>
</q-card> </q-card>
<DialogAddPersonal <!-- <DialogAddPersonal
title="ผู้ถูกร้องเรียน" title="ผู้ถูกร้องเรียน"
:mainData="mainStore.rowsAdd" :mainData="mainStore.rowsAdd"
:modal="modalPerson" :modal="modalPerson"
@ -383,6 +397,8 @@ onMounted(async () => {});
:close="toggleModal" :close="toggleModal"
:save="addPerson" :save="addPerson"
@returnData="handleSave" @returnData="handleSave"
/> /> -->
</form> </form>
</div>
</div>
</template> </template>

View file

@ -125,12 +125,12 @@ const updateInput = (value: any) => {
const Reset = () => { const Reset = () => {
emit("update:filterKeyword2", ""); emit("update:filterKeyword2", "");
}; };
watch([()=>props.modal],() => { // watch([()=>props.modal],() => {
selected.value = props.modal ? [] : []; // selected.value = props.modal ? [] : [];
if (props.modal === true) { // if (props.modal === true) {
selected.value = props.rows2; // selected.value = props.rows2;
} // }
}); // });
</script> </script>
<template> <template>
<q-dialog v-model="props.modal"> <q-dialog v-model="props.modal">

View file

@ -9,7 +9,6 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import DialogSendToCommand from "@/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue"; import DialogSendToCommand from "@/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue";
import type { dataType } from '@/modules/11_discipline/interface/response/suspend' import type { dataType } from '@/modules/11_discipline/interface/response/suspend'
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/SuspendStore"; import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/SuspendStore";
/** use */ /** use */