แก้ กรรมการ
This commit is contained in:
parent
40e787af89
commit
72a1171b8f
6 changed files with 186 additions and 144 deletions
|
|
@ -54,6 +54,7 @@ const type = ref<string>("");
|
|||
const modalEditDirector = ref<boolean>(false);
|
||||
const editDirectorId = ref<string>();
|
||||
const dutyVal = ref<string>();
|
||||
const commandNoVal = ref<string>();
|
||||
|
||||
const filter = ref<string>("");
|
||||
const isUpdate = ref<boolean>(false);
|
||||
|
|
@ -128,7 +129,7 @@ const formData = reactive<FormData>({
|
|||
organizationId: "",
|
||||
persons: [],
|
||||
investigationExtendHistory: [],
|
||||
isDisciplinary:false
|
||||
isDisciplinary: false,
|
||||
});
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
|
|
@ -293,20 +294,21 @@ watch(props.data, async () => {
|
|||
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
mainStore.rowsCheck = mainStore.rowsAdd.filter(
|
||||
(item: any) => item.isDisciplinary === false && item.isSend === 'NEW'
|
||||
(item: any) => item.isDisciplinary === false && item.isSend === "NEW"
|
||||
);
|
||||
|
||||
const dataMap = props.data.directors.map((item: any) => ({
|
||||
id: item.id,
|
||||
directorId: item.directorId,
|
||||
id: item.id ? item.id:'-',
|
||||
directorId: item.directorId ? item.directorId:'-',
|
||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
prefix: item.prefix,
|
||||
firstName: item.firstName,
|
||||
lastName: item.lastName,
|
||||
position: item.position,
|
||||
email: item.email,
|
||||
phone: item.phone,
|
||||
duty: item.duty,
|
||||
prefix: item.prefix ? item.prefix:'-',
|
||||
firstName: item.firstName ? item.firstName:'-',
|
||||
lastName: item.lastName ? item.lastName:'-',
|
||||
position: item.position ? item.position:'-',
|
||||
email: item.email ? item.email:'-',
|
||||
phone: item.phone ? item.phone:'-',
|
||||
commandNo: item.commandNo ? item.commandNo:'-',
|
||||
duty: item.duty ? item.duty:'-',
|
||||
check: "props",
|
||||
}));
|
||||
|
||||
|
|
@ -571,20 +573,24 @@ function emitPerson(data: FormData[]) {
|
|||
});
|
||||
}
|
||||
|
||||
function openEditDirector(id: string, duty: string) {
|
||||
editDirectorId.value = id;
|
||||
function openEditDirector(data: any) {
|
||||
editDirectorId.value = data.directorId;
|
||||
modalEditDirector.value = true;
|
||||
dutyVal.value = duty;
|
||||
dutyVal.value = data.duty;
|
||||
commandNoVal.value = data.commandNo;
|
||||
}
|
||||
|
||||
function closeEditDirector() {
|
||||
modalEditDirector.value = false;
|
||||
}
|
||||
|
||||
async function saveDuty(id: string, duty: string) {
|
||||
async function saveDuty(id: string, duty: string, resolution: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.investigateEditDuty(formData.id, id), { duty: duty })
|
||||
.put(config.API.investigateEditDuty(formData.id, id), {
|
||||
duty: duty,
|
||||
commandNo: resolution,
|
||||
})
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
closeEditDirector();
|
||||
|
|
@ -680,7 +686,10 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-4"
|
||||
v-if="route.name === 'disciplineInvestigatefactsEdit' && mainStore.rowsCheck.length >0"
|
||||
v-if="
|
||||
route.name === 'disciplineInvestigatefactsEdit' &&
|
||||
mainStore.rowsCheck.length > 0
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
class="q-pa-sm"
|
||||
|
|
@ -1143,24 +1152,11 @@ onMounted(async () => {
|
|||
flat
|
||||
round
|
||||
color="blue"
|
||||
@click="
|
||||
openEditDirector(
|
||||
props.row.directorId,
|
||||
props.row.duty
|
||||
)
|
||||
"
|
||||
@click="openEditDirector(props.row)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
<DialogDuty
|
||||
:modal="modalEditDirector"
|
||||
:close-popup="closeEditDirector"
|
||||
:id="editDirectorId"
|
||||
:duty="dutyVal"
|
||||
:save="saveDuty"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="!isReadonly"
|
||||
dense
|
||||
|
|
@ -1212,87 +1208,82 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-12"><q-separator /></div>
|
||||
|
||||
|
||||
<div class="row col-12 q-col-gutter-sm q-pa-sm">
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
for="#fault"
|
||||
outlined
|
||||
dense
|
||||
:readonly="isReadonly"
|
||||
ref="investigationStatusResultRef"
|
||||
v-model="formData.investigationStatusResult"
|
||||
:options="mainStore.statusResultOptions"
|
||||
label="ผลการสืบสวน"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@filter="(inputValue: any,
|
||||
<div class="row col-12 q-col-gutter-sm q-pa-sm">
|
||||
<div class="col-3">
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
for="#fault"
|
||||
outlined
|
||||
dense
|
||||
:readonly="isReadonly"
|
||||
ref="investigationStatusResultRef"
|
||||
v-model="formData.investigationStatusResult"
|
||||
:options="mainStore.statusResultOptions"
|
||||
label="ผลการสืบสวน"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterFnOptionsType(inputValue, doneFn, 'faultOp'
|
||||
)"
|
||||
@update:model-value="changeFormData()"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="
|
||||
formData.investigationStatusResult == 'HAVE_CAUSE'
|
||||
"
|
||||
class="col-3"
|
||||
>
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
for="#fault"
|
||||
outlined
|
||||
dense
|
||||
ref="investigationCauseTextRef"
|
||||
v-model="formData.investigationCauseText"
|
||||
:options="mainStore.causeTextOptions"
|
||||
label="ร้ายแรง/ไม่ร้ายแรง"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@update:model-value="changeFormData()"
|
||||
><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-12">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
outlined
|
||||
ref="resultRef"
|
||||
:readonly="isReadonly"
|
||||
dense
|
||||
borderless
|
||||
v-model="formData.result"
|
||||
hide-bottom-space
|
||||
:label="`${'เหตุผล'}`"
|
||||
type="textarea"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
@update:model-value="changeFormData()"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
|
||||
<div
|
||||
v-if="formData.investigationStatusResult == 'HAVE_CAUSE'"
|
||||
class="col-3"
|
||||
>
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly"
|
||||
for="#fault"
|
||||
outlined
|
||||
dense
|
||||
ref="investigationCauseTextRef"
|
||||
v-model="formData.investigationCauseText"
|
||||
:options="mainStore.causeTextOptions"
|
||||
label="ร้ายแรง/ไม่ร้ายแรง"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@update:model-value="changeFormData()"
|
||||
><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-12">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
outlined
|
||||
ref="resultRef"
|
||||
:readonly="isReadonly"
|
||||
dense
|
||||
borderless
|
||||
v-model="formData.result"
|
||||
hide-bottom-space
|
||||
:label="`${'เหตุผล'}`"
|
||||
type="textarea"
|
||||
@update:model-value="changeFormData()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
|
|
@ -1504,6 +1495,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<DialogDuty
|
||||
:modal="modalEditDirector"
|
||||
:close-popup="closeEditDirector"
|
||||
:id="editDirectorId"
|
||||
:duty="dutyVal"
|
||||
:command="commandNoVal"
|
||||
:save="saveDuty"
|
||||
/>
|
||||
|
||||
<DialogAddPersonal
|
||||
title="ผู้ถูกร้องเรียน"
|
||||
:modal="modalPerson"
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ const status = ref<string>("");
|
|||
|
||||
const idInvestigate = ref<string>("");
|
||||
const idComplaint = ref<string>("");
|
||||
const respondentRows = ref<Persons[]>();
|
||||
const respondentRows = ref<Persons[]>([]);
|
||||
const personObjComplaint = reactive<ArrayPerson>({
|
||||
id: "",
|
||||
personId: "",
|
||||
|
|
@ -117,6 +117,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
organizationId: "",
|
||||
persons: [],
|
||||
investigationExtendHistory: [],
|
||||
isDisciplinary: false,
|
||||
});
|
||||
|
||||
/** function fetchData สอบสวนความผิดทางวินัย*/
|
||||
|
|
@ -251,7 +252,9 @@ async function onSubmit(id: string) {
|
|||
|
||||
/** ยืนยัน ส่งไปออกคำสั่ง */
|
||||
async function sentIssue() {
|
||||
respondentRows.value = await store.rowSent.filter((x) => x.isSuspend === 'NEW' && x.isSend === 'NEW');
|
||||
respondentRows.value = await store.rowSent.filter(
|
||||
(x) => x.isSuspend === "NEW" && x.isSend === "NEW"
|
||||
);
|
||||
modalPopup.value = true;
|
||||
}
|
||||
|
||||
|
|
@ -381,7 +384,6 @@ onMounted(async () => {
|
|||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
<div class="toptitle col-12 row items-center">
|
||||
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
|
|
@ -394,7 +396,6 @@ onMounted(async () => {
|
|||
/>
|
||||
<div class="q-ma-none">แก้ไขการสอบสวนความผิดทางวินัย</div>
|
||||
<q-space />
|
||||
|
||||
<div class="q-gutter-x-sm">
|
||||
<q-btn
|
||||
v-if="status === 'NEW'"
|
||||
|
|
@ -452,7 +453,7 @@ onMounted(async () => {
|
|||
:data="dataInvestigatefacts"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
|
||||
<q-tab-panel name="disciplinary">
|
||||
<FormDisciplinary
|
||||
:on-submit="onSubmit"
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ const listDirector = ref<any>([]);
|
|||
const modalEditDirector = ref<boolean>(false);
|
||||
const editDirectorId = ref<string>();
|
||||
const dutyVal = ref<string>();
|
||||
const commandNoVal = ref<string>();
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const isUpdate = ref<boolean>(false);
|
||||
|
|
@ -327,16 +328,17 @@ async function fetchDatadetail() {
|
|||
);
|
||||
/** MAP รายชื่อกรรมการ หน้าหลัก */
|
||||
const dataMap = props.data.director.map((item: any) => ({
|
||||
idRaw: item.id,
|
||||
id: item.directorId,
|
||||
idRaw: item.id ? item.id:'-',
|
||||
id: item.directorId ? item.directorId:'-',
|
||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
prefix: item.prefix,
|
||||
firstName: item.firstName,
|
||||
lastName: item.lastName,
|
||||
position: item.position,
|
||||
email: item.email,
|
||||
phone: item.phone,
|
||||
duty: item.duty,
|
||||
prefix: item.prefix ? item.prefix:'-',
|
||||
firstName: item.firstName ? item.firstName:'-',
|
||||
lastName: item.lastName ? item.lastName:'-',
|
||||
position: item.position ? item.position:'-',
|
||||
email: item.email ? item.email:'-',
|
||||
phone: item.phone ? item.phone:'-',
|
||||
duty: item.duty ? item.duty:'-',
|
||||
commandNo: item.commandNo ? item.commandNo:'-',
|
||||
check: "props",
|
||||
}));
|
||||
|
||||
|
|
@ -537,20 +539,42 @@ function emitPerson(data: PersonsArray[]) {
|
|||
});
|
||||
}
|
||||
|
||||
function openEditDirector(idVal: string, duty: string) {
|
||||
editDirectorId.value = idVal;
|
||||
function openEditDirector(data: any) {
|
||||
console.log(data)
|
||||
editDirectorId.value = data.idRaw;
|
||||
modalEditDirector.value = true;
|
||||
dutyVal.value = duty;
|
||||
dutyVal.value = data.duty;
|
||||
commandNoVal.value = data.commandNo;
|
||||
}
|
||||
|
||||
function closeEditDirector() {
|
||||
modalEditDirector.value = false;
|
||||
}
|
||||
|
||||
async function saveDuty(id: string, duty: string) {
|
||||
// async function saveDuty(id: string, duty: string) {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.disciplinaryEditDuty(props.data.id, id), { duty: duty })
|
||||
// .then((res: any) => {
|
||||
// success($q, "บันทึกสำเร็จ");
|
||||
// closeEditDirector();
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// props.fetchData();
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
async function saveDuty(id: string, duty: string, resolution: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.disciplinaryEditDuty(props.data.id, id), { duty: duty })
|
||||
.put(config.API.disciplinaryEditDuty(props.data.id, id), {
|
||||
duty: duty,
|
||||
commandNo: resolution,
|
||||
})
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
closeEditDirector();
|
||||
|
|
@ -687,7 +711,8 @@ onMounted(async () => {
|
|||
v-if="
|
||||
route.name === 'disciplineDisciplinaryEdit' &&
|
||||
props.data &&
|
||||
props.data.status === 'NEW'
|
||||
props.data.status === 'NEW' &&
|
||||
mainStore.rowsCheck.length > 0
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
|
|
@ -1328,23 +1353,11 @@ onMounted(async () => {
|
|||
flat
|
||||
round
|
||||
color="blue"
|
||||
@click="
|
||||
openEditDirector(
|
||||
props.row.idRaw,
|
||||
props.row.duty
|
||||
)
|
||||
"
|
||||
@click="openEditDirector(props.row)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
<DialogDuty
|
||||
:modal="modalEditDirector"
|
||||
:close-popup="closeEditDirector"
|
||||
:id="editDirectorId"
|
||||
:duty="dutyVal"
|
||||
:save="saveDuty"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="!isReadonly"
|
||||
|
|
@ -1711,6 +1724,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<DialogDuty
|
||||
:modal="modalEditDirector"
|
||||
:close-popup="closeEditDirector"
|
||||
:id="editDirectorId"
|
||||
:duty="dutyVal"
|
||||
:command="commandNoVal"
|
||||
:save="saveDuty"
|
||||
/>
|
||||
|
||||
<!-- Popup ผู้ถูกร้องเรียน -->
|
||||
<DialogAddPersonal
|
||||
title="ผู้ถูกร้องเรียน"
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import http from "@/plugins/http";
|
|||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
||||
const listCheck = ref<number>();
|
||||
const listCheck = ref<number|null>();
|
||||
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
|
|
@ -46,6 +46,9 @@ function clickList(index: number, data: any) {
|
|||
|
||||
watch(props, () => {
|
||||
if (props) {
|
||||
listCheck.value = null
|
||||
listInvestigateDetail.value = []
|
||||
dataList.value = []
|
||||
const data: DirectorRowsResponse = props.dataList as DirectorRowsResponse;
|
||||
showLoader();
|
||||
http
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ const props = defineProps({
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
command: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
resolution: {
|
||||
type: String,
|
||||
default: "",
|
||||
|
|
@ -48,8 +52,9 @@ async function submit(){
|
|||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await props.save(props.id, duty.value);
|
||||
await props.save(props.id, duty.value,resolution.value);
|
||||
duty.value = "";
|
||||
resolution.value = "";
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลหรือไม่?"
|
||||
|
|
@ -60,8 +65,9 @@ async function submit(){
|
|||
};
|
||||
|
||||
watch(props, () => {
|
||||
console.log(props.command)
|
||||
duty.value = props?.duty;
|
||||
resolution.value = props?.resolution;
|
||||
resolution.value = props?.command;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ export const useInvestigateDisStore = defineStore(
|
|||
"name",
|
||||
"position",
|
||||
"duty",
|
||||
"commandNo",
|
||||
"email",
|
||||
"phone",
|
||||
"total",
|
||||
|
|
@ -217,6 +218,15 @@ export const useInvestigateDisStore = defineStore(
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "commandNo",
|
||||
align: "left",
|
||||
label: "มติ",
|
||||
sortable: true,
|
||||
field: "commandNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
align: "left",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue