แก้ กรรมการ
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue