diff --git a/src/modules/05_placement/components/AppointEmployee/DialogOrders.vue b/src/modules/05_placement/components/AppointEmployee/DialogOrders.vue
index 8476898dc..c5e534d98 100644
--- a/src/modules/05_placement/components/AppointEmployee/DialogOrders.vue
+++ b/src/modules/05_placement/components/AppointEmployee/DialogOrders.vue
@@ -490,5 +490,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="dataMapToSend"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/05_placement/components/AppointMent/DialogOrders.vue b/src/modules/05_placement/components/AppointMent/DialogOrders.vue
index f00758ae0..924c5e91e 100644
--- a/src/modules/05_placement/components/AppointMent/DialogOrders.vue
+++ b/src/modules/05_placement/components/AppointMent/DialogOrders.vue
@@ -534,5 +534,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="dataMapToSend"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/05_placement/components/Help-Government/DialogOrders.vue b/src/modules/05_placement/components/Help-Government/DialogOrders.vue
index b6fa35562..647b1c54a 100644
--- a/src/modules/05_placement/components/Help-Government/DialogOrders.vue
+++ b/src/modules/05_placement/components/Help-Government/DialogOrders.vue
@@ -334,5 +334,6 @@ function onSearch() {
v-model:modal="modalCommand"
:command-type-code="'C-PM-15'"
:persons="dataMapToSend"
+ :fetch-data="props.getData"
/>
diff --git a/src/modules/05_placement/components/Other/DialogOrders.vue b/src/modules/05_placement/components/Other/DialogOrders.vue
index 12816b288..6408d94c5 100644
--- a/src/modules/05_placement/components/Other/DialogOrders.vue
+++ b/src/modules/05_placement/components/Other/DialogOrders.vue
@@ -422,5 +422,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="dataMapToSend"
+ :fetch-data="props.fecthlistOthet"
/>
diff --git a/src/modules/05_placement/components/PersonalList/DialogOrders.vue b/src/modules/05_placement/components/PersonalList/DialogOrders.vue
index c0047fe21..85870eef3 100644
--- a/src/modules/05_placement/components/PersonalList/DialogOrders.vue
+++ b/src/modules/05_placement/components/PersonalList/DialogOrders.vue
@@ -484,5 +484,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="dataMapToSend"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue
index dd467f1e0..894e5a789 100644
--- a/src/modules/05_placement/components/PersonalList/Table.vue
+++ b/src/modules/05_placement/components/PersonalList/Table.vue
@@ -832,13 +832,13 @@ async function getWorkFlow() {
"positionCandidate",
];
}
- hideLoader();
})
.catch((e) => {
messageError($q, e);
- hideLoader();
})
- .finally(() => {});
+ .finally(() => {
+ hideLoader();
+ });
}
function onclickViewinfo(id: string) {
@@ -1716,7 +1716,11 @@ onMounted(async () => {
-
+
{
v-model:modal="modalCommand"
:command-type-code="'C-PM-14'"
:persons="dataMapToSend"
+ :fetch-data="props.fecthlistRecevice"
/>
diff --git a/src/modules/05_placement/components/Repatriate/DialogOrders.vue b/src/modules/05_placement/components/Repatriate/DialogOrders.vue
index 2d6983294..61217453e 100644
--- a/src/modules/05_placement/components/Repatriate/DialogOrders.vue
+++ b/src/modules/05_placement/components/Repatriate/DialogOrders.vue
@@ -16,8 +16,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
const $q = useQuasar();
const { statusText } = useTransferDataStore();
const mixin = useCounterMixin();
-const { dialogConfirm, findPosMasterNoOld, date2Thai, onSearchDataTable } =
- mixin;
+const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
/** props*/
const props = defineProps({
@@ -298,5 +297,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="'C-PM-16'"
:persons="dataMapToSend"
+ :fetch-data="props.getData"
/>
diff --git a/src/modules/05_placement/components/Transfer/DialogOrders.vue b/src/modules/05_placement/components/Transfer/DialogOrders.vue
index 7db2f7876..2425304b7 100644
--- a/src/modules/05_placement/components/Transfer/DialogOrders.vue
+++ b/src/modules/05_placement/components/Transfer/DialogOrders.vue
@@ -292,5 +292,6 @@ watch(
v-model:modal="modalCommand"
command-type-code="C-PM-13"
:persons="dataMapToSend"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/05_placement/components/probation/DialogOrder.vue b/src/modules/05_placement/components/probation/DialogOrder.vue
index eb2bc8d15..9557c2659 100644
--- a/src/modules/05_placement/components/probation/DialogOrder.vue
+++ b/src/modules/05_placement/components/probation/DialogOrder.vue
@@ -3,8 +3,6 @@ import { ref, watch, computed } from "vue";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
-import avatar from "@/assets/avatar_user.jpg";
-
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
@@ -15,11 +13,7 @@ import { useTransferDataStore } from "@/modules/05_placement/store";
import type { QTableProps } from "quasar";
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
-import type {
- FormMainProbation,
- FormMainProbation2,
- OpfillterType,
-} from "@/modules/05_placement/interface/request/Main";
+import type { FormMainProbation } from "@/modules/05_placement/interface/request/Main";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
@@ -33,6 +27,14 @@ const storeCommand = useCommandMainStore();
const { dialogConfirm, dateText, showLoader, hideLoader, messageError } = mixin;
const modal = defineModel("modal", { required: true });
+const props = defineProps({
+ fetchData: {
+ type: Function,
+ default: () => {
+ console.warn("fetchData function is not ");
+ },
+ },
+});
const examId = route.params.examId;
const rows = ref([]);
@@ -212,13 +214,13 @@ async function getList() {
rows.value = data;
totalList.value = Math.ceil(resTotal / pagination.value.rowsPerPage);
total.value = resTotal;
- hideLoader();
})
.catch((e) => {
messageError($q, e);
- hideLoader();
})
- .finally(() => {});
+ .finally(() => {
+ hideLoader();
+ });
}
function updatePagination(newPagination: any) {
@@ -426,5 +428,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="selected ? dataMapToSend : []"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue b/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue
index 7eae48805..92184afde 100644
--- a/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue
+++ b/src/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue
@@ -261,5 +261,6 @@ watchEffect(() => {
:command-type-code="'C-PM-10'"
:persons="selected ? dataMapToSend : []"
:not-person="false"
+ :fetch-data="props.getData"
/>
diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue
index d8a3e52c3..3af5063cf 100644
--- a/src/modules/05_placement/components/probation/MainProbation.vue
+++ b/src/modules/05_placement/components/probation/MainProbation.vue
@@ -866,5 +866,5 @@ onMounted(() => {
-
+
diff --git a/src/modules/05_placement/views/02_transferMain.vue b/src/modules/05_placement/views/02_transferMain.vue
index 362da553b..259d0e0f3 100644
--- a/src/modules/05_placement/views/02_transferMain.vue
+++ b/src/modules/05_placement/views/02_transferMain.vue
@@ -150,6 +150,7 @@ async function fetchData() {
const data = await res.data.result;
rows.value = data;
dataTransfer.value = data;
+ onSearch();
})
.catch((e) => {
messageError($q, e);
diff --git a/src/modules/05_placement/views/03_receiveMain.vue b/src/modules/05_placement/views/03_receiveMain.vue
index f6ff6729c..6c1ca08bf 100644
--- a/src/modules/05_placement/views/03_receiveMain.vue
+++ b/src/modules/05_placement/views/03_receiveMain.vue
@@ -230,6 +230,7 @@ async function fecthlistRecevice() {
rows.value = data;
rowsData.value = data;
filters.value = data;
+ onSearch();
})
.catch((e) => {
messageError($q, e);
diff --git a/src/modules/05_placement/views/04_helpGovernmentMain.vue b/src/modules/05_placement/views/04_helpGovernmentMain.vue
index e59bd9e47..ff8f70751 100644
--- a/src/modules/05_placement/views/04_helpGovernmentMain.vue
+++ b/src/modules/05_placement/views/04_helpGovernmentMain.vue
@@ -187,6 +187,7 @@ async function getData() {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
+ await onSearch();
})
.catch((e) => {
messageError($q, e);
@@ -249,7 +250,7 @@ function closeModal() {
filterKeyword2.value = "";
}
-function onSearch() {
+async function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
diff --git a/src/modules/05_placement/views/05_repatriateMain.vue b/src/modules/05_placement/views/05_repatriateMain.vue
index d728066f3..d06584550 100644
--- a/src/modules/05_placement/views/05_repatriateMain.vue
+++ b/src/modules/05_placement/views/05_repatriateMain.vue
@@ -31,7 +31,7 @@ const {
hideLoader,
success,
dialogRemove,
- findPosMasterNoOld,
+
onSearchDataTable,
} = useCounterMixin();
@@ -166,6 +166,7 @@ async function getData() {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
+ onSearch();
})
.catch((e) => {
messageError($q, e);
diff --git a/src/modules/05_placement/views/06_appointPromoteMain.vue b/src/modules/05_placement/views/06_appointPromoteMain.vue
index b65d53f18..e5dbf1df9 100644
--- a/src/modules/05_placement/views/06_appointPromoteMain.vue
+++ b/src/modules/05_placement/views/06_appointPromoteMain.vue
@@ -247,7 +247,7 @@ async function fecthlistappointment() {
showLoader();
await http
.get(config.API.appointmentMain() + `?status=${status.value}`)
- .then((res) => {
+ .then(async (res) => {
let response = res.data.result;
listRecevice.value = response;
rows.value = response;
@@ -267,6 +267,7 @@ async function fecthlistappointment() {
);
rows2.value = listData;
rows2Data.value = listData;
+ await onSearch();
})
.catch((e) => {
messageError($q, e);
@@ -367,7 +368,7 @@ function clickClose() {
modal.value = false;
}
-function onSearch() {
+async function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
diff --git a/src/modules/05_placement/views/07_appointEmployeeMain.vue b/src/modules/05_placement/views/07_appointEmployeeMain.vue
index 3487b2061..58949a1ad 100644
--- a/src/modules/05_placement/views/07_appointEmployeeMain.vue
+++ b/src/modules/05_placement/views/07_appointEmployeeMain.vue
@@ -256,6 +256,7 @@ async function fecthlistappointment() {
);
rows2.value = listData;
rows2Data.value = listData;
+ await onSearch();
})
.catch((e) => {
messageError($q, e);
@@ -356,7 +357,7 @@ async function onSave(data: FormDataAppoint) {
});
}
-function onSearch() {
+async function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
diff --git a/src/modules/05_placement/views/08_otherMain.vue b/src/modules/05_placement/views/08_otherMain.vue
index b3849c42e..68dd96bd2 100644
--- a/src/modules/05_placement/views/08_otherMain.vue
+++ b/src/modules/05_placement/views/08_otherMain.vue
@@ -181,7 +181,7 @@ async function fecthlistOthet() {
showLoader();
await http
.get(config.API.otherMain() + `?status=${status.value}`)
- .then((res) => {
+ .then(async (res) => {
let response = res.data.result;
rows.value = response;
rowsData.value = response;
@@ -199,6 +199,7 @@ async function fecthlistOthet() {
);
rows2.value = listData;
rows2Data.value = listData;
+ await onSearch();
})
.catch((e) => {
messageError($q, e);
@@ -312,7 +313,7 @@ function nextPage(id: string) {
});
}
-function onSearch() {
+async function onSearch() {
rows.value = onSearchDataTable(
filterKeyword.value,
rowsData.value,
diff --git a/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue b/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue
index f34a3242c..29e5d156f 100644
--- a/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue
+++ b/src/modules/06_retirement/components/02_resign/DialogSendToCommand.vue
@@ -334,5 +334,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="props.mainTabs === '1' ? 'C-PM-17' : 'C-PM-41'"
:persons="dataMapToSend"
+ :fetch-data="props.fecthList"
/>
diff --git a/src/modules/06_retirement/components/02_resign/Table.vue b/src/modules/06_retirement/components/02_resign/Table.vue
index 4379ec5c7..f7ce244ae 100644
--- a/src/modules/06_retirement/components/02_resign/Table.vue
+++ b/src/modules/06_retirement/components/02_resign/Table.vue
@@ -219,8 +219,9 @@ async function fecthlist() {
.get(pathAPI)
.then(async (res) => {
const data = await res.data.result;
- rows.value = data;
rowsData.value = data;
+ rows.value = data;
+ onSearch();
})
.catch((e) => {
messageError($q, e);
diff --git a/src/modules/06_retirement/components/03_resignEmp/DialogSendToCommand.vue b/src/modules/06_retirement/components/03_resignEmp/DialogSendToCommand.vue
index 2e32aa74c..1c3e52cef 100644
--- a/src/modules/06_retirement/components/03_resignEmp/DialogSendToCommand.vue
+++ b/src/modules/06_retirement/components/03_resignEmp/DialogSendToCommand.vue
@@ -309,5 +309,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="props.mainTabs === '1' ? 'C-PM-23' : 'C-PM-42'"
:persons="dataMapToSend"
+ :fecth-list="props.fecthList"
/>
diff --git a/src/modules/06_retirement/components/03_resignEmp/Table.vue b/src/modules/06_retirement/components/03_resignEmp/Table.vue
index eb1e17795..0b9c8db2f 100644
--- a/src/modules/06_retirement/components/03_resignEmp/Table.vue
+++ b/src/modules/06_retirement/components/03_resignEmp/Table.vue
@@ -215,6 +215,7 @@ async function fecthlist() {
const data = await res.data.result;
rows.value = data;
rowsData.value = data;
+ onSearch();
})
.catch((e) => {
messageError($q, e);
diff --git a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue
index 4b9f28cc1..385378baa 100644
--- a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue
+++ b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommand.vue
@@ -3,8 +3,6 @@ import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
-import http from "@/plugins/http";
-import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
@@ -297,5 +295,6 @@ watchEffect(() => {
v-model:modal="modalCommand"
:command-type-code="'C-PM-18'"
:persons="dataMapToSend"
+ :fetch-data="props.fecthlistRecevice"
/>
diff --git a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue
index 7929019b2..88e4da47a 100644
--- a/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue
+++ b/src/modules/06_retirement/components/06_dismissOrder/DialogSendToCommandEmp.vue
@@ -3,8 +3,6 @@ import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
-import http from "@/plugins/http";
-import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
@@ -297,5 +295,6 @@ watchEffect(() => {
v-model:modal="modalCommand"
:command-type-code="'C-PM-43'"
:persons="dataMapToSend"
+ :fetch-data="props.fecthlistRecevice"
/>
diff --git a/src/modules/08_registryEmployee/components/DialogSendOrder.vue b/src/modules/08_registryEmployee/components/DialogSendOrder.vue
index aa71abd62..63ec5ecfc 100644
--- a/src/modules/08_registryEmployee/components/DialogSendOrder.vue
+++ b/src/modules/08_registryEmployee/components/DialogSendOrder.vue
@@ -354,6 +354,7 @@ watch(
v-model:modal="modalCommand"
:command-type-code="'C-PM-21'"
:persons="dataMapToSend"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue
index 8428e34b4..18a6c494a 100644
--- a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue
+++ b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue
@@ -322,5 +322,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="selected ? dataMapToSend : []"
+ :fetch-data="props.getData"
/>
diff --git a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
index ef33bc2b1..e2ca9dc4f 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue
@@ -46,6 +46,7 @@ const filterKeyword = ref("");
/** props*/
const props = defineProps<{
rows: dataType[];
+ fetchData: Function;
}>();
/** คอลัมน์ */
@@ -324,5 +325,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="selected ? dataMapToSend : []"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue b/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue
index a4427b18c..bb391a6a0 100644
--- a/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue
+++ b/src/modules/11_discipline/components/7_ListSuspend/ListsPage.vue
@@ -494,6 +494,10 @@ onMounted(async () => {
-
+
diff --git a/src/modules/11_discipline/components/PopupSendToNext.vue b/src/modules/11_discipline/components/PopupSendToNext.vue
index c13067e2a..02e1f5b41 100644
--- a/src/modules/11_discipline/components/PopupSendToNext.vue
+++ b/src/modules/11_discipline/components/PopupSendToNext.vue
@@ -243,6 +243,7 @@ watch(
v-model:modal="modalCommand"
:command-type-code="'C-PM-32'"
:persons="selected ? dataMapToSend : []"
+ :fetch-data="props.fetchData"
/>
diff --git a/src/modules/18_command/components/DialogCreateCommand.vue b/src/modules/18_command/components/DialogCreateCommand.vue
index 822b82858..393a5e2b2 100644
--- a/src/modules/18_command/components/DialogCreateCommand.vue
+++ b/src/modules/18_command/components/DialogCreateCommand.vue
@@ -35,6 +35,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
+ fetchData: {
+ type: Function,
+ default: () => {},
+ },
});
const commandOp = ref([]); // ประเภทคำสั่ง
@@ -208,6 +212,7 @@ function createCommand(isRedirect: boolean) {
router.push(`/command/edit/${id}`);
} else {
clearValue();
+ await props.fetchData(); // เรียกฟังก์ชัน fetchData ที่ส่งมาจาก props เพื่อรีเฟรชข้อมูล
}
})
.catch((e) => {
@@ -253,7 +258,7 @@ function addPersonalToCommand(isRedirect: boolean) {
router.push(`/command/edit/${id}`);
} else {
modal.value = false;
- clearValue();
+ await props.fetchData(); // เรียกฟังก์ชัน fetchData ที่ส่งมาจาก props เพื่อรีเฟรชข้อมูล
}
})
.catch((e) => {