diff --git a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue index d74a64938..99ae2e718 100644 --- a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue +++ b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue @@ -22,7 +22,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; const type = ref(""); -const rows = ref([]) +const rows = ref([]); const $q = useQuasar(); const selected = ref([]); const mixin = useCounterMixin(); @@ -124,9 +124,11 @@ const fecthTypeOption = async () => { .then((res) => { optionsType.value = res.data.result.filter( (e: OpType) => - e.commandCode === "C-PM-26" || + e.commandCode === "C-PM-19" || + e.commandCode === "C-PM-20" || e.commandCode === "C-PM-27" || - e.commandCode === "C-PM-28" + e.commandCode === "C-PM-28" || + e.commandCode === "C-PM-29" ); }) .catch((e) => { @@ -140,9 +142,11 @@ const fecthTypeOption = async () => { watchEffect(() => { if (props.Modal === true) { selected.value = []; - type.value = '' + type.value = ""; // console.log(props.data.status) - rows.value = props.data.persons.filter((item: any) => item.status !== 'REPORT'); + rows.value = props.data.persons.filter( + (item: any) => item.status !== "REPORT" + ); } }); diff --git a/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue b/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue index c2fcc5684..763b7ff32 100644 --- a/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue +++ b/src/modules/11_discipline/components/7_ListSuspend/DetailPage.vue @@ -521,7 +521,6 @@ onMounted(async () => {
{
-import { ref, computed, watch } from "vue"; +import { ref, computed, watch, onMounted } from "vue"; import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import DialogHeader from "@/components/DialogHeader.vue"; import type { QTableProps } from "quasar"; import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main"; +import type { OpType } from "@/modules/05_placement/interface/response/Main"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -14,7 +15,7 @@ import config from "@/app.config"; const $q = useQuasar(); const selected = ref([]); const mixin = useCounterMixin(); -const { success, dialogConfirm } = mixin; +const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin; const emit = defineEmits([ "update:filterKeyword2", "update:selected", @@ -130,20 +131,71 @@ function updateInput(value: any) { function Reset() { emit("update:filterKeyword2", ""); } + +const type = ref(""); +//----(ดึงข้อมูลประเภทคำสั่ง)------// +const optionsType = ref<[]>([]); +const fecthTypeOption = async () => { + showLoader(); + await http + .get(config.API.typeOrder()) + .then((res) => { + optionsType.value = res.data.result.filter( + (e: OpType) => + e.commandCode === "C-PM-25" || e.commandCode === "C-PM-26" + ); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); +}; + // watch([()=>props.modal],() => { // selected.value = props.modal ? [] : []; // if (props.modal === true) { // selected.value = props.rows2; // } // }); +onMounted(() => { + fecthTypeOption(); +}); + - + currentPage.value, () => { rowsPerPage.value = pagination.value.rowsPerPage; - getData() + getData(); } ); @@ -171,7 +171,7 @@ watch( () => { rowsPerPage.value = pagination.value.rowsPerPage; currentPage.value = 1; - getData() + getData(); } ); @@ -201,7 +201,7 @@ watch( /** ไปยังหน้าเพิ่มข้อมูล */ function redirectToPageadd() { - dataStore.rowsAdd = [] + dataStore.rowsAdd = []; router.push(`/discipline-appealcomplain/add`); } @@ -209,7 +209,7 @@ function editPage(id: string) { router.push(`/discipline-appealcomplain/${id}`); } function filterFn() { - getData() + getData(); console.log("enter", filterKeyword.value); } @@ -245,7 +245,7 @@ function getData() { ) .then((res) => { maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value); - fetchAppealComplain(res.data.result.data) + fetchAppealComplain(res.data.result.data); }) .catch((e) => { messageError($q, e); @@ -255,17 +255,20 @@ function getData() { }); } -function dataUpdate(){ - getData() +function dataUpdate() { + getData(); } +function yearAll() { + formData.year = 0; + getData(); +} /** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */ onMounted(async () => { - getData() + getData(); // await getList(); dataStore.visibleColumns = visibleColumns.value; dataStore.columns = columns.value; - }); @@ -310,10 +313,18 @@ onMounted(async () => { dense lazy-rules outlined - :model-value="Number(formData.year) + 543" + :model-value=" + formData.year === 0 ? null : Number(formData.year) + 543 + " :label="`${'ปีงบประมาณ'}`" - > +