ปรับ 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">
|
||||
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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue