แก้ fetch data ทะเบียน

This commit is contained in:
Kittapath 2023-07-11 10:16:51 +07:00
parent e4f153b654
commit dc05b4740c
18 changed files with 158 additions and 125 deletions

View file

@ -366,7 +366,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขผลก
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -319,7 +319,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -381,7 +381,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขวิน
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -162,7 +162,9 @@ const $q = useQuasar(); // show dialog
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const route = useRoute(); const route = useRoute();
const { success, messageError } = mixin; const { success, messageError } = mixin;
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const edit = ref<boolean>(false); const edit = ref<boolean>(false);
const uploader = ref<any>(); const uploader = ref<any>();
const files = ref<any>([]); const files = ref<any>([]);

View file

@ -655,7 +655,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขประ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -606,6 +606,7 @@ const getNewData = async () => {
}; };
const fetchData = async () => { const fetchData = async () => {
if (route.params.id) {
loaderPage(true); loaderPage(true);
await http await http
.get(config.API.profileAdrsId(route.params.id.toString())) .get(config.API.profileAdrsId(route.params.id.toString()))
@ -627,6 +628,7 @@ const fetchData = async () => {
.finally(() => { .finally(() => {
loaderPage(false); loaderPage(false);
}); });
}
}; };
const editData = async () => { const editData = async () => {

View file

@ -316,7 +316,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขใบอ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -1299,6 +1299,7 @@ const fetchHistory = async () => {
}; };
const fetchData = async () => { const fetchData = async () => {
if (route.params.id) {
loaderPage(true); loaderPage(true);
await http await http
.get(config.API.profileFamiId(route.params.id.toString())) .get(config.API.profileFamiId(route.params.id.toString()))
@ -1354,6 +1355,7 @@ const fetchData = async () => {
.finally(async () => { .finally(async () => {
loaderPage(false); loaderPage(false);
}); });
}
}; };
const editData = async () => { const editData = async () => {

View file

@ -962,6 +962,7 @@ const calRetire = async (birth: Date) => {
}; };
const fetchData = async () => { const fetchData = async () => {
if (route.params.id) {
loaderPage(true); loaderPage(true);
await http await http
.get(config.API.profileInforId(route.params.id.toString())) .get(config.API.profileInforId(route.params.id.toString()))
@ -988,7 +989,10 @@ const fetchData = async () => {
dateBefore.value = new Date(data.birthDate); dateBefore.value = new Date(data.birthDate);
same.value = data.changeName == true ? "1" : "0"; same.value = data.changeName == true ? "1" : "0";
await calRetire(new Date(dateToISO(new Date(data.birthDate)))); await calRetire(new Date(dateToISO(new Date(data.birthDate))));
if (data.profileType == "officer" && columnsHistory.value.length >= 15) { if (
data.profileType == "officer" &&
columnsHistory.value.length >= 15
) {
columnsHistory.value.splice(13, 1); columnsHistory.value.splice(13, 1);
columnsHistory.value.splice(12, 1); columnsHistory.value.splice(12, 1);
} }
@ -1000,6 +1004,7 @@ const fetchData = async () => {
// loaderPage(false); // loaderPage(false);
await props.fetchDataProfile(); await props.fetchDataProfile();
}); });
}
}; };
const editData = async () => { const editData = async () => {

View file

@ -527,7 +527,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขเคร
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -444,7 +444,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขการ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filterTotal = ref<string>(""); const filterTotal = ref<string>("");
const rowsTotal = ref<RequestItemsTotalObject[]>([]); //select data history const rowsTotal = ref<RequestItemsTotalObject[]>([]); //select data history

View file

@ -213,7 +213,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขอื่
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -909,7 +909,7 @@ const tittleHistory = ref<string>("ประวัติแก้ไขตำแ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id ? route.params.id.toString() : "");
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -918,7 +918,7 @@ const tittleHistory = ref<string>("ประวัติแก้ไขตำแ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id ? route.params.id.toString() : "");
const rows = ref<ResponseObjectEmployee[]>([]); const rows = ref<ResponseObjectEmployee[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -941,7 +941,7 @@ const tittleHistory = ref<string>("ประวัติแก้ไขตำแ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id ? route.params.id.toString() : "");
const rows = ref<ResponseObjectEmployee[]>([]); const rows = ref<ResponseObjectEmployee[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -213,7 +213,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขควา
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -459,7 +459,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขการ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);

View file

@ -356,7 +356,9 @@ const tittleHistory = ref<string>("ประวัติแก้ไขปฏิ
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const rows = ref<RequestItemsObject[]>([]); const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]); const visibleColumns = ref<String[]>([]);