|
@@ -91,10 +91,13 @@ 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: {
|
|
@@ -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,14 @@ 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 || 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: 'amount', width: '10%', align: 'center', customRender: renderContent },
|
|
|
{ title: '毛利', dataIndex: 'gross', width: '10%', align: 'center', customRender: renderContent },
|