แก้ไขฟอร์มสรุปผลการพิจารณา
This commit is contained in:
parent
2c295dbd03
commit
d026e7c615
5 changed files with 219 additions and 200 deletions
|
|
@ -372,6 +372,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
persons: [],
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
<div class="toptitle col-12 row items-center">
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const mainStore = useDisciplineMainStore();
|
|||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const store = useDisciplineResultStore();
|
||||
const { dialogConfirm, showLoader, hideLoader, messageError } = mixin;
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
|
|
@ -51,16 +51,12 @@ function getData() {}
|
|||
/** ยืนยัน ส่งไปออกคำสั่ง */
|
||||
function sentIssue() {
|
||||
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[]>([]);
|
||||
/** function เรียกรายละเอียดผลการพิจารณาทางวินัย*/
|
||||
async function fetchDetailResult() {
|
||||
|
|
@ -69,6 +65,9 @@ async function fetchDetailResult() {
|
|||
.get(config.API.listResultById(id.value))
|
||||
.then((res) => {
|
||||
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) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -86,7 +85,6 @@ async function fetchDetailDisciplinary() {
|
|||
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||
.then((res) => {
|
||||
dataDisciplinary.value = res.data.result;
|
||||
// status.value = res.data.result.status;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -107,10 +105,10 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
investigationDetailOther: "",
|
||||
evidenceFiles: null,
|
||||
fileComplaint: null,
|
||||
extendStatus: false,
|
||||
investigationExtendStatus: false,
|
||||
investigationDateStart: null,
|
||||
investigationDateEnd: null,
|
||||
daysExtend: null,
|
||||
investigationDaysExtend: null,
|
||||
investigationStatusResult: "",
|
||||
investigationCauseText: "",
|
||||
complaintStatus: "",
|
||||
|
|
@ -128,7 +126,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
async function fetchDetailInvestigate() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineInvestigateById(id.value))
|
||||
.get(config.API.investigateById(idInvestigate.value))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
dataInvestigatefacts.id = dataList.id;
|
||||
|
|
@ -154,6 +152,10 @@ async function fetchDetailInvestigate() {
|
|||
dataList.disciplineInvestigateRelevantDocs;
|
||||
dataInvestigatefacts.investigationStatusResult =
|
||||
dataList.investigationStatusResult;
|
||||
dataInvestigatefacts.investigationExtendStatus =
|
||||
dataList.investigationExtendStatus;
|
||||
dataInvestigatefacts.investigationDaysExtend =
|
||||
dataList.investigationDaysExtend;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -206,7 +208,7 @@ const dataComplaints = reactive<FormDataComplaint>({
|
|||
async function fetchDetailComplaints() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineComplaintsById(id.value))
|
||||
.get(config.API.complaintbyId(idComplaint.value))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
dataComplaints.id = dataList.id;
|
||||
|
|
@ -237,6 +239,7 @@ async function fetchDetailComplaints() {
|
|||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(async () => {
|
||||
store.tabMenu = "result";
|
||||
await fetchDetailResult();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ div
|
|||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
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 { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
|
|
@ -23,7 +23,7 @@ const mainStore = useDisciplineMainStore();
|
|||
const modalPerson = ref<boolean>(false);
|
||||
const toggleModal = () => (modalPerson.value = !modalPerson.value);
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
const { fecthDirector } = investigateDis;
|
||||
// const { fecthDirector } = investigateDis;
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
const dataStore = useDisciplineResultStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -70,7 +70,7 @@ const organizationOption = ref<DataOption[]>([]);
|
|||
|
||||
async function addPerson(data: any) {
|
||||
await mainStore.fetchData(data);
|
||||
console.log(mainStore.rowsAdd)
|
||||
console.log(mainStore.rowsAdd);
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
|
|
@ -114,8 +114,6 @@ function validateForm() {
|
|||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
onSubmit();
|
||||
} else {
|
||||
console.log(hasError);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -131,6 +129,7 @@ function onSubmit() {
|
|||
await http
|
||||
.put(config.API.listResultById(id.value), formData)
|
||||
.then(() => {
|
||||
isSave.value = false;
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -156,7 +155,6 @@ async function fetchDatadetail() {
|
|||
watch(
|
||||
() => props.data,
|
||||
async () => {
|
||||
console.log('pros',props.data);
|
||||
respondentType.value = props.data.respondentType;
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
await fetchDatadetail();
|
||||
|
|
@ -169,12 +167,12 @@ function changeFormData() {
|
|||
isSave.value = true;
|
||||
}
|
||||
|
||||
function deletePerson(id: string) {
|
||||
changeFormData();
|
||||
const dataRow = mainStore.rowsAdd;
|
||||
const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||
mainStore.rowsAdd = updatedRows;
|
||||
}
|
||||
// function deletePerson(id: string) {
|
||||
// changeFormData();
|
||||
// const dataRow = mainStore.rowsAdd;
|
||||
// const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||
// mainStore.rowsAdd = updatedRows;
|
||||
// }
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
|
|
@ -182,75 +180,88 @@ function deletePerson(id: string) {
|
|||
onMounted(async () => {});
|
||||
</script>
|
||||
<template>
|
||||
<form @submit.prevent="validateForm">
|
||||
<q-card>
|
||||
<div class="q-pa-md">
|
||||
<div class="row col-12 q-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<q-select
|
||||
for="SelectrespondentType"
|
||||
v-model="respondentType"
|
||||
ref="respondentTypeRef"
|
||||
dense
|
||||
outlined
|
||||
label="ผู้ถูกร้องเรียน"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
use-input
|
||||
map-options
|
||||
hide-bottom-space
|
||||
:options="dataStore.complainantoptions"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="selectComplainant(respondentType)"
|
||||
@filter="(inputValue: any,
|
||||
<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">
|
||||
<q-card>
|
||||
<div class="q-pa-md">
|
||||
<div class="row col-12 q-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<q-select
|
||||
readonly
|
||||
for="SelectrespondentType"
|
||||
v-model="respondentType"
|
||||
ref="respondentTypeRef"
|
||||
dense
|
||||
outlined
|
||||
label="ผู้ถูกร้องเรียน"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
use-input
|
||||
map-options
|
||||
hide-bottom-space
|
||||
:options="dataStore.complainantoptions"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="selectComplainant(respondentType)"
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => dataStore.filterSelector(inputValue, doneFn, 'filterrespondentType'
|
||||
)"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-3"
|
||||
v-if="respondentType === 'ORGANIZATION'"
|
||||
id="organizationId"
|
||||
>
|
||||
<q-select
|
||||
for="inputOffice"
|
||||
name="organizationId"
|
||||
ref="organizationIdRef"
|
||||
dense
|
||||
hide-bottom-space
|
||||
outlined
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="organizationId"
|
||||
:options="organizationOption"
|
||||
label="เลือกสำนักงาน"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
|
||||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
<div class="row col-12" v-if="respondentType === 'PERSON'">
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12"
|
||||
style="border: 1px solid #d6dee1"
|
||||
>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div
|
||||
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-3"
|
||||
v-if="respondentType === 'ORGANIZATION'"
|
||||
id="organizationId"
|
||||
>
|
||||
ผู้ถูกร้องเรียน
|
||||
<q-btn
|
||||
<q-select
|
||||
for="inputOffice"
|
||||
name="organizationId"
|
||||
ref="organizationIdRef"
|
||||
dense
|
||||
hide-bottom-space
|
||||
outlined
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="organizationId"
|
||||
:options="organizationOption"
|
||||
label="เลือกสำนักงาน"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
|
||||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
<div class="row col-12" v-if="respondentType === 'PERSON'">
|
||||
<q-card
|
||||
bordered
|
||||
class="row col-12"
|
||||
style="border: 1px solid #d6dee1"
|
||||
>
|
||||
<div
|
||||
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||
>
|
||||
ผู้ถูกร้องเรียน
|
||||
<!-- <q-btn
|
||||
v-if="!isReadonly"
|
||||
size="12px"
|
||||
flat
|
||||
|
|
@ -262,72 +273,74 @@ onMounted(async () => {});
|
|||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มผู้ถูกร้องเรียน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-12 q-pa-sm">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="mainStore.columnsRespondent"
|
||||
:rows="mainStore.rowsAdd"
|
||||
row-key="idcard"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="mainStore.visibleColumnsRespondent"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
style="color: #000000; font-weight: 500"
|
||||
>
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width></q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="info"
|
||||
icon="info"
|
||||
@click="
|
||||
router.push(`/registry/${props.row.personId}`)
|
||||
"
|
||||
><q-tooltip
|
||||
>ดูข้อมูลในทะเบียนประวัติ</q-tooltip
|
||||
></q-btn
|
||||
</q-btn> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-12 q-pa-sm">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="mainStore.columnsRespondent"
|
||||
:rows="mainStore.rowsAdd"
|
||||
row-key="idcard"
|
||||
flat
|
||||
bordered
|
||||
:paging="true"
|
||||
dense
|
||||
class="custom-header-table"
|
||||
:visible-columns="mainStore.visibleColumnsRespondent"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
style="color: #000000; font-weight: 500"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name === 'organization'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<span class="text-weight-medium">{{
|
||||
col.label
|
||||
}}</span>
|
||||
</q-th>
|
||||
<!-- <q-th auto-width></q-th> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'info'">
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="info"
|
||||
icon="info"
|
||||
@click="
|
||||
router.push(`/registry/${props.row.personId}`)
|
||||
"
|
||||
><q-tooltip
|
||||
>ดูข้อมูลในทะเบียนประวัติ</q-tooltip
|
||||
></q-btn
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name === 'organization'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
{{ props.row.organization }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<!-- <q-td auto-width>
|
||||
<q-btn
|
||||
v-if="!isReadonly"
|
||||
size="12px"
|
||||
|
|
@ -340,42 +353,43 @@ onMounted(async () => {});
|
|||
@click="deletePerson(props.row.id)"
|
||||
><q-tooltip>ลบผู้ถูกร้องเรียน</q-tooltip></q-btn
|
||||
>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-td> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-input
|
||||
type="textarea"
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
ref="detailRef"
|
||||
v-model="formData.resultDescription"
|
||||
for="#detail"
|
||||
label="สรุปผลการพิจารณา"
|
||||
hide-bottom-space
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกกรณีมีความผิด'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-input
|
||||
type="textarea"
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
ref="detailRef"
|
||||
v-model="formData.resultDescription"
|
||||
for="#detail"
|
||||
label="สรุปผลการพิจารณา"
|
||||
hide-bottom-space
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกกรณีมีความผิด'}`]"
|
||||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="row col-12 q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
for="ButtonOnSubmit"
|
||||
id="formSubmit"
|
||||
color="secondary"
|
||||
label="บันทึก"
|
||||
type="submit"
|
||||
><q-tooltip>บับทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</q-card>
|
||||
<DialogAddPersonal
|
||||
<q-separator />
|
||||
<div class="row col-12 q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
for="ButtonOnSubmit"
|
||||
id="formSubmit"
|
||||
color="secondary"
|
||||
label="บันทึก"
|
||||
type="submit"
|
||||
><q-tooltip>บับทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</q-card>
|
||||
<!-- <DialogAddPersonal
|
||||
title="ผู้ถูกร้องเรียน"
|
||||
:mainData="mainStore.rowsAdd"
|
||||
:modal="modalPerson"
|
||||
|
|
@ -383,6 +397,8 @@ onMounted(async () => {});
|
|||
:close="toggleModal"
|
||||
:save="addPerson"
|
||||
@returnData="handleSave"
|
||||
/>
|
||||
</form>
|
||||
/> -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -125,12 +125,12 @@ const updateInput = (value: any) => {
|
|||
const Reset = () => {
|
||||
emit("update:filterKeyword2", "");
|
||||
};
|
||||
watch([()=>props.modal],() => {
|
||||
selected.value = props.modal ? [] : [];
|
||||
if (props.modal === true) {
|
||||
selected.value = props.rows2;
|
||||
}
|
||||
});
|
||||
// watch([()=>props.modal],() => {
|
||||
// selected.value = props.modal ? [] : [];
|
||||
// if (props.modal === true) {
|
||||
// selected.value = props.rows2;
|
||||
// }
|
||||
// });
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import DialogSendToCommand from "@/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue";
|
||||
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";
|
||||
|
||||
/** use */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue