Commit 0804ffb1 authored by 高滢's avatar 高滢

feat(投资资金): 下拉修改

parent 8b564dca
import { BasicColumn, FormSchema } from '@/components/Table'; import { BasicColumn, FormSchema } from '@/components/Table';
import {useUserStore} from "@/store/modules/user"; import { useUserStore } from '@/store/modules/user';
const deptId = useUserStore().userInfo.deptParentId; const deptId = useUserStore().userInfo.deptParentId;
type CheckedType = boolean | string | number; type CheckedType = boolean | string | number;
export const columns: ( export const columns: (
...@@ -95,8 +96,10 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -95,8 +96,10 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 4 }, colProps: { span: 4 },
}, },
{ {
ifShow: false,
field: 'planType', field: 'planType',
label: '', label: '',
defaultValue: '自投',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: [ options: [
...@@ -124,5 +127,3 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -124,5 +127,3 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 4 }, colProps: { span: 4 },
}, },
]; ];
<template> <template>
<div> <div>
<BasicTable @register="registerTable" :title="'工程项目投资计划填报'"> <BasicTable @register="registerTable" :title="'工程项目投资计划填报'">
<template #tabSlot>
<div>
<Tabs v-model:activeKey="planType" size="large" @change="clickTab">
<a-tab-pane key="自投" tab="自投"></a-tab-pane>
<a-tab-pane key="代建" tab="代建"></a-tab-pane>
<a-tab-pane key="承建" tab="承建"></a-tab-pane>
<a-tab-pane key="储备" tab="储备"></a-tab-pane>
</Tabs>
</div>
</template>
<template #toolbar> <template #toolbar>
<a-button class="btn" type="primary" @click="addEngineering('自投')"> 新建计划(自投) </a-button> <a-button class="btn" type="primary" @click="addEngineering(planType)"> {{'新建投资计划'+'('+planType+')'}} </a-button>
<a-button class="btn" type="primary" @click="addEngineering('代建')"> 新建计划(代建) </a-button> <!-- <a-button class="btn" type="primary" @click="addEngineering('代建')"> 新建计划(代建) </a-button>-->
<a-button class="btn" type="primary" @click="addEngineering('承建')"> 新建计划(承建) </a-button> <!-- <a-button class="btn" type="primary" @click="addEngineering('承建')"> 新建计划(承建) </a-button>-->
<a-button type="primary" @click="addEngineering('储备')"> 新建计划(储备) </a-button> <!-- <a-button type="primary" @click="addEngineering('储备')"> 新建计划(储备) </a-button>-->
</template> </template>
<template #bodyCell="{ column, text, record, index }"> <template #bodyCell="{ column, text, record, index }">
<!-- 当前列是序号列时,显示序号 --> <!-- 当前列是序号列时,显示序号 -->
...@@ -63,7 +73,7 @@ ...@@ -63,7 +73,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Tag } from 'ant-design-vue'; import { Tag,Tabs } from 'ant-design-vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import yearModal from '@/components/yearModal.vue'; import yearModal from '@/components/yearModal.vue';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
...@@ -85,13 +95,12 @@ ...@@ -85,13 +95,12 @@
const { error } = createMessage; const { error } = createMessage;
defineOptions({ name: 'EngineeringProject' }); defineOptions({ name: 'EngineeringProject' });
const types = ref('');
const [registerDrawer, { openDrawer }] = useDrawer(); const [registerDrawer, { openDrawer }] = useDrawer();
const [register, { openModal: openModal, closeModal: closeModal }] = useModal(); const [register, { openModal: openModal, closeModal: closeModal }] = useModal();
const [registerTable, { reload }] = useTable({ const [registerTable, { reload,getForm}] = useTable({
api: getEngineeringList, api: getEngineeringList,
title: '123', title: '123',
columns, columns,
...@@ -124,6 +133,15 @@ ...@@ -124,6 +133,15 @@
}); });
}); });
async function clickTab(value){
planType.value = value
getForm().setFieldsValue({
planType:value
}).then(()=>{
reload()
})
}
const planType = ref('自投')
function handleEdit(record: Recordable, disabled: number) { function handleEdit(record: Recordable, disabled: number) {
const data = { const data = {
filingCycle: record.filingCycle, filingCycle: record.filingCycle,
...@@ -152,7 +170,6 @@ ...@@ -152,7 +170,6 @@
}; };
const addEngineering = (type) => { const addEngineering = (type) => {
types.value = type
openModal(true, { openModal(true, {
data: ['year'], data: ['year'],
}); });
...@@ -161,7 +178,7 @@ ...@@ -161,7 +178,7 @@
async function handleNew(e){ async function handleNew(e){
const data = { const data = {
filingCycle: e.year, filingCycle: e.year,
planType: types.value, planType: planType.value,
} }
let res = await selectCount(data); let res = await selectCount(data);
console.log(res) console.log(res)
......
<template> <template>
<div style="margin: 16px"> <div style="margin: 16px">
<PageCard title="工程项目资金计划统计"> <PageCard title="工程项目资金计划统计">
<div>
<Tabs v-model:activeKey="planType" size="large" @change="clickTab">
<a-tab-pane key="自投" tab="自投" />
<a-tab-pane key="代建" tab="代建" />
<a-tab-pane key="承建" tab="承建" />
<a-tab-pane key="储备" tab="储备" />
</Tabs>
</div>
<BasicForm ref="formElRef" @register="registerForm"> <BasicForm ref="formElRef" @register="registerForm">
<template #formFooter> <template #formFooter>
<a-button type="primary" @click="handleSubmit"> 查询</a-button> <a-button type="primary" @click="handleSubmit"> 查询</a-button>
...@@ -26,7 +34,7 @@ ...@@ -26,7 +34,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import PageCard from '@/components/Page/src/PageCard.vue'; import PageCard from '@/components/Page/src/PageCard.vue';
import { Table } from 'ant-design-vue'; import { Table, Tabs } from 'ant-design-vue';
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import { import {
getBasicColumns, getBasicColumns,
...@@ -41,6 +49,7 @@ ...@@ -41,6 +49,7 @@
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { downloadByData } from '@/utils/file/download'; import { downloadByData } from '@/utils/file/download';
const planType = ref('自投');
const [register, { openModal: openModal }] = useModal(); const [register, { openModal: openModal }] = useModal();
onMounted(async () => { onMounted(async () => {
const data = await getSelectDeptById(); const data = await getSelectDeptById();
...@@ -50,12 +59,22 @@ ...@@ -50,12 +59,22 @@
const dataSource = ref([]); const dataSource = ref([]);
const loadingRef = ref(false); const loadingRef = ref(false);
const params = ref({ filingCycle: '2024', planType: '自投', company: '' }); const params = ref({ filingCycle: '2024', planType: '自投', company: '' });
const [registerForm, { getFieldsValue }] = useForm({ const [registerForm, { getFieldsValue, setFieldsValue }] = useForm({
labelWidth: 90, labelWidth: 90,
baseColProps: { span: 24 }, baseColProps: { span: 24 },
schemas: searchForm, schemas: searchForm,
showActionButtonGroup: false, showActionButtonGroup: false,
}); });
async function clickTab(value) {
setFieldsValue({
planType: value,
}).then(() => {
let data = getFieldsValue();
params.value = data;
getStatisticList();
});
}
function handleSubmit() { function handleSubmit() {
let data = getFieldsValue(); let data = getFieldsValue();
params.value = data; params.value = data;
...@@ -79,6 +98,7 @@ ...@@ -79,6 +98,7 @@
changeData(data, item); changeData(data, item);
}); });
loadingRef.value = false; loadingRef.value = false;
return data;
} }
function changeData(data, field) { function changeData(data, field) {
let count = 0; //重复项的第一项 let count = 0; //重复项的第一项
......
...@@ -20,6 +20,7 @@ export const searchForm: FormSchema[] = [ ...@@ -20,6 +20,7 @@ export const searchForm: FormSchema[] = [
}, },
{ {
field: 'planType', field: 'planType',
ifShow: false,
label: '', label: '',
defaultValue: '自投', defaultValue: '自投',
component: 'Select', component: 'Select',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment