โครงการ => API ลักษณะโครงการ
This commit is contained in:
parent
c5b68d0691
commit
b76f5854cf
5 changed files with 107 additions and 74 deletions
|
|
@ -6,9 +6,10 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
/**importType*/
|
/**importType*/
|
||||||
import type {
|
import type {
|
||||||
DataOption,
|
DataOptionTechnique,
|
||||||
FormProjectDetail,
|
FormProjectDetail,
|
||||||
} from "@/modules/15_development/interface/index/Main";
|
} from "@/modules/15_development/interface/index/Main";
|
||||||
|
import type { DataStrategic } from "@/modules/15_development/interface/response/Main";
|
||||||
|
|
||||||
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -27,18 +28,8 @@ const projectTypeOp = ref<String[]>([
|
||||||
"โครงการใหม่",
|
"โครงการใหม่",
|
||||||
"โครงการต่อเนื่อง",
|
"โครงการต่อเนื่อง",
|
||||||
]);
|
]);
|
||||||
// const projectTechniquesOp = ref<DataOption[]>([
|
|
||||||
// { id: "TRAINING", name: "การอบรม" },
|
|
||||||
// { id: "MEETING", name: "การประชุม" },
|
|
||||||
// { id: "SEMINAR", name: "การสัมมนา" },
|
|
||||||
// { id: "STUDY_TOUR", name: "การศึกษาดูงาน" },
|
|
||||||
// { id: "ACADEMIC_SEMINAR", name: "การสัมมนาทางวิชาการ" },
|
|
||||||
// { id: "WORKSHOP", name: "การสัมมนาเชิงปฏิบัติการ" },
|
|
||||||
// { id: "SPECIAL_LECTURE", name: "การบรรยายพิเศษ" },
|
|
||||||
// { id: "STUDY_TRAINING", name: "การฝึกศึกษา" },
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
const projectTechniquesOp = ref<any[]>([
|
const projectTechniquesOp = ref<DataOptionTechnique[]>([
|
||||||
{ value: "การอบรม", label: "การอบรม" },
|
{ value: "การอบรม", label: "การอบรม" },
|
||||||
{ value: "การประชุม", label: "การประชุม" },
|
{ value: "การประชุม", label: "การประชุม" },
|
||||||
{ value: "การสัมมนา", label: "การสัมมนา" },
|
{ value: "การสัมมนา", label: "การสัมมนา" },
|
||||||
|
|
@ -65,7 +56,7 @@ const formData = reactive<FormProjectDetail>({
|
||||||
projectNigthHoldActual: null,
|
projectNigthHoldActual: null,
|
||||||
developmentProjectTechniqueActuals: [],
|
developmentProjectTechniqueActuals: [],
|
||||||
projectModalActual: null,
|
projectModalActual: null,
|
||||||
projectModalPlanneds: null,
|
projectModalPlanned: null,
|
||||||
strategyChildPlannedId: null, //id ยุทธศาสตร์เป้าหมายตามแผน
|
strategyChildPlannedId: null, //id ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
strategyChildPlannedNode: 0, //node ยุทธศาสตร์เป้าหมายตามแผน
|
strategyChildPlannedNode: 0, //node ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
strategyChildActualId: null, //id ยุทธศาสตร์เป้าหมายตามจริง
|
strategyChildActualId: null, //id ยุทธศาสตร์เป้าหมายตามจริง
|
||||||
|
|
@ -77,8 +68,8 @@ const filter = ref<string>("");
|
||||||
const filter2 = ref<string>("");
|
const filter2 = ref<string>("");
|
||||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||||
const noData = ref<string>("ไม่มีข้อมูล");
|
const noData = ref<string>("ไม่มีข้อมูล");
|
||||||
const expanded = ref<Array<any>>([]);
|
const expanded = ref<Array<string | null>>([]);
|
||||||
const expanded2 = ref<Array<any>>([]);
|
const expanded2 = ref<Array<string | null>>([]);
|
||||||
function fetchData() {
|
function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -102,10 +93,33 @@ function fetchData() {
|
||||||
formData.projectNigthHoldActual = data.projectNigthHoldActual;
|
formData.projectNigthHoldActual = data.projectNigthHoldActual;
|
||||||
formData.developmentProjectTechniqueActuals =
|
formData.developmentProjectTechniqueActuals =
|
||||||
data.developmentProjectTechniqueActuals;
|
data.developmentProjectTechniqueActuals;
|
||||||
formData.strategyChildPlannedId = data.strategyChildPlannedId;
|
formData.projectModalPlanned = data.projectModalPlanned;
|
||||||
formData.strategyChildPlannedNode = data.strategyChildPlannedNode;
|
expanded.value = [
|
||||||
formData.strategyChildActualId = data.strategyChildActualId;
|
data.strategyChild1Planned,
|
||||||
formData.strategyChildActualNode = data.strategyChildActualNode;
|
data.strategyChild2Planned,
|
||||||
|
data.strategyChild3Planned,
|
||||||
|
data.strategyChild4Planned,
|
||||||
|
data.strategyChild5Planned,
|
||||||
|
];
|
||||||
|
expanded2.value = [
|
||||||
|
data.strategyChild1Actual,
|
||||||
|
data.strategyChild2Actual,
|
||||||
|
data.strategyChild3Actual,
|
||||||
|
data.strategyChild4Actual,
|
||||||
|
data.strategyChild5Actual,
|
||||||
|
];
|
||||||
|
const filteredArray = expanded.value.filter((item) => item !== null);
|
||||||
|
const filteredArray2 = expanded2.value.filter((item) => item !== null);
|
||||||
|
const lastItem = filteredArray[filteredArray.length - 1];
|
||||||
|
const lastItem2 = filteredArray2[filteredArray2.length - 1];
|
||||||
|
formData.strategyChildPlannedId =
|
||||||
|
lastItem !== undefined ? lastItem : null;
|
||||||
|
formData.strategyChildPlannedNode =
|
||||||
|
lastItem !== undefined ? filteredArray.length : null;
|
||||||
|
formData.strategyChildActualId =
|
||||||
|
lastItem2 !== undefined ? lastItem2 : null;
|
||||||
|
formData.strategyChildActualNode =
|
||||||
|
lastItem2 !== undefined ? filteredArray2.length : null;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -147,7 +161,7 @@ async function onSubmit() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelected(data: any, type: string) {
|
function updateSelected(data: DataStrategic, type: string) {
|
||||||
if (type === "1") {
|
if (type === "1") {
|
||||||
formData.strategyChildPlannedId = data.id;
|
formData.strategyChildPlannedId = data.id;
|
||||||
formData.strategyChildPlannedNode = data.level;
|
formData.strategyChildPlannedNode = data.level;
|
||||||
|
|
@ -388,7 +402,7 @@ onMounted(() => {
|
||||||
:disable="store.projectStatus === 'FINISH'"
|
:disable="store.projectStatus === 'FINISH'"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.projectModalPlanneds"
|
v-model="formData.projectModalPlanned"
|
||||||
label="จำนวน (รุ่น)"
|
label="จำนวน (รุ่น)"
|
||||||
mask="#"
|
mask="#"
|
||||||
reverse-fill-mask
|
reverse-fill-mask
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ interface DataOptionCheckBox {
|
||||||
label: string;
|
label: string;
|
||||||
value: boolean;
|
value: boolean;
|
||||||
}
|
}
|
||||||
|
interface DataOptionTechnique {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
interface FormFilter {
|
interface FormFilter {
|
||||||
page: number;
|
page: number;
|
||||||
|
|
@ -78,11 +82,11 @@ interface FormProjectDetail {
|
||||||
projectNigthHoldActual: string | null;
|
projectNigthHoldActual: string | null;
|
||||||
developmentProjectTechniqueActuals: [];
|
developmentProjectTechniqueActuals: [];
|
||||||
projectModalActual?: string | null;
|
projectModalActual?: string | null;
|
||||||
projectModalPlanneds?: string | null;
|
projectModalPlanned?: string | null;
|
||||||
strategyChildPlannedId: string | null; //id ยุทธศาสตร์เป้าหมายตามแผน
|
strategyChildPlannedId?: string | null; //id ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
strategyChildPlannedNode: number; //node ยุทธศาสตร์เป้าหมายตามแผน
|
strategyChildPlannedNode: number | null; //node ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
strategyChildActualId: string | null; //id ยุทธศาสตร์เป้าหมายตามจริง
|
strategyChildActualId?: string | null; //id ยุทธศาสตร์เป้าหมายตามจริง
|
||||||
strategyChildActualNode: number; //node ยุทธศาสตร์เป้าหมายตามจริง
|
strategyChildActualNode: number | null; //node ยุทธศาสตร์เป้าหมายตามจริง
|
||||||
}
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
|
|
@ -94,4 +98,5 @@ export type {
|
||||||
DataPerson,
|
DataPerson,
|
||||||
ItemsDownload,
|
ItemsDownload,
|
||||||
FormProjectDetail,
|
FormProjectDetail,
|
||||||
|
DataOptionTechnique,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -110,22 +110,29 @@ interface ResPlannedGoals {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ResRecord {
|
interface ResRecord {
|
||||||
commandDate: Date | null;
|
commandDate: Date | null;
|
||||||
commandNumber: string |null;
|
commandNumber: string | null;
|
||||||
firstName: string;
|
firstName: string;
|
||||||
fullName: string;
|
fullName: string;
|
||||||
id: string;
|
id: string;
|
||||||
idcard: string;
|
idcard: string;
|
||||||
isDone: boolean;
|
isDone: boolean;
|
||||||
lastName: string;
|
lastName: string;
|
||||||
org: string;
|
org: string;
|
||||||
posExecutive: string | null;
|
posExecutive: string | null;
|
||||||
posLevelName :string;
|
posLevelName: string;
|
||||||
posTypeName: string;
|
posTypeName: string;
|
||||||
position: string;
|
position: string;
|
||||||
prefix: string;
|
prefix: string;
|
||||||
trainingDays: number | null;
|
trainingDays: number | null;
|
||||||
type: string;
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DataStrategic {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
level: number;
|
||||||
|
children: DataStrategic;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
|
|
@ -136,5 +143,6 @@ export type {
|
||||||
ResPeople,
|
ResPeople,
|
||||||
ResActualGoals,
|
ResActualGoals,
|
||||||
ResPlannedGoals,
|
ResPlannedGoals,
|
||||||
ResRecord
|
ResRecord,
|
||||||
|
DataStrategic,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
interface DataStrategic {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
level: number;
|
||||||
|
children: DataStrategic;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { DataStrategic };
|
||||||
|
|
@ -5,6 +5,8 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import type { ItemsMenu } from "@/modules/15_development/interface/index/Main";
|
import type { ItemsMenu } from "@/modules/15_development/interface/index/Main";
|
||||||
|
import type { DataStrategic } from "@/modules/15_development/interface/response/Strategic";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -40,11 +42,9 @@ const ListMenu = ref<ItemsMenu[]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const nodes = ref<any>([]);
|
const nodes = ref<any[]>([]);
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
const expanded = ref<Array<string>>([]);
|
||||||
const noData = ref<string>("ไม่มีข้อมูล");
|
|
||||||
const expanded = ref<Array<any>>([]);
|
|
||||||
const nodeId = ref<string>("");
|
const nodeId = ref<string>("");
|
||||||
|
|
||||||
function fetchDataTree() {
|
function fetchDataTree() {
|
||||||
|
|
@ -52,7 +52,7 @@ function fetchDataTree() {
|
||||||
http
|
http
|
||||||
.get(config.API.devStrategy)
|
.get(config.API.devStrategy)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data: DataStrategic[] = res.data.result;
|
||||||
nodes.value = data;
|
nodes.value = data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -63,11 +63,7 @@ function fetchDataTree() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelected(data: any) {
|
function onClickAction(type: string, data: DataStrategic | null = null) {
|
||||||
nodeId.value = data.orgTreeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
function onClickAction(type: string, data: any = null) {
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "ADD":
|
case "ADD":
|
||||||
onClickOpenDialog(false, data);
|
onClickOpenDialog(false, data);
|
||||||
|
|
@ -76,7 +72,7 @@ function onClickAction(type: string, data: any = null) {
|
||||||
onClickOpenDialog(true, data);
|
onClickOpenDialog(true, data);
|
||||||
break;
|
break;
|
||||||
case "DEL":
|
case "DEL":
|
||||||
onDelete(data);
|
data && onDelete(data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -88,24 +84,27 @@ const isStatusEdit = ref<boolean>(false);
|
||||||
const strategicName = ref<string>("");
|
const strategicName = ref<string>("");
|
||||||
const levelnode = ref<number>(0);
|
const levelnode = ref<number>(0);
|
||||||
const titleDialog = ref<string>("");
|
const titleDialog = ref<string>("");
|
||||||
function onClickOpenDialog(status: boolean = false, data: any = null) {
|
function onClickOpenDialog(
|
||||||
|
status: boolean = false,
|
||||||
|
data: DataStrategic | null = null
|
||||||
|
) {
|
||||||
isStatusEdit.value = status;
|
isStatusEdit.value = status;
|
||||||
if (status) {
|
if (status) {
|
||||||
console.log(data);
|
if (data) {
|
||||||
|
nodeId.value = data.id;
|
||||||
nodeId.value = data.id;
|
strategicName.value = data.name;
|
||||||
strategicName.value = data.name;
|
levelnode.value = data.level;
|
||||||
levelnode.value = data.level;
|
titleDialog.value =
|
||||||
titleDialog.value =
|
data.level === 1
|
||||||
data.level === 1
|
? "ยุทธศาสตร์"
|
||||||
? "ยุทธศาสตร์"
|
: data.level === 2
|
||||||
: data.level === 2
|
? "ยุทธศาสตร์ที่ 1"
|
||||||
? "ยุทธศาสตร์ที่ 1"
|
: data.level === 3
|
||||||
: data.level === 3
|
? "ยุทธศาสตร์ย่อย"
|
||||||
? "ยุทธศาสตร์ย่อย"
|
: data.level === 4
|
||||||
: data.level === 4
|
? "กลยุทธ์ที่/เป้าประสงค์ที่"
|
||||||
? "กลยุทธ์ที่/เป้าประสงค์ที่"
|
: "";
|
||||||
: "";
|
}
|
||||||
} else {
|
} else {
|
||||||
if (data) {
|
if (data) {
|
||||||
titleDialog.value =
|
titleDialog.value =
|
||||||
|
|
@ -155,8 +154,7 @@ function onSubmit() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDelete(data: any) {
|
function onDelete(data: DataStrategic) {
|
||||||
console.log(data);
|
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
const formData = {
|
const formData = {
|
||||||
|
|
@ -218,8 +216,8 @@ onMounted(() => {
|
||||||
node-key="id"
|
node-key="id"
|
||||||
label-key="id"
|
label-key="id"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:no-results-label="notFound"
|
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||||
:no-nodes-label="noData"
|
no-nodes-label="ไม่มีข้อมูล"
|
||||||
v-model:expanded="expanded"
|
v-model:expanded="expanded"
|
||||||
>
|
>
|
||||||
<template v-slot:default-header="prop">
|
<template v-slot:default-header="prop">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue