Merge branch 'develop' into dev

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-04-21 14:14:59 +07:00
commit 34cf21da65
3 changed files with 37 additions and 22 deletions

View file

@ -354,6 +354,11 @@ function onClose() {
<div class="col-12">
<div class="row col-12 q-col-gutter-sm">
<div class="col-12">
<div class="text-caption text-grey-8">
แลระบบจะตดตอกลบผานทางอเมลทานระบ กรณาตรวจสอบอเมลของทานเปนระยะ
</div>
</div>
<div class="col-xs-12 col-md-6 col-lg-6">
<q-input
dense
@ -363,10 +368,11 @@ function onClose() {
class="inputgreen"
hide-bottom-space
:rules="[
() =>
!!formData.email ||
!!formData.phone ||
'กรุณากรอกอีเมลหรือเบอร์โทรติดต่อกลับ',
(val: string) => !!val || 'กรุณากรอกที่อยู่อีเมล',
(val: string) => {
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return emailPattern.test(val) || 'กรุณากรอกที่อยู่อีเมลในรูปแบบที่ถูกต้อง';
}
]"
/>
</div>
@ -378,12 +384,6 @@ function onClose() {
v-model="formData.phone"
class="inputgreen"
hide-bottom-space
:rules="[
() =>
!!formData.email ||
!!formData.phone ||
'กรุณากรอกอีเมลหรือเบอร์โทรติดต่อกลับ',
]"
/>
</div>
</div>

View file

@ -706,6 +706,7 @@ function classInput(val: boolean) {
hide-bottom-space
autocomplete="on"
name="organization"
:label="`${'หน่วยงาน'}`"
/>
</div>

View file

@ -370,18 +370,32 @@ async function uploadFile(event: any, date: any) {
*/
async function downloadAttachment(type: string, id: string) {
showLoader();
await http
.get(config.API.reportRetireList(type, id))
.then(async (res) => {
const data = res.data.result;
await genReport(data, `รายชื่อผู้เกษียณอายุราชการ`, type);
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
});
try {
const response = await http.get(
config.API.retirementReport + `/${type}/${id}`,
{
headers: {
accept:
type === "pdf"
? "application/pdf"
: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"content-Type": "application/json",
},
responseType: "blob",
}
);
const blob = response.data;
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = `รายชื่อผู้เกษียณอายุราชการ.${type}`;
link.click();
URL.revokeObjectURL(url);
} catch (e) {
messageError($q, e);
} finally {
hideLoader();
}
}
//