master
xy 10 months ago
parent fbd346251f
commit 02815ddfe8

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

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

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

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

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

@ -137,7 +137,7 @@ export default {
label: "分类",
width: 160,
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>
<slot>
<DatePicker style="padding-left: 20px;" :value="year" type="year" formatter="yyyy" @on-change="yearPick"></DatePicker>
</slot>
</LxHeader>
@ -25,7 +26,7 @@
</el-row>
<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>
@ -54,9 +55,15 @@ export default {
},
methods: {
async getData () {
const res = await departmentStatistics();
const res = await departmentStatistics({
year: this.year
});
this.data = res.departments;
},
yearPick (e) {
this.year = e
this.getData()
}
},
computed: {},
created() {

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