<template>
|
<div class="app-container">
|
<!--工具栏-->
|
<div class="head-container">
|
<el-card class="box-card" style="margin-bottom: 5px;">
|
<!-- 搜索 -->
|
<el-date-picker v-model="stTargetYear" type="year" clearable placeholder="目标年度" style="width: 185px;" @change="stTargetYearChange" />
|
<el-select v-model="tcpwhProjectDistinguish" filterable clearable placeholder="项目区分" style="width: 185px;" @change="tcpwhProjectDistinguishOrTargetYearChange">
|
<el-option
|
v-for="item in projectDistinguishList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</el-card>
|
<el-card class="box-card">
|
<ProjectCost :key="stRandom" :targetYear="stParameter" :projectType="tcpwhProjectDistinguish"></ProjectCost>
|
</el-card>
|
<el-card class="box-card">
|
<subgroupTurnover :key="stRandom" :targetYear="stParameter"></subgroupTurnover>
|
</el-card>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import constant from '../../../utils/constant'
|
import crudProject from '@/api/project/project'
|
import { getDictMap } from '@/api/system/dictDetail'
|
import ProjectCost from './chart/projectCost.vue'
|
import subgroupTurnover from '../chart/subgroupTurnover.vue'
|
|
export default {
|
name: 'ProjectBoard',
|
components: { ProjectCost, subgroupTurnover },
|
data() {
|
return {
|
// 项目列表
|
projectList: [],
|
// 项目区分列表
|
projectDistinguishList: [],
|
// 分组营业额:目标年度
|
stTargetYear: new Date(),
|
// 分组营业额:随机数
|
stRandom: 0,
|
// 分组营业额:传参
|
stParameter: new Date().getFullYear().toString(),
|
// 项目工时:目标项目
|
pwhProjectId: null,
|
// 项目工时:随机数
|
pwhRandom: 0,
|
// 项目工时:传参
|
pwhParameter: null,
|
// 类型合同额、分组工时:项目区分
|
tcpwhProjectDistinguish: null,
|
// 类型合同额、分组工时:目标年度
|
tcpwhTargetYear: new Date(),
|
// 类型合同额、分组工时:随机数
|
tcpwhRandom: 0,
|
// 类型合同额、分组工时:传参
|
tcpwhParameterProjectDistinguish: null,
|
tcpwhParameterTargetYear: new Date().getFullYear().toString(),
|
// 分组排名工时:项目区分
|
sthProjectDistinguish: null,
|
// 分组排名工时:随机数
|
sthRandom: 0,
|
// 分组排名工时:传参
|
sthParameterProjectDistinguish: null
|
}
|
},
|
created() {
|
// // 获取项目
|
// this.getProject()
|
// 获取字典
|
this.getDictDetail()
|
},
|
methods: {
|
// 获取项目
|
getProject() {
|
crudProject.getAll({ projectStatus: constant.PROJECT_STATUS_UNDER_WAY }).then(res => {
|
// 项目列表
|
this.projectList = res
|
// 项目工时:目标项目
|
this.pwhProjectId = res[0].id
|
// 项目工时:传参
|
this.pwhParameter = res[0].id.toString()
|
// 项目工时:随机数
|
this.pwhRandom = Math.random()
|
})
|
},
|
// 获取字典
|
getDictDetail() {
|
getDictMap(constant.PROJECT_DISTINGUISH).then(res => {
|
// 项目区分列表
|
this.projectDistinguishList = res[constant.PROJECT_DISTINGUISH]
|
// 类型合同额、分组工时:目标年度
|
this.tcpwhProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value
|
// 类型合同额、分组工时:传参
|
this.tcpwhParameterProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value.toString()
|
// 类型合同额、分组工时:随机数
|
this.tcpwhRandom = Math.random()
|
// 分组排名工时:项目区分
|
this.sthProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value
|
// 分组排名工时:传参
|
this.sthParameterProjectDistinguish = res[constant.PROJECT_DISTINGUISH][0].value.toString()
|
// 分组排名工时:随机数
|
this.sthRandom = Math.random()
|
})
|
},
|
// 分组营业额:目标年度变更
|
stTargetYearChange() {
|
// 分组营业额:传参
|
this.stParameter = this.stTargetYear.getFullYear().toString()
|
// 分组营业额:随机数
|
this.stRandom = Math.random()
|
},
|
// 项目工时:目标项目变更
|
pwhProjectIdChange() {
|
// 项目工时:传参
|
this.pwhParameter = this.pwhProjectId.toString()
|
// 项目工时:随机数
|
this.pwhRandom = Math.random()
|
},
|
// 类型合同额、分组工时:项目区分/目标年度变更
|
tcpwhProjectDistinguishOrTargetYearChange() {
|
// 类型合同额、分组工时:传参
|
this.tcpwhParameterProjectDistinguish = this.tcpwhProjectDistinguish.toString()
|
this.tcpwhParameterTargetYear = this.tcpwhTargetYear.getFullYear().toString()
|
// 类型合同额、分组工时:随机数
|
this.tcpwhRandom = Math.random()
|
},
|
// 分组排名工时:项目区分变更
|
sthProjectDistinguishChange() {
|
// 分组排名工时:传参
|
this.sthParameterProjectDistinguish = this.sthProjectDistinguish.toString()
|
// 分组排名工时:随机数
|
this.sthRandom = Math.random()
|
}
|
}
|
}
|
</script>
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
.dashboard-editor-container {
|
padding: 32px;
|
position: relative;
|
|
.github-corner {
|
position: absolute;
|
top: 0;
|
border: 0;
|
right: 0;
|
}
|
|
.search-wrapper {
|
text-align: right;
|
}
|
|
.chart-wrapper {
|
background: #fff;
|
padding: 16px 16px 0;
|
margin-bottom: 32px;
|
overflow: auto;
|
|
.wrapper-div {
|
text-align: right;
|
margin: 0px 15px 15px 15px ;
|
}
|
}
|
}
|
|
@media (max-width:1024px) {
|
.chart-wrapper {
|
padding: 8px;
|
}
|
}
|
</style>
|