<template>
|
<div class="dashboard-container">
|
<div class="dashboard-editor-container">
|
<el-row :gutter="32">
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper">
|
<div class="wrapper-div">
|
<el-date-picker v-model="stTargetYear" type="year" clearable placeholder="目标年度" style="width: 185px;" @change="stTargetYearChange" />
|
</div>
|
<subgroup-turnover :key="stRandom" :target-year="stParameter" />
|
</div>
|
</el-col>
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper" />
|
</el-col>
|
</el-row>
|
<el-row :gutter="32">
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper">
|
<div class="wrapper-div">
|
<div style="height: 32px;" />
|
</div>
|
<type-contract-price :key="tcpwhRandom" :project-distinguish="tcpwhParameterProjectDistinguish" :target-year="tcpwhParameterTargetYear" />
|
</div>
|
</el-col>
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper">
|
<div class="wrapper-div">
|
<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-date-picker v-model="tcpwhTargetYear" type="year" clearable placeholder="目标年度" style="width: 185px;" @change="tcpwhProjectDistinguishOrTargetYearChange" />
|
</div>
|
<type-working-hours :key="tcpwhRandom" :project-distinguish="tcpwhParameterProjectDistinguish" :target-year="tcpwhParameterTargetYear" />
|
</div>
|
</el-col>
|
</el-row>
|
<el-row :gutter="32">
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper">
|
<div class="wrapper-div">
|
<div style="height: 32px;" />
|
</div>
|
<subgroup-working-hours />
|
</div>
|
</el-col>
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper" />
|
</el-col>
|
</el-row>
|
<el-row :gutter="32">
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper">
|
<div class="wrapper-div">
|
<el-select v-model="sthProjectDistinguish" filterable clearable placeholder="项目区分" style="width: 185px;" @change="sthProjectDistinguishChange">
|
<el-option
|
v-for="item in projectDistinguishList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</div>
|
<subgroup-top-hours :key="sthRandom" :project-distinguish="sthParameterProjectDistinguish" />
|
</div>
|
</el-col>
|
<el-col :xs="24" :sm="24" :lg="12">
|
<div class="chart-wrapper">
|
<div class="wrapper-div">
|
<el-select v-model="pwhProjectId" filterable clearable placeholder="目标项目" style="width: 185px;" @change="pwhProjectIdChange">
|
<el-option
|
v-for="item in projectList"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
/>
|
</el-select>
|
</div>
|
<project-working-hours :key="pwhRandom" :project-id="pwhParameter" />
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import constant from '../../utils/constant'
|
import crudProject from '@/api/project/project'
|
import { getDictMap } from '@/api/system/dictDetail'
|
import SubgroupTurnover from './chart/subgroupTurnover.vue'
|
import SubgroupWorkingHours from './chart/subgroupWorkingHours.vue'
|
import ProjectWorkingHours from './chart/projectWorkingHours.vue'
|
import TypeContractPrice from './chart/typeContractPrice.vue'
|
import TypeWorkingHours from './chart/typeWorkingHours.vue'
|
import SubgroupTopHours from './chart/subgroupTopHours.vue'
|
|
export default {
|
name: 'ProjectChart',
|
components: { SubgroupTurnover, SubgroupWorkingHours, ProjectWorkingHours, TypeContractPrice, TypeWorkingHours, SubgroupTopHours },
|
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>
|