Commit 043075b3 by lichengming

修改了统计分析

parent 6df4e103
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
this.formObj.ctimeBegin = '' this.formObj.ctimeBegin = ''
this.formObj.ctimeEnd = '' this.formObj.ctimeEnd = ''
this.dateList = [] this.dateList = []
this._page() // this._page()
}, },
_page() { _page() {
this.$refs.pageTable._page( this.$refs.pageTable._page(
......
...@@ -105,13 +105,19 @@ export default { ...@@ -105,13 +105,19 @@ export default {
if (result.length === 0) { if (result.length === 0) {
this.option.series[0].data = [] this.option.series[0].data = []
} else { } else {
let total = 0
const testerList = []
for (let i = 0; i < result.length; i++) { for (let i = 0; i < result.length; i++) {
testerList.push(result[i].entrustDate)
total = total + result[i].quantity
const obj = {} const obj = {}
obj.name = result[i].entrustDate obj.name = result[i].entrustDate
obj.value = result[i].quantity obj.value = result[i].quantity
obj.fee = result[i].fee obj.fee = result[i].fee
this.option.series[0].data.push(obj) this.option.series[0].data.push(obj)
} }
this.option.title.text = '检测项目总量(个):' + total
this.option.legend.data = testerList
} }
}, },
_searchParams() { _searchParams() {
......
...@@ -97,14 +97,17 @@ export default { ...@@ -97,14 +97,17 @@ export default {
_openPie(data) { _openPie(data) {
// this.option.series[0].data = [] // this.option.series[0].data = []
// this.option.legend.data = [] // this.option.legend.data = []
const testerList = []
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
testerList.push(data[i].type)
this.option.series[0].data.push({ this.option.series[0].data.push({
name: data[i].type, name: data[i].type,
value: data[i].quantity value: data[i].quantity
}) })
this.option.legend.data.push(this.pie[i].type) // this.option.legend.data.push(this.data[i].type)
} }
alert(this.option.series[0].data) this.option.legend.data = testerList
console.log('963258', this.option.legend.data)
}, },
_searchPie(data) { _searchPie(data) {
this.option.series[0].data = [] this.option.series[0].data = []
......
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