index.vue
5.36 KB
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<template>
<div class="content-layout">
<el-form :model="queryForm" inline v-form>
<ht-form-item label="所属企业">
<ht-org-selector-input
v-model="queryForm.orgname"
display-style="block"
:config="{ id: 'queryForm.orgId' }"
append-to-body
></ht-org-selector-input>
</ht-form-item>
<el-form-item label="所属划区">
<el-select v-model="queryForm.ssqhs" multiple collapse-tags placeholder="请选择">
<el-option
v-for="item in hqOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="租赁形式">
<el-select v-model="queryForm.zlxs" clearable placeholder="请选择">
<el-option
v-for="item in zlOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="统计指标">
<el-select v-model="queryForm.code" placeholder="请选择">
<el-option
v-for="item in tjzbOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="handleSearch">统计</el-button>
<el-button icon="el-icon-refresh-left" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<div class="chartContiner">
<PieChart chart-id="chartOne" v-if="!showOne" :data="chartDataOne" class="pieBox" :tiplabel="'合同数'" :title="'合同数'" :unit="'份'"></PieChart>
<PieChart chart-id="chartTwo" :data="chartDataTwo" class="pieBox" :title="'面积数'" :tiplabel="'租赁面积'"></PieChart>
</div>
</div>
</template>
<script>
import PieChart from "@/views/components/PieChart.vue";
import {getfctjList, getqhList, getzlList, getzltjList} from "@/api/tongjiInfo";
export default {
components: {
PieChart
},
data() {
return {
queryForm: {
orgId: '',
orgname: '',
ssqhs: [],
zlxs: '',
code: ''
},
qyOptions: [],
hqOptions: [],
zlOptions: [
{label: '新租', value: '新租'},
{label: '续租', value: '续租'},
{label: '终止', value: '终止'},
],
tjzbOptions: [],
chartDataOne: [],
chartDataTwo: [],
showOne: false,
}
},
created() {
this.resetForm()
},
async mounted() {
await this.fentchData()
this.getChartData()
},
methods: {
async fentchData() {
await this.getqhOptions()
await this.getZdtjzbOptions()
},
//宗地统计指标下拉
async getZdtjzbOptions() {
await getzltjList([]).then(res => {
this.tjzbOptions = res.rows && res.rows.length > 0 ? res.rows.map(item => {
return {
label: item.VALUE,
value: item.CODE
}
}) : []
if (this.tjzbOptions.length > 0) {
this.queryForm.code = this.tjzbOptions[0].value
}
})
},
resetForm() {
this.queryForm = {
orgId: '',
orgname: '',
ssqhs: [],
zlxs: '',
code: this.tjzbOptions.length > 0 ? this.tjzbOptions[0].value : ''
}
},
//获取所属区划
getqhOptions() {
let postData = {
pageBean: {page: 1, pageSize: 999, showTotal: true, total: 0}
}
getqhList(postData).then(res => {
this.hqOptions = res.rows && res.rows.length > 0 ? res.rows.map(item => {
return {
label: item.value,
value: item.code
}
}) : []
})
},
async getChartData() {
let querydata = {}
if (this.queryForm.orgId) {
querydata.qyids = this.queryForm.orgId
}
if (this.queryForm.ssqhs.length > 0) {
querydata.ssqhs = this.queryForm.ssqhs.join(',')
}
if (this.queryForm.zlxs) {
querydata.zlxs = this.queryForm.zlxs
}
if (this.queryForm.code) {
querydata.code = this.queryForm.code
}
await getzlList(querydata).then(res => {
if (this.queryForm.code == 'dqqk') {
this.showOne = true
} else {
this.showOne = false
}
this.chartDataOne = res.list['合同数'] || []
this.chartDataTwo = res.list['面积数'] || []
}).catch((e) => {
console.log("e",e)
}).finally(() => {
})
},
//统计
handleSearch(){
this.getChartData()
},
//重置
handleReset(){
this.resetForm()
this.getChartData()
},
}
}
</script>
<style lang="scss" scoped>
@mixin background-color {
background-color: $base-color-white;
}
.content-layout {
height: 100%;
//overflow-y: auto;
position: relative;
box-sizing: border-box;
padding: 16px;
@include background-color;
overflow-x: hidden;
}
.chartContiner {
width: 100%;
height: calc(100% - 80px);
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
overflow-y: auto;
}
.pieBox {
width: 49%;
height: 100%;
}
.charttile {
text-align: center;
height: 40px;
line-height: 40px;
font-size: 18px;
font-weight: 500;
}
</style>