api รายการสืบสวนข้อเท็จจริง
This commit is contained in:
parent
691a989c16
commit
3c5fcc029b
14 changed files with 1025 additions and 383 deletions
|
|
@ -16,12 +16,10 @@ const router = useRouter();
|
|||
/** บันทึกข้อมูล */
|
||||
async function onSubmit(data: any) {
|
||||
/** post */
|
||||
console.log(data)
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.complaintAdd(), data)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
router.push(`/discipline/complaints/${res.data.result}`);
|
||||
})
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ const data = reactive<FormData>({
|
|||
documentFile: null,
|
||||
status: "",
|
||||
persons: [personOj],
|
||||
result: '',
|
||||
result: "",
|
||||
disciplineComplaintDocs: [fileListOj],
|
||||
});
|
||||
|
||||
|
|
@ -158,7 +158,6 @@ async function getData() {
|
|||
data.result = dataList.result;
|
||||
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
|
||||
|
||||
console.log("list", data.id);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -173,7 +172,6 @@ async function onSubmit(data: any) {
|
|||
http
|
||||
.put(config.API.complaintbyId(id.value), data)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
router.push(`/discipline/complaints`);
|
||||
})
|
||||
|
|
@ -183,19 +181,12 @@ async function onSubmit(data: any) {
|
|||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
console.log("edit", data);
|
||||
// router.push(`/discipline/complaints`);
|
||||
}
|
||||
|
||||
/** ยืนยัน มีมูลส่งไปสืบสวน */
|
||||
function sentInvestigate() {
|
||||
modalPopup.value = true;
|
||||
// dialogConfirm(
|
||||
// $q,
|
||||
// () => confirmSentInvestigate(),
|
||||
// "ยืนยันส่งไปสืบสวน",
|
||||
// "ต้องการยืนยันส่งไปสืบสวนใช่หรือไม่?"
|
||||
// );
|
||||
}
|
||||
|
||||
function closePopup() {
|
||||
|
|
@ -222,11 +213,6 @@ function cancelInvestigate() {
|
|||
);
|
||||
}
|
||||
|
||||
/** ฟังชั่น มีมูลส่งไปสืบสวน*/
|
||||
function confirmSentInvestigate() {
|
||||
console.log("sent");
|
||||
}
|
||||
|
||||
/** ฟังชั่น ยุติเรื่อง*/
|
||||
function confirmEndInvestigate() {
|
||||
showLoader();
|
||||
|
|
@ -236,12 +222,11 @@ function confirmEndInvestigate() {
|
|||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q,e);
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
});
|
||||
console.log("sent");
|
||||
}
|
||||
|
||||
/** ฟังชั่น ยกเลิกการยุติเรื่อง*/
|
||||
|
|
@ -250,7 +235,7 @@ function confirmCancelInvestigate() {
|
|||
http
|
||||
.get(config.API.complaintResume(id.value))
|
||||
.then((res) => {
|
||||
getData()
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -258,19 +243,18 @@ function confirmCancelInvestigate() {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
console.log("sent");
|
||||
}
|
||||
|
||||
function emitPerson(data:ArrayPerson[]){
|
||||
console.log('person',data)
|
||||
const dataMapId = data.map((item:ArrayPerson) =>
|
||||
item.personId
|
||||
)
|
||||
console.log('id',dataMapId)
|
||||
showLoader();
|
||||
/**
|
||||
* ดึงข้อมูล จาก component เเล้ว update
|
||||
* @param data person data
|
||||
*/
|
||||
function emitPerson(data: ArrayPerson[]) {
|
||||
const dataMapId = data.map((item: ArrayPerson) => item.personId);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintApprove(id.value),{
|
||||
persons:dataMapId
|
||||
.put(config.API.complaintApprove(id.value), {
|
||||
persons: dataMapId,
|
||||
})
|
||||
.then((res) => {
|
||||
router.push(`/discipline/complaints`);
|
||||
|
|
@ -282,24 +266,9 @@ function emitPerson(data:ArrayPerson[]){
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
// function sentApprove() {
|
||||
// // showLoader();
|
||||
// // http
|
||||
// // .put(config.API.complaintApprove(id.value))
|
||||
// // .then((res) => {
|
||||
// // router.push(`/discipline/complaints`);
|
||||
// // })
|
||||
// // .catch((e) => {
|
||||
// // messageError($q, e);
|
||||
// // })
|
||||
// // .finally(() => {
|
||||
// // hideLoader();
|
||||
// // });
|
||||
// console.log("sent");
|
||||
// }
|
||||
|
||||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
onMounted(() => {
|
||||
console.log(data);
|
||||
// fetchData();
|
||||
getData();
|
||||
});
|
||||
|
|
@ -341,11 +310,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"
|
||||
@return-person="emitPerson"
|
||||
/>
|
||||
<Popup :modal="modalPopup" :close="closePopup" @return-person="emitPerson"/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -228,42 +228,6 @@ const visibleColumns = ref<string[]>([
|
|||
"organization",
|
||||
]);
|
||||
|
||||
/**
|
||||
* รับค่าผู้ถูกร้องเรียน
|
||||
* @param val บุคคล หน่วยงาน กทม
|
||||
*/
|
||||
async function selectComplainant(val: string) {
|
||||
formData.organizationId = "";
|
||||
formData.consideredAgency = "";
|
||||
if (val === "0") {
|
||||
await fetchListname(); // ถ้าเลือกบุกคลจะเรียก function fetchListname เรียกรายชื่อจากทะเบียน
|
||||
} else if (val === "1") {
|
||||
await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
}
|
||||
}
|
||||
|
||||
/** เรียกรายชื่อ */
|
||||
async function fetchListname() {
|
||||
const listName = [
|
||||
{
|
||||
id: "1",
|
||||
name: "นายเอ",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
name: "นายบี",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
name: "นายชี",
|
||||
},
|
||||
];
|
||||
selectComplainantTpye(listName);
|
||||
}
|
||||
|
||||
/** เรียกโครงสร้างสำนักงาน */
|
||||
async function fetchOffice() {}
|
||||
|
||||
/**
|
||||
* ฟังชั่นอัปโหลดไฟล์
|
||||
* @param documentFile ไฟล์ที่รับมา
|
||||
|
|
@ -379,6 +343,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;
|
||||
|
|
@ -467,7 +432,6 @@ onMounted(() => {
|
|||
:options="complainstStore.complainantoptions"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="selectComplainant(formData.respondentType)"
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'filterrespondentType'
|
||||
)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue