แก้ reason
This commit is contained in:
parent
422ea07f4d
commit
9e3f326235
5 changed files with 108 additions and 55 deletions
|
|
@ -16,6 +16,8 @@ export default {
|
|||
|
||||
complaintAdd:() => `${discipline}/complaint`,
|
||||
complaintbyId:(id:string) => `${discipline}/complaint/${id}`,
|
||||
complaintReject:(id:string) => `${discipline}/complaint/reject/${id}`,
|
||||
complaintResume:(id:string) => `${discipline}/complaint/resume/${id}`,
|
||||
complaintList:(page:number,pageSize:number,keyword:string) => `${discipline}/complaint?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
||||
complaintFileUpload:(id:string) => `${discipline}/complaint/file/${id}`,
|
||||
complaintFileDelete:(id:string,docId:string) => `${discipline}/complaint/file/${id}/${docId}`
|
||||
|
|
|
|||
|
|
@ -16,20 +16,21 @@ const router = useRouter();
|
|||
/** บันทึกข้อมูล */
|
||||
async function onSubmit(data: any) {
|
||||
/** post */
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.complaintAdd(), data)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
router.push(`/discipline/complaints/${res.data.result}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
console.log(data)
|
||||
// showLoader();
|
||||
// http
|
||||
// .post(config.API.complaintAdd(), data)
|
||||
// .then((res) => {
|
||||
// console.log(res)
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// router.push(`/discipline/complaints/${res.data.result}`);
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// });
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,14 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, showLoader, hideLoader, success, messageError } = mixin;
|
||||
const {
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
|
|
@ -26,12 +33,12 @@ const modalPopup = ref<boolean>(false);
|
|||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const personOj = reactive<ArrayPerson>({
|
||||
personId:'',
|
||||
personId: "",
|
||||
idcard: "",
|
||||
name: "",
|
||||
prefix:'',
|
||||
firstName:'',
|
||||
lastName:'',
|
||||
prefix: "",
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
posNo: "",
|
||||
position: "",
|
||||
positionLevel: "",
|
||||
|
|
@ -46,7 +53,7 @@ const fileListOj = reactive<ArrayFileList>({
|
|||
});
|
||||
|
||||
const data = reactive<FormData>({
|
||||
id:'',
|
||||
id: "",
|
||||
respondentType: "",
|
||||
organizationId: "",
|
||||
consideredAgency: "",
|
||||
|
|
@ -62,7 +69,7 @@ const data = reactive<FormData>({
|
|||
documentFile: null,
|
||||
status: "",
|
||||
persons: [personOj],
|
||||
rejectReason: null,
|
||||
reason: '',
|
||||
disciplineComplaintDocs: [fileListOj],
|
||||
});
|
||||
|
||||
|
|
@ -129,29 +136,29 @@ const data = reactive<FormData>({
|
|||
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
await http
|
||||
.get(config.API.complaintbyId(id.value))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
data.id = dataList.id
|
||||
data.respondentType = dataList.respondentType
|
||||
data.organizationId = dataList.organizationId
|
||||
data.consideredAgency = dataList.consideredAgency
|
||||
data.title = dataList.title
|
||||
data.description = dataList.description
|
||||
data.dateReceived = dataList.dateReceived
|
||||
data.levelConsideration = dataList.levelConsideration
|
||||
data.dateConsideration = dataList.dateConsideration
|
||||
data.offenseDetails = dataList.offenseDetails
|
||||
data.dateNotification = dataList.dateNotification
|
||||
data.complaintFrom = dataList.complaintFrom
|
||||
data.appellant = dataList.appellant
|
||||
data.status = dataList.status
|
||||
data.persons = dataList.persons
|
||||
data.rejectReason = dataList.rejectReason
|
||||
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs
|
||||
data.id = dataList.id;
|
||||
data.respondentType = dataList.respondentType;
|
||||
data.organizationId = dataList.organizationId;
|
||||
data.consideredAgency = dataList.consideredAgency;
|
||||
data.title = dataList.title;
|
||||
data.description = dataList.description;
|
||||
data.dateReceived = dataList.dateReceived;
|
||||
data.levelConsideration = dataList.levelConsideration;
|
||||
data.dateConsideration = dataList.dateConsideration;
|
||||
data.offenseDetails = dataList.offenseDetails;
|
||||
data.dateNotification = dataList.dateNotification;
|
||||
data.complaintFrom = dataList.complaintFrom;
|
||||
data.appellant = dataList.appellant;
|
||||
data.status = dataList.status;
|
||||
data.persons = dataList.persons;
|
||||
data.reason = dataList.reason;
|
||||
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
|
||||
|
||||
console.log('list', data.id)
|
||||
console.log("list", data.id);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -161,12 +168,12 @@ async function getData() {
|
|||
});
|
||||
}
|
||||
/** ฟังชั่น แก้ไข */
|
||||
async function onSubmit(data:any) {
|
||||
showLoader()
|
||||
async function onSubmit(data: any) {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintbyId(id.value),data)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
.put(config.API.complaintbyId(id.value), data)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
router.push(`/discipline/complaints`);
|
||||
})
|
||||
|
|
@ -176,7 +183,7 @@ async function onSubmit(data:any) {
|
|||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
console.log("edit",data);
|
||||
console.log("edit", data);
|
||||
// router.push(`/discipline/complaints`);
|
||||
}
|
||||
|
||||
|
|
@ -222,11 +229,35 @@ function confirmSentInvestigate() {
|
|||
|
||||
/** ฟังชั่น ยุติเรื่อง*/
|
||||
function confirmEndInvestigate() {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintReject(id.value))
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q,e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
console.log("sent");
|
||||
}
|
||||
|
||||
/** ฟังชั่น ยกเลิกการยุติเรื่อง*/
|
||||
function confirmCancelInvestigate() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.complaintResume(id.value))
|
||||
.then((res) => {
|
||||
getData()
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
console.log("sent");
|
||||
}
|
||||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
|
|
@ -273,7 +304,11 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Form :on-submit="onSubmit" :data="data" :get-data="getData"/>
|
||||
<Form
|
||||
:on-submit="onSubmit"
|
||||
:data="data"
|
||||
:get-data="getData"
|
||||
/>
|
||||
<Popup :modal="modalPopup" :close="closePopup" />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ const levelConsiderationRef = ref<Object | null>(null);
|
|||
const dateNotificationRef = ref<Object | null>(null);
|
||||
const complaintFromRef = ref<Object | null>(null);
|
||||
const appellantRef = ref<Object | null>(null);
|
||||
const reasonRef = ref<Object | null>(null);
|
||||
|
||||
const fileList = ref<ArrayFileList[]>([]);
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
|
|
@ -71,6 +72,8 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
const fileListOj = reactive<ArrayFileList>({
|
||||
id: "",
|
||||
pathName: "",
|
||||
|
|
@ -93,11 +96,12 @@ const formData = reactive<FormData>({
|
|||
appellant: "",
|
||||
documentFile: null,
|
||||
status: "",
|
||||
rejectReason: null,
|
||||
reason: '',
|
||||
persons: [],
|
||||
disciplineComplaintDocs: fileList.value ?? null,
|
||||
});
|
||||
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
const objectComplaintsRef: MyObjectComplaintsRef = {
|
||||
respondentType: respondentTypeRef,
|
||||
|
|
@ -112,6 +116,7 @@ const objectComplaintsRef: MyObjectComplaintsRef = {
|
|||
dateNotification: dateNotificationRef,
|
||||
complaintFrom: complaintFromRef,
|
||||
appellant: appellantRef,
|
||||
reason: reasonRef,
|
||||
};
|
||||
|
||||
/** options ทั้งหมด*/
|
||||
|
|
@ -388,6 +393,7 @@ watch(props.data, async () => {
|
|||
formData.complaintFrom = props.data.complaintFrom;
|
||||
formData.appellant = props.data.appellant;
|
||||
formData.status = props.data.status;
|
||||
formData.reason = props.data.reason;
|
||||
formData.persons = complainstStore.rowsAdd;
|
||||
});
|
||||
|
||||
|
|
@ -875,12 +881,12 @@ onMounted(() => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
<q-input
|
||||
for="inputInspectionResults"
|
||||
ref="inputRef"
|
||||
for="reason"
|
||||
ref="reasonRef"
|
||||
dense
|
||||
outlined
|
||||
hide-bottom-space
|
||||
v-model="formData.rejectReason"
|
||||
v-model="formData.reason"
|
||||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอกผลการตรวจสอบเรื่องร้องเรียน',
|
||||
]"
|
||||
|
|
@ -911,15 +917,22 @@ onMounted(() => {
|
|||
</q-card>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-mt-sm q-mb-lg" v-if="props.data">
|
||||
<div class="col-12 q-mt-sm q-mb-lg" v-if="props.data && fileList.length > 0">
|
||||
<q-card flat bordered>
|
||||
<div
|
||||
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||
>
|
||||
{{ formData.status === 'NEW'? 'อัปโหลดไฟล์เอกสารหลักฐาน':'ไฟล์เอกสารหลักฐาน'}}
|
||||
{{
|
||||
formData.status === "NEW"
|
||||
? "อัปโหลดไฟล์เอกสารหลักฐาน"
|
||||
: "ไฟล์เอกสารหลักฐาน"
|
||||
}}
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-ma-sm q-col-gutter-x-sm" v-if="formData.status === 'NEW'">
|
||||
<div
|
||||
class="row q-ma-sm q-col-gutter-x-sm"
|
||||
v-if="formData.status === 'NEW'"
|
||||
>
|
||||
<div class="col-11" id="documentFile">
|
||||
<q-file
|
||||
for="inputFiles"
|
||||
|
|
@ -988,6 +1001,7 @@ onMounted(() => {
|
|||
</div>
|
||||
|
||||
<DialogAddPersonal
|
||||
title="ผู้ถูกร้องเรียน"
|
||||
:checkId="complainstStore.rowsAdd"
|
||||
:modal="modal"
|
||||
btn-title="เพิ่มรายชื่อผู้ถูกสอบสวน"
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ interface FormData {
|
|||
appellant: string
|
||||
documentFile: any | null
|
||||
status: string
|
||||
rejectReason: string|null
|
||||
reason: string
|
||||
persons: object|null
|
||||
organizationId:string|null
|
||||
disciplineComplaintDocs:object|null
|
||||
|
|
@ -50,6 +50,7 @@ interface MyObjectComplaintsRef {
|
|||
dateNotification: object | null;
|
||||
complaintFrom: object | null;
|
||||
appellant: object | null;
|
||||
reason: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue