Commit aa243f73 authored by xingyuji's avatar xingyuji

Merge branch 'develop' into 'master'

fix: 导出字段问题;产品类型选择框无值的问题;表格字体换行问题;供应套数总为0的问题

修复四个主要问题
fix: 导出字段问题;产品类型选择框无值的问题;表格字体换行问题;供应套数总为0的问题

See merge request !12
parents 98001018 2dadbb4f
...@@ -8,7 +8,7 @@ export function plateAnalysis(data) { ...@@ -8,7 +8,7 @@ export function plateAnalysis(data) {
export function plateAnalysisHouseImg(data) { export function plateAnalysisHouseImg(data) {
return xhr.post('/bnsproject/bns-project/withProjectAndProduct/getRegionProductImg', data) return xhr.post('/bnsproject/bns-project/withProjectAndProduct/getRegionProductImg', data)
} }
// 导出数据 // 获取导出数据结构
export function exportExcelJson(data) { export function exportExcelJson(data) {
return xhr.post('/bnsproject/bns-project/withProjectAndProduct/getRegionProductJson', data) return xhr.post('/bnsproject/bns-project/withProjectAndProduct/getRegionProductJson', data)
} }
...@@ -18,3 +18,7 @@ export function queryProductionType(type) { ...@@ -18,3 +18,7 @@ export function queryProductionType(type) {
type type
}) })
} }
// 导出
export function exportAsExcel(data) {
return xhr.downloadFile('/bnsregion/bns-region/downloadCP',data)
}
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
import { demoData } from "./tableHeader"; import { demoData } from "./tableHeader";
import { getRegionPlate } from "../../assets/js/api/plateSupplyManage"; import { getRegionPlate } from "../../assets/js/api/plateSupplyManage";
import { unitArea } from "./unitArea"; import { unitArea } from "./unitArea";
import {plateAnalysis, queryProductionType, exportExcelJson} from "../../assets/js/api/projectManage"; import {plateAnalysis, queryProductionType, exportExcelJson, exportAsExcel} from "../../assets/js/api/projectManage";
export default { export default {
name: "ProductAnalysis", name: "ProductAnalysis",
...@@ -169,16 +169,15 @@ ...@@ -169,16 +169,15 @@
} }
}, },
histogramData: { histogramData: {
columns: ['roomInfo'], columns: [],
rows: [ rows: [
{ 'roomInfo': '南向面宽' }
] ]
}, },
map: { map: {
'nxmk': '南向面宽', 'nxmkAvg': '南向面宽',
'qjsmk': '起居室面宽', 'qjsmkAvg': '起居室面宽',
'zwmk': '主卧面宽', 'zwmkAvg': '主卧面宽',
'kwmk': '客卧面宽' 'kwmkAvg': '客卧面宽'
}, // 房屋数据 map匹配 }, // 房屋数据 map匹配
histogramTableData: [], histogramTableData: [],
chartSettings : { chartSettings : {
...@@ -190,30 +189,63 @@ ...@@ -190,30 +189,63 @@
type: 'bar', type: 'bar',
barWidth: 30 barWidth: 30
} }
}, }, //柱状图设置柱的宽度
regionOptions: [], regionOptions: [], // 区域数据
regionVal: '', regionVal: '', //区域id绑定
plateOptions: [], plateOptions: [], // 板块数据
plateVal: '', plateVal: '', // 板块值绑定
timeOptions: [], timeOptions: [], // 年份数据
timeVal: '', timeVal: '', //年份下拉框绑定
houseTypeOptions: [], houseTypeOptions: [], // 产品类型下拉框数据
houseTypeVal: '', houseTypeVal: '', // 产品类型下拉框绑定
areaInterval: '0-70', areaInterval: '0-70', // 面积区间 下拉框取值
areaIntervalData: unitArea, areaIntervalData: unitArea, // 面积区间-固定数据
showMode: 0, showMode: 0, // 板块产品分析-显示户型还是分析
colorsArr: colors, colorsArr: colors, // 图表颜色风格
headerTable: tableHeader, headerTable: tableHeader, // 多级表头-表头数据
plateMap: { plateMap: {
// 格式为 regionId: plateData 即区域Id所对应的下属板块数据
}, },
exportLoading: false exportLoading: false, // 导出lodaing
exportExcelSave: null // 保存的excel表格数据
} }
}, },
methods: { methods: {
// 导出板块产品分析-图表数据
exportPlateAnalysis () { exportPlateAnalysis () {
if(this.exportExcelSave) {
this.exportLoading = true
exportAsExcel({
title: this.exportExcelSave.title,
dataJsonTwo: JSON.stringify(this.exportExcelSave.detilProductJsonDtoList)
}).then(res => {
if(res) {
const url = window.URL.createObjectURL(new Blob([res], { type: 'application/vnd.ms-excel;charset=utf-8' }))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', this.exportExcelSave.title.replace(/;/g, '-')) // 自定义下载文件名
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
this.$message({
type: 'success',
message: '导出完成'
})
this.exportLoading = false
} else {
this.$message({
type: 'warning',
message: '无结果'
})
this.exportLoading = false
}
}).catch(() => {
this.exportLoading = false
})
}
}, },
// 区域变化后 根据区域map匹配对应的下属板块
changePlateForRegion (region) { changePlateForRegion (region) {
this.plateVal = '' this.plateVal = ''
if(this.plateMap[region] && this.plateMap[region].length > 0) { if(this.plateMap[region] && this.plateMap[region].length > 0) {
...@@ -222,6 +254,7 @@ ...@@ -222,6 +254,7 @@
this.plateOptions = [] this.plateOptions = []
} }
}, },
// 根据下拉框的值 筛选图表数据
getPlateAnalysisData() { getPlateAnalysisData() {
let temp = { let temp = {
adminRegion: this.regionVal, adminRegion: this.regionVal,
...@@ -239,9 +272,12 @@ ...@@ -239,9 +272,12 @@
// 处理 面宽数据 格式: { roomInfo: '南向面宽', '产品1': num, '产品2': num2 } // 处理 面宽数据 格式: { roomInfo: '南向面宽', '产品1': num, '产品2': num2 }
let histomData = [] let histomData = []
let colum = ['roomInfo'] let colum = ['roomInfo']
if(res.data.barDetilDtoList && res.data.barDetilDtoList.length > 0) {
Object.keys(this.map).forEach(key => { Object.keys(this.map).forEach(key => {
// 单条数据预备对象
let singleData = {} let singleData = {}
res.data.barDetilDtoList.forEach(item => { res.data.barDetilDtoList.forEach(item => {
// 将产品名称加入到
if(colum.length - 1 !== res.data.barDetilDtoList.length) { if(colum.length - 1 !== res.data.barDetilDtoList.length) {
colum.push(item.production) colum.push(item.production)
} }
...@@ -252,11 +288,17 @@ ...@@ -252,11 +288,17 @@
}) })
histomData.push(singleData) histomData.push(singleData)
}) })
}
this.histogramData.columns = colum this.histogramData.columns = colum
this.histogramData.rows = histomData this.histogramData.rows = histomData
console.log(this.histogramData)
}) })
exportExcelJson(temp).then(res => { exportExcelJson(temp).then(res => {
console.log(res) try {
this.exportExcelSave = JSON.parse(res.data)
} catch (e) {
this.exportExcelSave = null
}
}) })
}, },
getRegionAndPlate(callback) { getRegionAndPlate(callback) {
...@@ -282,7 +324,7 @@ ...@@ -282,7 +324,7 @@
if(!this.plateMap[item.adminRegionId]) { if(!this.plateMap[item.adminRegionId]) {
this.plateMap[item.adminRegionId] = item.resultRegionDTOS this.plateMap[item.adminRegionId] = item.resultRegionDTOS
} }
if(item.resultRegionDTOS && item.resultRegionDTOS.length > 0) { if(item.resultRegionDTOS && item.resultRegionDTOS.length > 0 && !this.regionVal && !this.plateVal) {
this.plateOptions = item.resultRegionDTOS this.plateOptions = item.resultRegionDTOS
this.regionVal = item.adminRegionId this.regionVal = item.adminRegionId
this.plateVal = item.resultRegionDTOS[0].regionId this.plateVal = item.resultRegionDTOS[0].regionId
...@@ -290,19 +332,28 @@ ...@@ -290,19 +332,28 @@
} }
}) })
} }
callback && callback() if(callback) {
callback()
}
}) })
}, },
getProductType (callback) { getProductType (callback) {
queryProductionType('product_Type').then(res => { queryProductionType('product_Type').then(res => {
console.log(res)
this.houseTypeOptions = res.data this.houseTypeOptions = res.data
try { const plateAnalysisQuery = sessionStorage.getItem('plateAnalysisQuery')
const product_type = JSON.parse(sessionStorage.getItem('plateAnalysisQuery')).productType if(plateAnalysisQuery) {
this.houseTypeVal = product_type || res.data[0].businessId const product_type = JSON.parse(plateAnalysisQuery).productType
} catch (e) { if(product_type) {
this.houseTypeVal = '' this.houseTypeVal = product_type
} else {
this.houseTypeVal = res.data[0] ? res.data[0].businessId : ''
}
} else {
this.houseTypeVal = res.data[0] ? res.data[0].businessId : ''
} }
callback && callback() console.log(this.houseTypeVal)
callback()
}) })
} }
}, },
...@@ -376,6 +427,7 @@ ...@@ -376,6 +427,7 @@
border-color: #d1ccc0; border-color: #d1ccc0;
background-color: #dedede; background-color: #dedede;
text-align center text-align center
white-space nowrap
} }
table.table td { table.table td {
border-width: 1px; border-width: 1px;
...@@ -384,6 +436,7 @@ ...@@ -384,6 +436,7 @@
border-color: #d1ccc0; border-color: #d1ccc0;
background-color: #ffffff; background-color: #ffffff;
text-align center text-align center
white-space nowrap
} }
} }
.supplyAnalysisTable{ .supplyAnalysisTable{
......
...@@ -112,17 +112,17 @@ ...@@ -112,17 +112,17 @@
<el-collapse v-model="soildInfoChange" class="sys-collapse"> <el-collapse v-model="soildInfoChange" class="sys-collapse">
<el-card :body-style="{padding: '0'}" class="box-card" v-for="(item,index) in dataType.plateRegion.resultBnsLandDTOS" :key="index"> <el-card :body-style="{padding: '0'}" class="box-card" v-for="(item,index) in dataType.plateRegion.resultBnsLandDTOS" :key="index">
<el-collapse-item :title="item.name" :name="index"> <el-collapse-item :title="item.name" :name="index">
<p>行政分区:{{dataType.plateRegion.adminRegionName}}</p> <p>行政分区:{{dataType.plateRegion.adminRegionName || '--'}}</p>
<p>所属板块: {{dataType.plateRegion.name}}</p> <p>所属板块: {{dataType.plateRegion.name || '--'}}</p>
<p>土地面积:{{item.landArea}}m<sup>2</sup></p> <p>土地面积:{{item.landArea || '--'}}m<sup>2</sup></p>
<p>容积率:{{item.plotRatio}}%</p> <p>容积率:{{item.plotRatio || '--'}}%</p>
<p>建筑面积:{{item.builtArea}}m<sup>2</sup></p> <p>建筑面积:{{item.builtArea || '--'}}m<sup>2</sup></p>
<p>建筑密度:{{item.builtDensity}}%</p> <p>建筑密度:{{item.builtDensity || '--'}}%</p>
<p>楼面价:{{item.floorPrice}}/m<sup>2</sup></p> <p>楼面价:{{item.floorPrice || '--'}}/m<sup>2</sup></p>
<p>成交日期:{{item.dealDate}}</p> <p>成交日期:{{item.dealDate || '--'}}</p>
<p>成交价:{{item.dealPrice}}亿元</p> <p>成交价:{{item.dealPrice || '--'}}亿元</p>
<p>溢价率:{{item.premium}}%</p> <p>溢价率:{{item.premium || '--'}}%</p>
<p>受让方:{{item.assignee}}</p> <p>受让方:{{item.assignee || '--'}}</p>
</el-collapse-item> </el-collapse-item>
</el-card> </el-card>
</el-collapse> </el-collapse>
...@@ -134,12 +134,12 @@ ...@@ -134,12 +134,12 @@
</div> </div>
<div class="infomationContainer"> <div class="infomationContainer">
<div class="propertyListName" style="color: #1482f0" @click="toPropertyDetail(item.businessId)">{{item.name}}</div> <div class="propertyListName" style="color: #1482f0" @click="toPropertyDetail(item.businessId)">{{item.name}}</div>
<p>价格:{{item.price}}/m<sup>2</sup></p> <p>价格:{{item.price || '--'}}/m<sup>2</sup></p>
<p>产品类型: {{item.productType}}</p> <p>产品类型: {{item.productType || '--'}}</p>
<p>占地面积:{{item.landArea}}<sup>2</sup></p> <p>占地面积:{{item.landArea || '--'}}<sup>2</sup></p>
<p>建筑面积:{{item.totalArea}}<sup>2</sup></p> <p>建筑面积:{{item.totalArea || '--'}}<sup>2</sup></p>
<p>容积率:{{item.plotRatio}}</p> <p>容积率:{{item.plotRatio || '--'}}</p>
<p>开盘时间:{{item.openTime}}</p> <p>开盘时间:{{item.openTime || '--'}}</p>
</div> </div>
</el-card> </el-card>
</div> </div>
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
<p class="propertyDetail" <p class="propertyDetail"
v-for="(val, key, index) in propertyDetailDataMap" v-for="(val, key, index) in propertyDetailDataMap"
:key="index" :key="index"
v-html="val.name + ':' + (propertyDetailData[key] || '---') + val.defaultSetting"> v-html="val.name + ':' + (propertyDetailData[key] || '--') + val.defaultSetting">
</p> </p>
</div> </div>
</div> </div>
......
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
const link = document.createElement('a') const link = document.createElement('a')
link.style.display = 'none' link.style.display = 'none'
link.href = url link.href = url
link.setAttribute('download', `${this.regionVal}${this.plateVal}板块${this.timeVal}年份供求信息`) // 自定义下载文件名 link.setAttribute('download', `${this.regionVal}-${this.plateVal}-${this.timeVal}年份供求信息`) // 自定义下载文件名
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
document.body.removeChild(link) document.body.removeChild(link)
...@@ -201,11 +201,11 @@ ...@@ -201,11 +201,11 @@
}) })
areaRange.push(areaRangeMap[key]) areaRange.push(areaRangeMap[key])
rate.push(res.data[key] ? (res.data[key].rate || 0) : 0) rate.push(res.data[key] ? (res.data[key].rate || 0) : 0)
supplyNumber.push(res.data[key] ? (res.data[key].supplyNumber || 0) : 0) supplyNumber.push(res.data[key] ? (res.data[key].suplyNumber || 0) : 0)
dealNumber.push(res.data[key] ? (res.data[key].dealNumber || 0) : 0) dealNumber.push(res.data[key] ? (res.data[key].dealNumber || 0) : 0)
exportList.push({ exportList.push({
areaRange: areaRangeMap[key], areaRange: areaRangeMap[key],
supplyNumber: res.data[key] ? (res.data[key].supplyNumber || 0) : 0, supplyNumber: res.data[key] ? (res.data[key].suplyNumber || 0) : 0,
dealNumber: res.data[key] ? (res.data[key].dealNumber || 0) : 0 dealNumber: res.data[key] ? (res.data[key].dealNumber || 0) : 0
}) })
}) })
...@@ -318,6 +318,7 @@ ...@@ -318,6 +318,7 @@
border-color: #d1ccc0; border-color: #d1ccc0;
background-color: #dedede; background-color: #dedede;
text-align center text-align center
white-space nowrap
} }
table.table td { table.table td {
border-width: 1px; border-width: 1px;
...@@ -326,6 +327,7 @@ ...@@ -326,6 +327,7 @@
border-color: #d1ccc0; border-color: #d1ccc0;
background-color: #ffffff; background-color: #ffffff;
text-align center text-align center
white-space nowrap
} }
.tips { .tips {
font-size 16px font-size 16px
......
...@@ -119,11 +119,11 @@ ...@@ -119,11 +119,11 @@
<th>卫生间数</th> <th>卫生间数</th>
</tr> </tr>
<tr v-for="item in supplyData.rows"> <tr v-for="item in supplyData.rows">
<td>{{item.production}}</td> <td>{{item.production || '--'}}</td>
<td>{{item.kjNum}}</td> <td>{{item.kjNum || '--'}}</td>
<td>{{item.jsNum}}</td> <td>{{item.jsNum || '--'}}</td>
<td>{{item.tingNum}}</td> <td>{{item.tingNum || '--'}}</td>
<td>{{item.wsjNum}}</td> <td>{{item.wsjNum || '--'}}</td>
</tr> </tr>
</table> </table>
</el-col> </el-col>
...@@ -140,11 +140,11 @@ ...@@ -140,11 +140,11 @@
<th>客卧面宽</th> <th>客卧面宽</th>
</tr> </tr>
<tr v-for="item in supplyTableData"> <tr v-for="item in supplyTableData">
<td>{{item.production}}</td> <td>{{item.production || '--'}}</td>
<td>{{item.nxmk}}</td> <td>{{item.nxmk || '--'}}</td>
<td>{{item.qjsmk}}</td> <td>{{item.qjsmk || '--'}}</td>
<td>{{item.zwmk}}</td> <td>{{item.zwmk || '--'}}</td>
<td>{{item.kwmk}}</td> <td>{{item.kwmk || '--'}}</td>
</tr> </tr>
</table> </table>
</el-col> </el-col>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment