Merge branch 'develop' into devTee
This commit is contained in:
commit
46396a6c8b
3 changed files with 402 additions and 321 deletions
|
|
@ -40,7 +40,6 @@ const formData = reactive<FormBasicinfo>({
|
||||||
|
|
||||||
const orgName = ref<string>("");
|
const orgName = ref<string>("");
|
||||||
const node = ref<any>([]);
|
const node = ref<any>([]);
|
||||||
const nodeId = ref<string>("");
|
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const expanded = ref<any>([]);
|
const expanded = ref<any>([]);
|
||||||
|
|
||||||
|
|
@ -56,15 +55,18 @@ async function fetchData(id: string) {
|
||||||
formData.objective = data.objective;
|
formData.objective = data.objective;
|
||||||
formData.nodeId = data.nodeId;
|
formData.nodeId = data.nodeId;
|
||||||
|
|
||||||
const test = await searchAndReplace(node.value, formData?.nodeId);
|
if (node.value && formData?.nodeId) {
|
||||||
console.log(test);
|
const nodeTree = await searchAndReplace(node.value, formData?.nodeId);
|
||||||
|
if (nodeTree) {
|
||||||
const parts = test.orgName.split("/");
|
expanded.value = [];
|
||||||
for (let i = 0; i < parts.length; i++) {
|
const parts = nodeTree?.orgName.split("/");
|
||||||
const arrangedParts = parts[i];
|
for (let i = 0; i < parts.length; i++) {
|
||||||
expanded.value.push(arrangedParts);
|
const arrangedParts = parts[i - 1];
|
||||||
|
expanded.value.push(arrangedParts);
|
||||||
|
}
|
||||||
|
updateSelected(nodeTree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateSelected(test);
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -129,9 +131,6 @@ async function fetchTree(id: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelected(data: any) {
|
function updateSelected(data: any) {
|
||||||
console.log(expanded.value);
|
|
||||||
|
|
||||||
nodeId.value = data.orgTreeId;
|
|
||||||
orgName.value = data.orgTreeName;
|
orgName.value = data.orgTreeName;
|
||||||
formData.node = data.orgLevel;
|
formData.node = data.orgLevel;
|
||||||
formData.nodeId = data.orgTreeId;
|
formData.nodeId = data.orgTreeId;
|
||||||
|
|
@ -163,60 +162,54 @@ onMounted(async () => {
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<q-card bordered class="col-12 row caedNone">
|
<q-card bordered class="col-12 row caedNone">
|
||||||
<div class="col-xs-12 col-sm-3 row">
|
<div class="col-xs-12 col-sm-3 row">
|
||||||
<div class="col-12 row no-wrap bg-grey-1">
|
<div class="col-12 row no-wrap">
|
||||||
<div class="col-12 q-py-sm q-px-sm">
|
<div class="col-12 q-py-sm q-px-sm q-gutter-sm">
|
||||||
<q-card-section
|
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||||
class="q-pt-none q-pa-sm scroll"
|
<template v-slot:append>
|
||||||
style="max-height: 65vh"
|
<q-icon
|
||||||
|
v-if="filter !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="filter = ''"
|
||||||
|
/>
|
||||||
|
<q-icon v-else name="search" color="grey-5" />
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
<q-tree
|
||||||
|
class="tree-container"
|
||||||
|
dense
|
||||||
|
:nodes="node"
|
||||||
|
node-key="orgTreeName"
|
||||||
|
label-key="labelName"
|
||||||
|
v-model:expanded="expanded"
|
||||||
|
:filter="filter"
|
||||||
|
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||||
|
no-nodes-label="ไม่มีข้อมูล"
|
||||||
>
|
>
|
||||||
<q-input dense outlined v-model="filter" label="ค้นหา">
|
<template v-slot:default-header="prop">
|
||||||
<template v-slot:append>
|
<q-item
|
||||||
<q-icon
|
clickable
|
||||||
v-if="filter !== ''"
|
@click.stop="updateSelected(prop.node)"
|
||||||
name="clear"
|
:active="formData.nodeId === prop.node.orgTreeId"
|
||||||
class="cursor-pointer"
|
active-class="my-list-link text-primary text-weight-medium"
|
||||||
@click="filter = ''"
|
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||||
/>
|
>
|
||||||
<q-icon v-else name="search" color="grey-5" />
|
<div>
|
||||||
</template>
|
<div class="text-weight-medium">
|
||||||
</q-input>
|
{{ prop.node.orgTreeName }}
|
||||||
<q-tree
|
|
||||||
dense
|
|
||||||
:nodes="node"
|
|
||||||
node-key="orgTreeName"
|
|
||||||
label-key="orgTreeName"
|
|
||||||
v-model:expanded="expanded"
|
|
||||||
:filter="filter"
|
|
||||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
|
||||||
no-nodes-label="ไม่มีข้อมูล"
|
|
||||||
>
|
|
||||||
<template v-slot:default-header="prop">
|
|
||||||
<q-item
|
|
||||||
clickable
|
|
||||||
@click.stop="updateSelected(prop.node)"
|
|
||||||
:active="formData.nodeId === prop.node.orgTreeId"
|
|
||||||
active-class="my-list-link text-primary text-weight-medium"
|
|
||||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<div class="text-weight-medium">
|
|
||||||
{{ prop.node.orgTreeName }}
|
|
||||||
</div>
|
|
||||||
<div class="text-weight-light text-grey-8">
|
|
||||||
{{
|
|
||||||
prop.node.orgCode == null ? null : prop.node.orgCode
|
|
||||||
}}
|
|
||||||
{{
|
|
||||||
prop.node.orgTreeShortName == null
|
|
||||||
? null
|
|
||||||
: prop.node.orgTreeShortName
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</q-item>
|
<div class="text-weight-light text-grey-8">
|
||||||
</template>
|
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||||
</q-tree>
|
{{
|
||||||
</q-card-section>
|
prop.node.orgTreeShortName == null
|
||||||
|
? null
|
||||||
|
: prop.node.orgTreeShortName
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-tree>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
|
|
@ -344,6 +337,13 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.tree-container {
|
||||||
|
overflow: auto;
|
||||||
|
height: 70vh;
|
||||||
|
border: 1px solid #e6e6e7;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.my-list-link {
|
.my-list-link {
|
||||||
color: rgb(118, 168, 222);
|
color: rgb(118, 168, 222);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ interface FormQueryListProject {
|
||||||
org: string;
|
org: string;
|
||||||
keyword: string;
|
keyword: string;
|
||||||
status: string;
|
status: string;
|
||||||
|
node: number | null;
|
||||||
|
nodeId: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FormBasicinfo {
|
interface FormBasicinfo {
|
||||||
|
|
@ -230,6 +232,14 @@ interface PlannedGoals {
|
||||||
amount: number | null;
|
amount: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface FormProject {
|
||||||
|
year: number | null;
|
||||||
|
projectName: "";
|
||||||
|
node: number | null;
|
||||||
|
nodeId: string | null;
|
||||||
|
orgRevisionId: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
FormQueryListProject,
|
FormQueryListProject,
|
||||||
FormAddProject,
|
FormAddProject,
|
||||||
|
|
@ -242,4 +252,5 @@ export type {
|
||||||
FormAddHistoryProject,
|
FormAddHistoryProject,
|
||||||
FormAddHistoryEmployee,
|
FormAddHistoryEmployee,
|
||||||
FormGroupTargetPlannedGoal,
|
FormGroupTargetPlannedGoal,
|
||||||
|
FormProject,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,21 @@
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import { useQuasar, type QTableProps } from "quasar";
|
import { useQuasar, type QTableProps } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
|
||||||
|
|
||||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
/**importType*/
|
/**importType*/
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
ItemsMenu,
|
|
||||||
NewPagination,
|
NewPagination,
|
||||||
} from "@/modules/15_development/interface/index/Main";
|
} from "@/modules/15_development/interface/index/Main";
|
||||||
import type { FormQueryListProject } from "@/modules/15_development/interface/request/Main";
|
import type {
|
||||||
|
FormQueryListProject,
|
||||||
|
FormProject,
|
||||||
|
} from "@/modules/15_development/interface/request/Main";
|
||||||
import type { ResListProject } from "@/modules/15_development/interface/response/Main";
|
import type { ResListProject } from "@/modules/15_development/interface/response/Main";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
|
|
@ -23,11 +25,14 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
/** use*/
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError, dialogMessageNotify } =
|
||||||
|
useCounterMixin();
|
||||||
|
|
||||||
const ticked = ref<any>([]);
|
const ticked = ref<any>([]);
|
||||||
const node = ref<any>([]);
|
const node = ref<any>([]);
|
||||||
const expanded = ref<any>([]);
|
const expanded = ref<any>([]);
|
||||||
|
const filter = ref<string>("");
|
||||||
|
const filterMain = ref<string>("");
|
||||||
const splitterModel = ref<number>(60);
|
const splitterModel = ref<number>(60);
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const projectName = ref<string>("");
|
const projectName = ref<string>("");
|
||||||
|
|
@ -68,28 +73,6 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
]);
|
]);
|
||||||
const visibleColumns = ref<string[]>(["year", "projectName", "org"]);
|
const visibleColumns = ref<string[]>(["year", "projectName", "org"]);
|
||||||
|
|
||||||
/** เมนูดาวน์โหลด*/
|
|
||||||
const itemDownload = ref<ItemsMenu[]>([
|
|
||||||
{
|
|
||||||
label: "Excel",
|
|
||||||
value: "EXCEL",
|
|
||||||
icon: "mdi-file-pdf-box",
|
|
||||||
color: "green",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "ดาวน์โหลด 2",
|
|
||||||
value: "PDF",
|
|
||||||
icon: "mdi-file-table",
|
|
||||||
color: "red",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "ดาวน์โหลด 3",
|
|
||||||
value: "WORD",
|
|
||||||
icon: "mdi-file-word",
|
|
||||||
color: "blue",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const statusOpt = ref<DataOption[]>([
|
const statusOpt = ref<DataOption[]>([
|
||||||
{ id: "ONGOING", name: "กำลังดำเนินการ" },
|
{ id: "ONGOING", name: "กำลังดำเนินการ" },
|
||||||
{ id: "FINISH", name: "เสร็จสิ้นโครงการ" },
|
{ id: "FINISH", name: "เสร็จสิ้นโครงการ" },
|
||||||
|
|
@ -102,8 +85,9 @@ const formQuery = reactive<FormQueryListProject>({
|
||||||
org: "1",
|
org: "1",
|
||||||
keyword: "",
|
keyword: "",
|
||||||
status: "ONGOING",
|
status: "ONGOING",
|
||||||
|
node: null,
|
||||||
|
nodeId: null,
|
||||||
});
|
});
|
||||||
const orgOp = ref<DataOption[]>([{ id: "1", name: "หน่วยงาน 1" }]);
|
|
||||||
|
|
||||||
const totalList = ref<number>(1); //จำนวนข้อมูลรายการ
|
const totalList = ref<number>(1); //จำนวนข้อมูลรายการ
|
||||||
|
|
||||||
|
|
@ -113,7 +97,7 @@ function fetchListProject() {
|
||||||
http
|
http
|
||||||
.get(
|
.get(
|
||||||
config.API.developmentMain +
|
config.API.developmentMain +
|
||||||
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${formQuery.year}&status=${formQuery.status}`
|
`?page=${formQuery.page}&pageSize=${formQuery.pageSize}&keyword=${formQuery.keyword}&year=${formQuery.year}&status=${formQuery.status}&node=${formQuery.node}&nodeId=${formQuery.nodeId}`
|
||||||
)
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
|
|
@ -188,28 +172,30 @@ function closeDialog() {
|
||||||
projectName.value = "";
|
projectName.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formProject = reactive<FormProject>({
|
||||||
|
year: null,
|
||||||
|
projectName: "",
|
||||||
|
node: null,
|
||||||
|
nodeId: null,
|
||||||
|
orgRevisionId: null,
|
||||||
|
});
|
||||||
|
|
||||||
/** dialog submit */
|
/** dialog submit */
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
http
|
if (formProject.nodeId) {
|
||||||
.post(config.API.developmentMain,{
|
http
|
||||||
year:year.value,
|
.post(config.API.developmentMain, formProject)
|
||||||
projectName:projectName.value
|
.then((res) => {
|
||||||
})
|
closeDialog();
|
||||||
.then((res) => {
|
router.push(`/development/${res.data.result}`);
|
||||||
closeDialog();
|
})
|
||||||
router.push(`/development/${res.data.result}`);
|
.catch((e) => {
|
||||||
})
|
messageError($q, e);
|
||||||
.catch((e) => {
|
})
|
||||||
messageError($q, e);
|
.finally(() => {});
|
||||||
})
|
} else {
|
||||||
.finally(() => {});
|
dialogMessageNotify($q, "กรุณาเลือกหน่วยงานที่รับผิดชอบ");
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTicked(val: any) {
|
|
||||||
console.log(expanded.value);
|
|
||||||
|
|
||||||
ticked.value = [];
|
|
||||||
ticked.value.push(val[val.length - 1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchActive() {
|
function fetchActive() {
|
||||||
|
|
@ -242,6 +228,24 @@ async function fetchTree(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateSelected(data: any) {
|
||||||
|
formProject.node = data.orgLevel;
|
||||||
|
formProject.nodeId = data.orgTreeId;
|
||||||
|
formProject.orgRevisionId = data.orgRevisionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateSelectedTreeMain(data: any) {
|
||||||
|
if (formQuery.node === data.orgLevel && formQuery.nodeId === data.orgTreeId) {
|
||||||
|
formQuery.node = null;
|
||||||
|
formQuery.nodeId = null;
|
||||||
|
} else {
|
||||||
|
formQuery.node = data.orgLevel;
|
||||||
|
formQuery.nodeId = data.orgTreeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchListProjectNew();
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchActive();
|
fetchActive();
|
||||||
fetchListProject();
|
fetchListProject();
|
||||||
|
|
@ -252,218 +256,251 @@ onMounted(() => {
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด
|
รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="q-pa-md">
|
<q-card bordered class="col-12 row caedNone">
|
||||||
<q-toolbar style="padding: 0">
|
<div class="col-xs-12 col-sm-3 row">
|
||||||
<div class="row q-gutter-sm">
|
<div class="col-12 row no-wrap">
|
||||||
<datepicker
|
<div class="col-12 q-py-sm q-px-sm">
|
||||||
menu-class-name="modalfix"
|
<div class="q-gutter-sm">
|
||||||
v-model="formQuery.year"
|
<q-input dense outlined v-model="filterMain" label="ค้นหา">
|
||||||
:locale="'th'"
|
<template v-slot:append>
|
||||||
autoApply
|
|
||||||
year-picker
|
|
||||||
:enableTimePicker="false"
|
|
||||||
style="width: 150px"
|
|
||||||
@update:model-value="fetchListProjectNew"
|
|
||||||
>
|
|
||||||
<template #year="{ year }">{{ year + 543 }}</template>
|
|
||||||
<template #year-overlay-value="{ value }">{{
|
|
||||||
parseInt(value + 543)
|
|
||||||
}}</template>
|
|
||||||
<template #trigger>
|
|
||||||
<q-input
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
outlined
|
|
||||||
:model-value="
|
|
||||||
formQuery.year === 0 ? 'ทั้งหมด' : Number(formQuery.year) + 543
|
|
||||||
"
|
|
||||||
:label="`${'ปีงบประมาณ'}`"
|
|
||||||
>
|
|
||||||
<template v-if="formQuery.year" v-slot:append>
|
|
||||||
<q-icon
|
<q-icon
|
||||||
name="cancel"
|
v-if="filterMain !== ''"
|
||||||
@click.stop.prevent="
|
name="clear"
|
||||||
(formQuery.year = 0), fetchListProjectNew()
|
|
||||||
"
|
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
@click="filterMain = ''"
|
||||||
/>
|
/>
|
||||||
</template>
|
<q-icon v-else name="search" color="grey-5" />
|
||||||
<template v-slot:prepend>
|
|
||||||
<q-icon
|
|
||||||
name="event"
|
|
||||||
class="cursor-pointer"
|
|
||||||
style="color: var(--q-primary)"
|
|
||||||
>
|
|
||||||
</q-icon>
|
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
</template>
|
|
||||||
</datepicker>
|
|
||||||
<q-select
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
v-model="formQuery.status"
|
|
||||||
:options="statusOpt"
|
|
||||||
label="สถานะโครงการ"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
@update:model-value="fetchListProjectNew"
|
|
||||||
/>
|
|
||||||
<q-select
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
v-model="formQuery.org"
|
|
||||||
:options="orgOp"
|
|
||||||
label="หน่วยงาน"
|
|
||||||
option-label="name"
|
|
||||||
option-value="id"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
@update:model-value="fetchListProjectNew"
|
|
||||||
/>
|
|
||||||
<q-toolbar-title>
|
|
||||||
<q-btn flat round dense icon="add" color="primary" @click="onAdd()">
|
|
||||||
<q-tooltip>เพิ่ม</q-tooltip>
|
|
||||||
</q-btn>
|
|
||||||
</q-toolbar-title>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<q-space />
|
<q-tree
|
||||||
<div class="row q-gutter-sm">
|
class="tree-container"
|
||||||
<div>
|
dense
|
||||||
<q-btn
|
:nodes="node"
|
||||||
flat
|
node-key="orgTreeName"
|
||||||
round
|
label-key="labelName"
|
||||||
dense
|
v-model:expanded="expanded"
|
||||||
icon="mdi-arrow-down-bold-circle-outline"
|
:filter="filterMain"
|
||||||
color="blue"
|
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||||
@click="onDownload"
|
no-nodes-label="ไม่มีข้อมูล"
|
||||||
>
|
v-model:selected="formQuery.nodeId"
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
>
|
||||||
</q-btn>
|
<template v-slot:default-header="prop">
|
||||||
<!-- <q-btn
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="blue"
|
|
||||||
icon="mdi-arrow-down-bold-circle-outline"
|
|
||||||
>
|
|
||||||
<q-menu>
|
|
||||||
<q-list style="min-width: 100px" dense>
|
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
@click.stop="updateSelectedTreeMain(prop.node)"
|
||||||
v-for="items in itemDownload"
|
:active="formQuery.nodeId === prop.node.orgTreeId"
|
||||||
:key="items.value"
|
active-class="my-list-link text-primary text-weight-medium"
|
||||||
@click="onDownload(items.value)"
|
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||||
>
|
>
|
||||||
<q-item-section avatar>
|
<div>
|
||||||
<q-icon :color="items.color" :name="items.icon" />
|
<div class="text-weight-medium">
|
||||||
</q-item-section>
|
{{ prop.node.orgTreeName }}
|
||||||
<q-item-section :class="`text-${items.color}`">{{
|
</div>
|
||||||
items.label
|
<div class="text-weight-light text-grey-8">
|
||||||
}}</q-item-section>
|
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||||
|
{{
|
||||||
|
prop.node.orgTreeShortName == null
|
||||||
|
? null
|
||||||
|
: prop.node.orgTreeShortName
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</template>
|
||||||
</q-menu>
|
</q-tree>
|
||||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
</div>
|
||||||
</q-btn> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="col-12 row">
|
||||||
<q-input
|
<q-separator :vertical="!$q.screen.lt.md" />
|
||||||
standout
|
|
||||||
dense
|
|
||||||
v-model="formQuery.keyword"
|
|
||||||
ref="filterRef"
|
|
||||||
outlined
|
|
||||||
placeholder="ค้นหา"
|
|
||||||
@keyup.enter="fetchListProjectNew"
|
|
||||||
>
|
|
||||||
<template v-slot:append>
|
|
||||||
<q-icon v-if="formQuery.keyword == ''" name="search" />
|
|
||||||
<q-icon
|
|
||||||
v-if="formQuery.keyword !== ''"
|
|
||||||
name="clear"
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="
|
|
||||||
(formQuery.keyword = ''),
|
|
||||||
fetchListProject(),
|
|
||||||
(formQuery.page = 1)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</q-input>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<q-select
|
|
||||||
v-model="visibleColumns"
|
|
||||||
multiple
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
options-dense
|
|
||||||
:display-value="$q.lang.table.columns"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
:options="columns"
|
|
||||||
option-value="name"
|
|
||||||
options-cover
|
|
||||||
style="min-width: 150px"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-toolbar>
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-9 q-pa-md row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<d-table
|
<q-toolbar style="padding: 0">
|
||||||
for="table"
|
<div class="row q-gutter-sm">
|
||||||
ref="table"
|
<datepicker
|
||||||
:columns="columns"
|
menu-class-name="modalfix"
|
||||||
:rows="rows"
|
v-model="formQuery.year"
|
||||||
row-key="id"
|
:locale="'th'"
|
||||||
flat
|
autoApply
|
||||||
bordered
|
year-picker
|
||||||
dense
|
:enableTimePicker="false"
|
||||||
class="custom-header-table"
|
style="width: 150px"
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
@update:model-value="fetchListProjectNew"
|
||||||
:visible-columns="visibleColumns"
|
|
||||||
@update:pagination="updatePagination"
|
|
||||||
>
|
|
||||||
<template v-slot:header="props">
|
|
||||||
<q-tr :props="props">
|
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
|
||||||
</q-th>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
<template v-slot:body="props">
|
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
|
||||||
<q-td
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
@click="onClickAddOrView(true, props.row.id)"
|
|
||||||
>
|
>
|
||||||
<div class="table_ellipsis">
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
{{ col.value ? col.value : "-" }}
|
<template #year-overlay-value="{ value }">{{
|
||||||
</div>
|
parseInt(value + 543)
|
||||||
</q-td>
|
}}</template>
|
||||||
</q-tr>
|
<template #trigger>
|
||||||
</template>
|
<q-input
|
||||||
<template v-slot:pagination="scope">
|
dense
|
||||||
<q-pagination
|
lazy-rules
|
||||||
v-model="formQuery.page"
|
outlined
|
||||||
active-color="primary"
|
:model-value="
|
||||||
color="dark"
|
formQuery.year === 0
|
||||||
:max="Number(totalList)"
|
? 'ทั้งหมด'
|
||||||
size="sm"
|
: Number(formQuery.year) + 543
|
||||||
boundary-links
|
"
|
||||||
direction-links
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
:max-pages="5"
|
>
|
||||||
@update:model-value="fetchListProject"
|
<template v-if="formQuery.year" v-slot:append>
|
||||||
></q-pagination>
|
<q-icon
|
||||||
</template>
|
name="cancel"
|
||||||
</d-table>
|
@click.stop.prevent="
|
||||||
|
(formQuery.year = 0), fetchListProjectNew()
|
||||||
|
"
|
||||||
|
class="cursor-pointer"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
style="color: var(--q-primary)"
|
||||||
|
>
|
||||||
|
</q-icon>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
<q-select
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
v-model="formQuery.status"
|
||||||
|
:options="statusOpt"
|
||||||
|
label="สถานะโครงการ"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
@update:model-value="fetchListProjectNew"
|
||||||
|
/>
|
||||||
|
<q-toolbar-title>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="add"
|
||||||
|
color="primary"
|
||||||
|
@click="onAdd()"
|
||||||
|
>
|
||||||
|
<q-tooltip>เพิ่ม</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</q-toolbar-title>
|
||||||
|
</div>
|
||||||
|
<q-space />
|
||||||
|
<div class="row q-gutter-sm">
|
||||||
|
<div>
|
||||||
|
<q-btn
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="mdi-arrow-down-bold-circle-outline"
|
||||||
|
color="blue"
|
||||||
|
@click="onDownload"
|
||||||
|
>
|
||||||
|
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<q-input
|
||||||
|
standout
|
||||||
|
dense
|
||||||
|
v-model="formQuery.keyword"
|
||||||
|
ref="filterRef"
|
||||||
|
outlined
|
||||||
|
placeholder="ค้นหา"
|
||||||
|
@keyup.enter="fetchListProjectNew"
|
||||||
|
>
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon v-if="formQuery.keyword == ''" name="search" />
|
||||||
|
<q-icon
|
||||||
|
v-if="formQuery.keyword !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="
|
||||||
|
(formQuery.keyword = ''),
|
||||||
|
fetchListProject(),
|
||||||
|
(formQuery.page = 1)
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<q-select
|
||||||
|
v-model="visibleColumns"
|
||||||
|
multiple
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
options-dense
|
||||||
|
:display-value="$q.lang.table.columns"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="columns"
|
||||||
|
option-value="name"
|
||||||
|
options-cover
|
||||||
|
style="min-width: 150px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-toolbar>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<d-table
|
||||||
|
for="table"
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:rows="rows"
|
||||||
|
row-key="id"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
dense
|
||||||
|
class="custom-header-table"
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
|
@update:pagination="updatePagination"
|
||||||
|
>
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
|
</q-th>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:body="props">
|
||||||
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
|
<q-td
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
@click="onClickAddOrView(true, props.row.id)"
|
||||||
|
>
|
||||||
|
<div class="table_ellipsis">
|
||||||
|
{{ col.value ? col.value : "-" }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:pagination="scope">
|
||||||
|
<q-pagination
|
||||||
|
v-model="formQuery.page"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max="Number(totalList)"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
:max-pages="5"
|
||||||
|
@update:model-value="fetchListProject"
|
||||||
|
></q-pagination>
|
||||||
|
</template>
|
||||||
|
</d-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
|
|
@ -479,20 +516,34 @@ onMounted(() => {
|
||||||
<q-splitter v-model="splitterModel" disable>
|
<q-splitter v-model="splitterModel" disable>
|
||||||
<template v-slot:before>
|
<template v-slot:before>
|
||||||
<q-scroll-area visible style="height: 60vh">
|
<q-scroll-area visible style="height: 60vh">
|
||||||
|
<div class="q-pa-md">
|
||||||
|
<q-input dense outlined v-model="filter" label="ค้นหา">
|
||||||
|
<template v-slot:append>
|
||||||
|
<q-icon
|
||||||
|
v-if="filter !== ''"
|
||||||
|
name="clear"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="filter = ''"
|
||||||
|
/>
|
||||||
|
<q-icon v-else name="search" color="grey-5" />
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</div>
|
||||||
<q-tree
|
<q-tree
|
||||||
class="q-pa-sm"
|
|
||||||
dense
|
dense
|
||||||
:nodes="node"
|
:nodes="node"
|
||||||
node-key="orgName"
|
node-key="orgTreeName"
|
||||||
label-key="labelName"
|
label-key="labelName"
|
||||||
v-model:expanded="expanded"
|
v-model:expanded="expanded"
|
||||||
tick-strategy="strict"
|
:filter="filter"
|
||||||
v-model:ticked="ticked"
|
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||||
@update:ticked="updateTicked"
|
no-nodes-label="ไม่มีข้อมูล"
|
||||||
>
|
>
|
||||||
<template v-slot:default-header="prop">
|
<template v-slot:default-header="prop">
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
|
@click.stop="updateSelected(prop.node)"
|
||||||
|
:active="formProject.nodeId === prop.node.orgTreeId"
|
||||||
active-class="my-list-link text-primary text-weight-medium"
|
active-class="my-list-link text-primary text-weight-medium"
|
||||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||||
>
|
>
|
||||||
|
|
@ -522,7 +573,7 @@ onMounted(() => {
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
v-model="year"
|
v-model="formProject.year"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
autoApply
|
autoApply
|
||||||
year-picker
|
year-picker
|
||||||
|
|
@ -538,13 +589,17 @@ onMounted(() => {
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`,]"
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`,]"
|
||||||
outlined
|
outlined
|
||||||
:model-value="year === 0 ? null : Number(year) + 543"
|
:model-value="
|
||||||
|
formProject.year === null
|
||||||
|
? null
|
||||||
|
: Number(formProject.year) + 543
|
||||||
|
"
|
||||||
:label="`${'ปีงบประมาณ'}`"
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
>
|
>
|
||||||
<template v-if="year" v-slot:append>
|
<template v-if="formProject.year" v-slot:append>
|
||||||
<q-icon
|
<q-icon
|
||||||
name="cancel"
|
name="cancel"
|
||||||
@click.stop.prevent="year = 0"
|
@click.stop.prevent="formProject.year = null"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -562,7 +617,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
v-model="projectName"
|
v-model="formProject.projectName"
|
||||||
label="ชื่อโครงการ/กิจกรรม/หลักสูตร"
|
label="ชื่อโครงการ/กิจกรรม/หลักสูตร"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
|
@ -591,4 +646,19 @@ onMounted(() => {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tree-container {
|
||||||
|
overflow: auto;
|
||||||
|
height: 80vh;
|
||||||
|
border: 1px solid #e6e6e7;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-list-link {
|
||||||
|
color: rgb(118, 168, 222);
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #a3d3fb48 !important;
|
||||||
|
font-weight: 600;
|
||||||
|
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue