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

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