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