|
@@ -43,7 +43,7 @@ import MapChart from '@/components/chart/MapChart'
|
|
|
import PieChart from '@/components/chart/PieChart'
|
|
|
import ProgressChart from '@/components/chart/ProgressChart'
|
|
|
import { getEntChart } from '@/api/modules/'
|
|
|
-import { getParam, bSort, moneyUnit } from '@/utils/'
|
|
|
+import { bSort, moneyUnit } from '@/utils/'
|
|
|
export default {
|
|
|
name: 'ent-chart',
|
|
|
props: ['active'],
|
|
@@ -159,7 +159,7 @@ export default {
|
|
|
async getChartData () {
|
|
|
this.getEntPortraitInfoTimes++
|
|
|
const res = await getEntChart({
|
|
|
- entId: decodeURIComponent(getParam('eId'))
|
|
|
+ entId: decodeURIComponent(this.$route.params.eId)
|
|
|
})
|
|
|
if (res.error_code === 0) {
|
|
|
if (res.data && Object.keys(res.data).length !== 0) {
|
|
@@ -204,7 +204,7 @@ export default {
|
|
|
/* *********** 画像数据处理 ********** */
|
|
|
// 整理年度项目统计数据
|
|
|
arrangeAnnualData (data) {
|
|
|
- if (!data) return
|
|
|
+ if (!data || Object.keys(data).length === 0) return
|
|
|
let rows = []
|
|
|
let count = 0
|
|
|
for (var key in data) {
|
|
@@ -231,7 +231,7 @@ export default {
|
|
|
},
|
|
|
// 整理月度中标金额数据
|
|
|
arrangeMonthZbData (data) {
|
|
|
- if (!data) return
|
|
|
+ if (!data || Object.keys(data).length === 0) return
|
|
|
const rows = []
|
|
|
const columns = ['月份']
|
|
|
let count = 0
|
|
@@ -272,7 +272,7 @@ export default {
|
|
|
},
|
|
|
// 整理主要市场分布(中国地图)数据
|
|
|
arrangeMapData (data) {
|
|
|
- if (!data) return
|
|
|
+ if (!data || data.length === 0) return
|
|
|
const mapRows = []
|
|
|
let count = 0
|
|
|
if (data && $.isArray(data)) {
|
|
@@ -294,7 +294,7 @@ export default {
|
|
|
},
|
|
|
// 整理平均折扣率数据
|
|
|
arrangeRateData (data) {
|
|
|
- if (!data) return
|
|
|
+ if (!data || Object.keys(data).length === 0) return
|
|
|
const rows = []
|
|
|
const columns = ['日期', '全部客户']
|
|
|
let count = 0
|
|
@@ -328,7 +328,7 @@ export default {
|
|
|
},
|
|
|
// 整理客户类型分布数据
|
|
|
initPieChartData (res) {
|
|
|
- if (!res) return
|
|
|
+ if (!res || res.length === 0) return
|
|
|
const arr = []
|
|
|
const data = JSON.parse(JSON.stringify(res))
|
|
|
// 降序排列
|
|
@@ -359,7 +359,7 @@ export default {
|
|
|
},
|
|
|
// 整理重要客户数据
|
|
|
arrangeImportantData (data) {
|
|
|
- if (!data) return
|
|
|
+ if (!data || data.length === 0) return
|
|
|
const arr = []
|
|
|
if ($.isArray(data)) {
|
|
|
data.forEach((list) => {
|