จัดโค้ดวินัย

This commit is contained in:
setthawutttty 2023-12-25 16:31:24 +07:00
parent 71d3b54ef0
commit 7262000680
37 changed files with 492 additions and 697 deletions

View file

@ -30,6 +30,7 @@ const router = useRouter();
const id = ref<string>(route.params.id as string);
const modalPerson = ref<boolean>(false);
const toggleModal = () => (modalPerson.value = !modalPerson.value);
/**เรียกใช้ store */
const investigateFactStore = useInvestigateFactStore();
const mainStore = useDisciplineMainStore();
@ -47,13 +48,21 @@ const {
} = mixin;
const investigateDis = useInvestigateDisStore();
// const complaintsOptions = ref<any>([]);
const modal = ref<boolean>(false);
const filterKeyword2 = ref<string>("");
const type = ref<string>("");
const modalEditDirector = ref<boolean>(false);
const editDirectorId = ref<string>();
const dutyVal = ref<string>();
const filter = ref<string>("");
const isUpdate = ref<boolean>(false);
const filterTable = ref<string>("");
const filterKeyword = ref<string>("");
const maxPage = ref<number>(1);
const page = ref<number>(1);
const rowsPerPage = ref<number>(10);
/** ตัวแปร ref สำหรับแสดง validate */
const complaintRef = ref<Object | null>(null);
const complaintdetailRef = ref<Object | null>(null);
@ -90,8 +99,6 @@ const props = defineProps({
},
});
const filter = ref<string>("");
/** ข้อมูล v-model ของฟอร์ม */
const formData = reactive<FormData>({
id: "",
@ -168,7 +175,6 @@ function validateForm() {
onSubmit();
} else {
console.log("ไม่ผ่าน ");
// console.log(hasError);
}
}
@ -226,9 +232,6 @@ function resetExtend() {
formData.investigationDaysExtend = 0;
}
const modal = ref<boolean>(false);
const filterKeyword2 = ref<string>("");
const type = ref<string>("");
/** เปิด dialog */
function onClickOpenPopup() {
modal.value = true;
@ -305,7 +308,6 @@ function uploadFileRelevant() {
http
.put(config.API.investigateRelevantUploadFile(formData.id), Data)
.then((res) => {
console.log(res);
success($q, "อัปโหลดไฟล์สำเร็จ");
props.getData();
// router.push(`/discipline/complaints`);
@ -319,6 +321,7 @@ function uploadFileRelevant() {
});
}
/** อัปโหลดไฟล์ */
function uploadFile() {
const Data = new FormData();
Data.append("file", formData.documentFile);
@ -326,7 +329,6 @@ function uploadFile() {
http
.put(config.API.investigateUploadFile(formData.id), Data)
.then((res) => {
console.log(res);
success($q, "อัปโหลดไฟล์สำเร็จ");
props.getData();
// router.push(`/discipline/complaints`);
@ -553,9 +555,6 @@ function emitPerson(data: FormData[]) {
});
}
const modalEditDirector = ref<boolean>(false);
const editDirectorId = ref<string>();
const dutyVal = ref<string>();
function openEditDirector(id: string, duty: string) {
editDirectorId.value = id;
modalEditDirector.value = true;
@ -566,7 +565,7 @@ function closeEditDirector() {
modalEditDirector.value = false;
}
const saveDuty = async (id: string, duty: string) => {
async function saveDuty(id: string, duty: string){
showLoader();
await http
.put(config.API.investigateEditDuty(formData.id, id), { duty: duty })