ออกคำสั่ง เงินเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-24 11:21:58 +07:00
parent 95dcc45177
commit 64dff5d907
4 changed files with 68 additions and 15 deletions

View file

@ -40,6 +40,7 @@ const props = defineProps({
commandTypeCodeArray: { type: Array, defult: [] }, //
systemName: String, //
orgPublishDate: { type: Date || undefined, defult: undefined },
salaryPeriodId: { type: String, defult: "" }, //
});
const commandOp = ref<ListCommand[]>([]); //
@ -49,6 +50,8 @@ const commandYear = ref<number>(new Date().getFullYear());
const commandAffectDate = ref<Date | null>(null); //
const commandExcecuteDate = ref<Date | null>(null); //
const commandCode = ref<string>("");
const group = ref<string>("GROUP1.1"); //
const isCheckOrgPublishDate = ref<boolean>(false); //
const groupDataOp = ref<DataOption[]>([
@ -204,11 +207,20 @@ function filterOption(val: string, update: Function) {
}
/**
* งกนเลอกกล
* @param val กลมทองการคนหา
* งกนเลอกประเภทคำสงและเลอกกล
*/
function updateGroup() {
getPerson();
function updateValue() {
if (props.systemName === "SALARY" || props.systemName === "SALARY_EMP") {
const code = commandOp.value.find(
(e: any) => e.id === commandType.value
)?.code;
if (code && props.salaryPeriodId) {
commandCode.value = code;
getPerson();
}
} else {
getPerson();
}
}
/** ดึงข้อมูลคน */
@ -221,10 +233,9 @@ function getPerson() {
const pathAPI =
props.systemName === "ORGANIZATION"
? config.API.orgPosReport
: props.systemName === "SALARY"
? config.API.orgPosReport
: props.systemName === "SALARY_EMP"
? config.API.orgPosReport
: props.systemName === "SALARY" || props.systemName === "SALARY_EMP"
? config.API.orgPosSalaryReport +
`${commandCode.value}/${props.salaryPeriodId}`
: props.systemName === "ACTING"
? config.API.orgPosReport
: "";
@ -259,7 +270,9 @@ watch(modal, async () => {
(item) => item.id !== "GROUP1.1"
);
}
getPerson();
if (props.systemName !== "SALARY" && props.systemName !== "SALARY_EMP") {
getPerson();
}
}
});
</script>
@ -295,6 +308,7 @@ watch(modal, async () => {
? 'inputgreen'
: ''
"
@update:model-value="updateValue"
>
<template v-slot:no-option>
<q-item>
@ -466,7 +480,7 @@ watch(modal, async () => {
map-options
use-input
outlined
@update:model-value="updateGroup"
@update:model-value="updateValue"
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "
>
<template v-slot:no-option>