แก้ ui
This commit is contained in:
parent
5c28d14047
commit
66124a819d
9 changed files with 246 additions and 189 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import FormComplaints from "@/modules/11_discipline/components/1_Complaint/Form.vue"; //เรื่องร้องเรียน
|
||||
import FormInvestigatefacts from "@/modules/11_discipline/components/2_InvestigateFacts/Form.vue"; //สืบสวนข้อเท็จจริง
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInvestigateFactStore } from "@/modules/11_discipline/store/InvestigateFactStore";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/main";
|
||||
|
|
@ -25,6 +25,7 @@ const mixin = useCounterMixin();
|
|||
const store = useInvestigateFactStore();
|
||||
const { dialogConfirm, showLoader, success, hideLoader, messageError } = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์มสืบสวน */
|
||||
|
|
@ -138,9 +139,11 @@ function getData() {
|
|||
.get(config.API.investigateById(id.value))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
console.log(dataList)
|
||||
data.id = dataList.id;
|
||||
data.idComplaint = dataList.idComplaint;
|
||||
data.respondentType = dataList.respondentType;
|
||||
data.organizationId = dataList.organizationId;
|
||||
data.persons = dataList.persons;
|
||||
data.investigationDetail = dataList.investigationDetail;
|
||||
data.investigationDetailOther = dataList.investigationDetailOther;
|
||||
|
|
@ -157,6 +160,7 @@ function getData() {
|
|||
data.investigationStatusResult = dataList.investigationStatusResult;
|
||||
data.investigationExtendStatus = dataList.investigationExtendStatus;
|
||||
data.investigationDaysExtend = dataList.investigationDaysExtend;
|
||||
console.log(dataList)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -193,13 +197,33 @@ async function onSubmit(data: any) {
|
|||
const modalPopup = ref<boolean>(false);
|
||||
/** ยืนยัน ส่งไปสอบสวน */
|
||||
function sentInvestigate() {
|
||||
modalPopup.value = true;
|
||||
// dialogConfirm(
|
||||
// $q,
|
||||
// () => confirmSentInvestigate(),
|
||||
// "ยืนยันส่งไปสอบสวน",
|
||||
// "ต้องการยืนยันส่งไปสอบสวนใช่หรือไม่?"
|
||||
// );
|
||||
if (mainStore.rowsAdd.length > 0) {
|
||||
modalPopup.value = true;
|
||||
} else {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => sentConfirmNoPerson(),
|
||||
"ยืนยันส่งไปสอบสวน",
|
||||
"ต้องการยืนยันส่งไปสอบสวนใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function sentConfirmNoPerson() {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.investigateApprove(id.value), {
|
||||
persons: [],
|
||||
})
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
getData();
|
||||
router.push(`/discipline/investigatefacts`)
|
||||
});
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
|
|
@ -237,12 +261,13 @@ function confirmEndInvestigate() {
|
|||
http
|
||||
.get(config.API.investigateReject(id.value))
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
success($q, "ยุติเรื่องสำเร็จ");
|
||||
await getData();
|
||||
});
|
||||
}
|
||||
|
|
@ -260,6 +285,7 @@ function confirmCancelInvestigate() {
|
|||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
success($q, "ยกเลิกยุติเรื่องสำเร็จ");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue