ปรับ เรื่องร้องเรียน
This commit is contained in:
parent
cc2e45666e
commit
facadbd837
6 changed files with 73 additions and 14 deletions
|
|
@ -244,7 +244,6 @@ async function getData() {
|
|||
data.persons = dataList.persons;
|
||||
data.result = dataList.result;
|
||||
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
|
||||
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -272,7 +271,28 @@ async function onSubmit(data: any) {
|
|||
|
||||
/** ยืนยัน มีมูลส่งไปสืบสวน */
|
||||
function sentInvestigate() {
|
||||
modalPopup.value = true;
|
||||
if (complainstStore.rowsAdd.length > 0) {
|
||||
modalPopup.value = true;
|
||||
} else {
|
||||
dialogConfirm($q,()=>sentConfirm(),'ยืนยันส่งไปสืบสวน','ต้องการยืนยันยืนยันส่งไปสืบสวนใช่หรือไม่?')
|
||||
}
|
||||
}
|
||||
|
||||
function sentConfirm(){
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintApprove(id.value), {
|
||||
persons: [],
|
||||
})
|
||||
.then((res) => {
|
||||
router.push(`/discipline/complaints`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ function confirmDelete(id: string) {
|
|||
watch(props.data, async () => {
|
||||
fileList.value = props.data.disciplineComplaintDocs;
|
||||
complainstStore.fetchComplainstAdd(props.data.persons);
|
||||
|
||||
|
||||
formData.id = props.data.id;
|
||||
formData.respondentType = props.data.respondentType;
|
||||
formData.organizationId = props.data.organizationId;
|
||||
|
|
@ -403,20 +403,22 @@ function upLoadFileDoc() {
|
|||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
router.push(`/discipline/complaints`);
|
||||
props.getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
formData.documentFile = null
|
||||
});
|
||||
console.log("file", formData.documentFile, formData.id);
|
||||
}
|
||||
|
||||
async function addPerson(data: any) {
|
||||
await complainstStore.fetchComplainstAdd(data);
|
||||
toggleModal();
|
||||
console.log(data)
|
||||
await complainstStore.fetchComplainstAdd(data);
|
||||
}
|
||||
|
||||
function getOc() {
|
||||
|
|
@ -425,6 +427,19 @@ function getOc() {
|
|||
complainstStore.ocListFn(data);
|
||||
});
|
||||
}
|
||||
|
||||
function deletePerson(id: string) {
|
||||
dialogRemove($q, () => removePerson(id));
|
||||
}
|
||||
|
||||
function removePerson(id: string) {
|
||||
const dataRow = complainstStore.rowsAdd;
|
||||
const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||
success($q,'ลบข้อมูลสำเร็จ')
|
||||
complainstStore.rowsAdd = updatedRows;
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOc();
|
||||
complainstStore.columns = columns.value;
|
||||
|
|
@ -575,6 +590,7 @@ onMounted(() => {
|
|||
col.label
|
||||
}}</span>
|
||||
</q-th>
|
||||
<q-th auto-width v-if="formData.status === 'NEW'"></q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -595,10 +611,29 @@ onMounted(() => {
|
|||
>
|
||||
{{ col.value }}
|
||||
</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 v-if="formData.status === 'NEW'">
|
||||
<q-btn
|
||||
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>
|
||||
|
|
@ -978,6 +1013,7 @@ onMounted(() => {
|
|||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
v-if="formData.status === 'NEW'"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
|
|
@ -991,6 +1027,13 @@ onMounted(() => {
|
|||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
<div v-if="fileList.length === 0">
|
||||
<q-card class="bg-grey-4 q-ma-sm q-py-md" bordered>
|
||||
<p class="text-subtitle1 text-center q-ma-none text-bold">
|
||||
ไม่มีรายการเอกสาร
|
||||
</p>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -60,10 +60,6 @@ const initialPagination = ref<any>({
|
|||
});
|
||||
|
||||
function onclickSend() {
|
||||
// inputRef.value.validate();
|
||||
// dialogConfirm($q, () => props.sentApprove());
|
||||
|
||||
if (selected.value.length > 0) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -75,9 +71,7 @@ function onclickSend() {
|
|||
`ยืนยันการส่ง${props.title}`,
|
||||
`ต้องการยืนยันการส่ง${props.title}หรือไม่`
|
||||
);
|
||||
} else {
|
||||
dialogMessageNotify($q, "กรุณาเลือกรายชื่อ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onClickClose() {
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ watch(
|
|||
class="custom-header-table"
|
||||
:visible-columns="complainstStore.visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ onMounted(async () => {
|
|||
v-bind="attrs"
|
||||
:visible-columns="dataInvestigate.visibleColumns"
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ interface DataListRow {
|
|||
id: string;
|
||||
personId: string;
|
||||
title: string;
|
||||
dateReceived: string;
|
||||
dateReceived: string|null;
|
||||
respondentType: string;
|
||||
offenseDetails: string;
|
||||
createdAt: string;
|
||||
levelConsideration: string;
|
||||
dateConsideration: string;
|
||||
dateConsideration: string |null;
|
||||
status: string;
|
||||
}
|
||||
interface DataAdd {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue