master
xy 2 years ago
parent fbd346251f
commit 02815ddfe8

@ -8,7 +8,7 @@ const state = {
safety: [], safety: [],
safetyPlan: [], safetyPlan: [],
adventSafetyPlan: [], adventSafetyPlan: [],
departmentStatics: {}, departmentStatics: [],
type: 1, type: 1,
is_auth: 1, is_auth: 1,
} }

@ -0,0 +1,107 @@
<template>
<div>
<div class="dept-statics bg-color-black">
<div class="title d-flex align-center">
<span>
<SvgIcon icon-class="tudi" class="text-icon"></SvgIcon>
</span>
<span class="fs-xl text">资产详情</span>
</div>
<dv-scroll-board class="body" :config="config">
</dv-scroll-board>
</div>
</div>
</template>
<script>
import SvgIcon from '@/components/SvgIcon/index.vue'
export default {
components: {
SvgIcon,
},
data() {
return {
}
},
methods: {
handleNum (num, precision=2,times=1) {
if (!num) return Number(0).toFixed(precision)
if (typeof num === 'string') {
if (isNaN(Number(num))) {
return Number(0).toFixed(precision)
} else {
return Number(num * times).toFixed(precision)
}
} else if (typeof num === 'number') {
return (num * times).toFixed(precision)
} else {
return Number(0).toFixed(precision)
}
},
},
computed: {
config() {
let data = this.$store.state.bigdata.departmentStatics || []
return {
data: data?.map(dept => [
dept.name,dept.land_count, this.handleNum(dept.land_shijimianji), dept.house_count, this.handleNum(dept.house_shijimianji)
]),
carousel: 'single',
rowNum: 10,
oddRowBGC: '#4fa497',
evenRowBGC: 'transparent',
headerBGC: 'transparent',
header: ['公司','土地','土地面积','房产','房产面积'],
columnWidth: [128,50,100,50,100],
align: ['center','center','center','center','center']
}
}
},
}
</script>
<style scoped lang="scss">
.text-icon {
width: 24px;
height: 24px;
color: #1da4a1;
}
.dept-statics {
padding: 20px 10px;
width: 100%;
.title {
flex: 0;
display: flex;
color: #fff;
padding: 0 20px;
align-items: center;
.text {
padding: 0 8px;
}
}
.body {
width: 100%;
height: 540px;
padding: 10px 10px;
}
}
.department-statics {
&__item {
color: #fff;
padding: 12px 18px;
&--name {
font-size: 17px;
font-weight: 600;
margin-bottom: 6px;
}
&--house, &--land {
text-indent: 6px;
}
.text-icon {
color: #73f3df;
}
}
}
</style>

@ -0,0 +1,106 @@
<template>
<div>
<div class="dept-statics bg-color-black">
<div class="title d-flex align-center">
<span>
<SvgIcon icon-class="fangwu" class="text-icon"></SvgIcon>
</span>
<span class="fs-xl text">房产详情</span>
</div>
<dv-scroll-ranking-board class="body" :config="config">
</dv-scroll-ranking-board>
</div>
</div>
</template>
<script>
import SvgIcon from '@/components/SvgIcon/index.vue'
export default {
components: {
SvgIcon,
},
data() {
return {
}
},
methods: {
handleNum (num, precision=2,times=1) {
if (!num) return Number(0).toFixed(precision)
if (typeof num === 'string') {
if (isNaN(Number(num))) {
return Number(0).toFixed(precision)
} else {
return Number(num * times).toFixed(precision)
}
} else if (typeof num === 'number') {
return (num * times).toFixed(precision)
} else {
return Number(0).toFixed(precision)
}
},
},
computed: {
config() {
let data = this.$store.state.bigdata.departmentStatics || []
return {
data: data?.map(dept => ({
name: dept.name,
value: dept.house_shijimianji??0,
originalValue: [dept.house_count, dept.house_shijimianji]
})),
carousel: 'single',
rowNum: 4,
valueFormatter: ({ originalValue }) => {
return `房产${originalValue[0]},面积${this.handleNum(originalValue[1])}`
}
}
}
},
}
</script>
<style scoped lang="scss">
.text-icon {
width: 24px;
height: 24px;
color: #1da4a1;
}
.dept-statics {
padding: 20px 10px;
width: 100%;
.title {
flex: 0;
display: flex;
color: #fff;
padding: 0 20px;
align-items: center;
.text {
padding: 0 8px;
}
}
.body {
width: 100%;
height: 260px;
padding: 10px 20px;
}
}
.department-statics {
&__item {
color: #fff;
padding: 12px 18px;
&--name {
font-size: 17px;
font-weight: 600;
margin-bottom: 6px;
}
&--house, &--land {
text-indent: 6px;
}
.text-icon {
color: #73f3df;
}
}
}
</style>

@ -18,8 +18,9 @@
<leftBottom class="mt-2"></leftBottom> <leftBottom class="mt-2"></leftBottom>
</div> </div>
<div class="right d-flex flex-column ml-2"> <div class="right d-flex flex-column ml-2">
<dv-border-box-12><right1></right1></dv-border-box-12> <dv-border-box-12><RightDept></RightDept></dv-border-box-12>
<dv-border-box-12><right2></right2></dv-border-box-12> <!-- <dv-border-box-12><right1></right1></dv-border-box-12>-->
<!-- <dv-border-box-12><right2></right2></dv-border-box-12>-->
<dv-border-box-12><right3></right3></dv-border-box-12> <dv-border-box-12><right3></right3></dv-border-box-12>
</div> </div>
</div> </div>
@ -38,6 +39,8 @@ import right1 from "./right1.vue";
import right2 from "./right2.vue"; import right2 from "./right2.vue";
import right3 from "./right3.vue"; import right3 from "./right3.vue";
import btns from "./btns.vue"; import btns from "./btns.vue";
import RightDept from './RightDept.vue'
import RightDept1 from './RightDept1.vue'
import leftBottom from "./leftBottom.vue" import leftBottom from "./leftBottom.vue"
import { index } from '@/api/system/baseForm'; import { index } from '@/api/system/baseForm';
import { mapActions } from "vuex" import { mapActions } from "vuex"
@ -51,7 +54,9 @@ export default {
right2, right2,
right3, right3,
btns, btns,
leftBottom leftBottom,
RightDept,
RightDept1
}, },
mixins: [drawMixin], mixins: [drawMixin],
data() { data() {
@ -86,9 +91,9 @@ export default {
this.getAssets() this.getAssets()
this.getLeases() this.getLeases()
this.getAdventLeases() this.getAdventLeases()
this.getSafety() // this.getSafety()
this.getSafetyPlan() // this.getSafetyPlan()
this.getAdventSafetyPlan() // this.getAdventSafetyPlan()
this.getDepartmentStatics() this.getDepartmentStatics()
} }
} }
@ -125,6 +130,12 @@ export default {
flex: 1; flex: 1;
padding-right: 20px; padding-right: 20px;
& > div:nth-child(1) {
flex: 0.64;
}
& > div:nth-child(2) {
flex: 0.36;
}
div + div { div + div {
margin-top: .5rem; margin-top: .5rem;
} }

@ -236,6 +236,9 @@ export default {
} }
} }
} }
.dv-box {
cursor: pointer;
}
.dv-box + .dv-box { .dv-box + .dv-box {
margin-left: .5rem; margin-left: .5rem;
} }

@ -13,21 +13,21 @@
</div> </div>
<div class="switch-btn__bkg"></div> <div class="switch-btn__bkg"></div>
</div> </div>
<div class="department-statics"> <!-- <div class="department-statics">-->
<dv-border-box-12 style="min-width: 200px;" :key="departmentStaticsId"> <!-- <dv-border-box-12 style="min-width: 200px;" :key="departmentStaticsId">-->
<div class="department-statics__item" v-for="dept in $store.state.bigdata.departmentStatics" :key="dept.id"> <!-- <div class="department-statics__item" v-for="dept in $store.state.bigdata.departmentStatics" :key="dept.id">-->
<div class="department-statics__item--name">{{ dept.name }}</div> <!-- <div class="department-statics__item&#45;&#45;name">{{ dept.name }}</div>-->
<div class="department-statics__item--land"> <!-- <div class="department-statics__item&#45;&#45;land">-->
<SvgIcon icon-class="tudi" class="text-icon"></SvgIcon> <!-- <SvgIcon icon-class="tudi" class="text-icon"></SvgIcon>-->
土地 <span class="text-icon">{{ dept.land_count }}</span> <!-- 土地 <span class="text-icon">{{ dept.land_count }}</span>-->
</div> <!-- </div>-->
<div class="department-statics__item--house"> <!-- <div class="department-statics__item&#45;&#45;house">-->
<SvgIcon icon-class="fangwu" class="text-icon"></SvgIcon> <!-- <SvgIcon icon-class="fangwu" class="text-icon"></SvgIcon>-->
房产 <span class="text-icon">{{ dept.house_count }}</span> <!-- 房产 <span class="text-icon">{{ dept.house_count }}</span>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</dv-border-box-12> <!-- </dv-border-box-12>-->
</div> <!-- </div>-->
<div class="other-asset" ref="otherAssetBoard" v-if="config.data.length > 0"> <div class="other-asset" ref="otherAssetBoard" v-if="config.data.length > 0">
<img class="other-asset__arrow" :src="require('@/assets/arrow.png')" alt=""> <img class="other-asset__arrow" :src="require('@/assets/arrow.png')" alt="">
@ -164,10 +164,10 @@ export default {
setConfig () { setConfig () {
this.config = { this.config = {
headerBGC: '#4fa497', headerBGC: '#4fa497',
header: ['区域', '数量'], header: ['区域', '土地数量','房产'],
data: this.labelData.filter(i => !i.isWx).map(i => [i.name, i.value]), data: this.labelData.filter(i => (!i.isWx && (i.value > 0 || i.houseValue > 0))).map(i => [i.name, i.value, i.houseValue]),
columnWidth: [200, 180], columnWidth: [200, 180, 180],
align: ['center', 'center'] align: ['center', 'center', 'center']
} }
} }
}, },
@ -248,7 +248,7 @@ export default {
color: 'transparent' color: 'transparent'
} }
}, },
data: this.labelData.map(v => { data: this.labelData?.filter(v => v.value > 0)?.map(v => {
v.label = this.label; v.label = this.label;
v.emphasis = { v.emphasis = {
label: this.label, label: this.label,
@ -267,6 +267,7 @@ export default {
name: item[1], name: item[1],
value: 0, value: 0,
originalData: [], originalData: [],
houseValue: 0,
originalHouse: [], originalHouse: [],
isWx: this.wxAreas.indexOf(item[1]) !== -1 isWx: this.wxAreas.indexOf(item[1]) !== -1
})) }))
@ -280,11 +281,12 @@ export default {
houses.forEach(item => { houses.forEach(item => {
let find = temp.find(v => v.tag === item.area) let find = temp.find(v => v.tag === item.area)
if (find) { if (find) {
find.houseValue++;
find.originalHouse.push(item) find.originalHouse.push(item)
} }
}) })
return temp.filter(v => v.value > 0); return temp;
} }
}, },
watch: { watch: {
@ -298,10 +300,10 @@ export default {
}, },
mounted() { mounted() {
this.initMap(); this.initMap();
this.departmentStaticsWatch = this.$watch(() => this.$store.state.bigdata?.departmentStatics, () => this.departmentStaticsId++) // this.departmentStaticsWatch = this.$watch(() => this.$store.state.bigdata?.departmentStatics, () => this.departmentStaticsId++)
}, },
beforeDestroy() { beforeDestroy() {
this.departmentStaticsWatch() // this.departmentStaticsWatch()
} }
} }
</script> </script>

@ -109,14 +109,14 @@ export default {
let landSum = this.info?.reduce((pre, cur) => pre + (isNaN(Number(cur.shijimianji)) ? 0 : Number(cur.shijimianji)),0) let landSum = this.info?.reduce((pre, cur) => pre + (isNaN(Number(cur.shijimianji)) ? 0 : Number(cur.shijimianji)),0)
sums[key] = { sums[key] = {
key, key,
value: '土地'+landSum+'' value: '土地'+landSum.toFixed(2)+''
}; };
return; return;
} else if (index === 1) { } else if (index === 1) {
let houseSum = this.house?.reduce((pre, cur) => pre + (isNaN(Number(cur.shijimianji)) ? 0 : Number(cur.shijimianji)),0) let houseSum = this.house?.reduce((pre, cur) => pre + (isNaN(Number(cur.shijimianji)) ? 0 : Number(cur.shijimianji)),0)
sums[key] = { sums[key] = {
key, key,
value: '房产'+houseSum+'' value: '房产'+houseSum.toFixed(2)+''
}; };
return; return;
} else { } else {

@ -902,7 +902,7 @@ export default {
chuzumianji: item._chuzumianji, chuzumianji: item._chuzumianji,
let_id: res.id, let_id: res.id,
})); }));
if (leaseToAssetsData && leaseToAssetsData.length > 0) { if (this.type === 'add' && leaseToAssetsData && leaseToAssetsData.length > 0) {
imports( imports(
{ {
table_name: "lets_to_assets", table_name: "lets_to_assets",

@ -137,7 +137,7 @@ export default {
label: "分类", label: "分类",
width: 160, width: 160,
customFn: row => ( customFn: row => (
<span>{ (row.land_id || row.house_id) ? (row.land_id ? '房产' : '土地'): row.biaodileixing }</span> <span>{ (row.land_id || row.house_id) ? (row.land_id ? '土地' : '房产') : row.biaodileixing }</span>
) )
}, },
{ {

@ -9,6 +9,7 @@
> >
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<DatePicker style="padding-left: 20px;" :value="year" type="year" formatter="yyyy" @on-change="yearPick"></DatePicker>
</slot> </slot>
</LxHeader> </LxHeader>
@ -25,7 +26,7 @@
</el-row> </el-row>
<barLineChart id="department-statistics" :my-data="data" width="100%" height="300px" style="margin-top: 20px;"></barLineChart> <barLineChart id="department-statistics" :my-data="data" width="100%" height="300px" style="margin-top: 20px;"></barLineChart>
<barLineChart1 id="department-statistics1" :my-data="data" width="100%" height="300px" style="margin-top: 20px;"></barLineChart1> <barLineChart1 id="department-statistics1" :year="year" :my-data="data" width="100%" height="300px" style="margin-top: 20px;"></barLineChart1>
</div> </div>
</div> </div>
</div> </div>
@ -54,9 +55,15 @@ export default {
}, },
methods: { methods: {
async getData () { async getData () {
const res = await departmentStatistics(); const res = await departmentStatistics({
year: this.year
});
this.data = res.departments; this.data = res.departments;
}, },
yearPick (e) {
this.year = e
this.getData()
}
}, },
computed: {}, computed: {},
created() { created() {

@ -12,7 +12,7 @@ import resize from '@/components/Charts/mixins/resize'
export default { export default {
mixins: [resize], mixins: [resize],
props: { props: {
year: Date, year: String,
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart'
@ -32,7 +32,7 @@ export default {
myData: { myData: {
type: Array, type: Array,
default: () => [] default: () => []
} },
}, },
data() { data() {
return { return {
@ -57,16 +57,16 @@ export default {
} }
}, },
methods: { methods: {
handleNum (num, precision=2) { handleNum (num, precision=2,times=1) {
if (!num) return Number(0).toFixed(precision) if (!num) return Number(0).toFixed(precision)
if (typeof num === 'string') { if (typeof num === 'string') {
if (isNaN(Number(num))) { if (isNaN(Number(num))) {
return Number(0).toFixed(precision) return Number(0).toFixed(precision)
} else { } else {
return Number(num).toFixed(precision) return Number(num * times).toFixed(precision)
} }
} else if (typeof num === 'number') { } else if (typeof num === 'number') {
return num.toFixed(precision) return (num * times).toFixed(precision)
} else { } else {
return Number(0).toFixed(precision) return Number(0).toFixed(precision)
} }
@ -124,12 +124,12 @@ export default {
], ],
yAxis: [ yAxis: [
{ {
type: 'value' type: 'value',
} }
], ],
series: [ series: [
{ {
barWidth: 30, barWidth: 25,
name: '租赁土地面积', name: '租赁土地面积',
type: 'bar', type: 'bar',
emphasis: { emphasis: {
@ -138,13 +138,22 @@ export default {
data: this.myData.map(i => this.handleNum(i.leases_land_dengjimianji)) data: this.myData.map(i => this.handleNum(i.leases_land_dengjimianji))
}, },
{ {
barWidth: 30, barWidth: 25,
name: '租赁房产面积', name: '租赁房产面积',
type: 'bar', type: 'bar',
emphasis: { emphasis: {
focus: 'series' focus: 'series'
}, },
data: this.myData.map(i => this.handleNum(i.leases_house_dengjimianji)) data: this.myData.map(i => this.handleNum(i.leases_house_dengjimianji))
},
{
barWidth: 25,
name: `${this.year}年租金(万)`,
type: 'bar',
emphasis: {
focus: 'series'
},
data: this.myData.map(i => this.handleNum(i.hetongnianzujin_total,2,0.0001))
} }
] ]
}) })

Loading…
Cancel
Save