feat : 年度计划生成功能及分摊汇总导出功能

This commit is contained in:
2024-07-06 02:21:26 +08:00
parent fce1708f5c
commit 8180c248ac
11 changed files with 471 additions and 38 deletions

190
src/views/plan/detail.vue Normal file
View File

@@ -0,0 +1,190 @@
<template>
<div v-loading="loading">
<el-form :model="formData" class="query-form">
<el-row>
<el-col :span="8">
<el-form-item label="年度计划名称" prop="annualPlanName">
<!-- <el-input v-model="formData.annualPlanName" placeholder="请输入年度计划名称" clearable>-->
<!-- </el-input>-->
<span>{{ formData.annualPlanName }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间" prop="createTime">
<span>{{ formData.createTime }}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="query-btn">
<el-button color="#DED0B2" style="float: right;margin: 0 10px 10px 0" @click="exportTable">导出</el-button>
</div>
<el-table ref="table" :data="formData.projectList" border :header-cell-style="{background:'#f5f7fa'}">
<el-table-column label="四川省国有资产经营投资管理有限责任公司科技创新项目年度计划表" align="center">
<template #default="scope">
<el-table-column type="index" label="序号" align="center" width="60"/>
<el-table-column prop="projectName" label="项目名称" align="center"/>
<el-table-column prop="time" label="起始时间" align="center" min-width="120px">
<template #default="scope">
{{ scope.row.startTime + ' 至 ' + scope.row.endTime }}
</template>
</el-table-column>
<el-table-column prop="projectType" label="项目类型" align="center">
<template #default="scope">
<div v-if="scope.row.projectType !== null">
<Tag dictType="project_type" :value="scope.row.projectType"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="investmentType" label="出资类型" align="center">
<template #default="scope">
<div v-if="scope.row.investmentType !== null">
<Tag dictType="invest_type" :value="scope.row.investmentType"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="projectImpact" label="项目影响" align="center">
<template #default="scope">
<div v-if="scope.row.projectImpact !== null">
<Tag dictType="project_impact" :value="scope.row.projectImpact"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="businessSegment" label="所属业务板块" align="center">
<template #default="scope">
<div v-if="scope.row.businessSegment !== null">
<Tag dictType="business_segment" :value="scope.row.businessSegment"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="resultForm" label="预期成果形式" align="center" min-width="100px">
<template #default="scope">
<div v-if="scope.row.resultForm !== null">
<el-tag effect="plain">{{
filterDict(cacheStore.getDict('result_form'), scope.row.resultForm)
}}
</el-tag>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="technicalStandard" label="预期技术标准制定" align="center">
<template #default="scope">
<div v-if="scope.row.technicalStandard !== null">
<Tag dictType="technical_standard" :value="scope.row.technicalStandard"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="industryUniversityResearch" label="产学研联合" align="center">
<template #default="scope">
<div v-if="scope.row.industryUniversityResearch !== null">
<Tag dictType="industry_university" :value="scope.row.industryUniversityResearch"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="governmentDeclaration" label="开展政府申报" align="center">
<template #default="scope">
<div v-if="scope.row.governmentDeclaration !== null">
<Tag dictType="government_declaration" :value="scope.row.governmentDeclaration"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="intellectualProperty" label="知识产权状况" align="center">
<template #default="scope">
<div v-if="scope.row.intellectualProperty !== null">
<Tag dictType="intellectual_property" :value="scope.row.intellectualProperty"/>
</div>
<div v-else>--</div>
</template>
</el-table-column>
<el-table-column prop="intellectualProperty" label="经济概算(元)" align="center">
<template #default="scope">
<span>{{ toThousands(scope.row.economicEstimate) }}</span>
</template>
</el-table-column>
<el-table-column prop="specialFundAmount" label="专项资金(元)" align="center">
<template #default="scope">
<span>{{ toThousands(scope.row.specialFundAmount) }}</span>
</template>
</el-table-column>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup>
import {toThousands} from '@/utils/changePrice.js'
import {ElNotification} from "element-plus";
import {getPlan} from "@/api/project-demand/summary";
import {useCacheStore} from '@/stores/cache.js'
import {exportExcel} from "@/utils/export-excel";
const cacheStore = useCacheStore()
const loading = ref(false)
const formData = ref({})
const table = ref()
const route = useRoute()
const exportTable = () => {
const $e = table.value.$el
let $table = $e.querySelector('.el-table__fixed')
if (!$table) {
$table = $e
}
exportExcel($table, (5 + (Object.keys(formData.value.projectList[0]).length - 5) * 5), "四川省国有资产经营投资管理有限责任公司科技创新项目年度计划表", 2)
}
const filterDict = (data, value) => {
if (data === undefined || value === undefined) return;
let label = ''
let result = []
if (JSON.parse(value) instanceof Array) {
JSON.parse(value).forEach(item1 => {
data.find(item => {
if (item.value == item1) {
result.push(item.label)
}
})
})
label = result.map(item => item).join('')
} else {
if (data instanceof Array) {
data.find(item => {
if (item.value == value) {
label = item.label
}
})
}
}
return label
}
const getDetailInfo = () => {
loading.value = true
getPlan(route.query.annualPlanId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
formData.value = res.data
loading.value = false
}
})
}
onMounted(() => {
if (route.query.annualPlanId) {
getDetailInfo()
}
})
</script>
<style scoped>
</style>

76
src/views/plan/index.vue Normal file
View File

@@ -0,0 +1,76 @@
<template>
<!-- <fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>-->
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
</template>
<script setup lang="jsx">
const tableIns = ref()
const router = useRouter()
const route = useRoute()
const tableConfig = reactive({
columns: [
// {
// type: 'selection',
// prop: 'selection'
// },
{
prop: 'annualPlanName',
label: '年度计划名称',
align: 'center'
},
{
prop: 'createTime',
label: '创建时间',
align: 'center'
},
{
prop: 'oper',
label: '操作',
align: 'center',
fixed: 'right',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = []
btn.push({label: '详情', func: () => handleDetail(row), type: 'primary'})
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
// v-perm={item.prem}
onClick={() => item.func()}
link
>
{item.label}
</el-button>
))
}
</div>
)
}
}
],
api: '/workflow/annual/plan/list',
params: {},
})
const headBtnClick = (key) => {
switch (key) {
case 'add':
handleAdd()
break;
}
}
const handleDetail=(row)=>{
router.push({
name: 'Plan/detail',
query: {
annualPlanId: row.annualPlanId,
}
})
}
</script>
<style scoped lang="scss">
</style>