ข้อมูลเงินเดือน/ค่าจ้าง
This commit is contained in:
parent
fafdeb68f4
commit
af9ce4ac1e
2 changed files with 95 additions and 453 deletions
|
|
@ -7,7 +7,7 @@ import { useRoute } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { QTableColumn } from "quasar";
|
||||
import type {
|
||||
DataPositions,
|
||||
DataCommandCode,
|
||||
|
|
@ -21,7 +21,9 @@ import type { FormSalary } from "@/modules/04_registryPerson/interface/request/S
|
|||
import type { ResListSalary } from "@/modules/04_registryPerson/interface/response/Salary";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogHistory from "@/modules/04_registryPerson/components/detail/Salary/01_PositionSalaryHistory.vue";
|
||||
import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue";
|
||||
|
||||
// import DialogHistory from "@/modules/04_registryPerson/components/detail/Salary/01_PositionSalaryHistory.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useSalaryDataStore } from "@/modules/04_registryPerson/stores/salary";
|
||||
|
|
@ -61,7 +63,7 @@ const keyword = ref<string>(""); //คำค้นหา
|
|||
const modalCommand = ref<boolean>(false);
|
||||
const command = ref<string>("");
|
||||
const commandId = ref<string>("");
|
||||
const baseColumns = ref<QTableProps["columns"]>([
|
||||
const baseColumns = ref<QTableColumn[]>([
|
||||
{
|
||||
name: "commandDateAffect",
|
||||
align: "left",
|
||||
|
|
@ -281,20 +283,35 @@ const baseColumns = ref<QTableProps["columns"]>([
|
|||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "lastUpdateFullName",
|
||||
align: "left",
|
||||
label: "ผู้ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "lastUpdateFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "lastUpdatedAt",
|
||||
align: "left",
|
||||
label: "วันที่แก้ไข",
|
||||
sortable: true,
|
||||
field: "lastUpdatedAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => date2Thai(v, false, true),
|
||||
sort: (a: string, b: string) =>
|
||||
a
|
||||
.toString()
|
||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const columns = computed(() => {
|
||||
if (empType.value === "-employee") {
|
||||
if (baseColumns.value) {
|
||||
return baseColumns.value.filter(
|
||||
(column) =>
|
||||
column.name !== "positionSalaryAmount" &&
|
||||
column.name !== "mouthSalaryAmount"
|
||||
);
|
||||
}
|
||||
}
|
||||
return baseColumns.value;
|
||||
});
|
||||
const visibleColumns = ref<string[]>([
|
||||
const baseVisibleColumns = ref<string[]>([
|
||||
"commandDateAffect",
|
||||
"posNo",
|
||||
"positionName",
|
||||
|
|
@ -309,11 +326,47 @@ const visibleColumns = ref<string[]>([
|
|||
"commandDateSign",
|
||||
"organization",
|
||||
"remark",
|
||||
"lastUpdateFullName",
|
||||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
const columns = computed<QTableColumn[]>(() => {
|
||||
if (empType.value === "-employee") {
|
||||
if (baseColumns.value) {
|
||||
return baseColumns.value.filter(
|
||||
(column) =>
|
||||
column.name !== "positionSalaryAmount" &&
|
||||
column.name !== "mouthSalaryAmount"
|
||||
);
|
||||
}
|
||||
}
|
||||
return baseColumns.value.filter(
|
||||
(e: any) => e.name !== "lastUpdateFullName" && e.name !== "lastUpdatedAd"
|
||||
);
|
||||
});
|
||||
const visibleColumns = ref<string[]>(
|
||||
baseVisibleColumns.value.filter(
|
||||
(e: string) => e !== "lastUpdateFullName" && e !== "lastUpdatedAd"
|
||||
)
|
||||
);
|
||||
const pagination = ref({
|
||||
sortBy: "",
|
||||
});
|
||||
|
||||
const columnsHistory = computed<QTableColumn[]>(() => {
|
||||
if (empType.value === "-employee") {
|
||||
if (baseColumns.value) {
|
||||
return baseColumns.value.filter(
|
||||
(column) =>
|
||||
column.name !== "positionSalaryAmount" &&
|
||||
column.name !== "mouthSalaryAmount"
|
||||
);
|
||||
}
|
||||
}
|
||||
return baseColumns.value;
|
||||
});
|
||||
const visibleColumnsHistory = ref<string[]>(baseVisibleColumns.value);
|
||||
|
||||
const formData = reactive<FormSalary>({
|
||||
commandCode: "", //ประเภทคำสั่ง
|
||||
commandNo: "", //เลขที่คำสั่ง
|
||||
|
|
@ -698,6 +751,22 @@ function onClikcHistory(id: string) {
|
|||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/** function fetch ข้อมูลประวัติการแก้ไข*/
|
||||
async function fetchDataHistory() {
|
||||
showLoader();
|
||||
try {
|
||||
const res = await http.get(
|
||||
config.API.profileListSalaryHistoryNew(salaryId.value, empType.value)
|
||||
);
|
||||
|
||||
return res.data.result;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
}
|
||||
|
||||
const classInput = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
|
|
@ -1419,7 +1488,16 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogHistory v-model:modal="modalHistory" v-model:salaryId="salaryId" />
|
||||
<!-- <DialogHistory v-model:modal="modalHistory" v-model:salaryId="salaryId" /> -->
|
||||
|
||||
<DialogHistory
|
||||
v-model:modal="modalHistory"
|
||||
:visible-columns="visibleColumnsHistory"
|
||||
:title="`ประวัติแก้ไขเงินเดือน`"
|
||||
:columns="columnsHistory"
|
||||
:fetch-data="fetchDataHistory"
|
||||
/>
|
||||
|
||||
<DialogPreviewCommand
|
||||
v-model:modal="modalCommand"
|
||||
v-model:command="command"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue