fixing route
This commit is contained in:
parent
1333e53c63
commit
d0ac01b92e
5 changed files with 32 additions and 22 deletions
|
|
@ -22,7 +22,7 @@ const retireDate = ref<Date>();
|
|||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||
|
||||
const isEmployee = defineModel("isEmployee", { type: String });
|
||||
const empType = ref<string>("");
|
||||
const empType = ref<string>("officer");
|
||||
/** props*/
|
||||
const props = defineProps({
|
||||
id: {
|
||||
|
|
@ -95,7 +95,12 @@ function calculateAge(birthDate: Date | null) {
|
|||
async function fetchInformation(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgProfileById(id, empType.value))
|
||||
.get(
|
||||
config.API.orgProfileById(
|
||||
id,
|
||||
`${empType.value == "employee" ? `-${empType.value}` : ""}`
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
imformation.prefix = data.prefix ? data.prefix : "-";
|
||||
|
|
@ -128,7 +133,12 @@ async function fetchInformation(id: string) {
|
|||
async function fetchProfileGov(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewGovernmentById(id, empType.value))
|
||||
.get(
|
||||
config.API.profileNewGovernmentById(
|
||||
id,
|
||||
`${empType.value == "employee" ? `-${empType.value}` : ""}`
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
goverment.oc = data.org !== "" ? data.org : "-";
|
||||
|
|
@ -155,7 +165,7 @@ async function fetchProfileGov(id: string) {
|
|||
}
|
||||
|
||||
function redirecToRegistry() {
|
||||
router.push(`/registry-officer${empType.value}/${props.id}`);
|
||||
router.push(`/registry-${empType.value}/${props.id}`);
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
|
|
@ -168,8 +178,8 @@ watch(
|
|||
empType.value =
|
||||
route.name === "appoint-employee-detail" ||
|
||||
isEmployee.value == "EMPLOYEE"
|
||||
? "-employee"
|
||||
: "";
|
||||
? "employee"
|
||||
: "officer";
|
||||
|
||||
fetchInformation(props.id);
|
||||
fetchProfileGov(props.id);
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ const putData = () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
router.push(`/exit-Interview`);
|
||||
router.push(`/retirement/exit-interview`);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ const openModalCalendar = (rows: any) => {
|
|||
color="blue-9"
|
||||
icon="mdi-square-edit-outline"
|
||||
outline
|
||||
@click="$router.push('/retirement/exit-Interview/edit-question')"
|
||||
@click="$router.push('/retirement/exit-interview/edit-question')"
|
||||
><span class="q-pl-sm">แก้ไขคำถาม</span></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
@ -374,7 +374,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -385,7 +385,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -396,7 +396,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -407,7 +407,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -418,7 +418,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -429,7 +429,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -440,7 +440,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -452,7 +452,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -465,7 +465,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
@ -478,7 +478,7 @@ const openModalCalendar = (rows: any) => {
|
|||
:props="props"
|
||||
@click="
|
||||
router.push(
|
||||
`/retirement/exit-Interview/questionnair/${props.row.id}`
|
||||
`/retirement/exit-interview/questionnair/${props.row.id}`
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ const putData = () => {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
router.push(`/exit-Interview`);
|
||||
router.push(`/retirement/exit-interview`);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/exit-Interview",
|
||||
path: "/retirement/exit-interview",
|
||||
name: "exit-Interview",
|
||||
component: exitInterviewMain,
|
||||
meta: {
|
||||
|
|
@ -93,7 +93,7 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/exit-Interview/questionnair/:id",
|
||||
path: "/retirement/exit-interview/questionnair/:id",
|
||||
name: "exit-Interview-details",
|
||||
component: exitInterviewDetails,
|
||||
meta: {
|
||||
|
|
@ -103,7 +103,7 @@ export default [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: "/retirement/exit-Interview/edit-question",
|
||||
path: "/retirement/exit-interview/edit-question",
|
||||
name: "ExitInterviewEditQuestion",
|
||||
component: exitInterviewEditQuestion,
|
||||
meta: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue