lilei hace 2 meses
padre
commit
3110cc5595
Se han modificado 1 ficheros con 19 adiciones y 4 borrados
  1. 19 4
      src/views/reportData/regionTypeBusinessReport/list.vue

+ 19 - 4
src/views/reportData/regionTypeBusinessReport/list.vue

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