รายการเลื่อนเงินเดือนลูกจ้างประจำ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-19 13:30:19 +07:00
parent ee6603eaae
commit 90960dd551
12 changed files with 138 additions and 121 deletions

View file

@ -12,9 +12,16 @@ const $q = useQuasar(); //ใช้ noti quasar
const mixin = useCounterMixin();
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
const props = defineProps({
rootId: String,
periodId: String,
getData: Function,
});
const sendStep = ref<number>(1);
const fileUpload = ref<any>(null);
const document = ref<string>("");
const type = ref<string>("");
/**
* function ปโหลดไฟลเจาหนาท
* @param event file
@ -47,10 +54,32 @@ async function uploadFile(event: any) {
);
}
function saveReccommend() {
function saveReccommend(reason: string) {
dialogConfirm(
$q,
async () => {
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();
});
sendStep.value = sendStep.value + 1;
modalRecommend.value = false;
},
@ -59,10 +88,29 @@ function saveReccommend() {
);
}
function sendToDirector(msg: string) {
function sendToDirector(msg: string, type: string) {
dialogConfirm(
$q,
async () => {
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();
});
sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1;
},
"ยืนยันการ" + msg,
@ -72,9 +120,10 @@ function sendToDirector(msg: string) {
const modalRecommend = ref<boolean>(false);
const titleRecommend = ref<string>("");
function sendAndRecommend(title: string) {
function sendAndRecommend(title: string, typeOrder: string) {
modalRecommend.value = true;
titleRecommend.value = title;
type.value = typeOrder;
}
</script>
@ -128,7 +177,7 @@ function sendAndRecommend(title: string) {
unelevated
color="public"
label="ส่งเอกสารให้ ผอ. ตรวจสอบ"
@click="sendToDirector('ส่งเอกสารให้ ผอ. ตรวจสอบ')"
@click="sendToDirector('ส่งเอกสารให้ ผอ. ตรวจสอบ', 'officer')"
/>
<!-- ผอ. หนวยงานทำการยนยนและสงให สกจ. -->
@ -137,7 +186,7 @@ function sendAndRecommend(title: string) {
unelevated
color="public"
label="ยืนยันและส่งเอกสารให้ สกจ."
@click="sendToDirector('ยืนยันและส่งเอกสารให้ สกจ.')"
@click="sendToDirector('ยืนยันและส่งเอกสารให้ สกจ.', 'head')"
/>
<!-- สกจ. ตรวจสอบเอกสารและขอมลรายการเงนเดอนทแตละหนวยงานสงมา ไมปรบโควต -->
@ -146,7 +195,7 @@ function sendAndRecommend(title: string) {
unelevated
color="green"
label="ยืนยันการตรวจสอบ"
@click="sendToDirector('ยืนยันการตรวจสอบ')"
@click="sendToDirector('ยืนยันการตรวจสอบ', 'owner')"
/>
<!-- สกจ. ตรวจสอบเอกสารและขอมลรายการเงนเดอนทแตละหนวยงานสงมา ปรบโควต -->
@ -156,7 +205,7 @@ function sendAndRecommend(title: string) {
unelevated
color="warning"
label="ส่งคำแนะนำให้ ผอ. ตรวจสอบ"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ')"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ', 'owner')"
/>
<!-- ผอ.หนวยงานสงคำแนะนำใหการเจาหนาทหนวยงาน -->
@ -165,7 +214,7 @@ function sendAndRecommend(title: string) {
unelevated
color="public"
label="ส่งคำแนะนำให้การเจ้าหน้าที่หน่วยงาน"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ')"
@click="sendAndRecommend('ส่งคำแนะนำให้ ผอ. ตรวจสอบ', 'head')"
/>
<q-btn