Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-07-08 16:32:11 +07:00
commit 2bf23bae5b
3 changed files with 67 additions and 60 deletions

View file

@ -17,7 +17,7 @@ import type { DataPerson } from "@/modules/13_salary/interface/response/SalaryLi
/** importComponents*/
import Header from "@/components/DialogHeader.vue";
/** use*/
/** use composables */
const $q = useQuasar();
const store = useSalaryEmployeeListSDataStore();
const { messageError, showLoader, hideLoader, dialogConfirm, success } =
@ -102,7 +102,9 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.posTypeShort}${row.posLevel}`;
return `${row.posTypeShort ? row.posTypeShort : ""}${
row.posLevel ? row.posLevel : ""
}`;
},
},
]);
@ -117,18 +119,14 @@ const formFilter = reactive<DataFilterPerson>({
});
const maxPage = ref<number>(1);
/**
* function close popup
*/
/** function close popup*/
function closeModal() {
modal.value = false;
formFilter.page = 1;
formFilter.keyword = "";
}
/**
* function เรยกรายช คนเลอนเงนเดอน
*/
/** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/
async function fetchListPerson() {
showLoader();
formFilter.rootId = store.rootId;
@ -157,10 +155,12 @@ async function fetchListPerson() {
*/
function onClickAddPerson(data: DataPerson) {
data.rank = undefined;
const body: DataPersonReq = {
id: store.groupId,
type: store.tabType,
...data,
position: data.position ? data.position : "",
};
dialogConfirm(
@ -186,32 +186,24 @@ function onClickAddPerson(data: DataPerson) {
);
}
/**
* function updatePage
*/
/** function update Pagination*/
async function updatePagePagination() {
fetchListPerson();
}
/**
* function updatePageSize
*/
/** function updatePageSize*/
function updatePageSizePagination(newPagination: NewPagination) {
formFilter.page = 1;
formFilter.pageSize = newPagination.rowsPerPage;
}
/**
* function นหาขอมลตาม keyword
*/
/** function ค้นหาข้อมูลตาม keyword*/
function searchData() {
formFilter.page = 1;
fetchListPerson();
}
/**
* callblack function เรยกขอมลรายชอคนเลอนเงนเดอน เมอมการเป Popup
*/
/** callblack function เรียกข้อมูลรายชื่อคนเลื่อนเงินเดือน เมื่อมีการเปิด Popup */
watch(
() => modal.value,
() => {
@ -221,9 +213,7 @@ watch(
}
);
/**
* callblack function เรยกขอมลรายชอคนเลอนเงนเดอน เมอมการเปลยน PageSize
*/
/** callblack function เรียกข้อมูลรายชื่อคนเลื่อนเงินเดือน เมื่อมีการเปลี่ยน PageSize*/
watch(
() => formFilter.pageSize,
() => {

View file

@ -23,7 +23,7 @@ import DialogInfoCriteria from "@/modules/13_salary/components/05_salaryListsEmp
import { useCounterMixin } from "@/stores/mixin";
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
/** use*/
/** use composables */
const $q = useQuasar();
const store = useSalaryEmployeeListSDataStore();
const { messageError, showLoader, hideLoader } = useCounterMixin();
@ -212,11 +212,11 @@ const formFilter = reactive<DataFilter>({
});
/**
* function เรยกขอมจำนวนโควต
* งกเรยกขอมโควต
* @param id กล
*/
function fetchDataQuota(id: string) {
http
async function fetchDataQuota(id: string) {
await http
.get(config.API.salaryListPeriodQuotaEmp(id))
.then((res) => {
const data = res.data.result;
@ -243,11 +243,10 @@ function fetchDataQuota(id: string) {
}
/**
* function เรยกขอมลรายช
* งกเรยกขอมลรายช
* @param id กล
*/
async function fetchDataPeriod(id: string) {
showLoader();
let formData = {
page: formFilter.page.toString(),
pageSize: formFilter.pageSize.toString(),
@ -271,35 +270,45 @@ async function fetchDataPeriod(id: string) {
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
setTimeout(() => {
hideLoader();
}, 1000);
});
}
/**
* function เปลยนข
*/
function changeTabType() {
formFilter.page = 1;
formFilter.pageSize = 10;
formFilter.keyword = "";
store.groupId && fetchDataPeriod(store.groupId);
/** ฟังก์ชันเปลี่ยนขั้น*/
async function changeTabType() {
if (!store.groupId) return;
showLoader();
try {
formFilter.page = 1;
formFilter.pageSize = 10;
formFilter.keyword = "";
await fetchDataPeriod(store.groupId);
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
}
/** ฟังก์ชันเรียกข้อมูลรายชื่ออีกครั้งและโควต้า */
async function fetchDataPeriodNew() {
if (!store.groupId) return;
showLoader();
try {
await Promise.all([
fetchDataPeriod(store.groupId),
fetchDataQuota(store.groupId),
]);
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
}
/**
* function เรยกขอมลรายชออกคร
*/
function fetchDataPeriodNew() {
store.groupId && fetchDataPeriod(store.groupId);
store.groupId && fetchDataQuota(store.groupId);
}
/**
* function โหลดไฟล
* @param data อมลทองการโหล
* งกนโหลดไฟล
* @param data อมลทองการโหลด
* @param type ประเภทไฟล docx,xlsx
*/
async function onClickDownload(data: DataOption, type: string = "xlsx") {
@ -359,19 +368,27 @@ async function onClickDownload(data: DataOption, type: string = "xlsx") {
}
}
/**
* funrion แสดงเฉพาะผเกษยณอายราชการ
*/
/** funrion แสดงเฉพาะผู้เกษียณอายุราชการ*/
function updateIsShowRetire() {
isRetire.value = !isRetire.value;
fetchDataPeriodNew();
}
onMounted(() => {
/** ฟังก์ชันเรียกข้อมูลเมื่อ component ถูกเรียก */
onMounted(async () => {
if (props.rootId) {
fetchDataQuota(store.groupId);
fetchDataPeriod(store.groupId);
splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
showLoader();
try {
await Promise.all([
fetchDataQuota(store.groupId),
fetchDataPeriod(store.groupId),
(splitterModel.value = store.roundMainCode === "APR" ? 13 : 16),
]);
} catch (error) {
messageError($q, error);
} finally {
hideLoader();
}
}
});
</script>

View file

@ -90,7 +90,7 @@ export const useSocketStore = defineStore("socket", () => {
fnStyleNotiOrg();
Notify.create({
message: `${message} <a href="#" onclick="window.resetOrgPage('${type}')" class="notify-link">${
type == "draft" ? "ไปยังแบบร่าง" : "ไปยังปัจจุบัน"
type == "draft" ? "ไปยังโครงสร้างแบบร่าง" : "ไปยังโครงสร้างปัจจุบัน"
}</a>`,
html: true,
group: false,