chenrui před 1 rokem
rodič
revize
1bbcf5270b

+ 65 - 3
src/views/reportData/salesReturnDetailReport/list.vue

@@ -146,6 +146,19 @@
     <!-- 列表 -->
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
+        <div style="text-align:right;margin-bottom:10px;">
+          <span>显示:</span>
+          <a-tree-select
+            size="small"
+            v-model="showCols"
+            style="min-width: 200px"
+            dropdownMatchSelectWidth
+            :maxTagCount="3"
+            :tree-data="colsArr"
+            tree-checkable
+            placeholder="请选择要显示的列(多选)"
+          />
+        </div>
         <s-table
           class="sTable fixPagination"
           ref="table"
@@ -159,10 +172,19 @@
           :scroll="{ x: 2960, y: tableHeight - 60 }"
           :defaultLoadData="false"
           bordered>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <span>{{ record.productCode }}</span>
+            <a-badge count="折" :number-style="{ zoom:'80%' }" v-if="record.priceSetFlag==='PRICE_SET_FLAG_DISCOUNT'"></a-badge>
+          </template>
           <template slot="footer">
             <a-row :gutter="15">
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">开单退货金额:{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? toThousands(totalData.totalPrice) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')&&showCols.includes('priceOrig')">退货开单价(折前):{{ (totalData && (totalData.totalAmountOrig || totalData.totalAmountOrig==0)) ? toThousands(totalData.totalAmountOrig) : '--' }}</a-col>
               <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">实售退货金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')&&showCols.includes('realSalePriceOrig')">退货实售价(折前):{{ (totalData && (totalData.totalRealAmountOrig || totalData.totalRealAmountOrig==0)) ? toThousands(totalData.totalRealAmountOrig) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">直接差价:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</a-col>
+              <a-col :md="4" :sm="24" v-if="$hasPermissions('M_salesReturnDetailReportList_salesPrice')">间接差价:{{ (totalData && (totalData.indirectRebateAmount || totalData.indirectRebateAmount==0)) ? toThousands(totalData.indirectRebateAmount) : '--' }}</a-col>
               <a-col :md="4" :sm="24">仓库实收数量:{{ (totalData && (totalData.receiveQty || totalData.receiveQty==0)) ? totalData.receiveQty : '--' }}</a-col>
               <a-col :md="4" :sm="24">坏件数量:{{ (totalData && (totalData.totalBadQty || totalData.totalBadQty==0)) ? totalData.totalBadQty : '--' }}</a-col>
               <a-col :md="4" :sm="24">良品数量:{{ (totalData && (totalData.goodQty || totalData.goodQty==0)) ? totalData.goodQty : '--' }}</a-col>
@@ -264,7 +286,35 @@ export default {
           return data
         })
       },
-      totalData: null
+      totalData: null,
+      // 列表列显示
+      showCols: [], // 已勾选的列
+      colsArr: [
+        {
+          title: '退货开单价(折前)',
+          value: 'priceOrig',
+          key: 'priceOrig',
+          disabled: false
+        },
+        {
+          title: '退货实售价(折前)',
+          value: 'realSalePriceOrig',
+          key: 'realSalePriceOrig',
+          disabled: false
+        },
+        {
+          title: '直接差价(折前)',
+          value: 'directRebatePriceOrig',
+          key: 'directRebatePriceOrig',
+          disabled: !this.$hasPermissions('M_salesQueryList_salesPrice')
+        },
+        {
+          title: '间接差价(折前)',
+          value: 'indirectRebatePriceOrig',
+          key: 'indirectRebatePriceOrig',
+          disabled: false
+        }
+      ]
     }
   },
   computed: {
@@ -285,7 +335,7 @@ export default {
         { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', scopedSlots: { customRender: 'productCode' }, width: 150, align: 'center' },
 
         { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '退货原因', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
@@ -312,8 +362,14 @@ export default {
       }
       if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) { //  售价权限
         arr.push({ title: '退货开单价', dataIndex: 'price', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('priceOrig')) {
+          arr.push({ title: '退货开单价(折前)', dataIndex: 'priceOrig', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '退货开单金额', dataIndex: 'totalPrice', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '退货实售价', dataIndex: 'realPrice', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('realSalePriceOrig')) {
+          arr.push({ title: '退货实售价(折前)', dataIndex: 'realSalePriceOrig', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '退货实售金额', dataIndex: 'totalRealAmount', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.$hasPermissions('M_salesReturnDetailReportList_cityPrice')) {
@@ -321,7 +377,13 @@ export default {
       }
       if (this.$hasPermissions('M_salesReturnDetailReportList_salesPrice')) {
         arr.push({ title: '直接差价', dataIndex: 'reportRebateAmountInfo.directRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('directRebatePriceOrig')) {
+          arr.push({ title: '直接差价(折前)', dataIndex: 'directRebatePriceOrig', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '间接差价', dataIndex: 'reportRebateAmountInfo.indirectRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.showCols.includes('indirectRebatePriceOrig')) {
+          arr.push({ title: '间接差价(折前)', dataIndex: 'indirectRebatePriceOrig', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        }
         arr.push({ title: '直接上级差价金额', dataIndex: 'reportRebateAmountInfo.directRebateUpAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '间接上级差价金额', dataIndex: 'reportRebateAmountInfo.indirectRebateUpAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.push({ title: '指定差价金额', dataIndex: 'reportRebateAmountInfo.assignRebateAmount', width: 70, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
@@ -472,7 +534,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 200
+      this.tableHeight = window.innerHeight - tableSearchH - 230
     }
   },
   mounted () {