tianq 3 years ago
parent
commit
bb73a699ef
  1. 215
      src/views/modules/census/census-houseList.vue
  2. 10
      src/views/modules/census/census-nineList.vue

215
src/views/modules/census/census-houseList.vue

@ -4,11 +4,10 @@
<div class="div_search"> <div class="div_search">
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'80px'"> <el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'80px'">
<div> <div>
<el-form-item label="所属组织" prop="gridId"> <el-form-item label="所属组织" prop="orgId">
<el-cascader <el-cascader
class="customer_cascader" class="customer_cascader"
ref="myCascader" ref="myCascader"
filterable
clearable clearable
v-model="formData.orgId" v-model="formData.orgId"
:options="orgOptions" :options="orgOptions"
@ -181,7 +180,9 @@ export default {
user: {}, user: {},
gridList: [], //list-- gridList: [], //list--
tableData: [], tableData: [],
formData: {}, formData: {
orgId: ''
},
pageNo: 1, pageNo: 1,
pageSize: window.localStorage.getItem('pageSize') || 20, pageSize: window.localStorage.getItem('pageSize') || 20,
total: 1, total: 1,
@ -202,6 +203,7 @@ export default {
value: 'agencyId', value: 'agencyId',
label: 'agencyName', label: 'agencyName',
children: 'subAgencyList', children: 'subAgencyList',
emitPath: false,
checkStrictly: true checkStrictly: true
}, },
TableHeight: '', TableHeight: '',
@ -212,7 +214,9 @@ export default {
color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#F0D915', '#FEB349', '#FE6252', '#F44230', '#5DC7F0'], color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#F0D915', '#FEB349', '#FE6252', '#F44230', '#5DC7F0'],
chartData: [], chartData: [],
chartData2: [], chartData2: [],
pieData: [] pieData: [],
pieData2: [],
orgId: ''
}; };
}, },
computed: { computed: {
@ -234,16 +238,18 @@ export default {
console.log(this.$store.state); console.log(this.$store.state);
this.user = this.$store.state.user; this.user = this.$store.state.user;
this.agencyId = this.user.agencyId; this.agencyId = this.user.agencyId;
this.orgId=this.agencyId;
this.getOrgTreeList(); this.getOrgTreeList();
this.getTableData(); // this.getTableData();
this.getPie(); this.getsubData();
this.getPie2(); this.getsubData2();
}, },
methods: { methods: {
handleSearch(val) { handleSearch(val) {
console.log(this.formData);
this.pageNo = 1; this.pageNo = 1;
this.getTableData(); this.getTableData();
this.getsubData();
this.getsubData2();
}, },
async getTableData() { async getTableData() {
this.tableLoading = true; this.tableLoading = true;
@ -280,20 +286,33 @@ export default {
}, },
async getsubData() { async getsubData() {
this.$refs.pieChart.showLoading(); this.$refs.pieChart.showLoading();
let url = '/gov/org/staffLoginLog/sub-count'; let url = '/gov/org/ichouse/getHousePurposeCount';
let param = { let param = {
orgId: this.formData.orgId, orgIdPath: this.orgId,
level: this.formData.level, timeStart: this.formData.startDate,
startDate: this.formData.startDate, timeEnd: this.formData.endDate
endDate: this.formData.endDate
}; };
const { data, code, msg } = await requestPost(url, param); const { data, code, msg } = await requestPost(url, param);
this.$refs.pieChart.hideLoading(); this.$refs.pieChart.hideLoading();
if (code === 0) { if (code === 0) {
this.pieData = data.list; this.pieData = data.list;
console.log('this.pieData ', this.pieData);
this.getPie(); this.getPie();
} else {
this.$message.error(msg);
}
},
async getsubData2() {
this.$refs.pieChart2.showLoading();
let url = '/gov/org/ichouse/getHouseStatusCount';
let param = {
orgIdPath: this.orgId,
timeStart: this.formData.startDate,
timeEnd: this.formData.endDate
};
const { data, code, msg } = await requestPost(url, param);
this.$refs.pieChart2.hideLoading();
if (code === 0) {
this.pieData2 = data.list;
this.getPie2(); this.getPie2();
} else { } else {
this.$message.error(msg); this.$message.error(msg);
@ -303,9 +322,7 @@ export default {
this.pieInitState = true; this.pieInitState = true;
}, },
pieInitOk2() { pieInitOk2() {
console.log('2333erwewrwe33333', this.pieInitState2);
this.pieInitState2 = true; this.pieInitState2 = true;
console.log('2333erwewrwe333335476754765', this.pieInitState2);
}, },
getPie() { getPie() {
if (this.pieInitState) { if (this.pieInitState) {
@ -318,7 +335,6 @@ export default {
}, },
getPie2() { getPie2() {
if (this.pieInitState2) { if (this.pieInitState2) {
console.log('233333333');
this.setPieData2(); this.setPieData2();
} else { } else {
setTimeout(() => { setTimeout(() => {
@ -327,45 +343,51 @@ export default {
} }
}, },
setPieData() { setPieData() {
// let data = [...this.pieData]; let data = [...this.pieData.list];
// console.log('data', data); this.chartData.name = data.map(item => item.type);
let chartData = { this.chartData.data = data.map(item => {
name: ['反骨', '反骨2', '反骨3', '反骨4'], return {
data: [{ value: 62, name: '反骨' }, { value: 44, name: '反骨2' }, { value: 123, name: '反骨3' }, { value: 232, name: '反骨4' }] value: item.count,
}; name: item.type,
this.chartData = chartData; radio: item.count == 0 ? '0' : ((item.count / this.pieData.total) * 100).toFixed(2)
// chartData.name = data.map(item => item.agencyName); };
// chartData.data = data.map(item => { });
// return { value: item.count, id: item.agencyId, level: item.agencyLevel, name: item.agencyName };
// }); console.log('chartData', this.chartData);
console.log('chartData', chartData); this.iniPieChart(this.chartData);
this.iniPieChart(chartData);
}, },
setPieData2() { setPieData2() {
console.log('dddddddddddd'); let data = [...this.pieData2.list];
// let data = [...this.pieData]; this.chartData2.name = data.map(item => item.type);
// console.log('data', data); this.chartData2.data = data.map(item => {
let chartData = { return {
name: ['自住', '出租', '闲置', '未售出'], value: item.count,
data: [{ value: 62, name: '自住' }, { value: 243, name: '出租' }, { value: 243, name: '闲置' }, { value: 243, name: '未售出' }] name: item.type,
}; radio: item.count == 0 ? '0' : ((item.count / this.pieData2.total) * 100).toFixed(2)
this.chartData2 = chartData; };
// chartData.name = data.map(item => item.agencyName); });
// chartData.data = data.map(item => {
// return { value: item.count, id: item.agencyId, level: item.agencyLevel, name: item.agencyName }; console.log('chartData', this.chartData2);
// }); this.iniPieChart(this.chartData2);
console.log('chartData', chartData);
this.iniPieChart2(chartData);
}, },
// //
async iniPieChart(chartData) { async iniPieChart(chartData) {
this.$refs.pieChart.clear(); this.$refs.pieChart.clear();
// pieChart // pieChart
this.pieOption = { this.pieOption = {
tooltip: {
trigger: 'item',
formatter: '{b}<br/>总数 : {c}<br/> 占比 : {d}%',
backgroundColor: 'rgb(134,134,134)',
borderColor: 'rgb(134,134,134)',
textStyle: {
color: '#fff'
}
},
color: this.color, color: this.color,
title: { title: {
text: '12345', text: this.pieData.total,
subtext: '房屋总数(分)', subtext: '总数',
x: 'center', x: 'center',
y: 'center', y: 'center',
textStyle: { textStyle: {
@ -382,7 +404,21 @@ export default {
series: [ series: [
{ {
type: 'pie', type: 'pie',
radius: ['60%', '85%'], radius: ['65%', '80%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
tooltip: {
show: true
},
data: chartData.data
},
{
type: 'pie',
radius: ['60%', '65%'],
center: ['50%', '50%'], center: ['50%', '50%'],
selectedMode: false, selectedMode: false,
hoverAnimation: false, hoverAnimation: false,
@ -407,19 +443,32 @@ export default {
} }
} }
}, },
{ {
type: 'pie', type: 'pie',
radius: ['65%', '80%'], radius: ['80%', '85%'],
avoidLabelOverlap: false, center: ['50%', '50%'],
selectedMode: false,
hoverAnimation: false,
data: [{ value: 1, name: '' }],
itemStyle: {
color: '#f7f7f7'
},
label: { label: {
show: false, show: false
position: 'center' },
labelLine: {
show: false
}, },
tooltip: { tooltip: {
show: true show: false
}, },
data: chartData.data animation: false,
cursor: 'auto',
emphasis: {
itemStyle: {
color: '#f7f7f7'
}
}
} }
] ]
}; };
@ -430,10 +479,19 @@ export default {
// pieChart // pieChart
this.pieOption2 = { this.pieOption2 = {
tooltip: {
trigger: 'item',
formatter: '{b}<br/>总数 : {c}<br/> 占比 : {d}%',
backgroundColor: 'rgb(134,134,134)',
borderColor: 'rgb(134,134,134)',
textStyle: {
color: '#fff'
}
},
color: this.color, color: this.color,
title: { title: {
text: '12345', text: this.pieData.total,
subtext: '房屋总数(分)', subtext: '总数',
x: 'center', x: 'center',
y: 'center', y: 'center',
textStyle: { textStyle: {
@ -459,12 +517,39 @@ export default {
tooltip: { tooltip: {
show: true show: true
}, },
z: 9999,
data: chartData.data data: chartData.data
}, },
{ {
type: 'pie', type: 'pie',
radius: ['60%', '85%'], radius: ['60%', '65%'],
center: ['50%', '50%'],
selectedMode: false,
hoverAnimation: false,
data: [{ value: 1, name: '' }],
itemStyle: {
color: '#f7f7f7'
},
label: {
show: false
},
labelLine: {
show: false
},
tooltip: {
show: false
},
animation: false,
cursor: 'auto',
emphasis: {
itemStyle: {
color: '#f7f7f7'
}
}
},
{
type: 'pie',
radius: ['80%', '85%'],
center: ['50%', '50%'], center: ['50%', '50%'],
selectedMode: false, selectedMode: false,
hoverAnimation: false, hoverAnimation: false,
@ -577,9 +662,13 @@ export default {
}, },
handleChangeAgency(val) { handleChangeAgency(val) {
let obj = this.$refs['myCascader'].getCheckedNodes()[0].data; let obj = this.$refs['myCascader'].getCheckedNodes()[0].data;
console.log(obj);
this.formData.orgId = obj.agencyId; let tmp = this.formData.orgId;
this.formData.level = obj.level; if (!tmp && typeof tmp != 'undefined' && tmp != 0 && tmp != null) {
this.orgId = this.formData.orgId;
} else {
this.orgId = this.agencyId;
}
}, },
deepTree(arr) { deepTree(arr) {
if (Array.isArray(arr)) { if (Array.isArray(arr)) {
@ -690,7 +779,7 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
margin-bottom:0px; margin-bottom: 0px;
margin-top: 0px; margin-top: 0px;
.census_searchcensus_box { .census_searchcensus_box {
align-items: flex-end; align-items: flex-end;

10
src/views/modules/census/census-nineList.vue

@ -456,7 +456,15 @@ export default {
async handleExport() { async handleExport() {
const url = '/gov/org/enterprise/export'; const url = '/gov/org/enterprise/export';
const { pageSize, pageNo, formData } = this;
const { pageSize, pageNo } = this;
let tmp = this.formData.orgId;
if (!tmp && typeof tmp != 'undefined' && tmp != 0) {
this.formData.orgId = '';
this.orgType = '';
}
axios({ axios({
url: window.SITE_CONFIG['apiURL'] + url, url: window.SITE_CONFIG['apiURL'] + url,
method: 'post', method: 'post',

Loading…
Cancel
Save