แก้ออกคำสั่งเงินเดือน step 1 & 4

This commit is contained in:
Warunee Tamkoo 2024-04-26 13:56:32 +07:00
parent f7d8256682
commit adfbe1b047
2 changed files with 41 additions and 9 deletions

View file

@ -66,7 +66,7 @@ const byOrder = ref<string>("");
const nameCommand = ref<any>();
const positionCommand = ref<string>("");
const year = ref<number>(0);
const SalaryRound = ref<string>("");
const SalaryRound = ref<any>(null);
// 33-34-35
const input33 = ref<string>("");
@ -83,9 +83,6 @@ onMounted(async () => {
} else {
await fecthTypeOption("noData");
}
if (year.value !== 0) {
fetchSalaryRound();
}
});
//
watch(byOrder, async () => {
@ -176,6 +173,9 @@ const fetchdetailOrder = async () => {
nameCommand.value = data.signatoryBy;
positionCommand.value = data.signatoryPosition;
SalaryRound.value = data.salaryPeriodId;
year.value = Number(data.year);
fetchSalaryRound();
})
.catch((e) => {
messageError($q, e);
@ -256,7 +256,8 @@ const submit = async () => {
signatoryBy: signBy === "" ? nameCommand.value : signBy,
signatoryPosition: positionCommand.value,
year: year.value,
salaryPeriodId: SalaryRound.value,
salaryPeriodId: SalaryRound.value.id,
salaryPeriod: SalaryRound.value.code,
};
// if (
// typeOrder.value.commandCode == "C-PM-33" ||
@ -387,8 +388,13 @@ function fetchSalaryRound() {
: e.period === "OCT"
? "รอบตุลาคม"
: "-",
code: e.period,
}));
salaryRoundOptionMain.value = list;
if (SalaryRound.value) {
SalaryRound.value = list.find((x: any) => x.id == SalaryRound.value);
}
})
.catch((err) => {
messageError($q, err);
@ -398,6 +404,7 @@ function fetchSalaryRound() {
});
}
</script>
<template>
<q-form greedy @submit.prevent @validation-success="submit" class="q-pa-md">
<div class="q-pa-md">
@ -665,13 +672,11 @@ function fetchSalaryRound() {
:rules="[(val: string) => !!val || `${'กรุณาเลือกรอบการขึ้นเงินเดือน'}`]"
hide-bottom-space
:label="`${'รอบการขึ้นเงินเดือน'}`"
map-options
option-label="name"
:options="salaryRoundOption"
option-value="id"
use-input
input-debounce="0"
emit-value
lazy-rules
@filter="(inputValue:any,
doneFn:Function) => filterSelector(inputValue, doneFn,'SalaryRound'

View file

@ -51,6 +51,33 @@ const orderId = ref<string>(orderId_params.toString());
// code
const attachmentStatus = computed(() => {
return code.value != "c-pm-10" &&
code.value != "c-pm-11" &&
code.value != "c-pm-12" &&
code.value != "c-pm-16" &&
code.value != "c-pm-18" &&
code.value != "c-pm-19" &&
code.value != "c-pm-20" &&
code.value != "c-pm-21" &&
code.value != "c-pm-23" &&
code.value != "c-pm-25" &&
code.value != "c-pm-26" &&
code.value != "c-pm-27" &&
code.value != "c-pm-28" &&
code.value != "c-pm-29" &&
code.value != "c-pm-30" &&
code.value != "c-pm-31" &&
code.value != "c-pm-32" &&
code.value != "c-pm-33" &&
code.value != "c-pm-34" &&
code.value != "c-pm-35" &&
code.value != "c-pm-36" &&
code.value != "c-pm-37"
? true
: false;
});
const attachmentUploadStatus = computed(() => {
return code.value != "c-pm-10" &&
code.value != "c-pm-11" &&
code.value != "c-pm-12" &&
@ -430,7 +457,7 @@ const clickExecute = async (id: string) => {
};
const validateFormUpload = () => {
if (
attachmentStatus.value &&
attachmentUploadStatus.value &&
fileOrder.value !== null &&
fileTailer.value !== null
) {
@ -645,7 +672,7 @@ onMounted(async () => {
</template>
</q-file>
</div>
<div v-if="attachmentStatus">
<div v-if="attachmentUploadStatus">
<label class="text-file">เอกสารแนบทาย</label>
<div v-if="TailerPDFUpload != ''" class="text-right">
<q-btn