浏览代码

Merge branch 'develop_yh55' of jianguan-web/jg-ocs-html into pre-release

李磊 2 月之前
父节点
当前提交
127a607b06
共有 1 个文件被更改,包括 15 次插入3 次删除
  1. 15 3
      src/views/reportData/regionTypeBusinessReport/list.vue

+ 15 - 3
src/views/reportData/regionTypeBusinessReport/list.vue

@@ -91,10 +91,13 @@ import getDate from '@/libs/getDate'
 // 接口
 // 接口
 import { manageAnalysisReportQuery, manageAnalysisReportExport } from '@/api/reportData'
 import { manageAnalysisReportQuery, manageAnalysisReportExport } from '@/api/reportData'
 const strongRow = []
 const strongRow = []
+const redRow = []
 const renderContent = (value, row, index) => {
 const renderContent = (value, row, index) => {
   const ret = value || value == 0 ? value : ''
   const ret = value || value == 0 ? value : ''
   const retVal = ret == 0 ? '0.00' : ret
   const retVal = ret == 0 ? '0.00' : ret
-  if (strongRow.indexOf(index) >= 0) {
+  const isStrong = strongRow.indexOf(index) >= 0
+  const isRed = redRow.indexOf(index) >= 0
+  if (isStrong || isRed) {
     return {
     return {
       children: retVal == '--' ? '' : retVal,
       children: retVal == '--' ? '' : retVal,
       attrs: {
       attrs: {
@@ -155,6 +158,9 @@ export default {
               if (data[i].category.indexOf('合计') >= 0) {
               if (data[i].category.indexOf('合计') >= 0) {
                 strongRow.push(i)
                 strongRow.push(i)
               }
               }
+              if (data[i].category == '全品类(含NGK)' || data[i].category == '箭牌喇叭' || data[i].category == '轮胎') {
+                redRow.push(i)
+              }
               ret.push(data[i])
               ret.push(data[i])
             }
             }
           }
           }
@@ -184,8 +190,14 @@ export default {
           width: '15%',
           width: '15%',
           align: 'center',
           align: 'center',
           customRender: (text, row, index) => {
           customRender: (text, row, index) => {
-            return row.category.indexOf('合计') < 0 ? <a-button size="small" type="link" class="button-default">{text}</a-button> : (<a-button size="small" type="link" class="button-error" style="font-weight:bold;font-size:14px;">{text}</a-button>)
-          } },
+            const isStrong = row.category.indexOf('合计') >= 0
+            const isRed = row.category == '全品类(含NGK)' || row.category == '箭牌喇叭' || row.category == '轮胎'
+            if (isStrong || isRed) {
+              return <a-button size="small" type="link" class="button-error" style="font-weight:bold;font-size:14px;">{text}</a-button>
+            }
+            return <a-button size="small" type="link" class="button-default">{text}</a-button>
+          }
+        },
         { title: '成本', dataIndex: 'cost', width: '10%', align: 'center', customRender: renderContent },
         { title: '成本', dataIndex: 'cost', width: '10%', align: 'center', customRender: renderContent },
         { title: '销售额', dataIndex: 'amount', width: '10%', align: 'center', customRender: renderContent },
         { title: '销售额', dataIndex: 'amount', width: '10%', align: 'center', customRender: renderContent },
         { title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: renderContent },
         { title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: renderContent },