lilei há 7 meses atrás
pai
commit
4ad4d289c9

+ 46 - 6
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -10,6 +10,7 @@
       row-key-field-name="id"
       :checkbox-option="checkboxOption"
       :column-width-resize-option="columnWidthResizeOption"
+      :cell-style-option="cellStyleOption"
       :row-style-option="{clickHighlight: true}"
       :cellSelectionOption="{enable: false}"
       :virtual-scroll-option="{enable: false}"
@@ -19,8 +20,10 @@
 </template>
 
 <script>
+import { commonMixin } from '@/utils/mixin'
 import { salesPromoDetailCount } from '@/api/salesDetailNew'
 export default {
+  mixins: [commonMixin],
   props: {
     activeList: {
       type: Array,
@@ -63,6 +66,28 @@ export default {
           console.log(isSelected, selectedRowKeys)
         }
       },
+      // 单元格样式
+      cellStyleOption: {
+        headerCellClass: ({ column, rowIndex }) => {
+          if (column.field == 'col2' || column.field == 'col3' || column.field == 'col4') {
+            return 'table-header-cell-blue'
+          }
+          if (column.field == 'col6' || column.field == 'col7' || column.field == 'col8' || column.field == 'col9') {
+            return 'table-header-cell-red'
+          }
+          if (column.field == 'col11' || column.field == 'col12' || column.field == 'col13') {
+            return 'table-header-cell-green'
+          }
+          if (column.field == 'col14' || column.field == 'col15' || column.field == 'col16' || column.field == 'col17') {
+            return 'table-header-cell-org'
+          }
+          if (column.field == 'col18' || column.field == 'col19' || column.field == 'col20') {
+            return 'table-header-cell-zs'
+          }
+        },
+        bodyCellClass: ({ row, column, rowIndex }) => {
+        }
+      },
       columns: [
         {
           field: '',
@@ -84,8 +109,8 @@ export default {
             return ++rowIndex
           }
         },
-        { field: 'promotionRuleType', key: 'ruletype', width: 100, title: '活动类型', align: 'center', fixed: 'left' },
-        { field: 'promotionRuleDesc', key: 'ruledesc', width: 100, title: '规则简称', align: 'center', fixed: 'left' },
+        { field: 'promotionRuleType', key: 'ruletype', width: 100, title: '活动类型', align: 'center', fixed: 'left', ellipsis: { showTitle: true } },
+        { field: 'promotionRuleDesc', key: 'ruledesc', width: 100, title: '规则简称', align: 'center', fixed: 'left', ellipsis: { showTitle: true } },
         {
           title: '门槛产品(数量/金额)',
           children: [
@@ -104,7 +129,7 @@ export default {
               align: 'center'
             },
             {
-              field: 'col5',
+              field: 'col4',
               key: 'e',
               title: '差额',
               width: 50,
@@ -137,7 +162,7 @@ export default {
               align: 'center'
             },
             {
-              field: 'col10',
+              field: 'col9',
               key: 'l',
               title: '差额',
               width: 50,
@@ -232,8 +257,8 @@ export default {
         },
         { field: 'totalCategory', key: 'ks', title: '款数', width: 50, align: 'center', fixed: 'right' },
         { field: 'totalQty', key: 'dsl', title: '数量', width: 50, align: 'center', fixed: 'right' },
-        { field: 'totalAmount', key: 'dje', title: '总金额', width: 60, align: 'center', fixed: 'right' },
-        { field: 'lossAmount', key: 'dyhje', title: '优惠金额', width: 60, align: 'center', fixed: 'right' },
+        { field: 'totalAmount', key: 'dje', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
+        { field: 'lossAmount', key: 'dyhje', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
         {
           field: '',
           key: 'action',
@@ -353,4 +378,19 @@ export default {
 </script>
 
 <style>
+  .table-header-cell-blue {
+    background: #c9fbff !important;
+  }
+  .table-header-cell-red {
+    background: #ffdccb !important;
+  }
+  .table-header-cell-green {
+    background: #deffec !important;
+  }
+  .table-header-cell-zs {
+    background: #fff2ff !important;
+  }
+  .table-header-cell-org {
+    background: #fff3c2 !important;
+  }
 </style>