diff --git a/src/components/Dialogs/AddPersonal.vue b/src/components/Dialogs/AddPersonal.vue index 52d10a313..d5581e8c7 100644 --- a/src/components/Dialogs/AddPersonal.vue +++ b/src/components/Dialogs/AddPersonal.vue @@ -15,7 +15,7 @@ const totalList = ref(1); const $q = useQuasar(); const mixin = useCounterMixin(); -const { dialogMessageNotify, showLoader, hideLoader } = mixin; +const { dialogMessageNotify, showLoader, hideLoader, messageError } = mixin; const pagination = ref({ sortBy: "createdAt", @@ -97,14 +97,14 @@ const emit = defineEmits(["returnData"]); /** ปิด dialog */ async function close() { - console.log("close"); props.close(); + rows.value = []; + search.value = ""; } /** เปิด dialog ยืนยัน */ function savePost() { if (selected.value.length != 0) { - // dialogConfirm($q, () => saveData()); saveData(); } else { dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ"); @@ -185,7 +185,7 @@ async function getSearch() { rows.value = list; }) .catch((err) => { - console.log(err); + messageError($q, err); }) .finally(() => { hideLoader(); @@ -205,7 +205,6 @@ watch( ); function updatePagination(newPagination: any) { - console.log("🚀 ~ updatePagination ~ newPagination:", newPagination) pagination.value.page = 1; pagination.value.rowsPerPage = newPagination.rowsPerPage; } @@ -373,7 +372,12 @@ watch( - +
{{ props.btnTitle }}
diff --git a/src/modules/11_discipline/components/1_Complaint/MainPage.vue b/src/modules/11_discipline/components/1_Complaint/MainPage.vue index 76818f859..27b8ed54c 100644 --- a/src/modules/11_discipline/components/1_Complaint/MainPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/MainPage.vue @@ -92,7 +92,7 @@ onMounted(async () => {
-
+
{ option-value="id" :options="complainstStore.statusOptions" @update:model-value="getList()" - /> + > + +
({ 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( diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 691f2e749..b3baa7101 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -902,7 +902,7 @@ onMounted(async () => { {{ props.row.salary.toLocaleString() }}
- {{ col.value }} + {{ col.value ?? "-" }}
@@ -1268,7 +1268,7 @@ onMounted(async () => { {{ props.rowIndex + 1 }}
- {{ col.value }} + {{ col.value ?? "-" }}
@@ -1545,6 +1545,7 @@ onMounted(async () => { v-if="!isReadonly && formData.id !== ''" class="col-12 row" > + { v-model="formData.documentFile" @added="uploadFile" label="ไฟล์เอกสารหลักฐาน" - accept=".pdf,.xlsx,.docx" + clearable >