fix table
This commit is contained in:
parent
d5f5c722d3
commit
e3a91f1c71
5 changed files with 13 additions and 10 deletions
|
|
@ -85,7 +85,6 @@ const pagination = ref({
|
|||
|
||||
/**
|
||||
* ปิดปุ่มย้ายตำแหน่ง
|
||||
*
|
||||
* เมื่อไม่ได้เลือกตำแหน่งที่ต้องการย้ายและหน่วยงานที่ต้องการย้ายปุ่มย้ายตำแหน่งจะปืด
|
||||
*/
|
||||
const isDisable = computed(() => {
|
||||
|
|
@ -94,17 +93,13 @@ const isDisable = computed(() => {
|
|||
} else return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* function เลือกข้อมูลหน่วยงาน
|
||||
*/
|
||||
/** function เลือกข้อมูลหน่วยงาน*/
|
||||
function updateSelected(data: DataTree) {
|
||||
levelTree.value = data.orgLevel;
|
||||
selectedTree.value = data.orgTreeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ยืนยันการย้ายแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน
|
||||
*/
|
||||
/** function ยืนยันการย้ายแหน่งจากหน่วยงาน/ส่วนราชการปัจจุบัน*/
|
||||
function onClickMovePos() {
|
||||
if (selectedTree.value === "" || selectedTree.value === null) {
|
||||
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่จะย้ายไป");
|
||||
|
|
@ -156,9 +151,7 @@ function onSearchData() {
|
|||
props.fetchDataTable?.(store.treeId, store.level, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* ดูการเปลี่ยนแปลง modal เมื่อเป็น true
|
||||
*/
|
||||
/** ดูการเปลี่ยนแปลง modal เมื่อเป็น true*/
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ const reqMaster = reactive<FilterMaster>({
|
|||
revisionId: "",
|
||||
});
|
||||
const totalPage = ref<number>(1);
|
||||
const totalData = ref<number>(1);
|
||||
const action1 = ref<boolean>(false);
|
||||
const posMaster = ref<PosMaster2[]>([]);
|
||||
const shortName = ref<string>("");
|
||||
|
|
@ -116,6 +117,7 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
|
|||
.then(async (res) => {
|
||||
const dataMain: PosMaster[] = [];
|
||||
totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
|
||||
totalData.value = res.data.result.total;
|
||||
res.data.result.data.forEach((e: PosMaster) => {
|
||||
const p = e.positions;
|
||||
if (p.length !== 0) {
|
||||
|
|
@ -334,6 +336,7 @@ onMounted(async () => {
|
|||
v-model:req-master="reqMaster"
|
||||
v-model:total-page="totalPage"
|
||||
v-model:org-root-id="orgRootId"
|
||||
v-model:total-data="totalData"
|
||||
:short-name="shortName"
|
||||
:main-tree="mainTree"
|
||||
:fetch-data-table="fetchDataTable"
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ const orgLevel = defineModel<number>("orgLevel", { required: true });
|
|||
const treeId = defineModel<string>("treeId", { required: true });
|
||||
const reqMaster = defineModel<FilterMaster>("reqMaster", { required: true });
|
||||
const totalPage = defineModel<number>("totalPage", { required: true });
|
||||
const totalData = defineModel<number>("totalData", { required: true });
|
||||
const posMaster = defineModel<PosMaster2[]>("posMaster", { required: true });
|
||||
const orgRootId = defineModel<string>("orgRootId", { required: true });
|
||||
const props = defineProps({
|
||||
|
|
@ -887,6 +888,7 @@ watch(
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ totalData }} รายการ
|
||||
<q-pagination
|
||||
v-model="reqMaster.page"
|
||||
active-color="primary"
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ const orgLevel = defineModel<number>("orgLevel", { required: true });
|
|||
const treeId = defineModel<string>("treeId", { required: true });
|
||||
const reqMaster = defineModel<FilterMaster>("reqMaster", { required: true });
|
||||
const totalPage = defineModel<number>("totalPage", { required: true });
|
||||
const totalData = defineModel<number>("totalData", { required: true });
|
||||
const posMaster = defineModel<PosMaster2[]>("posMaster", { required: true });
|
||||
const props = defineProps({
|
||||
filterKeyword: { type: Function, require: true, default: () => {} },
|
||||
|
|
@ -634,6 +635,7 @@ watch(
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
ทั้งหมด {{ totalData }} รายการ
|
||||
<q-pagination
|
||||
v-model="reqMaster.page"
|
||||
active-color="primary"
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ const reqMaster = reactive<FilterMaster>({
|
|||
revisionId: "",
|
||||
});
|
||||
const totalPage = ref<number>(1); //จำนวนหน้า
|
||||
const totalData = ref<number>(1); //จำนวนหน้า
|
||||
const action1 = ref<boolean>(false);
|
||||
const posMaster = ref<PosMaster2[]>([]); //รายการตำแหน่ง
|
||||
const shortName = ref<string>(""); //ชื่อย่อย
|
||||
|
|
@ -100,6 +101,7 @@ function fetchDataTable(id: string, level: number, action: boolean) {
|
|||
.then(async (res) => {
|
||||
const dataMain: PosMaster[] = [];
|
||||
totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
|
||||
totalData.value = res.data.result.total;
|
||||
res.data.result.data.forEach((e: PosMaster) => {
|
||||
const p = e.positions;
|
||||
if (p.length !== 0) {
|
||||
|
|
@ -294,6 +296,7 @@ onMounted(() => {
|
|||
v-model:pos-master="posMaster"
|
||||
v-model:req-master="reqMaster"
|
||||
v-model:total-page="totalPage"
|
||||
v-model:total-data="totalData"
|
||||
:short-name="shortName"
|
||||
:main-tree="mainTree"
|
||||
:fetch-data-table="fetchDataTable"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue