Commit 50c111d7 authored by jiaxu.yan's avatar jiaxu.yan

feat: 完成月度

parent 0cf9d504
import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel';
export type ProjectParams = {
projectName?: string;
};
export type ProjectPageParams = BasicPageParams & ProjectParams;
export interface ProjectListItem {
id: string;
projectName: string;
isReserveProject: string;
constructionSite: string;
constructionMode: string;
projectType: string;
projectOverview: string;
constructionPurpose: string;
delFlag: string;
constructionScale: string;
fundingSource: string;
implementingEntity: string;
logo: string;
createTime: null;
createBy: string;
updateTime: null;
updateBy: string;
}
export interface ProjectModel {
id?: string | number;
constructionMode: string;
isReserveProject: string;
projectType: string;
projectOverview: string;
constructionPurpose: string;
}
export interface ProjectCountModel {
counttotal: number;
countbuildbyoneself: number;
countbuildbyentrust: number;
countbuildbyreplace: number;
countbuildbyhold: number;
countreserve: number;
}
export type ProjectListGetResultModel = BasicFetchResult<ProjectListItem>;
...@@ -33,5 +33,12 @@ export interface ProjectModel { ...@@ -33,5 +33,12 @@ export interface ProjectModel {
projectOverview: string; projectOverview: string;
constructionPurpose: string; constructionPurpose: string;
} }
export interface ProjectCountModel {
counttotal: number;
countbuildbyoneself: number;
countbuildbyentrust: number;
countbuildbyreplace: number;
countbuildbyhold: number;
countreserve: number;
}
export type ProjectListGetResultModel = BasicFetchResult<ProjectListItem>; export type ProjectListGetResultModel = BasicFetchResult<ProjectListItem>;
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';
enum Api { enum Api {
GetList = '/pro/monthEngineer/page', GetList = '/pro/monthEngineer/page',
GetMonthlyPlanProjectList = '/pro/fundPlanYear/selectplan', AddProject = '/pro/monthEngineer/add',
UpdateProject = '/pro/monthEngineer/update',
DeleteProject = '/pro/monthEngineer/delInTable',
ProjectDetail = '/pro/monthEngineer/details',
Itemdelete = '/pro/monthEngineer/delByDetail',
audit = '/pro/monthEngineer/audit',
} }
export const getMonthlyPlanList = (params?: ProjectParams) => export const getMonthlyPlanList = (params?: ProjectParams) =>
defHttp.post<ProjectModel>({ url: Api.GetList, data: params }); defHttp.post<ProjectModel>({ url: Api.GetList, data: params });
export const getMonthlyPlanProjectList = (params?: ProjectParams) => export const addItem = (params?: any) =>
defHttp.post<ProjectModel>({ url: Api.GetMonthlyPlanProjectList, data: params }); defHttp.post<ProjectModel>({
url: Api.AddProject,
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 auditItem = (params?: any) =>
defHttp.get<ProjectModel>({
url: Api.audit,
params,
});
export const deleteItem = (params?: any) =>
defHttp.delete<ProjectModel>({ url: Api.DeleteProject, params });
export const Itemdelete = (params?: any) =>
defHttp.delete<ProjectModel>({ url: Api.Itemdelete, params });
export const getItem = (params?: any) => defHttp.get<ProjectModel>({ url: Api.ProjectDetail, params });
...@@ -3,6 +3,7 @@ import { ...@@ -3,6 +3,7 @@ import {
ProjectListGetResultModel, ProjectListGetResultModel,
ProjectModel, ProjectModel,
ProjectListItem, ProjectListItem,
ProjectCountModel
} from './model/projectModel'; } from './model/projectModel';
import { defHttp } from '@/utils/http/axios'; import { defHttp } from '@/utils/http/axios';
...@@ -12,6 +13,7 @@ enum Api { ...@@ -12,6 +13,7 @@ enum Api {
UpdateProject = '/pro/project/update', UpdateProject = '/pro/project/update',
DeleteProject = '/pro/project/del', DeleteProject = '/pro/project/del',
ProjectDetail = '/pro/project/details', ProjectDetail = '/pro/project/details',
ProjectCount = '/pro/project/count',
} }
export const getListByPage = (params?: ProjectParams) => export const getListByPage = (params?: ProjectParams) =>
defHttp.post<ProjectListGetResultModel>({ url: Api.GetList, data: params }); defHttp.post<ProjectListGetResultModel>({ url: Api.GetList, data: params });
...@@ -27,3 +29,6 @@ export const deleteItem = (params?: any) => ...@@ -27,3 +29,6 @@ export const deleteItem = (params?: any) =>
export const getItem = (params?: any) => export const getItem = (params?: any) =>
defHttp.get<ProjectListItem>({ url: Api.ProjectDetail, params }); defHttp.get<ProjectListItem>({ url: Api.ProjectDetail, params });
export const getProjectCount = (params?: any) =>
defHttp.post<ProjectCountModel>({ url: Api.ProjectCount, params });
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
width="70%" width="70%"
v-bind="$attrs" v-bind="$attrs"
@register="register" @register="register"
title="选择项目导入" title="选择合同导入"
:minHeight="30" :minHeight="30"
okText="导入" okText="导入"
@ok="handleSubmit" @ok="handleSubmit"
......
...@@ -64,6 +64,24 @@ ...@@ -64,6 +64,24 @@
colProps: { span: 11, offset: 1 }, colProps: { span: 11, offset: 1 },
}); });
} }
if (i == 'month') {
schemas.push({
field: 'month',
label: '',
component: 'DatePicker',
required: true,
componentProps: {
placeholder: '月份',
picker: 'month',
valueFormat: 'YYYY-MM',
format: 'YYYY-MM',
style: {
width: '100%',
},
},
colProps: { span: 11, offset: 1 },
});
}
if (i == 'quarter') { if (i == 'quarter') {
schemas.push({ schemas.push({
field: 'quarter', field: 'quarter',
......
...@@ -42,7 +42,7 @@ const monthlyPlan: { ...@@ -42,7 +42,7 @@ const monthlyPlan: {
component: () => import('@/views/monthlyPlan/monthlyPlanEdit/monthlyPlanEdit.vue'), component: () => import('@/views/monthlyPlan/monthlyPlanEdit/monthlyPlanEdit.vue'),
meta: { meta: {
// affix: true, // affix: true,
title: '新建计划(工程)', title: '月度工程资金计划',
orderNo: 8, orderNo: 8,
}, },
}, },
......
...@@ -2,31 +2,56 @@ ...@@ -2,31 +2,56 @@
<div> <div>
<BasicTable @register="registerTable" :title="'月度工程资金计划'"> <BasicTable @register="registerTable" :title="'月度工程资金计划'">
<template #toolbar> <template #toolbar>
<a-button class="btn" type="primary" @click="addMonthlyPlan"> 新建月度工程资金计划 </a-button> <a-button class="btn" type="primary" @click="addMonthlyPlan">
新建月度工程资金计划
</a-button>
</template> </template>
<template #bodyCell="{ column, text, record, index }"> <template #bodyCell="{ column, text, record, index }">
<!-- 当前列是序号列时,显示序号 --> <!-- 当前列是序号列时,显示序号 -->
<span v-if="column.dataIndex === 'serialNumber'">{{ index + 1 }}</span> <span v-if="column.dataIndex === 'serialNumber'">{{ index + 1 }}</span>
<!-- 其他列正常显示 --> <!-- 其他列正常显示 -->
<span v-else>{{ text }}</span> <span v-else>{{ text }}</span>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<TableAction <TableAction
:actions="[ :actions="[
{
label: '详情',
onClick: handleEdit.bind(null, record, 1),
ifShow: (_action) => {
return record.reviewStatus == '1';
},
},
{ {
icon: 'clarity:note-edit-line', label: '修改',
onClick: handleEdit.bind(null, record), onClick: handleEdit.bind(null, record, 0),
ifShow: (_action) => {
return record.reviewStatus == 0;
},
}, },
{ {
icon: 'ant-design:delete-outlined', label: '删除',
color: 'error', color: 'error',
popConfirm: { popConfirm: {
title: '是否确认删除', title: '是否确认删除',
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record), confirm: handleDelete.bind(null, record),
}, },
ifShow: (_action) => {
return record.reviewStatus == 0;
},
},
{
label: '审核',
color: 'success',
popConfirm: {
title: '是否确认审核',
placement: 'left',
confirm: examine.bind(null, record, true),
},
ifShow: (_action) => {
return record.reviewStatus == 0;
},
}, },
]" ]"
/> />
...@@ -37,82 +62,85 @@ ...@@ -37,82 +62,85 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getMonthlyPlanList } from '@/api/project/monthlyPlan'; import { getMonthlyPlanList, deleteItem, auditItem } from '@/api/project/monthlyPlan';
import { getListByPage } from '@/api/project/biddingPlan'; import { useDrawer } from '@/components/Drawer';
import { useDrawer } from '@/components/Drawer'; import { columns, searchFormSchema } from './data';
import { columns, searchFormSchema } from './data'; defineOptions({ name: 'MonthlyPlan' });
defineOptions({ name: 'MonthlyPlan' }); import yearModal from '@/components/yearModal.vue';
import yearModal from '@/components/yearModal.vue'; import { useModal } from '@/components/Modal';
import { useModal } from '@/components/Modal'; import { useRouter } from 'vue-router';
const { push } = useRouter();
import {router} from "@/router";
const [register, { openModal: openModal }] = useModal();
const [register, { openModal: openModal }] = useModal();
const [registerTable, { reload }] = useTable({
const [registerTable, { reload }] = useTable({ api: getMonthlyPlanList,
api: getMonthlyPlanList, title: '123',
title: '123', columns,
columns, formConfig: {
formConfig: { labelWidth: 120,
labelWidth: 120, schemas: searchFormSchema,
schemas: searchFormSchema, },
}, useSearchForm: true,
useSearchForm: true, showTableSetting: false,
showTableSetting: false, bordered: true,
bordered: true, showIndexColumn: false,
showIndexColumn: false, actionColumn: {
actionColumn: { width: 220,
width: 80, title: '操作',
title: '操作', dataIndex: 'action',
dataIndex: 'action', // slots: { customRender: 'action' },
// slots: { customRender: 'action' }, fixed: undefined,
fixed: undefined, },
},
});
function handleEdit(record: Recordable) {
openDrawer(true, {
record,
isUpdate: true,
}); });
}
function handleDelete(record: Recordable) {
console.log(record);
}
function handleSuccess() {
reload();
}
const change = (key: string) => {
reload();
};
const addMonthlyPlan = () => { function handleEdit(record: Recordable, disabled: number) {
openModal(true, { push({
data: ['year'], path: '/monthlyPlan/monthlyPlanEdit',
}); query: {
}; id: record.id,
disabled: String(disabled),
const handleNew = (e) => { },
console.log('eeee', e); });
router.push({ }
path: '/monthlyPlan/monthlyPlanEdit',
query: e, function handleDelete(record: Recordable) {
}); deleteItem({ id: record.id });
}; reload();
}
function handleSuccess() {
reload();
}
async function examine(record: Recordable, disabled: boolean) {
const id = record.id;
const res = await auditItem({ id });
console.log(res);
reload();
}
const addMonthlyPlan = () => {
openModal(true, {
data: ['month'],
});
};
const handleNew = (e) => {
push({
path: '/monthlyPlan/monthlyPlanEdit',
query: e,
});
};
</script> </script>
<style scoped> <style scoped>
.btn { .btn {
margin-right: 10px; margin-right: 10px;
} }
</style> </style>
...@@ -7,28 +7,46 @@ ...@@ -7,28 +7,46 @@
<div class="title">项目总数</div> <div class="title">项目总数</div>
<div class="content"> <div class="content">
<img :class="`${prefixCls}__top-img`" src="../../assets/images/group.png" /> <img :class="`${prefixCls}__top-img`" src="../../assets/images/group.png" />
<span><p>100</p></span> <span
><p>{{ countData.counttotal }}</p
></span
>
</div> </div>
</Col> </Col>
<Col :span="4" :class="`${prefixCls}__top-col`"> <Col :span="4" :class="`${prefixCls}__top-col`">
<div class="title">自建</div> <div class="title">自建</div>
<span><p>100</p></span> <span
><p>{{ countData.countbuildbyoneself }}</p
></span
>
</Col> </Col>
<Col :span="4" :class="`${prefixCls}__top-col`"> <Col :span="4" :class="`${prefixCls}__top-col`">
<div class="title">委托建设</div> <div class="title">委托建设</div>
<span><p>100</p></span> <span
><p>{{ countData.countbuildbyentrust }}</p
></span
>
</Col> </Col>
<Col :span="4" :class="`${prefixCls}__top-col`"> <Col :span="4" :class="`${prefixCls}__top-col`">
<div class="title">代建</div> <div class="title">代建</div>
<span><p>100</p></span> <span
><p>{{ countData.countbuildbyreplace }}</p
></span
>
</Col> </Col>
<Col :span="4" :class="`${prefixCls}__top-col`"> <Col :span="4" :class="`${prefixCls}__top-col`">
<div class="title">承建</div> <div class="title">承建</div>
<span><p>100</p></span> <span
><p>{{ countData.countbuildbyhold }}</p
></span
>
</Col> </Col>
<Col :span="4" :class="`${prefixCls}__top-col`"> <Col :span="4" :class="`${prefixCls}__top-col`">
<div class="title">储备</div> <div class="title">储备</div>
<span><p>100</p></span> <span
><p>{{ countData.countreserve }}</p
></span
>
</Col> </Col>
</Row> </Row>
</div> </div>
...@@ -78,12 +96,14 @@ ...@@ -78,12 +96,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Tag } from 'ant-design-vue'; import { Tag } from 'ant-design-vue';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import { getListByPage, deleteItem, getItem } from '@/api/project/project'; import { getListByPage, deleteItem, getProjectCount } from '@/api/project/project';
import { columns, searchFormSchema } from './project.data'; import { columns, searchFormSchema } from './project.data';
import { Row, Col } from 'ant-design-vue'; import { Row, Col } from 'ant-design-vue';
import projectDrawer from './projectDrawer.vue'; import projectDrawer from './projectDrawer.vue';
import { useDrawer } from '@/components/Drawer'; import { useDrawer } from '@/components/Drawer';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { onMounted, ref } from 'vue';
const countData = ref({});
const { push } = useRouter(); const { push } = useRouter();
const [registerDrawer, { openDrawer }] = useDrawer(); const [registerDrawer, { openDrawer }] = useDrawer();
const prefixCls = 'list-basic'; const prefixCls = 'list-basic';
...@@ -139,6 +159,11 @@ ...@@ -139,6 +159,11 @@
function handleSuccess() { function handleSuccess() {
reload(); reload();
} }
onMounted(async () => {
let res = await getProjectCount();
console.log(res);
countData.value = res;
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.list-basic { .list-basic {
......
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