fixing insignia deputy
This commit is contained in:
parent
cc1927a2f4
commit
ae9e989a14
5 changed files with 31 additions and 13 deletions
|
|
@ -308,7 +308,11 @@ const person = ref<DataManageList>();
|
||||||
/** เช็คสถานนะแสดงปุ่มเพิ่ม*/
|
/** เช็คสถานนะแสดงปุ่มเพิ่ม*/
|
||||||
const checkStatus = computed(() => {
|
const checkStatus = computed(() => {
|
||||||
if (
|
if (
|
||||||
DataStore.isStaff &&
|
((DataStore.isOfficer &&
|
||||||
|
DataStore.optionsTypeOc.findIndex(
|
||||||
|
(v: OptionData) => v.id === organization.value && v.isDeputy === true
|
||||||
|
) > -1) ||
|
||||||
|
DataStore.isStaff) &&
|
||||||
(DataStore.requestStatus == "st1" || DataStore.requestStatus == "st4")
|
(DataStore.requestStatus == "st1" || DataStore.requestStatus == "st4")
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -846,9 +850,10 @@ function clearInsigniaFilters(name: string) {
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => DataStore.typeOc,
|
() => DataStore.typeOc,
|
||||||
async () => {
|
() => {
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
filterOrganizationOP.value = DataStore.optionsTypeOc;
|
||||||
organization.value = await DataStore.typeOc;
|
organization.value = DataStore.typeOc;
|
||||||
|
DataStore.selectOrganization = DataStore.typeOc;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -890,6 +895,7 @@ function onClickViewInfo(type: string, id: string, empClass: string) {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||||
organization.value = DataStore.typeOc;
|
organization.value = DataStore.typeOc;
|
||||||
|
DataStore.selectOrganization = DataStore.typeOc;
|
||||||
|
|
||||||
if (organization.value !== "" || organization.value !== undefined) {
|
if (organization.value !== "" || organization.value !== undefined) {
|
||||||
if (props.fecthInsigniaByOc) {
|
if (props.fecthInsigniaByOc) {
|
||||||
|
|
|
||||||
|
|
@ -269,7 +269,8 @@ function onSearch() {
|
||||||
/*** Hook*/
|
/*** Hook*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||||
organization.value = await DataStore.typeOc;
|
organization.value = DataStore.typeOc;
|
||||||
|
DataStore.selectOrganization = DataStore.typeOc;
|
||||||
if (organization.value !== "" || organization.value !== undefined) {
|
if (organization.value !== "" || organization.value !== undefined) {
|
||||||
if (props.fecthInsigniaByOc) {
|
if (props.fecthInsigniaByOc) {
|
||||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||||
|
|
@ -293,6 +294,7 @@ watch(
|
||||||
async () => {
|
async () => {
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
||||||
organization.value = await DataStore.typeOc;
|
organization.value = await DataStore.typeOc;
|
||||||
|
DataStore.selectOrganization = DataStore.typeOc;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -271,15 +271,17 @@ function onSearch() {
|
||||||
watch(
|
watch(
|
||||||
() => DataStore.typeOc,
|
() => DataStore.typeOc,
|
||||||
async () => {
|
async () => {
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
filterOrganizationOP.value = DataStore.optionsTypeOc;
|
||||||
organization.value = await DataStore.typeOc;
|
organization.value = DataStore.typeOc;
|
||||||
|
DataStore.selectOrganization = DataStore.typeOc;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
/** Hook*/
|
/** Hook*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
filterOrganizationOP.value = await DataStore.optionsTypeOc;
|
filterOrganizationOP.value = DataStore.optionsTypeOc;
|
||||||
organization.value = await DataStore.typeOc;
|
organization.value = DataStore.typeOc;
|
||||||
|
DataStore.selectOrganization = DataStore.typeOc;
|
||||||
if (organization.value !== "" || organization.value !== undefined) {
|
if (organization.value !== "" || organization.value !== undefined) {
|
||||||
if (props.fecthInsigniaByOc) {
|
if (props.fecthInsigniaByOc) {
|
||||||
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
isDeputy.value = await (DataStore.optionsTypeOc.findIndex(
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
const isOfficer = ref<boolean>(false);
|
const isOfficer = ref<boolean>(false);
|
||||||
const isStaff = ref<boolean>(false);
|
const isStaff = ref<boolean>(false);
|
||||||
const isDirector = ref<boolean>(false);
|
const isDirector = ref<boolean>(false);
|
||||||
|
const isDeputy = ref<boolean>(false);
|
||||||
|
const selectOrganization = ref<string>("");
|
||||||
|
|
||||||
/** option รายงาน */
|
/** option รายงาน */
|
||||||
const optionReport = ref<OptionReport[]>([
|
const optionReport = ref<OptionReport[]>([
|
||||||
|
|
@ -285,5 +287,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
||||||
isStaff,
|
isStaff,
|
||||||
isOfficer,
|
isOfficer,
|
||||||
isDirector,
|
isDirector,
|
||||||
|
isDeputy,
|
||||||
|
selectOrganization,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,7 @@ async function fecthAgency(id: string) {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
DataStore.agency = res.data.result.rootId;
|
DataStore.agency = res.data.result.rootId;
|
||||||
|
DataStore.selectOrganization = res.data.result.rootId;
|
||||||
DataStore.typeOc = DataStore.agency;
|
DataStore.typeOc = DataStore.agency;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -190,6 +191,7 @@ async function fetchCheckIsofficer() {
|
||||||
DataStore.isStaff = data.isStaff;
|
DataStore.isStaff = data.isStaff;
|
||||||
DataStore.isOfficer = data.isOfficer;
|
DataStore.isOfficer = data.isOfficer;
|
||||||
DataStore.isDirector = data.isDirector;
|
DataStore.isDirector = data.isDirector;
|
||||||
|
DataStore.isDeputy = data.isDeputy;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -556,7 +558,7 @@ onUnmounted(() => {
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="
|
||||||
(DataStore.isStaff && requestStatus == 'st4') ||
|
(((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex((v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) && requestStatus == 'st4') ||
|
||||||
(DataStore.isDirector && requestStatus == 'st5')
|
(DataStore.isDirector && requestStatus == 'st5')
|
||||||
"
|
"
|
||||||
class="q-pa-md q-gutter-sm"
|
class="q-pa-md q-gutter-sm"
|
||||||
|
|
@ -634,7 +636,7 @@ onUnmounted(() => {
|
||||||
|
|
||||||
<q-toolbar class="q-py-md text-right">
|
<q-toolbar class="q-py-md text-right">
|
||||||
<q-file
|
<q-file
|
||||||
v-if="DataStore.isStaff && checkPermission($route)?.attrIsUpdate"
|
v-if="((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex((v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) && checkPermission($route)?.attrIsUpdate"
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
clearable
|
clearable
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -665,7 +667,7 @@ onUnmounted(() => {
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="primary"
|
color="primary"
|
||||||
v-if="DataStore.isStaff && checkPermission($route)?.attrIsGet"
|
v-if="checkPermission($route)?.attrIsGet"
|
||||||
:href="document"
|
:href="document"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
|
|
@ -684,9 +686,11 @@ onUnmounted(() => {
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
DataStore.isStaff &&
|
((DataStore.isOfficer && DataStore.optionsTypeOc.findIndex(
|
||||||
|
(v: OptionData) => v.id === DataStore.selectOrganization && v.isDeputy === true) > -1) || DataStore.isStaff) &&
|
||||||
(requestStatus == 'st1' || requestStatus == 'st4') &&
|
(requestStatus == 'st1' || requestStatus == 'st4') &&
|
||||||
checkPermission($route)?.attrIsUpdate
|
checkPermission($route)?.attrIsUpdate
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue