Merge branch 'develop' into devTee
This commit is contained in:
commit
acbf16dd14
36 changed files with 212 additions and 121 deletions
|
|
@ -109,7 +109,7 @@ function fetchTreeStrategy() {
|
|||
function fetchTreeAgency(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
nodeAgency.value = data;
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ function fetchActive() {
|
|||
async function fetchTree(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ function fetchActive() {
|
|||
async function fetchTree(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
|
|
|
|||
|
|
@ -832,7 +832,7 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -8,60 +8,36 @@ import config from "@/app.config";
|
|||
import { OrgChart } from "bma-org-chart";
|
||||
import "bma-org-chart/org-chart.css";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
import chartData from "@/assets/orgChartData";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const store = useOrganizational();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const $q = useQuasar(); // show dialog
|
||||
|
||||
const dataSource = ref(chartData);
|
||||
// const dataSource = ref() // ข้อมูล Chart
|
||||
const dataSource = ref(chartData); // ข้อมูล Chart
|
||||
|
||||
const rootOrgID = ref(); // org id ของ root ตัวปัจจุบันที่เลือกอยู่
|
||||
const dataSourceLock = ref(); // ข้อมูลตั้งต้นของ Chart ใช้ให้กดกลับไปที่ home
|
||||
const chartRef = ref(); // อ้างอิงไปที่ตัว chart
|
||||
const savePNG = () => {
|
||||
chartRef.value.savePNG();
|
||||
};
|
||||
const savePDF = () => {
|
||||
chartRef.value.savePDF();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchTreeRoot();
|
||||
await fetchOrgChart();
|
||||
});
|
||||
|
||||
/**
|
||||
* อ่าน Root ของข้อมูลทั้งหมดก่อน
|
||||
* fetch ข้อมูล Chart โครงสร้าง
|
||||
*/
|
||||
const fetchTreeRoot = async () => {
|
||||
function fetchOrgChart() {
|
||||
showLoader();
|
||||
let urlRequest = config.API.chartGetTreeRoot;
|
||||
await http
|
||||
let urlRequest = config.API.orgChart(rootOrgID.value);
|
||||
http
|
||||
.get(urlRequest)
|
||||
.then((response) => {
|
||||
.then(async (response) => {
|
||||
if (response.data.result.length > 0) {
|
||||
rootOrgID.value = response.data.result[0].organizationId;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const data = response.data.result;
|
||||
|
||||
const updatedData = await Promise.all(data.map(addAvatarToData));
|
||||
dataSource.value = updatedData[0];
|
||||
|
||||
const fetchOrgChart = async () => {
|
||||
showLoader();
|
||||
let urlRequest = config.API.chartGetOrg(rootOrgID.value);
|
||||
await http
|
||||
.get(urlRequest)
|
||||
.then((response) => {
|
||||
if (response.data.result.length > 0) {
|
||||
dataSource.value = response.data.result[0];
|
||||
if (dataSourceLock.value === undefined)
|
||||
dataSourceLock.value = dataSource.value;
|
||||
}
|
||||
|
|
@ -72,24 +48,79 @@ const fetchOrgChart = async () => {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* map ข้อมูล Chart
|
||||
* @param item ข้อมูล Chart
|
||||
*/
|
||||
async function addAvatarToData(item: any) {
|
||||
// เพิ่ม avatar ให้กับ item
|
||||
const updatedItem = {
|
||||
...item,
|
||||
avatar: item.avatar ? await fetchProfile(item.avatar) : avatar,
|
||||
// ตรวจสอบว่า item มี children หรือไม่
|
||||
children: item.children
|
||||
? await Promise.all(item.children.map(addAvatarToData))
|
||||
: [],
|
||||
};
|
||||
return updatedItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch รูปโปรไฟล์ return ลิงค์ download ไฟล์
|
||||
* @param path ไฟล์รูป
|
||||
*/
|
||||
async function fetchProfile(path: string) {
|
||||
try {
|
||||
const res = await http.get(config.API.filefullPath(path));
|
||||
return res.data.downloadUrl; // คืนค่า URL ของ avatar
|
||||
} catch (err) {
|
||||
return avatar; // คืนค่า default avatar ถ้าเกิดข้อผิดพลาด
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อมีการคลิกที่ Chart ให้อ่าน ID ของหน่วยงานที่ถูกคลิก แล้วดึงข้อมูล Chart ของหน่วยงานนั้น ๆ จาก API
|
||||
* @param data
|
||||
*/
|
||||
const refreshChart = async (data: any) => {
|
||||
async function refreshChart(data: any) {
|
||||
if (data.value !== undefined) rootOrgID.value = data.value;
|
||||
else rootOrgID.value = data;
|
||||
if (rootOrgID.value !== 0) await fetchOrgChart();
|
||||
if (data.value !== undefined) data.value = 0;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* โหลด Chart รูป
|
||||
*/
|
||||
function savePNG() {
|
||||
chartRef.value.savePNG();
|
||||
}
|
||||
|
||||
/**
|
||||
* โหลด Chart PDF
|
||||
*/
|
||||
function savePDF() {
|
||||
chartRef.value.savePDF();
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
rootOrgID.value =
|
||||
store.typeOrganizational === "current"
|
||||
? store.activeId
|
||||
: store.typeOrganizational === "draft"
|
||||
? store.draftId
|
||||
: store.historyId;
|
||||
|
||||
await fetchOrgChart();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- <div class="toptitle text-dark col-12 row items-center">แผนภูมิองค์กร</div> -->
|
||||
<div class="text-dark">
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<q-card class="col-12 q-mt-sm">
|
||||
<div class="q-pa-sm">
|
||||
<q-btn flat round color="primary" @click="savePNG()" icon="mdi-image">
|
||||
<q-tooltip> ดาวน์โหลด PNG </q-tooltip>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { ref, watch } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** importType*/
|
||||
import type { ListMenu } from "@/modules/02_organization/interface/index/Main";
|
||||
|
|
@ -547,7 +548,7 @@ watch(
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-else
|
||||
v-else-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
color="grey-13"
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { useQuasar } from "quasar";
|
|||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import genreport from "@/plugins/genreportxlsx";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -683,7 +684,7 @@ watch(
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-else
|
||||
v-else-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
color="deep-purple"
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ async function fetchDataTree(id: string) {
|
|||
isLoadTree.value = false;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByid(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodeTree.value = data;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const idVal = ref("");
|
|||
async function fetchDataTree(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByid(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodes.value = data;
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ function clearSelect(t: string) {
|
|||
async function fetchTree(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByIdSystem(id.toString(), route.meta.Key))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ import CardPosition from "@/modules/05_placement/components/PersonalList/CardPos
|
|||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useSelectOrgStore } from "@/modules/05_placement/stores/storeSelect";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
|
|
@ -93,7 +96,7 @@ async function fetchOrganizationActive() {
|
|||
async function fetchDataTree(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
if (data) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import type {
|
|||
DataPositionNo,
|
||||
TreeMain,
|
||||
} from "@/modules/05_placement/interface/response/Receive";
|
||||
import { useRoute } from "vue-router";
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const {
|
||||
|
|
@ -33,6 +34,7 @@ const {
|
|||
} = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
|
||||
const nodeLevel = ref<number>(0);
|
||||
const route = useRoute();
|
||||
|
||||
const isAll = ref<boolean>(false);
|
||||
const isBlank = ref<boolean>(false);
|
||||
|
|
@ -471,7 +473,7 @@ function getSumPosition(data: SumPosition) {
|
|||
async function fetchDataTree(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodes.value = data;
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ async function getActive() {
|
|||
async function getTreeData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(id))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodes.value = data;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; //หม
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
import { useroleUserDataStore } from "@/stores/roleUser";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
/**use */
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
|
@ -24,6 +25,7 @@ const roleDataStore = useroleUserDataStore();
|
|||
const DataStore = useInsigniaDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
||||
const route = useRoute();
|
||||
|
||||
/**
|
||||
* ตัวแปร
|
||||
|
|
@ -137,7 +139,7 @@ function fetchActiveId() {
|
|||
function fetchListOrg(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import DialogHeader from "../DialogHeader.vue";
|
|||
|
||||
/** import Stores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
/** useStore*/
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -27,6 +28,7 @@ const {
|
|||
dateToISO,
|
||||
} = mixin;
|
||||
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
const myForm = ref<any>();
|
||||
|
||||
|
|
@ -126,7 +128,7 @@ function fetchOrgList() {
|
|||
const data = res.data.result;
|
||||
|
||||
http
|
||||
.get(config.API.orgByid(data.activeId))
|
||||
.get(config.API.orgByIdSystem(data.activeId, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ async function fetchOrgList() {
|
|||
const data = res.data.result;
|
||||
|
||||
http
|
||||
.get(config.API.orgByid(data.activeId))
|
||||
.get(config.API.orgByIdSystem(data.activeId, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
|
|
@ -468,7 +468,6 @@ onMounted(async () => {
|
|||
<q-td key="remain" :props="props">
|
||||
{{ props.row.remain }}
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
|||
/** impotrStores */
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useBrrowDataStore } from "@/modules/07_insignia/storeBrrow";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const $q = useQuasar();
|
||||
const myForm = ref<QForm>();
|
||||
const route = useRoute();
|
||||
|
||||
const DataStore = useBrrowDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -133,7 +135,7 @@ async function fetchOrgList() {
|
|||
const data = res.data.result;
|
||||
|
||||
http
|
||||
.get(config.API.orgByid(data.activeId))
|
||||
.get(config.API.orgByIdSystem(data.activeId, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ async function fetchOrganizationActive() {
|
|||
async function fetchDataTree(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByIdSystem(id.toString(), route.meta.Key))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
if (data) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const {
|
|||
messageError,
|
||||
hideLoader,
|
||||
showLoader,
|
||||
downloadRenameFileByLink
|
||||
downloadRenameFileByLink,
|
||||
} = mixin;
|
||||
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
|
|
@ -141,7 +141,6 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ลบไฟล์
|
||||
* @param id id file
|
||||
|
|
@ -283,7 +282,7 @@ async function getActive() {
|
|||
async function getOc(activeId: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(activeId))
|
||||
.get(config.API.orgByIdSystem(activeId, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: any) => ({
|
||||
organizationId: item.orgTreeId,
|
||||
|
|
@ -1041,7 +1040,10 @@ function filterOptionFnAgency(val: string, update: Function) {
|
|||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="
|
||||
downloadRenameFileByLink(data.pathName, data.fileName)
|
||||
downloadRenameFileByLink(
|
||||
data.pathName,
|
||||
data.fileName
|
||||
)
|
||||
"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const {
|
|||
success,
|
||||
messageError,
|
||||
dialogRemove,
|
||||
downloadRenameFileByLink
|
||||
downloadRenameFileByLink,
|
||||
} = mixin;
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
const countNum = ref<number>(1);
|
||||
|
|
@ -465,7 +465,7 @@ async function getActive() {
|
|||
async function getOc(activeId: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(activeId))
|
||||
.get(config.API.orgByIdSystem(activeId, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: any) => ({
|
||||
organizationId: item.orgTreeId,
|
||||
|
|
@ -1554,7 +1554,12 @@ onMounted(async () => {
|
|||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadRenameFileByLink(file.pathName, file.fileName)"
|
||||
@click="
|
||||
downloadRenameFileByLink(
|
||||
file.pathName,
|
||||
file.fileName
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
@ -1658,7 +1663,12 @@ onMounted(async () => {
|
|||
round
|
||||
color="blue"
|
||||
icon="mdi-download"
|
||||
@click="downloadRenameFileByLink(file.pathName, file.fileName)"
|
||||
@click="
|
||||
downloadRenameFileByLink(
|
||||
file.pathName,
|
||||
file.fileName
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -440,7 +440,7 @@ async function getActive() {
|
|||
async function getOc(activeId: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(activeId))
|
||||
.get(config.API.orgByIdSystem(activeId, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
organizationOption.value = await res.data.result.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
|
|
@ -901,7 +901,6 @@ onMounted(async () => {
|
|||
col.label
|
||||
}}</span>
|
||||
</q-th>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -1006,7 +1005,8 @@ onMounted(async () => {
|
|||
<template
|
||||
v-if="
|
||||
formData.disciplinaryDateInvestigation &&
|
||||
isReadonly === false &&!checkRoutePermisson
|
||||
isReadonly === false &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
|
|
@ -1067,7 +1067,8 @@ onMounted(async () => {
|
|||
<template
|
||||
v-if="
|
||||
formData.disciplinaryDateAllegation &&
|
||||
isReadonly === false &&!checkRoutePermisson
|
||||
isReadonly === false &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
|
|
@ -1140,7 +1141,7 @@ onMounted(async () => {
|
|||
<div v-if="extendStatus" class="col-3">
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
for="#daysExtend"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -1178,7 +1179,8 @@ onMounted(async () => {
|
|||
<div v-if="!extendStatus" class="col-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
:readonly="checkRoutePermisson||
|
||||
:readonly="
|
||||
checkRoutePermisson ||
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length > 0
|
||||
"
|
||||
|
|
@ -1201,7 +1203,8 @@ onMounted(async () => {
|
|||
class="full-width cursor-pointer"
|
||||
ref="dateRef"
|
||||
:class="inputEditExtend(isReadonly)"
|
||||
:readonly="checkRoutePermisson||
|
||||
:readonly="
|
||||
checkRoutePermisson ||
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length >
|
||||
0
|
||||
|
|
@ -1229,7 +1232,7 @@ onMounted(async () => {
|
|||
</template>
|
||||
<template
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
!checkRoutePermisson &&
|
||||
formData.disciplinaryDateStart &&
|
||||
isReadonly === false &&
|
||||
formData.disciplinaryExtendHistory
|
||||
|
|
@ -1256,7 +1259,8 @@ onMounted(async () => {
|
|||
:class="isReadonly ? '' : dateEndInputStyle"
|
||||
menu-class-name="modalfix"
|
||||
v-model="formData.disciplinaryDateEnd"
|
||||
:readonly="checkRoutePermisson||
|
||||
:readonly="
|
||||
checkRoutePermisson ||
|
||||
formData.disciplinaryDateStart === null ||
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length > 0
|
||||
|
|
@ -1279,7 +1283,8 @@ onMounted(async () => {
|
|||
for="#dateEnd"
|
||||
:class="inputEditExtend(isReadonly)"
|
||||
ref="dateEndRef"
|
||||
:readonly="checkRoutePermisson||
|
||||
:readonly="
|
||||
checkRoutePermisson ||
|
||||
formData.disciplinaryDateStart === null ||
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length >
|
||||
|
|
@ -1307,7 +1312,8 @@ onMounted(async () => {
|
|||
</q-icon>
|
||||
</template>
|
||||
<template
|
||||
v-if="!checkRoutePermisson&&
|
||||
v-if="
|
||||
!checkRoutePermisson &&
|
||||
formData.disciplinaryDateEnd &&
|
||||
isReadonly === false &&
|
||||
formData.disciplinaryExtendHistory
|
||||
|
|
@ -1360,7 +1366,7 @@ onMounted(async () => {
|
|||
</div>
|
||||
|
||||
<datepicker
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
menu-class-name="modalfix"
|
||||
for="#dateEvident"
|
||||
v-model="formData.disciplinaryDateEvident"
|
||||
|
|
@ -1380,7 +1386,7 @@ onMounted(async () => {
|
|||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
ref="disciplinaryDateEvidentRef"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -1403,7 +1409,9 @@ onMounted(async () => {
|
|||
</template>
|
||||
<template
|
||||
v-if="
|
||||
formData.disciplinaryDateEvident && isReadonly === false &&!checkRoutePermisson
|
||||
formData.disciplinaryDateEvident &&
|
||||
isReadonly === false &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
|
|
@ -1420,7 +1428,7 @@ onMounted(async () => {
|
|||
</datepicker>
|
||||
|
||||
<datepicker
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
menu-class-name="modalfix"
|
||||
for="#dateResult"
|
||||
v-model="formData.disciplinaryDateResult"
|
||||
|
|
@ -1441,7 +1449,7 @@ onMounted(async () => {
|
|||
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
ref="disciplinaryDateResultRef"
|
||||
outlined
|
||||
:class="inputEdit(isReadonly)"
|
||||
|
|
@ -1464,7 +1472,9 @@ onMounted(async () => {
|
|||
</template>
|
||||
<template
|
||||
v-if="
|
||||
formData.disciplinaryDateResult && isReadonly === false &&!checkRoutePermisson
|
||||
formData.disciplinaryDateResult &&
|
||||
isReadonly === false &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
v-slot:append
|
||||
>
|
||||
|
|
@ -1491,7 +1501,7 @@ onMounted(async () => {
|
|||
>
|
||||
รายชื่อกรรมการเพื่อพิจารณาความผิดทางวินัย
|
||||
<q-btn
|
||||
v-if="!isReadonly&&!checkRoutePermisson"
|
||||
v-if="!isReadonly && !checkRoutePermisson"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
|
|
@ -1522,11 +1532,15 @@ onMounted(async () => {
|
|||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" >
|
||||
<q-tr :props="props">
|
||||
<q-td class="text-right">
|
||||
<!-- แก้ไขกรรมการ -->
|
||||
<q-btn
|
||||
v-if="!isReadonly && props.row.check === 'props' &&!checkRoutePermisson"
|
||||
v-if="
|
||||
!isReadonly &&
|
||||
props.row.check === 'props' &&
|
||||
!checkRoutePermisson
|
||||
"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -1538,7 +1552,7 @@ onMounted(async () => {
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isReadonly&&!checkRoutePermisson"
|
||||
v-if="!isReadonly && !checkRoutePermisson"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -1574,7 +1588,7 @@ onMounted(async () => {
|
|||
<div class="col-xs-12 col-sm-3">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
dense
|
||||
outlined
|
||||
ref="disciplinaryCaseFaultRef"
|
||||
|
|
@ -1589,7 +1603,7 @@ onMounted(async () => {
|
|||
<div class="col-xs-12 col-sm-3">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
dense
|
||||
hide-bottom-space
|
||||
outlined
|
||||
|
|
@ -1604,7 +1618,7 @@ onMounted(async () => {
|
|||
<div class="col-xs-12 col-sm-3">
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
dense
|
||||
outlined
|
||||
for="#faultLevel"
|
||||
|
|
@ -1647,7 +1661,7 @@ onMounted(async () => {
|
|||
<div class="col-xs-12 col-sm-3">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
dense
|
||||
for="#refLaw"
|
||||
hide-bottom-space
|
||||
|
|
@ -1662,7 +1676,7 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<q-input
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -1678,7 +1692,7 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<q-input
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -1694,7 +1708,7 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<q-input
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -1710,7 +1724,7 @@ onMounted(async () => {
|
|||
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<q-input
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
:class="inputEdit(isReadonly)"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -1745,7 +1759,7 @@ onMounted(async () => {
|
|||
for="#fault"
|
||||
outlined
|
||||
dense
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
ref="disciplinaryStatusResultRef"
|
||||
v-model="formData.disciplinaryStatusResult"
|
||||
:options="option"
|
||||
|
|
@ -1773,7 +1787,7 @@ onMounted(async () => {
|
|||
>
|
||||
<q-select
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
for="#fault"
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -1802,7 +1816,7 @@ onMounted(async () => {
|
|||
<div class="col-12">
|
||||
<q-input
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="isReadonly||checkRoutePermisson"
|
||||
:readonly="isReadonly || checkRoutePermisson"
|
||||
class="full-width cursor-pointer"
|
||||
outlined
|
||||
ref="disciplinaryResultRef"
|
||||
|
|
@ -1834,7 +1848,7 @@ onMounted(async () => {
|
|||
:id="id"
|
||||
type="relevant"
|
||||
:fetchData="props.fetchData"
|
||||
:is-readonly="isReadonly||checkRoutePermisson"
|
||||
:is-readonly="isReadonly || checkRoutePermisson"
|
||||
:return-count="returnCount"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1846,7 +1860,7 @@ onMounted(async () => {
|
|||
:id="id"
|
||||
type="summaryEvidence"
|
||||
:fetchData="props.fetchData"
|
||||
:is-readonly="isReadonly||checkRoutePermisson"
|
||||
:is-readonly="isReadonly || checkRoutePermisson"
|
||||
:return-count="returnCount"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1858,7 +1872,7 @@ onMounted(async () => {
|
|||
:id="id"
|
||||
type="recordAccuser"
|
||||
:fetchData="props.fetchData"
|
||||
:is-readonly="isReadonly||checkRoutePermisson"
|
||||
:is-readonly="isReadonly || checkRoutePermisson"
|
||||
:return-count="returnCount"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1870,7 +1884,7 @@ onMounted(async () => {
|
|||
:id="id"
|
||||
type="witnesses"
|
||||
:fetchData="props.fetchData"
|
||||
:is-readonly="isReadonly||checkRoutePermisson"
|
||||
:is-readonly="isReadonly || checkRoutePermisson"
|
||||
:return-count="returnCount"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1882,7 +1896,7 @@ onMounted(async () => {
|
|||
:id="id"
|
||||
type="other"
|
||||
:fetchData="props.fetchData"
|
||||
:is-readonly="isReadonly||checkRoutePermisson"
|
||||
:is-readonly="isReadonly || checkRoutePermisson"
|
||||
:return-count="returnCount"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1890,7 +1904,10 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div v-if="!isReadonly&&!checkRoutePermisson" class="row col-12 q-pa-sm">
|
||||
<div
|
||||
v-if="!isReadonly && !checkRoutePermisson"
|
||||
class="row col-12 q-pa-sm"
|
||||
>
|
||||
<q-space />
|
||||
<q-btn
|
||||
for="ButtonOnSubmit"
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ async function getActive() {
|
|||
async function getOc(activeId: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(activeId))
|
||||
.get(config.API.orgByIdSystem(activeId, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
organizationOption.value = await res.data.result.map((item: any) => ({
|
||||
id: item.orgTreeId,
|
||||
|
|
|
|||
|
|
@ -32,11 +32,13 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
|||
*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useRoute } from "vue-router";
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const route = useRoute();
|
||||
|
||||
/**
|
||||
* ตัวแปรงาน
|
||||
|
|
@ -148,7 +150,7 @@ function fetchActiveId() {
|
|||
function fetchListOrg(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result.map((item: ResOrg) => ({
|
||||
id: item.orgTreeId,
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function fetchActive() {
|
|||
function fetchTree(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ import config from "@/app.config";
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
|
||||
const modal = defineModel<boolean>("modal", { default: false });
|
||||
|
|
@ -47,7 +49,7 @@ function fetchActive() {
|
|||
async function fetchTree(id: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -31,6 +31,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const store = useDevelopmentDataStore();
|
||||
const {
|
||||
|
|
@ -236,7 +237,7 @@ function fetchActive() {
|
|||
*/
|
||||
function fetchTree(id: string) {
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
node.value = data;
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ watch(
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ watch(
|
|||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import Header from "@/components/DialogHeader.vue";
|
|||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
|
|
@ -35,6 +36,7 @@ const {
|
|||
dialogMessageNotify,
|
||||
success,
|
||||
} = useCounterMixin();
|
||||
const route = useRoute();
|
||||
|
||||
/** props*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
|
|
@ -56,7 +58,7 @@ async function fetchTree() {
|
|||
showLoader();
|
||||
const id: string = store.activeId ? store.activeId?.toString() : "";
|
||||
await http
|
||||
.get(config.API.orgByid(id))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
nodeTree.value = res.data.result;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ watch(
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="
|
||||
|
|
|
|||
|
|
@ -20,11 +20,13 @@ import TreeTable from "@/modules/16_positionEmployee/components/TreeTable.vue";
|
|||
/** importStore*/
|
||||
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
/** use*/
|
||||
const store = usePositionEmp();
|
||||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||
const route = useRoute();
|
||||
|
||||
const nodeTree = ref<OrgTree[]>([]); // ข้อมูล Tree
|
||||
const nodeId = ref<string>(""); // id ของ Tree
|
||||
|
|
@ -56,7 +58,7 @@ function fetchDataTree(id: string) {
|
|||
isLoadTree.value = false;
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodeTree.value = data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue