lilei hai 6 meses
pai
achega
f6608f5ea2

+ 23 - 27
src/components/VTable/index.vue

@@ -3,7 +3,7 @@
     <a-spin :spinning="localLoading" tip="Loading...">
       <ve-table
         ref="tableRef"
-        style="width:100%"
+        style="width:100%;word-break:break-all;"
         :max-height="scroll.y"
         :scroll-width="scroll.x"
         :columns="veColumns"
@@ -13,13 +13,13 @@
         :border-y="bordered"
         :border-around="bordered"
         :column-width-resize-option="columnWidthResizeOption"
-        :columnHiddenOption="columnHiddenOption"
+        :cell-style-option="cellStyleOption"
         :row-style-option="{clickHighlight: true}"
         :cellSelectionOption="{enable: false}"
-        :virtual-scroll-option="{enable: true}"
+        :virtual-scroll-option="{enable: !showPagination}"
         :sort-option="sortOption"
       />
-      <div v-show="localDataSource.length==0" :style="{height:scroll.y+'px'}" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
+      <div v-show="localDataSource.length==0" :style="{height:(showPagination?scroll.y-35:scroll.y)+'px',position:!showPagination?'absolute':'relative',top:!showPagination?0:''}" class="empty-data"><a-empty description="暂无数据" :image="simpleImage"/></div>
       <div class="ve-pagination" :class="'ve-pagination-align-'+pageAlign">
         <div class="ve-page-left" v-if="pageAlign=='left'"><slot name="page"></slot></div>
         <a-pagination
@@ -76,11 +76,6 @@ export default {
       type: String,
       default: 'id'
     },
-    // 默认隐藏的列,传 filed 值
-    defaultHiddenColumnKeys: {
-      type: Array,
-      default: () => []
-    },
     // 分页配置
     pagination: {
       type: Object
@@ -117,9 +112,9 @@ export default {
         // column size change
         sizeChange: ({ column, differWidth, columnWidth }) => {}
       },
-      columnHiddenOption: {
-        // default hidden column keys
-        defaultHiddenColumnKeys: this.defaultHiddenColumnKeys
+      // 单元格样式
+      cellStyleOption: {
+        bodyCellClass: ({ row, column, rowIndex }) => {}
       },
       // 排序
       sortOption: {
@@ -144,6 +139,13 @@ export default {
     }
   },
   methods: {
+    // 通过key.key...获取属性值
+    getNestedPropertyValue (obj, path) {
+      return path.split('.').reduce(function (o, p) {
+        if (!o) return
+        return o[p]
+      }, obj || {})
+    },
     // 转换colums数据结构,兼容老页面
     convertColumns (columns) {
       const ret = []
@@ -166,42 +168,38 @@ export default {
             }
             return h('span', column.title)
           },
-          width: item.width.indexOf('%') >= 0 ? item.width.replace('%', '') * 12 : item.width, // 百分比转数字
+          width: String(item.width).indexOf('%') >= 0 ? String(item.width).replace('%', '') * 12 : item.width, // 百分比转数字
           align: item.align,
           fixed: item.fixed,
           sortBy: item.sortBy || item.sorter ? '' : undefined,
           children: item.children ? _this.convertColumns(item.children) : undefined,
           // 自定义单元格
           scopedSlotsKey: item.scopedSlots && item.scopedSlots.customRender,
+          hasEllipsis: item.ellipsis,
           renderBodyCell: ({ row, column, rowIndex }, h) => {
-            const text = row[column.field]
+            // 如果filed 是obj.objkey.objkey...形式
+            const text = column.field ? (column.field.indexOf('.') >= 0 ? _this.getNestedPropertyValue(row, column.field) : row[column.field]) : null
+            // 有自定义单元格
             if (column.scopedSlotsKey) {
               return _this.$scopedSlots[column.scopedSlotsKey](text, row, rowIndex, column)
             }
-            if (item.ellipsis && column.field) {
+            // 省略字符
+            if (item.ellipsis && column.field && text) {
               return (
                 <a-tooltip placement="right">
                   <template slot="title">
                     <span>{text}</span>
                   </template>
-                  <span style="width:100%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{text}</span>
+                  <span class="ve-table-body-td-span-ellipsis" style="-webkit-line-clamp: 1;">{text || '--'}</span>
                 </a-tooltip>
               )
             }
-            return item.customRender ? h('span', item.customRender(text)) : h('span', text || '--')
+            return item.customRender ? item.customRender(text) : text || '--'
           }
         })
       }
       return ret
     },
-    // hidden columns
-    hideColumns (keys) {
-      this.$refs['tableRef'].hideColumnsByKeys(keys)
-    },
-    // show cloumns
-    showColumns (keys) {
-      this.$refs['tableRef'].showColumnsByKeys(keys)
-    },
     /**
      * 加载数据方法
      * @param {Object} pagination 分页选项器
@@ -321,8 +319,6 @@ export default {
     .empty-data{
         color: #999;
         text-align: center;
-        position: absolute;
-        bottom: 0;
         width: 100%;
         display: flex;
         align-items: center;

+ 67 - 0
src/views/common/hideCellMenus.js

@@ -0,0 +1,67 @@
+const HideCellMenus = {
+  template: `
+     <a-dropdown v-model="visibleMenu" @click="visibleMenu=true">
+       <a-menu slot="overlay">
+         <a-menu-item v-for="item in list" :key="item.key">
+           <a-checkbox :checked="item.checked" @change="e=>onHideKeyChange(e.target.checked,item.key)">
+             {{ item.title }}
+           </a-checkbox>
+         </a-menu-item>
+       </a-menu>
+       <a-button :size="size" :id="id"> {{placeholder}} <a-icon type="down" /> </a-button>
+     </a-dropdown>
+    `,
+  props: {
+    defHiddenKes: {
+      type: Array,
+      defatut: function(){
+        return []
+      }
+    },
+    id: {
+      type: String,
+      default: 'hideCellMenus'
+    },
+    placeholder: {
+      type: String,
+      default: '显示更多列'
+    },
+    size: {
+        type: String,
+        default: 'default'
+    },
+  },
+  data() {
+    return {
+      visibleMenu: false,
+      list: this.defHiddenKes.filter(item=> !item.disabled)
+    };
+  },
+  mounted() {
+  },
+  watch: {
+    defHiddenKes: {
+      handler: function (val) {
+        this.list = val.filter(item=> !item.disabled)
+      },
+      immediate: true
+    },
+    list: {
+      handler: function (val) {
+        const hidekey = this.list.filter(item => !item.checked).map(item => item.key)
+        this.$emit('change', hidekey);
+        this.$emit('input', hidekey);
+      },
+      immediate: true
+    }
+  },
+  methods: {
+    onHideKeyChange(checked, key) {
+      const row = this.list.find(item => item.key == key)
+      row.checked = checked
+      this.list.splice()
+    }
+  },
+};
+
+export default HideCellMenus

+ 16 - 31
src/views/salesManagement/salesQueryNew/list.vue

@@ -159,17 +159,7 @@
               </div>
             </div>
             <div>
-              <span>显示:</span>
-              <a-tree-select
-                size="small"
-                v-model="showCols"
-                style="min-width: 200px"
-                dropdownMatchSelectWidth
-                :maxTagCount="3"
-                :tree-data="colsArr"
-                tree-checkable
-                placeholder="请选择要显示的列(多选)"
-              />
+              <hideCellMenus :defHiddenKes="colsArr" v-model="showCols"></hideCellMenus>
             </div>
           </div>
         </div>
@@ -327,6 +317,7 @@ import baseDataModal from '@/views/expenseManagement/expenseReimbursement/baseDa
 import reportModal from '@/views/common/reportModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 import { dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
 import { salesList, salesDel, salesCancle, salesCount, queryCreateBySalesBillSn, expenseAccountSave, changeBillCheckUpdatePrice, changeBillCheck } from '@/api/salesNew'
@@ -335,7 +326,7 @@ import { salesDetailExport } from '@/api/salesBillReport'
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
-  components: { VTable, VSelect, tipModal, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse, baseDataModal, customerService },
+  components: { VTable, VSelect, tipModal, hideCellMenus, chooseCustomModal, dealerSubareaScopeList, Area, rangeDate, subarea, commonModal, reportModal, chooseWarehouse, baseDataModal, customerService },
   data () {
     return {
       spinning: false,
@@ -446,33 +437,32 @@ export default {
       colsArr: [
         {
           title: '已取消数量',
-          value: 'totalCancelQty',
           key: 'totalCancelQty',
-          disabled: false
+          disabled: false,
+          checked: false
         },
         {
           title: '待下推数量',
-          value: 'totalUnpushedQty',
           key: 'totalUnpushedQty',
-          disabled: false
+          disabled: false,
+          checked: false
         },
         {
           title: '待下推金额',
-          value: 'totalUnpushedAmount',
           key: 'totalUnpushedAmount',
           disabled: !this.$hasPermissions('M_salesQueryList_salesPrice')
         },
         {
           title: '转采购额数量',
-          value: 'totalConvertPromoGiftsQty',
           key: 'totalConvertPromoGiftsQty',
-          disabled: false
+          disabled: false,
+          checked: false
         },
         {
           title: '转采购额金额',
-          value: 'totalConvertPromoGiftsAmount',
           key: 'totalConvertPromoGiftsAmount',
-          disabled: !this.$hasPermissions('M_salesQueryList_salesPrice')
+          disabled: !this.$hasPermissions('M_salesQueryList_salesPrice'),
+          checked: false
         }
       ]
     }
@@ -480,7 +470,7 @@ export default {
   computed: {
     columns () {
       const _this = this
-      const arr = [
+      let arr = [
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '8%', align: 'left' },
         { title: '提交时间', slots: { title: 'customDateTitle' }, dataIndex: 'firstSubmitDate', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, sorter: true },
@@ -505,15 +495,10 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '9%', align: 'center' }
       ]
       // 根据权限及勾选按固定顺序动态显示列
-      arr.map(item => {
-        if (this.$hasPermissions('M_salesQueryList_salesPrice')) {
-          item.isShow = ['totalAmount', 'totalPushedAmount', 'totalUnpushedAmount', 'totalConvertPromoGiftsAmount'].includes(item.dataIndex)
-        }
-        if (this.colsArr.find(k => k.value == item.dataIndex)) {
-          item.isShow = this.showCols.includes(item.dataIndex)
-        }
-      })
-      return arr.filter(item => !this.colsArr.find(k => k.value == item.dataIndex) || item.isShow)
+      if (!this.$hasPermissions('M_salesQueryList_salesPrice')) {
+        arr = arr.filter(item => !['totalAmount', 'totalPushedAmount', 'totalUnpushedAmount', 'totalConvertPromoGiftsAmount'].includes(item.dataIndex))
+      }
+      return arr.filter(item => !this.showCols.includes(item.dataIndex))
     }
   },
   methods: {

+ 56 - 46
src/views/salesManagement/shortageStatisticsC/list.vue

@@ -109,44 +109,44 @@
         <!-- alert -->
         <div class="tongji-bar">
           <div>
-            总客户数:<strong>{{ productTotal && (productTotal.totalBuyerQty || productTotal.totalBuyerQty==0) ? productTotal.totalBuyerQty : '--' }}</strong>,
-            总单数:<strong>{{ productTotal && (productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--' }}</strong>,
-            缺货总款数:<strong>{{ productTotal && (productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong>,
-            缺货总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>,
-            <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">缺货总金额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? toThousands(productTotal.totalAmount) : '--' }}</strong></span>
+            <div>
+              总客户数:<strong>{{ productTotal && (productTotal.totalBuyerQty || productTotal.totalBuyerQty==0) ? productTotal.totalBuyerQty : '--' }}</strong>,
+              总单数:<strong>{{ productTotal && (productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--' }}</strong>,
+              缺货总款数:<strong>{{ productTotal && (productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--' }}</strong>,
+              缺货总数量:<strong>{{ productTotal && (productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--' }}</strong>,
+              <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">缺货总金额:<strong>{{ productTotal && (productTotal.totalAmount || productTotal.totalAmount==0) ? toThousands(productTotal.totalAmount) : '--' }}</strong></span>
+            </div>
+            <div>
+              本页客户数:<strong>{{ currentTotal && (currentTotal.totalBuyerQty || currentTotal.totalBuyerQty==0) ? currentTotal.totalBuyerQty : '--' }}</strong>,
+              本页总单数:<strong>{{ currentTotal && (currentTotal.totalRecord || currentTotal.totalRecord==0) ? currentTotal.totalRecord : '--' }}</strong>,
+              本页缺货总款数:<strong>{{ currentTotal && (currentTotal.totalCategory || currentTotal.totalCategory==0) ? currentTotal.totalCategory : '--' }}</strong>,
+              本页缺货总数量:<strong>{{ currentTotal && (currentTotal.totalQty || currentTotal.totalQty==0) ? currentTotal.totalQty : '--' }}</strong>,
+              <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">本页缺货总金额:<strong>{{ currentTotal && (currentTotal.totalAmount || currentTotal.totalAmount==0) ? toThousands(currentTotal.totalAmount) : '--' }}</strong></span>
+            </div>
           </div>
           <div>
-            本页客户数:<strong>{{ currentTotal && (currentTotal.totalBuyerQty || currentTotal.totalBuyerQty==0) ? currentTotal.totalBuyerQty : '--' }}</strong>,
-            本页总单数:<strong>{{ currentTotal && (currentTotal.totalRecord || currentTotal.totalRecord==0) ? currentTotal.totalRecord : '--' }}</strong>,
-            本页缺货总款数:<strong>{{ currentTotal && (currentTotal.totalCategory || currentTotal.totalCategory==0) ? currentTotal.totalCategory : '--' }}</strong>,
-            本页缺货总数量:<strong>{{ currentTotal && (currentTotal.totalQty || currentTotal.totalQty==0) ? currentTotal.totalQty : '--' }}</strong>,
-            <span v-if="$hasPermissions('M_shortageStatisticsCList_salesPrice')">本页缺货总金额:<strong>{{ currentTotal && (currentTotal.totalAmount || currentTotal.totalAmount==0) ? toThousands(currentTotal.totalAmount) : '--' }}</strong></span>
+            <hideCellMenus :defHiddenKes="defHiddenKes" v-model="hidekey"></hideCellMenus>
           </div>
         </div>
         <!-- 列表 -->
-        <s-table
+        <v-table
           class="sTable fixPagination"
           ref="table"
-          :style="{ height: tableHeight+65+'px' }"
+          :style="{ height: tableHeight+32+'px' }"
           size="small"
-          :rowKey="(record) => record.no"
           rowKeyName="no"
-          :pageSize="30"
+          :pagination="{pageSize:30}"
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
-          :scroll="{ x: 2020, y: tableHeight }"
+          :scroll="{y: tableHeight }"
           bordered>
-          <!-- 单号 -->
-          <template slot="salesBillNo" slot-scope="text, record">
-            {{ record.salesBillNo }}
-          </template>
           <template slot="productCode" slot-scope="text, record">
-            <span style="padding-right: 15px;">{{ text }}</span>
-            <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
-            <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
+            <span style="padding-right: 10px;">{{ text }}</span>
+            <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'0.8' }"></a-badge>
+            <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'0.8' }"></a-badge>
           </template>
-        </s-table>
+        </v-table>
       </a-spin>
     </a-card>
   </div>
@@ -156,7 +156,7 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
-import { STable, VSelect } from '@/components'
+import { VTable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import subarea from '@/views/common/subarea.js'
@@ -166,11 +166,12 @@ import ProductBrand from '@/views/common/productBrand.js'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
 import dealerType from '@/views/common/dealerType.js'
+import hideCellMenus from '@/views/common/hideCellMenus'
 import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
 export default {
   name: 'ShortageStatisticsCList',
   mixins: [commonMixin],
-  components: { STable, VSelect, dealerSubareaScopeList, subarea, Area, rangeDate, ProductBrand, ProductType, chooseWarehouse, customerService, dealerType },
+  components: { VTable, VSelect, hideCellMenus, dealerSubareaScopeList, subarea, Area, rangeDate, ProductBrand, ProductType, chooseWarehouse, customerService, dealerType },
   data () {
     return {
       spinning: false,
@@ -221,6 +222,8 @@ export default {
               data.list[i].no = no + i + 1
               if (data.list[i].dealerEntity.dealerTypeName1) {
                 data.list[i].dealerTypeName = data.list[i].dealerEntity.dealerTypeName1 + '>' + data.list[i].dealerEntity.dealerTypeName2
+                data.list[i].offlineReasonType = data.list[i].productEntity.offlineReasonType
+                data.list[i].commonCode = data.list[i].productEntity.commonCode
               }
             }
             this.disabled = false
@@ -233,43 +236,45 @@ export default {
       },
       productType: [],
       productTotal: null,
-      currentTotal: null
+      currentTotal: null,
+      defHiddenKes: [
+        { title: '操作员', key: 'operatorName', checked: false },
+        { title: '缺货说明', key: 'offlineReasonType', checked: false },
+        { title: '通用编码', key: 'commonCode', checked: false }
+      ],
+      hidekey: []
     }
   },
   computed: {
     columns () {
       const arr = [
-        { title: '区域', dataIndex: 'subareaArea.subareaName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: 100, align: 'center' },
-        { title: '省份', dataIndex: 'dealerEntity.provinceName', width: 60, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: 140, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '仓库', dataIndex: 'warehouseName', width: 80, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '客户类型', dataIndex: 'dealerTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: 100, align: 'center' },
+        { title: '省份', dataIndex: 'dealerEntity.provinceName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓库', dataIndex: 'warehouseName', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productEntity.productBrandName', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '二级分类', dataIndex: 'productEntity.productTypeName2', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: 180, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: 120, align: 'left', scopedSlots: { customRender: 'productCode' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 40, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品状态', dataIndex: 'productEntity.stateDictValue', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '缺货数量', dataIndex: 'qty', width: 60, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '缺货成本金额', dataIndex: 'totalCostAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '缺货实售金额', dataIndex: 'totalSalesAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '缺货开单金额', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'operatorName', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '缺货说明', dataIndex: 'productEntity.offlineReasonType', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '通用编码', dataIndex: 'productEntity.commonCode', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '操作员', dataIndex: 'operatorName', key: 'operatorName', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货说明', dataIndex: 'offlineReasonType', key: 'offlineReasonType', width: 80, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '通用编码', dataIndex: 'commonCode', key: 'commonCode', width: 80, align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_shortageStatisticsCList_costPrice')) { //  成本价权限
-        arr.splice(15, 0, { title: '缺货成本金额', dataIndex: 'totalShowCostAmount', width: 90, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(15, 0, { title: '缺货成本金额', dataIndex: 'totalShowCostAmount', width: 80, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       if (this.$hasPermissions('M_shortageStatisticsCList_salesPrice')) { //  售价权限
         const ind = this.$hasPermissions('M_shortageStatisticsCList_costPrice') ? 16 : 15
-        arr.splice(ind, 0, { title: '缺货实售金额', dataIndex: 'totalRealSaleAmount', width: 90, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
-        arr.splice(ind + 1, 0, { title: '缺货开单金额', dataIndex: 'totalAmount', width: 90, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind, 0, { title: '缺货实售金额', dataIndex: 'totalRealSaleAmount', width: 80, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(ind + 1, 0, { title: '缺货开单金额', dataIndex: 'totalAmount', width: 80, align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
-      return arr
+      return arr.filter(item => !this.hidekey.includes(item.key))
     }
   },
   methods: {
@@ -395,7 +400,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 240
+      this.tableHeight = window.innerHeight - tableSearchH - 210
     }
   },
   watch: {
@@ -437,5 +442,10 @@ export default {
      .sTable{
        margin-top: 10px;
      }
+     .tongji-bar{
+       display: flex;
+       align-items: center;
+       justify-content:space-between;
+     }
   }
 </style>

+ 7 - 9
src/views/salesManagement/shortageStatisticsP/list.vue

@@ -91,16 +91,14 @@
           </div>
         </div>
         <!-- 列表 -->
-        <s-table
+        <v-table
           class="sTable fixPagination"
           ref="table"
-          :style="{ height: tableHeight+65+'px' }"
-          size="small"
-          :rowKey="(record) => record.no"
+          :style="{ height: tableHeight+32+'px' }"
           rowKeyName="no"
           :columns="columns"
           :data="loadData"
-          :pageSize="30"
+          :pagination="{pageSize:30}"
           :scroll="{ y: tableHeight }"
           :defaultLoadData="false"
           bordered>
@@ -109,7 +107,7 @@
             <a-badge count="促" v-if="record.promotionFlag=='GIFT'" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
             <a-badge count="特" v-if="record.promotionFlag=='DISCOUNT'" :number-style="{ backgroundColor: '#faad14', zoom:'80%' }"></a-badge>
           </template>
-        </s-table>
+        </v-table>
       </a-spin>
     </a-card>
   </div>
@@ -119,7 +117,7 @@
 import { commonMixin } from '@/utils/mixin'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
-import { STable, VSelect } from '@/components'
+import { VTable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import customerService from '@/views/common/customerService'
@@ -127,7 +125,7 @@ import { oosProductList, oosProductDetailCount, oosProductDetailPageCount, oosDe
 export default {
   name: 'ShortageStatisticsPList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, chooseWarehouse, customerService },
+  components: { VTable, VSelect, rangeDate, chooseWarehouse, customerService },
   data () {
     return {
       spinning: false,
@@ -287,7 +285,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 225
+      this.tableHeight = window.innerHeight - tableSearchH - 190
     }
   },
   watch: {