load
This commit is contained in:
parent
51b26ba51c
commit
ad8cf4553a
4 changed files with 136 additions and 8 deletions
|
|
@ -151,8 +151,8 @@ function onSubmit() {
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await props.fetchDataTree?.();
|
await props.fetchDataTree?.();
|
||||||
await closeClear();
|
closeClear();
|
||||||
await hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
props.dataNode &&
|
props.dataNode &&
|
||||||
|
|
@ -175,8 +175,8 @@ function onSubmit() {
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
// await props.fetchDataTree?.();
|
// await props.fetchDataTree?.();
|
||||||
await closeClear();
|
closeClear();
|
||||||
await hideLoader();
|
hideLoader();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,27 @@ function validateFormPositionEdit() {
|
||||||
/** ฟังชั่น บันทึก */
|
/** ฟังชั่น บันทึก */
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
console.log(formData);
|
const positionsData = rows.value.map((e) => ({
|
||||||
|
posDictName: e.positionName, //ชื่อตำแหน่งในสายงาน (ชื่อตำแหน่ง)
|
||||||
|
posDictField: e.positionField, //สายงาน
|
||||||
|
posTypeId: e.positionName, //*ประเภทตำแหน่ง
|
||||||
|
posLevelId: e.positionName, //*ระดับตำแหน่ง
|
||||||
|
posExecutiveId: e.positionName, //ตำแหน่งทางการบริหาร
|
||||||
|
posDictExecutiveField: e.positionName, //ด้านทางการบริหาร
|
||||||
|
posDictArea: e.positionArea, //ด้าน/สาขา
|
||||||
|
}));
|
||||||
|
const body = {
|
||||||
|
posMasterNoPrefix: formData.prefixNo, //*Prefix นำหน้าเลขที่ตำแหน่ง เป็น Optional (ไม่ใช่อักษรย่อของหน่วยงาน/ส่วนราชการ)
|
||||||
|
posMasterNo: Number(formData.positionNo), //*เลขที่ตำแหน่ง เป็นตัวเลข
|
||||||
|
posMasterNoSuffix: formData.suffixNo, //Suffix หลังเลขที่ตำแหน่ง เช่น ช.
|
||||||
|
// orgRootId: Guid, //Id สำนัก
|
||||||
|
// orgChild1Id: Guid, //Id โครงสร้างระดับ1
|
||||||
|
// orgChild2Id: Guid, //Id โครงสร้างระดับ2
|
||||||
|
// orgChild3Id: Guid, //Id โครงสร้างระดับ3
|
||||||
|
// orgChild4Id: Guid, //Id โครงสร้างระดับ4
|
||||||
|
positions: [positionsData],
|
||||||
|
};
|
||||||
|
console.log(body);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** ฟังชั่น บันทึก */
|
/** ฟังชั่น บันทึก */
|
||||||
|
|
|
||||||
|
|
@ -208,8 +208,8 @@ async function onClickDel(type: number, id: string) {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
await props.fetchDataTree?.();
|
props.fetchDataTree?.();
|
||||||
await hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,13 @@ const rows = ref<any>([
|
||||||
levelPositoion: "ชำนาญการ / ?",
|
levelPositoion: "ชำนาญการ / ?",
|
||||||
isStatus: "ไม่มี",
|
isStatus: "ไม่มี",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
noPosition: "สกง.2",
|
||||||
|
namePosition: "นักทรัพยากรบุคคล",
|
||||||
|
typePosition: "ทั่วไป",
|
||||||
|
levelPositoion: "ชำนาญการ / ?",
|
||||||
|
isStatus: "ไม่มี",
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const dialogPosition = ref<boolean>(false);
|
const dialogPosition = ref<boolean>(false);
|
||||||
|
|
@ -173,7 +180,7 @@ function onClickViewDetail() {
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
row-key="id"
|
row-key="noPosition"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
|
|
@ -184,6 +191,7 @@ function onClickViewDetail() {
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
<q-th auto-width></q-th>
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
|
|
@ -192,6 +200,16 @@ function onClickViewDetail() {
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
|
<q-td>
|
||||||
|
<q-btn
|
||||||
|
size="sm"
|
||||||
|
color="primary"
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
@click="props.expand = !props.expand"
|
||||||
|
:icon="props.expand ? 'remove' : 'add'"
|
||||||
|
/>
|
||||||
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
|
|
@ -233,6 +251,96 @@ function onClickViewDetail() {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
|
|
||||||
|
<q-tr v-show="props.expand" :props="props" >
|
||||||
|
<q-td colspan="100%">
|
||||||
|
<div class="text-left q-pa-md">
|
||||||
|
<div class="col-12">
|
||||||
|
<d-table
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:rows="rows"
|
||||||
|
row-key="noPosition"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:paging="true"
|
||||||
|
dense
|
||||||
|
class="custom-header-table"
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
:filter="filter"
|
||||||
|
>
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
>
|
||||||
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
|
</q-th>
|
||||||
|
<q-th auto-width></q-th>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:body="props">
|
||||||
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
|
<q-td
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
>
|
||||||
|
<div v-if="col.name == 'no'">
|
||||||
|
{{ props.rowIndex + 1 }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else>
|
||||||
|
{{ col.value }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
<q-td>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
icon="mdi-dots-vertical"
|
||||||
|
class="q-pa-none q-ml-xs"
|
||||||
|
color="grey-13"
|
||||||
|
>
|
||||||
|
<q-menu>
|
||||||
|
<q-list
|
||||||
|
dense
|
||||||
|
style="min-width: 200px"
|
||||||
|
v-for="(item, index) in listMenu"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<q-item
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="
|
||||||
|
item.type === 'VIEWDETIAL'
|
||||||
|
? onClickViewDetail()
|
||||||
|
: null
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<q-item-section avatar>
|
||||||
|
<q-icon
|
||||||
|
:color="item.color"
|
||||||
|
:name="item.icon"
|
||||||
|
/>
|
||||||
|
</q-item-section>
|
||||||
|
<q-item-section>{{
|
||||||
|
item.label
|
||||||
|
}}</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</q-list>
|
||||||
|
</q-menu>
|
||||||
|
</q-btn>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
</d-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<!-- <template v-slot:pagination="scope">
|
<!-- <template v-slot:pagination="scope">
|
||||||
<q-pagination
|
<q-pagination
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue