Merge branch 'develop' into devTee
This commit is contained in:
commit
2bf23bae5b
3 changed files with 67 additions and 60 deletions
|
|
@ -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,
|
||||
() => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue