ปรับโครงสร้างอัตรากำลัง
This commit is contained in:
parent
4e7ea67e01
commit
833ab217e6
4 changed files with 184 additions and 147 deletions
|
|
@ -43,81 +43,81 @@ const formData = reactive<FormDetailPosition>({
|
|||
status: "", //*สถานะตำแหน่ง
|
||||
});
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
field: "positionName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionField",
|
||||
align: "left",
|
||||
label: "สายงาน",
|
||||
sortable: true,
|
||||
field: "positionField",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posTypeName",
|
||||
align: "left",
|
||||
label: "ประเภทตำเเหน่ง",
|
||||
sortable: true,
|
||||
field: "posTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posLevelName",
|
||||
align: "left",
|
||||
label: "ระดับตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "posLevelName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posExecutiveName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งทางการบริหาร",
|
||||
sortable: true,
|
||||
field: "posExecutiveName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionExecutiveField",
|
||||
align: "left",
|
||||
label: "ด้านทางการบริหาร",
|
||||
sortable: true,
|
||||
field: "positionExecutiveField",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionArea",
|
||||
align: "left",
|
||||
label: "ด้าน/สาขา",
|
||||
sortable: true,
|
||||
field: "positionArea",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const row = ref<Position[]>([]);
|
||||
// const columns = ref<QTableProps["columns"]>([
|
||||
// {
|
||||
// name: "no",
|
||||
// align: "left",
|
||||
// label: "ลำดับ",
|
||||
// sortable: false,
|
||||
// field: "no",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "positionName",
|
||||
// align: "left",
|
||||
// label: "ตำแหน่งในสายงาน",
|
||||
// sortable: true,
|
||||
// field: "positionName",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "positionField",
|
||||
// align: "left",
|
||||
// label: "สายงาน",
|
||||
// sortable: true,
|
||||
// field: "positionField",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "posTypeName",
|
||||
// align: "left",
|
||||
// label: "ประเภทตำเเหน่ง",
|
||||
// sortable: true,
|
||||
// field: "posTypeName",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "posLevelName",
|
||||
// align: "left",
|
||||
// label: "ระดับตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "posLevelName",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "posExecutiveName",
|
||||
// align: "left",
|
||||
// label: "ตำแหน่งทางการบริหาร",
|
||||
// sortable: true,
|
||||
// field: "posExecutiveName",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "positionExecutiveField",
|
||||
// align: "left",
|
||||
// label: "ด้านทางการบริหาร",
|
||||
// sortable: true,
|
||||
// field: "positionExecutiveField",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// {
|
||||
// name: "positionArea",
|
||||
// align: "left",
|
||||
// label: "ด้าน/สาขา",
|
||||
// sortable: true,
|
||||
// field: "positionArea",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
// ]);
|
||||
// const row = ref<Position[]>([]);
|
||||
|
||||
/** function ปิด popup*/
|
||||
function close() {
|
||||
|
|
@ -137,18 +137,26 @@ watch(
|
|||
: store.typeOrganizational === "draft"
|
||||
? "แบบร่าง"
|
||||
: "ยุบเลิก";
|
||||
row.value = prosp.dataDetailPos.positions.map((e: Position) => ({
|
||||
...e,
|
||||
positionName: e.positionName ? e.positionName : "-",
|
||||
positionField: e.positionField ? e.positionField : "-",
|
||||
posTypeName: e.posTypeName ? e.posTypeName : "-",
|
||||
posLevelName: e.posLevelName ? e.posLevelName : "-",
|
||||
posExecutiveName: e.posExecutiveName ? e.posExecutiveName : "-",
|
||||
positionExecutiveField: e.positionExecutiveField
|
||||
? e.positionExecutiveField
|
||||
: "-",
|
||||
positionArea: e.positionArea ? e.positionArea : "-",
|
||||
}));
|
||||
formData.positionType = prosp.dataDetailPos.posTypeName
|
||||
formData.positionPathSide = prosp.dataDetailPos.positionName
|
||||
formData.positionLine = prosp.dataDetailPos.positionField
|
||||
formData.positionSide = prosp.dataDetailPos.positionArea ? prosp.dataDetailPos.positionArea : "-"
|
||||
formData.positionLevel = prosp.dataDetailPos.posLevelName
|
||||
formData.positionExecutive = prosp.dataDetailPos.posExecutiveName ? prosp.dataDetailPos.posExecutiveName : "-"
|
||||
formData.positionExecutiveSide = prosp.dataDetailPos.positionExecutiveField ? prosp.dataDetailPos.positionExecutiveField : "-"
|
||||
|
||||
// row.value = prosp.dataDetailPos.positions.map((e: Position) => ({
|
||||
// ...e,
|
||||
// positionName: e.positionName ? e.positionName : "-",
|
||||
// positionField: e.positionField ? e.positionField : "-",
|
||||
// posTypeName: e.posTypeName ? e.posTypeName : "-",
|
||||
// posLevelName: e.posLevelName ? e.posLevelName : "-",
|
||||
// posExecutiveName: e.posExecutiveName ? e.posExecutiveName : "-",
|
||||
// positionExecutiveField: e.positionExecutiveField
|
||||
// ? e.positionExecutiveField
|
||||
// : "-",
|
||||
// positionArea: e.positionArea ? e.positionArea : "-",
|
||||
// }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -172,7 +180,6 @@ watch(
|
|||
<p>{{ formData.positionNo }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
|
|
@ -182,9 +189,9 @@ watch(
|
|||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionType }}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ตำแหน่งในสายงาน</p>
|
||||
|
|
@ -193,9 +200,9 @@ watch(
|
|||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionPathSide }}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>สายงาน</p>
|
||||
|
|
@ -204,9 +211,9 @@ watch(
|
|||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionLine }}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ด้าน/สาขา</p>
|
||||
|
|
@ -215,9 +222,9 @@ watch(
|
|||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionSide }}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ระดับตำแหน่ง</p>
|
||||
|
|
@ -226,9 +233,9 @@ watch(
|
|||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionLevel }}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ตำแหน่งทางการบริหาร</p>
|
||||
|
|
@ -237,9 +244,9 @@ watch(
|
|||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionExecutive }}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
<div>
|
||||
<p>ด้านทางการบริหาร</p>
|
||||
|
|
@ -248,7 +255,7 @@ watch(
|
|||
<div class="col-8 text-grey-8">
|
||||
<p>{{ formData.positionExecutiveSide }}</p>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-4 text-bold">
|
||||
|
|
@ -261,7 +268,7 @@ watch(
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm q-mb-xs">
|
||||
<!-- <div class="row q-col-gutter-sm q-mb-xs">
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
flat
|
||||
|
|
@ -302,7 +309,7 @@ watch(
|
|||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -124,6 +124,32 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
|
|||
});
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
|
||||
function getSummary() {
|
||||
http
|
||||
.post(config.API.orgSummary, {
|
||||
id: reqMaster.id, //*Id node
|
||||
type: reqMaster.type, //*ประเภทnode
|
||||
isNode: reqMaster.isAll, //*นับทั้ง node ไหม
|
||||
})
|
||||
.then(async (res: any) => {
|
||||
const data = await res.data.result;
|
||||
|
||||
store.getSumPosition({
|
||||
totalPosition: data.totalPosition,
|
||||
totalPositionCurrentUse: data.totalPositionCurrentUse,
|
||||
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
|
||||
totalPositionNextUse: data.totalPositionNextUse,
|
||||
totalPositionNextVacant: data.totalPositionNextVacant,
|
||||
totalRootPosition: data.totalPosition,
|
||||
totalRootPositionCurrentUse: data.totalPositionCurrentUse,
|
||||
totalRootPositionCurrentVacant: data.totalPositionCurrentVacant,
|
||||
totalRootPositionNextUse: data.totalPositionNextUse,
|
||||
totalRootPositionNextVacant: data.totalPositionNextVacant,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** funcion ค้นหาข้อมูลใน Table*/
|
||||
async function filterKeyword() {
|
||||
reqMaster.page = 1;
|
||||
|
|
@ -171,6 +197,7 @@ watch([() => reqMaster.page, () => reqMaster.pageSize], () => {
|
|||
watch(
|
||||
() => reqMaster.isAll,
|
||||
() => {
|
||||
getSummary();
|
||||
if (reqMaster.page !== 1) {
|
||||
reqMaster.page = 1;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -96,39 +96,39 @@ const orgId = ref<string>("");
|
|||
* @param data ข่อมูล Tree
|
||||
*/
|
||||
function updateSelected(data: DataTree) {
|
||||
store.treeId = data.orgTreeId;
|
||||
store.level = data.orgLevel;
|
||||
// if (data.orgTreeId === nodeId.value) {
|
||||
// nodeId.value = "";
|
||||
// } else {
|
||||
nodeId.value = data.orgTreeId ? data.orgTreeId : "111";
|
||||
if (!store.treeId || store.treeId != data.orgTreeId) {
|
||||
store.treeId = data.orgTreeId;
|
||||
store.level = data.orgLevel;
|
||||
|
||||
data.orgTreeId && props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
|
||||
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
|
||||
http
|
||||
.post(config.API.orgSummary, {
|
||||
id: data.orgTreeId, //*Id node
|
||||
type: data.orgLevel, //*ประเภทnode
|
||||
isNode: false, //*นับทั้ง node ไหม
|
||||
})
|
||||
.then(async (res: any) => {
|
||||
const data = await res.data.result;
|
||||
if (data) {
|
||||
store.getSumPosition({
|
||||
totalPosition: data.totalPosition,
|
||||
totalPositionCurrentUse: data.totalPositionCurrentUse,
|
||||
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
|
||||
totalPositionNextUse: data.totalPositionNextUse,
|
||||
totalPositionNextVacant: data.totalPositionNextVacant,
|
||||
totalRootPosition: data.totalPosition,
|
||||
totalRootPositionCurrentUse: data.totalPositionCurrentUse,
|
||||
totalRootPositionCurrentVacant: data.totalPositionCurrentVacant,
|
||||
totalRootPositionNextUse: data.totalPositionNextUse,
|
||||
totalRootPositionNextVacant: data.totalPositionNextVacant,
|
||||
});
|
||||
}
|
||||
});
|
||||
// }
|
||||
nodeId.value = data.orgTreeId ? data.orgTreeId : "111";
|
||||
|
||||
data.orgTreeId &&
|
||||
props.fetchDataTable?.(data.orgTreeId, data.orgLevel, true);
|
||||
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
|
||||
http
|
||||
.post(config.API.orgSummary, {
|
||||
id: data.orgTreeId, //*Id node
|
||||
type: data.orgLevel, //*ประเภทnode
|
||||
isNode: false, //*นับทั้ง node ไหม
|
||||
})
|
||||
.then(async (res: any) => {
|
||||
const data = await res.data.result;
|
||||
if (data) {
|
||||
store.getSumPosition({
|
||||
totalPosition: data.totalPosition,
|
||||
totalPositionCurrentUse: data.totalPositionCurrentUse,
|
||||
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
|
||||
totalPositionNextUse: data.totalPositionNextUse,
|
||||
totalPositionNextVacant: data.totalPositionNextVacant,
|
||||
totalRootPosition: data.totalPosition,
|
||||
totalRootPositionCurrentUse: data.totalPositionCurrentUse,
|
||||
totalRootPositionCurrentVacant: data.totalPositionCurrentVacant,
|
||||
totalRootPositionNextUse: data.totalPositionNextUse,
|
||||
totalRootPositionNextVacant: data.totalPositionNextVacant,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const breakLoop = ref<boolean>(false);
|
||||
|
|
|
|||
|
|
@ -89,12 +89,6 @@ const listMenu = ref<ListMenu[]>([
|
|||
type: "HISTORY",
|
||||
color: "deep-purple",
|
||||
},
|
||||
{
|
||||
label: "ดูรายละเอียด",
|
||||
icon: "mdi-eye",
|
||||
type: "VIEWDETIAL",
|
||||
color: "blue",
|
||||
},
|
||||
]);
|
||||
const document = ref<any>([
|
||||
{
|
||||
|
|
@ -612,16 +606,12 @@ async function onClickDownloadReport(val: string) {
|
|||
<q-item
|
||||
v-for="(item, index) in store.typeOrganizational === 'draft'
|
||||
? listMenu
|
||||
: listMenu.filter(
|
||||
(e) => e.type === 'HISTORY' || e.type === 'VIEWDETIAL'
|
||||
)"
|
||||
: listMenu.filter((e) => e.type === 'HISTORY')"
|
||||
:key="index"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
item.type === 'VIEWDETIAL'
|
||||
? onClickViewDetail(props.row)
|
||||
: item.type === 'EDIT'
|
||||
item.type === 'EDIT'
|
||||
? onClickPosition('EDIT', props.row.id)
|
||||
: item.type === 'DEL'
|
||||
? onClickDelete(props.row.id)
|
||||
|
|
@ -645,6 +635,19 @@ async function onClickDownloadReport(val: string) {
|
|||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="props.row.positionIsSelected != 'ว่าง'"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="onClickViewDetail(props.row)"
|
||||
>
|
||||
<q-item-section>
|
||||
<div class="row items-center">
|
||||
<q-icon color="blue" size="17px" name="mdi-eye" />
|
||||
<div class="q-pl-md">ดูรายละเอียด</div>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue