Merge branch 'develop' into feat/operator

* develop:
  fix:genReport
  แก้ข้อความยืนยันการบรรจุแล้ว
  เปิดปุ่มแก้ไขเป้ามายตามแผน ของผู้เกี่ยวข้องส่วนของโครงการะบบพัฒนา
  fix
  add code show salary history
This commit is contained in:
Warunee Tamkoo 2026-02-09 17:25:34 +07:00
commit 7136ac966c
6 changed files with 26 additions and 24 deletions

View file

@ -5,7 +5,7 @@ import type { DataOption } from "@/modules/04_registryPerson/interface/index/Mai
export const useSalaryDataStore = defineStore("salatyDataStore", () => {
// commandCode ขอตำแหน่ง
const salaryCode = ref<number[]>([5, 6, 7]);
const salaryCode = ref<number[]>([5, 6, 7, 19]);
const commandCodeData = ref<DataOption[]>([]);
const posTypeData = ref<DataOption[]>([]); //รายการประเภทตำแหน่ง | กลุ่มงาน

View file

@ -22,7 +22,6 @@ import type {
DataOptionSys,
} from "@/modules/04_registryPerson/interface/index/Main";
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
import { s } from "@fullcalendar/core/internal-common";
/** importComponents*/
const CardNotPermission = defineAsyncComponent(

View file

@ -937,8 +937,8 @@ function onUpdateStatus(id: string) {
hideLoader();
}
},
"ยืนยันการส่งบรรจุ",
"ต้องการยืนยันการส่งบรรจุนี้ใช่หรือไม่ ?"
"ยืนยันการเปลี่ยนสถานะเป็นบรรจุแล้ว",
"ต้องการเปลี่ยนสถานะรายชื่อนี้เป็นบรรจุแล้วใช่หรือไม่ ?"
);
}

View file

@ -791,9 +791,7 @@ onMounted(() => {
<q-tr :props="props">
<q-td>
<q-btn
v-if="
store.projectStatus !== 'FINISH' && !checkRoutePermission
"
v-if="!checkRoutePermission"
round
flat
color="edit"
@ -894,8 +892,8 @@ onMounted(() => {
v-if="!checkRoutePermission"
round
flat
color="primary"
icon="mdi-pencil-outline"
color="edit"
icon="edit"
size="14px"
@click="
() => {
@ -971,8 +969,8 @@ onMounted(() => {
v-if="!checkRoutePermission"
round
flat
color="primary"
icon="mdi-pencil-outline"
color="edit"
icon="edit"
size="14px"
@click="
() => {

View file

@ -1,5 +1,3 @@
import type { D } from "@fullcalendar/core/internal-common";
interface Options {
label: string;
value: string;

View file

@ -29,25 +29,32 @@ async function genReport(
responseType: "arraybuffer",
})
.then((res) => {
const data = res.data;
if (data) {
// สร้าง Blob จาก array buffer
const blob = new Blob([data], {
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
});
const responseData = res.data;
if (responseData) {
// --- ส่วนที่ปรับปรุง 1: กำหนด MIME Type ให้ตรงกับไฟล์ที่รับมาจริง ---
const mimeType =
type === "docx"
? "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
: "application/pdf";
// สร้าง URL สำหรับไฟล์ Blob
const blob = new Blob([responseData], { type: mimeType });
const url = URL.createObjectURL(blob);
// สร้างลิงก์เพื่อดาวน์โหลดไฟล์
// --- ส่วนที่ปรับปรุง 2: จัดการชื่อไฟล์ (ป้องกันนามสกุลซ้อน) ---
const baseName = fileName.trim();
const extension = type === "docx" ? "docx" : "pdf";
const link = document.createElement("a");
link.href = url;
link.download = `${fileName}.${type === "docx" ? "docx" : "pdf"}`; // กำหนดชื่อไฟล์ที่จะดาวน์โหลด
link.download = `${baseName}.${extension}`;
document.body.appendChild(link);
link.click();
// ลบ URL ที่สร้างขึ้นหลังจากใช้งาน
URL.revokeObjectURL(url);
// หน่วงเวลาเล็กน้อยก่อนลบ element และ revoke URL เพื่อให้ Browser ทำงานเสร็จ
setTimeout(() => {
document.body.removeChild(link);
URL.revokeObjectURL(url);
}, 100);
}
})
.catch((err) => {