Refactoring code module 01_masterdata
This commit is contained in:
parent
82f5380f3e
commit
71be6d095f
22 changed files with 272 additions and 209 deletions
|
|
@ -2,12 +2,15 @@
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
/** importType*/
|
|
||||||
import type { FormDataRole } from "@/modules/01_masterdata/interface/request/Main";
|
import type { FormDataRole } from "@/modules/01_masterdata/interface/request/Main";
|
||||||
import type { DataOption } from "@/modules/01_masterdata/interface/index/Main";
|
import type {
|
||||||
|
DataOption,
|
||||||
|
SizeType,
|
||||||
|
} from "@/modules/01_masterdata/interface/index/Main";
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -40,15 +43,29 @@ const form = reactive<FormDataRole>({
|
||||||
date: [null, null],
|
date: [null, null],
|
||||||
});
|
});
|
||||||
|
|
||||||
const fieldLabels = {
|
const fieldLabels = reactive<{
|
||||||
|
score5: string;
|
||||||
|
score4: string;
|
||||||
|
score3: string;
|
||||||
|
score2: string;
|
||||||
|
score1: string;
|
||||||
|
}>({
|
||||||
score5: "5",
|
score5: "5",
|
||||||
score4: "4",
|
score4: "4",
|
||||||
score3: "3",
|
score3: "3",
|
||||||
score2: "2",
|
score2: "2",
|
||||||
score1: "1",
|
score1: "1",
|
||||||
};
|
});
|
||||||
|
|
||||||
const formScore = reactive<any>({
|
/** กำหนด type ให้ ScoreField*/
|
||||||
|
type ScoreField = "score5" | "score4" | "score3" | "score2" | "score1";
|
||||||
|
const formScore = reactive<{
|
||||||
|
score5: string;
|
||||||
|
score4: string;
|
||||||
|
score3: string;
|
||||||
|
score2: string;
|
||||||
|
score1: string;
|
||||||
|
}>({
|
||||||
score5: "",
|
score5: "",
|
||||||
score4: "",
|
score4: "",
|
||||||
score3: "",
|
score3: "",
|
||||||
|
|
@ -62,12 +79,15 @@ const roundOp = ref<DataOption[]>([
|
||||||
{ id: "OCT", name: "รอบตุลาคม" },
|
{ id: "OCT", name: "รอบตุลาคม" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ดึงข้อมูลยุทธศาสตร์
|
||||||
|
* @param id id rows
|
||||||
|
*/
|
||||||
function fetchspecialByid(id: string) {
|
function fetchspecialByid(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.kpiSpecial + `/edit/${id}`)
|
.get(config.API.kpiSpecial + `/edit/${id}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
form.year = data.year;
|
form.year = data.year;
|
||||||
form.round = data.period;
|
form.round = data.period;
|
||||||
|
|
@ -96,10 +116,15 @@ function fetchspecialByid(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onResize(size: any) {
|
/**
|
||||||
|
* resize ตาม ขนาดของ box ที่ได้รับมา
|
||||||
|
* @param size size { width,height}
|
||||||
|
*/
|
||||||
|
function onResize(size: SizeType) {
|
||||||
heightSize.value = `${size.height - 99}`;
|
heightSize.value = `${size.height - 99}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อโหลด component */
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchspecialByid(id.value);
|
fetchspecialByid(id.value);
|
||||||
});
|
});
|
||||||
|
|
@ -258,7 +283,7 @@ onMounted(() => {
|
||||||
<div class="col-8 text-left">
|
<div class="col-8 text-left">
|
||||||
<q-input
|
<q-input
|
||||||
readonly
|
readonly
|
||||||
v-model="formScore[field]"
|
v-model="formScore[field as ScoreField]"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
class="inputgreen"
|
class="inputgreen"
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,13 @@
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai } = mixin;
|
const { date2Thai } = mixin;
|
||||||
|
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const rows = defineModel<any[]>("rows", { required: true });
|
const rows = defineModel<any[]>("rows", { required: true });
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,12 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
|
import type { CompetencySumary } from "@/modules/01_masterdata/interface/index/Main";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
const { messageError } = useCounterMixin();
|
||||||
useCounterMixin();
|
|
||||||
const indicatorTotal = ref<any[]>([
|
const indicatorTotal = ref<CompetencySumary[]>([
|
||||||
{
|
{
|
||||||
value: "kpiPlan",
|
value: "kpiPlan",
|
||||||
label: "ตัวชี้วัดตามแผน",
|
label: "ตัวชี้วัดตามแผน",
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
|
|
@ -14,18 +17,15 @@ import type {
|
||||||
import type { FormQueryCapacity } from "@/modules/01_masterdata/interface/request/Main";
|
import type { FormQueryCapacity } from "@/modules/01_masterdata/interface/request/Main";
|
||||||
import type { ResDataCapacity } from "@/modules/01_masterdata/interface/response/Main";
|
import type { ResDataCapacity } from "@/modules/01_masterdata/interface/response/Main";
|
||||||
|
|
||||||
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
|
||||||
|
|
||||||
import CompetencyTotal from "@/modules/01_masterdata/components/competency/Summary.vue";
|
import CompetencyTotal from "@/modules/01_masterdata/components/competency/Summary.vue";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
|
|
||||||
const total = ref<number>();
|
const total = ref<number>();
|
||||||
const store = useKPIDataStore();
|
const store = useKPIDataStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
|
||||||
const $q = useQuasar();
|
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
|
||||||
|
|
||||||
const competencyTypeOp = ref<DataOption[]>([
|
const competencyTypeOp = ref<DataOption[]>([
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,24 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import dialogHeader from "@/components/DialogHeader.vue";
|
|
||||||
import type {
|
|
||||||
DataOption,
|
|
||||||
NewPagination,
|
|
||||||
} from "@/modules/14_KPI/interface/index/Main";
|
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import { useRoute } from "vue-router";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
import type { NewPagination } from "@/modules/14_KPI/interface/index/Main";
|
||||||
|
|
||||||
|
import dialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const total = ref<number>();
|
const total = ref<number>();
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<any[]>([]);
|
||||||
const groupName = ref<string>("");
|
const groupName = ref<string>("");
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const editStatus = ref<boolean>(false);
|
const editStatus = ref<boolean>(false);
|
||||||
const editId = ref<string>("");
|
const editId = ref<string>("");
|
||||||
// const competencyTypeOp = ref<DataOption[]>([
|
|
||||||
// {
|
|
||||||
// id: "ID1",
|
|
||||||
// name: "สมรรถนะหลัก",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: "ID2",
|
|
||||||
// name: "สมรรถนะประจำกลุ่มงาน",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: "ID3",
|
|
||||||
// name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: "ID4",
|
|
||||||
// name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: "ID5",
|
|
||||||
// name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
|
|
||||||
// },
|
|
||||||
// ]);
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "nameGroupKPI",
|
name: "nameGroupKPI",
|
||||||
|
|
@ -101,6 +75,7 @@ async function fetchData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** เพิ่มข้อมูล */
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.kpiGroup, {
|
.post(config.API.kpiGroup, {
|
||||||
|
|
@ -118,6 +93,7 @@ async function addData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** save แก้ไขข้อมูล */
|
||||||
async function editData(id: string) {
|
async function editData(id: string) {
|
||||||
await http
|
await http
|
||||||
.put(config.API.kpiGroupById(id), {
|
.put(config.API.kpiGroupById(id), {
|
||||||
|
|
@ -135,6 +111,7 @@ async function editData(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ลบข้อมูล */
|
||||||
async function deleteData(id: string) {
|
async function deleteData(id: string) {
|
||||||
await http
|
await http
|
||||||
.delete(config.API.kpiGroupById(id))
|
.delete(config.API.kpiGroupById(id))
|
||||||
|
|
@ -161,6 +138,7 @@ function closeDialog() {
|
||||||
groupName.value = "";
|
groupName.value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** เปิด dialog แก้ไข */
|
||||||
function onEdit(data: any) {
|
function onEdit(data: any) {
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
editStatus.value = true;
|
editStatus.value = true;
|
||||||
|
|
@ -168,6 +146,7 @@ function onEdit(data: any) {
|
||||||
editId.value = data.id;
|
editId.value = data.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** บันทึกข้อมูล */
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,33 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
import Header from "@/components/DialogHeader.vue";
|
import Header from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
NewPagination,
|
NewPagination,
|
||||||
|
ListLinkGroup,
|
||||||
|
Position,
|
||||||
} from "@/modules/01_masterdata/interface/index/Main";
|
} from "@/modules/01_masterdata/interface/index/Main";
|
||||||
import http from "@/plugins/http";
|
|
||||||
import config from "@/app.config";
|
|
||||||
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission } from "@/utils/permissions";
|
||||||
|
|
||||||
const total = ref<number>();
|
const total = ref<number>();
|
||||||
const id = ref<string>("");
|
const id = ref<string>("");
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<ListLinkGroup[]>([]);
|
||||||
const editStatus = ref<boolean>(false);
|
const editStatus = ref<boolean>(false);
|
||||||
const groupName = ref<any>();
|
const groupName = ref<Position | null>();
|
||||||
const position = ref<any>();
|
const position = ref<string[]>();
|
||||||
const competency = ref<any>();
|
const competency = ref<Position[]>();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const groupNameOp = ref<DataOption[]>([]);
|
const groupNameOp = ref<DataOption[]>([]);
|
||||||
|
|
@ -233,9 +237,9 @@ function onSubmit() {
|
||||||
? config.API.kpiLink + `/${id.value}`
|
? config.API.kpiLink + `/${id.value}`
|
||||||
: config.API.kpiLink;
|
: config.API.kpiLink;
|
||||||
const body = {
|
const body = {
|
||||||
kpiGroupId: groupName.value.id,
|
kpiGroupId: groupName.value?.id,
|
||||||
positions: position.value,
|
positions: position.value,
|
||||||
kpiCapacityIds: competency.value.map((i: any) => i.id),
|
kpiCapacityIds: competency.value?.map((i: any) => i.id),
|
||||||
};
|
};
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
http[editStatus.value ? "put" : "post"](url, body)
|
http[editStatus.value ? "put" : "post"](url, body)
|
||||||
|
|
@ -248,12 +252,13 @@ function onSubmit() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ปิด dialog */
|
||||||
function close() {
|
function close() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
editStatus.value = false;
|
editStatus.value = false;
|
||||||
groupName.value = "";
|
groupName.value = null;
|
||||||
position.value = null;
|
position.value = [];
|
||||||
competency.value = null;
|
competency.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,10 @@ import { checkPermission } from "@/utils/permissions";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataLevel = ref<any>();
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { showLoader, hideLoader, success } = useCounterMixin();
|
const { showLoader, hideLoader, success } = useCounterMixin();
|
||||||
|
|
||||||
|
const dataLevel = ref<any>();
|
||||||
const fieldLabels = {
|
const fieldLabels = {
|
||||||
score5: "5",
|
score5: "5",
|
||||||
score4: "4",
|
score4: "4",
|
||||||
|
|
@ -21,23 +22,6 @@ const fieldLabels = {
|
||||||
score1: "1",
|
score1: "1",
|
||||||
};
|
};
|
||||||
|
|
||||||
const formScore = reactive<any>({
|
|
||||||
score5: "",
|
|
||||||
score4: "",
|
|
||||||
score3: "",
|
|
||||||
score2: "",
|
|
||||||
score1: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
interface FormScore {
|
|
||||||
score5: string;
|
|
||||||
score4: string;
|
|
||||||
score3: string;
|
|
||||||
score2: string;
|
|
||||||
score1: string;
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
const body = {
|
const body = {
|
||||||
formScore: dataLevel.value.map((item: any) => {
|
formScore: dataLevel.value.map((item: any) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from "vue";
|
import { ref } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
import Main from "@/modules/01_masterdata/components/competency/Forms/Main.vue";
|
import Main from "@/modules/01_masterdata/components/competency/Forms/Main.vue";
|
||||||
|
|
@ -7,24 +7,12 @@ import Main from "@/modules/01_masterdata/components/competency/Forms/Main.vue";
|
||||||
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
||||||
|
|
||||||
import type { DataOption } from "@/modules/01_masterdata/interface/index/Main";
|
import type { DataOption } from "@/modules/01_masterdata/interface/index/Main";
|
||||||
import type { FormCompetency } from "@/modules/01_masterdata/interface/request/Main";
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const store = useKPIDataStore();
|
const store = useKPIDataStore();
|
||||||
|
|
||||||
const checkRoute = ref<boolean>(route.name == "KPICompetencyDetailByid");
|
const checkRoute = ref<boolean>(route.name == "KPICompetencyDetailByid");
|
||||||
const formData = reactive<FormCompetency>({
|
|
||||||
competencyType: "",
|
|
||||||
competencyName: "",
|
|
||||||
definition: "",
|
|
||||||
level_1: ["", "", "", "", "", ""],
|
|
||||||
level_2: "",
|
|
||||||
level_3: "",
|
|
||||||
level_4: "",
|
|
||||||
level_5: "",
|
|
||||||
evaluation: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
const competencyTypeOp = ref<DataOption[]>([
|
const competencyTypeOp = ref<DataOption[]>([
|
||||||
{
|
{
|
||||||
|
|
@ -48,28 +36,6 @@ const competencyTypeOp = ref<DataOption[]>([
|
||||||
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
|
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const itemsFormCard = ref<any>([
|
|
||||||
{
|
|
||||||
id: "",
|
|
||||||
name: "",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
function ocClickAdd() {
|
|
||||||
if (itemsFormCard.value.length !== 6) {
|
|
||||||
const data = {
|
|
||||||
id: "",
|
|
||||||
name: "",
|
|
||||||
};
|
|
||||||
itemsFormCard.value.push(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** บันทึก */
|
|
||||||
function onSubmit() {
|
|
||||||
console.log(formData);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,13 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import { useQuasar } from "quasar";
|
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
|
||||||
import config from "@/app.config";
|
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm, showLoader, hideLoader, success, messageError } = mixin;
|
const { dialogConfirm } = mixin;
|
||||||
const router = useRouter();
|
|
||||||
const store = useKPIDataStore();
|
const store = useKPIDataStore();
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,15 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import config from "@/app.config";
|
import { useKPIDataStore } from "@/modules/01_masterdata/stores/KPIStore";
|
||||||
|
|
||||||
|
import type {} from
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm, showLoader, hideLoader, success, messageError } = mixin;
|
const { dialogConfirm } = mixin;
|
||||||
const router = useRouter;
|
|
||||||
const store = useKPIDataStore();
|
const store = useKPIDataStore();
|
||||||
|
|
||||||
interface DetailLevelType {
|
interface DetailLevelType {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
|
@ -34,6 +35,7 @@ const formData = reactive({
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** ดึงข้อมูลรายละเอียด */
|
||||||
function fetchDetail() {
|
function fetchDetail() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -53,6 +55,7 @@ function fetchDetail() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** เพิ่ม ระดับ สมรรถนะ */
|
||||||
function onClickAddLevels() {
|
function onClickAddLevels() {
|
||||||
const levelName = formData.levels.length + 1;
|
const levelName = formData.levels.length + 1;
|
||||||
const data = {
|
const data = {
|
||||||
|
|
@ -67,6 +70,7 @@ function onClickAddLevels() {
|
||||||
levelName <= 6 && formData.levels.push(data);
|
levelName <= 6 && formData.levels.push(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** บันทึกข้อมูล */
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
const formBody = {
|
const formBody = {
|
||||||
|
|
@ -95,9 +99,12 @@ function onSubmit() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ลบ ระดับ สมรรถนะ*/
|
||||||
function onDeleteLevels(index: number) {
|
function onDeleteLevels(index: number) {
|
||||||
formData.levels.splice(index, 1);
|
formData.levels.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ทำงานเมื่อ โหลด component */
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (competencyId.value) {
|
if (competencyId.value) {
|
||||||
fetchDetail();
|
fetchDetail();
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useQuasar } from "quasar";
|
|
||||||
|
|
||||||
|
import type { CompetencySumary } from "@/modules/01_masterdata/interface/index/Main";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
const { messageError } = useCounterMixin();
|
||||||
useCounterMixin();
|
|
||||||
|
|
||||||
const competencyTotal = ref<any[]>([
|
const competencyTotal = ref<CompetencySumary[]>([
|
||||||
{
|
{
|
||||||
value: "HEAD",
|
value: "HEAD",
|
||||||
label: "สมรรถนะหลัก",
|
label: "สมรรถนะหลัก",
|
||||||
|
|
@ -49,13 +49,17 @@ function getTotal() {
|
||||||
.get(config.API.capacitySummary)
|
.get(config.API.capacitySummary)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
competencyTotal.value.forEach((i) => {
|
competencyTotal.value.forEach((i: CompetencySumary) => {
|
||||||
const map = data.find((item: any) => item.type === i.value);
|
const map = data.find((item: any) => item.type === i.value);
|
||||||
if (map) i.total = map.total;
|
if (map) i.total = map.total;
|
||||||
});
|
});
|
||||||
const totalSum = data.reduce((i: any, j: any) => i + +j.total, 0);
|
const totalSum = data.reduce((i: any, j: any) => i + +j.total, 0);
|
||||||
competencyTotal.value.find((i) => i.value === "total").total =
|
const totalItem = competencyTotal.value.find(
|
||||||
totalSum.toString();
|
(i: CompetencySumary) => i.value === "total"
|
||||||
|
);
|
||||||
|
if (totalItem) {
|
||||||
|
totalItem.total = totalSum.toString();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,126 @@ interface DataAssignment {
|
||||||
year: string;
|
year: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IndicatorType {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
including: number;
|
||||||
|
includingName: string;
|
||||||
|
kpiPeriod: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OrgTreeNode {
|
||||||
|
orgTreeId: string;
|
||||||
|
orgRootId: string;
|
||||||
|
orgLevel: number;
|
||||||
|
orgName: string;
|
||||||
|
orgTreeName: string;
|
||||||
|
orgTreeShortName: string;
|
||||||
|
orgTreeCode: string;
|
||||||
|
orgCode: string;
|
||||||
|
orgTreeRank: string;
|
||||||
|
orgTreeRankSub: string | null;
|
||||||
|
orgTreeOrder: number;
|
||||||
|
orgRootCode: string;
|
||||||
|
orgTreePhoneEx: string;
|
||||||
|
orgTreePhoneIn: string;
|
||||||
|
orgTreeFax: string;
|
||||||
|
orgRevisionId: string;
|
||||||
|
orgRootName: string;
|
||||||
|
responsibility: string | null;
|
||||||
|
labelName: string;
|
||||||
|
totalPosition: number;
|
||||||
|
totalPositionCurrentUse: number;
|
||||||
|
totalPositionCurrentVacant: number;
|
||||||
|
totalPositionNextUse: number;
|
||||||
|
totalPositionNextVacant: number;
|
||||||
|
totalRootPosition: number;
|
||||||
|
totalRootPositionCurrentUse: number;
|
||||||
|
totalRootPositionCurrentVacant: number;
|
||||||
|
totalRootPositionNextUse: number;
|
||||||
|
totalRootPositionNextVacant: number;
|
||||||
|
children: OrgTreeNode[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DataHistory {
|
||||||
|
id: string;
|
||||||
|
createdAt: Date | null;
|
||||||
|
createdUserId: string;
|
||||||
|
lastUpdatedAt: Date | null;
|
||||||
|
lastUpdateUserId: string;
|
||||||
|
createdFullName: string;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
kpiPlanId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface NodePlan {
|
||||||
|
id: string;
|
||||||
|
level: number;
|
||||||
|
name: string;
|
||||||
|
children: NodePlan[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface KpiRoleData {
|
||||||
|
id: string;
|
||||||
|
createdAt: Date | null;
|
||||||
|
createdUserId: string;
|
||||||
|
lastUpdatedAt: Date | null;
|
||||||
|
lastUpdateUserId: string;
|
||||||
|
createdFullName: string;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
kpiRoleId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IndicatorTotal {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
color: string;
|
||||||
|
}
|
||||||
|
interface CompetencySumary {
|
||||||
|
value: string;
|
||||||
|
label: string;
|
||||||
|
color: string;
|
||||||
|
total?:string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Position {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Capacity {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
type: string;
|
||||||
|
description: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ListLinkGroup {
|
||||||
|
id: string;
|
||||||
|
groupName: string;
|
||||||
|
groupId: string;
|
||||||
|
positions: Position[];
|
||||||
|
capacitys: Capacity[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SizeType{
|
||||||
|
width:number
|
||||||
|
height:number
|
||||||
|
}
|
||||||
export type {
|
export type {
|
||||||
Pagination,
|
Pagination,
|
||||||
DataOption,
|
DataOption,
|
||||||
NewPagination,
|
NewPagination,
|
||||||
ItemsMenu,
|
ItemsMenu,
|
||||||
DataAssignment,
|
DataAssignment,
|
||||||
|
IndicatorType,
|
||||||
|
OrgTreeNode,
|
||||||
|
DataHistory,
|
||||||
|
NodePlan,
|
||||||
|
KpiRoleData,
|
||||||
|
IndicatorTotal,
|
||||||
|
ListLinkGroup,
|
||||||
|
Position,
|
||||||
|
CompetencySumary,
|
||||||
|
SizeType
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ interface DataStrategic {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
level: number;
|
level: number;
|
||||||
children: DataStrategic;
|
children: DataStrategic[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { DataStrategic };
|
export type { DataStrategic };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useQuasar, type QTableProps } from "quasar";
|
import { useQuasar, type QTableProps } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -21,7 +21,6 @@ import { checkPermission } from "@/utils/permissions";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
|
||||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
||||||
useCounterMixin();
|
useCounterMixin();
|
||||||
|
|
||||||
|
|
@ -50,6 +49,7 @@ const visibleColumns = ref<string[]>(["including", "includingName"]);
|
||||||
|
|
||||||
/** Option รอบการประเมิน*/
|
/** Option รอบการประเมิน*/
|
||||||
const roundOp = ref<DataOption[]>([
|
const roundOp = ref<DataOption[]>([
|
||||||
|
{ id: "", name: "ทั้งหมด" },
|
||||||
{ id: "APR", name: "รอบเมษายน" },
|
{ id: "APR", name: "รอบเมษายน" },
|
||||||
{ id: "OCT", name: "รอบตุลาคม" },
|
{ id: "OCT", name: "รอบตุลาคม" },
|
||||||
]);
|
]);
|
||||||
|
|
@ -230,9 +230,6 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formFilter.period"
|
v-model="formFilter.period"
|
||||||
:model-value="
|
|
||||||
formFilter.period === '' ? 'ทั้งหมด' : formFilter.period
|
|
||||||
"
|
|
||||||
:options="roundOp"
|
:options="roundOp"
|
||||||
label="รอบการประเมิน"
|
label="รอบการประเมิน"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
|
|
||||||
// import type { ItemsMenu } from "@/modules/01_masterdata/interface/index/Main";
|
|
||||||
import type { DataStrategic } from "@/modules/01_masterdata/interface/response/Strategic";
|
import type { DataStrategic } from "@/modules/01_masterdata/interface/response/Strategic";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
|
||||||
import { useRoute } from "vue-router";
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const {
|
const {
|
||||||
showLoader,
|
showLoader,
|
||||||
|
|
@ -22,29 +21,7 @@ const {
|
||||||
success,
|
success,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
// const ListMenu = ref<ItemsMenu[]>([
|
const nodes = ref<DataStrategic[]>([]);
|
||||||
// {
|
|
||||||
// label: "เพิ่ม",
|
|
||||||
// icon: "add",
|
|
||||||
// value: "ADD",
|
|
||||||
// color: "primary",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: "แก้ไข",
|
|
||||||
// icon: "edit",
|
|
||||||
// value: "EDIT",
|
|
||||||
// color: "edit",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// label: "ลบ",
|
|
||||||
// icon: "delete",
|
|
||||||
// value: "DEL",
|
|
||||||
// color: "red",
|
|
||||||
// },
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const nodes = ref<any[]>([]);
|
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const expanded = ref<Array<string>>([]);
|
const expanded = ref<Array<string>>([]);
|
||||||
const nodeId = ref<string>("");
|
const nodeId = ref<string>("");
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,6 @@ import ListLinkGroup from "@/modules/01_masterdata/components/competency/03ListL
|
||||||
import ListCriteria from "@/modules/01_masterdata/components/competency/04ListCriteria.vue";
|
import ListCriteria from "@/modules/01_masterdata/components/competency/04ListCriteria.vue";
|
||||||
import ListDetail from "@/modules/01_masterdata/components/competency/05ListDetail.vue";
|
import ListDetail from "@/modules/01_masterdata/components/competency/05ListDetail.vue";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
|
||||||
import config from "@/app.config";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { useQuasar } from "quasar";
|
|
||||||
|
|
||||||
const $q = useQuasar();
|
|
||||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
|
||||||
useCounterMixin();
|
|
||||||
|
|
||||||
const currentTab = ref<string>("list_competency");
|
const currentTab = ref<string>("list_competency");
|
||||||
const tabs = ref<Array<any>>([]);
|
const tabs = ref<Array<any>>([]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,26 +5,31 @@ import { useRouter, useRoute } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
|
|
||||||
|
import type {
|
||||||
|
DataOption,
|
||||||
|
IndicatorType,
|
||||||
|
OrgTreeNode,
|
||||||
|
DataHistory,
|
||||||
|
} from "@/modules/01_masterdata/interface/index/Main";
|
||||||
|
|
||||||
import type { DataOption } from "@/modules/01_masterdata/interface/index/Main";
|
|
||||||
import DialogHistory from "@/modules/01_masterdata/components/Indicators/DialogHistory.vue";
|
import DialogHistory from "@/modules/01_masterdata/components/Indicators/DialogHistory.vue";
|
||||||
import Summary from "@/modules/01_masterdata/components/Indicators/Summary.vue";
|
import Summary from "@/modules/01_masterdata/components/Indicators/Summary.vue";
|
||||||
|
|
||||||
/** importStore*/
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
|
||||||
/** use*/
|
|
||||||
const dataHistory = ref<any[]>([]);
|
|
||||||
const modalHistory = ref<boolean>(false);
|
|
||||||
const isAll = ref<boolean>(false);
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
||||||
useCounterMixin();
|
useCounterMixin();
|
||||||
|
|
||||||
|
const dataHistory = ref<DataHistory[]>([]);
|
||||||
|
const modalHistory = ref<boolean>(false);
|
||||||
|
const isAll = ref<boolean>(false);
|
||||||
|
|
||||||
/** หัวตาราง */
|
/** หัวตาราง */
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<IndicatorType[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "including",
|
name: "including",
|
||||||
|
|
@ -45,7 +50,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const node = ref<any>([]);
|
const node = ref<OrgTreeNode[]>([]);
|
||||||
const expanded = ref<any>([]);
|
const expanded = ref<any>([]);
|
||||||
const filterMain = ref<string>("");
|
const filterMain = ref<string>("");
|
||||||
const visibleColumns = ref<string[]>(["including", "includingName"]);
|
const visibleColumns = ref<string[]>(["including", "includingName"]);
|
||||||
|
|
@ -68,6 +73,7 @@ const nodeData = reactive<any>({
|
||||||
keyword: "",
|
keyword: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** ดึงข้อมูล */
|
||||||
function fetchList() {
|
function fetchList() {
|
||||||
if (nodeData.nodeId) {
|
if (nodeData.nodeId) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -96,6 +102,11 @@ function fetchList() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังชั่น add/edit
|
||||||
|
* @param status true = edit / false = add
|
||||||
|
* @param id id edit
|
||||||
|
*/
|
||||||
function onClickAddOrView(status: boolean = false, id: string = "") {
|
function onClickAddOrView(status: boolean = false, id: string = "") {
|
||||||
status
|
status
|
||||||
? router.push(`/masterdata/indicator-plan/${id}`)
|
? router.push(`/masterdata/indicator-plan/${id}`)
|
||||||
|
|
@ -120,6 +131,7 @@ function fetchActive() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ดึงข้อมูลโครงสรร้าง */
|
||||||
async function fetchTree(id: string) {
|
async function fetchTree(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -136,6 +148,7 @@ async function fetchTree(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** เรียกข้อมูลตาม row โครงสร้าง*/
|
||||||
function updateSelectedTreeMain(data: any) {
|
function updateSelectedTreeMain(data: any) {
|
||||||
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
|
if (nodeData.node === data.orgLevel && nodeData.nodeId === data.orgTreeId) {
|
||||||
nodeData.node = null;
|
nodeData.node = null;
|
||||||
|
|
@ -147,11 +160,13 @@ function updateSelectedTreeMain(data: any) {
|
||||||
fetchListProjectNew();
|
fetchListProjectNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ดึงรายละเอียดโครงสร้าง */
|
||||||
function fetchListProjectNew() {
|
function fetchListProjectNew() {
|
||||||
nodeData.page = 1;
|
nodeData.page = 1;
|
||||||
fetchList();
|
fetchList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** delete */
|
||||||
async function deleteData(idData: string) {
|
async function deleteData(idData: string) {
|
||||||
dialogRemove($q, () =>
|
dialogRemove($q, () =>
|
||||||
http
|
http
|
||||||
|
|
@ -169,6 +184,7 @@ async function deleteData(idData: string) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** clear input filter */
|
||||||
function clearFilter() {
|
function clearFilter() {
|
||||||
nodeData.keyword = "";
|
nodeData.keyword = "";
|
||||||
fetchActive();
|
fetchActive();
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,42 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, watch } from "vue";
|
import { ref, reactive, onMounted, watch } from "vue";
|
||||||
import { useQuasar, type QTableProps } from "quasar";
|
import { useQuasar, type QTableProps } from "quasar";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { checkPermission } from "@/utils/permissions";
|
||||||
|
|
||||||
import type { FormListMainByRole } from "@/modules/01_masterdata/interface/request/Main";
|
import type { FormListMainByRole } from "@/modules/01_masterdata/interface/request/Main";
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
NewPagination,
|
NewPagination,
|
||||||
|
KpiRoleData,
|
||||||
|
IndicatorType,
|
||||||
|
IndicatorTotal,
|
||||||
} from "@/modules/01_masterdata/interface/index/Main";
|
} from "@/modules/01_masterdata/interface/index/Main";
|
||||||
|
|
||||||
import DialogHistory from "@/modules/01_masterdata/components/Indicators/DialogHistory.vue";
|
import DialogHistory from "@/modules/01_masterdata/components/Indicators/DialogHistory.vue";
|
||||||
import Summary from "@/modules/01_masterdata/components/Indicators/Summary.vue";
|
import Summary from "@/modules/01_masterdata/components/Indicators/Summary.vue";
|
||||||
|
|
||||||
/** importStore*/
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
|
||||||
|
|
||||||
/** use*/
|
|
||||||
const dataHistory = ref<any[]>([]);
|
|
||||||
const modalHistory = ref<boolean>(false);
|
|
||||||
const total = ref<number>();
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
|
||||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
||||||
useCounterMixin();
|
useCounterMixin();
|
||||||
|
|
||||||
|
/** use*/
|
||||||
|
const dataHistory = ref<KpiRoleData[]>([]);
|
||||||
|
const modalHistory = ref<boolean>(false);
|
||||||
|
const total = ref<number>();
|
||||||
|
|
||||||
const positionOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
const positionOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||||
const positionMainOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
const positionMainOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||||
|
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
|
||||||
/** หัวตาราง */
|
/** หัวตาราง */
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<IndicatorType[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "including",
|
name: "including",
|
||||||
|
|
@ -70,7 +72,7 @@ const pagination = ref({
|
||||||
rowsPerPage: formFilter.pageSize,
|
rowsPerPage: formFilter.pageSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
const indicatorTotal = ref<any[]>([
|
const indicatorTotal = ref<IndicatorTotal[]>([
|
||||||
{
|
{
|
||||||
value: "kpiPlan",
|
value: "kpiPlan",
|
||||||
label: "ตัวชี้วัดตามแผน",
|
label: "ตัวชี้วัดตามแผน",
|
||||||
|
|
@ -103,7 +105,6 @@ const roundOp = ref<DataOption[]>([
|
||||||
async function fetchList() {
|
async function fetchList() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.kpiRoleMainList + `/search-edit`, {
|
.post(config.API.kpiRoleMainList + `/search-edit`, {
|
||||||
// ?page=${formFilter.page}&pageSize=${formFilter.pageSize}&period=${formFilter.round}&position=${formFilter.position}&keyword=${formFilter.keyword}&year=${formFilter.year}
|
|
||||||
keyword: formFilter.keyword,
|
keyword: formFilter.keyword,
|
||||||
position: formFilter.position,
|
position: formFilter.position,
|
||||||
period: formFilter.round,
|
period: formFilter.round,
|
||||||
|
|
|
||||||
|
|
@ -1818,7 +1818,6 @@ export const useManageDataStore = defineStore("manage", () => {
|
||||||
.get(apiInsignia)
|
.get(apiInsignia)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
console.log(data);
|
|
||||||
let rows: InsigniaResponse[] = [];
|
let rows: InsigniaResponse[] = [];
|
||||||
let version: string = "";
|
let version: string = "";
|
||||||
let id: string = "";
|
let id: string = "";
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,6 @@ const fetchData = async () => {
|
||||||
.get(config.API.periodExamType("all"))
|
.get(config.API.periodExamType("all"))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
console.log("🚀 ~ .then ~ data:", data);
|
|
||||||
let result: ResponsePeriodExam[] = [];
|
let result: ResponsePeriodExam[] = [];
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
data.map((r: RequestPeriodExam) => {
|
data.map((r: RequestPeriodExam) => {
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,6 @@ const detailPage = (id: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
function onSave(data: any) {
|
function onSave(data: any) {
|
||||||
console.log("🚀 ~ onSave ~ data:", data);
|
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.put(
|
.put(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue