เงินเดือน ==> เลื่อน ปรับ ui

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-28 11:33:36 +07:00
parent be2a9a8ca6
commit f6b1580cf1
6 changed files with 712 additions and 678 deletions

View file

@ -111,7 +111,9 @@ function uploadfile(uploadUrl: string, file: any) {
});
}
/** function fetchList ไฟล์*/
/**
* fetchList ไฟล
*/
function getListFile() {
http
.get(
@ -130,69 +132,8 @@ function getListFile() {
});
}
function saveReccommend(reason: string) {
dialogConfirm(
$q,
async () => {
showLoader();
http
.put(
config.API.salaryPeriodStatusComment(
type.value,
props.periodId ? props.periodId : "",
props.rootId ? props.rootId : ""
),
{
titleRecommend: reason,
}
)
.then(async () => {
await props.getData?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
},
"ยืนยันการ" + titleRecommend.value,
"ต้องการยืนยันการ" + titleRecommend.value + "หรือไม่?"
);
}
function sendToDirector(msg: string, type: string) {
dialogConfirm(
$q,
async () => {
showLoader();
http
.get(
config.API.salaryPeriodStatus(
type,
props.periodId ? props.periodId : "",
props.rootId ? props.rootId : ""
)
)
.then(() => {
props.getData?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการ" + msg,
"ต้องการยืนยันการ" + msg + "หรือไม่?"
);
}
/**
* function โหลดไฟล
* โหลดไฟล
* @param fileName อไฟล
*/
function downloadFile(fileName: string) {
@ -220,7 +161,7 @@ function downloadFile(fileName: string) {
}
/**
* function ลบไฟล
* ลบไฟล
* @param fileName อไฟล
*/
function deleteFile(fileName: string) {
@ -250,12 +191,87 @@ function deleteFile(fileName: string) {
});
}
/**
* นยนการส
* @param msg งเอกสารให ผอ. ตรวจสอบ,นยนและสงเอกสารให,นยนการตรวจสอบ
* @param type officer, head,owner
*/
function sendToDirector(msg: string, type: string) {
dialogConfirm(
$q,
async () => {
showLoader();
http
.get(
config.API.salaryPeriodStatus(
type,
props.periodId ? props.periodId : "",
props.rootId ? props.rootId : ""
)
)
.then(() => {
props.getData?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการ" + msg,
"ต้องการยืนยันการ" + msg + "หรือไม่?"
);
}
/**
* งคำแนะนำให ผอ. ตรวจสอบ
* @param title วข
* @param typeOrder ประเภทคำส
*/
function sendAndRecommend(title: string, typeOrder: string) {
modalRecommend.value = true;
titleRecommend.value = title;
type.value = typeOrder;
}
/**
* นยนการบนทกคำแนะนำ
* @param reason คำแนะนำ
*/
function saveReccommend(reason: string) {
dialogConfirm(
$q,
async () => {
showLoader();
http
.put(
config.API.salaryPeriodStatusComment(
type.value,
props.periodId ? props.periodId : "",
props.rootId ? props.rootId : ""
),
{
titleRecommend: reason,
}
)
.then(async () => {
await props.getData?.();
sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
},
"ยืนยันการ" + titleRecommend.value,
"ต้องการยืนยันการ" + titleRecommend.value + "หรือไม่?"
);
}
onMounted(() => {
if (props.rootId) {
getListFile();
@ -264,51 +280,106 @@ onMounted(() => {
</script>
<template>
<div class="row col-12 q-pa-md">
<q-toolbar class="q-pa-none">
<q-file
<q-card class="col-12">
<q-card-section>
<q-toolbar
class="q-pa-none"
v-if="
store.statusQuota == 'PENDING' &&
checkPermission($route)?.attrIsUpdate
"
bg-color="white"
clearable
outlined
dense
v-model="fileUpload"
accept=".pdf"
label="อัปโหลดไฟล์"
>
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
<q-tooltip>ปโหลดไฟล</q-tooltip>
</template>
</q-file>
<q-file
bg-color="white"
clearable
outlined
dense
v-model="fileUpload"
accept=".pdf"
label="อัปโหลดไฟล์"
>
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
<q-tooltip>ปโหลดไฟล</q-tooltip>
</template>
</q-file>
<q-btn
flat
color="light-blue"
icon="upload"
@click="uploadFile(fileUpload)"
v-if="fileUpload !== null"
/>
<div v-if="document">
<q-btn
dense
color="primary"
icon-right="mdi-download"
label="ดาวน์โหลดไฟล์"
outline
:href="document"
target="_blank"
flat
round
color="light-blue"
icon="upload"
@click="uploadFile(fileUpload)"
v-if="fileUpload !== null"
>
<q-tooltip>ดาวนโหลด</q-tooltip></q-btn
>
</div>
<q-tooltip>ปโหลดไฟล</q-tooltip>
</q-btn>
<div v-if="document">
<q-btn
dense
color="primary"
icon-right="mdi-download"
label="ดาวน์โหลดไฟล์"
outline
:href="document"
target="_blank"
>
<q-tooltip>ดาวนโหลด</q-tooltip></q-btn
>
</div>
<q-toolbar-title>
<!-- Toolbar -->
</q-toolbar-title>
<q-toolbar-title>
<!-- Toolbar -->
</q-toolbar-title>
</q-toolbar>
<div class="row">
<div class="col-6" v-if="listFile.length !== 0">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
รายการเอกสาร
</div>
<q-list bordered separator>
<q-item clickable v-ripple v-for="item in listFile">
<q-item-section>{{ item.fileName }}</q-item-section>
<q-item-section avatar>
<div class="row">
<div>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
dense
flat
round
color="blue"
icon="mdi-download"
@click="downloadFile(item.fileName)"
>
<q-tooltip>ดาวนโหลดเอกสาร</q-tooltip>
</q-btn>
</div>
<div>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
dense
flat
round
color="red"
icon="delete"
@click="deleteFile(item.fileName)"
><q-tooltip>ลบเอกสาร</q-tooltip></q-btn
>
</div>
</div>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<div>
<!-- การเจาหนาทของหนวยงานสงเอกสารให ผอ. หนวยงานตรวจสอบ -->
<q-btn
@ -373,6 +444,7 @@ onMounted(() => {
"
/>
<!-- งไปออกคำส -->
<q-btn
v-if="
store.statusQuota == 'WAITOFFICER2' &&
@ -382,6 +454,8 @@ onMounted(() => {
color="public"
label="ส่งไปออกคำสั่ง"
/>
<!-- รอออกคำส -->
<q-btn
v-if="
store.statusQuota == 'REPORT' &&
@ -393,57 +467,16 @@ onMounted(() => {
label="รอออกคำสั่ง"
/>
</div>
</q-toolbar>
<div class="col-6" v-if="listFile.length !== 0">
<q-card bordered style="border: 1px solid #d6dee1">
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
รายการเอกสาร
</div>
<q-list bordered separator>
<q-item clickable v-ripple v-for="item in listFile">
<q-item-section>{{ item.fileName }}</q-item-section>
<q-item-section avatar>
<div class="row">
<div>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
dense
flat
round
color="blue"
icon="mdi-download"
@click="downloadFile(item.fileName)"
>
<q-tooltip>ดาวนโหลดเอกสาร</q-tooltip>
</q-btn>
</div>
<div>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
dense
flat
round
color="red"
icon="delete"
@click="deleteFile(item.fileName)"
><q-tooltip>ลบเอกสาร</q-tooltip></q-btn
>
</div>
</div>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</q-card-actions>
</q-card>
<DialogPopupReason
v-model:modal="modalRecommend"
:title="titleRecommend"
label="คำแนะนำ"
:savaForm="saveReccommend"
textReport=""
/>
</div>
<DialogPopupReason
v-model:modal="modalRecommend"
:title="titleRecommend"
label="คำแนะนำ"
:savaForm="saveReccommend"
textReport=""
/>
</template>
<style lang="scss" scoped></style>