เงินเดือน ==> เลื่อน ปรับ ui
This commit is contained in:
parent
be2a9a8ca6
commit
f6b1580cf1
6 changed files with 712 additions and 678 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue