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

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-08-20 11:44:42 +07:00
parent af56b950b1
commit a589162530
12 changed files with 337 additions and 308 deletions

View file

@ -6,15 +6,23 @@ import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
/**
* importType
*/
import type { QTableProps } from "quasar";
import type { NewPagination } from "@/modules/13_salary/interface/index/Main";
import type { Salary } from "@/modules/13_salary/interface/response/Main";
import type { FormQuerySalary } from "@/modules/13_salary/interface/request/Main";
import DialogFormUpload from "@/modules/13_salary/components/SalaryChart/DialogUpload.vue";
import DialogFormMain from "@/modules/13_salary/components/SalaryChart/DialogFormMain.vue";
/** importStore*/
/**
* importComponents
*/
import DialogFormMain from "@/modules/13_salary/components/SalaryChart/DialogFormMain.vue"; //
import DialogFormUpload from "@/modules/13_salary/components/SalaryChart/DialogUpload.vue"; //
/**
*importStore
*/
import { useCounterMixin } from "@/stores/mixin";
/** use*/
@ -33,6 +41,7 @@ const {
const modalDialogFormMain = ref<boolean>(false);
const modalUpload = ref<boolean>(false);
const rowId = ref<string>("");
/** Table*/
const rows = ref<Salary[]>([]);
const columns = ref<QTableProps["columns"]>([
@ -93,7 +102,7 @@ const typeAction = ref<string>("");
const dataRow = ref<Salary>();
/**
* function fetch อมลรายการผงบญชเงนเดอน
* fetch อมลรายการผงบญชเงนเดอน
*/
function fetchListSalaly() {
showLoader();
@ -105,11 +114,11 @@ function fetchListSalaly() {
config.API.salaryChart +
`?page=${page}&pageSize=${pageSize}&keyword=${keyword}`
)
.then((res) => {
.then(async (res) => {
total.value = res.data.result.total;
maxPage.value = Math.ceil(res.data.result.total / formQuery.pageSize);
const data = res.data.result.data;
rows.value = data;
const data = await res.data.result.data;
rows.value = await data;
})
.catch((err) => {
messageError($q, err);
@ -145,16 +154,18 @@ function onClickSalaryRate(id: string) {
* @param id ญชเงนเดอน
*/
function onClickCoppy(id: string) {
showLoader();
http
.post(config.API.salaryChartCopy, { id: id })
.then(() => {
success($q, "คัดลอกข้อมูลสำเร็จ");
.then(async () => {
await fetchListSalaly();
await success($q, "คัดลอกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
fetchListSalaly();
hideLoader();
});
}
@ -164,16 +175,18 @@ function onClickCoppy(id: string) {
*/
function onClickDelete(id: string) {
dialogRemove($q, () => {
showLoader();
http
.delete(config.API.salaryChartByid(id))
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
.then(async () => {
await fetchListSalaly();
await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
fetchListSalaly();
hideLoader();
});
});
}
@ -481,12 +494,15 @@ onMounted(() => {
</div>
</q-card>
<!-- popup งบญชเงนเดอน -->
<DialogFormMain
v-model:modal="modalDialogFormMain"
:typeAction="typeAction"
:data="dataRow"
:fetchData="fetchListSalaly"
/>
<!-- popup ปโหลดเอกสารอางอ -->
<DialogFormUpload
v-model:modal="modalUpload"
:typeAction="typeAction"