วินัย => fix bug

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-04 13:44:29 +07:00
parent 7a483649d4
commit 17b801eede
15 changed files with 197 additions and 90 deletions

View file

@ -109,7 +109,11 @@ const dataComplaints = reactive<FormDataComplaint>({
async function getDataComplaint() {
showLoader();
await http
.get(config.API.complaintbyId(data.idComplaint))
.get(
config.API.complaintbyId(
data.idComplaint ? data.idComplaint : store.complaintId
)
)
.then((res) => {
const dataList = res.data.result;
dataComplaints.id = dataList.id;
@ -148,6 +152,7 @@ function getData() {
const dataList = res.data.result;
data.id = dataList.id;
data.idComplaint = dataList.idComplaint;
store.complaintId = dataList.idComplaint;
data.respondentType = dataList.respondentType;
data.organizationId = dataList.organizationId;
data.organization = dataList.organization;
@ -191,15 +196,15 @@ async function onSubmit(data: any) {
showLoader();
http
.put(config.API.investigateById(id.value), data)
.then((res) => {
getData();
success($q, "บันทึกข้อมูลสำเร็จ");
.then(async (res) => {
await getData();
await success($q, "บันทึกข้อมูลสำเร็จ");
// router.push(`/discipline/complaints`);
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
.finally(() => {
hideLoader();
});
// router.push(`/discipline/investigatefacts`);
@ -225,14 +230,15 @@ function sentConfirmNoPerson() {
.put(config.API.investigateApprove(id.value), {
persons: [],
})
.then((res) => {})
.then((res) => {
getData();
router.push(`/discipline/investigatefacts`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
getData();
router.push(`/discipline/investigatefacts`);
});
}
@ -265,14 +271,13 @@ function confirmEndInvestigate() {
showLoader();
http
.get(config.API.investigateReject(id.value))
.then((res) => {
success($q, "ยุติเรื่องสำเร็จ");
.then(async () => {
await getData();
await success($q, "ยุติเรื่องสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await getData();
hideLoader();
});
}
@ -281,15 +286,15 @@ function confirmCancelInvestigate() {
showLoader();
http
.get(config.API.investigateResume(id.value))
.then((res) => {
getData();
.then(async () => {
await getData();
await success($q, "ยกเลิกยุติเรื่องสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
success($q, "ยกเลิกยุติเรื่องสำเร็จ");
});
}
@ -300,8 +305,7 @@ function emitPerson(data: FormData[]) {
.put(config.API.investigateApprove(id.value), {
persons: dataMapId,
})
.then((res) => {
.then(() => {
router.push(`/discipline/investigatefacts`);
})
.catch((e) => {
@ -315,6 +319,9 @@ function emitPerson(data: FormData[]) {
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(() => {
getData();
if (store.tabMenu == "complaints") {
getDataComplaint();
}
});
watch(

View file

@ -902,7 +902,7 @@ onMounted(async () => {
{{ props.row.salary.toLocaleString() }}
</div>
<div v-else>
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
<q-td auto-width>
@ -1268,7 +1268,7 @@ onMounted(async () => {
{{ props.rowIndex + 1 }}
</div>
<div v-else class="table_ellipsis2">
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
<q-td class="text-right">
@ -1545,6 +1545,7 @@ onMounted(async () => {
v-if="!isReadonly && formData.id !== ''"
class="col-12 row"
>
<!-- accept=".pdf,.xlsx,.docx" -->
<q-file
for="inputFiles"
class="col-12"
@ -1553,7 +1554,7 @@ onMounted(async () => {
v-model="formData.documentFile"
@added="uploadFile"
label="ไฟล์เอกสารหลักฐาน"
accept=".pdf,.xlsx,.docx"
clearable
>
<template v-slot:prepend>

View file

@ -124,7 +124,14 @@ onMounted(async () => {
option-value="id"
:options="dataInvestigate.statusOptions"
@update:model-value="getList()"
/>
>
<template v-if="statusFilter !== 'ALL'" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="(statusFilter = 'ALL'), getList()"
class="cursor-pointer"
/> </template
></q-select>
</div>
<q-space />