Commit 0cf9d504 authored by mengzixuan's avatar mengzixuan

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

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