Merge branch 'nice_dev' into develop
This commit is contained in:
commit
29072a7f78
5 changed files with 107 additions and 74 deletions
|
|
@ -6,9 +6,10 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
/**importType*/
|
||||
import type {
|
||||
DataOption,
|
||||
DataOptionTechnique,
|
||||
FormProjectDetail,
|
||||
} 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 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: "การสัมมนา" },
|
||||
|
|
@ -65,7 +56,7 @@ const formData = reactive<FormProjectDetail>({
|
|||
projectNigthHoldActual: null,
|
||||
developmentProjectTechniqueActuals: [],
|
||||
projectModalActual: null,
|
||||
projectModalPlanneds: null,
|
||||
projectModalPlanned: null,
|
||||
strategyChildPlannedId: null, //id ยุทธศาสตร์เป้าหมายตามแผน
|
||||
strategyChildPlannedNode: 0, //node ยุทธศาสตร์เป้าหมายตามแผน
|
||||
strategyChildActualId: null, //id ยุทธศาสตร์เป้าหมายตามจริง
|
||||
|
|
@ -77,8 +68,8 @@ const filter = ref<string>("");
|
|||
const filter2 = ref<string>("");
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่มีข้อมูล");
|
||||
const expanded = ref<Array<any>>([]);
|
||||
const expanded2 = ref<Array<any>>([]);
|
||||
const expanded = ref<Array<string | null>>([]);
|
||||
const expanded2 = ref<Array<string | null>>([]);
|
||||
function fetchData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -102,10 +93,33 @@ function fetchData() {
|
|||
formData.projectNigthHoldActual = data.projectNigthHoldActual;
|
||||
formData.developmentProjectTechniqueActuals =
|
||||
data.developmentProjectTechniqueActuals;
|
||||
formData.strategyChildPlannedId = data.strategyChildPlannedId;
|
||||
formData.strategyChildPlannedNode = data.strategyChildPlannedNode;
|
||||
formData.strategyChildActualId = data.strategyChildActualId;
|
||||
formData.strategyChildActualNode = data.strategyChildActualNode;
|
||||
formData.projectModalPlanned = data.projectModalPlanned;
|
||||
expanded.value = [
|
||||
data.strategyChild1Planned,
|
||||
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) => {
|
||||
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") {
|
||||
formData.strategyChildPlannedId = data.id;
|
||||
formData.strategyChildPlannedNode = data.level;
|
||||
|
|
@ -388,7 +402,7 @@ onMounted(() => {
|
|||
:disable="store.projectStatus === 'FINISH'"
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.projectModalPlanneds"
|
||||
v-model="formData.projectModalPlanned"
|
||||
label="จำนวน (รุ่น)"
|
||||
mask="#"
|
||||
reverse-fill-mask
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ interface DataOptionCheckBox {
|
|||
label: string;
|
||||
value: boolean;
|
||||
}
|
||||
interface DataOptionTechnique {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface FormFilter {
|
||||
page: number;
|
||||
|
|
@ -78,11 +82,11 @@ interface FormProjectDetail {
|
|||
projectNigthHoldActual: string | null;
|
||||
developmentProjectTechniqueActuals: [];
|
||||
projectModalActual?: string | null;
|
||||
projectModalPlanneds?: string | null;
|
||||
strategyChildPlannedId: string | null; //id ยุทธศาสตร์เป้าหมายตามแผน
|
||||
strategyChildPlannedNode: number; //node ยุทธศาสตร์เป้าหมายตามแผน
|
||||
strategyChildActualId: string | null; //id ยุทธศาสตร์เป้าหมายตามจริง
|
||||
strategyChildActualNode: number; //node ยุทธศาสตร์เป้าหมายตามจริง
|
||||
projectModalPlanned?: string | null;
|
||||
strategyChildPlannedId?: string | null; //id ยุทธศาสตร์เป้าหมายตามแผน
|
||||
strategyChildPlannedNode: number | null; //node ยุทธศาสตร์เป้าหมายตามแผน
|
||||
strategyChildActualId?: string | null; //id ยุทธศาสตร์เป้าหมายตามจริง
|
||||
strategyChildActualNode: number | null; //node ยุทธศาสตร์เป้าหมายตามจริง
|
||||
}
|
||||
|
||||
export type {
|
||||
|
|
@ -94,4 +98,5 @@ export type {
|
|||
DataPerson,
|
||||
ItemsDownload,
|
||||
FormProjectDetail,
|
||||
DataOptionTechnique,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -110,22 +110,29 @@ interface ResPlannedGoals {
|
|||
}
|
||||
|
||||
interface ResRecord {
|
||||
commandDate: Date | null;
|
||||
commandNumber: string |null;
|
||||
firstName: string;
|
||||
fullName: string;
|
||||
id: string;
|
||||
idcard: string;
|
||||
isDone: boolean;
|
||||
lastName: string;
|
||||
org: string;
|
||||
posExecutive: string | null;
|
||||
posLevelName :string;
|
||||
posTypeName: string;
|
||||
position: string;
|
||||
prefix: string;
|
||||
trainingDays: number | null;
|
||||
type: string;
|
||||
commandDate: Date | null;
|
||||
commandNumber: string | null;
|
||||
firstName: string;
|
||||
fullName: string;
|
||||
id: string;
|
||||
idcard: string;
|
||||
isDone: boolean;
|
||||
lastName: string;
|
||||
org: string;
|
||||
posExecutive: string | null;
|
||||
posLevelName: string;
|
||||
posTypeName: string;
|
||||
position: string;
|
||||
prefix: string;
|
||||
trainingDays: number | null;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface DataStrategic {
|
||||
id: string;
|
||||
name: string;
|
||||
level: number;
|
||||
children: DataStrategic;
|
||||
}
|
||||
|
||||
export type {
|
||||
|
|
@ -136,5 +143,6 @@ export type {
|
|||
ResPeople,
|
||||
ResActualGoals,
|
||||
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 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 { 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 notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่มีข้อมูล");
|
||||
const expanded = ref<Array<any>>([]);
|
||||
const expanded = ref<Array<string>>([]);
|
||||
const nodeId = ref<string>("");
|
||||
|
||||
function fetchDataTree() {
|
||||
|
|
@ -52,7 +52,7 @@ function fetchDataTree() {
|
|||
http
|
||||
.get(config.API.devStrategy)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
const data: DataStrategic[] = res.data.result;
|
||||
nodes.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -63,11 +63,7 @@ function fetchDataTree() {
|
|||
});
|
||||
}
|
||||
|
||||
function updateSelected(data: any) {
|
||||
nodeId.value = data.orgTreeName;
|
||||
}
|
||||
|
||||
function onClickAction(type: string, data: any = null) {
|
||||
function onClickAction(type: string, data: DataStrategic | null = null) {
|
||||
switch (type) {
|
||||
case "ADD":
|
||||
onClickOpenDialog(false, data);
|
||||
|
|
@ -76,7 +72,7 @@ function onClickAction(type: string, data: any = null) {
|
|||
onClickOpenDialog(true, data);
|
||||
break;
|
||||
case "DEL":
|
||||
onDelete(data);
|
||||
data && onDelete(data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -88,24 +84,27 @@ const isStatusEdit = ref<boolean>(false);
|
|||
const strategicName = ref<string>("");
|
||||
const levelnode = ref<number>(0);
|
||||
const titleDialog = ref<string>("");
|
||||
function onClickOpenDialog(status: boolean = false, data: any = null) {
|
||||
function onClickOpenDialog(
|
||||
status: boolean = false,
|
||||
data: DataStrategic | null = null
|
||||
) {
|
||||
isStatusEdit.value = status;
|
||||
if (status) {
|
||||
console.log(data);
|
||||
|
||||
nodeId.value = data.id;
|
||||
strategicName.value = data.name;
|
||||
levelnode.value = data.level;
|
||||
titleDialog.value =
|
||||
data.level === 1
|
||||
? "ยุทธศาสตร์"
|
||||
: data.level === 2
|
||||
? "ยุทธศาสตร์ที่ 1"
|
||||
: data.level === 3
|
||||
? "ยุทธศาสตร์ย่อย"
|
||||
: data.level === 4
|
||||
? "กลยุทธ์ที่/เป้าประสงค์ที่"
|
||||
: "";
|
||||
if (data) {
|
||||
nodeId.value = data.id;
|
||||
strategicName.value = data.name;
|
||||
levelnode.value = data.level;
|
||||
titleDialog.value =
|
||||
data.level === 1
|
||||
? "ยุทธศาสตร์"
|
||||
: data.level === 2
|
||||
? "ยุทธศาสตร์ที่ 1"
|
||||
: data.level === 3
|
||||
? "ยุทธศาสตร์ย่อย"
|
||||
: data.level === 4
|
||||
? "กลยุทธ์ที่/เป้าประสงค์ที่"
|
||||
: "";
|
||||
}
|
||||
} else {
|
||||
if (data) {
|
||||
titleDialog.value =
|
||||
|
|
@ -155,8 +154,7 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
function onDelete(data: any) {
|
||||
console.log(data);
|
||||
function onDelete(data: DataStrategic) {
|
||||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
const formData = {
|
||||
|
|
@ -218,8 +216,8 @@ onMounted(() => {
|
|||
node-key="id"
|
||||
label-key="id"
|
||||
:filter="filter"
|
||||
:no-results-label="notFound"
|
||||
:no-nodes-label="noData"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
v-model:expanded="expanded"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue