Merge branch 'develop' into dev-tee
This commit is contained in:
commit
b0bc090d83
6 changed files with 36 additions and 52 deletions
|
|
@ -153,7 +153,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานะ",
|
label: "ทดลองปฏิบัติหน้าที่ราชการ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "status",
|
field: "status",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -474,8 +474,8 @@ const paginationLabel2 = (start: string, end: string, total: string) => {
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'status'">
|
<div v-else-if="col.name == 'status'" class="text-center">
|
||||||
<q-icon v-if="col.value === true" name="mdi-check" color="positive" />
|
<q-icon v-if="col.value === true" name="mdi-check" color="positive" size="sm"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ const name = ref<string>("");
|
||||||
const position_line = ref<string>("");
|
const position_line = ref<string>("");
|
||||||
const position_level = ref<string>("");
|
const position_level = ref<string>("");
|
||||||
const organization = ref<string>("");
|
const organization = ref<string>("");
|
||||||
const probation_status = ref<number>();
|
const probation_status = ref<any>();
|
||||||
const probation_statusold = ref<string>("");
|
const probation_statusold = ref<string>("");
|
||||||
const avatarprofile = ref<string>("");
|
const avatarprofile = ref<string>("");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||||
|
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
@ -22,6 +23,7 @@ const {
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
|
const roleDataStore = useroleUserDataStore();
|
||||||
|
|
||||||
const modalNote = ref<boolean>(false);
|
const modalNote = ref<boolean>(false);
|
||||||
const modelPopupReject = ref<boolean>(false);
|
const modelPopupReject = ref<boolean>(false);
|
||||||
|
|
@ -201,9 +203,6 @@ const props = defineProps({
|
||||||
fecthInsigniaByOc: {
|
fecthInsigniaByOc: {
|
||||||
type: Function,
|
type: Function,
|
||||||
},
|
},
|
||||||
roleUser: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
roundName: {
|
roundName: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
|
@ -231,7 +230,7 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
const checkStatus = computed(() => {
|
const checkStatus = computed(() => {
|
||||||
if (
|
if (
|
||||||
DataStore.roleUser === "insignia1" &&
|
roleDataStore.insignia1Role &&
|
||||||
(DataStore.requestStatus == "st1" || DataStore.requestStatus == "st4")
|
(DataStore.requestStatus == "st1" || DataStore.requestStatus == "st4")
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -574,7 +573,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="row col-12 q-col-gutter-sm">
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<q-select
|
<q-select
|
||||||
v-if="props.roleUser == 'admin'"
|
v-if="roleDataStore.adminRole"
|
||||||
v-model="organization"
|
v-model="organization"
|
||||||
label="หน่วยงาน"
|
label="หน่วยงาน"
|
||||||
dense
|
dense
|
||||||
|
|
@ -683,7 +682,7 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
||||||
v-if="
|
v-if="
|
||||||
(DataStore.isLock == false &&
|
(DataStore.isLock == false &&
|
||||||
DataStore.requestStatus == 'st5' &&
|
DataStore.requestStatus == 'st5' &&
|
||||||
DataStore.roleUser == 'admin') ||
|
roleDataStore.adminRole) ||
|
||||||
checkStatus == true
|
checkStatus == true
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
@ -804,14 +803,14 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
||||||
v-if="
|
v-if="
|
||||||
(DataStore.isLock == false &&
|
(DataStore.isLock == false &&
|
||||||
DataStore.requestStatus == 'st5' &&
|
DataStore.requestStatus == 'st5' &&
|
||||||
DataStore.roleUser == 'admin') ||
|
roleDataStore.adminRole) ||
|
||||||
checkStatus == true
|
checkStatus == true
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
roleUser == 'admin' ||
|
roleDataStore.adminRole ||
|
||||||
(roleUser == 'insignia1' &&
|
(roleDataStore.insignia1Role &&
|
||||||
(requestStatus == 'st1' || requestStatus == 'st4'))
|
(requestStatus == 'st1' || requestStatus == 'st4'))
|
||||||
"
|
"
|
||||||
icon="mdi-dots-vertical"
|
icon="mdi-dots-vertical"
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,9 @@ import type { QTableProps } from "quasar";
|
||||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import DialogInformation from "@/components/Dialogs/Information.vue";
|
import DialogInformation from "@/components/Dialogs/Information.vue";
|
||||||
|
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||||
|
|
||||||
|
const roleDataStore = useroleUserDataStore();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
|
|
@ -20,9 +23,6 @@ const props = defineProps({
|
||||||
fecthInsigniaByOc: {
|
fecthInsigniaByOc: {
|
||||||
type: Function,
|
type: Function,
|
||||||
},
|
},
|
||||||
roleUser: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const organization = ref<string>("1");
|
const organization = ref<string>("1");
|
||||||
|
|
@ -213,7 +213,7 @@ const closeReson = () => {
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="row col-12 q-col-gutter-sm">
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<q-select
|
<q-select
|
||||||
v-if="props.roleUser == 'admin'"
|
v-if="roleDataStore.adminRole"
|
||||||
v-model="organization"
|
v-model="organization"
|
||||||
label="หน่วยงาน"
|
label="หน่วยงาน"
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ import type { QTableProps } from "quasar";
|
||||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import DialogInformation from "@/components/Dialogs/Information.vue";
|
import DialogInformation from "@/components/Dialogs/Information.vue";
|
||||||
|
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||||
|
|
||||||
|
const roleDataStore = useroleUserDataStore();
|
||||||
|
const { adminRole } = roleDataStore;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
|
|
@ -21,9 +25,6 @@ const props = defineProps({
|
||||||
fecthInsigniaByOc: {
|
fecthInsigniaByOc: {
|
||||||
type: Function,
|
type: Function,
|
||||||
},
|
},
|
||||||
roleUser: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const organization = ref<string>("1");
|
const organization = ref<string>("1");
|
||||||
|
|
@ -143,7 +144,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
||||||
organizationOptions.value = DataStore.optionsTypeOc;
|
organizationOptions.value = DataStore.optionsTypeOc;
|
||||||
organization.value = await (DataStore.agency != null
|
organization.value = await (DataStore.agency != null
|
||||||
? DataStore.agency
|
? DataStore.agency
|
||||||
|
|
@ -211,7 +211,7 @@ const closeReson = () => {
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="row col-12 q-col-gutter-sm">
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<q-select
|
<q-select
|
||||||
v-if="props.roleUser == 'admin'"
|
v-if="roleDataStore.adminRole"
|
||||||
v-model="organization"
|
v-model="organization"
|
||||||
label="หน่วยงาน"
|
label="หน่วยงาน"
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import config from "@/app.config";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||||
|
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||||
|
|
||||||
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
|
import cardTop from "@/modules/07_insignia/components/2_Manage/StatCard.vue";
|
||||||
import tab1 from "@/modules/07_insignia/components/2_Manage/Tab1.vue";
|
import tab1 from "@/modules/07_insignia/components/2_Manage/Tab1.vue";
|
||||||
|
|
@ -18,6 +19,7 @@ import keycloak from "@/plugins/keycloak";
|
||||||
|
|
||||||
const roleUser = ref<string>("admin");
|
const roleUser = ref<string>("admin");
|
||||||
|
|
||||||
|
const roleDataStore = useroleUserDataStore();
|
||||||
const DataStore = useInsigniaDataStore();
|
const DataStore = useInsigniaDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
||||||
|
|
@ -40,25 +42,9 @@ const stat = ref<any>({
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
tab.value = DataStore.mainTab;
|
tab.value = DataStore.mainTab;
|
||||||
await checkRole();
|
|
||||||
await fecthlistRound();
|
await fecthlistRound();
|
||||||
});
|
});
|
||||||
|
|
||||||
const checkRole = async () => {
|
|
||||||
if (keycloak.tokenParsed != null) {
|
|
||||||
const insignia1 = await keycloak.tokenParsed.role.includes("insignia1");
|
|
||||||
const insignia2 = await keycloak.tokenParsed.role.includes("insignia2");
|
|
||||||
if (insignia1) {
|
|
||||||
roleUser.value = "insignia1";
|
|
||||||
} else if (insignia2) {
|
|
||||||
roleUser.value = "insignia2";
|
|
||||||
} else {
|
|
||||||
roleUser.value = "admin";
|
|
||||||
}
|
|
||||||
DataStore.roleUser = roleUser.value;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const fecthlistRound = async () => {
|
const fecthlistRound = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.listRoundInsignia())
|
.get(config.API.listRoundInsignia())
|
||||||
|
|
@ -104,7 +90,7 @@ const fecthAgency = async () => {
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
DataStore.agency = res.data.result;
|
DataStore.agency = res.data.result;
|
||||||
loadview.value = true;
|
loadview.value = true;
|
||||||
if (roleUser.value == "admin") {
|
if (roleDataStore.adminRole) {
|
||||||
await fecthType();
|
await fecthType();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -331,7 +317,9 @@ const requestSendNote = async () => {
|
||||||
<q-space />
|
<q-space />
|
||||||
<!-- สกจ. Freez ข้อมูล -->
|
<!-- สกจ. Freez ข้อมูล -->
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="roleUser == 'admin' && DataStore.isLock !== true && hideBottom"
|
v-if="
|
||||||
|
roleDataStore.adminRole && DataStore.isLock !== true && hideBottom
|
||||||
|
"
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
label="ล็อกข้อมูล"
|
label="ล็อกข้อมูล"
|
||||||
|
|
@ -343,7 +331,7 @@ const requestSendNote = async () => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div v-if="roleUser == 'admin'" class="col-12 row bg-white">
|
<div v-if="roleDataStore.adminRole" class="col-12 row bg-white">
|
||||||
<div class="fit q-px-md q-py-sm">
|
<div class="fit q-px-md q-py-sm">
|
||||||
<div class="row col-12 q-col-gutter-sm fit">
|
<div class="row col-12 q-col-gutter-sm fit">
|
||||||
<cardTop
|
<cardTop
|
||||||
|
|
@ -380,7 +368,7 @@ const requestSendNote = async () => {
|
||||||
|
|
||||||
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
|
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
|
||||||
<div
|
<div
|
||||||
v-if="roleUser == 'insignia1' && requestStatus == 'st4'"
|
v-if="roleDataStore.insignia1Role && requestStatus == 'st4'"
|
||||||
class="q-pa-md q-gutter-sm"
|
class="q-pa-md q-gutter-sm"
|
||||||
>
|
>
|
||||||
<q-banner
|
<q-banner
|
||||||
|
|
@ -406,7 +394,7 @@ const requestSendNote = async () => {
|
||||||
<q-tab name="reject" label="คนที่ไม่ยื่นขอ" />
|
<q-tab name="reject" label="คนที่ไม่ยื่นขอ" />
|
||||||
<q-tab name="delete" label="คนที่ถูกลบออก" />
|
<q-tab name="delete" label="คนที่ถูกลบออก" />
|
||||||
<q-tab
|
<q-tab
|
||||||
v-if="roleUser == 'admin'"
|
v-if="roleDataStore.adminRole"
|
||||||
name="organization"
|
name="organization"
|
||||||
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
|
label="หน่วยงานที่ยังไม่ได้ส่งรายชื่อ"
|
||||||
/>
|
/>
|
||||||
|
|
@ -420,7 +408,6 @@ const requestSendNote = async () => {
|
||||||
:roundId="round"
|
:roundId="round"
|
||||||
:roundName="roundName"
|
:roundName="roundName"
|
||||||
:fecthInsigniaByOc="fecthInsigniaByOc"
|
:fecthInsigniaByOc="fecthInsigniaByOc"
|
||||||
:role-user="roleUser"
|
|
||||||
:request-status="requestStatus"
|
:request-status="requestStatus"
|
||||||
/>
|
/>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
@ -429,7 +416,6 @@ const requestSendNote = async () => {
|
||||||
:tab="tab"
|
:tab="tab"
|
||||||
:roundId="round"
|
:roundId="round"
|
||||||
:fecthInsigniaByOc="fecthInsigniaByOc"
|
:fecthInsigniaByOc="fecthInsigniaByOc"
|
||||||
:role-user="roleUser"
|
|
||||||
/>
|
/>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel name="delete" class="q-pa-none">
|
<q-tab-panel name="delete" class="q-pa-none">
|
||||||
|
|
@ -437,23 +423,22 @@ const requestSendNote = async () => {
|
||||||
:tab="tab"
|
:tab="tab"
|
||||||
:roundId="round"
|
:roundId="round"
|
||||||
:fecthInsigniaByOc="fecthInsigniaByOc"
|
:fecthInsigniaByOc="fecthInsigniaByOc"
|
||||||
:role-user="roleUser"
|
|
||||||
/>
|
/>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
<q-tab-panel
|
<q-tab-panel
|
||||||
v-if="roleUser == 'admin'"
|
v-if="roleDataStore.adminRole"
|
||||||
name="organization"
|
name="organization"
|
||||||
class="q-pa-none"
|
class="q-pa-none"
|
||||||
>
|
>
|
||||||
<tab4 :tab="tab" :roundId="round" :role-user="roleUser" />
|
<tab4 :tab="tab" :roundId="round" />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
|
<!-- :role-user="roleUser" -->
|
||||||
<q-toolbar class="q-py-md text-right">
|
<q-toolbar class="q-py-md text-right">
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
roleUser == 'insignia1' &&
|
roleDataStore.insignia1Role &&
|
||||||
(requestStatus == 'st1' || requestStatus == 'st4')
|
(requestStatus == 'st1' || requestStatus == 'st4')
|
||||||
"
|
"
|
||||||
dense
|
dense
|
||||||
|
|
@ -464,7 +449,7 @@ const requestSendNote = async () => {
|
||||||
@click="sendToDirector"
|
@click="sendToDirector"
|
||||||
/>
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="roleUser == 'insignia2' && requestStatus == 'st3'"
|
v-if="roleDataStore.insignia2Role && requestStatus == 'st3'"
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
label="ตีกลับ"
|
label="ตีกลับ"
|
||||||
|
|
@ -473,7 +458,7 @@ const requestSendNote = async () => {
|
||||||
@click="popupBackToEdit"
|
@click="popupBackToEdit"
|
||||||
/>
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="roleUser == 'insignia2' && requestStatus == 'st3'"
|
v-if="roleDataStore.insignia2Role && requestStatus == 'st3'"
|
||||||
dense
|
dense
|
||||||
unelevated
|
unelevated
|
||||||
label="อนุมัติ"
|
label="อนุมัติ"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue