Bug ทะเบียนประวัติ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-04-23 14:18:10 +07:00
parent 10d2614c76
commit b6ab59e5ee
5 changed files with 46 additions and 20 deletions

View file

@ -240,20 +240,17 @@ async function uploadfile(subId: string) {
//
await uploadFile(uploadUrl, fileUpload.value);
await updateIsUpload();
await updateIsUpload(subId);
} catch (err) {
messageError($q, err);
}
}
/** ฟังก์ชันอัพเดทสถานะอัพโหลด*/
async function updateIsUpload() {
async function updateIsUpload(subId: string) {
await http
.patch(
config.API.profileNewCertificateByCertificateId(
editId.value,
empType.value
),
config.API.profileNewCertificateByCertificateId(subId, empType.value),
{
isUpload: fileUpload.value ? true : false,
}

View file

@ -400,21 +400,18 @@ async function uploadfile(id: string) {
//
await uploadFile(uploadUrl, fileUpload.value);
await updateIsUpload();
await updateIsUpload(id);
} catch (err) {
messageError($q, err);
}
}
/** ฟังก์ชันอัพเดทสถานะอัพโหลด*/
async function updateIsUpload() {
async function updateIsUpload(id: string) {
await http
.patch(
config.API.profileNewDisciplineByDisciplineId(id.value, empType.value),
{
isUpload: fileUpload.value ? true : false,
}
)
.patch(config.API.profileNewDisciplineByDisciplineId(id, empType.value), {
isUpload: fileUpload.value ? true : false,
})
.then(() => {
fileUpload.value = null;
});

View file

@ -618,7 +618,7 @@ onMounted(async () => {
<q-btn
v-if="scope.queuedFiles.length > 0"
icon="clear_all"
@click="scope.removeQueuedFiles"
@click="scope.removeQueuedFiles, (fileUpload = undefined)"
round
dense
flat
@ -628,7 +628,7 @@ onMounted(async () => {
<q-btn
v-if="scope.uploadedFiles.length > 0"
icon="done_all"
@click="scope.removeUploadedFiles"
@click="scope.removeUploadedFiles, (fileUpload = undefined)"
round
dense
flat
@ -663,7 +663,7 @@ onMounted(async () => {
<q-btn
v-if="scope.isUploading"
icon="clear"
@click="scope.abort"
@click="scope.abort, (fileUpload = undefined)"
round
dense
flat
@ -672,6 +672,36 @@ onMounted(async () => {
</q-btn>
</div>
</template>
<template v-slot:list="scope">
<q-list separator>
<q-item v-for="file in scope.files" :key="file.__key">
<q-item-section>
<q-item-label class="full-width ellipsis">
{{ file.name }}
</q-item-label>
<q-item-label caption>
{{ file.__sizeLabel }} / {{ file.__progressLabel }}
</q-item-label>
</q-item-section>
<q-item-section top side>
<q-btn
class="gt-xs"
size="12px"
flat
dense
round
icon="delete"
@click="
scope.removeFile(file), (fileUpload = undefined)
"
/>
</q-item-section>
</q-item>
</q-list>
</template>
</q-uploader>
<div
v-if="alertUpload && dialogStatus === 'create'"

View file

@ -679,6 +679,7 @@ function onSubmit() {
...formData,
commandDateAffect: convertDateToAPI(formData.commandDateAffect),
commandDateSign: convertDateToAPI(formData.commandDateSign),
commandName: store.convertCommandCodeName(formData.commandCode),
amount: Number(String(formData.amount)?.replace(/,/g, "")),
amountSpecial: Number(
String(formData.amountSpecial)?.replace(/,/g, "")
@ -690,6 +691,7 @@ function onSubmit() {
String(formData.mouthSalaryAmount)?.replace(/,/g, "")
),
});
await fetchListSalary();
onClickCloseDialog();
success($q, "บันทึกข้อมูลสำเร็จ");

View file

@ -233,16 +233,16 @@ async function uploadfile(id: string) {
//
await uploadFile(uploadUrl, fileUpload.value);
await updateIsUpload();
await updateIsUpload(id);
} catch (err) {
messageError($q, err);
}
}
/** ฟังก์ชันอัพเดทสถานะอัพโหลด*/
async function updateIsUpload() {
async function updateIsUpload(id: string) {
await http
.patch(config.API.profileNewNoPaidById(id.value, empType.value), {
.patch(config.API.profileNewNoPaidById(id, empType.value), {
isUpload: fileUpload.value ? true : false,
})
.then(() => {