diff --git a/src/modules/15_development/components/Record.vue b/src/modules/15_development/components/Record.vue index 154d98498..32392f40e 100644 --- a/src/modules/15_development/components/Record.vue +++ b/src/modules/15_development/components/Record.vue @@ -7,6 +7,7 @@ import config from "@/app.config"; import axios from "axios"; import type { QTableProps } from "quasar"; import { useQuasar } from "quasar"; +import type { ResRecord } from "@/modules/15_development/interface/response/Main"; const mixin = useCounterMixin(); const route = useRoute(); const $q = useQuasar(); @@ -17,7 +18,6 @@ const { showLoader, hideLoader, dialogConfirm, - dialogRemove, date2Thai, } = mixin; const columns = ref([ @@ -170,7 +170,6 @@ const columns = ref([ }, ]); -const fileList = ref([]); const visibleColumns = ref([ "type", "idcard", @@ -192,35 +191,7 @@ const pagination = ref({ rowsPerPage: 10, }); const keyword = ref(""); -const row = [ - { - idcard: "1234567890121", - prefix: "นาง", - firstName: "ณัฐนิชา", - lastName: "เป็งกำปอง", - position: "นักวิชาการสถิติ", - posTypeName: "วิชาการ", - posLevelName: "ชำนาญการ", - posExecutive: "นักบริหาร", - org: "สาขาสถิติ", - refCommandNo: "25/2566", - refCommandDate: new Date(), - }, - { - idcard: "2222222222222", - prefix: "นาย", - firstName: "สมศักดิ์", - lastName: "กำแหง", - position: "นักการไฟฟ้า", - posTypeName: "วิชาการ", - posLevelName: "สูง", - posExecutive: "นักการช่าง", - org: "อิเล็กทรอนิกส์", - refCommandNo: "12/2565", - refCommandDate: new Date(), - }, -]; -const rows = ref([]); +const rows = ref([]); async function clickUpload(file: any) { dialogConfirm( @@ -257,36 +228,6 @@ function formBmaofficer(val: string) { } } -// async function clickUpload(file: any) { -// const fileName = { fileName: file.name }; -// dialogConfirm( -// $q, -// async () => { -// const selectedFile = file; -// const formdata = new FormData(); -// formdata.append("file", selectedFile); -// await http -// .post(config.API.developmentMainTab("tab6", id.value)), { -// replace: false, -// fileList: fileName, -// }) -// .then(async (res:any) => { -// const foundKey: string | undefined = Object.keys(res.data).find( -// (key) => -// res.data[key]?.fileName !== undefined && -// res.data[key]?.fileName !== "" -// ); -// foundKey && uploadFileDoc(res.data[foundKey]?.uploadUrl, files.value); -// }) -// .catch((err) => { -// messageError($q, err); -// }); -// }, -// "ยืนยันการอัปโหลดไฟล์", -// "ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?" -// ); -// } - async function getData() { showLoader(); await http @@ -302,29 +243,6 @@ async function getData() { }); } -async function uploadFileDoc(uploadUrl: string, file: any) { - const Data = new FormData(); - Data.append("file", files.value); - showLoader(); - await axios - .put(uploadUrl, file, { - headers: { - "Content-Type": file.type, - }, - }) - .then((res) => { - success($q, "อัปโหลดไฟล์สำเร็จ"); - getData(); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - files.value = null; - }); -} - function sendRecordRegistry() { // ส่งไปบันทึกที่ทะเบียนประวัติ dialogConfirm( @@ -382,7 +300,7 @@ onMounted(() => { อัปโหลดไฟล์