เพิ่ม Function เพิ่มรายการประวัติตำแหน่ง/เงินเดือน
This commit is contained in:
parent
9c5e958715
commit
524523976f
4 changed files with 171 additions and 34 deletions
|
|
@ -118,6 +118,15 @@ const baseColumns = ref<QTableColumn[]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionExecutiveField",
|
||||
align: "left",
|
||||
label: "ด้านทางการบริหาร",
|
||||
sortable: false,
|
||||
field: "positionExecutiveField",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "amount",
|
||||
align: "left",
|
||||
|
|
@ -259,6 +268,7 @@ const visibleColumns = ref<string[]>([
|
|||
"positionType",
|
||||
"positionLevel",
|
||||
"positionExecutive",
|
||||
"positionExecutiveField",
|
||||
"amount",
|
||||
"mouthSalaryAmount",
|
||||
"positionSalaryAmount",
|
||||
|
|
@ -276,7 +286,9 @@ const columns = computed<QTableColumn[]>(() => {
|
|||
return baseColumns.value.filter(
|
||||
(column) =>
|
||||
column.name !== "positionSalaryAmount" &&
|
||||
column.name !== "mouthSalaryAmount"
|
||||
column.name !== "mouthSalaryAmount" &&
|
||||
column.name !== "positionExecutive" &&
|
||||
column.name !== "positionExecutivefield"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -285,6 +297,7 @@ const columns = computed<QTableColumn[]>(() => {
|
|||
|
||||
const modal = ref<boolean>(false);
|
||||
const modalSort = ref<boolean>(false);
|
||||
const isAddPosition = ref<boolean>(true); // สถานะการเพิ่มตำแหน่ง
|
||||
|
||||
/** function fetch ข้อมูลรายการตำแหน่งเงินเดือน*/
|
||||
async function fetchData() {
|
||||
|
|
@ -327,6 +340,8 @@ function serchDataTable() {
|
|||
function onEditData(index: number) {
|
||||
rowIndex.value = index;
|
||||
modal.value = true;
|
||||
isAddPosition.value = index === -1; // ถ้า index เป็น -1 แสดงว่าเป็นการเพิ่มข้อมูลใหม่
|
||||
console.log(`isAddPosition: ${isAddPosition.value}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -739,6 +754,20 @@ onMounted(async () => {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<div class="row q-col-gutter-sm items-center">
|
||||
<q-btn
|
||||
v-if="
|
||||
tabs === 'PENDING' && statusCheckEdit == 'PENDING' && isConfirmEdit
|
||||
"
|
||||
class="q-ml-sm"
|
||||
round
|
||||
flat
|
||||
dense
|
||||
color="primary"
|
||||
icon="add"
|
||||
@click.stop.prevent="onEditData(-1)"
|
||||
>
|
||||
<q-tooltip>จัดลำดับข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
v-if="
|
||||
tabs === 'PENDING' && statusCheckEdit == 'PENDING' && isConfirmEdit
|
||||
|
|
@ -1393,6 +1422,7 @@ onMounted(async () => {
|
|||
:emp-type="empType"
|
||||
:row-data="rows"
|
||||
:fetch-data="fetchData"
|
||||
:is-add-position="isAddPosition"
|
||||
/>
|
||||
|
||||
<DialogSort
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue