Sfoglia il codice sorgente

Merge branch 'develop_yh55' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh55

chenrui 2 mesi fa
parent
commit
672d81cc2e
1 ha cambiato i file con 17 aggiunte e 12 eliminazioni
  1. 17 12
      src/views/reportData/regionTypeBusinessReport/list.vue

+ 17 - 12
src/views/reportData/regionTypeBusinessReport/list.vue

@@ -90,13 +90,22 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import getDate from '@/libs/getDate'
 // 接口
 import { manageAnalysisReportQuery, manageAnalysisReportExport } from '@/api/reportData'
+const strongRow = []
 const renderContent = (value, row, index) => {
-  const text = (value || value == 0) || '--'
-  const obj = {
-    children: text,
-    attrs: {}
+  let ret = Number(value) || Number(value) == 0 ? Number(value).toFixed(2) : '--'
+  if (row.dataIndex == 'grossMargin' || row.dataIndex == 'promoRatio') {
+    ret = ret ? ret + '%' : '--'
   }
-  return obj
+
+  if (strongRow.indexOf(index) >= 0) {
+    return {
+      children: ret,
+      attrs: {
+        style: 'font-weight: bold;'
+      }
+    }
+  }
+  return ret
 }
 export default {
   name: 'RegionTypeBusinessReportList',
@@ -137,12 +146,10 @@ export default {
             // 计算表格序号
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
-              data[i].grossMargin = data[i].grossMargin ? data[i].grossMargin + '%' : ''
-              data[i].promoRatio = data[i].promoRatio ? data[i].promoRatio + '%' : ''
-              ret.push(data[i])
               if (data[i].category.indexOf('合计') >= 0) {
-                ret.push({ no: 'hj-' + data[i].no, 'category': 'a' })
+                strongRow.push(i)
               }
+              ret.push(data[i])
             }
           }
           this.disabled = false
@@ -171,9 +178,7 @@ export default {
           width: '25%',
           align: 'center',
           customRender: (text, row, index) => {
-            if (row.category != 'a') {
-              return row.category.indexOf('合计') < 0 ? <a-button type="link" class="button-default">{text}</a-button> : (<a-button type="link" class="button-default" style="font-weight:bold;">{text}</a-button>)
-            }
+            return row.category.indexOf('合计') < 0 ? <a-button type="link" class="button-default">{text}</a-button> : (<a-button type="link" class="button-default" style="font-weight:bold;">{text}</a-button>)
           } },
         { title: '成本', dataIndex: 'cost', width: '10%', align: 'right', customRender: renderContent },
         { title: '销售额', dataIndex: 'amount', width: '10%', align: 'right', customRender: renderContent },