lancer преди 2 години
родител
ревизия
cc1920f14f
променени са 2 файла, в които са добавени 135 реда и са изтрити 41 реда
  1. +4
    -3
      src/views/building/index.vue
  2. +131
    -38
      src/views/houseData/analyse.vue

+ 4
- 3
src/views/building/index.vue Целия файл

@@ -276,7 +276,7 @@
</el-table-column>


<el-table-column :key="Math.random()" prop="managerPhone" label="管理员账号" align="center">
<el-table-column :key="Math.random()" width="100" prop="managerPhone" label="管理员账号" align="center">
<template slot-scope="{ row }">
{{ row.managerPhone || "-" }}
</template>
@@ -308,14 +308,15 @@
<el-table-column
prop="startWorking"
label="合同开始日期"
width="100"
align="center"
>
</el-table-column>

<el-table-column prop="endWorking" label="合同结束日期" align="center">
<el-table-column prop="endWorking" width="100" label="合同结束日期" align="center">
</el-table-column>

<el-table-column label="添加日期" align="center">
<el-table-column label="添加日期" width="100" align="center">
<template slot-scope="{ row }">
{{ row.createTime.substring(0, 10) }}
</template>


+ 131
- 38
src/views/houseData/analyse.vue Целия файл

@@ -180,6 +180,13 @@
cursor: pointer;
"
>
<div
:class="{ colostyle: tabFlag2 == 0 }"
style="margin-right: 10px"
@click="tabClick2(0)"
>
不变
</div>
<div
:class="{ colostyle: tabFlag2 == 1 }"
style="margin-right: 10px"
@@ -195,7 +202,7 @@
<div
style="overflow-y: auto; height: 350px; width: 94%; margin: 0 auto"
>
<div class="jinbox" v-for="(item, i) in objList" :key="i">
<div class="jinbox" v-for="(item, i) in objList1" :key="i">
<div class="jinboxtit">{{ item.name }}</div>
<div class="jinbox-box">
<div
@@ -384,29 +391,11 @@ export default {
},
receiveRules: {},
tabFlag: 1,
tabFlag2: 1,
objList: [
{
name: "顾文一",
zxl1: 90,
zxl: 10,
},
{
name: "顾文一",
zxl1: 90,
zxl: 10,
},
{
name: "顾文一",
zxl1: 90,
zxl: 10,
},
{
name: "顾文一",
zxl1: 90,
zxl: 10,
},
],
tabFlag2: 0,
objList1: [],
objList: [],
orgData: [],
orgArr: [],
};
},
mounted() {
@@ -436,11 +425,11 @@ export default {
//第一个饼状图
targetAnalysis() {
let obj = {
month: this.time,
month: this.time + "-01",
agentId: this.selValue == 0 ? this.choicValue : null,
orgCode: this.selValue == 1 ? this.choicValue : null,
houseId: this.selValue == 2 ? this.choicValue : null,
operationType: localStorage.getItem("orgType")/1+1,
operationType: localStorage.getItem("orgType") / 1 + 1,
houseTypes: "0,1",
operationStaffId: this.operationStaffId,
};
@@ -462,38 +451,84 @@ export default {
// 第一个柱状图
operationalGoals() {
let obj = {
month: this.time,
month: this.time + "-01",
agentId: this.selValue == 0 ? this.choicValue : null,
orgCode: this.selValue == 1 ? this.choicValue : null,
houseId: this.selValue == 2 ? this.choicValue : null,
operationType: localStorage.getItem("orgType")/1+1,
operationType: localStorage.getItem("orgType") / 1 + 1,
houseTypes: "0,1",
operationStaffId: this.operationStaffId,
};
this.$api.api.operationalGoals(obj).then((res) => {
console.log(res);
// console.log(res);
// 数据处理
this.orgArr = res.data;
this.dealData();
});
},
// 数据处理
dealData() {
let arr = [];
if (this.tabFlag == 1) {
// 达标
// res.data.upToStandardList
let num = Math.max.apply(
Math,
this.orgArr.upToStandardList.map(function (o) {
return o.upToStandard;
})
);
// console.log(num, "最大值");
this.orgArr.upToStandardList.map((item) => {
let obj = {};
obj.zxl = item.upToStandard;
obj.name = item.name;
obj.zxl1 = Math.floor((item.upToStandard / num) * 100);
arr.push(obj);
});
} else {
// res.data.didNotMakeItList
let num = Math.max.apply(
Math,
this.orgArr.didNotMakeItList.map(function (o) {
return o.didNotMakeIt;
})
);
// console.log(num, "最大值");
this.orgArr.didNotMakeItList.map((item) => {
let obj = {};
obj.zxl = item.didNotMakeIt;
obj.name = item.name;
obj.zxl1 = Math.floor((item.didNotMakeIt / num) * 100);
arr.push(obj);
});
}
this.objList = arr;
},
//第二个饼状图
targetAnalysisCompared() {
let obj = {
month: this.time,
month: this.time + "-01",
agentId: this.selValue == 0 ? this.choicValue : null,
orgCode: this.selValue == 1 ? this.choicValue : null,
houseId: this.selValue == 2 ? this.choicValue : null,
operationType: localStorage.getItem("orgType")/1+1,
operationType: localStorage.getItem("orgType") / 1 + 1,
houseTypes: "0,1",
operationStaffId: this.operationStaffId,
};
this.$api.api.targetAnalysisCompared(obj).then((res) => {
let arr = [
{
value: res.data.upToStandard,
name: "达标",
value: res.data.rise,
name: "上升",
},
{
value: res.data.didNotMakeIt,
name: "未达标",
value: res.data.decline,
name: "下降",
},
{
value: res.data.constant,
name: "不变",
},
];
// console.log(res);
@@ -503,23 +538,81 @@ export default {
// 第二个柱状图
operationalGoalsCompared() {
let obj = {
month: this.time,
month: this.time + "-01",
agentId: this.selValue == 0 ? this.choicValue : null,
orgCode: this.selValue == 1 ? this.choicValue : null,
houseId: this.selValue == 2 ? this.choicValue : null,
operationType: localStorage.getItem("orgType")/1+1,
operationType: localStorage.getItem("orgType") / 1 + 1,
houseTypes: "0,1",
operationStaffId: this.operationStaffId,
};
this.$api.api.operationalGoalsCompared(obj).then((res) => {
console.log(res);
// console.log(res);
this.orgData = res.data;
this.dealData2();
});
},
// 数据处理
dealData2() {
let arr = [];
if (this.tabFlag2 == 0) {
// 达标
// res.data.upToStandardList
let num = Math.max.apply(
Math,
this.orgData.riseList.map(function (o) {
return o.rise;
})
);
// console.log(num, "最大值");
this.orgData.riseList.map((item) => {
let obj = {};
obj.zxl = item.rise;
obj.name = item.name;
obj.zxl1 = Math.floor((item.rise / num) * 100);
arr.push(obj);
});
} else if (this.tabFlag2 == 1) {
// res.data.didNotMakeItList
let num = Math.max.apply(
Math,
this.orgData.constantList.map(function (o) {
return o.constant;
})
);
// console.log(num, "最大值");
this.orgData.constantList.map((item) => {
let obj = {};
obj.zxl = item.constant;
obj.name = item.name;
obj.zxl1 = Math.floor((item.constant / num) * 100);
arr.push(obj);
});
} else {
let num = Math.max.apply(
Math,
this.orgData.declineList.map(function (o) {
return o.decline;
})
);
// console.log(num, "最大值");
this.orgData.declineList.map((item) => {
let obj = {};
obj.zxl = item.decline;
obj.name = item.name;
obj.zxl1 = Math.floor((item.decline / num) * 100);
arr.push(obj);
});
}
this.objList1 = arr;
},
tabClick2(idx) {
this.tabFlag2 = idx;
this.dealData2();
},
tabClick1(idx) {
this.tabFlag = idx;
this.dealData();
},
reset() {
this.receiveForm = {


Зареждане…
Отказ
Запис