Merge branch 'develop' into devTee

# Conflicts:
#	src/api/12_evaluatePersonal/api.evaluate.ts
This commit is contained in:
setthawutttty 2023-12-22 18:21:51 +07:00
commit 5c7001a2b5
10 changed files with 150 additions and 102 deletions

View file

@ -231,7 +231,7 @@
</q-item-section>
<q-item-section>ใหออกจากราชการ</q-item-section>
</q-item>
<!-- <q-separator />
<q-separator />
<q-item
clickable
v-close-popup
@ -252,7 +252,7 @@
<q-item-section style="min-width: 0px" avatar class="q-py-sm">
</q-item-section>
<q-item-section>ไลออกจากราชการ</q-item-section>
</q-item> -->
</q-item>
<q-separator />
<q-item
clickable

View file

@ -303,7 +303,7 @@ async function fetchDatadetail() {
mainStore.rowsAdd = props.data.persons;
mainStore.rowsCheck = mainStore.rowsAdd.filter(
(item: any) => item.report === false && item.isSuspend === 'NEW' && item.isSend === 'NEW'
(item: any) => item.isSuspend === "NEW" && item.isSend === "NEW"
);
/** MAP รายชื่อกรรมการ หน้าหลัก */
const dataMap = props.data.director.map((item: any) => ({
@ -645,7 +645,11 @@ onMounted(async () => {
</div> -->
<div
class="col-xs-12 col-sm-4"
v-if="route.name === 'disciplineDisciplinaryEdit'"
v-if="
route.name === 'disciplineDisciplinaryEdit' &&
props.data &&
props.data.status === 'NEW'
"
>
<q-btn
class="q-pa-sm"

View file

@ -76,7 +76,7 @@ onMounted(async () => {
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการสรปผลการพจารณาทางว
รายการสรปผลการพจารณาความผทางว
</div>
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
<div>

View file

@ -30,10 +30,10 @@ async function onSubmit(data: any) {
formData.append("file", data.file);
showLoader();
http
.post(config.API.appealAdd(), formData)
.post(config.API.appealAdd() + "/admin", formData)
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
router.push(`/discipline-appealcomplain/${res.data.result}`)
router.push(`/discipline-appealcomplain/${res.data.result}`);
})
.catch((e) => {
messageError($q, e);

View file

@ -273,7 +273,7 @@ onMounted(async () => {
<template>
<div class="toptitle text-dark col-12 row items-center">
รายการอทธรณองทกข
รายการอทธรณ/องทกข
</div>
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
<div class="row q-mb-sm">

View file

@ -43,7 +43,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
case "SEND_DISCIPLINARY":
return "ส่งไปสอบสวน";
case "DONE":
return "ส่งไปสรุปผลการพิจารณาทางวินัย";
return "ส่งไปสรุปผลการพิจารณาความผิดทางวินัย";
}
}

View file

@ -1,7 +1,8 @@
<script setup lang="ts">
import { ref, reactive, watch } from "vue";
import { ref, reactive, watch, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import type {
FormData,
FormRef,
@ -9,7 +10,8 @@ import type {
} from "@/modules/12_evaluatePersonal/interface/index/meeting";
import http from "@/plugins/http";
import config from "@/app.config";
const route = useRoute();
const id = ref<string>(route.params.id as string);
const $q = useQuasar();
const mixin = useCounterMixin();
const {
@ -42,10 +44,11 @@ const emit = defineEmits(["formDataReturn"]);
*/
//
const idCard = ref<string>("");
const file = ref<any>();
const fileOj = reactive<FileOj[]>([]);
const formData = reactive<FormData>({
id: "",
rounded: "",
dateMeeting: "",
dateMeetingStart: null,
@ -53,7 +56,7 @@ const formData = reactive<FormData>({
consider: "",
period: "",
title: "",
file: fileOj,
// file: fileOj,
});
/**
@ -63,6 +66,7 @@ const formData = reactive<FormData>({
*/
watch(props.data, async () => {
// console.log("data==>", props.data)
formData.id = props.data.id;
formData.rounded = props.data.rounded;
formData.dateMeetingStart = props.data.dateMeetingStart;
formData.dateMeetingEnd = props.data.dateMeetingEnd;
@ -71,45 +75,6 @@ watch(props.data, async () => {
formData.title = props.data.title;
});
// /**
// *
// */
// function addEmployee() {
// if (idCard.value.length === 13) {
// console.log("idCard===>", idCard.value);
// showLoader();
// http
// .post(config.API.profileSearchPersonal(), {
// fieldName: "idcard",
// keyword: idCard.value,
// })
// .then((res) => {
// const dataApi = res.data.result;
// if (dataApi.length > 0) {
// const dataList = dataApi[0];
// formData.rounded = dataList.rounded;
// formData.dateMeeting = dataList.dateMeeting;
// formData.consider = dataList.consider;
// formData.period = dataList.period;
// } else {
// dialogMessageNotify($q, "");
// }
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// hideLoader();
// });
// }
// if (idCard.value.length !== 13) {
// hideLoader();
// dialogMessageNotify($q, " 13 ");
// } else {
// console.log("nodata");
// }
// }
/**
* ตรวจสอบขอมลกอนสงไปย api
*/
@ -146,29 +111,85 @@ function onValidate() {
}
}
function uploadFile() {
// const Data = new FormData();
// Data.append("file", formData.file);
// showLoader();
// http
// .put(config.API.appealUpLoadFile(formData.id), Data)
// .then((res) => {
// console.log(res);
// success($q, "");
// props.getData();
// // router.push(`/discipline/complaints`);
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// hideLoader();
// formData.file = null;
// });
}
const fileData = ref<any>([]);
/**
* งคาจาก api
*/
const fetchDataFile = async () => {
if (id.value != undefined) {
showLoader();
await http
.get(config.API.meetingFilebyId("การประชุม", id.value))
.then((res) => {
// const dataFile = res.data.result;
const dataFile = res.data;
fileData.value = dataFile;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
};
function downloadFile(link: string) {
window.open(link, "_blank");
/**
* function download
*/
const fileDataDownload = ref<any>([]);
const fetchDataFileDownload = async (pathName: string) => {
console.log(fileData.value[0].fileName);
if (id.value !== undefined) {
showLoader();
console.log(fileData.value[0].fileName);
await http
.get(config.API.meetingFileDowloadbyId("การประชุม", id.value, pathName))
.then((res) => {
const dataFile = res.data;
fileDataDownload.value = dataFile;
window.open(fileDataDownload.value.downloadUrl);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
};
/**
* addFiles
*/
function uploadFile() {
fetchDataFile();
if (file) {
const fileList = [
{
fileName: file.value.name,
metadata: {
tag: "value",
},
},
];
const requestBody = {
replace: false,
fileList: fileList,
};
showLoader();
http
.post(config.API.meetingFilebyId("การประชุม", id.value), requestBody)
.then((res) => {})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
file.value = null;
setTimeout(() => fetchDataFile(), 500);
});
}
}
function deleteFile(id: string) {
@ -179,19 +200,19 @@ function deleteFile(id: string) {
* นย ลบ ไฟล
* @param id id file
*/
function confirmDelete(id: string) {
// showLoader();
// http
// .delete(config.API.appealDeleteFile(formData.id, id))
// .then((res) => {
// success($q, ``);
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// props.getData();
// });
function confirmDelete(fileName: string) {
showLoader();
http
.delete(config.API.meetingFileDowloadbyId("การประชุม", id.value, fileName))
.then((res) => {
success($q, `ลบไฟล์สำเร็จ`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
setTimeout(() => fetchDataFile(), 1000);
});
}
//checkDate
@ -211,6 +232,12 @@ function inputEdit(val: boolean) {
"full-width cursor-pointer inputgreen": !val,
};
}
/**Hook */
onMounted(() => {
setTimeout(() => fetchDataFile(), 500);
// fetchDataFileDownload();
});
</script>
<template>
<form @submit.prevent.stop="onValidate">
@ -342,7 +369,7 @@ function inputEdit(val: boolean) {
:rules="[(val: string) => !!val || `${'กรุณากรอกระยะเวลาในการแก้ไขผลงาน'}`]"
/>
</div>
<div class="col-sm-12 col-md-12">
<div class="col-sm-12 col-md-12" v-if="id">
<q-card bordered class="row col-12" style="border: 1px solid #d6dee1">
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
ปโหลดไฟลเอกสารหลกฐาน
@ -354,7 +381,7 @@ function inputEdit(val: boolean) {
class="col-11"
outlined
dense
v-model="formData.file"
v-model="file"
@added="uploadFile"
label="ไฟล์เอกสารหลักฐาน"
hide-bottom-space
@ -369,22 +396,22 @@ function inputEdit(val: boolean) {
<div class="col-1 self-center text-center">
<q-btn
v-if="formData.file && isReadonly"
size="14px"
flat
round
dense
color="add"
icon="mdi-upload"
v-if="file"
@click="uploadFile"
><q-tooltip>ปโหลดไฟล</q-tooltip></q-btn
>
</div>
</div>
<div v-if="formData.file.length > 0" class="col-12 q-pa-sm row">
<div class="col-12 q-pa-sm row" v-if="fileData.length > 0">
<!-- v-if="file.length > 0" v-else -->
<q-list
v-for="data in formData.file"
v-for="data in fileData"
:key="data.id"
class="full-width"
bordered
@ -400,7 +427,7 @@ function inputEdit(val: boolean) {
dense
color="blue"
icon="mdi-download"
@click="downloadFile(data.pathName)"
@click="fetchDataFileDownload(data.fileName)"
><q-tooltip>ดาวนโหลดไฟล</q-tooltip></q-btn
>
<q-btn
@ -411,7 +438,7 @@ function inputEdit(val: boolean) {
color="red"
class="q-ml-sm"
icon="mdi-delete-outline"
@click="deleteFile(data.id)"
@click="deleteFile(data.fileName)"
><q-tooltip>ลบไฟล</q-tooltip></q-btn
>
</q-item>

View file

@ -13,7 +13,14 @@ interface MainList {
date: string;
}
interface ArrayFileList {
id: string;
pathName: string;
fileName: string;
}
interface FormData {
id: string;
rounded: string;
dateMeeting: string;
dateMeetingStart: Date | null;
@ -21,7 +28,7 @@ interface FormData {
consider: string;
period: string;
title: string;
file: FileOj[];
// file: FileOj[];
}
interface FileOj {
@ -38,4 +45,11 @@ interface FormRef {
period: object | null;
[key: string]: any;
}
export type { DataResponseList, MainList, FormData, FormRef, FileOj };
export type {
DataResponseList,
MainList,
FormData,
FormRef,
FileOj,
ArrayFileList,
};