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

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

@ -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>