แก้ฟิวตำแหน่ง
This commit is contained in:
parent
9b2bc64958
commit
5a0bf37501
2 changed files with 170 additions and 145 deletions
|
|
@ -3,20 +3,30 @@ import { ref, onMounted } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store"
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { listMain,listMainAPI } from "@/modules/05_placement/interface/response/OhterMain"
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main"
|
||||
import type {
|
||||
listMain,
|
||||
listMainAPI,
|
||||
} from "@/modules/05_placement/interface/response/OhterMain";
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import Dialogbody from "@/modules/05_placement/components/Other/Dialogbody.vue"
|
||||
import Dialogbody from "@/modules/05_placement/components/Other/Dialogbody.vue";
|
||||
|
||||
const storeFn = useTransferDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const { statusText } = storeFn
|
||||
const { showLoader, hideLoader, success, messageError, date2Thai, dialogRemove } = mixin;
|
||||
const { statusText } = storeFn;
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
date2Thai,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
|
@ -36,7 +46,15 @@ const pagination = ref({
|
|||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const visibleColumns = ref<string[]>([ "no", "fullname", "position", "positionLevel", "organizationPositionOld", "createdAt", "statustext"]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
"positionPath",
|
||||
"positionLevel",
|
||||
"organizationPositionOld",
|
||||
"createdAt",
|
||||
"statustext",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -57,11 +75,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
name: "positionPath",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
field: "positionPath",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -121,6 +139,7 @@ const fecthlistOthet = async () => {
|
|||
organizationPositionOld: r.organizationPositionOld ?? "-",
|
||||
posNo: r.posNo ?? "-",
|
||||
position: r.position ?? "-",
|
||||
positionPath: r.positionPath ?? "-",
|
||||
positionLevel: r.positionLevel ?? "-",
|
||||
positionLevelOld: r.positionLevelOld ?? "-",
|
||||
positionNumberOld: r.positionNumberOld ?? "-",
|
||||
|
|
@ -133,8 +152,7 @@ const fecthlistOthet = async () => {
|
|||
fullname: `${r.prefix ?? ""}${r.firstname ?? ""} ${r.lastname ?? ""}`,
|
||||
}));
|
||||
rows2.value = rows.value.filter(
|
||||
(e: listMain) =>
|
||||
e.status !== "REPORT" && e.status !== "DONE"
|
||||
(e: listMain) => e.status !== "REPORT" && e.status !== "DONE"
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -152,7 +170,8 @@ const fecthTypeOption = async () => {
|
|||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
optionsType.value = res.data.result.filter(
|
||||
(e: OpType) => e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09"
|
||||
(e: OpType) =>
|
||||
e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09"
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -179,7 +198,6 @@ const deleteOther = async (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
//----(รีเซ็ตข้อมูลในช่อง input)------//
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
|
|
@ -187,7 +205,6 @@ const resetFilter = () => {
|
|||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
|
||||
//----(เปิด Dialog)------//
|
||||
const popup = () => {
|
||||
modal.value = true;
|
||||
|
|
@ -222,39 +239,52 @@ onMounted(() => {
|
|||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<div class="row col-12">
|
||||
<q-btn @click="popup()" size="14px" flat round color="add" icon="mdi-account-arrow-right">
|
||||
<q-btn
|
||||
@click="popup()"
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งรายการอื่นๆ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter"/>
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
|
|
@ -286,8 +316,8 @@ onMounted(() => {
|
|||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="position" :props="props">
|
||||
{{ props.row.position }}
|
||||
<q-td key="positionPath" :props="props">
|
||||
{{ props.row.positionPath }}
|
||||
</q-td>
|
||||
<q-td key="positionLevel" :props="props">
|
||||
{{ props.row.positionLevel }}
|
||||
|
|
@ -331,14 +361,14 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<Dialogbody
|
||||
v-model:Modal="modal"
|
||||
:clickClose="clickClose"
|
||||
:optionsType="optionsType"
|
||||
:rows2="rows2"
|
||||
v-model:filterKeyword2="filterKeyword2"
|
||||
v-model:type="type"
|
||||
:fecthlistOthet="fecthlistOthet"
|
||||
/>
|
||||
<Dialogbody
|
||||
v-model:Modal="modal"
|
||||
:clickClose="clickClose"
|
||||
:optionsType="optionsType"
|
||||
:rows2="rows2"
|
||||
v-model:filterKeyword2="filterKeyword2"
|
||||
v-model:type="type"
|
||||
:fecthlistOthet="fecthlistOthet"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -1,104 +1,99 @@
|
|||
// ข้อมูลที่เก็บ
|
||||
interface listMain {
|
||||
personalId:string
|
||||
fullname:string
|
||||
prefix:string
|
||||
firstName:string
|
||||
lastName:string
|
||||
date:Date
|
||||
isActive:boolean
|
||||
organization:string
|
||||
organizationPositionOld:string
|
||||
posNo:string
|
||||
position:string
|
||||
positionLevel:string
|
||||
positionLevelOld:string
|
||||
positionNumberOld:string
|
||||
positionTypeOld:string
|
||||
reason:string
|
||||
salary:number
|
||||
status:string
|
||||
statustext:string
|
||||
createdAt:Date
|
||||
personalId: string;
|
||||
fullname: string;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
date: Date;
|
||||
isActive: boolean;
|
||||
organization: string;
|
||||
organizationPositionOld: string;
|
||||
posNo: string;
|
||||
position: string;
|
||||
positionLevel: string;
|
||||
positionLevelOld: string;
|
||||
positionNumberOld: string;
|
||||
positionTypeOld: string;
|
||||
reason: string;
|
||||
salary: number;
|
||||
status: string;
|
||||
statustext: string;
|
||||
createdAt: Date;
|
||||
}
|
||||
//ข้อมูลจาก api
|
||||
interface listMainAPI {
|
||||
id:string
|
||||
firstname:string
|
||||
prefix:string
|
||||
firstName:string
|
||||
lastname:string
|
||||
date:Date
|
||||
isActive:boolean
|
||||
organization:string
|
||||
organizationPositionOld:string
|
||||
posNo:string
|
||||
position:string
|
||||
positionLevel:string
|
||||
positionLevelOld:string
|
||||
positionNumberOld:string
|
||||
positionTypeOld:string
|
||||
reason:string
|
||||
salary:number
|
||||
status:string
|
||||
statustext:string
|
||||
createdAt:Date
|
||||
id: string;
|
||||
firstname: string;
|
||||
prefix: string;
|
||||
firstName: string;
|
||||
lastname: string;
|
||||
date: Date;
|
||||
isActive: boolean;
|
||||
organization: string;
|
||||
organizationPositionOld: string;
|
||||
positionPath: string;
|
||||
posNo: string;
|
||||
position: string;
|
||||
positionLevel: string;
|
||||
positionLevelOld: string;
|
||||
positionNumberOld: string;
|
||||
positionTypeOld: string;
|
||||
reason: string;
|
||||
salary: number;
|
||||
status: string;
|
||||
statustext: string;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
interface OtherdataInterface {
|
||||
citizenId: string;
|
||||
prefixId: string;
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
}
|
||||
citizenId: string;
|
||||
prefixId: string;
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
}
|
||||
|
||||
interface resApiData {
|
||||
data:{
|
||||
result:{
|
||||
id: string
|
||||
profileId: string
|
||||
citizenId: string
|
||||
prefix: string
|
||||
prefixId: string
|
||||
firstname: string
|
||||
lastname: string
|
||||
dateOfBirth: Date
|
||||
gender: string
|
||||
nationality: string
|
||||
race: string
|
||||
religion: string
|
||||
bloodGroup: string
|
||||
relationship: string
|
||||
telephoneNumber: string
|
||||
status: string
|
||||
amount: number
|
||||
recruitDate: Date
|
||||
posNoId: string
|
||||
positionId: string
|
||||
positionPathSideId: string
|
||||
positionTypeId: string
|
||||
positionLineId: string
|
||||
positionLevelId: string
|
||||
organizationPositionId: string
|
||||
createdAt: Date
|
||||
reason: string
|
||||
educationOld: string
|
||||
amountOld: number
|
||||
positionTypeOld: string
|
||||
positionLevelOld: string
|
||||
positionNumberOld: string
|
||||
organizationPositionOld: string
|
||||
positionDate: Date
|
||||
avatar: string
|
||||
commandType: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type {
|
||||
listMain,
|
||||
listMainAPI,
|
||||
OtherdataInterface,
|
||||
resApiData
|
||||
|
||||
}
|
||||
interface resApiData {
|
||||
data: {
|
||||
result: {
|
||||
id: string;
|
||||
profileId: string;
|
||||
citizenId: string;
|
||||
prefix: string;
|
||||
prefixId: string;
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
dateOfBirth: Date;
|
||||
gender: string;
|
||||
nationality: string;
|
||||
race: string;
|
||||
religion: string;
|
||||
bloodGroup: string;
|
||||
relationship: string;
|
||||
telephoneNumber: string;
|
||||
status: string;
|
||||
amount: number;
|
||||
recruitDate: Date;
|
||||
posNoId: string;
|
||||
positionId: string;
|
||||
positionPathSideId: string;
|
||||
positionTypeId: string;
|
||||
positionLineId: string;
|
||||
positionLevelId: string;
|
||||
organizationPositionId: string;
|
||||
createdAt: Date;
|
||||
reason: string;
|
||||
educationOld: string;
|
||||
amountOld: number;
|
||||
positionTypeOld: string;
|
||||
positionLevelOld: string;
|
||||
positionNumberOld: string;
|
||||
organizationPositionOld: string;
|
||||
positionDate: Date;
|
||||
avatar: string;
|
||||
commandType: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export type { listMain, listMainAPI, OtherdataInterface, resApiData };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue