fix report salary

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-02-04 14:17:33 +07:00
parent 8aba3faf9b
commit f4b758ab32
4 changed files with 22 additions and 35 deletions

View file

@ -45,5 +45,7 @@ export default {
leaveReportTimeLate: (type: string) => `${leaveReport}/late/${type}`,
leaveReportLeaveday: (type: string) => `${leaveReport}/leaveday/${type}`,
leaveReportLeavedayRetire: () => `${leaveReport}/leavedayRetire`,
leaveReportLeave2: (type: string) => `${leaveReport}/leave2/${type}`,
};

View file

@ -15,12 +15,11 @@ import type {
} from "@/modules/13_salary/interface/index/Main";
import type { ResSalaryOrg } from "@/modules/13_salary/interface/response/SalaryList";
/** importStore*/
/** use*/
const $q = useQuasar();
const store = useSalaryListSDataStore();
const { messageError, showLoader, hideLoader,onSearchDataTable } = useCounterMixin();
const { messageError, showLoader, hideLoader, onSearchDataTable } =
useCounterMixin();
/** props*/
const props = defineProps({
@ -389,9 +388,7 @@ const columns = computed(() => {
return columnsss;
});
/**
* function fetch อมลสถ
*/
/** function fetch ข้อมูลสถิติ*/
async function fetchDataDashboard() {
showLoader();
const formData = {
@ -561,7 +558,6 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
map-options
:options="columns"
option-value="name"
style="min-width: 140px"
/>
</div>

View file

@ -311,7 +311,7 @@ function fetchDataPeriodNew() {
function onClickDownload(data: DataOption, type: string = "xlsx") {
showLoader();
if (data.id === "go1" || data.id === "go2") {
if (data.id === "go1" || data.id === "go2" || data.id === "go2-01") {
const formData = {
type: "HAFT",
startDate:
@ -323,12 +323,17 @@ function onClickDownload(data: DataOption, type: string = "xlsx") {
? `${props?.roundFilter?.year}-03-31`
: `${props?.roundFilter?.year}-09-30`,
nodeId: props.rootId,
isRetirement: data.id === "go2-01" ? true : undefined,
};
const pathApi =
data.id === "go2-01"
? config.API.leaveReportLeavedayRetire()
: config.API.leaveReportLeaveday("officer");
http
.post(config.API.leaveReportLeaveday("officer"), formData)
.then((res) => {
.post(pathApi, formData)
.then(async (res) => {
const dataList = res.data.result;
genReportXLSX(dataList, data.name);
await genReportXLSX(dataList, data.name);
})
.catch((e) => {
messageError($q, e);
@ -358,9 +363,9 @@ function onClickDownload(data: DataOption, type: string = "xlsx") {
const finalUrl = isGovernmentId ? `${url}/${store.tabGroup}` : url;
http
.get(finalUrl)
.then((res) => {
.then(async (res) => {
const dataList = res.data.result;
genReportXLSX(dataList, data.name, type);
await genReportXLSX(dataList, data.name, type);
})
.catch((e) => {
messageError($q, e);
@ -383,7 +388,7 @@ onMounted(() => {
const isRetire = ref<boolean>(false);
const updateIsShowRetire = async () => {
isRetire.value = await !isRetire.value;
isRetire.value = !isRetire.value;
fetchDataPeriodNew();
};
</script>

View file

@ -69,14 +69,6 @@ const titleCommand = computed(() => {
break;
}
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 เรยกรอบ
* @param code value รอบเงนเดอน
*/
async function getSnap(code: string) {
snapOptions.value =
@ -287,9 +280,7 @@ async function fetchSalalyPeriod(
}
}
/**
* function เปลยนรอบการขนเงนเดอน
*/
/** function เปลี่ยนรอบการขั้นเงินเดือน*/
async function onChangeRound() {
// isClosedRound
store.isClosedRound = roundFilter.value.isClose;
@ -309,11 +300,8 @@ async function onChangeRound() {
}
}
/**
* function เปลยนรอบ
*/
/** function เปลี่ยนรอบ*/
async function onChangeSnap() {
// agencyFilter.value = "";
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
await fetchSalalyPeriod(
agencyFilter.value,
@ -323,9 +311,7 @@ async function onChangeSnap() {
}
}
/**
* function เปลยนหนวยงาน
*/
/** function เปลี่ยนหน่วยงาน*/
async function onChangeAgency() {
store.rootId = agencyFilter.value;
if (
@ -341,9 +327,7 @@ async function onChangeAgency() {
}
}
/**
* function fetch PeriodQuota
*/
/** function fetch PeriodQuota*/
function getQuota() {
http
.get(config.API.salaryListPeriodQuota(store.groupId))