Commit 0cf9d504 authored by mengzixuan's avatar mengzixuan

feat: 年度工程资金计划页面接口对接

parent c4b410ea
import { ProjectParams, ProjectListGetResultModel, ProjectModel } from './model/projectModel'; import { ProjectParams, ProjectListGetResultModel, ProjectModel } from './model/projectModel';
import { defHttp } from '@/utils/http/axios'; import { defHttp } from '@/utils/http/axios';
import {ListItem} from "@/api/project/model/biddingPlanModel"; import { ListItem, ProjectPageParams } from '@/api/project/model/biddingPlanModel';
enum Api { enum Api {
GetList = '/pro/fundPlanYear/page', GetList = '/pro/fundPlanYear/page',
GetContent = '/pro/fundPlanYear/selectproBypan', GetContent = '/pro/fundPlanYear/selectproBypan',
AddannualPlanProject = '/pro/fundPlanYear/add',
UpdateProject = '/pro/fundPlanYear/update',
ProjectDetail = '/pro/fundPlanYear/details',
audit = '/pro/fundPlanYear/examine',
} }
export const getAnnualPlanList = (params?: ProjectParams) => export const getAnnualPlanList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params }); defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
export const getContent = (params?: { investmentId: any }) => export const getContent = (params?: { investmentId: any }) =>
defHttp.get<ListItem[]>({ url: Api.GetContent, params }); defHttp.get<ListItem[]>({ url: Api.GetContent, params });
export const addItem = (params?: ProjectPageParams) =>
defHttp.post<ProjectModel>({
url: Api.AddannualPlanProject,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
});
export const updateItem = (params?: any) =>
defHttp.post<ProjectModel>({
url: Api.UpdateProject,
data: params,
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
});
export const getItem = (params?: any) =>
defHttp.get<ListItem[]>({ url: Api.ProjectDetail, params });
export const auditItem = (params?: any) => defHttp.post<ListItem[]>({ url: Api.audit, params });
...@@ -3,6 +3,10 @@ import { defHttp } from '@/utils/http/axios'; ...@@ -3,6 +3,10 @@ import { defHttp } from '@/utils/http/axios';
enum Api { enum Api {
GetList = '/pro/overdueFunds/getList', GetList = '/pro/overdueFunds/getList',
GetCompletedProjectList = '/pro/overdueFunds/getProject',
} }
export const getCompletedList = (params?: ProjectParams) => export const getCompletedList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params }); defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
export const getCompletedProjectList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetCompletedProjectList, data: params })
...@@ -30,7 +30,7 @@ const completed: AppRouteModule = { ...@@ -30,7 +30,7 @@ const completed: AppRouteModule = {
component: () => import('@/views/completed//completedEdit/completedEdit.vue'), component: () => import('@/views/completed//completedEdit/completedEdit.vue'),
meta: { meta: {
// affix: true, // affix: true,
title: '已竣工验收项目陈欠资金计划', title: '新建已竣工验收项目陈欠资金计划',
orderNo: 12, orderNo: 12,
}, },
}, },
......
...@@ -46,7 +46,7 @@ export function getBasicColumnsTwo(): BasicColumn[] { ...@@ -46,7 +46,7 @@ export function getBasicColumnsTwo(): BasicColumn[] {
}, },
{ {
title: '自有资金', title: '自有资金',
dataIndex: 'ownFunds', dataIndex: 'ownFund',
width: 150, width: 150,
// sorter: true, // sorter: true,
// defaultHidden: true, // defaultHidden: true,
...@@ -140,7 +140,7 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen ...@@ -140,7 +140,7 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
{ {
field: 'competentDepartment', field: 'competentDepartment',
label: '项目主管部门:', label: '项目主管部门:',
required: true, // required: true,
component: 'Input', component: 'Input',
componentProps: { componentProps: {
readonly: true, readonly: true,
...@@ -201,7 +201,7 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen ...@@ -201,7 +201,7 @@ export const formSchema: ({ colProps: { offset: number; span: number }; componen
}, },
{ {
label: '备注', label: '备注',
field: 'remarks', field: 'remark',
required: true, required: true,
component: 'InputTextArea', component: 'InputTextArea',
componentProps: { componentProps: {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
@register="register" @register="register"
title="选择投资计划" title="选择投资计划"
:minHeight="30" :minHeight="30"
okText="导入" okText="新建"
@ok="handleSubmit" @ok="handleSubmit"
@visible-change="handleVisibleChange" @visible-change="handleVisibleChange"
> >
......
...@@ -77,12 +77,46 @@ export const columns: ( ...@@ -77,12 +77,46 @@ export const columns: (
]; ];
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
// {
// field: 'projectName',
// label: '',
// component: 'Input',
// componentProps: {
// placeholder: '搜索关键字',
// },
// colProps: { span: 4 },
// },
{ {
field: 'projectName', field: 'filingCycle',
label: '', label: '',
component: 'Input', component: 'DatePicker',
componentProps: {
placeholder: '年度',
picker: 'year',
valueFormat: 'YYYY',
format: 'YYYY',
style: {
width: '100%',
},
},
colProps: { span: 4 },
},
{
field: 'planType',
label: '',
component: 'Select',
componentProps: { componentProps: {
placeholder: '搜索关键字', placeholder: '类型',
options: [
{
label: '工程',
value: '工程',
},
{
label: '承建',
value: '承建',
},
],
}, },
colProps: { span: 4 }, colProps: { span: 4 },
}, },
......
...@@ -26,11 +26,11 @@ export const columns: ( ...@@ -26,11 +26,11 @@ export const columns: (
dataIndex: 'year', dataIndex: 'year',
width: 200, width: 200,
}, },
{ // {
title: '类型', // title: '类型',
dataIndex: 'type', // dataIndex: 'type',
width: 180, // width: 180,
}, // },
{ {
title: '年计划投资', title: '年计划投资',
dataIndex: 'planInvestment', dataIndex: 'planInvestment',
......
...@@ -15,31 +15,46 @@ ...@@ -15,31 +15,46 @@
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', label: '修改',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record, 0),
// ifShow: (_action) => {
// return record.completionResult == 0;
// },
},
{
label: '详情',
onClick: handleEdit.bind(null, record, 1),
// ifShow: (_action) => {
// return record.reviewStatus == '1';
// },
}, },
{ {
icon: 'ant-design:delete-outlined', label: '审核',
color: 'error', color: 'success',
popConfirm: { popConfirm: {
title: '是否确认删除', title: '是否确认审核',
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record), confirm: examine.bind(null, record, true),
}, },
// ifShow: (_action) => {
// return record.reviewStatus == null;
// },
}, },
]" ]"
/> />
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<yearModal @register="register" @close="handleNew" /> <annualPlanModel @register="register" @close="handleNew" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {useRouter} from "vue-router";
const { push } = useRouter();
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getAnnualPlanList } from '@/api/project/annualPlan'; import { getAnnualPlanList } from '@/api/project/annualPlan';
import yearModal from '@/components/yearModal.vue'; import annualPlanModel from './annualPlanModel/annualPlanModel.vue';
import { getListByPage } from '@/api/project/biddingPlan'; import { getListByPage } from '@/api/project/biddingPlan';
...@@ -48,6 +63,9 @@ import { useDrawer } from '@/components/Drawer'; ...@@ -48,6 +63,9 @@ import { useDrawer } from '@/components/Drawer';
import { columns, searchFormSchema } from './data'; import { columns, searchFormSchema } from './data';
import {useModal} from "@/components/Modal"; import {useModal} from "@/components/Modal";
import {router} from "@/router"; import {router} from "@/router";
import { BasicForm, useForm, FormProps, UseFormReturnType } from '@/components/Form';
import {formSchema} from "@/views/annualPlan/annualPlanEdit/tableData";
import {auditItem} from "@/api/project/engineeringProject";
const [register, { openModal: openModal }] = useModal(); const [register, { openModal: openModal }] = useModal();
...@@ -67,7 +85,7 @@ const [registerTable, { reload }] = useTable({ ...@@ -67,7 +85,7 @@ const [registerTable, { reload }] = useTable({
bordered: true, bordered: true,
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 80, width: 180,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
// slots: { customRender: 'action' }, // slots: { customRender: 'action' },
...@@ -76,10 +94,13 @@ const [registerTable, { reload }] = useTable({ ...@@ -76,10 +94,13 @@ const [registerTable, { reload }] = useTable({
}); });
function handleEdit(record: Recordable) { function handleEdit(record: Recordable, disabled: number) {
openDrawer(true, { push({
record, path: '/annualPlan/annualPlanEdit',
isUpdate: true, query: {
id: record.id,
disabled: String(disabled),
},
}); });
} }
...@@ -101,13 +122,22 @@ const handleNew = (e) => { ...@@ -101,13 +122,22 @@ const handleNew = (e) => {
console.log('eeee', e); console.log('eeee', e);
router.push({ router.push({
path: '/annualPlan/annualPlanEdit', path: '/annualPlan/annualPlanEdit',
query: e, query: {
source: JSON.stringify(e),
},
}); });
}; };
const change = (key: string) => { const change = (key: string) => {
reload(); reload();
}; };
async function examine(record: Recordable, disabled: boolean) {
const id = record.id;
const res = await auditItem({ id });
console.log(res);
reload();
}
</script> </script>
<style scoped> <style scoped>
.btn { .btn {
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
// console.log('data.table' + index, data.table); // console.log('data.table' + index, data.table);
let { getDataSource } = data.table[1]; let { getDataSource } = data.table[1];
const res = getDataSource(); const res = getDataSource();
// console.log('res', res);
const totalNo = res.reduce((prev, next) => { const totalNo = res.reduce((prev, next) => {
prev += Number(next.numericalValue); prev += Number(next.numericalValue);
return prev; return prev;
...@@ -272,113 +271,112 @@ ...@@ -272,113 +271,112 @@
* *
*/ */
async function handleNew(info: any) { async function handleNew(info: any) {
let res = await getContent({ investmentId: info.id }); // let res = await getContent({ investmentId: info.id });
console.log('res', res); // console.log('res', res);
for (let i = 0; i < res.length; i++) { // for (let i = 0; i < res.length; i++) {
investmentld.value = res[i].id; // investmentld.value = res[i].id;
const item = { const item = {
name: '序号' + (tabsFormSchema.length + 1), name: '序号' + (tabsFormSchema.length + 1),
forceRender: true, forceRender: true,
Form: useForm(Object.assign({ schemas: formSchema }, baseFormConfig) as FormProps), Form: useForm(Object.assign({ schemas: formSchema }, baseFormConfig) as FormProps),
table: useTable({ table: useTable({
title: '表尾行合计示例', title: '表尾行合计示例',
// api: demoListApi, // api: demoListApi,
// rowSelection: { type: 'checkbox' }, // rowSelection: { type: 'checkbox' },
columns: getBasicColumns(), columns: getBasicColumns(),
showSummary: true, showSummary: true,
summaryData: show, summaryData: show,
maxHeight: 180, maxHeight: 180,
maxWidth: 200, maxWidth: 200,
showIndexColumn: false, showIndexColumn: false,
pagination: false, pagination: false,
// scroll: { x: 2000 }, // scroll: { x: 2000 },
// canResize: false, // canResize: false,
// showSelectionBar: true, // 显示多选状态栏 // showSelectionBar: true, // 显示多选状态栏
}), }),
tableTwo: useTable({ tableTwo: useTable({
title: '表尾行合计示例', title: '表尾行合计示例',
// api: demoListApi, // api: demoListApi,
// rowSelection: { type: 'checkbox' }, // rowSelection: { type: 'checkbox' },
columns: getBasicColumnsTwo(), columns: getBasicColumnsTwo(),
showSummary: true, showSummary: true,
summaryData: showTwo, summaryData: showTwo,
maxHeight: 180, maxHeight: 180,
maxWidth: 200, maxWidth: 200,
showIndexColumn: false, showIndexColumn: false,
pagination: false, pagination: false,
// scroll: { x: 2000 }, // scroll: { x: 2000 },
// canResize: false, // canResize: false,
// showSelectionBar: true, // 显示多选状态栏 // showSelectionBar: true, // 显示多选状态栏
}), }),
}; };
const { setTableData } = item.table[1]; const { setTableData } = item.table[1];
// console.log('item.table',setTableData) // console.log('item.table',setTableData)
const { setFieldsValue } = item.Form[1]; const { setFieldsValue } = item.Form[1];
tabsFormSchema.push(item); tabsFormSchema.push(item);
setTable(item.table[1], [ setTable(item.table[1], [
{ {
quarter: '一季度', quarter: '一季度',
numericalValue: '', numericalValue: '',
}, },
{ {
quarter: '二季度', quarter: '二季度',
numericalValue: '', numericalValue: '',
}, },
{ {
quarter: '三季度', quarter: '三季度',
numericalValue: '', numericalValue: '',
}, },
]); ]);
setTable(item.tableTwo[1], [ setTable(item.tableTwo[1], [
{ {
quarter: '一季度', quarter: '一季度',
numericalValue: '', numericalValue: '',
}, },
{ {
quarter: '二季度', quarter: '二季度',
numericalValue: '', numericalValue: '',
}, },
{ {
quarter: '三季度', quarter: '三季度',
numericalValue: '', numericalValue: '',
}, },
{ {
quarter: '四季度', quarter: '四季度',
numericalValue: '', numericalValue: '',
}, },
]); ]);
formData.value.investmentPlan.push({ // formData.value.investmentPlan.push({
proId: res[i].id, // proId: info[i].id,
}); // });
nextTick(() => { nextTick(() => {
// setTableData([ // setTableData([
// { // {
// quarter: '一季度', // quarter: '一季度',
// numericalValue: '', // numericalValue: '',
// }, // },
// { // {
// quarter: '二季度', // quarter: '二季度',
// numericalValue: '', // numericalValue: '',
// }, // },
// { // {
// quarter: '三季度', // quarter: '三季度',
// numericalValue: '', // numericalValue: '',
// }, // },
// ]); // ]);
setFieldsValue({ setFieldsValue({
projectName: res[i].projectName, projectName: info.projectName,
constructionSite: res[i].constructionSite, constructionSite: info.constructionSite,
totalInvestment: res[i].totalInvestment, constructionMode: info.constructionMode,
planFunds: res[i].planFunds, projectType: info.projectType,
attribute: res[i].attribute, constructionScale: info.constructionScale,
beginTime: res[i].beginTime, projectOverview: info.projectOverview,
schedule: res[i].schedule, fundingSource: info.fundingSource,
competentDepartment: res[i].competentDepartment, implementingEntity: info.implementingEntity,
projectType: res[i].projectType,
});
}); });
} });
// }
} }
async function deleteItem(index: any) { async function deleteItem(index: any) {
tabsFormSchema.splice(index, 1); tabsFormSchema.splice(index, 1);
......
...@@ -25,10 +25,10 @@ import { BasicModal, useModalInner } from '@/components/Modal'; ...@@ -25,10 +25,10 @@ import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { columns, searchFormSchema } from './data'; import { columns, searchFormSchema } from './data';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { getMonthlyPlanProjectList } from "@/api/project/monthlyPlan"; import { getCompletedProjectList } from "@/api/project/completed";
const [registerTable, { reload, getSelectRows }] = useTable({ const [registerTable, { reload, getSelectRows }] = useTable({
api: getMonthlyPlanProjectList, api: getCompletedProjectList,
title: '123', title: '123',
columns, columns,
formConfig: { formConfig: {
......
...@@ -15,63 +15,43 @@ export const columns: ( ...@@ -15,63 +15,43 @@ export const columns: (
| { dataIndex: string; width: number; title: string } | { dataIndex: string; width: number; title: string }
)[] = [ )[] = [
{ {
title: '年度', title: '基本信息',
dataIndex: 'filingCycle', dataIndex: 'projectName',
width: 180, width: 180,
}, },
{ {
title: '类型', title: '实施主体',
dataIndex: 'planType', dataIndex: 'implementingEntity',
width: 180, width: 180,
}, },
{ {
title: '项目数量', title: '建设模式',
dataIndex: 'totalProject', dataIndex: 'constructionMode',
width: 200, width: 200,
}, },
{ {
title: '总投资', title: '建设地点',
dataIndex: 'totalInvestment', dataIndex: 'constructionSite',
width: 180, width: 180,
}, },
{ {
title: '合同总额合计', title: '项目类型',
dataIndex: 'totalContract', dataIndex: 'projectType',
width: 180, width: 180,
}, },
{ {
title: '三年滚动投资计划合计', title: '资金来源',
dataIndex: 'totalRollingInvestment', dataIndex: 'fundingSource',
width: 180, width: 180,
}, },
{ {
title: '公司名称', title: '建设目的及项目功能',
dataIndex: 'company', dataIndex: 'constructionPurpose',
width: 180, width: 180,
}, },
{ {
title: '最新更新人', title: '建设规模',
dataIndex: 'updateBy', dataIndex: 'constructionScale',
width: 180,
},
{
title: '最新更新时间',
dataIndex: 'updateTime',
width: 180,
},
{
title: '审核状态',
dataIndex: 'planResult',
width: 180,
},
{
title: '审核人',
dataIndex: 'auditingBy',
width: 180,
},
{
title: '审核时间',
dataIndex: 'auditingTime',
width: 180, width: 180,
}, },
]; ];
......
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