2024-03-07 12:15:38 +07:00
|
|
|
<script setup lang="ts">
|
2024-03-19 16:45:49 +07:00
|
|
|
import { ref, onMounted } from "vue";
|
2024-03-08 13:31:27 +07:00
|
|
|
import { useQuasar } from "quasar";
|
|
|
|
|
|
|
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
|
|
|
|
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; //หมายเหตุ
|
|
|
|
|
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
2024-03-19 14:42:50 +07:00
|
|
|
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
|
2024-03-08 13:31:27 +07:00
|
|
|
|
|
|
|
|
const $q = useQuasar(); //ใช้ noti quasar
|
|
|
|
|
const mixin = useCounterMixin();
|
2024-03-19 14:42:50 +07:00
|
|
|
const store = useSalaryEmployeeListSDataStore();
|
2024-03-08 13:31:27 +07:00
|
|
|
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
|
|
|
|
|
2024-03-19 13:30:19 +07:00
|
|
|
const props = defineProps({
|
|
|
|
|
rootId: String,
|
|
|
|
|
periodId: String,
|
|
|
|
|
getData: Function,
|
|
|
|
|
});
|
|
|
|
|
|
2024-03-08 18:01:23 +07:00
|
|
|
const sendStep = ref<number>(1);
|
2024-03-19 15:59:10 +07:00
|
|
|
const fileUpload = ref<any[]>([]);
|
2024-03-08 13:31:27 +07:00
|
|
|
const document = ref<string>("");
|
2024-03-19 13:30:19 +07:00
|
|
|
const type = ref<string>("");
|
2024-03-08 13:31:27 +07:00
|
|
|
/**
|
|
|
|
|
* function อัปโหลดไฟล์เจ้าหน้าที่
|
|
|
|
|
* @param event file
|
|
|
|
|
*/
|
|
|
|
|
async function uploadFile(event: any) {
|
2024-03-19 15:59:10 +07:00
|
|
|
console.log(event);
|
|
|
|
|
const fileName = event.map((e: any) => ({ fileName: e.name }));
|
|
|
|
|
|
2024-03-08 13:31:27 +07:00
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
async () => {
|
|
|
|
|
const selectedFile = event;
|
|
|
|
|
const formdata = new FormData();
|
|
|
|
|
formdata.append("Document", selectedFile);
|
2024-03-19 15:59:10 +07:00
|
|
|
http
|
|
|
|
|
.post(
|
2024-03-19 16:45:49 +07:00
|
|
|
config.API.subFile(
|
2024-03-19 15:59:10 +07:00
|
|
|
"ระบบเงินเดือน",
|
|
|
|
|
"เลื่อนค่าจ้าง",
|
|
|
|
|
props.periodId ? props.periodId : "",
|
|
|
|
|
props.rootId ? props.rootId : ""
|
|
|
|
|
),
|
|
|
|
|
{
|
|
|
|
|
replace: false, //อัพทับที่เดิมไหม
|
|
|
|
|
fileList: fileName,
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.then(async () => {
|
|
|
|
|
// await fecthInsigniaByOc(
|
|
|
|
|
// round.value,
|
|
|
|
|
// DataStore.agency,
|
|
|
|
|
// "officer",
|
|
|
|
|
// tab.value
|
|
|
|
|
// );
|
|
|
|
|
// success($q, "อัปโหลดไฟล์สำเร็จ");
|
|
|
|
|
// fileUpload.value = null;
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
2024-03-08 13:31:27 +07:00
|
|
|
},
|
|
|
|
|
"ยืนยันการอัปโหลดไฟล์",
|
|
|
|
|
"ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-19 13:30:19 +07:00
|
|
|
function saveReccommend(reason: string) {
|
2024-03-08 18:01:23 +07:00
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
async () => {
|
2024-03-19 13:30:19 +07:00
|
|
|
showLoader();
|
|
|
|
|
http
|
|
|
|
|
.put(
|
|
|
|
|
config.API.salaryPeriodStatusCommentEmp(
|
|
|
|
|
type.value,
|
|
|
|
|
props.periodId ? props.periodId : "",
|
|
|
|
|
props.rootId ? props.rootId : ""
|
|
|
|
|
),
|
|
|
|
|
{
|
|
|
|
|
titleRecommend: reason,
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
props.getData?.();
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
2024-03-08 18:01:23 +07:00
|
|
|
sendStep.value = sendStep.value + 1;
|
|
|
|
|
modalRecommend.value = false;
|
|
|
|
|
},
|
|
|
|
|
"ยืนยันการ" + titleRecommend.value,
|
|
|
|
|
"ต้องการยืนยันการ" + titleRecommend.value + "หรือไม่?"
|
|
|
|
|
);
|
2024-03-08 17:49:08 +07:00
|
|
|
}
|
|
|
|
|
|
2024-03-19 13:30:19 +07:00
|
|
|
function sendToDirector(msg: string, type: string) {
|
2024-03-08 18:01:23 +07:00
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
async () => {
|
2024-03-19 13:30:19 +07:00
|
|
|
showLoader();
|
|
|
|
|
http
|
|
|
|
|
.get(
|
|
|
|
|
config.API.salaryPeriodStatusEmp(
|
|
|
|
|
type,
|
|
|
|
|
props.periodId ? props.periodId : "",
|
|
|
|
|
props.rootId ? props.rootId : ""
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
props.getData?.();
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
2024-03-08 18:01:23 +07:00
|
|
|
sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1;
|
|
|
|
|
},
|
|
|
|
|
"ยืนยันการ" + msg,
|
|
|
|
|
"ต้องการยืนยันการ" + msg + "หรือไม่?"
|
|
|
|
|
);
|
|
|
|
|
}
|
2024-03-08 17:49:08 +07:00
|
|
|
|
|
|
|
|
const modalRecommend = ref<boolean>(false);
|
|
|
|
|
const titleRecommend = ref<string>("");
|
2024-03-19 13:30:19 +07:00
|
|
|
function sendAndRecommend(title: string, typeOrder: string) {
|
2024-03-08 17:49:08 +07:00
|
|
|
modalRecommend.value = true;
|
|
|
|
|
titleRecommend.value = title;
|
2024-03-19 13:30:19 +07:00
|
|
|
type.value = typeOrder;
|
2024-03-08 17:49:08 +07:00
|
|
|
}
|
2024-03-19 16:45:49 +07:00
|
|
|
|
|
|
|
|
function fetchListFile() {
|
|
|
|
|
http
|
|
|
|
|
.get(
|
|
|
|
|
config.API.subFile(
|
|
|
|
|
"ระบบเงินเดือน",
|
|
|
|
|
"เลื่อนค่าจ้าง",
|
|
|
|
|
props.periodId ? props.periodId : "",
|
|
|
|
|
props.rootId ? props.rootId : ""
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
.then(async () => {})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
fetchListFile();
|
|
|
|
|
});
|
2024-03-07 12:15:38 +07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2024-03-08 13:31:27 +07:00
|
|
|
<div class="row col-12 q-pa-md">
|
2024-03-19 16:45:49 +07:00
|
|
|
<q-toolbar style="padding: 0px">
|
2024-03-08 17:49:08 +07:00
|
|
|
<q-file
|
|
|
|
|
v-if="sendStep == 1"
|
|
|
|
|
bg-color="white"
|
|
|
|
|
clearable
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
v-model="fileUpload"
|
|
|
|
|
label="อัปโหลดไฟล์"
|
2024-03-19 15:59:10 +07:00
|
|
|
multiple
|
2024-03-08 17:49:08 +07:00
|
|
|
>
|
|
|
|
|
<template v-slot:prepend>
|
|
|
|
|
<q-icon color="light-blue" name="attach_file" />
|
|
|
|
|
<q-tooltip>อัปโหลดไฟล์</q-tooltip>
|
|
|
|
|
</template>
|
|
|
|
|
</q-file>
|
2024-03-08 13:31:27 +07:00
|
|
|
|
2024-03-08 17:49:08 +07:00
|
|
|
<q-btn
|
|
|
|
|
flat
|
|
|
|
|
color="light-blue"
|
|
|
|
|
icon="upload"
|
|
|
|
|
@click="uploadFile(fileUpload)"
|
|
|
|
|
v-if="fileUpload !== null"
|
|
|
|
|
/>
|
|
|
|
|
<div v-if="document">
|
2024-03-08 13:31:27 +07:00
|
|
|
<q-btn
|
2024-03-08 17:49:08 +07:00
|
|
|
dense
|
|
|
|
|
color="primary"
|
|
|
|
|
icon-right="mdi-download"
|
|
|
|
|
label="ดาวน์โหลดไฟล์"
|
|
|
|
|
outline
|
|
|
|
|
:href="document"
|
|
|
|
|
target="_blank"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>ดาวน์โหลด</q-tooltip></q-btn
|
|
|
|
|
>
|
2024-03-08 13:31:27 +07:00
|
|
|
</div>
|
2024-03-08 17:49:08 +07:00
|
|
|
|
2024-03-19 16:45:49 +07:00
|
|
|
<q-space />
|
2024-03-08 13:31:27 +07:00
|
|
|
<div>
|
|
|
|
|
<!-- การเจ้าหน้าที่ของหน่วยงานส่งเอกสารให้ ผอ. หน่วยงานตรวจสอบ -->
|
|
|
|
|
<q-btn
|
2024-03-19 14:42:50 +07:00
|
|
|
v-if="store.statusQuota == 'PENDING'"
|
2024-03-08 13:31:27 +07:00
|
|
|
unelevated
|
|
|
|
|
color="public"
|
|
|
|
|
label="ส่งเอกสารให้ ผอ. ตรวจสอบ"
|
2024-03-19 13:30:19 +07:00
|
|
|
@click="sendToDirector('ส่งเอกสารให้ ผอ. ตรวจสอบ', 'officer')"
|
2024-03-08 13:31:27 +07:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- ผอ. หน่วยงานทำการยืนยันและส่งให้ สกจ. -->
|
|
|
|
|
<q-btn
|
2024-03-19 14:42:50 +07:00
|
|
|
v-if="store.statusQuota == 'WAITHEAD1'"
|
2024-03-08 13:31:27 +07:00
|
|
|
unelevated
|
|
|
|
|
color="public"
|
|
|
|
|
label="ยืนยันและส่งเอกสารให้ สกจ."
|
2024-03-19 13:30:19 +07:00
|
|
|
@click="sendToDirector('ยืนยันและส่งเอกสารให้ สกจ.', 'head')"
|
2024-03-08 13:31:27 +07:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- สกจ. ตรวจสอบเอกสารและข้อมูลรายการเงินเดือนที่แต่ละหน่วยงานส่งมา ไม่มีปรับโควต้า -->
|
|
|
|
|
<q-btn
|
2024-03-19 14:42:50 +07:00
|
|
|
v-if="store.statusQuota == 'WAITOWNER1'"
|
2024-03-08 13:31:27 +07:00
|
|
|
unelevated
|
2024-03-08 18:01:23 +07:00
|
|
|
color="green"
|
2024-03-08 13:31:27 +07:00
|
|
|
label="ยืนยันการตรวจสอบ"
|
2024-03-19 13:30:19 +07:00
|
|
|
@click="sendToDirector('ยืนยันการตรวจสอบ', 'owner')"
|
2024-03-08 13:31:27 +07:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- สกจ. ตรวจสอบเอกสารและข้อมูลรายการเงินเดือนที่แต่ละหน่วยงานส่งมา มีปรับโควต้า -->
|
|
|
|
|
<q-btn
|
2024-03-19 14:42:50 +07:00
|
|
|
v-if="store.statusQuota == 'WAITOWNER1'"
|
2024-03-08 18:01:23 +07:00
|
|
|
class="q-ml-sm"
|
2024-03-08 13:31:27 +07:00
|
|
|
unelevated
|
2024-03-08 18:01:23 +07:00
|
|
|
color="warning"
|
2024-03-08 13:31:27 +07:00
|
|
|
label="ส่งคำแนะนำให้ ผอ. ตรวจสอบ"
|
2024-03-19 13:30:19 +07:00
|
|
|
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ', 'owner')"
|
2024-03-08 13:31:27 +07:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<!-- ผอ.หน่วยงานส่งคำแนะนำให้การเจ้าหน้าที่หน่วยงาน -->
|
|
|
|
|
<q-btn
|
2024-03-19 14:42:50 +07:00
|
|
|
v-if="store.statusQuota == 'WAITHEAD2'"
|
2024-03-08 13:31:27 +07:00
|
|
|
unelevated
|
|
|
|
|
color="public"
|
|
|
|
|
label="ส่งคำแนะนำให้การเจ้าหน้าที่หน่วยงาน"
|
2024-03-19 14:42:50 +07:00
|
|
|
@click="
|
|
|
|
|
sendAndRecommend('ส่งคำแนะนำให้การเจ้าหน้าที่หน่วยงาน', 'head')
|
|
|
|
|
"
|
2024-03-08 13:31:27 +07:00
|
|
|
/>
|
2024-03-08 18:01:23 +07:00
|
|
|
|
|
|
|
|
<q-btn
|
2024-03-19 14:42:50 +07:00
|
|
|
v-if="store.statusQuota == 'WAITOFFICER2'"
|
2024-03-08 18:01:23 +07:00
|
|
|
unelevated
|
|
|
|
|
color="public"
|
|
|
|
|
label="ส่งไปออกคำสั่ง"
|
|
|
|
|
/>
|
2024-03-19 14:42:50 +07:00
|
|
|
<q-btn
|
|
|
|
|
v-if="store.statusQuota == 'REPORT'"
|
|
|
|
|
unelevated
|
|
|
|
|
color="public"
|
|
|
|
|
disable
|
|
|
|
|
label="รอออกคำสั่ง"
|
|
|
|
|
/>
|
2024-03-08 13:31:27 +07:00
|
|
|
</div>
|
|
|
|
|
</q-toolbar>
|
2024-03-19 16:45:49 +07:00
|
|
|
<div class="col-6">
|
|
|
|
|
<q-list bordered>
|
|
|
|
|
<q-item clickable v-ripple>
|
|
|
|
|
<q-item-section>Icon as avatar</q-item-section>
|
|
|
|
|
<q-item-section avatar>
|
|
|
|
|
<q-icon color="primary" name="bluetooth" />
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
2024-03-08 17:49:08 +07:00
|
|
|
|
2024-03-19 16:45:49 +07:00
|
|
|
<q-item clickable v-ripple>
|
|
|
|
|
<q-item-section>Avatar-type icon</q-item-section>
|
|
|
|
|
<q-item-section avatar>
|
|
|
|
|
<q-avatar color="teal" text-color="white" icon="bluetooth" />
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
|
|
|
|
|
<q-item clickable v-ripple>
|
|
|
|
|
<q-item-section>Rounded avatar-type icon</q-item-section>
|
|
|
|
|
<q-item-section avatar>
|
|
|
|
|
<q-avatar
|
|
|
|
|
rounded
|
|
|
|
|
color="purple"
|
|
|
|
|
text-color="white"
|
|
|
|
|
icon="bluetooth"
|
|
|
|
|
/>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
|
|
|
|
|
<q-item clickable v-ripple>
|
|
|
|
|
<q-item-section>Letter avatar-type</q-item-section>
|
|
|
|
|
<q-item-section avatar>
|
|
|
|
|
<q-avatar color="primary" text-color="white"> R </q-avatar>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</q-list>
|
|
|
|
|
</div>
|
2024-03-08 13:31:27 +07:00
|
|
|
</div>
|
2024-03-19 16:45:49 +07:00
|
|
|
|
|
|
|
|
<DialogPopupReason
|
|
|
|
|
v-model:modal="modalRecommend"
|
|
|
|
|
:title="titleRecommend"
|
|
|
|
|
label="คำแนะนำ"
|
|
|
|
|
:savaForm="saveReccommend"
|
|
|
|
|
textReport=""
|
|
|
|
|
/>
|
2024-03-07 12:15:38 +07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|