("rows", { required: true });
@@ -111,9 +116,60 @@ function onClickMovePos() {
}
}
+/**
+ * function fetch ข้อรายการตำแหน่ง
+ * @param id idTree
+ * @param level levelTree
+ */
+async function fetchDataTable(id: string, level: number, action: boolean) {
+ // orgLevel.value = level;
+ // reqMaster.id = id;
+ // reqMaster.type = level;
+ // action1.value = action;
+ // if (action) {
+ // setTimeout(() => {
+ // action1.value = false;
+ // }, 1000);
+ // reqMaster.isAll = false;
+ // reqMaster.page = 1;
+ // reqMaster.pageSize = 10;
+ // reqMaster.keyword = "";
+ // }
+ // if (action === true) {
+ // isLoad.value = true;
+ // }
+ // await http
+ // .post(config.API.orgPosMasterList, reqMaster)
+ // .then((res) => {
+ // posMaster.value = [];
+ // const dataMain: PosMaster[] = [];
+ // totalPage.value = Math.ceil(res.data.result.total / reqMaster.pageSize);
+ // res.data.result.data.forEach((e: PosMaster) => {
+ // const p = e.positions;
+ // if (p.length !== 0) {
+ // const a = p.find((el: Position) => el.positionIsSelected === true);
+ // const { id, ...rest } = a ? a : p[0];
+ // const test = { ...e, ...rest };
+ // dataMain.push(test);
+ // }
+ // });
+ // posMaster.value = store.fetchPosMaster(dataMain);
+ // })
+ // .catch((err) => {
+ // messageError($q, err);
+ // posMaster.value = [];
+ // })
+ // .finally(() => {
+ // setTimeout(() => {
+ // isLoad.value = false;
+ // }, 500);
+ // });
+}
+
watch(
() => modal.value,
() => {
+ reqMaster.value.page = 1;
if (modal.value && props.type === "SINGER") {
const data = rows.value.filter((e: PosMaster2) => e.id === props.rowId);
selectedFilter.value = data;
@@ -181,7 +237,11 @@ watch(
:props="props"
>
- {{ props.rowIndex + 1 }}
+ {{
+ (reqMaster.page - 1) * Number(reqMaster.pageSize) +
+ props.rowIndex +
+ 1
+ }}
@@ -190,6 +250,17 @@ watch(
+
+
+
diff --git a/src/modules/02_organizationalNew/components/listView.vue b/src/modules/02_organizationalNew/components/listView.vue
index 1c551d81f..2ff6a8217 100644
--- a/src/modules/02_organizationalNew/components/listView.vue
+++ b/src/modules/02_organizationalNew/components/listView.vue
@@ -159,11 +159,20 @@ watch(
);
/** callblck function ทำการ fetch ข้อมูล Table เมื่อมีการเปลี่ยนหน้า*/
+watch([() => reqMaster.page, () => reqMaster.pageSize], () => {
+ action1.value === false &&
+ fetchDataTable(reqMaster.id, reqMaster.type, false);
+});
+
+/** callblck function ทำการ fetch ข้อมูล Table เมื่อแสดงตำแหน่งทั้งหมด*/
watch(
- [() => reqMaster.page, () => reqMaster.pageSize, () => reqMaster.isAll],
+ () => reqMaster.isAll,
() => {
- action1.value === false &&
+ if (reqMaster.page !== 1) {
+ reqMaster.page = 1;
+ } else {
fetchDataTable(reqMaster.id, reqMaster.type, false);
+ }
}
);
diff --git a/src/modules/02_organizationalNew/components/tableTree.vue b/src/modules/02_organizationalNew/components/tableTree.vue
index a07497da4..4df6c0097 100644
--- a/src/modules/02_organizationalNew/components/tableTree.vue
+++ b/src/modules/02_organizationalNew/components/tableTree.vue
@@ -22,6 +22,8 @@ import DialogSort from "@/modules/02_organizationalNew/components/DialogSortPosi
import DialogMovePos from "@/modules/02_organizationalNew/components/DialogMovePos.vue";
import DialogHistoryPos from "@/modules/02_organizationalNew/components/DialogHistoryPos.vue";
import DialogSelectPerson from "@/modules/02_organizationalNew/components/DialogSelectPerson.vue";
+import DialogInherit from "@/modules/02_organizationalNew/components/DialogInherit.vue";
+
/** importStore*/
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
import { useCounterMixin } from "@/stores/mixin";
@@ -78,6 +80,12 @@ const listMenu = ref([
type: "MOVE",
color: "positive",
},
+ {
+ label: "สืบทอดตำแหน่ง",
+ icon: "mdi-account-multiple-outline",
+ type: "INHERIT",
+ color: "deep-orange",
+ },
{
label: "ประวัติตำแหน่ง",
icon: "history",
@@ -356,6 +364,12 @@ function removePerson(id: string) {
);
}
+const modalDialogInherit = ref(false);
+function onClickInherit(id: string) {
+ modalDialogInherit.value = !modalDialogInherit.value;
+ rowId.value = id;
+}
+
/** ดึงข้อมูลสถิติจำนวนด้านบน*/
function getSummary() {
showLoader();
@@ -655,6 +669,8 @@ async function genReportDoc(data: any) {
? onClickMovePos(props.row.id, 'SINGER')
: item.type === 'HISTORY'
? onClickHistoryPos(props.row.id)
+ : item.type === 'INHERIT'
+ ? onClickInherit(props.row.id)
: null
"
>
@@ -790,6 +806,8 @@ async function genReportDoc(data: any) {
v-model:nodeTree="nodeTree"
v-model:columns="columns as QTableProps[]"
v-model:rows="posMaster"
+ v-model:totalPage="totalPage"
+ v-model:reqMaster="reqMaster"
:fetchDataTree="props.fetchDataTree"
:type="typeMove"
:rowId="rowId"
@@ -798,12 +816,16 @@ async function genReportDoc(data: any) {
+
+
+
+