fix report salary
This commit is contained in:
parent
8aba3faf9b
commit
f4b758ab32
4 changed files with 22 additions and 35 deletions
|
|
@ -45,5 +45,7 @@ export default {
|
||||||
leaveReportTimeLate: (type: string) => `${leaveReport}/late/${type}`,
|
leaveReportTimeLate: (type: string) => `${leaveReport}/late/${type}`,
|
||||||
|
|
||||||
leaveReportLeaveday: (type: string) => `${leaveReport}/leaveday/${type}`,
|
leaveReportLeaveday: (type: string) => `${leaveReport}/leaveday/${type}`,
|
||||||
|
leaveReportLeavedayRetire: () => `${leaveReport}/leavedayRetire`,
|
||||||
|
|
||||||
leaveReportLeave2: (type: string) => `${leaveReport}/leave2/${type}`,
|
leaveReportLeave2: (type: string) => `${leaveReport}/leave2/${type}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,11 @@ import type {
|
||||||
} from "@/modules/13_salary/interface/index/Main";
|
} from "@/modules/13_salary/interface/index/Main";
|
||||||
import type { ResSalaryOrg } from "@/modules/13_salary/interface/response/SalaryList";
|
import type { ResSalaryOrg } from "@/modules/13_salary/interface/response/SalaryList";
|
||||||
|
|
||||||
/** importStore*/
|
|
||||||
|
|
||||||
/** use*/
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = useSalaryListSDataStore();
|
const store = useSalaryListSDataStore();
|
||||||
const { messageError, showLoader, hideLoader,onSearchDataTable } = useCounterMixin();
|
const { messageError, showLoader, hideLoader, onSearchDataTable } =
|
||||||
|
useCounterMixin();
|
||||||
|
|
||||||
/** props*/
|
/** props*/
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -389,9 +388,7 @@ const columns = computed(() => {
|
||||||
return columnsss;
|
return columnsss;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/** function fetch ข้อมูลสถิติ*/
|
||||||
* function fetch ข้อมูลสถิติ
|
|
||||||
*/
|
|
||||||
async function fetchDataDashboard() {
|
async function fetchDataDashboard() {
|
||||||
showLoader();
|
showLoader();
|
||||||
const formData = {
|
const formData = {
|
||||||
|
|
@ -561,7 +558,6 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
|
||||||
map-options
|
map-options
|
||||||
:options="columns"
|
:options="columns"
|
||||||
option-value="name"
|
option-value="name"
|
||||||
|
|
||||||
style="min-width: 140px"
|
style="min-width: 140px"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ function fetchDataPeriodNew() {
|
||||||
|
|
||||||
function onClickDownload(data: DataOption, type: string = "xlsx") {
|
function onClickDownload(data: DataOption, type: string = "xlsx") {
|
||||||
showLoader();
|
showLoader();
|
||||||
if (data.id === "go1" || data.id === "go2") {
|
if (data.id === "go1" || data.id === "go2" || data.id === "go2-01") {
|
||||||
const formData = {
|
const formData = {
|
||||||
type: "HAFT",
|
type: "HAFT",
|
||||||
startDate:
|
startDate:
|
||||||
|
|
@ -323,12 +323,17 @@ function onClickDownload(data: DataOption, type: string = "xlsx") {
|
||||||
? `${props?.roundFilter?.year}-03-31`
|
? `${props?.roundFilter?.year}-03-31`
|
||||||
: `${props?.roundFilter?.year}-09-30`,
|
: `${props?.roundFilter?.year}-09-30`,
|
||||||
nodeId: props.rootId,
|
nodeId: props.rootId,
|
||||||
|
isRetirement: data.id === "go2-01" ? true : undefined,
|
||||||
};
|
};
|
||||||
|
const pathApi =
|
||||||
|
data.id === "go2-01"
|
||||||
|
? config.API.leaveReportLeavedayRetire()
|
||||||
|
: config.API.leaveReportLeaveday("officer");
|
||||||
http
|
http
|
||||||
.post(config.API.leaveReportLeaveday("officer"), formData)
|
.post(pathApi, formData)
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const dataList = res.data.result;
|
const dataList = res.data.result;
|
||||||
genReportXLSX(dataList, data.name);
|
await genReportXLSX(dataList, data.name);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -358,9 +363,9 @@ function onClickDownload(data: DataOption, type: string = "xlsx") {
|
||||||
const finalUrl = isGovernmentId ? `${url}/${store.tabGroup}` : url;
|
const finalUrl = isGovernmentId ? `${url}/${store.tabGroup}` : url;
|
||||||
http
|
http
|
||||||
.get(finalUrl)
|
.get(finalUrl)
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const dataList = res.data.result;
|
const dataList = res.data.result;
|
||||||
genReportXLSX(dataList, data.name, type);
|
await genReportXLSX(dataList, data.name, type);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -383,7 +388,7 @@ onMounted(() => {
|
||||||
|
|
||||||
const isRetire = ref<boolean>(false);
|
const isRetire = ref<boolean>(false);
|
||||||
const updateIsShowRetire = async () => {
|
const updateIsShowRetire = async () => {
|
||||||
isRetire.value = await !isRetire.value;
|
isRetire.value = !isRetire.value;
|
||||||
fetchDataPeriodNew();
|
fetchDataPeriodNew();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -69,14 +69,6 @@ const titleCommand = computed(() => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return `ปีงบประมาณ ${year.value + 543} รอบการขึ้นเงินเดือน ${txt}`;
|
return `ปีงบประมาณ ${year.value + 543} รอบการขึ้นเงินเดือน ${txt}`;
|
||||||
|
|
||||||
// return `ปีงบประมาณ ${year.value + 543} รอบการขึ้นเงินเดือน ${
|
|
||||||
// roundFilter.value?.shortCode === "SPECIAL"
|
|
||||||
// ? roundFilter.value?.name
|
|
||||||
// ? roundFilter.value?.name
|
|
||||||
// : ""
|
|
||||||
// : `1 ${roundFilter.value?.name ? roundFilter.value?.name : ""}`
|
|
||||||
// } `;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -140,6 +132,7 @@ async function getRound() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function เรียกรอบ
|
* function เรียกรอบ
|
||||||
|
* @param code value รอบเงินเดือน
|
||||||
*/
|
*/
|
||||||
async function getSnap(code: string) {
|
async function getSnap(code: string) {
|
||||||
snapOptions.value =
|
snapOptions.value =
|
||||||
|
|
@ -287,9 +280,7 @@ async function fetchSalalyPeriod(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เปลี่ยนรอบการขั้นเงินเดือน*/
|
||||||
* function เปลี่ยนรอบการขั้นเงินเดือน
|
|
||||||
*/
|
|
||||||
async function onChangeRound() {
|
async function onChangeRound() {
|
||||||
// เก็บสถานะการปิดรอบในตัวแปร isClosedRound เพื่อใช้ในการเช็ค
|
// เก็บสถานะการปิดรอบในตัวแปร isClosedRound เพื่อใช้ในการเช็ค
|
||||||
store.isClosedRound = roundFilter.value.isClose;
|
store.isClosedRound = roundFilter.value.isClose;
|
||||||
|
|
@ -309,11 +300,8 @@ async function onChangeRound() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เปลี่ยนรอบ*/
|
||||||
* function เปลี่ยนรอบ
|
|
||||||
*/
|
|
||||||
async function onChangeSnap() {
|
async function onChangeSnap() {
|
||||||
// agencyFilter.value = "";
|
|
||||||
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
|
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
|
||||||
await fetchSalalyPeriod(
|
await fetchSalalyPeriod(
|
||||||
agencyFilter.value,
|
agencyFilter.value,
|
||||||
|
|
@ -323,9 +311,7 @@ async function onChangeSnap() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เปลี่ยนหน่วยงาน*/
|
||||||
* function เปลี่ยนหน่วยงาน
|
|
||||||
*/
|
|
||||||
async function onChangeAgency() {
|
async function onChangeAgency() {
|
||||||
store.rootId = agencyFilter.value;
|
store.rootId = agencyFilter.value;
|
||||||
if (
|
if (
|
||||||
|
|
@ -341,9 +327,7 @@ async function onChangeAgency() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function fetch PeriodQuota*/
|
||||||
* function fetch PeriodQuota
|
|
||||||
*/
|
|
||||||
function getQuota() {
|
function getQuota() {
|
||||||
http
|
http
|
||||||
.get(config.API.salaryListPeriodQuota(store.groupId))
|
.get(config.API.salaryListPeriodQuota(store.groupId))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue