เงินเดือน => ผังบัญชีค่าจ้างลูกจ้างประจำ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-30 13:04:43 +07:00
parent ff13fb1345
commit 6bf2247962
3 changed files with 41 additions and 24 deletions

View file

@ -1,24 +1,22 @@
<script setup lang="ts">
import { ref, reactive, watch } from "vue";
import { ref, watch } from "vue";
import { useQuasar } from "quasar";
import axios from "axios";
import http from "@/plugins/http";
import config from "@/app.config";
/** importComponents*/
import Header from "@/components/DialogHeader.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
/**use*/
const $q = useQuasar();
const {
dialogConfirm,
showLoader,
hideLoader,
messageError,
success,
dialogRemove,
} = useCounterMixin();
const { showLoader, hideLoader, messageError, success, dialogRemove } =
useCounterMixin();
/**props*/
const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
id: {
@ -32,10 +30,13 @@ const props = defineProps({
});
const salaryId = ref<string>("");
const documentFile = ref<any>(null);
const itemsDocument = ref<any>([]);
/**
* function fetch อมลรายการ ไฟล
* @param id
*/
async function fetchDocumentFile(id: string) {
showLoader();
await http
@ -50,22 +51,12 @@ async function fetchDocumentFile(id: string) {
});
}
watch(
() => modal.value,
async () => {
if (modal.value) {
if (props.id) {
salaryId.value = props.id;
await fetchDocumentFile(props.id);
}
}
}
);
/** function ปืด Dialog*/
function closeDialog() {
modal.value = !modal.value;
}
/** function เรียก path อัปโหลดไฟล์*/
async function uploadDocumentFile() {
const fileName = documentFile.value.name.replace(/\.(xlsx|docx|pdf)$/, "");
showLoader();
@ -117,6 +108,10 @@ function fileUpLoad(url: string) {
.finally(() => {});
}
/**
* function ลบขอมลรายการไฟล
* @param fileName อไฟล
*/
function onClickDeleteFile(fileName: string) {
dialogRemove($q, async () => {
showLoader();
@ -139,6 +134,10 @@ function onClickDeleteFile(fileName: string) {
});
}
/**
* function โหลดขอมลไฟล
* @param fileName อไฟล
*/
async function onClickDonwload(fileName: string) {
showLoader();
await http
@ -182,6 +181,19 @@ async function downloadFile(url: string, type: string, fileName: string) {
hideLoader();
});
}
/** callbackFunction ทำการ fetch ข้อมูลไฟล์เมื่อเปิด Dialog*/
watch(
() => modal.value,
async () => {
if (modal.value) {
if (props.id) {
salaryId.value = props.id;
await fetchDocumentFile(props.id);
}
}
}
);
</script>
<template>

View file

@ -4,21 +4,23 @@ import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
import type {
DataOptions,
DataListOptions,
} from "@/modules/13_salary/interface/index/EmployeeChart";
/** importComponents*/
import Header from "@/components/DialogHeader.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const { dialogConfirm, showLoader, hideLoader, messageError, success } =
useCounterMixin();
// const salaryEmployeeId = ref<string>(route.params.id.toString());
/** props*/
const modal = defineModel<boolean>("modal", { required: true });
const isEdit = defineModel<boolean>("isStatusEdit", { required: true });
const props = defineProps({

View file

@ -1,9 +1,12 @@
<script setup lang="ts">
/** importComponents*/
import TabStructure from "@/modules/13_salary/components/salaryEmployeeChart/TabStructure.vue";
import TabCriteris from "@/modules/13_salary/components/salaryEmployeeChart/TabCriteria.vue";
/** importStore*/
import { useSalaryEmployeeChartDataStore } from "@/modules/13_salary/store/SalaryEmployeeChart";
/** use*/
const store = useSalaryEmployeeChartDataStore();
</script>