no message
This commit is contained in:
parent
9f82a3b2ef
commit
5d625bc4ae
5 changed files with 145 additions and 89 deletions
|
|
@ -235,7 +235,6 @@ function getData() {
|
||||||
http
|
http
|
||||||
.get(config.API.investigateById(id.value))
|
.get(config.API.investigateById(id.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data.result);
|
|
||||||
const dataList = res.data.result;
|
const dataList = res.data.result;
|
||||||
data.id = dataList.id;
|
data.id = dataList.id;
|
||||||
data.idComplaint = dataList.idComplaint;
|
data.idComplaint = dataList.idComplaint;
|
||||||
|
|
@ -251,8 +250,7 @@ function getData() {
|
||||||
data.result = dataList.result;
|
data.result = dataList.result;
|
||||||
data.directors = dataList.director;
|
data.directors = dataList.director;
|
||||||
data.disciplineInvestigateDocs = dataList.disciplineInvestigateDocs;
|
data.disciplineInvestigateDocs = dataList.disciplineInvestigateDocs;
|
||||||
data.disciplineInvestigateRelevantDocs =
|
data.disciplineInvestigateRelevantDocs = dataList.disciplineInvestigateRelevantDocs;
|
||||||
dataList.disciplineInvestigateRelevantDocs;
|
|
||||||
data.investigationStatusResult = dataList.investigationStatusResult;
|
data.investigationStatusResult = dataList.investigationStatusResult;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -282,6 +280,7 @@ async function onSubmit(data: any) {
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
getData();
|
||||||
});
|
});
|
||||||
// router.push(`/discipline/investigatefacts`);
|
// router.push(`/discipline/investigatefacts`);
|
||||||
}
|
}
|
||||||
|
|
@ -361,6 +360,7 @@ function confirmCancelInvestigate() {
|
||||||
|
|
||||||
function emitPerson(data: FormData[]) {
|
function emitPerson(data: FormData[]) {
|
||||||
const dataMapId = data.map((item: FormData) => item.id);
|
const dataMapId = data.map((item: FormData) => item.id);
|
||||||
|
console.log(dataMapId);
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.put(config.API.investigateApprove(id.value), {
|
.put(config.API.investigateApprove(id.value), {
|
||||||
|
|
@ -374,6 +374,7 @@ function emitPerson(data: FormData[]) {
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
getData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -310,10 +310,23 @@ watch(props.data, async () => {
|
||||||
formData.investigationCauseText = props.data.investigationCauseText;
|
formData.investigationCauseText = props.data.investigationCauseText;
|
||||||
formData.result = props.data.result;
|
formData.result = props.data.result;
|
||||||
formData.disciplineInvestigateDocs = props.data.disciplineInvestigateDocs;
|
formData.disciplineInvestigateDocs = props.data.disciplineInvestigateDocs;
|
||||||
formData.evidenceFiles = props.data.evidenceFiles;
|
formData.disciplineInvestigateRelevantDocs =
|
||||||
|
props.data.disciplineInvestigateRelevantDocs;
|
||||||
|
formData.status = props.data.status;
|
||||||
|
|
||||||
investigateFactStore.rowsAdd = props.data.persons;
|
investigateFactStore.rowsAdd = props.data.persons;
|
||||||
rows.value = props.data.directors;
|
|
||||||
|
const dataMap = props.data.directors.map((item: any) => ({
|
||||||
|
id: item.id,
|
||||||
|
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,
|
||||||
|
}));
|
||||||
|
rows.value = dataMap;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -482,11 +495,30 @@ async function getList() {
|
||||||
function returnDirector(data: any) {
|
function returnDirector(data: any) {
|
||||||
clickClose();
|
clickClose();
|
||||||
const dataList = data.map((item: any) => item.id);
|
const dataList = data.map((item: any) => item.id);
|
||||||
console.log(dataList);
|
console.log(data);
|
||||||
formData.directors = dataList;
|
formData.directors = dataList;
|
||||||
rows.value = data;
|
rows.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deletePerson(id: string) {
|
||||||
|
dialogRemove($q, () => remove(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
function remove(id: string) {
|
||||||
|
const dataRow = investigateFactStore.rowsAdd;
|
||||||
|
const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||||
|
investigateFactStore.rowsAdd = updatedRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
function deleteDirector(id: string) {
|
||||||
|
dialogRemove($q, () => removePerson(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
function removePerson(id: string) {
|
||||||
|
const dataRow = rows.value;
|
||||||
|
const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||||
|
rows.value = updatedRows;
|
||||||
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
console.log(route.name);
|
console.log(route.name);
|
||||||
getOc();
|
getOc();
|
||||||
|
|
@ -558,35 +590,36 @@ onMounted(async () => {
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="col-xs-12 col-sm-3">
|
<div class="col-xs-12 col-sm-3">
|
||||||
<q-select
|
<q-select
|
||||||
for="SelectrespondentType"
|
for="SelectrespondentType"
|
||||||
v-model="formData.respondentType"
|
v-model="formData.respondentType"
|
||||||
ref="respondentTypeRef"
|
ref="respondentTypeRef"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
:readonly="formData.status !== 'NEW' && formData.status !== ''"
|
:readonly="formData.status !== 'NEW'"
|
||||||
label="ผู้ถูกร้องเรียน"
|
label="ผู้ถูกร้องเรียน"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
emit-value
|
emit-value
|
||||||
use-input
|
use-input
|
||||||
map-options
|
map-options
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:options="investigateFactStore.respondentTypeOps"
|
:options="investigateFactStore.respondentTypeOps"
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
@filter="(inputValue: any,
|
@filter="(inputValue: any,
|
||||||
doneFn: Function) => investigateFactStore.filterSelector(inputValue, doneFn, 'filterrespondentType'
|
doneFn: Function) => investigateFactStore.filterSelector(inputValue, doneFn, 'filterrespondentType'
|
||||||
)"
|
)"
|
||||||
>
|
>
|
||||||
<template v-slot:no-option>
|
<template v-slot:no-option>
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
<q-item-section class="text-grey">
|
||||||
</q-item>
|
ไม่มีข้อมูล
|
||||||
</template>
|
</q-item-section>
|
||||||
</q-select>
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="col-xs-12 col-sm-3"
|
class="col-xs-12 col-sm-3"
|
||||||
v-if="formData.respondentType === 'ORGANIZATION'"
|
v-if="formData.respondentType === 'ORGANIZATION'"
|
||||||
|
|
@ -598,7 +631,7 @@ onMounted(async () => {
|
||||||
ref="organizationIdRef"
|
ref="organizationIdRef"
|
||||||
dense
|
dense
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:readonly="formData.status !== 'NEW' && formData.status !== ''"
|
:readonly="formData.status !== 'NEW'"
|
||||||
outlined
|
outlined
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
|
|
@ -611,35 +644,6 @@ onMounted(async () => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-3">
|
|
||||||
<q-select
|
|
||||||
:readonly="statusStep"
|
|
||||||
:disable="statusStep"
|
|
||||||
for="#investigationDetail"
|
|
||||||
outlined
|
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
ref="investigationDetailRef"
|
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกลักษณะการสืบสวน'}`]"
|
|
||||||
v-model="formData.investigationDetail"
|
|
||||||
:options="investigateFactStore.investigationDetailOp"
|
|
||||||
label="ลักษณะการสืบสวน"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
use-input
|
|
||||||
@filter="(inputValue: any,
|
|
||||||
doneFn: Function) => filterFnOptionsType(inputValue, doneFn, 'investigationOp'
|
|
||||||
)"
|
|
||||||
><template v-slot:no-option>
|
|
||||||
<q-item>
|
|
||||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</template>
|
|
||||||
</q-select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row col-12" v-if="formData.respondentType === 'PERSON'">
|
<div class="row col-12" v-if="formData.respondentType === 'PERSON'">
|
||||||
<q-card
|
<q-card
|
||||||
|
|
@ -652,7 +656,7 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
ผู้ถูกร้องเรียน
|
ผู้ถูกร้องเรียน
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="formData.status === 'NEW' || formData.status === ''"
|
v-if="formData.status === 'NEW'"
|
||||||
size="12px"
|
size="12px"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
@ -689,6 +693,7 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<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-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
|
|
@ -705,14 +710,58 @@ onMounted(async () => {
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
<!-- v-if="formData.status === 'NEW'" -->
|
||||||
|
<q-td auto-width>
|
||||||
|
<q-btn
|
||||||
|
v-if="formData.status === 'NEW'"
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
color="red"
|
||||||
|
class="q-ml-sm"
|
||||||
|
icon="mdi-delete-outline"
|
||||||
|
@click="deletePerson(props.row.id)"
|
||||||
|
><q-tooltip>ลบผู้ถูกร้องเรียน</q-tooltip></q-btn
|
||||||
|
>
|
||||||
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-3">
|
||||||
|
<q-select
|
||||||
|
:readonly="formData.status !== 'NEW'"
|
||||||
|
for="#investigationDetail"
|
||||||
|
outlined
|
||||||
|
hide-bottom-space
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
ref="investigationDetailRef"
|
||||||
|
:rules="[(val) => !!val || `${'กรุณาเลือกลักษณะการสืบสวน'}`]"
|
||||||
|
v-model="formData.investigationDetail"
|
||||||
|
:options="investigateFactStore.investigationDetailOp"
|
||||||
|
label="ลักษณะการสืบสวน"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
use-input
|
||||||
|
@filter="(inputValue: any,
|
||||||
|
doneFn: Function) => filterFnOptionsType(inputValue, doneFn, 'investigationOp'
|
||||||
|
)"
|
||||||
|
><template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
ไม่มีข้อมูล
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="formData.investigationDetail === 'OTHER'" class="col-12">
|
<div v-if="formData.investigationDetail === 'OTHER'" class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
for="#investigationDetailOther"
|
for="#investigationDetailOther"
|
||||||
|
|
@ -949,7 +998,8 @@ onMounted(async () => {
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="red"
|
color="red"
|
||||||
icon="mdi-delete"
|
icon="mdi-delete-outline"
|
||||||
|
@click="deleteDirector(props.row.id)"
|
||||||
>
|
>
|
||||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
@ -1137,7 +1187,10 @@ onMounted(async () => {
|
||||||
><q-tooltip>อัปโหลดเอกสาร</q-tooltip></q-btn
|
><q-tooltip>อัปโหลดเอกสาร</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-mt-sm">
|
<div
|
||||||
|
class="col-12 q-mt-sm"
|
||||||
|
v-if="formData.disciplineInvestigateRelevantDocs.length === 0"
|
||||||
|
>
|
||||||
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
<q-card class="q-pa-md" bordered> ไม่มีรายการเอกสาร </q-card>
|
||||||
</div>
|
</div>
|
||||||
<q-list separator class="full-width q-mt-md">
|
<q-list separator class="full-width q-mt-md">
|
||||||
|
|
@ -1205,6 +1258,7 @@ onMounted(async () => {
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="col-xs-12 q-pa-sm row">
|
<div class="col-xs-12 q-pa-sm row">
|
||||||
<q-file
|
<q-file
|
||||||
|
v-if="formData.status === 'NEW'"
|
||||||
class="col-11 q-mt-sm"
|
class="col-11 q-mt-sm"
|
||||||
for="#documentFile"
|
for="#documentFile"
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -1264,6 +1318,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="formData.status === 'NEW'"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -39,28 +39,28 @@ interface investigateDisDataRowType {
|
||||||
|
|
||||||
interface directorType {
|
interface directorType {
|
||||||
id: string;
|
id: string;
|
||||||
directorId: string;
|
directorId?: string;
|
||||||
prefix: string;
|
prefix: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
position: string;
|
position: string;
|
||||||
email: string;
|
email: string;
|
||||||
phone: string;
|
phone: string;
|
||||||
total: number;
|
total?: number;
|
||||||
duty: string;
|
duty?: string;
|
||||||
}
|
}
|
||||||
interface responseType {
|
interface responseType {
|
||||||
id: string;
|
id: string;
|
||||||
directorId: string;
|
directorId?: string;
|
||||||
name: string;
|
|
||||||
prefix: string;
|
prefix: string;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
position: string;
|
position: string;
|
||||||
email: string;
|
email: string;
|
||||||
phone: string;
|
phone: string;
|
||||||
total: number;
|
total?: number;
|
||||||
duty: string;
|
duty?: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FileLists {
|
interface FileLists {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ interface FormData {
|
||||||
directors:object|null
|
directors:object|null
|
||||||
status:string
|
status:string
|
||||||
disciplineInvestigateDocs:any
|
disciplineInvestigateDocs:any
|
||||||
disciplineInvestigateRelevantDocs:object|null
|
disciplineInvestigateRelevantDocs:any
|
||||||
documentFile:any|null
|
documentFile:any|null
|
||||||
respondentType:string
|
respondentType:string
|
||||||
organizationId:string
|
organizationId:string
|
||||||
|
|
|
||||||
|
|
@ -55,21 +55,21 @@ export const useInvestigateDisStore = defineStore(
|
||||||
|
|
||||||
rows.value = datalist;
|
rows.value = datalist;
|
||||||
}
|
}
|
||||||
// async function fecthDirector(data: directorType[]) {
|
async function fecthDirector(data: directorType[]) {
|
||||||
// let datalistDirector: responseType[] = data.map((e: directorType) => ({
|
let datalistDirector: responseType[] = data.map((e: directorType) => ({
|
||||||
// id: e.id,
|
id: e.id,
|
||||||
// name: `${e.prefix}${e.firstName} ${e.lastName}`,
|
name: `${e.prefix}${e.firstName} ${e.lastName}`,
|
||||||
// prefix: e.prefix,
|
prefix: e.prefix,
|
||||||
// firstName: e.firstName,
|
firstName: e.firstName,
|
||||||
// lastName: e.lastName,
|
lastName: e.lastName,
|
||||||
// position: e.position,
|
position: e.position,
|
||||||
// email: e.email,
|
email: e.email,
|
||||||
// phone: e.phone,
|
phone: e.phone,
|
||||||
// }));
|
}));
|
||||||
// rows2.value = datalistDirector;
|
rows2.value = datalistDirector;
|
||||||
// selected.value = rows2.value;
|
selected.value = rows2.value;
|
||||||
// // console.log(rows2.value);
|
// console.log(rows2.value);
|
||||||
// }
|
}
|
||||||
|
|
||||||
function convertRespondentType(val: string) {
|
function convertRespondentType(val: string) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
|
|
@ -305,7 +305,7 @@ export const useInvestigateDisStore = defineStore(
|
||||||
rows2,
|
rows2,
|
||||||
optionsTypefault,
|
optionsTypefault,
|
||||||
optionsfaultLevel,
|
optionsfaultLevel,
|
||||||
// fecthDirector,
|
fecthDirector,
|
||||||
visibleColumns,
|
visibleColumns,
|
||||||
columns,
|
columns,
|
||||||
visibleColumnsDirector,
|
visibleColumnsDirector,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue