Browse Source

周报新加字段判断

branch0222
douzhuo 1 year ago
parent
commit
eb78ddf075
2 changed files with 26 additions and 25 deletions
  1. +2
    -2
      manifest.json
  2. +24
    -23
      pages/reportExcel/weekReport.vue

+ 2
- 2
manifest.json View File

@@ -1,5 +1,5 @@
{
"name" : "去房智控管家",
"name" : "数智工牌",
"appid" : "__UNI__7A1611D",
"description" : "去房智控管家",
"versionName" : "1.1.0",
@@ -91,7 +91,7 @@
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx8f883dca5ecc5510",
"appid" : "wxe044603515ff2cb5",
"setting" : {
"urlCheck" : false,
"es6" : true,


+ 24
- 23
pages/reportExcel/weekReport.vue View File

@@ -712,31 +712,32 @@
...res.zkMessage,
}
}

if (this.weekObj.level1List[0] && this.weekObj.level1List[0].total) {
let max1 = this.weekObj.level1List[0].total || 1
this.weekObj.level1List.forEach(item => {
item.percent = Math.floor((item.total / max1) * 100)
})
} else {
this.weekObj.level1List.forEach(item => {
item.percent = 0
})
}

if (this.weekObj.level2List[0] && this.weekObj.level2List[0].total) {
let max2 = this.weekObj.level2List[0].total || 1

this.weekObj.level2List.forEach(item => {
item.percent = Math.floor((item.total / max2) * 100)
})
} else {
this.weekObj.level2List.forEach(item => {
item.percent = 0
})
if (this.weekObj.level1List && this.weekObj.level2List) {
if (this.weekObj.level1List[0] && this.weekObj.level1List[0].total) {
let max1 = this.weekObj.level1List[0].total || 1
this.weekObj.level1List.forEach(item => {
item.percent = Math.floor((item.total / max1) * 100)
})
} else {
this.weekObj.level1List.forEach(item => {
item.percent = 0
})
}
if (this.weekObj.level2List[0] && this.weekObj.level2List[0].total) {
let max2 = this.weekObj.level2List[0].total || 1
this.weekObj.level2List.forEach(item => {
item.percent = Math.floor((item.total / max2) * 100)
})
} else {
this.weekObj.level2List.forEach(item => {
item.percent = 0
})
}
}


this.weekObj.createTimeName = this.getTimeLines(this.weekObj.weekDate, 1)
console.log(this.weekObj, 'this.weekObj')
this.projectName = res.projectName


Loading…
Cancel
Save