new loader

This commit is contained in:
Thanit Konmek 2023-06-09 14:25:41 +07:00
parent fd7aae2f5d
commit fe6c712a18
95 changed files with 1189 additions and 950 deletions

View file

@ -216,7 +216,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const name = ref<string>();
@ -352,7 +353,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAssessmentId(profileId.value))
.then((res) => {
@ -373,7 +374,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -459,7 +460,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileAssessmentId(profileId.value), {
id: id.value,
@ -483,7 +484,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileAssessmentId(id.value), {
id: id.value,
@ -515,7 +516,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAssessmentId(id.value))
.then((res) => {
@ -622,7 +623,7 @@ const clickEditRow = () => {
const clickHistory = async (row: RequestItemsObject) => {
tittleHistory.value = "ประวัติแก้ไขผลการประเมินการปฏิบัติราชการ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileAssessmentHisId(row.id))
.then((res) => {
@ -643,7 +644,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -224,7 +224,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const issuer = ref<string>();
@ -360,7 +361,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileHonorId(profileId.value))
.then((res) => {
@ -381,7 +382,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -467,7 +468,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileHonorId(profileId.value), {
id: id.value,
@ -491,7 +492,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileHonorId(id.value), {
id: id.value,
@ -523,7 +524,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileHonorId(id.value))
.then((res) => {
@ -633,7 +634,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขประกาศลูกจ้างดีเด่น"
: "ประวัติแก้ไขประกาศเกียรติคุณ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileHonorHisId(row.id))
.then((res) => {
@ -654,7 +655,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -293,7 +293,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const level = ref<string>();
@ -545,7 +546,7 @@ const filterSelector = (val: string, update: Function, refData: string) => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileDisId(profileId.value))
.then((res) => {
@ -568,7 +569,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -656,7 +657,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileDisId(profileId.value), {
id: id.value,
@ -682,7 +683,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDisId(id.value), {
id: id.value,
@ -716,7 +717,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileDisId(id.value))
.then((res) => {
@ -826,7 +827,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileDisHisId(row.id))
.then((res) => {
@ -849,7 +850,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -161,7 +161,7 @@ const { loaderPage } = dataStore;
const $q = useQuasar(); // show dialog
const mixin = useCounterMixin();
const route = useRoute();
const { success, messageError } = mixin;
const { success, messageError, showLoader, hideLoader } = mixin;
const profileId = ref<string>(route.params.id.toString());
const edit = ref<boolean>(false);
const uploader = ref<any>();
@ -174,7 +174,7 @@ onMounted(async () => {
});
const getData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profilePaperId(profileId.value))
.then((res) => {
@ -185,12 +185,12 @@ const getData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const deleteData = async (id: string) => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profilePaperId(id))
.then((res) => {
@ -212,7 +212,7 @@ const uploadData = async () => {
});
const formData = new FormData();
formData.append("", newFile);
loaderPage(true);
showLoader();
await http
.post(config.API.profilePaperId(profileId.value), formData)
.then((res) => {

View file

@ -466,7 +466,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { success, dateToISO, date2Thai, messageError } = mixin;
const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const levelId = ref<string>();
@ -896,7 +897,7 @@ onMounted(async () => {
});
const fetchLevel = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.educationLevel)
.then((res) => {
@ -912,12 +913,12 @@ const fetchLevel = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchPositionPath = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
@ -933,7 +934,7 @@ const fetchPositionPath = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -960,7 +961,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileEduId(profileId.value))
.then((res) => {
@ -994,7 +995,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1097,7 +1098,7 @@ const saveData = async () => {
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
// (r: any) => r.id == positionPathId.value
// );
loaderPage(true);
showLoader();
await http
.post(config.API.profileEduId(profileId.value), {
id: id.value,
@ -1139,7 +1140,7 @@ const editData = async () => {
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
// (r: any) => r.id == positionPathId.value
// );
loaderPage(true);
showLoader();
await http
.put(config.API.profileEduId(id.value), {
id: id.value,
@ -1183,7 +1184,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileEduId(id.value))
.then((res) => {
@ -1311,7 +1312,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileEduHisId(row.id))
.then((res) => {
@ -1345,7 +1346,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -323,7 +323,7 @@ const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError } = mixin;
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const edit = ref<boolean>(false);
const addressData = ref<Address>(defaultAddress);
const myform = ref<any>();
@ -561,7 +561,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileAdrsHisId(route.params.id.toString()))
.then((res) => {
@ -589,7 +589,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -610,7 +610,7 @@ const getNewData = async () => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAdrsId(route.params.id.toString()))
.then((res) => {
@ -629,7 +629,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -661,7 +661,7 @@ const editData = async () => {
createdAt: new Date(),
createdFullName: "-",
};
loaderPage(true);
showLoader();
await http
.put(config.API.profileAdrsId(route.params.id.toString()), body)
.then((res) => {
@ -731,7 +731,7 @@ const selectSubDistrict = (e: string | null, name: string) => {
};
const fetchProvince = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.province)
.then((res) => {
@ -747,13 +747,13 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchDistrict = async (id: string | null, position: string) => {
if (id != null) {
loaderPage(true);
showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -774,14 +774,14 @@ const fetchDistrict = async (id: string | null, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchSubDistrict = async (id: string | null, position: string) => {
if (id != null) {
loaderPage(true);
showLoader();
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@ -806,7 +806,7 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};

View file

@ -293,7 +293,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const certificateNo = ref<string>();
@ -484,7 +485,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileCertId(profileId.value))
.then((res) => {
@ -507,7 +508,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -595,7 +596,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileCertId(profileId.value), {
id: id.value,
@ -621,7 +622,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileCertId(id.value), {
id: id.value,
@ -655,7 +656,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileCertId(id.value))
.then((res) => {
@ -769,7 +770,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขใบอนุญาตของลูกจ้าง"
: "ประวัติแก้ไขใบอนุญาตประกอบอาชีพ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileCertHisId(row.id))
.then((res) => {
@ -792,7 +793,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -792,7 +792,7 @@ const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError } = mixin;
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const edit = ref<boolean>(false);
const fix = ref<boolean>(true);
const myform = ref<QForm | null>(null);
@ -857,7 +857,7 @@ const refreshData = async () => {
};
const fetchPrefix = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.prefix)
.then((res) => {
@ -873,7 +873,7 @@ const fetchPrefix = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -901,7 +901,7 @@ const deleteChildren = (items: childrenFamily) => {
const fetchHistory = async () => {
familyDataHistory.value = [];
loaderPage(true);
showLoader();
await http
.get(config.API.profileFamiHisId(route.params.id.toString()))
.then((res) => {
@ -933,7 +933,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
if (familyDataHistory.value.length == 0) {
// modalError(
// $q,
@ -955,7 +955,7 @@ const fetchHistory = async () => {
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileFamiId(route.params.id.toString()))
.then((res) => {
@ -1000,12 +1000,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
const editData = async () => {
loaderPage(true);
showLoader();
const body: ResponseObject = {
couple: familyData.value.same == "1",
couplePrefixId: familyData.value.prefixIdC,

View file

@ -319,7 +319,8 @@ const $q = useQuasar();
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const profileStore = useProfileDataStore();
const { birthDate, retireText } = storeToRefs(profileStore);
const edit = ref<boolean>(false);
@ -540,7 +541,7 @@ watch(retireText, async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileGovId(route.params.id.toString()))
.then((res) => {
@ -564,7 +565,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -574,7 +575,7 @@ const refreshData = async () => {
};
const editData = async () => {
loaderPage(true);
showLoader();
const body: ResponseObject = {
oc: govermentData.value.ocId,
business: govermentData.value.businessId,
@ -623,7 +624,7 @@ const handleDate = async (modelData: Date) => {
};
const fetchCalAgeGov = async (date: Date) => {
loaderPage(true);
showLoader();
const body = {
dateAppoint: date,
};
@ -637,7 +638,7 @@ const fetchCalAgeGov = async (date: Date) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -646,7 +647,7 @@ const fetchCalAgeGov = async (date: Date) => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileGovHisId(route.params.id.toString()))
.then((res) => {
@ -677,7 +678,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -417,7 +417,15 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, modalError } = mixin;
const {
date2Thai,
success,
dateToISO,
messageError,
modalError,
showLoader,
hideLoader,
} = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const profileStore = useProfileDataStore();
@ -674,7 +682,7 @@ const onCancel = async () => {
* get รายการ อมลเกยวกบบคคล
*/
const fetchPerson = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.person)
.then((res) => {
@ -731,7 +739,7 @@ const fetchPerson = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -740,7 +748,7 @@ const fetchPerson = async () => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileInforHisId(route.params.id.toString()))
.then((res) => {
@ -781,7 +789,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -851,7 +859,7 @@ const calRetire = async (birth: Date) => {
const body = {
birthDate: dateToISO(birth),
};
loaderPage(true);
showLoader();
await http
.post(config.API.profileCalRetire, body)
.then((res: any) => {
@ -867,12 +875,12 @@ const calRetire = async (birth: Date) => {
changeRetireText(date2Thai(retire));
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileInforId(route.params.id.toString()))
.then(async (res: any) => {
@ -904,7 +912,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -933,7 +941,7 @@ const editData = async () => {
profileType: informaData.value.profileType,
createdFullName: "-",
};
loaderPage(true);
showLoader();
await http
.put(config.API.profileInforId(route.params.id.toString()), body)
.then((res) => {

View file

@ -19,7 +19,8 @@ import Address from "@/modules/04_registry/components/Information/Address.vue";
import Family from "@/modules/04_registry/components/Information/Family.vue";
import Certicate from "@/modules/04_registry/components/Information/Certicate.vue";
// import NotifyError from "@/components/NotifyError.vue";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
const props = defineProps({
statusEdit: {
@ -33,8 +34,8 @@ const props = defineProps({
});
const emit = defineEmits(["update:statusEdit"]);
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { showLoader, hideLoader } = mixin;
const statusEdit = ref<boolean>(false);
const modalNoEdit = ref<boolean>(false);
const modalNoEditTittle = ref<string>("ไม่สามารถไม่สามารถแก้ไขข้อมูลได้?");
@ -49,7 +50,7 @@ watch(props, (count: any, prevCount: any) => {
});
onMounted(() => {
loaderPage(false);
hideLoader();
});
const notiNoEdit = () => {

View file

@ -420,7 +420,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const insigniaId = ref<string>("");
@ -790,7 +791,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
};
const fetchInsignia = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.insignia)
.then((res) => {
@ -811,12 +812,12 @@ const fetchInsignia = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileInsignId(profileId.value))
.then((res) => {
@ -846,7 +847,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -940,7 +941,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileInsignId(profileId.value), {
id: id.value,
@ -972,7 +973,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileInsignId(id.value), {
id: id.value,
@ -1012,7 +1013,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileInsignId(id.value))
.then((res) => {
@ -1134,7 +1135,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileInsignHisId(row.id))
.then((res) => {
@ -1164,7 +1165,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -383,7 +383,7 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError } = mixin;
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const route = useRoute();
const id = ref<string>("");
const year = ref<number>(0);
@ -748,7 +748,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveId(profileId.value))
.then((res) => {
@ -778,7 +778,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -873,7 +873,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileLeaveId(profileId.value), {
id: id.value,
@ -906,7 +906,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileLeaveId(id.value), {
id: id.value,
@ -947,7 +947,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileLeaveId(id.value))
.then((res) => {
@ -1072,7 +1072,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveHisId(row.id))
.then((res) => {
@ -1102,7 +1102,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -194,7 +194,7 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, messageError } = mixin;
const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -302,7 +302,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOtherId(profileId.value))
.then((res) => {
@ -322,7 +322,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -407,7 +407,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileOtherId(profileId.value), {
id: id.value,
@ -430,7 +430,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileOtherId(id.value), {
id: id.value,
@ -461,7 +461,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileOtherId(id.value))
.then((res) => {
@ -565,7 +565,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileOtherHisId(row.id))
.then((res) => {
@ -585,7 +585,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -2,7 +2,10 @@
<div class="col-12 row">
<div class="row col-12" style="padding-top: 80px">
<div id="information" name="1" class="row col-12 information">
<Informationvue v-model:statusEdit="statusEdit" :profileType="profileType" />
<Informationvue
v-model:statusEdit="statusEdit"
:profileType="profileType"
/>
</div>
<div id="certicate" name="15" class="row col-12 q-mt-md">
<Certicate v-model:statusEdit="statusEdit" :profileType="profileType" />
@ -20,7 +23,10 @@
<CoinedVue v-model:statusEdit="statusEdit" :profileType="profileType" />
</div>
<div id="assessment" name="6" class="row col-12 q-mt-md">
<AssessmentVue v-model:statusEdit="statusEdit" :profileType="profileType" />
<AssessmentVue
v-model:statusEdit="statusEdit"
:profileType="profileType"
/>
</div>
<div id="position" name="7" class="row col-12 q-mt-md">
<SalaryVue v-model:statusEdit="statusEdit" />
@ -53,7 +59,9 @@
class="bg-grey-2 text-white"
style="z-index: 99; padding: 0% 1% 0% 1%"
>
<div class="row col-12 q-gutter-sm q-pb-sm text-dark no-wrap items-center">
<div
class="row col-12 q-gutter-sm q-pb-sm text-dark no-wrap items-center"
>
<q-btn
flat
round
@ -64,7 +72,12 @@
@click="router.go(-1)"
>
</q-btn>
<q-avatar v-if="imageUrl == null" size="65px" rounded class="containerimage">
<q-avatar
v-if="imageUrl == null"
size="65px"
rounded
class="containerimage"
>
<img
src="@/assets/avatar_user.jpg"
class="bg-grey-3"
@ -108,7 +121,9 @@
</q-avatar>
<div class="row items-center text-dark q-ml-md">
<div class="column">
<div class="text-bold q-pb-xs text-name">{{ fullname }}{{ leaveReason }}</div>
<div class="text-bold q-pb-xs text-name">
{{ fullname }}{{ leaveReason }}
</div>
<div>{{ position }}</div>
</div>
</div>
@ -118,9 +133,13 @@
flat
:color="reasonStatus ? 'primary' : 'pink-5'"
@click="clickRetire()"
:icon="reasonStatus ? 'mdi-home-import-outline' : 'mdi-home-export-outline'"
:icon="
reasonStatus ? 'mdi-home-import-outline' : 'mdi-home-export-outline'
"
>
<q-tooltip>{{ reasonStatus ? "กลับเข้าราชการ" : "ออกราชการ" }}</q-tooltip>
<q-tooltip>{{
reasonStatus ? "กลับเข้าราชการ" : "ออกราชการ"
}}</q-tooltip>
</q-btn>
<q-btn icon="mdi-file-eye-outline" round color="primary" flat>
@ -131,7 +150,9 @@
<q-item-section class="text-blue">..7/..1</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="clickKp7Short()">
<q-item-section class="text-primary">ประวแบบย</q-item-section>
<q-item-section class="text-primary"
>ประวแบบย</q-item-section
>
</q-item>
</q-list>
</q-menu>
@ -233,9 +254,18 @@
<strong>ปโหลดรปภาพ</strong>
</div>
</div>
<div v-for="n in images" :key="n" class="col-3" @click="imageActive(n)">
<div
v-for="n in images"
:key="n"
class="col-3"
@click="imageActive(n)"
>
<div :class="getClass(n)">
<q-img v-if="n.avatar != null" :src="n.avatar" :class="imageClass(n)">
<q-img
v-if="n.avatar != null"
:src="n.avatar"
:class="imageClass(n)"
>
<!-- <div
class="absolute-top bg-transparent cursor-pointer text-right"
style="padding: 5px"
@ -311,7 +341,9 @@
<q-separator />
<q-card-section class="q-p-sm">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
<div
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-select
class="full-width inputgreen cursor-pointer"
@ -373,7 +405,10 @@
lazy-rules
autogrow
v-model="leaveDetail"
:rules="[(val) => !!val || `${'กรุณากรอกสาเหตุ/เหตุผลของการพ้นจากราชการ'}`]"
:rules="[
(val) =>
!!val || `${'กรุณากรอกสาเหตุ/เหตุผลของการพ้นจากราชการ'}`,
]"
hide-bottom-space
:label="`${'สาเหตุ/เหตุผลของการพ้นจากราชการ'}`"
/>
@ -431,7 +466,13 @@
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn flat round color="public" @click="Retire" icon="mdi-content-save-outline">
<q-btn
flat
round
color="public"
@click="Retire"
icon="mdi-content-save-outline"
>
<q-tooltip>นท</q-tooltip>
</q-btn>
</q-card-actions>
@ -468,7 +509,15 @@ const $q = useQuasar();
const store = useDataStore();
const { changeTab, loaderPage } = store;
const mixin = useCounterMixin();
const { date2Thai, dateToISO, modalConfirm, messageError, dialogMessage } = mixin;
const {
date2Thai,
dateToISO,
modalConfirm,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const router = useRouter();
const imageUrl = ref<any>(null);
@ -544,7 +593,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAvatarId(profileId.value))
.then((res) => {
@ -568,12 +617,12 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const checkProfileData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileCheckId(profileId.value))
.then((res) => {
@ -584,12 +633,12 @@ const checkProfileData = async () => {
router.push("/registry");
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchAvatarHistory = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAvatarHistoryId(profileId.value))
.then((res) => {
@ -608,7 +657,7 @@ const fetchAvatarHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -617,7 +666,7 @@ const uploadImage = async (e: any) => {
if (input.length > 0) {
const formData = new FormData();
formData.append("FileData", input[0]);
loaderPage(true);
showLoader();
await http
.post(config.API.profileAvatarId(profileId.value), formData)
.then((res) => {})
@ -644,7 +693,7 @@ const deletePhoto = async (id: string) => {
// undefined,
// false
// );
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAvatarHistoryId(id))
.then((res) => {})
@ -672,7 +721,7 @@ const selectAvatarHistory = async () => {
);
return;
}
loaderPage(true);
showLoader();
await http
.put(config.API.profileAvatarId(profileId.value), {
avatar: activeImage.value.avatarId,
@ -740,7 +789,7 @@ const downloadKP7Short = () => {};
const clickKp7 = async () => {
window.open(config.API.profileReportId(profileId.value));
// loaderPage(true);
// showLoader();
// await http
// .get(config.API.profileReportId(profileId.value))
// .then((res) => {
@ -753,7 +802,7 @@ const clickKp7 = async () => {
// })
// .catch((e) => {messageError($q, e);})
// .finally(() => {
// loaderPage(false);
// hideLoader();
// });
};
@ -772,7 +821,7 @@ const downloadFilePDF = async (res: string, fileName: string) => {
const clickKp7Short = async () => {
window.open(config.API.profileKp7ShortId(profileId.value));
// loaderPage(true);
// showLoader();
// await http
// .get(config.API.profileKp7ShortId(profileId.value))
// .then((res) => {
@ -785,7 +834,7 @@ const clickKp7Short = async () => {
// })
// .catch((e) => {messageError($q, e);})
// .finally(() => {
// loaderPage(false);
// hideLoader();
// });
};
@ -809,7 +858,7 @@ const clickRetire = async () => {
const Retire = async () => {
if (reasonStatus.value == true) {
loaderPage(true);
showLoader();
await http
.put(config.API.profileReactive(profileId.value))
.then((res) => {
@ -824,7 +873,7 @@ const Retire = async () => {
router.push("/registry");
});
} else {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDeactive(profileId.value), {
leaveDate: dateToISO(leaveDate.value),

View file

@ -213,7 +213,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -351,7 +352,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileNopaidId(profileId.value))
.then((res) => {
@ -372,7 +373,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -458,7 +459,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileNopaidId(profileId.value), {
id: id.value,
@ -482,7 +483,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileNopaidId(id.value), {
id: id.value,
@ -514,7 +515,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileNopaidId(id.value))
.then((res) => {
@ -620,7 +621,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileNopaidHisId(row.id))
.then((res) => {
@ -641,7 +642,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -551,7 +551,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -1311,7 +1312,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1325,7 +1326,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1333,7 +1334,7 @@ const nodeTree = async () => {
* get รายการ ตำแหน
*/
const fetchPosition = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.position)
.then((res) => {
@ -1410,12 +1411,12 @@ const fetchPosition = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryId(profileId.value))
.then((res) => {
@ -1457,7 +1458,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1467,7 +1468,7 @@ const onSelected = async (id: string) => {
const fetchOrganization = async (id: string) => {
if (selected.value != "") {
loaderPage(true);
showLoader();
await http
.get(config.API.organizationName(id))
.then((res) => {
@ -1478,13 +1479,13 @@ const fetchOrganization = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchPositionNumber = async (id: string) => {
loaderPage(true);
showLoader();
await http
.get(config.API.getPositionNumberIdByOcId(id))
.then((res) => {
@ -1500,7 +1501,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1663,7 +1664,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
@ -1698,7 +1699,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileSalaryId(id.value), {
date: dateToISO(date.value),
@ -1741,7 +1742,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1883,7 +1884,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -1925,7 +1926,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -291,7 +291,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const field = ref<string>();
@ -506,7 +507,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAbiliId(profileId.value))
.then((res) => {
@ -530,7 +531,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -619,7 +620,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileAbiliId(profileId.value), {
id: id.value,
@ -646,7 +647,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileAbiliId(id.value), {
id: id.value,
@ -681,7 +682,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAbiliId(id.value))
.then((res) => {
@ -793,7 +794,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileAbiliHisId(row.id))
.then((res) => {
@ -817,7 +818,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -431,7 +431,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const name = ref<string>();
@ -751,7 +752,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileTrainId(profileId.value))
.then((res) => {
@ -779,7 +780,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -872,7 +873,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileTrainId(profileId.value), {
id: id.value,
@ -903,7 +904,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileTrainId(id.value), {
id: id.value,
@ -942,7 +943,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileTrainId(id.value))
.then((res) => {
@ -1062,7 +1063,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileTrainHisId(row.id))
.then((res) => {
@ -1090,7 +1091,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -261,7 +261,8 @@ const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError } = mixin;
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
mixin;
const route = useRoute();
const id = ref<string>("");
const dateStart = ref<Date>(new Date());
@ -426,7 +427,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileDutyId(profileId.value))
.then((res) => {
@ -448,7 +449,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -535,7 +536,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileDutyId(profileId.value), {
id: id.value,
@ -560,7 +561,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDutyId(id.value), {
id: id.value,
@ -593,7 +594,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileDutyId(id.value))
.then((res) => {
@ -701,7 +702,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileDutyHisId(row.id))
.then((res) => {
@ -723,7 +724,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};