소스 검색

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

chenrui 1 년 전
부모
커밋
9af9228108
2개의 변경된 파일79개의 추가작업 그리고 39개의 파일을 삭제
  1. 1 1
      src/views/dealerManagement/rebateBinding/priceDiffModal.vue
  2. 78 38
      src/views/reportData/promotionSalesOrderReport/list.vue

+ 1 - 1
src/views/dealerManagement/rebateBinding/priceDiffModal.vue

@@ -177,7 +177,7 @@ export default {
       this.form.dealerSn = undefined
       this.form.cjgsf = []
       this.zdDealearList = []
-      if (this.$refs.custList) {
+      if (this.showPercent1) {
         this.$refs.custList.resetForm()
       }
     },

+ 78 - 38
src/views/reportData/promotionSalesOrderReport/list.vue

@@ -123,42 +123,55 @@
           bordered>
           <!-- 品牌-->
           <template slot="brandName" slot-scope="text, record">
-            {{ record.allProductBrandFlag?'全品类':record.brandName?record.brandName:'--' }}
+            {{ record.allProductBrandFlag==1?'全品牌':record.brandName?record.brandName:'--' }}
           </template>
           <!-- 分类 -->
           <template slot="brandtypeName" slot-scope="text, record">
-            {{ record.allProductTypeFlag?'全分类':record.brandtypeName?record.brandtypeName:'--' }}
+            {{ record.allProductTypeFlag==1?'全分类':record.brandtypeName?record.brandtypeName:'--' }}
           </template>
           <template slot="footer" v-if="totalData">
             <a-row>
               <a-col span="24">
                 <a-row>
                   <a-col
-                    span="4">销售额:{{ (totalData.totalSaleAmount || totalData.totalSaleAmount==0) ? toThousands(totalData.totalSaleAmount) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">销售额:{{ (totalData.totalSaleAmount || totalData.totalSaleAmount==0) ? toThousands(totalData.totalSaleAmount) : '--' }}</a-col>
                   <a-col
-                    span="4">促销成本费用:{{ (totalData.promoCostFee || totalData.promoCostFee==0) ? toThousands(totalData.promoCostFee) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">促销成本费用:{{ (totalData.promoCostFee || totalData.promoCostFee==0) ? toThousands(totalData.promoCostFee) : '--' }}</a-col>
                   <a-col
-                    span="4">促销成本费用比:{{ totalData.promoCostFeeRate ? toThousands(totalData.promoCostFeeRate*100)+'%' : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">促销成本费用比:{{ totalData.promoCostFeeRate ? (totalData.promoCostFeeRate*100).toFixed(2)+'%' : '--' }}</a-col>
                   <a-col
-                    span="4">促销销售费用:{{ (totalData.promoSaleFee || totalData.promoSaleFee==0) ? toThousands(totalData.promoSaleFee) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">促销销售费用:{{ (totalData.promoSaleFee || totalData.promoSaleFee==0) ? toThousands(totalData.promoSaleFee) : '--' }}</a-col>
                   <a-col
-                    span="4">促销销售费用比:{{ totalData.promoSaleFeeRate ? toThousands(totalData.promoSaleFeeRate*100)+'%' : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">促销销售费用比:{{ totalData.promoSaleFeeRate ? (totalData.promoSaleFeeRate*100).toFixed(2)+'%' : '--' }}</a-col>
                   <a-col
-                    span="4">参与活动销售额:{{ (totalData.promoSaleAmount || totalData.promoSaleAmount==0) ? toThousands(totalData.promoSaleAmount) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">参与活动销售额:{{ (totalData.promoSaleAmount || totalData.promoSaleAmount==0) ? toThousands(totalData.promoSaleAmount) : '--' }}</a-col>
                   <a-col
-                    span="4">未参与活动销售额:{{ (totalData.notpromotionSale || totalData.notpromotionSale==0) ? toThousands(totalData.notpromotionSale) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">未参与活动销售额:{{ (totalData.notpromotionSale || totalData.notpromotionSale==0) ? toThousands(totalData.notpromotionSale) : '--' }}</a-col>
                   <a-col
-                    span="4">调拨物料成本费用:{{ (totalData.allocateCost || totalData.allocateCost==0) ? toThousands(totalData.allocateCost) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">调拨物料成本费用:{{ (totalData.allocateCost || totalData.allocateCost==0) ? toThousands(totalData.allocateCost) : '--' }}</a-col>
                   <a-col
-                    span="4">调拨物料销售费用:{{ (totalData.allocateSaleAmount || totalData.allocateSaleAmount==0) ? toThousands(totalData.allocateSaleAmount) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">调拨物料销售费用:{{ (totalData.allocateSaleAmount || totalData.allocateSaleAmount==0) ? toThousands(totalData.allocateSaleAmount) : '--' }}</a-col>
                   <a-col
-                    span="4">促销成本费用+物料成本费用合计:{{ (totalData.promoCostFeeAndAllocateCost || totalData.promoCostFeeAndAllocateCost==0)? toThousands(totalData.promoCostFeeAndAllocateCost) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">促销成本费用+物料成本费用合计:{{ (totalData.promoCostFeeAndAllocateCost || totalData.promoCostFeeAndAllocateCost==0)? toThousands(totalData.promoCostFeeAndAllocateCost) : '--' }}</a-col>
                   <a-col
-                    span="4">成本合计占比:{{ totalData.totalCostRate ? toThousands(totalData.totalCostRate*100)+'%' : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_costPrice')">成本合计占比:{{ totalData.totalCostRate ? (totalData.totalCostRate*100).toFixed(2)+'%' : '--' }}</a-col>
                   <a-col
-                    span="4">促销销售费用+物料销售费用合计:{{ (totalData.promoSaleFeeAndAllocateAmount || totalData.promoSaleFeeAndAllocateAmount==0) ? toThousands(totalData.promoSaleFeeAndAllocateAmount) : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">促销销售费用+物料销售费用合计:{{ (totalData.promoSaleFeeAndAllocateAmount || totalData.promoSaleFeeAndAllocateAmount==0) ? toThousands(totalData.promoSaleFeeAndAllocateAmount) : '--' }}</a-col>
                   <a-col
-                    span="4">销售合计占比:{{ totalData.totalSaleRate ? toThousands(totalData.totalSaleRate*100)+'%' : '--' }}</a-col>
+                    span="4"
+                    v-if="$hasPermissions('M_promotionSalesOrderReportList_salesPrice')">销售合计占比:{{ totalData.totalSaleRate ? (totalData.totalSaleRate*100).toFixed(2)+'%' : '--' }}</a-col>
                 </a-row>
               </a-col>
             </a-row>
@@ -213,29 +226,6 @@ export default {
       form: {
         monthInfo: [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
       },
-      columns: [
-        { 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: 'center', 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: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
-        { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
-        { 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: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
-        { title: '促销销售费用+物料销售费用合计', dataIndex: 'promoSaleFeeAndAllocateAmount', width: '100px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '销售合计占比', dataIndex: 'totalSaleRate', width: '90px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') }
-      ],
       rules: {
         monthInfo: [{ required: true, message: '请选择统计月份', trigger: 'change' }]
       },
@@ -272,6 +262,54 @@ export default {
       totalData: null
     }
   },
+  computed: {
+    columns () {
+      const _this = this
+      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) + '%' : '--') }
+      ]
+      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
+    }
+  },
   watch: {
     advanced (newValue, oldValue) {
       const _this = this
@@ -332,9 +370,11 @@ export default {
           _this.showExport = true
           _this.exportLoading = true
           _this.spinning = true
+          _this.$store.state.app.curActionPermission = 'B_brandTypeReportExport'
           hdExportExcel(brandTypeReportExport, params, '促销销售单报表(统计)', function () {
             _this.exportLoading = false
             _this.spinning = false
+            _this.$store.state.app.curActionPermission = ''
           })
         } else {
           return false