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:
commit
06c3d36c7a
333 changed files with 64333 additions and 12866 deletions
|
|
@ -16,10 +16,14 @@ interface FormRegistryEmployee {
|
|||
dateAppoint: String | null;
|
||||
dateStart: String | null;
|
||||
createdAt: String | null;
|
||||
// salaryDate: String | null;
|
||||
// salaryDate: String | null;
|
||||
isLeave: String;
|
||||
// leaveReason: string;
|
||||
// leaveReason: string;
|
||||
leaveDateOrder: String | null;
|
||||
draftPositionEmployee: String | null;
|
||||
draftOrganizationOrganization: String | null;
|
||||
newAgency: String | null;
|
||||
currentAgency: String | null;
|
||||
}
|
||||
interface ResponseEmployeeTemp {
|
||||
id: string;
|
||||
|
|
@ -43,5 +47,7 @@ interface ResponseEmployeeTemp {
|
|||
isLeave: boolean;
|
||||
leaveReason: string;
|
||||
leaveDateOrder: Date | null;
|
||||
draftPositionEmployee: String | null;
|
||||
draftOrganizationOrganization: String | null;
|
||||
}
|
||||
export type { ResponseEmployeeTemp, FormRegistryEmployee };
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { defineAsyncComponent } from "vue";
|
|||
|
||||
// const Main = () => import("@/modules/08_registryEmployee/views/Main.vue");
|
||||
// const Detail = () => import("@/modules/08_registryEmployee/views/Detail.vue");
|
||||
const MainEmployee = defineAsyncComponent(
|
||||
const Main = defineAsyncComponent(
|
||||
() => import("@/modules/08_registryEmployee/views/Main.vue")
|
||||
);
|
||||
const Detail = defineAsyncComponent(
|
||||
|
|
@ -17,9 +17,9 @@ const EditDetail = defineAsyncComponent(
|
|||
|
||||
export default [
|
||||
{
|
||||
path: "/employee",
|
||||
name: "employee",
|
||||
component: MainEmployee,
|
||||
path: "/registry-employee",
|
||||
name: "registry-employee",
|
||||
component: Main,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11],
|
||||
|
|
@ -37,7 +37,7 @@ export default [
|
|||
// },
|
||||
// },
|
||||
{
|
||||
path: "/employee/add",
|
||||
path: "/registry-employee/add",
|
||||
name: "registryEmployeeAdd",
|
||||
component: Detail,
|
||||
meta: {
|
||||
|
|
@ -47,7 +47,7 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/employee/Edit/:Id",
|
||||
path: "/registry-employee/edit/:id",
|
||||
name: "registryEmployeeEdit",
|
||||
component: EditDetail,
|
||||
meta: {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -298,9 +298,17 @@ import config from "@/app.config";
|
|||
|
||||
const $q = useQuasar();
|
||||
const store = useDataStore();
|
||||
const { changeTab, loaderPage } = store;
|
||||
const { changeTab } = store;
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, dateToISO, messageError, dialogMessage, success } = mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
dateToISO,
|
||||
messageError,
|
||||
dialogMessage,
|
||||
success,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const imageUrl = ref<any>(null);
|
||||
|
|
@ -374,7 +382,7 @@ onMounted(async () => {
|
|||
|
||||
const fetchData = async () => {
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileAvatarId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -398,14 +406,14 @@ const fetchData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const checkProfileData = async () => {
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileCheckId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -416,14 +424,14 @@ const checkProfileData = async () => {
|
|||
router.push("/registry");
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const fetchAvatarHistory = async () => {
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileAvatarHistoryId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -443,7 +451,7 @@ const fetchAvatarHistory = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -454,7 +462,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) => {})
|
||||
|
|
@ -471,7 +479,7 @@ const uploadImage = async (e: any) => {
|
|||
};
|
||||
|
||||
const fetchDataDelete = async (id: string) => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profileAvatarHistoryId(id))
|
||||
.then((res) => {
|
||||
|
|
@ -517,7 +525,7 @@ const selectAvatarHistory = async () => {
|
|||
return;
|
||||
}
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileAvatarId(profileId.value), {
|
||||
avatar: activeImage.value.avatarId,
|
||||
|
|
@ -588,7 +596,7 @@ const clickKp7 = async () => {
|
|||
if (profileId.value !== "") {
|
||||
window.open(config.API.profileReportId(profileId.value));
|
||||
}
|
||||
// loaderPage(true);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.profileReportId(profileId.value))
|
||||
// .then((res) => {
|
||||
|
|
@ -601,7 +609,7 @@ const clickKp7 = async () => {
|
|||
// })
|
||||
// .catch((e) => {messageError($q, e);})
|
||||
// .finally(() => {
|
||||
// loaderPage(false);
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
|
||||
|
|
@ -609,7 +617,7 @@ const clickKp7Short = async () => {
|
|||
if (profileId.value !== "") {
|
||||
window.open(config.API.profileKp7ShortId(profileId.value));
|
||||
}
|
||||
// loaderPage(true);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.profileKp7ShortId(profileId.value))
|
||||
// .then((res) => {
|
||||
|
|
@ -622,7 +630,7 @@ const clickKp7Short = async () => {
|
|||
// })
|
||||
// .catch((e) => {messageError($q, e);})
|
||||
// .finally(() => {
|
||||
// loaderPage(false);
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -137,11 +137,9 @@
|
|||
<div class="row items-center text-dark q-ml-md">
|
||||
<div class="column">
|
||||
<div class="text-bold q-pb-xs text-name">
|
||||
{{ "แก้ไข้ข้อมูลทะเบียนประวัติลูกจ้างชั่วคราว" }}
|
||||
</div>
|
||||
<div class="text-bold q-pb-xs text-sub">
|
||||
{{ "ลูกจ้างชั่วคราว" }}
|
||||
{{ fullname }}{{ leaveReason }}
|
||||
</div>
|
||||
<div>{{ position }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<q-space />
|
||||
|
|
@ -523,9 +521,17 @@ import config from "@/app.config";
|
|||
|
||||
const $q = useQuasar();
|
||||
const store = useDataStore();
|
||||
const { changeTab, loaderPage } = store;
|
||||
const { changeTab } = store;
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, dateToISO, messageError, dialogMessage, success } = mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
dateToISO,
|
||||
messageError,
|
||||
dialogMessage,
|
||||
success,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const imageUrl = ref<any>(null);
|
||||
|
|
@ -605,7 +611,7 @@ onMounted(async () => {
|
|||
|
||||
const fetchData = async () => {
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileAvatarId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -629,14 +635,14 @@ const fetchData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const checkProfileData = async () => {
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileCheckId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -647,14 +653,14 @@ const checkProfileData = async () => {
|
|||
router.push("/registry");
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const fetchAvatarHistory = async () => {
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileAvatarHistoryId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -674,7 +680,7 @@ const fetchAvatarHistory = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -685,7 +691,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) => {})
|
||||
|
|
@ -702,7 +708,7 @@ const uploadImage = async (e: any) => {
|
|||
};
|
||||
|
||||
const fetchDataDelete = async (id: string) => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profileAvatarHistoryId(id))
|
||||
.then((res) => {
|
||||
|
|
@ -748,7 +754,7 @@ const selectAvatarHistory = async () => {
|
|||
return;
|
||||
}
|
||||
if (profileId.value !== "") {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileAvatarId(profileId.value), {
|
||||
avatar: activeImage.value.avatarId,
|
||||
|
|
@ -819,7 +825,7 @@ const clickKp7 = async () => {
|
|||
if (profileId.value !== "") {
|
||||
window.open(config.API.profileReportId(profileId.value));
|
||||
}
|
||||
// loaderPage(true);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.profileReportId(profileId.value))
|
||||
// .then((res) => {
|
||||
|
|
@ -832,7 +838,7 @@ const clickKp7 = async () => {
|
|||
// })
|
||||
// .catch((e) => {messageError($q, e);})
|
||||
// .finally(() => {
|
||||
// loaderPage(false);
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
|
||||
|
|
@ -853,7 +859,7 @@ const clickKp7Short = async () => {
|
|||
if (profileId.value !== "") {
|
||||
window.open(config.API.profileKp7ShortId(profileId.value));
|
||||
}
|
||||
// loaderPage(true);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.profileKp7ShortId(profileId.value))
|
||||
// .then((res) => {
|
||||
|
|
@ -866,7 +872,7 @@ const clickKp7Short = async () => {
|
|||
// })
|
||||
// .catch((e) => {messageError($q, e);})
|
||||
// .finally(() => {
|
||||
// loaderPage(false);
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
|
||||
|
|
@ -896,7 +902,7 @@ const clickRetire = async () => {
|
|||
const Retire = async () => {
|
||||
if (profileId.value !== "") {
|
||||
if (reasonStatus.value == true) {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileReactive(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -911,7 +917,7 @@ const Retire = async () => {
|
|||
router.push("/registry");
|
||||
});
|
||||
} else {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileDeactive(profileId.value), {
|
||||
leaveDate: dateToISO(leaveDate.value),
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,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 certificateNo = ref<string>();
|
||||
|
|
@ -487,7 +487,7 @@ onMounted(async () => {
|
|||
|
||||
const fetchData = async () => {
|
||||
if (profileId.value) {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileCertId(profileId.value))
|
||||
.then((res) => {
|
||||
|
|
@ -510,7 +510,7 @@ const fetchData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -599,7 +599,7 @@ const clickSave = async () => {
|
|||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileCertId(profileId.value), {
|
||||
id: id.value,
|
||||
|
|
@ -625,7 +625,7 @@ const saveData = async () => {
|
|||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileCertId(id.value), {
|
||||
id: id.value,
|
||||
|
|
@ -659,7 +659,7 @@ const clickDelete = async () => {
|
|||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profileCertId(id.value))
|
||||
.then((res) => {
|
||||
|
|
@ -773,7 +773,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
? "ประวัติแก้ไขใบอนุญาตของลูกจ้าง"
|
||||
: "ประวัติแก้ไขใบอนุญาตประกอบอาชีพ";
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileCertHisId(row.id))
|
||||
.then((res) => {
|
||||
|
|
@ -796,7 +796,7 @@ const clickHistory = async (row: RequestItemsObject) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,18 +56,12 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-12 q-pt-sm">
|
||||
<q-table
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumnsEmployeeTemp"
|
||||
:filter="filter"
|
||||
row-key="id"
|
||||
class="custom-header-table"
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
@ -90,6 +84,53 @@
|
|||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="newAgency"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.id)"
|
||||
>
|
||||
<div
|
||||
class="col-12"
|
||||
v-if="
|
||||
props.row.draftOrganizationOrganization == null &&
|
||||
props.row.draftPositionEmployee == null
|
||||
"
|
||||
>
|
||||
<div class="text-weight-medium">
|
||||
{{ "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" v-else>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.draftOrganizationOrganization ?? "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.draftPositionEmployee ?? "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td
|
||||
key="currentAgency"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.id)"
|
||||
>
|
||||
<div
|
||||
class="col-12"
|
||||
v-if="props.row.oc == null && props.row.position == null"
|
||||
>
|
||||
<div class="text-weight-medium">
|
||||
{{ "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12" v-else>
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.oc ?? "-" }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.position ?? "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<!-- <q-td
|
||||
key="positionEmployeePosition"
|
||||
:props="props"
|
||||
@click="redirectToPage(props.row.id)"
|
||||
|
|
@ -119,7 +160,7 @@
|
|||
</q-td>
|
||||
<q-td key="oc" :props="props" @click="redirectToPage(props.row.id)">
|
||||
{{ props.row.oc }}
|
||||
</q-td>
|
||||
</q-td> -->
|
||||
<q-td
|
||||
key="amount"
|
||||
:props="props"
|
||||
|
|
@ -231,7 +272,7 @@
|
|||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickDelete('test')"
|
||||
@click="clickDelete(props.row.id)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
|
|
@ -250,19 +291,7 @@
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
|
|
@ -416,18 +445,6 @@
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
|
||||
|
|
@ -439,7 +456,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, useAttrs } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QInput, QForm, QTableProps } from "quasar";
|
||||
|
|
@ -502,13 +519,6 @@ const columnsModal = [
|
|||
},
|
||||
];
|
||||
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const visibleColumnsOrder = ref<String[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
|
|
@ -548,9 +558,11 @@ visibleColumnsEmployeeTemp.value = [
|
|||
"salaryDate",
|
||||
"age",
|
||||
"amount",
|
||||
"isLeave",
|
||||
"leaveDateOrder",
|
||||
"newAgency",
|
||||
"currentAgency",
|
||||
];
|
||||
// "isLeave",
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -575,13 +587,12 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
|
||||
{
|
||||
name: "positionEmployeePosition",
|
||||
name: "newAgency",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
label: "หน่วยงานที่รับการบรรจุ",
|
||||
sortable: true,
|
||||
field: "positionEmployeePosition",
|
||||
field: "newAgency",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -591,25 +602,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
}),
|
||||
},
|
||||
{
|
||||
name: "positionEmployeePositionSide",
|
||||
name: "currentAgency",
|
||||
align: "left",
|
||||
label: "ด้านของตำแหน่ง",
|
||||
label: "หน่วยงานปัจจุบัน",
|
||||
sortable: true,
|
||||
field: "positionEmployeePositionSide",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "positionLine",
|
||||
align: "left",
|
||||
label: "สายงาน",
|
||||
sortable: true,
|
||||
field: "positionLine",
|
||||
field: "currentAgency",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -619,34 +616,77 @@ const columns = ref<QTableProps["columns"]>([
|
|||
}),
|
||||
},
|
||||
|
||||
{
|
||||
name: "positionEmployeeGroup",
|
||||
align: "left",
|
||||
label: "กลุ่มงาน",
|
||||
sortable: true,
|
||||
field: "positionEmployeeGroup",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "oc",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "oc",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
// {
|
||||
// name: "positionEmployeePosition",
|
||||
// align: "left",
|
||||
// label: "ตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "positionEmployeePosition",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, {
|
||||
// numeric: true,
|
||||
// sensitivity: "base",
|
||||
// }),
|
||||
// },
|
||||
// {
|
||||
// name: "positionEmployeePositionSide",
|
||||
// align: "left",
|
||||
// label: "ด้านของตำแหน่ง",
|
||||
// sortable: true,
|
||||
// field: "positionEmployeePositionSide",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, {
|
||||
// numeric: true,
|
||||
// sensitivity: "base",
|
||||
// }),
|
||||
// },
|
||||
// {
|
||||
// name: "positionLine",
|
||||
// align: "left",
|
||||
// label: "สายงาน",
|
||||
// sortable: true,
|
||||
// field: "positionLine",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, {
|
||||
// numeric: true,
|
||||
// sensitivity: "base",
|
||||
// }),
|
||||
// },
|
||||
|
||||
// {
|
||||
// name: "positionEmployeeGroup",
|
||||
// align: "left",
|
||||
// label: "กลุ่มงาน",
|
||||
// sortable: true,
|
||||
// field: "positionEmployeeGroup",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, {
|
||||
// numeric: true,
|
||||
// sensitivity: "base",
|
||||
// }),
|
||||
// },
|
||||
// {
|
||||
// name: "oc",
|
||||
// align: "left",
|
||||
// label: "สังกัด",
|
||||
// sortable: true,
|
||||
// field: "oc",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, {
|
||||
// numeric: true,
|
||||
// sensitivity: "base",
|
||||
// }),
|
||||
// },
|
||||
{
|
||||
name: "amount",
|
||||
align: "left",
|
||||
|
|
@ -751,17 +791,17 @@ const columns = ref<QTableProps["columns"]>([
|
|||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "isLeave",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "isLeave",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
// {
|
||||
// name: "isLeave",
|
||||
// align: "left",
|
||||
// label: "สถานะ",
|
||||
// sortable: true,
|
||||
// field: "isLeave",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// // sort: (a: string, b: string) =>
|
||||
// // a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
// },
|
||||
{
|
||||
name: "leaveDateOrder",
|
||||
align: "left",
|
||||
|
|
@ -1204,7 +1244,6 @@ const getPosition = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
const clickAddOrder = () => {
|
||||
modaladdOrder.value = true;
|
||||
|
|
@ -1304,14 +1343,7 @@ const modalOpenClose = () => {
|
|||
};
|
||||
|
||||
const next = (id: string) => {
|
||||
router.push(`/registryEmployee/${id}`);
|
||||
};
|
||||
|
||||
const paginationLabel = (start: number, end: number, total: number) => {
|
||||
// if (props.paging == true)
|
||||
// return " " + start + " ใน " + end + " จากจำนวน " + total + " รายการ";
|
||||
// else
|
||||
return start + "-" + end + " ใน " + total;
|
||||
router.push(`/registry-employee/${id}`);
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
|
|
@ -1349,13 +1381,13 @@ const clickClose = async () => {
|
|||
const clickAdd = () => {
|
||||
// modal.value = true;
|
||||
|
||||
router.push(`/employee/add`);
|
||||
router.push(`/registry-employee/add`);
|
||||
// router.push(`/placement/detail`);
|
||||
};
|
||||
|
||||
// ดูรายการแก้ไขรายชื่อ
|
||||
const redirectToPage = (profileId?: string) => {
|
||||
router.push(`/employee/Edit/${profileId}`);
|
||||
const redirectToPage = (id?: string) => {
|
||||
router.push(`/registry-employee/edit/${id}`);
|
||||
};
|
||||
const editDetail = async (row: any) => {
|
||||
await getPosition(row.id);
|
||||
|
|
@ -1429,7 +1461,7 @@ const showEmployeeTemp = async () => {
|
|||
if (selected.value == null || selected.value == "") return;
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.searchProfileByOcId(selected.value, "all"), {
|
||||
.post(config.API.searchProfileTemp("all"), {
|
||||
criterias: cirteria,
|
||||
})
|
||||
.then((res) => {
|
||||
|
|
@ -1462,6 +1494,10 @@ const showEmployeeTemp = async () => {
|
|||
e.leaveDateOrder == null
|
||||
? null
|
||||
: date2Thai(new Date(e.leaveDateOrder)),
|
||||
newAgency: "",
|
||||
currentAgency: "",
|
||||
draftPositionEmployee: e.draftPositionEmployee,
|
||||
draftOrganizationOrganization: e.draftOrganizationOrganization,
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
@ -1489,7 +1525,7 @@ const showEmployeeTempOrder = async () => {
|
|||
if (selected.value == null || selected.value == "") return;
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.searchProfileByOcId(selected.value, "all"), {
|
||||
.post(config.API.searchProfileTemp("all"), {
|
||||
criterias: cirteria,
|
||||
})
|
||||
.then((res) => {
|
||||
|
|
@ -1522,6 +1558,10 @@ const showEmployeeTempOrder = async () => {
|
|||
e.leaveDateOrder == null
|
||||
? null
|
||||
: date2Thai(new Date(e.leaveDateOrder)),
|
||||
newAgency: "",
|
||||
currentAgency: "",
|
||||
draftPositionEmployee: e.draftPositionEmployee,
|
||||
draftOrganizationOrganization: e.draftOrganizationOrganization,
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
@ -1530,7 +1570,7 @@ const showEmployeeTempOrder = async () => {
|
|||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
console.log(rowsOrder);
|
||||
// console.log(rowsOrder);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1540,34 +1580,4 @@ const onSelected = async (id: string) => {
|
|||
|
||||
const deleteData = async (id: string) => {};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
.custom-header-table {
|
||||
max-height: 64vh;
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,11 @@
|
|||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
:model-value="date2Thai(informaData.birthDate)"
|
||||
:model-value="
|
||||
informaData.birthDate == null
|
||||
? null
|
||||
: date2Thai(informaData.birthDate)
|
||||
"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
|
||||
:label="`${'วัน/เดือน/ปี เกิด'}`"
|
||||
>
|
||||
|
|
@ -386,7 +390,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,
|
||||
|
|
@ -427,9 +431,16 @@ const router = useRouter();
|
|||
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);
|
||||
|
|
@ -689,7 +700,7 @@ const defaultAdd = () => {
|
|||
prefixId: null,
|
||||
firstname: null,
|
||||
lastname: null,
|
||||
birthDate: new Date(),
|
||||
birthDate: null,
|
||||
genderId: null,
|
||||
bloodId: null,
|
||||
nationality: null,
|
||||
|
|
@ -715,7 +726,7 @@ const onCancel = async () => {
|
|||
* get รายการ ข้อมูลเกี่ยวกับบุคคล
|
||||
*/
|
||||
const fetchPerson = async () => {
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.person)
|
||||
.then((res) => {
|
||||
|
|
@ -772,7 +783,7 @@ const fetchPerson = async () => {
|
|||
})
|
||||
.catch((e: any) => {})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -787,7 +798,7 @@ const changeCardID = async (value: string | number | null) => {
|
|||
|
||||
const checkCitizen = async (id: string) => {
|
||||
console.log("String");
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileCitizenId(id))
|
||||
.then((res) => {
|
||||
|
|
@ -812,7 +823,7 @@ const checkCitizen = async (id: string) => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -821,7 +832,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) => {
|
||||
|
|
@ -862,7 +873,7 @@ const clickHistory = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -938,7 +949,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) => {
|
||||
|
|
@ -954,14 +965,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) => {
|
||||
|
|
@ -999,7 +1010,7 @@ const fetchData = async () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
// loaderPage(false);
|
||||
// hideLoader();
|
||||
await props.fetchDataProfile();
|
||||
});
|
||||
}
|
||||
|
|
@ -1026,7 +1037,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) => {
|
||||
|
|
@ -1040,7 +1051,7 @@ const editData = async () => {
|
|||
emit("update:statusEdit", false);
|
||||
await fetchData();
|
||||
await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -1065,7 +1076,7 @@ const addData = async () => {
|
|||
profileType: informaData.value.profileType,
|
||||
createdFullName: "-",
|
||||
};
|
||||
loaderPage(true);
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profileEmployeeIn, body)
|
||||
.then((res) => {
|
||||
|
|
@ -1079,10 +1090,10 @@ const addData = async () => {
|
|||
emit("update:statusEdit", false);
|
||||
await fetchData();
|
||||
await changeBirth(informaData.value.birthDate ?? new Date());
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
});
|
||||
console.log(body);
|
||||
loaderPage(false);
|
||||
hideLoader();
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
|
|
@ -1098,7 +1109,7 @@ const saveData = async () => {
|
|||
};
|
||||
|
||||
const clickBack = () => {
|
||||
router.push({ name: "registryEmployee" });
|
||||
router.push("/registry-employee");
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue