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

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

@ -86,4 +86,7 @@ export default {
`${salary}/sub-file/${name}/${group}/${id}/${subId}`,
salaryUploadFile: (name: string, group: string, id: string, subId: string) =>
`${salary}/sub-file/${name}/${group}/${id}/${subId}`,
//รายชื่อออกคำสั่ง
orgPosSalaryReport: `${salary}/report/command/`,
};

View file

@ -35,6 +35,7 @@ const roundFilter = ref<any>(); //รอบการขึ้นเงินเ
const agencyFilter = ref<string>(""); //
const snapFilter = ref<string>(""); //
const periodLatest = ref<DataPeriodLatest>();
const salaryPeriodId = ref<string>("");
//
const roundOptions = ref<DataOptionShort[]>([]); //
@ -70,6 +71,7 @@ async function getRound() {
roundOptions.value = [];
roundFilter.value = [];
const data = res.data.result.data;
if (data.length !== 0) {
isDisable.value = true;
lastPage.value = Math.ceil(res.data.result.total / pageSize.value);
@ -94,6 +96,7 @@ async function getRound() {
store.roundMainCode = roundFilter.value.shortCode;
store.roundYear = roundFilter.value.year;
store.isClosedRound = roundFilter.value.isClose;
salaryPeriodId.value = roundFilter.value.id;
await Promise.all([
getSnap(roundFilter.value.shortCode),
@ -199,6 +202,7 @@ async function getAgencyPosition(id: string) {
.then(async (res) => {
const data = await res.data.result;
store.rootId = data.rootId;
const position = agencyOptions.value?.find(
(e: DataOption) => e.id === data.rootId
);
@ -242,6 +246,7 @@ async function fetchSalalyPeriod(
.post(config.API.salaryListPeriodLatest, body)
.then(async (res) => {
const data = await res.data.result;
console.log(data);
if (roundFilter.value.shortCode !== "SPECIAL") {
if (Object.values(data).includes(null)) {
@ -274,6 +279,7 @@ async function fetchSalalyPeriod(
async function onChangeRound() {
// isClosedRound
store.isClosedRound = roundFilter.value.isClose;
salaryPeriodId.value = roundFilter.value.id;
if (roundFilter.value.shortCode === "SPECIAL") {
store.tabGroup = "group1";
}
@ -357,8 +363,21 @@ function filterSelector(val: string, update: Function, refData: string) {
}
}
onMounted(() => {
getRound();
async function fetchCheckisOfficer() {
http
.get(config.API.workflowKeycloakSystem(`SALARY_OFFICER`))
.then((res) => {
const data = res.data.result;
isOfficer.value = data.isOfficer;
isStaff.value = data.isStaff;
})
.catch((e) => {
messageError($q, e);
});
}
onMounted(async () => {
await Promise.all([getRound(), fetchCheckisOfficer()]);
});
</script>
@ -542,6 +561,7 @@ onMounted(() => {
v-model:is-staff="isStaff"
system-name="SALARY"
:command-type-code-array="['C-PM-33', 'C-PM-34', 'C-PM-35']"
:salary-period-id="salaryPeriodId"
/>
</template>

View file

@ -35,6 +35,7 @@ const roundFilter = ref<any>(); //รอบการขึ้นเงินเ
const agencyFilter = ref<string>(""); //
const snapFilter = ref<string>(""); //
const periodLatest = ref<DataPeriodLatest>();
const salaryPeriodId = ref<string>("");
//
const roundOptions = ref<DataOptionShort[]>([]); //
@ -92,7 +93,7 @@ async function getRound() {
roundFilter.value = await (roundOptions.value
? roundOptions.value[0]
: "");
salaryPeriodId.value = roundFilter.value.id;
store.roundMainCode = roundFilter.value.shortCode;
store.isClosedRound = roundFilter.value.isClose;
@ -262,6 +263,7 @@ async function fetchSalalyPeriod(
async function onChangeRound() {
// isClosedRound
store.isClosedRound = roundFilter.value.isClose;
salaryPeriodId.value = roundFilter.value.id;
await getSnap(roundFilter.value.shortCode);
await getAgency(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId);
@ -359,8 +361,21 @@ function filterSelector(val: string, update: Function, refData: string) {
}
}
onMounted(() => {
getRound();
async function fetchCheckisOfficer() {
http
.get(config.API.workflowKeycloakSystem(`SALARY_EMP`))
.then((res) => {
const data = res.data.result;
isOfficer.value = data.isOfficer;
isStaff.value = data.isStaff;
})
.catch((e) => {
messageError($q, e);
});
}
onMounted(async() => {
await Promise.all([getRound(), fetchCheckisOfficer()]);
});
</script>
@ -538,6 +553,7 @@ onMounted(() => {
v-model:is-staff="isStaff"
system-name="SALARY_EMP"
:command-type-code-array="['C-PM-36', 'C-PM-37']"
:salary-period-id="salaryPeriodId"
/>
</template>

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>