Merge branch 'develop' into nice_dev
This commit is contained in:
commit
788620f4e3
11 changed files with 178 additions and 32 deletions
|
|
@ -196,4 +196,8 @@ export default {
|
||||||
|
|
||||||
//สร้างข้อมูลราชการ
|
//สร้างข้อมูลราชการ
|
||||||
createProfileOfficer: () => `${profile}information/officer`,
|
createProfileOfficer: () => `${profile}information/officer`,
|
||||||
|
|
||||||
|
// verify
|
||||||
|
profileVerified: (profileId: string) => `${profile}verified/${profileId}`,
|
||||||
|
profileVerifiedUnlock: (profileId: string) => `${profile}not-verified/${profileId}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,7 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-card bordered class="col-12 row caedNone">
|
<q-card bordered class="col-12 row caedNone">
|
||||||
|
|
@ -208,19 +209,42 @@ watch(
|
||||||
class="row col-12 justify-between list-summary q-gutter-xs bg-grey-1 q-pb-xs q-pr-xs"
|
class="row col-12 justify-between list-summary q-gutter-xs bg-grey-1 q-pb-xs q-pr-xs"
|
||||||
>
|
>
|
||||||
<div class="row col q-pa-sm item">
|
<div class="row col q-pa-sm item">
|
||||||
<div class="ellipsis">ตำแหน่งทั้งหมด</div>
|
<div class="ellipsis">
|
||||||
|
ตำแหน่งทั้งหมด
|
||||||
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-badge color="secondary" :label="store.sumPosition.total" />
|
<q-badge
|
||||||
|
color="secondary"
|
||||||
|
:label="
|
||||||
|
reqMaster.isAll
|
||||||
|
? store.sumPosition.total
|
||||||
|
: store.sumPosition.totalRoot
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="row col q-pa-sm item">
|
<div class="row col q-pa-sm item">
|
||||||
<div class="ellipsis">ตำแหน่งที่มีคนครอง</div>
|
<div class="ellipsis">ตำแหน่งที่มีคนครอง</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-badge color="primary" :label="store.sumPosition.use" />
|
<q-badge
|
||||||
|
color="primary"
|
||||||
|
:label="
|
||||||
|
reqMaster.isAll
|
||||||
|
? store.sumPosition.use
|
||||||
|
: store.sumPosition.useRoot
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="row col q-pa-sm item">
|
<div class="row col q-pa-sm item">
|
||||||
<div class="ellipsis">ตำแหน่งว่าง</div>
|
<div class="ellipsis">ตำแหน่งว่าง</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-badge color="red" :label="store.sumPosition.vacant" />
|
<q-badge
|
||||||
|
color="red"
|
||||||
|
:label="
|
||||||
|
reqMaster.isAll
|
||||||
|
? store.sumPosition.vacant
|
||||||
|
: store.sumPosition.vacantRoot
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,12 @@ function updateSelected(data: DataTree) {
|
||||||
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
|
totalPositionCurrentVacant: data.totalPositionCurrentVacant,
|
||||||
totalPositionNextUse: data.totalPositionNextUse,
|
totalPositionNextUse: data.totalPositionNextUse,
|
||||||
totalPositionNextVacant: data.totalPositionNextVacant,
|
totalPositionNextVacant: data.totalPositionNextVacant,
|
||||||
|
totalRootPosition: data.totalRootPosition,
|
||||||
|
totalRootPositionCurrentUse: data.totalRootPositionCurrentUse,
|
||||||
|
totalRootPositionCurrentVacant: data.totalRootPositionCurrentVacant,
|
||||||
|
totalRootPositionNextUse: data.totalRootPositionNextUse,
|
||||||
|
totalRootPositionNextVacant: data.totalRootPositionNextVacant,
|
||||||
});
|
});
|
||||||
|
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -387,7 +391,7 @@ const modaeMenu = ref<boolean>(false);
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-white tree-container">
|
<div class="bg-white tree-container q-pa-xs">
|
||||||
<q-tree
|
<q-tree
|
||||||
class="q-pa-sm q-gutter-sm"
|
class="q-pa-sm q-gutter-sm"
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -26,7 +26,7 @@ import { useOrganizational } from "@/modules/02_organizationalNew/store/organiza
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const stroe = useOrganizational();
|
const store = useOrganizational();
|
||||||
const { showLoader, hideLoader, messageError, success, dialogRemove } =
|
const { showLoader, hideLoader, messageError, success, dialogRemove } =
|
||||||
useCounterMixin();
|
useCounterMixin();
|
||||||
|
|
||||||
|
|
@ -320,12 +320,37 @@ function openSelectPerson(data: DataPosition[]) {
|
||||||
modalSelectPerson.value = true;
|
modalSelectPerson.value = true;
|
||||||
dataDetailPos.value = data;
|
dataDetailPos.value = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ลบคนครอง */
|
||||||
|
function removePerson(data: DataPosition[]) {
|
||||||
|
dialogRemove(
|
||||||
|
$q,
|
||||||
|
async () => {
|
||||||
|
showLoader();
|
||||||
|
// await http
|
||||||
|
// .delete(config.API.orgPosMasterById(id))
|
||||||
|
// .then(() => {
|
||||||
|
// success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
// props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
"ยืนยันการลบคนครอง",
|
||||||
|
"ต้องการยืนยันการลบคนครองนี้ใช่หรือไม่?"
|
||||||
|
);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- TOOLBAR -->
|
<!-- TOOLBAR -->
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-toolbar style="padding: 0">
|
<q-toolbar style="padding: 0">
|
||||||
<div v-if="stroe.typeOrganizational === 'draft'">
|
<div v-if="store.typeOrganizational === 'draft'">
|
||||||
<q-btn
|
<q-btn
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
@ -467,21 +492,49 @@ function openSelectPerson(data: DataPosition[]) {
|
||||||
>
|
>
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list dense style="min-width: 150px">
|
<q-list dense style="min-width: 150px">
|
||||||
|
<!-- เลือกคนครอง -->
|
||||||
<q-item
|
<q-item
|
||||||
v-if="props.row.positionIsSelected == 'ว่าง' && stroe.typeOrganizational === 'draft'"
|
v-if="
|
||||||
|
props.row.positionIsSelected == 'ว่าง' &&
|
||||||
|
store.typeOrganizational === 'draft'
|
||||||
|
"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="openSelectPerson(props.row)"
|
@click="openSelectPerson(props.row)"
|
||||||
>
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
<q-icon color="secondary" size="17px" name="mdi-account-circle" />
|
<q-icon
|
||||||
|
color="secondary"
|
||||||
|
size="17px"
|
||||||
|
name="mdi-account"
|
||||||
|
/>
|
||||||
<div class="q-pl-md">เลือกคนครอง</div>
|
<div class="q-pl-md">เลือกคนครอง</div>
|
||||||
</div>
|
</div>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
v-for="(item, index) in stroe.typeOrganizational === 'draft'
|
v-else-if="
|
||||||
|
props.row.positionIsSelected != 'ว่าง' &&
|
||||||
|
store.typeOrganizational === 'draft'
|
||||||
|
"
|
||||||
|
clickable
|
||||||
|
v-close-popup
|
||||||
|
@click="removePerson(props.row)"
|
||||||
|
>
|
||||||
|
<q-item-section>
|
||||||
|
<div class="row items-center">
|
||||||
|
<q-icon
|
||||||
|
color="red"
|
||||||
|
size="17px"
|
||||||
|
name="mdi-account-remove"
|
||||||
|
/>
|
||||||
|
<div class="q-pl-md">ลบคนครอง</div>
|
||||||
|
</div>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item
|
||||||
|
v-for="(item, index) in store.typeOrganizational === 'draft'
|
||||||
? listMenu
|
? listMenu
|
||||||
: listMenu.filter(
|
: listMenu.filter(
|
||||||
(e) => e.type === 'HISTORY' || e.type === 'VIEWDETIAL'
|
(e) => e.type === 'HISTORY' || e.type === 'VIEWDETIAL'
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,13 @@ interface DataTree {
|
||||||
totalPositionCurrentVacant: number;
|
totalPositionCurrentVacant: number;
|
||||||
totalPositionNextUse: number;
|
totalPositionNextUse: number;
|
||||||
totalPositionNextVacant: number;
|
totalPositionNextVacant: number;
|
||||||
|
totalRootPosition: number;
|
||||||
|
totalRootPositionCurrentUse: number;
|
||||||
|
totalRootPositionCurrentVacant: number;
|
||||||
|
totalRootPositionNextUse: number;
|
||||||
|
totalRootPositionNextVacant: number;
|
||||||
|
|
||||||
children?: DataTree[];
|
children?: DataTree[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export type { DataPosition, Position, FormDetailPosition, DataTree };
|
export type { DataPosition, Position, FormDetailPosition, DataTree };
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@ interface SumPosition {
|
||||||
totalPositionCurrentVacant: number;
|
totalPositionCurrentVacant: number;
|
||||||
totalPositionNextUse: number;
|
totalPositionNextUse: number;
|
||||||
totalPositionNextVacant: number;
|
totalPositionNextVacant: number;
|
||||||
|
totalRootPosition: number;
|
||||||
|
totalRootPositionCurrentUse: number;
|
||||||
|
totalRootPositionCurrentVacant: number;
|
||||||
|
totalRootPositionNextUse: number;
|
||||||
|
totalRootPositionNextVacant: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OrgTree {
|
interface OrgTree {
|
||||||
|
|
|
||||||
|
|
@ -23,18 +23,36 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
||||||
total: 0,
|
total: 0,
|
||||||
use: 0,
|
use: 0,
|
||||||
vacant: 0,
|
vacant: 0,
|
||||||
|
totalRoot: 0,
|
||||||
|
useRoot: 0,
|
||||||
|
vacantRoot: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
function getSumPosition(data: SumPosition) {
|
function getSumPosition(data: SumPosition) {
|
||||||
sumPosition.total = data.totalPosition;
|
sumPosition.total = data.totalPosition;
|
||||||
sumPosition.use =
|
sumPosition.totalRoot = data.totalRootPosition ? data.totalRootPosition : 0;
|
||||||
typeOrganizational.value == "draft"
|
|
||||||
? data.totalPositionNextUse
|
if (typeOrganizational.value == "draft") {
|
||||||
: data.totalPositionCurrentUse;
|
sumPosition.use = data.totalPositionNextUse;
|
||||||
sumPosition.vacant =
|
sumPosition.useRoot = data.totalRootPositionNextUse
|
||||||
typeOrganizational.value == "draft"
|
? data.totalRootPositionNextUse
|
||||||
? data.totalPositionNextVacant
|
: 0;
|
||||||
: data.totalPositionCurrentVacant;
|
|
||||||
|
sumPosition.vacant = data.totalPositionNextVacant;
|
||||||
|
sumPosition.vacantRoot = data.totalRootPositionNextVacant
|
||||||
|
? data.totalRootPositionNextVacant
|
||||||
|
: 0;
|
||||||
|
} else {
|
||||||
|
sumPosition.use = data.totalPositionCurrentUse;
|
||||||
|
sumPosition.useRoot = data.totalRootPositionCurrentUse
|
||||||
|
? data.totalRootPositionCurrentUse
|
||||||
|
: 0;
|
||||||
|
|
||||||
|
sumPosition.vacant = data.totalPositionCurrentVacant;
|
||||||
|
sumPosition.vacantRoot = data.totalRootPositionCurrentVacant
|
||||||
|
? data.totalRootPositionCurrentVacant
|
||||||
|
: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchDataActive(data: DataActive) {
|
function fetchDataActive(data: DataActive) {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
{{ header }}
|
{{ header }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!profileStore.isVerified">
|
<div v-if="profileStore.isEdit">
|
||||||
<div class="q-gutter-sm q-mx-sm" v-if="addData == false">
|
<div class="q-gutter-sm q-mx-sm" v-if="addData == false">
|
||||||
<q-btn
|
<q-btn
|
||||||
size="12px"
|
size="12px"
|
||||||
|
|
|
||||||
|
|
@ -918,7 +918,21 @@ const roleRegistryverify = ref<boolean>(false);
|
||||||
function onClickVerified() {
|
function onClickVerified() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {},
|
async () => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.put(config.API.profileVerified(profileId.value))
|
||||||
|
.then((res) => {
|
||||||
|
checIsVerified();
|
||||||
|
success($q, "ยืนยันการตรวจสอบข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
},
|
||||||
"ยืนยันการตรวจสอบข้อมูล",
|
"ยืนยันการตรวจสอบข้อมูล",
|
||||||
"ต้องการยืนยันการตรวจสอบข้อมูลนี้หรือไม่?"
|
"ต้องการยืนยันการตรวจสอบข้อมูลนี้หรือไม่?"
|
||||||
);
|
);
|
||||||
|
|
@ -927,7 +941,21 @@ function onClickVerified() {
|
||||||
function onClickUnlock() {
|
function onClickUnlock() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {},
|
async () => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.put(config.API.profileVerifiedUnlock(profileId.value))
|
||||||
|
.then((res) => {
|
||||||
|
checIsVerified();
|
||||||
|
success($q, "ปลดล็อคให้แก้ไขข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
},
|
||||||
"ยืนยันการปลดให้แก้ไขข้อมูล",
|
"ยืนยันการปลดให้แก้ไขข้อมูล",
|
||||||
"ต้องการยืนยันการปลดให้แก้ไขข้อมูลนี้หรือไม่?"
|
"ต้องการยืนยันการปลดให้แก้ไขข้อมูลนี้หรือไม่?"
|
||||||
);
|
);
|
||||||
|
|
@ -985,13 +1013,16 @@ async function checIsVerified() {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
||||||
profileStore.isVerified = data.isVerified
|
profileStore.isVerified = data.isVerified;
|
||||||
? true
|
if (roleRegistryverify.value || roleKeyregistry.value) {
|
||||||
: roleRegistryverify.value
|
if (data.isVerified || roleRegistryverify.value) {
|
||||||
? true
|
profileStore.isEdit = false;
|
||||||
: roleKeyregistry.value
|
} else {
|
||||||
? false
|
profileStore.isEdit = true;
|
||||||
: false;
|
}
|
||||||
|
} else {
|
||||||
|
profileStore.isEdit = true;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { defineStore } from "pinia";
|
||||||
|
|
||||||
export const useProfileDataStore = defineStore("profile", () => {
|
export const useProfileDataStore = defineStore("profile", () => {
|
||||||
const isVerified = ref<boolean>(false);
|
const isVerified = ref<boolean>(false);
|
||||||
|
const isEdit = ref<boolean>(false);
|
||||||
const emplployeeClass = ref<string | null>("");
|
const emplployeeClass = ref<string | null>("");
|
||||||
interface profile {
|
interface profile {
|
||||||
main: { columns: String[] };
|
main: { columns: String[] };
|
||||||
|
|
@ -79,6 +80,7 @@ export const useProfileDataStore = defineStore("profile", () => {
|
||||||
return {
|
return {
|
||||||
isLoad,
|
isLoad,
|
||||||
isVerified,
|
isVerified,
|
||||||
|
isEdit,
|
||||||
profileData,
|
profileData,
|
||||||
changeProfileColumns,
|
changeProfileColumns,
|
||||||
birthDate,
|
birthDate,
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
v-if="props.row.isVerified"
|
v-if="props.row.isVerified"
|
||||||
name="verified"
|
name="verified"
|
||||||
color="green"
|
color="green"
|
||||||
size="2rem"
|
size="1.4rem"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'fullname'">
|
<div v-else-if="col.name == 'fullname'">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue