fix fetch ช้อมูลรายการออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-18 16:43:51 +07:00
parent 5fb8c24263
commit f1c056fc8d
31 changed files with 69 additions and 32 deletions

View file

@ -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<boolean>("modal", { required: true });
const props = defineProps({
fetchData: {
type: Function,
default: () => {
console.warn("fetchData function is not ");
},
},
});
const examId = route.params.examId;
const rows = ref<FormMainProbation[]>([]);
@ -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) {
@ -298,7 +300,6 @@ watch(
borderless
outlined
dense
v-model="filter"
placeholder="ค้นหา"
style="width: 200px; max-width: auto"
@ -427,5 +428,6 @@ watch(
v-model:modal="modalCommand"
:command-type-code="commandType"
:persons="selected ? dataMapToSend : []"
:fetch-data="props.fetchData"
/>
</template>

View file

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

View file

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