Merge branch 'develop' into working

# Conflicts:
#	src/interface/request/main/main.ts
#	src/modules/08_registryEmployee/router.ts
#	src/modules/08_registryEmployee/views/Main.vue
This commit is contained in:
Tanyalak 2023-08-16 17:06:58 +07:00
commit 06c3d36c7a
333 changed files with 64333 additions and 12866 deletions

View file

@ -308,7 +308,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -338,10 +338,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>();
@ -598,7 +598,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAssessmentId(profileId.value))
.then((res) => {
@ -624,7 +624,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -717,7 +717,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileAssessmentId(profileId.value), {
id: id.value,
@ -747,7 +747,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileAssessmentId(id.value), {
id: id.value,
@ -784,7 +784,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAssessmentId(id.value))
.then((res) => {
@ -901,7 +901,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) => {
@ -927,7 +927,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -264,7 +264,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -294,10 +294,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>();
@ -490,7 +490,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileHonorId(profileId.value))
.then((res) => {
@ -514,7 +514,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -604,7 +604,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileHonorId(profileId.value), {
id: id.value,
@ -632,7 +632,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileHonorId(id.value), {
id: id.value,
@ -667,7 +667,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileHonorId(id.value))
.then((res) => {
@ -781,7 +781,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขประกาศลูกจ้างดีเด่น"
: "ประวัติแก้ไขประกาศเกียรติคุณ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileHonorHisId(row.id))
.then((res) => {
@ -805,7 +805,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -278,7 +278,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -307,10 +307,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>();
@ -590,7 +590,7 @@ const filterSelector = (val: string, update: Function, refData: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileDisId(profileId.value))
.then((res) => {
@ -615,7 +615,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -706,7 +706,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileDisId(profileId.value), {
id: id.value,
@ -735,7 +735,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDisId(id.value), {
id: id.value,
@ -771,7 +771,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileDisId(id.value))
.then((res) => {
@ -883,7 +883,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileDisHisId(row.id))
.then((res) => {
@ -908,7 +908,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -138,7 +138,7 @@ import { onMounted, computed, ref, watch } from "vue";
import { useQuasar, QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
import { useDataStore } from "@/stores/data";
import HeaderTop from "@/modules/04_registry/components/Information/top.vue";
import http from "@/plugins/http";
import config from "@/app.config";
@ -156,12 +156,10 @@ const props = defineProps({
});
const emit = defineEmits(["update:statusEdit"]);
const dataStore = useDataStore();
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 ? route.params.id.toString() : ""
);
@ -177,7 +175,7 @@ onMounted(async () => {
const getData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profilePaperId(profileId.value))
.then((res) => {
@ -188,13 +186,13 @@ 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) => {
@ -219,7 +217,7 @@ const uploadData = async () => {
formData.append("avatar", newFile);
formData.append("moss", "newFile");
console.log(formData);
loaderPage(true);
showLoader();
await http
.post(config.API.profilePaperId(profileId.value), formData)
.then((res) => {

View file

@ -582,7 +582,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -609,10 +609,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>();
@ -1047,7 +1047,7 @@ onMounted(async () => {
});
const fetchLevel = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.educationLevel)
.then((res) => {
@ -1063,12 +1063,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) => {
@ -1085,7 +1085,7 @@ const fetchPositionPath = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1113,7 +1113,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileEduId(profileId.value))
.then((res) => {
@ -1150,7 +1150,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -1258,7 +1258,7 @@ const saveData = async () => {
// (r: any) => r.id == isEducation.value
// );
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileEduId(profileId.value), {
id: id.value,
@ -1308,7 +1308,7 @@ const editData = async () => {
// const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
// (r: any) => r.id == isEducation.value
// );
loaderPage(true);
showLoader();
await http
.put(config.API.profileEduId(id.value), {
id: id.value,
@ -1359,7 +1359,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileEduId(id.value))
.then((res) => {
@ -1493,7 +1493,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileEduHisId(row.id))
.then((res) => {
@ -1530,7 +1530,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -289,7 +289,7 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -321,10 +321,9 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
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>();
@ -582,7 +581,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) => {
@ -610,7 +609,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -626,13 +625,11 @@ const getNewData = async () => {
await fetchDistrict(addressData.value.provinceIdC, "2");
await fetchSubDistrict(addressData.value.districtId, "1");
await fetchSubDistrict(addressData.value.districtIdC, "2");
await selectSubDistrict(addressData.value.subdistrictId, "1");
await selectSubDistrict(addressData.value.subdistrictIdC, "2");
};
const fetchData = async () => {
if (route.params.id) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAdrsId(route.params.id.toString()))
.then((res) => {
@ -651,7 +648,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -684,7 +681,7 @@ const editData = async () => {
createdAt: new Date(),
createdFullName: "-",
};
loaderPage(true);
showLoader();
await http
.put(config.API.profileAdrsId(route.params.id.toString()), body)
.then((res) => {
@ -701,7 +698,7 @@ const editData = async () => {
};
const addData = async () => {
// loaderPage(true);
// showLoader();
// await http
// .put(config.API.profileInforId(route.params.id.toString()), body)
// .then((res) => {
@ -776,7 +773,7 @@ const selectSubDistrict = (e: string | null, name: string) => {
};
const fetchProvince = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.province)
.then((res) => {
@ -792,13 +789,13 @@ const fetchProvince = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchDistrict = async (id: string | null, position: string) => {
if (id != null) {
loaderPage(true);
if (id != null && id != "") {
showLoader();
await http
.get(config.API.listDistrict(id))
.then((res) => {
@ -819,14 +816,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);
if (id != null && id != "") {
showLoader();
await http
.get(config.API.listSubDistrict(id))
.then((res) => {
@ -851,7 +848,7 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};

View file

@ -261,7 +261,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -290,10 +290,9 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>();
@ -487,7 +486,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileCertId(profileId.value))
.then((res) => {
@ -510,7 +509,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -599,7 +598,7 @@ const clickSave = async () => {
* นทกเพมขอม
*/
const saveData = async () => {
loaderPage(true);
showLoader();
await http
.post(config.API.profileCertId(profileId.value), {
id: id.value,
@ -625,7 +624,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileCertId(id.value), {
id: id.value,
@ -659,7 +658,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileCertId(id.value))
.then((res) => {
@ -773,7 +772,7 @@ const clickHistory = async (row: RequestItemsObject) => {
? "ประวัติแก้ไขใบอนุญาตของลูกจ้าง"
: "ประวัติแก้ไขใบอนุญาตประกอบอาชีพ";
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileCertHisId(row.id))
.then((res) => {
@ -796,7 +795,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -1089,7 +1089,7 @@
import { ref, onMounted } from "vue";
import type { QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import type {
Family,
@ -1124,10 +1124,9 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
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);
@ -1233,7 +1232,7 @@ const refreshData = async () => {
};
const fetchPrefix = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.prefix)
.then((res) => {
@ -1249,7 +1248,7 @@ const fetchPrefix = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1279,7 +1278,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) => {
@ -1317,7 +1316,7 @@ const fetchHistory = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
if (familyDataHistory.value.length == 0) {
// modalError(
// $q,
@ -1340,7 +1339,7 @@ const fetchHistory = async () => {
const fetchData = async () => {
if (route.params.id) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileFamiId(route.params.id.toString()))
.then((res) => {
@ -1393,13 +1392,13 @@ 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,
@ -1441,7 +1440,7 @@ const editData = async () => {
};
const addData = async () => {
// loaderPage(true);
// showLoader();
// await http
// .put(config.API.profileInforId(route.params.id.toString()), body)
// .then((res) => {

View file

@ -330,7 +330,7 @@
<script setup lang="ts">
import { onMounted, ref, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import type { Goverment } from "@/modules/04_registry/components/profileType";
import { defaultGoverment } from "@/modules/04_registry/components/profileType";
@ -363,10 +363,10 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
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);
@ -611,7 +611,7 @@ watch(retireText, async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileGovId(route.params.id.toString()))
.then((res) => {
@ -637,7 +637,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -647,7 +647,7 @@ const refreshData = async () => {
};
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileGovId(route.params.id.toString()), {
dateAppoint: dateToISO(govermentData.value.containDate),
@ -682,7 +682,7 @@ const handleDate = async (modelData: Date) => {
};
const fetchCalAgeGov = async (date: Date) => {
loaderPage(true);
showLoader();
const body = {
dateAppoint: date,
};
@ -696,7 +696,7 @@ const fetchCalAgeGov = async (date: Date) => {
messageError($q, e);
})
.finally(async () => {
loaderPage(false);
hideLoader();
});
};
@ -705,7 +705,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) => {
@ -738,7 +738,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -409,7 +409,7 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import type {
Information,
@ -450,9 +450,16 @@ const emit = defineEmits(["update:statusEdit"]);
const route = useRoute();
const $q = useQuasar();
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, dialogMessage } = mixin;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const {
date2Thai,
success,
dateToISO,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const profileStore = useProfileDataStore();
const { changeRetireText, changeBirth } = profileStore;
const edit = ref<boolean>(false);
@ -739,7 +746,7 @@ const onCancel = async () => {
* get รายการ อมลเกยวกบบคคล
*/
const fetchPerson = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.person)
.then((res) => {
@ -796,7 +803,7 @@ const fetchPerson = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -822,7 +829,7 @@ const changeCardID = (value: string | number | null) => {
};
const checkCitizen = async (id: string) => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileCitizenId(id))
.then((res) => {
@ -847,7 +854,7 @@ const checkCitizen = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -856,7 +863,7 @@ const checkCitizen = async (id: string) => {
*/
const clickHistory = async () => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileInforHisId(route.params.id.toString()))
.then((res) => {
@ -897,7 +904,7 @@ const clickHistory = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -973,7 +980,7 @@ const calRetire = async (birth: Date) => {
birthDate: dateToISO(birth),
};
if (dateToISO(dateBefore.value) != dateToISO(birth)) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileCalRetire, body)
.then((res: any) => {
@ -989,14 +996,14 @@ const calRetire = async (birth: Date) => {
changeRetireText(date2Thai(retire));
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchData = async () => {
if (route.params.id) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileInforId(route.params.id.toString()))
.then(async (res: any) => {
@ -1034,7 +1041,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(async () => {
// loaderPage(false);
// hideLoader();
await props.fetchDataProfile();
});
}
@ -1061,7 +1068,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) => {
@ -1079,7 +1086,7 @@ const editData = async () => {
};
const addData = async () => {
// loaderPage(true);
// showLoader();
// await http
// .put(config.API.profileInforId(route.params.id.toString()), body)
// .then((res) => {

View file

@ -296,7 +296,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -341,8 +341,7 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const {
date2Thai,
@ -351,6 +350,8 @@ const {
messageError,
typeChangeName,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const id = ref<string>("");
@ -550,7 +551,7 @@ onMounted(async () => {
});
const fetchData = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileChangeNameId(profileId.value))
.then((res) => {
@ -574,7 +575,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -582,7 +583,7 @@ const fetchData = async () => {
* get รายการ อมลเกยวกบบคคล
*/
const fetchPerson = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.person)
.then((res) => {
@ -599,7 +600,7 @@ const fetchPerson = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -701,7 +702,7 @@ const saveData = async () => {
if (lastName.value != undefined)
formData.append("lastName", lastName.value);
if (status.value != undefined) formData.append("status", status.value);
loaderPage(true);
showLoader();
await http
.post(config.API.profileChangeNameId(profileId.value), formData)
.then((res) => {
@ -747,7 +748,7 @@ const editData = async () => {
formData.append("firstName", firstName.value);
if (lastName.value != undefined) formData.append("lastName", lastName.value);
if (status.value != undefined) formData.append("status", status.value);
loaderPage(true);
showLoader();
await http
.put(config.API.profileChangeNameId(id.value), formData)
.then((res) => {
@ -775,7 +776,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileChangeNameId(id.value))
.then((res) => {
@ -885,7 +886,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileChangeNameHisId(row.id))
.then((res) => {
@ -909,7 +910,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -457,7 +457,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -488,10 +488,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>("");
@ -913,7 +913,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
};
const fetchInsignia = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.insignia)
.then((res) => {
@ -934,13 +934,13 @@ const fetchInsignia = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileInsignId(profileId.value))
.then((res) => {
@ -973,7 +973,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -1071,7 +1071,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileInsignId(profileId.value), {
id: id.value,
@ -1107,7 +1107,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileInsignId(id.value), {
id: id.value,
@ -1150,7 +1150,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileInsignId(id.value))
.then((res) => {
@ -1276,7 +1276,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileInsignHisId(row.id))
.then((res) => {
@ -1309,7 +1309,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -347,7 +347,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -380,8 +380,7 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const {
date2Thai,
@ -390,6 +389,8 @@ const {
statusLeave,
dialogMessage,
dateToISO,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
@ -718,7 +719,7 @@ onMounted(async () => {
const fetchData = async () => {
rows.value = [];
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveId(profileId.value))
.then((res) => {
@ -743,7 +744,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -773,7 +774,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveHisId(row.id))
.then((res) => {
@ -798,7 +799,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -969,7 +970,7 @@ const saveData = async () => {
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileLeaveId(profileId.value), {
dateStartLeave: dateToISO(dateRange.value[0]),
@ -1000,7 +1001,7 @@ const saveData = async () => {
const editData = async () => {
const sum = Number(numLeave.value) + Number(numUsedLeave.value);
loaderPage(true);
showLoader();
await http
.put(config.API.profileLeaveId(id.value), {
dateStartLeave: dateToISO(dateRange.value[0]),
@ -1025,7 +1026,7 @@ const editData = async () => {
};
const deleteData = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileLeaveId(id.value))
.then((res) => {
@ -1192,7 +1193,7 @@ const addData = async () => {
const clickTotal = async () => {
rowsTotal.value = [];
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileLeaveTotalId(profileId.value))
.then((res) => {
@ -1211,7 +1212,7 @@ const clickTotal = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};

View file

@ -166,7 +166,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -191,10 +191,9 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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());
@ -305,7 +304,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOtherId(profileId.value))
.then((res) => {
@ -325,7 +324,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -412,7 +411,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileOtherId(profileId.value), {
id: id.value,
@ -436,7 +435,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileOtherId(id.value), {
id: id.value,
@ -467,7 +466,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileOtherId(id.value))
.then((res) => {
@ -571,7 +570,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileOtherHisId(row.id))
.then((res) => {
@ -591,7 +590,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

File diff suppressed because it is too large Load diff

View file

@ -258,7 +258,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -283,10 +283,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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());
@ -309,7 +309,9 @@ const tittleHistory = ref<string>(
);
const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal
const profileId = ref<string>(route.params.id ? route.params.id.toString():'');
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const checkValidate = ref<boolean>(false); //validate data
const rows = ref<RequestItemsObject[]>([]);
const filter = ref<string>(""); //search data table
@ -478,8 +480,8 @@ onMounted(async () => {
});
const fetchData = async () => {
if (profileId.value!='') {
loaderPage(true);
if (profileId.value != "") {
showLoader();
await http
.get(config.API.profileNopaidId(profileId.value))
.then((res) => {
@ -503,7 +505,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -593,7 +595,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileNopaidId(profileId.value), {
id: id.value,
@ -621,7 +623,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileNopaidId(id.value), {
id: id.value,
@ -656,7 +658,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileNopaidId(id.value))
.then((res) => {
@ -766,7 +768,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileNopaidHisId(row.id))
.then((res) => {
@ -790,7 +792,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -552,7 +552,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -581,10 +581,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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());
@ -1410,7 +1410,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1424,7 +1424,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1432,7 +1432,7 @@ const nodeTree = async () => {
* get รายการ ตำแหน
*/
const fetchPosition = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.position)
.then((res) => {
@ -1509,13 +1509,13 @@ const fetchPosition = async () => {
})
.catch((e: any) => {})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryId(profileId.value))
.then((res) => {
@ -1558,7 +1558,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -1569,7 +1569,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) => {
@ -1580,13 +1580,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) => {
@ -1602,7 +1602,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1767,7 +1767,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileSalaryId(profileId.value), {
date: dateToISO(date.value),
@ -1804,7 +1804,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileSalaryId(id.value), {
date: dateToISO(date.value),
@ -1848,7 +1848,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1992,7 +1992,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -2035,7 +2035,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -563,7 +563,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -592,10 +592,17 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, dialogMessage } = mixin;
const {
date2Thai,
success,
dateToISO,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -1281,14 +1288,14 @@ onMounted(async () => {
});
const fetchDataSelector = async () => {
loaderPage(true);
showLoader();
await fetchEmployeePosition();
await fetchEmployeePositionSide();
await fetchEmployeeLevel();
await fetchEmployeeGroup();
await fetchAgency();
await nodeTree();
loaderPage(false);
hideLoader();
};
//
const fetchEmployeePosition = async () => {
@ -1383,7 +1390,7 @@ const fetchAgency = async () => {
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1397,7 +1404,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1469,7 +1476,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => {
@ -1509,13 +1516,13 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchPositionNumber = async (id: string) => {
// loaderPage(true);
// showLoader();
if (id == null || id == "") return;
await http
.get(config.API.getPositionNumberIdByOcId(id))
@ -1532,7 +1539,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1696,7 +1703,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileSalaryEmployeeId(profileId.value), {
amount: amount.value,
@ -1731,7 +1738,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileSalaryEmployeeId(id.value), {
amount: amount.value,
@ -1765,7 +1772,7 @@ const editData = async () => {
* ลบขอม
*/
const fetchDataDelete = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1935,7 +1942,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -1974,7 +1981,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -538,7 +538,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -567,10 +567,17 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, success, dateToISO, messageError, dialogMessage } = mixin;
const {
date2Thai,
success,
dateToISO,
messageError,
dialogMessage,
showLoader,
hideLoader,
} = mixin;
const route = useRoute();
const id = ref<string>("");
const date = ref<Date>(new Date());
@ -1310,14 +1317,14 @@ onMounted(async () => {
});
const fetchDataSelector = async () => {
loaderPage(true);
showLoader();
await fetchEmployeePosition();
await fetchEmployeePositionSide();
await fetchEmployeeLevel();
await fetchEmployeeGroup();
await fetchAgency();
await nodeTree();
loaderPage(false);
hideLoader();
};
//
const fetchEmployeePosition = async () => {
@ -1412,7 +1419,7 @@ const fetchAgency = async () => {
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
@ -1426,7 +1433,7 @@ const nodeTree = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1498,7 +1505,7 @@ const filterSelector = (val: any, update: Function, filtername: string) => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryEmployeeId(profileId.value))
.then((res) => {
@ -1537,13 +1544,13 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
const fetchPositionNumber = async (id: string) => {
// loaderPage(true);
// showLoader();
if (id == null || id == "") return;
await http
.get(config.API.getPositionNumberIdByOcId(id))
@ -1560,7 +1567,7 @@ const fetchPositionNumber = async (id: string) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};
@ -1725,7 +1732,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileSalaryEmployeeId(profileId.value), {
amount: amount.value,
@ -1760,7 +1767,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileSalaryEmployeeId(id.value), {
amount: amount.value,
@ -1794,7 +1801,7 @@ const editData = async () => {
* ลบขอม
*/
const fetchDataDelete = async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileSalaryId(id.value))
.then((res) => {
@ -1964,7 +1971,7 @@ const clickEditRowRef = () => {
*/
const clickHistory = async (row: RequestItemsEmployee) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileSalaryHisId(row.id))
.then((res) => {
@ -2003,7 +2010,7 @@ const clickHistory = async (row: RequestItemsEmployee) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -164,7 +164,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -189,10 +189,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>();
@ -355,7 +355,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileAbiliId(profileId.value))
.then((res) => {
@ -377,7 +377,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -466,7 +466,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileAbiliId(profileId.value), {
id: id.value,
@ -492,7 +492,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileAbiliId(id.value), {
id: id.value,
@ -525,7 +525,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileAbiliId(id.value))
.then((res) => {
@ -633,7 +633,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileAbiliHisId(row.id))
.then((res) => {
@ -655,7 +655,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -403,7 +403,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -428,10 +428,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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>();
@ -754,7 +754,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileTrainId(profileId.value))
.then((res) => {
@ -782,7 +782,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -877,7 +877,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileTrainId(profileId.value), {
id: id.value,
@ -909,7 +909,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileTrainId(id.value), {
id: id.value,
@ -948,7 +948,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileTrainId(id.value))
.then((res) => {
@ -1068,7 +1068,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileTrainHisId(row.id))
.then((res) => {
@ -1096,7 +1096,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -304,7 +304,7 @@ import { onMounted, ref, watch } from "vue";
import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import ProfileTable from "@/modules/04_registry/components/Table.vue";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import DialogFooter from "@/modules/04_registry/components/DialogFooter.vue";
@ -329,10 +329,10 @@ const props = defineProps({
const $q = useQuasar();
const store = useProfileDataStore();
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());
@ -555,7 +555,7 @@ onMounted(async () => {
const fetchData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.get(config.API.profileDutyId(profileId.value))
.then((res) => {
@ -580,7 +580,7 @@ const fetchData = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
}
};
@ -671,7 +671,7 @@ const clickSave = async () => {
*/
const saveData = async () => {
if (profileId.value) {
loaderPage(true);
showLoader();
await http
.post(config.API.profileDutyId(profileId.value), {
id: id.value,
@ -700,7 +700,7 @@ const saveData = async () => {
* นทกแกไขขอม
*/
const editData = async () => {
loaderPage(true);
showLoader();
await http
.put(config.API.profileDutyId(id.value), {
id: id.value,
@ -736,7 +736,7 @@ const clickDelete = async () => {
persistent: true,
})
.onOk(async () => {
loaderPage(true);
showLoader();
await http
.delete(config.API.profileDutyId(id.value))
.then((res) => {
@ -848,7 +848,7 @@ const clickEditRow = () => {
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
loaderPage(true);
showLoader();
await http
.get(config.API.profileDutyHisId(row.id))
.then((res) => {
@ -873,7 +873,7 @@ const clickHistory = async (row: RequestItemsObject) => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};

View file

@ -14,7 +14,7 @@ interface Information {
prefixId: string | null;
firstname: string | null;
lastname: string | null;
birthDate: Date;
birthDate: Date | null;
genderId: string | null;
bloodId: string | null;
nationality: string | null;
@ -135,7 +135,7 @@ const defaultInformation: Information = {
prefixId: null,
firstname: null,
lastname: null,
birthDate: new Date(),
birthDate: null,
genderId: null,
bloodId: null,
nationality: null,

View file

@ -132,7 +132,7 @@ import { onMounted, ref, watch } from "vue";
import { useRouter } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar } from "quasar";
import type { RequestItemsObject } from "@/modules/04_registry/interface/request/Main";
import type { ResponseObject } from "@/modules/04_registry/interface/response/Main";
@ -144,15 +144,16 @@ import ProfileTable from "@/modules/04_registry/components/TableProfile.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
// import { jsontoexcel } from "vue-table-to-excel";
import { useDataStore } from "@/stores/data";
const dataStore = useDataStore();
const $q = useQuasar();
const store = useProfileDataStore();
const { profileData, changeProfileColumns } = store;
const dataStore = useDataStore();
const { loaderPage } = dataStore;
const { changeTreeRegister, selectedRegister, expandedRegister } = dataStore;
const mixin = useCounterMixin();
const { date2Thai, messageError, typeRetire } = mixin;
const { date2Thai, messageError, typeRetire, showLoader, hideLoader } = mixin;
const router = useRouter();
const isDrawer = ref<boolean>(true);
const filter = ref<string>(""); //search data table
@ -1163,25 +1164,20 @@ const onSelected = async (id: string) => {
};
const clickTree = () => {
dataStore.changeTreeRegister(expanded.value, selected.value);
changeTreeRegister(expanded.value, selected.value);
};
const nodeTree = async () => {
loaderPage(true);
showLoader();
await http
.get(config.API.profileOrganizRoot)
.then((res: any) => {
const data = res.data.result;
nodesTree.value = data;
if (data.length > 0) {
selected.value =
dataStore.selectedRegister == ""
? data[0].id
: dataStore.selectedRegister;
selected.value = selectedRegister == "" ? data[0].id : selectedRegister;
expanded.value =
dataStore.expandedRegister.length == 0
? [data[0].id]
: dataStore.expandedRegister;
expandedRegister.length == 0 ? [data[0].id] : expandedRegister;
}
})
.catch((e: any) => {
@ -1311,7 +1307,7 @@ const doSearch = async () => {
}
if (selected.value == null || selected.value == "") return;
loaderPage(true);
showLoader();
await http
.post(config.API.searchProfileByOcId(selected.value, profileType.value), {
criterias: cirteria,
@ -1367,7 +1363,7 @@ const doSearch = async () => {
messageError($q, e);
})
.finally(() => {
loaderPage(false);
hideLoader();
});
};