BAOLH
2026-11-10 4d730af0447c686133130d0116a0fa3dd82c2dca
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<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>