รักษาการในตำแหน่ง => API
This commit is contained in:
parent
50d4d8e351
commit
8850003836
5 changed files with 452 additions and 453 deletions
|
|
@ -4,6 +4,8 @@ const organization = `${env.API_URI}/org`;
|
|||
const orgPos = `${env.API_URI}/org/pos`;
|
||||
const orgProfile = `${env.API_URI}/org/profile`;
|
||||
const orgEmployeePos = `${env.API_URI}/org/employee/pos`;
|
||||
const orgAct = `${env.API_URI}/org/act`;
|
||||
const orgPosAct = `${env.API_URI}/org/pos/act`;
|
||||
|
||||
export default {
|
||||
keycloakPosition: () => `${organization}/profile/keycloak/position`,
|
||||
|
|
@ -100,4 +102,8 @@ export default {
|
|||
changePositionByIdProfile: `${organization}/placement/change-position/profile`,
|
||||
|
||||
orgProfileReport: `${orgProfile}-employee/report`,
|
||||
|
||||
/** รักษาการตำแหน่ง*/
|
||||
orgAct,
|
||||
orgPosAct,
|
||||
};
|
||||
|
|
|
|||
10
src/modules/17_acting/interface/index/Main.ts
Normal file
10
src/modules/17_acting/interface/index/Main.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
interface Pagination {
|
||||
rowsPerPage: number;
|
||||
}
|
||||
|
||||
interface DataOption {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type { Pagination, DataOption };
|
||||
1
src/modules/17_acting/interface/request/Main.ts
Normal file
1
src/modules/17_acting/interface/request/Main.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export type {};
|
||||
35
src/modules/17_acting/interface/response/Main.ts
Normal file
35
src/modules/17_acting/interface/response/Main.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
interface DataTree {
|
||||
labelName: string;
|
||||
orgCode: string;
|
||||
orgLevel: 0;
|
||||
orgName: string;
|
||||
orgRootName: string;
|
||||
orgTreeCode: string;
|
||||
orgTreeId: string;
|
||||
orgTreeName: string;
|
||||
orgTreeShortName: string;
|
||||
children: DataTree[];
|
||||
posMaster: PosMaster[];
|
||||
}
|
||||
|
||||
interface PosMaster {
|
||||
fullNameCurrentHolder: string;
|
||||
orgLevel: number;
|
||||
orgTreeId: string;
|
||||
posmasterId: string;
|
||||
}
|
||||
|
||||
interface ListPerson {
|
||||
citizenId: string;
|
||||
firstName: string;
|
||||
id: string;
|
||||
lastName: string;
|
||||
posLevel: string;
|
||||
posNo: string;
|
||||
posType: string;
|
||||
position: string;
|
||||
prefix: string;
|
||||
posMasterOrder?: string;
|
||||
}
|
||||
|
||||
export type { DataTree, PosMaster, ListPerson };
|
||||
|
|
@ -6,26 +6,25 @@ import config from "@/app.config";
|
|||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
DataTree,
|
||||
PosMaster,
|
||||
ListPerson,
|
||||
} from "@/modules/17_acting/interface/response/Main";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
success,
|
||||
} = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, dialogRemove } =
|
||||
useCounterMixin();
|
||||
|
||||
/** โครงสร้าง*/
|
||||
const expanded = ref<Array<string>>([]);
|
||||
const filter = ref<string>("");
|
||||
const nodeTree = ref<any[]>([]);
|
||||
const nodeId = ref<string>("");
|
||||
const nodeTree = ref<DataTree[]>([]);
|
||||
const posmasterId = ref<string>("");
|
||||
|
||||
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบัน*/
|
||||
function fetchOrganizationActive() {
|
||||
|
|
@ -51,23 +50,10 @@ function fetchOrganizationActive() {
|
|||
function fetchOrganization(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgAct + `/${id}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodeTree.value = data.map((e: any) => ({
|
||||
...e,
|
||||
owner: [
|
||||
{
|
||||
name: "นางอัจฉรา ศรีปริวาทิน",
|
||||
pos: "หัวหน้า",
|
||||
},
|
||||
{
|
||||
name: "นางศรีปริวาทิน",
|
||||
pos: "รองหัวหน้า",
|
||||
},
|
||||
],
|
||||
}));
|
||||
console.log(nodeTree.value);
|
||||
nodeTree.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -77,133 +63,20 @@ function fetchOrganization(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function updateSelected(data: any) {
|
||||
nodeId.value = data;
|
||||
async function updateSelected(data: PosMaster) {
|
||||
posmasterId.value = data.posmasterId;
|
||||
await Promise.all([fetchPosMaster(), fetchListAct()]);
|
||||
}
|
||||
|
||||
/** ตำแหน่ง*/
|
||||
const rowPosition = ref<any[]>([
|
||||
{
|
||||
id: "1",
|
||||
posMasterNo: "สกก.1",
|
||||
positionName: "นักบริหาร",
|
||||
posTypeName: "บริหาร",
|
||||
posLevelName: "สูง",
|
||||
positionIsSelected: "นางอัจฉรา ศรีปริวาทิน",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
posMasterNo: "สกก.1",
|
||||
positionName: "นักบริหาร",
|
||||
posTypeName: "บริหาร",
|
||||
posLevelName: "สูง",
|
||||
positionIsSelected: "นางศรีปริวาทิน",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
posMasterNo: "สกก.1",
|
||||
positionName: "นักบริหาร",
|
||||
posTypeName: "บริหาร",
|
||||
posLevelName: "สูง",
|
||||
positionIsSelected: "นางอัจฉรา ศรีปริวาทิน",
|
||||
},
|
||||
]);
|
||||
const columnsPosition = ref<QTableProps["columns"]>([
|
||||
const rowPosition = ref<ListPerson[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: (row) => rowPosition.value.indexOf(row) + 1,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posMasterNo",
|
||||
align: "left",
|
||||
label: "เลขที่ตำแหน่ง",
|
||||
sortable: false,
|
||||
field: "posMasterNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
field: "positionName",
|
||||
sortable: false,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posTypeName",
|
||||
align: "left",
|
||||
label: "ประเภทตำแหน่ง",
|
||||
sortable: false,
|
||||
field: "posTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posLevelName",
|
||||
align: "left",
|
||||
label: "ระดับตำแหน่ง",
|
||||
sortable: false,
|
||||
field: "posLevelName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionIsSelected",
|
||||
align: "left",
|
||||
label: "คนครอง",
|
||||
sortable: false,
|
||||
field: "positionIsSelected",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
const reqMaster = reactive({
|
||||
isAll: false,
|
||||
keyword: "",
|
||||
});
|
||||
|
||||
function selectPosition(data: any) {
|
||||
const test = rowPosition.value.filter((e) => e.id !== data.id);
|
||||
rowListPerson.value.push(data);
|
||||
rowPosition.value = test;
|
||||
}
|
||||
|
||||
/** รายชื่อคนรักษาการ*/
|
||||
const rowListPerson = ref<any[]>([
|
||||
{
|
||||
id: "1",
|
||||
citizenId: "1101700019241",
|
||||
name: "เรือตรีพนัส บิณศิรวานิช",
|
||||
posMasterNo: "สพข.54",
|
||||
positionName: "นายแพทย์",
|
||||
posTypeName: "ทั่วไป",
|
||||
posLevelName: "สูง",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
citizenId: "1101700019241",
|
||||
name: "เรือตรีพนัส บิณศิรวานิช",
|
||||
posMasterNo: "สพข.54",
|
||||
positionName: "นายแพทย์",
|
||||
posTypeName: "ทั่วไป",
|
||||
posLevelName: "สูง",
|
||||
},
|
||||
]);
|
||||
const columnsPerson = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: (row) => rowListPerson.value.indexOf(row) + 1,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -220,60 +93,145 @@ const columnsPerson = ref<QTableProps["columns"]>([
|
|||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
field: "name",
|
||||
field(row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
},
|
||||
sortable: false,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posMasterNo",
|
||||
name: "posNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: false,
|
||||
field: "posMasterNo",
|
||||
field: "posNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionName",
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: false,
|
||||
field: "positionName",
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posTypeName",
|
||||
name: "posType",
|
||||
align: "left",
|
||||
label: "ตำแหน่งประเภท",
|
||||
sortable: false,
|
||||
field: "posTypeName",
|
||||
field: "posType",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "posLevelName",
|
||||
name: "posLevel",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: false,
|
||||
field: "posLevelName",
|
||||
field: "posLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const keyword = ref<string>("");
|
||||
|
||||
function onSwapPerson(type: string, id: string) {}
|
||||
|
||||
function onDelete(id: string) {
|
||||
dialogRemove($q, () => {
|
||||
const test = rowListPerson.value.filter((e: any) => e.id !== id);
|
||||
rowListPerson.value = test;
|
||||
});
|
||||
/** function fetch รายชื่อ*/
|
||||
function fetchPosMaster() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgPosAct + `/search`, { posmasterId: posmasterId.value })
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowPosition.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {});
|
||||
/**
|
||||
* function เลือกราชชื่อรักษาการ
|
||||
* @param data ข้อมูลรายชื่อ
|
||||
*/
|
||||
function selectPosition(data: ListPerson) {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.orgPosAct, {
|
||||
posMasterId: posmasterId.value,
|
||||
posMasterChildId: data.id,
|
||||
})
|
||||
.then(async () => {
|
||||
await Promise.all([fetchPosMaster(), fetchListAct()]);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** รายชื่อคนรักษาการ*/
|
||||
const rowListPerson = ref<ListPerson[]>([]);
|
||||
const keywordAct = ref<string>("");
|
||||
|
||||
/** function fetch รายชื่อรักษาการ */
|
||||
function fetchListAct() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgPosAct + `/${posmasterId.value}`)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowListPerson.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* funcion เลือกลำดับรายชื่อรักษาการ
|
||||
* @param type up,down
|
||||
* @param id รายชื่อรักษาการ
|
||||
*/
|
||||
function onSwapPerson(type: string, id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgPosAct + `/swap/${type}/${id}`)
|
||||
.then(() => {
|
||||
fetchListAct();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function ลบรายชื่อรักษาการ
|
||||
* @param id ชื่อรักษาการ
|
||||
*/
|
||||
function onDelete(id: string) {
|
||||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
http
|
||||
.delete(config.API.orgPosAct + `/${id}`)
|
||||
.then(async () => {
|
||||
await Promise.all([fetchPosMaster(), fetchListAct()]);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -286,99 +244,96 @@ onMounted(() => {
|
|||
รักษาการในตำแหน่ง
|
||||
</div>
|
||||
<q-card style="height: 100%">
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div>
|
||||
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="bg-white tree-container q-pa-xs">
|
||||
<q-tree
|
||||
class="q-pa-sm q-gutter-sm"
|
||||
dense
|
||||
:nodes="nodeTree"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
:filter="filter"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
v-model:expanded="expanded"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
clickable
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div>
|
||||
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="bg-white tree-container q-pa-xs">
|
||||
<q-tree
|
||||
class="q-pa-sm q-gutter-sm"
|
||||
dense
|
||||
:nodes="nodeTree"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
:filter="filter"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
v-model:expanded="expanded"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
clickable
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
<template v-slot:default-body="prop">
|
||||
<div v-if="prop.node.owner">
|
||||
<q-list dense v-for="col in prop.node.owner">
|
||||
<q-item
|
||||
clickable
|
||||
:active="nodeId == col.name"
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
@click.stop="updateSelected(col.name)"
|
||||
>
|
||||
<q-item-section>
|
||||
{{ col.name }} {{ col.pos }}</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<div></div>
|
||||
</div>
|
||||
</template>
|
||||
</q-tree>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
<template v-slot:default-body="prop">
|
||||
<div v-if="prop.node.posMaster">
|
||||
<q-list dense v-for="col in prop.node.posMaster">
|
||||
<q-item
|
||||
clickable
|
||||
:active="posmasterId == col.posmasterId"
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
@click.stop="updateSelected(col)"
|
||||
>
|
||||
<q-item-section>
|
||||
{{ col.fullNameCurrentHolder }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<div></div>
|
||||
</div>
|
||||
</template>
|
||||
</q-tree>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section
|
||||
v-if="nodeId"
|
||||
class="col-lg-9 col-md-8 col-xs-12 scroll"
|
||||
style="height: 80vh"
|
||||
>
|
||||
<div class="column q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card bordered style="height: 100%; border: 1px solid #d6dee1">
|
||||
<div
|
||||
class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
|
||||
>
|
||||
รายชื่อ
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-space />
|
||||
<div class="row q-gutter-md">
|
||||
<div>
|
||||
<!-- <q-checkbox
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section
|
||||
v-if="posmasterId"
|
||||
class="col-lg-9 col-md-8 col-xs-12 scroll"
|
||||
style="height: 80vh"
|
||||
>
|
||||
<div class="column q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card bordered style="height: 100%; border: 1px solid #d6dee1">
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
รายชื่อ
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-space />
|
||||
<div class="row q-gutter-md">
|
||||
<div>
|
||||
<!-- <q-checkbox
|
||||
keep-color
|
||||
v-model="reqMaster.isAll"
|
||||
label="แสดงตำแหน่งทั้งหมด"
|
||||
|
|
@ -388,62 +343,61 @@ onMounted(() => {
|
|||
>แสดงตำแหน่งทั้งหมดภายใต้หน่วยงาน/ส่วนราชการที่เลือก</q-tooltip
|
||||
>
|
||||
</q-checkbox> -->
|
||||
</div>
|
||||
<div>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
v-model="reqMaster.keyword"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
</div>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columnsPosition"
|
||||
:rows="rowPosition"
|
||||
:paging="true"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<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-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"
|
||||
@click="selectPosition(props.row)"
|
||||
>
|
||||
<div>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<div>
|
||||
<q-input outlined dense v-model="keyword" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
</div>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rowPosition"
|
||||
:paging="true"
|
||||
:filter="keyword"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<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-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"
|
||||
@click="selectPosition(props.row)"
|
||||
>
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="reqMaster.page"
|
||||
active-color="primary"
|
||||
|
|
@ -455,156 +409,149 @@ onMounted(() => {
|
|||
direction-links
|
||||
></q-pagination>
|
||||
</template> -->
|
||||
</d-table>
|
||||
</div>
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col">
|
||||
<q-card bordered style="height: 100%; border: 1px solid #d6dee1">
|
||||
<div
|
||||
class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
|
||||
>
|
||||
รายชื่อรักษาการ
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-space />
|
||||
<div class="row q-gutter-md">
|
||||
<div>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
v-model="reqMaster.keyword"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
</div>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columnsPerson"
|
||||
:rows="rowListPerson"
|
||||
:paging="true"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width v-if="rowListPerson.length !== 1" />
|
||||
<q-th auto-width v-if="rowListPerson.length !== 1" />
|
||||
<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-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width v-if="rowListPerson.length !== 1">
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="
|
||||
props.rowIndex + 1 == 1 ? 'grey' : 'green'
|
||||
"
|
||||
:disable="props.rowIndex + 1 == 1"
|
||||
icon="mdi-arrow-up-bold"
|
||||
@click="onSwapPerson('up', props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับขึ้น</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width v-if="rowListPerson.length !== 1">
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="
|
||||
rowListPerson.length == props.rowIndex + 1
|
||||
? 'grey'
|
||||
: 'red'
|
||||
"
|
||||
:disable="
|
||||
rowListPerson.length == props.rowIndex + 1
|
||||
"
|
||||
icon="mdi-arrow-down-bold"
|
||||
@click="onSwapPerson('down', props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<div>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
icon="delete"
|
||||
@click="onDelete(props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="reqMaster.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="totalPage"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template> -->
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<div class="col">
|
||||
<q-card bordered style="height: 100%; border: 1px solid #d6dee1">
|
||||
<div class="col-12 text-weight-medium bg-grey-1 q-py-sm q-px-md">
|
||||
รายชื่อรักษาการ
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-space />
|
||||
<div class="row q-gutter-md">
|
||||
<div>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
v-model="keywordAct"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
</div>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="rowListPerson"
|
||||
:paging="true"
|
||||
:filter="keywordAct"
|
||||
row-key="id"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width v-if="rowListPerson.length !== 1" />
|
||||
<q-th auto-width v-if="rowListPerson.length !== 1" />
|
||||
<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-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width v-if="rowListPerson.length !== 1">
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="props.rowIndex + 1 == 1 ? 'grey' : 'green'"
|
||||
:disable="props.rowIndex + 1 == 1"
|
||||
icon="mdi-arrow-up-bold"
|
||||
@click="onSwapPerson('up', props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับขึ้น</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width v-if="rowListPerson.length !== 1">
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
:color="
|
||||
rowListPerson.length == props.rowIndex + 1
|
||||
? 'grey'
|
||||
: 'red'
|
||||
"
|
||||
:disable="
|
||||
rowListPerson.length == props.rowIndex + 1
|
||||
"
|
||||
icon="mdi-arrow-down-bold"
|
||||
@click="onSwapPerson('down', props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<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 ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
icon="delete"
|
||||
@click="onDelete(props.row.id)"
|
||||
>
|
||||
<!-- <q-tooltip>เลื่อนลำดับลง</q-tooltip> -->
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="reqMaster.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="totalPage"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template> -->
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<!-- <q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions> -->
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue