Browse Source

Merge branch 'develop_yh33' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh35

lilei 1 year ago
parent
commit
715ba9617c
1 changed files with 33 additions and 31 deletions
  1. 33 31
      src/views/salesManagement/salesQueryNew/list.vue

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

@@ -438,28 +438,34 @@ export default {
       showCols: [], // 列表显示列
       colsArr: [
         {
-          title: '取消数量',
-          value: 'showCancelQty',
-          key: 'showCancelQty',
+          title: '取消数量',
+          value: 'totalCancelQty',
+          key: 'totalCancelQty',
           disabled: false
         },
         {
           title: '待下推数量',
-          value: 'showPushedQty',
-          key: 'showPushedQty',
+          value: 'totalUnpushedQty',
+          key: 'totalUnpushedQty',
           disabled: false
         },
         {
           title: '待下推金额',
-          value: 'showPushedPrice',
-          key: 'showPushedPrice',
+          value: 'totalUnpushedAmount',
+          key: 'totalUnpushedAmount',
           disabled: !this.$hasPermissions('M_salesQueryList_salesPrice')
         },
         {
           title: '转采购额数量',
-          value: 'showPurchaseQty',
-          key: 'showPurchaseQty',
+          value: 'totalConvertPromoGiftsQty',
+          key: 'totalConvertPromoGiftsQty',
           disabled: false
+        },
+        {
+          title: '转采购额金额',
+          value: 'totalConvertPromoGiftsAmount',
+          key: 'totalConvertPromoGiftsAmount',
+          disabled: !this.$hasPermissions('M_salesQueryList_salesPrice')
         }
       ]
     }
@@ -474,8 +480,15 @@ export default {
         { title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '8%', align: 'left', ellipsis: true },
         { title: '总数量', dataIndex: 'totalQty', scopedSlots: { customRender: 'totalQty' }, width: '4%', align: 'center' },
+        { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'right',isShow:false,customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '已下推数量', dataIndex: 'totalPushedQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '4%', align: 'right', isShow:false, customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: '4%', align: 'center', isShow:false, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待下推金额', dataIndex: 'totalUnpushedAmount', width: '4%', align: 'right',isShow:false,  customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '已发货数量', dataIndex: 'totalDispatchQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已取消数量', dataIndex: 'totalCancelQty', width: '4%', align: 'center',isShow:false,  customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '转采购额数量', dataIndex: 'totalConvertPromoGiftsQty', width: '4%', align: 'center',isShow:false,  customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '转采购额金额', dataIndex: 'totalConvertPromoGiftsAmount', width: '4%', align: 'right',isShow:false,  customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
         { title: '最近备货时间', dataIndex: 'lastStockUpDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
@@ -484,28 +497,17 @@ export default {
         { title: '备货打印状态', dataIndex: 'printStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
-      if (this.$hasPermissions('M_salesQueryList_salesPrice')) { // 售价权限
-        arr.splice(6, 0, { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(8, 0, { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '4%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      }
-      if (this.showCols.includes('showCancelQty')) {
-        const pos = this.$hasPermissions('M_salesQueryList_salesPrice') ? 9 : 7
-        arr.splice(pos, 0, { title: '已取消数量', dataIndex: 'totalCancelQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      if (this.showCols.includes('showPushedQty')) {
-        const pos = this.$hasPermissions('M_salesQueryList_salesPrice') && this.showCols.includes('showCancelQty') ? 11 : 8
-        arr.splice(pos, 0, { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      if (this.$hasPermissions('M_salesQueryList_salesPrice') && this.showCols.includes('showPushedPrice')) {
-        const pos = this.showCols.includes('showCancelQty') && this.showCols.includes('showPushedQty') ? 12 : 10
-        arr.splice(pos, 0, { title: '待下推金额', dataIndex: 'totalUnpushedAmount', width: '4%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      }
-
-      if (this.showCols.includes('showPurchaseQty')) {
-        const pos = this.$hasPermissions('M_salesQueryList_salesPrice') && this.showCols.includes('showCancelQty') && this.showCols.includes('showPushedQty') ? 13 : 10
-        arr.splice(pos, 0, { title: '转采购额数量', dataIndex: 'totalConvertPromoGiftsQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      }
-      return arr
+      
+      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)
+        }
+      })
+      console.log(arr)
+      return arr.filter(item => !this.colsArr.find(k=>k.value==item.dataIndex) || item.isShow)
     }
   },
   methods: {