lilei 6 месяцев назад
Родитель
Сommit
af91bb27f1
1 измененных файлов с 13 добавлено и 23 удалено
  1. 13 23
      src/views/reportData/salesOrderTotal/list.vue

+ 13 - 23
src/views/reportData/salesOrderTotal/list.vue

@@ -127,19 +127,8 @@
     </a-card>
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
-        <div style="margin-bottom:12px;text-align: right;">
-          <span>显示:</span>
-          <a-tree-select
-            size="small"
-            v-model="showCols"
-            style="min-width: 200px"
-            dropdownMatchSelectWidth
-            :maxTagCount="3"
-            id="salesOrderTotalList-isShowColumn"
-            :tree-data="colsArr"
-            tree-checkable
-            placeholder="请选择要显示的列(多选)"
-          />
+        <div style="margin-bottom:10px;text-align: right;">
+          <hideCellMenus :defHiddenKes="colsArr" v-model="showCols"></hideCellMenus>
         </div>
         <!-- 列表 -->
         <s-table
@@ -186,6 +175,7 @@ import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import custList from '@/views/common/custList.vue'
 import reportModal from '@/views/common/reportModal.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 import customerService from '@/views/common/customerService.vue'
 import Area from '@/views/common/area.js'
 // 接口
@@ -194,7 +184,7 @@ import { reportSalesBillList, reportSalesBillCount, reportSalesBillExport } from
 export default {
   name: 'SalesOrderTotalList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, custList, subarea, reportModal, Area, customerService },
+  components: { STable, VSelect, rangeDate, custList, subarea, reportModal, Area, customerService, hideCellMenus },
   data () {
     return {
       spinning: false,
@@ -254,15 +244,15 @@ export default {
       colsArr: [
         {
           title: '直接差价金额(明细)',
-          value: 'directRebateAmountInfo',
           key: 'directRebateAmountInfo',
-          disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
+          disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice'),
+          checked: false
         },
         {
           title: '间接差价金额(明细)',
-          value: 'indirectRebateAmountInfo',
           key: 'indirectRebateAmountInfo',
-          disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice')
+          disabled: !this.$hasPermissions('M_salesOrderTotalList_salesPrice'),
+          checked: false
         }
       ],
       showCols: []// 已勾选显示的列
@@ -272,9 +262,9 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售审核时间', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售审核时间', dataIndex: 'auditDate', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户级别', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         // { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -316,13 +306,13 @@ export default {
         arr.push({ title: '特约金额', dataIndex: 'totalSpecialAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.$hasPermissions('M_salesOrderTotalList_salesPrice')) {
-        if (this.showCols.includes('directRebateAmountInfo')) {
+        if (!this.showCols.includes('directRebateAmountInfo')) {
           arr.push({ title: '直接上级差价', dataIndex: 'reportRebateAmountInfo.directRebateUpAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
           arr.push({ title: '直接指定差价', dataIndex: 'reportRebateAmountInfo.directRebateAssignAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
           arr.push({ title: '直接总部差价', dataIndex: 'reportRebateAmountInfo.directRebateHeadAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
         arr.push({ title: '直接差价金额', dataIndex: 'reportRebateAmountInfo.directRebateAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        if (this.showCols.includes('indirectRebateAmountInfo')) {
+        if (!this.showCols.includes('indirectRebateAmountInfo')) {
           arr.push({ title: '间接上级差价', dataIndex: 'reportRebateAmountInfo.indirectRebateUpAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
           arr.push({ title: '间接指定差价', dataIndex: 'reportRebateAmountInfo.indirectRebateAssignAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
           arr.push({ title: '间接总部差价', dataIndex: 'reportRebateAmountInfo.indirectRebateHeadAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })