Merge branch 'nice_dev' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-04 13:34:01 +07:00
commit db6d3440ed
5 changed files with 106 additions and 26 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, reactive, ref, watch } from "vue";
import { reactive, ref } from "vue";
import { useQuasar } from "quasar";
import type { FormBasicinfo } from "@/modules/15_development/interface/request/Main";

View file

@ -5,6 +5,13 @@ import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
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 Target from "@/modules/15_development/components/Target.vue";
import ProjectDetail from "@/modules/15_development/components/ProjectDetail.vue";
@ -38,7 +45,7 @@ function fetchDataProject(id: string) {
http
.get(config.API.developmentMainById(id))
.then((res) => {
const data = res.data.result;
const data: ResDataProject = res.data.result;
console.log(data);
/** ข้อมูลเบื้องต้น*/
store.formAddProject.year = data.year;
@ -47,7 +54,7 @@ function fetchDataProject(id: string) {
store.formAddProject.objective = data.objective;
/**เป้าหมาย*/
const plannedGoals = data.plannedGoals.map((e: any) => ({
const plannedGoals = data.plannedGoals.map((e: ResPlannedGoals) => ({
groupTarget: e.groupTarget,
groupTargetSub: e.groupTargetSub,
position: e.position,
@ -56,14 +63,14 @@ function fetchDataProject(id: string) {
type: e.type,
amount: e.amount,
}));
const plannedPeoples = data.plannedPeoples.map((e: any) => ({
const plannedPeoples = data.plannedPeoples.map((e: ResPeople) => ({
groupTarget: e.groupTarget,
amount: e.amount,
}));
store.formAddProject.plannedGoals = plannedGoals;
store.formAddProject.plannedPeoples = plannedPeoples;
const actualGoals = data.actualGoals.map((e: any) => ({
const actualGoals = data.actualGoals.map((e: ResActualGoals) => ({
groupTarget: e.groupTarget,
groupTargetSub: e.groupTargetSub,
position: e.position,
@ -72,7 +79,7 @@ function fetchDataProject(id: string) {
type: e.type,
amount: e.amount,
}));
const actualPeoples = data.actualPeoples.map((e: any) => ({
const actualPeoples = data.actualPeoples.map((e: ResPeople) => ({
groupTarget: e.groupTarget,
amount: e.amount,
}));

View file

@ -72,7 +72,7 @@ function changeDateStart() {
* @param val าตวพมพนหา
* @param update กครงทมพ
*/
const filterSelector = (val: any, update: Function) => {
const filterSelector = (val: string, update: Function) => {
update(() => {
provinceOp.value = provinceOpMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
@ -203,7 +203,7 @@ onMounted(() => {
class="inputgreen"
use-input
@filter="
(inputValue:any, doneFn:Function) =>
(inputValue:string, doneFn:Function) =>
filterSelector(inputValue, doneFn, )
"
>
@ -384,7 +384,7 @@ onMounted(() => {
class="inputgreen"
use-input
@filter="
(inputValue:any, doneFn:Function) =>
(inputValue:string, doneFn:Function) =>
filterSelector(inputValue, doneFn, )
"
><template v-slot:no-option>

View file

@ -13,6 +13,9 @@ import type {
import type {
ResGroup,
ResLevel,
ResPlannedGoals,
ResPeople,
ResActualGoals,
} from "@/modules/15_development/interface/response/Main";
import DialogHeader from "@/components/DialogHeader.vue";
@ -22,14 +25,7 @@ import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const store = useDevelopmentDataStore();
const {
showLoader,
hideLoader,
dialogConfirm,
dialogRemove,
success,
messageError,
} = useCounterMixin();
const { dialogRemove, success, messageError } = useCounterMixin();
const columnsPlannedGoals = ref<QTableProps["columns"]>([
{
@ -122,10 +118,10 @@ const columnsRelated = ref<QTableProps["columns"]>([
},
]);
const plannedGoals = ref<any>([]);
const plannedPeoples = ref<any>([]);
const actualGoals = ref<any>([]);
const actualPeoples = ref<any>([]);
const plannedGoals = ref<ResPlannedGoals[]>([]);
const plannedPeoples = ref<ResPeople[]>([]);
const actualGoals = ref<ResActualGoals[]>([]);
const actualPeoples = ref<ResPeople[]>([]);
const peoplesOp = ref<DataOption[]>([
{ id: "OPERATOR", name: "เจ้าหน้าที่ดําเนินการ" },
@ -200,7 +196,7 @@ function onSubmitGroup() {
if (isTarget.value === "planned") {
const data = [];
data.push(formGroupTarget);
const list = data.map((e) => ({
const list = data.map((e: FormGroupTarget) => ({
groupTarget: e.groupTarget,
groupTargetSub: e.groupTargetSub,
position: e.position,
@ -214,7 +210,7 @@ function onSubmitGroup() {
} else {
const data = [];
data.push(formGroupTarget);
const list = data.map((e) => ({
const list = data.map((e: FormGroupTarget) => ({
groupTarget: e.groupTarget,
groupTargetSub: e.groupTargetSub,
position: e.position,
@ -235,7 +231,7 @@ function onSubmitRelate() {
if (isTarget.value === "planned") {
const data = [];
data.push(formGroupRelate);
const list = data.map((e) => ({
const list = data.map((e: FormGroupRelate) => ({
groupTarget: e.relate,
amount: Number(e.amount),
}));
@ -244,7 +240,7 @@ function onSubmitRelate() {
} else {
const data = [];
data.push(formGroupRelate);
const list = data.map((e) => ({
const list = data.map((e: FormGroupRelate) => ({
groupTarget: e.relate,
amount: Number(e.amount),
}));

View file

@ -20,4 +20,81 @@ interface ResListProject {
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,
};