Commit 218a7fba authored by 高滢's avatar 高滢

feat(年度投资计划): 添加四种分类

parent 90b486fe
...@@ -12,6 +12,7 @@ VITE_BUILD_COMPRESS = 'gzip' ...@@ -12,6 +12,7 @@ VITE_BUILD_COMPRESS = 'gzip'
# Basic interface address SPA # Basic interface address SPA
# VITE_GLOB_API_URL = https://dev.unitj.cn # VITE_GLOB_API_URL = https://dev.unitj.cn
VITE_GLOB_API_URL = '' VITE_GLOB_API_URL = ''
# File upload address, optional # File upload address, optional
# It can be forwarded by nginx or write the actual address directly # It can be forwarded by nginx or write the actual address directly
......
...@@ -12,8 +12,11 @@ enum Api { ...@@ -12,8 +12,11 @@ enum Api {
DeleteProject = '/pro/investmentPlan/delete', DeleteProject = '/pro/investmentPlan/delete',
selectCount = '/pro/investmentPlan/selectCount', selectCount = '/pro/investmentPlan/selectCount',
statisticEngineProject = '/pro/investmentPlan/statisticEngineering', statisticEngineProject = '/pro/investmentPlan/statisticEngineering',
statisticEngineeringOther = '/pro/investmentPlan/statisticEngineeringOther',
statisticEngineProjectDetails = '/pro/investmentPlan/statisticEngineeringDetails', statisticEngineProjectDetails = '/pro/investmentPlan/statisticEngineeringDetails',
statisticEngineeringDetailsOther = '/pro/investmentPlan/statisticEngineeringDetailsOther',
exportStatisticEngine = '/pro/investmentPlan/exportStatisticEngineer', exportStatisticEngine = '/pro/investmentPlan/exportStatisticEngineer',
ExportStatisticEngineerOther = '/pro/investmentPlan/exportStatisticEngineerOther',
} }
export const selectCount = (params?: any) => export const selectCount = (params?: any) =>
...@@ -62,7 +65,16 @@ export const getStatisticEngineProject = (params?: any) => ...@@ -62,7 +65,16 @@ export const getStatisticEngineProject = (params?: any) =>
url: Api.statisticEngineProject, url: Api.statisticEngineProject,
params, params,
}); });
export const statisticEngineeringOther = (params?: any) =>
defHttp.post<any>({
url: Api.statisticEngineeringOther,
params,
});
export const statisticEngineeringDetailsOther = (params?: any) =>
defHttp.post<any>({
url: Api.statisticEngineeringDetailsOther,
params,
});
export const getStatisticEngineProjectDetails = (params?: any) => export const getStatisticEngineProjectDetails = (params?: any) =>
defHttp.post<any>({ defHttp.post<any>({
url: Api.statisticEngineProjectDetails, url: Api.statisticEngineProjectDetails,
...@@ -78,3 +90,13 @@ export const exportStatisticEngine = (params?: any) => ...@@ -78,3 +90,13 @@ export const exportStatisticEngine = (params?: any) =>
}, },
{ errorMessageMode: 'none', isTransformResponse: false }, { errorMessageMode: 'none', isTransformResponse: false },
); );
export const exportStatisticEngineerOther = (params?: any) =>
defHttp.post<any>(
{
url: Api.ExportStatisticEngineerOther,
data: params,
responseType: 'blob',
},
{ errorMessageMode: 'none', isTransformResponse: false },
);
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
:scroll="{ x: 4000, y: 300 }" :scroll="{ x: 4000, y: 300 }"
> >
<template #index="{ text, record, index }"> <template #index="{ text, record, index }">
{{index+1}} {{ index + 1 }}
</template> </template>
</Table> </Table>
</div> </div>
...@@ -23,13 +23,23 @@ ...@@ -23,13 +23,23 @@
import { ref } from 'vue'; import { ref } from 'vue';
import { Table } from 'ant-design-vue'; import { Table } from 'ant-design-vue';
import { getDtailsBasicColumns } from '@/views/engineeringProject/statisticEngineering/statisticData'; import { getDtailsBasicColumns } from '@/views/engineeringProject/statisticEngineering/statisticData';
import { getStatisticEngineProjectDetails } from '@/api/project/engineeringProject'; import {
getStatisticEngineProjectDetails,
statisticEngineeringDetailsOther,
} from '@/api/project/engineeringProject';
const loadingRef = ref(false); const loadingRef = ref(false);
// 列表 // 列表
const dataSource = ref([]); const dataSource = ref([]);
const getTitle = ref(''); const getTitle = ref('');
const params = ref({ companyId: '', projectType: '', filingCycle: '', planType: '' }); const params = ref({
companyId: '',
projectType: '',
filingCycle: '',
planType: '',
groupByField: '',
params: '',
});
const [register, { closeModal }] = useModalInner(async (data) => { const [register, { closeModal }] = useModalInner(async (data) => {
getTitle.value = data.record.company; getTitle.value = data.record.company;
...@@ -37,7 +47,13 @@ ...@@ -37,7 +47,13 @@
params.value.projectType = data.record.projectType; params.value.projectType = data.record.projectType;
params.value.filingCycle = data.filingCycle; params.value.filingCycle = data.filingCycle;
params.value.planType = data.planType; params.value.planType = data.planType;
dataSource.value = await getStatisticEngineProjectDetails(params.value); params.value.groupByField = data.groupByField;
params.value.params = data.record.groupByField;
if (data.groupByField === 'company') {
dataSource.value = await getStatisticEngineProjectDetails(params.value);
} else {
dataSource.value = await statisticEngineeringDetailsOther(params.value);
}
// console.log('212', list); // console.log('212', list);
}); });
</script> </script>
......
...@@ -12,13 +12,23 @@ ...@@ -12,13 +12,23 @@
<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>
<a-button type="primary" @click="exportCount" style="margin-left: 10px"> 导出</a-button> <a-button type="primary" @click="exportCount" style="margin-left: 10px">{{
'导出' + groupByFieldReturn()
}}</a-button>
</template> </template>
</BasicForm> </BasicForm>
<div>
<Tabs v-model:activeKey="groupByField" size="large" @change="clickGroupByFieldTab">
<a-tab-pane key="company" tab="公司" />
<a-tab-pane key="projectType" tab="项目类型" />
<a-tab-pane key="attribute" tab="建设性质" />
<a-tab-pane key="schedule" tab="年底形象进度" />
</Tabs>
</div>
<Table <Table
:pagination="false" :pagination="false"
:dataSource="dataSource" :dataSource="dataSource"
:columns="getBasicColumns(params.filingCycle, params.planType)" :columns="getBasicColumns(params.filingCycle, params.planType, params.groupByField)"
bordered bordered
:loading="loadingRef" :loading="loadingRef"
:rowClassName="setRowClassName" :rowClassName="setRowClassName"
...@@ -43,12 +53,15 @@ ...@@ -43,12 +53,15 @@
import { getSelectDeptById } from '@/api/project/monthlyPlan'; import { getSelectDeptById } from '@/api/project/monthlyPlan';
import { import {
exportStatisticEngine, exportStatisticEngine,
exportStatisticEngineerOther,
getStatisticEngineProject, getStatisticEngineProject,
statisticEngineeringOther,
} from '@/api/project/engineeringProject'; } from '@/api/project/engineeringProject';
import EngineeringStatisticWindow from '@/views/engineeringProject/statisticEngineering/engineeringStatisticWindow.vue'; import EngineeringStatisticWindow from '@/views/engineeringProject/statisticEngineering/engineeringStatisticWindow.vue';
import { useModal } from '@/components/Modal'; import { useModal } from '@/components/Modal';
import { downloadByData } from '@/utils/file/download'; import { downloadByData } from '@/utils/file/download';
const groupByField = ref('company');
const planType = ref('自投'); const planType = ref('自投');
const [register, { openModal: openModal }] = useModal(); const [register, { openModal: openModal }] = useModal();
onMounted(async () => { onMounted(async () => {
...@@ -64,7 +77,12 @@ ...@@ -64,7 +77,12 @@
}); });
const dataSource = ref([]); const dataSource = ref([]);
const loadingRef = ref(false); const loadingRef = ref(false);
const params = ref({ filingCycle: new Date().getFullYear(), planType: '自投', company: '' }); const params = ref({
filingCycle: new Date().getFullYear(),
planType: '自投',
company: '',
groupByField: 'company',
});
const [registerForm, { getFieldsValue, setFieldsValue, updateSchema }] = useForm({ const [registerForm, { getFieldsValue, setFieldsValue, updateSchema }] = useForm({
labelWidth: 90, labelWidth: 90,
baseColProps: { span: 24 }, baseColProps: { span: 24 },
...@@ -72,6 +90,28 @@ ...@@ -72,6 +90,28 @@
showActionButtonGroup: false, showActionButtonGroup: false,
}); });
const groupByFieldReturn = () => {
if (groupByField.value === 'schedule') {
return '(按年底形象进度分类)';
} else if (groupByField.value === 'attribute') {
return '(按建设性质分类)';
} else if (groupByField.value === 'projectType') {
return '(按项目类型分类)';
} else {
return '(按公司分类)';
}
};
async function clickGroupByFieldTab(value) {
params.value.groupByField = value;
setFieldsValue({
groupByField: value,
}).then(() => {
let data = getFieldsValue();
params.value = data;
getStatisticList();
});
}
async function clickTab(value) { async function clickTab(value) {
setFieldsValue({ setFieldsValue({
planType: value, planType: value,
...@@ -88,21 +128,25 @@ ...@@ -88,21 +128,25 @@
getStatisticList(); getStatisticList();
} }
function setRowClassName(record) { function setRowClassName(record) {
if (record.projectType === '总计') { if (record.projectType === '总计' || record.groupByField === '合计'||record.company === '合计') {
return 'rowcolor'; return 'rowcolor';
} else { } else {
return; return;
} }
} }
async function getStatisticList() { async function getStatisticList() {
loadingRef.value = true; loadingRef.value = true;
let data = await getStatisticEngineProject(params.value); let data = [];
// dataSource.value = data; if (groupByField.value === 'company') {
let propsList = ['company']; data = await getStatisticEngineProject(params.value);
propsList.map((item) => { let propsList = ['company'];
changeData(data, item); propsList.map((item) => {
}); changeData(data, item);
});
} else {
data = await statisticEngineeringOther(params.value);
dataSource.value = data;
}
loadingRef.value = false; loadingRef.value = false;
return data; return data;
} }
...@@ -130,11 +174,23 @@ ...@@ -130,11 +174,23 @@
record, record,
filingCycle: params.value.filingCycle, filingCycle: params.value.filingCycle,
planType: params.value.planType, planType: params.value.planType,
groupByField: groupByField.value,
}); });
} }
async function exportCount() { async function exportCount() {
const data = await exportStatisticEngine(params.value); if (groupByField.value === 'company') {
downloadByData(data, '投资计划' + '.xls'); const data = await exportStatisticEngine(params.value);
downloadByData(data, '投资计划按公司分类' + '.xls');
} else {
let fileName =
groupByField.value === 'attribute'
? '按建设性质分类'
: groupByField.value === 'schedule'
? '按年底形象进度分类'
: '按项目类型分类';
const data = await exportStatisticEngineerOther(params.value);
downloadByData(data, '投资计划' + fileName + '.xls');
}
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
......
...@@ -36,6 +36,23 @@ export const searchForm: FormSchema[] = [ ...@@ -36,6 +36,23 @@ export const searchForm: FormSchema[] = [
}, },
colProps: { span: 4 }, colProps: { span: 4 },
}, },
{
field: 'groupByField',
ifShow: false,
label: '',
defaultValue: 'company',
component: 'Select',
componentProps: {
options: [
{ label: 'company', value: 'company' },
{ label: 'schedule', value: 'schedule' },
{ label: 'attribute', value: 'attribute' },
{ label: 'projectType', value: 'projectType' },
],
placeholder: '分类',
},
colProps: { span: 4 },
},
{ {
field: 'company', field: 'company',
label: '', label: '',
...@@ -48,13 +65,21 @@ export const searchForm: FormSchema[] = [ ...@@ -48,13 +65,21 @@ export const searchForm: FormSchema[] = [
colProps: { span: 4 }, colProps: { span: 4 },
}, },
]; ];
export function getBasicColumns(year: string, planType: string): BasicColumn[] { export function getBasicColumns(year: string, planType: string,groupByField:string): BasicColumn[] {
return [ return [
{ {
title: year + '年' + planType + '工程项目投资计划', title: year + '年' + planType + '工程项目投资计划',
colSpan: 6, colSpan: 6,
children: [ children: [
{ {
className: groupByField !== 'company' ? 'tableShow' : 'tableHiddle',
title: '类别',
dataIndex: 'groupByField',
width: 300,
fixed: 'left',
},
{
className: groupByField === 'company' ? 'tableShow' : 'tableHiddle',
title: '公司名称', title: '公司名称',
dataIndex: 'company', dataIndex: 'company',
fixed: 'left', fixed: 'left',
...@@ -64,6 +89,7 @@ export function getBasicColumns(year: string, planType: string): BasicColumn[] { ...@@ -64,6 +89,7 @@ export function getBasicColumns(year: string, planType: string): BasicColumn[] {
}), }),
}, },
{ {
className: groupByField === 'company' ? 'tableShow' : 'tableHiddle',
title: '项目类型', title: '项目类型',
dataIndex: 'projectType', dataIndex: 'projectType',
fixed: 'left', fixed: 'left',
......
...@@ -18,9 +18,8 @@ export default defineApplicationConfig({ ...@@ -18,9 +18,8 @@ export default defineApplicationConfig({
server: { server: {
proxy: { proxy: {
'/api': { '/api': {
// target: 'http://172.72.253.25:8088', // target: 'https://dev.unitj.cn',
target: 'https://dev.unitj.cn', target: 'http://172.72.253.84',
// target: 'http://58.223.177.48:8088',
changeOrigin: true, changeOrigin: true,
// ws: false, // ws: false,
rewrite: (path) => path.replace(new RegExp(`^/api`), ''), rewrite: (path) => path.replace(new RegExp(`^/api`), ''),
......
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