ปรับ code รายการโครงการ
This commit is contained in:
parent
f8304abfc4
commit
93a5d53df2
5 changed files with 106 additions and 26 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, reactive, ref, watch } from "vue";
|
import { reactive, ref } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import type { FormBasicinfo } from "@/modules/15_development/interface/request/Main";
|
import type { FormBasicinfo } from "@/modules/15_development/interface/request/Main";
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,13 @@ 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 type {
|
||||||
|
ResDataProject,
|
||||||
|
ResPlannedGoals,
|
||||||
|
ResActualGoals,
|
||||||
|
ResPeople,
|
||||||
|
} from "@/modules/15_development/interface/response/Main";
|
||||||
|
|
||||||
import BasicInfo from "@/modules/15_development/components/BasicInfo.vue";
|
import BasicInfo from "@/modules/15_development/components/BasicInfo.vue";
|
||||||
import Target from "@/modules/15_development/components/Target.vue";
|
import Target from "@/modules/15_development/components/Target.vue";
|
||||||
import ProjectDetail from "@/modules/15_development/components/ProjectDetail.vue";
|
import ProjectDetail from "@/modules/15_development/components/ProjectDetail.vue";
|
||||||
|
|
@ -38,7 +45,7 @@ function fetchDataProject(id: string) {
|
||||||
http
|
http
|
||||||
.get(config.API.developmentMainById(id))
|
.get(config.API.developmentMainById(id))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data: ResDataProject = res.data.result;
|
||||||
console.log(data);
|
console.log(data);
|
||||||
/** ข้อมูลเบื้องต้น*/
|
/** ข้อมูลเบื้องต้น*/
|
||||||
store.formAddProject.year = data.year;
|
store.formAddProject.year = data.year;
|
||||||
|
|
@ -47,7 +54,7 @@ function fetchDataProject(id: string) {
|
||||||
store.formAddProject.objective = data.objective;
|
store.formAddProject.objective = data.objective;
|
||||||
|
|
||||||
/**เป้าหมาย*/
|
/**เป้าหมาย*/
|
||||||
const plannedGoals = data.plannedGoals.map((e: any) => ({
|
const plannedGoals = data.plannedGoals.map((e: ResPlannedGoals) => ({
|
||||||
groupTarget: e.groupTarget,
|
groupTarget: e.groupTarget,
|
||||||
groupTargetSub: e.groupTargetSub,
|
groupTargetSub: e.groupTargetSub,
|
||||||
position: e.position,
|
position: e.position,
|
||||||
|
|
@ -56,14 +63,14 @@ function fetchDataProject(id: string) {
|
||||||
type: e.type,
|
type: e.type,
|
||||||
amount: e.amount,
|
amount: e.amount,
|
||||||
}));
|
}));
|
||||||
const plannedPeoples = data.plannedPeoples.map((e: any) => ({
|
const plannedPeoples = data.plannedPeoples.map((e: ResPeople) => ({
|
||||||
groupTarget: e.groupTarget,
|
groupTarget: e.groupTarget,
|
||||||
amount: e.amount,
|
amount: e.amount,
|
||||||
}));
|
}));
|
||||||
store.formAddProject.plannedGoals = plannedGoals;
|
store.formAddProject.plannedGoals = plannedGoals;
|
||||||
store.formAddProject.plannedPeoples = plannedPeoples;
|
store.formAddProject.plannedPeoples = plannedPeoples;
|
||||||
|
|
||||||
const actualGoals = data.actualGoals.map((e: any) => ({
|
const actualGoals = data.actualGoals.map((e: ResActualGoals) => ({
|
||||||
groupTarget: e.groupTarget,
|
groupTarget: e.groupTarget,
|
||||||
groupTargetSub: e.groupTargetSub,
|
groupTargetSub: e.groupTargetSub,
|
||||||
position: e.position,
|
position: e.position,
|
||||||
|
|
@ -72,7 +79,7 @@ function fetchDataProject(id: string) {
|
||||||
type: e.type,
|
type: e.type,
|
||||||
amount: e.amount,
|
amount: e.amount,
|
||||||
}));
|
}));
|
||||||
const actualPeoples = data.actualPeoples.map((e: any) => ({
|
const actualPeoples = data.actualPeoples.map((e: ResPeople) => ({
|
||||||
groupTarget: e.groupTarget,
|
groupTarget: e.groupTarget,
|
||||||
amount: e.amount,
|
amount: e.amount,
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ function changeDateStart() {
|
||||||
* @param val ค่าตัวพิมพ์ค้นหา
|
* @param val ค่าตัวพิมพ์ค้นหา
|
||||||
* @param update ทุกครั้งที่พิมพ์ค่า
|
* @param update ทุกครั้งที่พิมพ์ค่า
|
||||||
*/
|
*/
|
||||||
const filterSelector = (val: any, update: Function) => {
|
const filterSelector = (val: string, update: Function) => {
|
||||||
update(() => {
|
update(() => {
|
||||||
provinceOp.value = provinceOpMain.value.filter(
|
provinceOp.value = provinceOpMain.value.filter(
|
||||||
(v: DataOption) => v.name.indexOf(val) > -1
|
(v: DataOption) => v.name.indexOf(val) > -1
|
||||||
|
|
@ -203,7 +203,7 @@ onMounted(() => {
|
||||||
class="inputgreen"
|
class="inputgreen"
|
||||||
use-input
|
use-input
|
||||||
@filter="
|
@filter="
|
||||||
(inputValue:any, doneFn:Function) =>
|
(inputValue:string, doneFn:Function) =>
|
||||||
filterSelector(inputValue, doneFn, )
|
filterSelector(inputValue, doneFn, )
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
|
@ -384,7 +384,7 @@ onMounted(() => {
|
||||||
class="inputgreen"
|
class="inputgreen"
|
||||||
use-input
|
use-input
|
||||||
@filter="
|
@filter="
|
||||||
(inputValue:any, doneFn:Function) =>
|
(inputValue:string, doneFn:Function) =>
|
||||||
filterSelector(inputValue, doneFn, )
|
filterSelector(inputValue, doneFn, )
|
||||||
"
|
"
|
||||||
><template v-slot:no-option>
|
><template v-slot:no-option>
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ import type {
|
||||||
import type {
|
import type {
|
||||||
ResGroup,
|
ResGroup,
|
||||||
ResLevel,
|
ResLevel,
|
||||||
|
ResPlannedGoals,
|
||||||
|
ResPeople,
|
||||||
|
ResActualGoals,
|
||||||
} from "@/modules/15_development/interface/response/Main";
|
} from "@/modules/15_development/interface/response/Main";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
@ -22,14 +25,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = useDevelopmentDataStore();
|
const store = useDevelopmentDataStore();
|
||||||
const {
|
const { dialogRemove, success, messageError } = useCounterMixin();
|
||||||
showLoader,
|
|
||||||
hideLoader,
|
|
||||||
dialogConfirm,
|
|
||||||
dialogRemove,
|
|
||||||
success,
|
|
||||||
messageError,
|
|
||||||
} = useCounterMixin();
|
|
||||||
|
|
||||||
const columnsPlannedGoals = ref<QTableProps["columns"]>([
|
const columnsPlannedGoals = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -122,10 +118,10 @@ const columnsRelated = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const plannedGoals = ref<any>([]);
|
const plannedGoals = ref<ResPlannedGoals[]>([]);
|
||||||
const plannedPeoples = ref<any>([]);
|
const plannedPeoples = ref<ResPeople[]>([]);
|
||||||
const actualGoals = ref<any>([]);
|
const actualGoals = ref<ResActualGoals[]>([]);
|
||||||
const actualPeoples = ref<any>([]);
|
const actualPeoples = ref<ResPeople[]>([]);
|
||||||
|
|
||||||
const peoplesOp = ref<DataOption[]>([
|
const peoplesOp = ref<DataOption[]>([
|
||||||
{ id: "OPERATOR", name: "เจ้าหน้าที่ดําเนินการ" },
|
{ id: "OPERATOR", name: "เจ้าหน้าที่ดําเนินการ" },
|
||||||
|
|
@ -200,7 +196,7 @@ function onSubmitGroup() {
|
||||||
if (isTarget.value === "planned") {
|
if (isTarget.value === "planned") {
|
||||||
const data = [];
|
const data = [];
|
||||||
data.push(formGroupTarget);
|
data.push(formGroupTarget);
|
||||||
const list = data.map((e) => ({
|
const list = data.map((e: FormGroupTarget) => ({
|
||||||
groupTarget: e.groupTarget,
|
groupTarget: e.groupTarget,
|
||||||
groupTargetSub: e.groupTargetSub,
|
groupTargetSub: e.groupTargetSub,
|
||||||
position: e.position,
|
position: e.position,
|
||||||
|
|
@ -214,7 +210,7 @@ function onSubmitGroup() {
|
||||||
} else {
|
} else {
|
||||||
const data = [];
|
const data = [];
|
||||||
data.push(formGroupTarget);
|
data.push(formGroupTarget);
|
||||||
const list = data.map((e) => ({
|
const list = data.map((e: FormGroupTarget) => ({
|
||||||
groupTarget: e.groupTarget,
|
groupTarget: e.groupTarget,
|
||||||
groupTargetSub: e.groupTargetSub,
|
groupTargetSub: e.groupTargetSub,
|
||||||
position: e.position,
|
position: e.position,
|
||||||
|
|
@ -235,7 +231,7 @@ function onSubmitRelate() {
|
||||||
if (isTarget.value === "planned") {
|
if (isTarget.value === "planned") {
|
||||||
const data = [];
|
const data = [];
|
||||||
data.push(formGroupRelate);
|
data.push(formGroupRelate);
|
||||||
const list = data.map((e) => ({
|
const list = data.map((e: FormGroupRelate) => ({
|
||||||
groupTarget: e.relate,
|
groupTarget: e.relate,
|
||||||
amount: Number(e.amount),
|
amount: Number(e.amount),
|
||||||
}));
|
}));
|
||||||
|
|
@ -244,7 +240,7 @@ function onSubmitRelate() {
|
||||||
} else {
|
} else {
|
||||||
const data = [];
|
const data = [];
|
||||||
data.push(formGroupRelate);
|
data.push(formGroupRelate);
|
||||||
const list = data.map((e) => ({
|
const list = data.map((e: FormGroupRelate) => ({
|
||||||
groupTarget: e.relate,
|
groupTarget: e.relate,
|
||||||
amount: Number(e.amount),
|
amount: Number(e.amount),
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,81 @@ interface ResListProject {
|
||||||
year: number;
|
year: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { ResGroup, ResLevel, ResListProject };
|
interface ResDataProject {
|
||||||
|
year: number;
|
||||||
|
projectName: string;
|
||||||
|
reason: string;
|
||||||
|
objective: string;
|
||||||
|
metricType: string;
|
||||||
|
indicators: string;
|
||||||
|
target: string;
|
||||||
|
calculation: string;
|
||||||
|
measuRement: string;
|
||||||
|
results: string;
|
||||||
|
obstacles: string;
|
||||||
|
suggestions: string;
|
||||||
|
project: string;
|
||||||
|
isPassAllocate: boolean;
|
||||||
|
isPassNoAllocate: boolean;
|
||||||
|
isNoPass: boolean;
|
||||||
|
isBudget: boolean;
|
||||||
|
isOutBudget: boolean;
|
||||||
|
dateStart: Date | null;
|
||||||
|
dateEnd: Date | null;
|
||||||
|
totalDate: number | null;
|
||||||
|
address: string;
|
||||||
|
provinceId: string | null;
|
||||||
|
budget: string;
|
||||||
|
accept: number | string | null;
|
||||||
|
receive: number | string | null;
|
||||||
|
approved: number | string | null;
|
||||||
|
budgetPay: number | string | null;
|
||||||
|
issues: string;
|
||||||
|
chance: string;
|
||||||
|
effects: string;
|
||||||
|
riskLevel: string;
|
||||||
|
riskManagement: string;
|
||||||
|
expect: string;
|
||||||
|
topicAcademic: string;
|
||||||
|
addressAcademic: string;
|
||||||
|
provinceActualId: string | null;
|
||||||
|
actualPeoples: ResPeople[];
|
||||||
|
plannedPeoples: ResPeople[];
|
||||||
|
actualGoals: ResActualGoals[];
|
||||||
|
plannedGoals: ResPlannedGoals[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ResPeople {
|
||||||
|
groupTarget: string;
|
||||||
|
amount: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ResActualGoals {
|
||||||
|
groupTarget: string;
|
||||||
|
groupTargetSub: string;
|
||||||
|
position: string;
|
||||||
|
posTypeActualId: string | null;
|
||||||
|
posLevelActualId: string | null;
|
||||||
|
type: string;
|
||||||
|
amount: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ResPlannedGoals {
|
||||||
|
groupTarget: string;
|
||||||
|
groupTargetSub: string;
|
||||||
|
position: string;
|
||||||
|
posTypePlannedId: string | null;
|
||||||
|
posLevelPlannedId: string | null;
|
||||||
|
type: string;
|
||||||
|
amount: number | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type {
|
||||||
|
ResGroup,
|
||||||
|
ResLevel,
|
||||||
|
ResListProject,
|
||||||
|
ResDataProject,
|
||||||
|
ResPeople,
|
||||||
|
ResActualGoals,
|
||||||
|
ResPlannedGoals,
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue