เพิ่ม interface ให้ any
This commit is contained in:
parent
7d3c48142c
commit
77ccaec4e3
18 changed files with 259 additions and 73 deletions
|
|
@ -5,6 +5,7 @@ import { useRoute, useRouter } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import type { ResponseTitle } from "@/modules/05_placement/interface/response/Receive";
|
||||
import type { appointmentData,ResponseData } from "@/modules/05_placement/interface/response/AppointMent";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -14,7 +15,12 @@ const route = useRoute();
|
|||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const appointment = ref<any>([]);
|
||||
const appointment = ref<appointmentData>({
|
||||
citizenId:"",
|
||||
prefixId:"",
|
||||
firstname:"",
|
||||
lastname:""
|
||||
});
|
||||
const myform = ref<any>();
|
||||
const edit = ref<boolean>(false);
|
||||
const profileId = ref<string>("");
|
||||
|
|
@ -52,7 +58,7 @@ const fecthappointmentByid = async () => {
|
|||
showLoader();
|
||||
await http
|
||||
.get(config.API.appointmentByid(paramsId.toString()))
|
||||
.then((res: any) => {
|
||||
.then((res: ResponseData) => {
|
||||
const data = res.data.result;
|
||||
appointment.value = data;
|
||||
profileId.value = data.profileId;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { ref, computed,watchEffect } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { UserData } from "@/modules/05_placement/interface/response/AppointMent";
|
||||
|
||||
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -12,7 +13,7 @@ const { showLoader, success, messageError, dialogConfirm,hideLoader } = mixin;
|
|||
|
||||
const $q = useQuasar();
|
||||
import DialogHeader from "@/modules/05_placement/components/AppointMent/DialogHeader.vue";
|
||||
const selected = ref([]);
|
||||
const selected = ref<UserData[]>([]);
|
||||
const checkSelected = computed(() => {
|
||||
if (selected.value.length === 0 || props.type === "") {
|
||||
return true;
|
||||
|
|
@ -98,7 +99,7 @@ const updateInput = (value: any) => {
|
|||
emit("update:filterKeyword2", value);
|
||||
};
|
||||
|
||||
const updateInputType = (value: any) => {
|
||||
const updateInputType = (value: string) => {
|
||||
emit("update:type", value);
|
||||
};
|
||||
//รีเซ็ตค่าในช่องค้นหา
|
||||
|
|
@ -115,7 +116,7 @@ const clickAddlist = () => {
|
|||
const createdAppoint = async () => {
|
||||
let pId: string[] = [];
|
||||
let Type = props.type as string
|
||||
selected.value.forEach((e: any) => {
|
||||
selected.value.forEach((e: UserData) => {
|
||||
pId.push(e.personalId);
|
||||
});
|
||||
let data = {
|
||||
|
|
@ -124,10 +125,10 @@ const createdAppoint = async () => {
|
|||
showLoader();
|
||||
await http
|
||||
.put(config.API.apppointmentReport(Type), data)
|
||||
.then((res: any) => {
|
||||
.then((res) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e: any) => {
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
@ -145,7 +146,7 @@ watchEffect(() => {
|
|||
});
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader title="ส่งไปออกคำสั่ง" :close="clickClose" />
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const router = useRouter();
|
|||
const rows = ref<listAppointType[]>([]);
|
||||
const rows2 = ref<listAppointType[]>([]);
|
||||
const modalTree = ref<boolean>(false);
|
||||
const personal = ref<any[]>([]);
|
||||
const personal = ref<resData[]>([]);
|
||||
const personalId = ref<string>("");
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
|
|
@ -235,9 +235,9 @@ const closeModalTree = async () => {
|
|||
};
|
||||
|
||||
// ไปหน้ารายละเอียด
|
||||
const nextPage = (row: any) => {
|
||||
const nextPage = (id: string) => {
|
||||
router.push({
|
||||
path: `appoint-promote/detail/${row.personalId}`,
|
||||
path: `appoint-promote/detail/${id}`,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -286,16 +286,16 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props" @click="nextPage(props.row)">
|
||||
<q-td key="no" :props="props" @click="nextPage(props.row.personalId)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="citizenId" :props="props" @click="nextPage(props.row)">
|
||||
<q-td key="citizenId" :props="props" @click="nextPage(props.row.personalId)">
|
||||
{{ props.row.citizenId }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="nextPage(props.row)">
|
||||
<q-td key="fullname" :props="props" @click="nextPage(props.row.personalId)">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="organizationName" :props="props" @click="nextPage(props.row)">
|
||||
<q-td key="organizationName" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<div v-if="props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
">
|
||||
|
|
@ -316,13 +316,13 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="birthday" :props="props" @click="nextPage(props.row)">
|
||||
<q-td key="birthday" :props="props" @click="nextPage(props.row.personalId)">
|
||||
{{ props.row.birthday }}
|
||||
</q-td>
|
||||
<q-td key="createdAt" :props="props" @click="nextPage(props.row)">
|
||||
<q-td key="createdAt" :props="props" @click="nextPage(props.row.personalId)">
|
||||
{{ props.row.createdAt }}
|
||||
</q-td>
|
||||
<q-td key="status" :props="props" @click="nextPage(props.row)">
|
||||
<q-td key="status" :props="props" @click="nextPage(props.row.personalId)">
|
||||
{{ props.row.status }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue