Merge branch 'develop' of github.com:Frappet/hrms-mgt into develop

This commit is contained in:
Warunee Tamkoo 2025-07-18 16:57:45 +07:00
commit 0ff2b91d24
31 changed files with 69 additions and 31 deletions

View file

@ -490,5 +490,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -534,5 +534,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -334,5 +334,6 @@ function onSearch() {
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-15'" :command-type-code="'C-PM-15'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.getData"
/> />
</template> </template>

View file

@ -422,5 +422,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fecthlistOthet"
/> />
</template> </template>

View file

@ -484,5 +484,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -832,13 +832,13 @@ async function getWorkFlow() {
"positionCandidate", "positionCandidate",
]; ];
} }
hideLoader();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
hideLoader();
}) })
.finally(() => {}); .finally(() => {
hideLoader();
});
} }
function onclickViewinfo(id: string) { function onclickViewinfo(id: string) {
@ -1716,7 +1716,11 @@ onMounted(async () => {
</q-card> </q-card>
</q-dialog> </q-dialog>
<DialogOrders v-model:modal="modalOrder" :rows="rowsOrder" /> <DialogOrders
v-model:modal="modalOrder"
:rows="rowsOrder"
:fetch-data="getTable"
/>
<PopupPersonal <PopupPersonal
:modal="modalPersonal" :modal="modalPersonal"
:id="personalId" :id="personalId"

View file

@ -398,5 +398,6 @@ watchEffect(() => {
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-14'" :command-type-code="'C-PM-14'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fecthlistRecevice"
/> />
</template> </template>

View file

@ -16,8 +16,7 @@ import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCom
const $q = useQuasar(); const $q = useQuasar();
const { statusText } = useTransferDataStore(); const { statusText } = useTransferDataStore();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { dialogConfirm, findPosMasterNoOld, date2Thai, onSearchDataTable } = const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
mixin;
/** props*/ /** props*/
const props = defineProps({ const props = defineProps({
@ -298,5 +297,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-16'" :command-type-code="'C-PM-16'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.getData"
/> />
</template> </template>

View file

@ -292,5 +292,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
command-type-code="C-PM-13" command-type-code="C-PM-13"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -3,8 +3,6 @@ import { ref, watch, computed } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import avatar from "@/assets/avatar_user.jpg";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -15,11 +13,7 @@ import { useTransferDataStore } from "@/modules/05_placement/store";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer"; import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
import type { ListCommand } from "@/modules/18_command/interface/index/Main"; import type { ListCommand } from "@/modules/18_command/interface/index/Main";
import type { import type { FormMainProbation } from "@/modules/05_placement/interface/request/Main";
FormMainProbation,
FormMainProbation2,
OpfillterType,
} from "@/modules/05_placement/interface/request/Main";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.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 { dialogConfirm, dateText, showLoader, hideLoader, messageError } = mixin;
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const props = defineProps({
fetchData: {
type: Function,
default: () => {
console.warn("fetchData function is not ");
},
},
});
const examId = route.params.examId; const examId = route.params.examId;
const rows = ref<FormMainProbation[]>([]); const rows = ref<FormMainProbation[]>([]);
@ -212,13 +214,13 @@ async function getList() {
rows.value = data; rows.value = data;
totalList.value = Math.ceil(resTotal / pagination.value.rowsPerPage); totalList.value = Math.ceil(resTotal / pagination.value.rowsPerPage);
total.value = resTotal; total.value = resTotal;
hideLoader();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
hideLoader();
}) })
.finally(() => {}); .finally(() => {
hideLoader();
});
} }
function updatePagination(newPagination: any) { function updatePagination(newPagination: any) {
@ -426,5 +428,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="selected ? dataMapToSend : []" :persons="selected ? dataMapToSend : []"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -261,5 +261,6 @@ watchEffect(() => {
:command-type-code="'C-PM-10'" :command-type-code="'C-PM-10'"
:persons="selected ? dataMapToSend : []" :persons="selected ? dataMapToSend : []"
:not-person="false" :not-person="false"
:fetch-data="props.getData"
/> />
</template> </template>

View file

@ -866,5 +866,5 @@ onMounted(() => {
</q-card> </q-card>
</q-dialog> </q-dialog>
<DialogOrder v-model:modal="modalCommand" /> <DialogOrder v-model:modal="modalCommand" :fetch-data="fetchProbationPersonalList" />
</template> </template>

View file

@ -150,6 +150,7 @@ async function fetchData() {
const data = await res.data.result; const data = await res.data.result;
rows.value = data; rows.value = data;
dataTransfer.value = data; dataTransfer.value = data;
onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -230,6 +230,7 @@ async function fecthlistRecevice() {
rows.value = data; rows.value = data;
rowsData.value = data; rowsData.value = data;
filters.value = data; filters.value = data;
onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -187,6 +187,7 @@ async function getData() {
const data = await res.data.result; const data = await res.data.result;
rows.value = data; rows.value = data;
rowsData.value = data; rowsData.value = data;
await onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -249,7 +250,7 @@ function closeModal() {
filterKeyword2.value = ""; filterKeyword2.value = "";
} }
function onSearch() { async function onSearch() {
rows.value = onSearchDataTable( rows.value = onSearchDataTable(
filterKeyword.value, filterKeyword.value,
rowsData.value, rowsData.value,

View file

@ -31,7 +31,7 @@ const {
hideLoader, hideLoader,
success, success,
dialogRemove, dialogRemove,
findPosMasterNoOld,
onSearchDataTable, onSearchDataTable,
} = useCounterMixin(); } = useCounterMixin();
@ -166,6 +166,7 @@ async function getData() {
const data = await res.data.result; const data = await res.data.result;
rows.value = data; rows.value = data;
rowsData.value = data; rowsData.value = data;
onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -247,7 +247,7 @@ async function fecthlistappointment() {
showLoader(); showLoader();
await http await http
.get(config.API.appointmentMain() + `?status=${status.value}`) .get(config.API.appointmentMain() + `?status=${status.value}`)
.then((res) => { .then(async (res) => {
let response = res.data.result; let response = res.data.result;
listRecevice.value = response; listRecevice.value = response;
rows.value = response; rows.value = response;
@ -267,6 +267,7 @@ async function fecthlistappointment() {
); );
rows2.value = listData; rows2.value = listData;
rows2Data.value = listData; rows2Data.value = listData;
await onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -367,7 +368,7 @@ function clickClose() {
modal.value = false; modal.value = false;
} }
function onSearch() { async function onSearch() {
rows.value = onSearchDataTable( rows.value = onSearchDataTable(
filterKeyword.value, filterKeyword.value,
rowsData.value, rowsData.value,

View file

@ -256,6 +256,7 @@ async function fecthlistappointment() {
); );
rows2.value = listData; rows2.value = listData;
rows2Data.value = listData; rows2Data.value = listData;
await onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -356,7 +357,7 @@ async function onSave(data: FormDataAppoint) {
}); });
} }
function onSearch() { async function onSearch() {
rows.value = onSearchDataTable( rows.value = onSearchDataTable(
filterKeyword.value, filterKeyword.value,
rowsData.value, rowsData.value,

View file

@ -181,7 +181,7 @@ async function fecthlistOthet() {
showLoader(); showLoader();
await http await http
.get(config.API.otherMain() + `?status=${status.value}`) .get(config.API.otherMain() + `?status=${status.value}`)
.then((res) => { .then(async (res) => {
let response = res.data.result; let response = res.data.result;
rows.value = response; rows.value = response;
rowsData.value = response; rowsData.value = response;
@ -199,6 +199,7 @@ async function fecthlistOthet() {
); );
rows2.value = listData; rows2.value = listData;
rows2Data.value = listData; rows2Data.value = listData;
await onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -312,7 +313,7 @@ function nextPage(id: string) {
}); });
} }
function onSearch() { async function onSearch() {
rows.value = onSearchDataTable( rows.value = onSearchDataTable(
filterKeyword.value, filterKeyword.value,
rowsData.value, rowsData.value,

View file

@ -334,5 +334,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="props.mainTabs === '1' ? 'C-PM-17' : 'C-PM-41'" :command-type-code="props.mainTabs === '1' ? 'C-PM-17' : 'C-PM-41'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fecthList"
/> />
</template> </template>

View file

@ -219,8 +219,9 @@ async function fecthlist() {
.get(pathAPI) .get(pathAPI)
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
rows.value = data;
rowsData.value = data; rowsData.value = data;
rows.value = data;
onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -309,5 +309,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="props.mainTabs === '1' ? 'C-PM-23' : 'C-PM-42'" :command-type-code="props.mainTabs === '1' ? 'C-PM-23' : 'C-PM-42'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fecth-list="props.fecthList"
/> />
</template> </template>

View file

@ -215,6 +215,7 @@ async function fecthlist() {
const data = await res.data.result; const data = await res.data.result;
rows.value = data; rows.value = data;
rowsData.value = data; rowsData.value = data;
onSearch();
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -3,8 +3,6 @@ import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store"; import { useTransferDataStore } from "@/modules/05_placement/store";
@ -297,5 +295,6 @@ watchEffect(() => {
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-18'" :command-type-code="'C-PM-18'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fecthlistRecevice"
/> />
</template> </template>

View file

@ -3,8 +3,6 @@ import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store"; import { useTransferDataStore } from "@/modules/05_placement/store";
@ -297,5 +295,6 @@ watchEffect(() => {
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-43'" :command-type-code="'C-PM-43'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fecthlistRecevice"
/> />
</template> </template>

View file

@ -354,6 +354,7 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-21'" :command-type-code="'C-PM-21'"
:persons="dataMapToSend" :persons="dataMapToSend"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -322,5 +322,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="selected ? dataMapToSend : []" :persons="selected ? dataMapToSend : []"
:fetch-data="props.getData"
/> />
</template> </template>

View file

@ -46,6 +46,7 @@ const filterKeyword = ref<string>("");
/** props*/ /** props*/
const props = defineProps<{ const props = defineProps<{
rows: dataType[]; rows: dataType[];
fetchData: Function;
}>(); }>();
/** คอลัมน์ */ /** คอลัมน์ */
@ -324,5 +325,6 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="commandType" :command-type-code="commandType"
:persons="selected ? dataMapToSend : []" :persons="selected ? dataMapToSend : []"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -494,6 +494,10 @@ onMounted(async () => {
</div> </div>
</q-card> </q-card>
<DialogSendToCommand v-model:modal="modal" :rows="rows2" /> <DialogSendToCommand
v-model:modal="modal"
:rows="rows2"
:fetch-data="getList"
/>
</template> </template>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View file

@ -243,6 +243,7 @@ watch(
v-model:modal="modalCommand" v-model:modal="modalCommand"
:command-type-code="'C-PM-32'" :command-type-code="'C-PM-32'"
:persons="selected ? dataMapToSend : []" :persons="selected ? dataMapToSend : []"
:fetch-data="props.fetchData"
/> />
</template> </template>

View file

@ -35,6 +35,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
fetchData: {
type: Function,
default: () => {},
},
}); });
const commandOp = ref<ListCommand[]>([]); // const commandOp = ref<ListCommand[]>([]); //
@ -208,6 +212,7 @@ function createCommand(isRedirect: boolean) {
router.push(`/command/edit/${id}`); router.push(`/command/edit/${id}`);
} else { } else {
clearValue(); clearValue();
await props.fetchData(); // fetchData props
} }
}) })
.catch((e) => { .catch((e) => {
@ -253,7 +258,7 @@ function addPersonalToCommand(isRedirect: boolean) {
router.push(`/command/edit/${id}`); router.push(`/command/edit/${id}`);
} else { } else {
modal.value = false; modal.value = false;
clearValue(); await props.fetchData(); // fetchData props
} }
}) })
.catch((e) => { .catch((e) => {