fix ชื่อ-นามสกุล

This commit is contained in:
AnandaTon 2023-09-19 17:42:17 +07:00
parent 4966b1d2e2
commit 1c57374868
12 changed files with 833 additions and 1082 deletions

View file

@ -10,7 +10,11 @@ import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { requestSendNoti,DataCopyOrder,ResponseOrganiz } from "@/modules/06_retirement/interface/response/Deceased";
import type {
requestSendNoti,
DataCopyOrder,
ResponseOrganiz,
} from "@/modules/06_retirement/interface/response/Deceased";
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const route = useRoute();
@ -26,14 +30,11 @@ const props = defineProps({
});
const profileId = ref<string>(route.params.id.toString());
const next = () => props.next();
const previous = () => props.previous();
const $q = useQuasar();
const mixin = useCounterMixin(); //
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
const myForm = ref<QForm | null>(null);
const filterRef = ref<QInput>();
const filter = ref<string>("");
@ -157,23 +158,22 @@ const editRows = ref<DataCopyOrder[]>([]);
onMounted(async () => {
await getData();
// await getList();
});
const getList = async () => {
showLoader();
await http.get(config.API.detailByidDeceased(profileId.value))
.then((res) => {
const data = res.data.result
console.log(data)
}).catch((e) => {
await http
.get(config.API.detailByidDeceased(profileId.value))
.then((res) => {
const data = res.data.result;
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
}
};
const listModal = async (id: string) => {
showLoader();
await http
@ -203,14 +203,12 @@ const listModal = async (id: string) => {
});
};
const getData = async () => {
showLoader();
await http
.get(config.API.detailByidDeceased(profileId.value))
.then((res) => {
const data = res.data.result;
// console.log(data);
let list: DataCopyOrder[] = [];
data.map((r: any) => {
let selectCopyOrder = [];
@ -222,9 +220,9 @@ const getData = async () => {
}
list.push({
id:r.id,
id: r.id,
personalId: r.profileId ?? "",
name:`${r.prefix}${r.firstName} ${r.lastName}`,
name: `${r.prefix}${r.firstName} ${r.lastName}`,
idCard: r.citizenId ?? "",
position: r.positionName ?? "",
unit: r.organizationName ?? "-",
@ -252,22 +250,22 @@ const getData = async () => {
};
const saveData = async () => {
showLoader();
const persons = selectedModal.value.map(item => ({ profileId: item.profileId }));
const dataToSend = { Persons: persons };
await http
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
.then((res) => {
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
clickClose();
getData();
hideLoader();
});
showLoader();
const persons = selectedModal.value.map((item) => ({
profileId: item.profileId,
}));
const dataToSend = { Persons: persons };
await http
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
.then((res) => {})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
clickClose();
getData();
hideLoader();
});
};
const resetFilter = () => {
@ -299,11 +297,7 @@ const clickAdd = async () => {
};
const clickDelete = (id: string) => {
console.log(id)
dialogRemove(
$q,
() => deleteData(id),
);
dialogRemove($q, () => deleteData(id));
};
const nodeTree = async () => {
@ -339,7 +333,6 @@ const deleteData = async (id: string) => {
messageError($q, e);
})
.finally(async () => {
// hideLoader();
await getData();
});
};
@ -367,7 +360,7 @@ const fetchSaveCopyOrder = async () => {
showLoader();
await http
.put(config.API.notiDeceased(profileId.value), {Persons:list})
.put(config.API.notiDeceased(profileId.value), { Persons: list })
.then((res: any) => {
success($q, "บันทึกข้อมูลสำเร็จ");
next();
@ -377,7 +370,7 @@ const fetchSaveCopyOrder = async () => {
})
.finally(() => {
hideLoader();
getData()
getData();
});
};
@ -387,7 +380,7 @@ const updateData = (row: DataCopyOrder) => {
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
<div class="toptitle text-dark col-12 row items-center">
<q-btn
icon="mdi-arrow-left"
unelevated
@ -510,7 +503,6 @@ const updateData = (row: DataCopyOrder) => {
</q-select>
</q-td>
<q-td auto-width>
<q-btn
dense
size="12px"
@ -537,7 +529,7 @@ const updateData = (row: DataCopyOrder) => {
color="public"
@click="saveDataCopyOrder"
class="q-px-md"
>
>
</q-btn>
</div>
</div>
@ -625,7 +617,6 @@ const updateData = (row: DataCopyOrder) => {
:filter="filterModal"
row-key="profileId"
selection="multiple"
v-model:selected="selectedModal"
>
<template v-slot:header-selection="scope">