lilei 1 год назад
Родитель
Сommit
927da1cdf9

+ 39 - 23
src/views/reportData/priceDifferenceDetailReport/list.vue

@@ -43,6 +43,11 @@
                 <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="区域/分区">
+                <subarea id="priceDifferenceDetailList-allocateTypeSn" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-model-item>
+            </a-col>
             <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
               <a-form-item label="单据类型">
                 <v-select
@@ -55,7 +60,7 @@
               </a-form-item>
             </a-col>
 
-            <a-col :md="isShowCustomerSearch?6:24" :sm="24" style="margin-bottom: 10px;" :style="{textAlign: isShowCustomerSearch?'':'center'}">
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="priceDifferenceDetailList-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="priceDifferenceDetailList-reset">重置</a-button>
               <a-button
@@ -91,17 +96,15 @@
           <template slot="footer">
             <table>
               <tr>
-                <td width="41%" colspan="4">总计:</td>
-                <td width="8%" align="right">
-                  <div>实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</div>
-                </td>
-                <td width="8%" align="right">
-                  <div>开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</div>
+                <td width="16%" colspan="3">总计:</td>
+                <td width="76%" colspan="8" style="display:flex;justify-content: space-between;">
+                  <span>实售金额:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? toThousands(totalData.totalRealAmount) : '--' }}</span>
+                  <span>开单金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</span>
+                  <span>销售一部差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</span>
+                  <span>销售二部差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</span>
+                  <span>差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</span>
                 </td>
-                <td width="8%" align="right">
-                  <div>差价金额:{{ (totalData && (totalData.directRebateAmount || totalData.directRebateAmount==0)) ? toThousands(totalData.directRebateAmount) : '--' }}</div>
-                </td>
-                <td width="34%" colspan="3"></td>
+                <td width="8%"></td>
               </tr>
             </table>
           </template>
@@ -141,7 +144,11 @@ export default {
         parentDealerSn: undefined,
         buyerSn: undefined,
         bizUserSn: undefined,
-        bizType: undefined // 单据类型
+        bizType: undefined, // 单据类型
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        }
       },
       rules: {
         'month': [{ required: true, message: '请选择月份', trigger: 'change' }],
@@ -180,17 +187,19 @@ export default {
     columns () {
       const _this = this
       const arr = [
-        { title: '月份', dataIndex: 'bizDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'provinceName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '记账门店', dataIndex: 'parentDealerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '月份', dataIndex: 'bizDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', show: true, width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', show: true, width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'provinceName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '记账门店', dataIndex: 'parentDealerName', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品品牌+二级分类', dataIndex: 'productBrandAndType2', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      arr.splice(4, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      arr.splice(5, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      arr.splice(6, 0, { title: '差价金额', dataIndex: 'directRebateAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      arr.splice(7, 0, { title: '记账费用', dataIndex: 'rebateAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(4, 0, { title: '实售金额', dataIndex: 'totalRealAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(5, 0, { title: '开单金额', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(6, 0, { title: '差价金额', dataIndex: 'directRebateAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(7, 0, { title: '记账费用', dataIndex: 'rebateAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     }
   },
@@ -201,6 +210,11 @@ export default {
     disabledDate (current) {
       return current && current > moment().endOf('day')
     },
+    // 区域分区
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
     // 合计
     getCount (params) {
       reportRebateCount(params).then(res => {
@@ -237,10 +251,12 @@ export default {
       this.queryParam.buyerSn = undefined
       this.queryParam.bizUserSn = undefined
       this.queryParam.bizType = undefined
-
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.subareaAreaSn = undefined
       this.$refs.rebateDealerList.resetForm()
       this.totalData = null
       this.$refs.custList.resetForm()
+      this.$refs.subarea.clearData()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },

+ 27 - 41
src/views/reportData/promotionSalesOrderReport/list.vue

@@ -265,49 +265,35 @@ export default {
   computed: {
     columns () {
       const _this = this
+      const isCostFlag = this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')
+      const isSellFlag = this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')
       const arr = [
-        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域负责人', dataIndex: 'bizUserName', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealerInfo.provinceName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerInfo.dealerName', width: '130px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandName' } },
-        { title: '二级分类', dataIndex: 'brandtypeName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } }
-        // { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        // { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
-        // { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
-        // { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '调拨物料成本费用', dataIndex: 'allocateCost', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '调拨物料销售费用', dataIndex: 'allocateSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '促销成本费用+物料成本费用合计', dataIndex: 'promoCostFeeAndAllocateCost', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '成本合计占比', dataIndex: 'totalCostRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
-        // { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
-        // { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
+        { title: '区域', dataIndex: 'subareaArea.subareaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域负责人', dataIndex: 'bizUserName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'dealerInfo.provinceName', show: true, width: '70px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerInfo.dealerName', show: true, width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'dealerInfo.dealerLevelDictValue', show: true, width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', show: true, width: '80px', align: 'center', scopedSlots: { customRender: 'brandName' } },
+        { title: '二级分类', dataIndex: 'brandtypeName', show: true, width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } },
+        { title: '销售额', dataIndex: 'totalSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '促销成本费用', dataIndex: 'promoCostFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
+        { title: '促销销售费用', dataIndex: 'promoSaleFee', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', show: true, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
+        { title: '参与活动销售额', dataIndex: 'promoSaleAmount', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '未参与活动销售额', dataIndex: 'notpromotionSale', show: true, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '产品赠品成本费用', dataIndex: 'allocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '产品赠品销售费用', dataIndex: 'allocateSaleAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '物料赠品成本费用', dataIndex: 'allocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '物料赠品销售费用', dataIndex: 'allocateSaleAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '促销成本费用+产品/物料成本费用', dataIndex: 'promoCostFeeAndAllocateCost', show: isCostFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '成本合计占比', dataIndex: 'totalCostRate', show: isCostFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') },
+        { title: '促销销售费用+产品/物料销售费用', dataIndex: 'promoSaleFeeAndAllocateAmount', show: isSellFlag, width: '80px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') },
+        { title: '销售合计占比', dataIndex: 'totalSaleRate', show: isSellFlag, width: '60px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') }
       ]
-      if (this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')) { //  售价权限
-        const isCostFlag = this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')
-        arr.splice(8, 0, { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 11 : 9, 0, { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 12 : 10, 0, { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-        arr.splice(isCostFlag ? 12 : 11, 0, { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 13 : 12, 0, { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 16 : 13, 0, { title: '调拨物料销售费用', dataIndex: 'allocateSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 19 : 14, 0, { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isCostFlag ? 20 : 15, 0, { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-      }
-      if (this.$hasPermissions('M_promotionSalesOrderReportList_costPrice')) { //  成本
-        const isSellFlag = this.$hasPermissions('M_promotionSalesOrderReportList_salesPrice')
-        arr.splice(isSellFlag ? 9 : 8, 0, { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isSellFlag ? 10 : 9, 0, { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-        arr.splice(isSellFlag ? 15 : 10, 0, { title: '调拨物料成本费用', dataIndex: 'allocateCost', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isSellFlag ? 17 : 11, 0, { title: '促销成本费用+物料成本费用合计', dataIndex: 'promoCostFeeAndAllocateCost', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? _this.toThousands(text) : '--') })
-        arr.splice(isSellFlag ? 18 : 12, 0, { title: '成本合计占比', dataIndex: 'totalCostRate', width: '90px', align: 'center', customRender: text => (text ? (text * 100).toFixed(2) + '%' : '--') })
-      }
-      return arr
+
+      return arr.filter(item => item.show)
     }
   },
   watch: {