Browse Source

利润表

hongxudong 1 year ago
parent
commit
19b4b0870d

+ 4 - 0
api/pages/report/report.js

@@ -43,6 +43,10 @@ module.exports = {
     getSaleProfit:'get_sale_profit',
     // 查询部门利润
     getSaleProfitGroupByOrg:'get_sale_profit_group_by_org',
+    // 查询业务员利润
+    getSaleProfitGroupByStaff:'get_sale_profit_group_by_staff',
+    // 查询商品利润
+    getSaleProfitGroupBySku:'get_sale_profit_group_by_sku',
   },
   routeUrl: {
     report: {

+ 4 - 2
app.json

@@ -60,7 +60,6 @@
                 "pages/print-layout/print-layout",
                 "pages/beginner-guide/beginner-guide",
                 "pages/beginner-guide/demo-tutorial/demo-tutorial"
-
             ]
         },
         {
@@ -202,7 +201,10 @@
                 "pages/staff-repay-rank/staff-repay-rank",
                 "pages/detail-report/detail-report",
                 "pages/cus-rec-pay-report/cus-rec-pay-report",
-                "pages/profit-report/profit-report"
+                "pages/profit-report/profit-report",
+                "pages/profit-report/org-rank/org-rank",
+                "pages/profit-report/staff-rank/staff-rank",
+                "pages/profit-report/sku-rank/sku-rank"
             ]
         },
         {

+ 1 - 1
components/dkbase/dk-table/dk-table.wxml

@@ -23,7 +23,7 @@
   <view wx:if="{{tableData && tableData.length>0}}" class="data">
     <view wx:for="{{tableData}}" wx:for-item="tableDataItem" wx:for-index="tableDataIndex" wx:key="tableDataIndex" style="display: flex;background: #fff;padding: 0 19rpx;">
       <view style="{{'width:34rpx;position: relative;border-bottom:'+(tableDataIndex!==tableData.length-1?1:0)+'px solid #E9F0FE;display: flex;align-items: center;'}}">
-        <image style="position: absolute;width: 28.79rpx;height: 21.81rpx;top:15rpx;left:-19rpx;" wx:if="{{tableDataIndex<=2}}" src="{{'../../static/img/index'+(tableDataIndex+1)+'.png'}}" />
+        <image style="position: absolute;width: 28.79rpx;height: 21.81rpx;top:15rpx;left:-19rpx;" wx:if="{{tableDataIndex<=2}}" src="{{'../../../static/img/index'+(tableDataIndex+1)+'.png'}}" />
         <view style="font-family: 'DIN Alternate';font-style: normal;font-weight: 700;font-size: 9px;color: #1B365D;" wx:else>{{tableDataIndex<=8?('0'+(tableDataIndex+1)):(tableDataIndex+1)}}</view>
       </view>
       <view style="width: calc(100% - 34rpx);display: flex;">

+ 2 - 1
i18n/zh-CN.js

@@ -525,7 +525,8 @@ const others = {
   cpEndDate: '到期日期',
   dueText: '即将到期',
   wxRight:'手机授权',
-  webRight:'电脑授权'
+  webRight:'电脑授权',
+  sort:'排序'
 }
 // 组织机构
 const org = {

+ 62 - 254
package-business-analysis/pages/echarts-data.js

@@ -1,187 +1,86 @@
-const option1BarColor = ['#95A8CB','#77C5D5','#9BCBEB','#9FAEE5','#DEC9A3','#D59696','#D7ABD5','#BCC1CA'];
-
 const option1 = {
   tooltip: {
-    trigger: 'item',
-    position: 'inside',
-    padding: [0, 2],
-    formatter: (a) => { return a.name.replaceAll('\n', '') + ':' + a.value },
-    textStyle: {
-      color: '#95A8CB'
+    trigger: 'axis',
+    axisPointer: {
+      type: 'cross',
+      crossStyle: {
+        color: '#999'
+      }
     }
   },
   grid: {
-    left: '13%',
-    height: '79%',
-    width: '74%',
-    y: '-7%',
+    left: '17%',
+    width: '68%',
+    // y: '-7%',
+  },
+  legend: {
+    data: ['销售毛利', '销售毛利率'],
+    left: '0%',
+    // top: '1%'
   },
   xAxis: [
     {
-      offset: 5,
-      axisTick: {
-        show: false,
-      },
-      axisLine: {
-        onZero: false,
-        lineStyle: {
-          color: '#E9F0FE',
-          width: 2
-        },
-      },
-      axisLabel:{textStyle: { fontSize: 8, color: '#95A8CB' }},
       type: 'category',
-      data: [],
+      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+      axisPointer: {
+        type: 'shadow'
+      }
     }
   ],
-  yAxis: [{
-    type: 'value',
-    axisTick: {
-      show: false,
-    },
-    axisLine: {
-      show: true,
-    },
-    axisLabel: {
-      show: true,
-    },
-    splitLine: {
-      lineStyle: {
-        type: 'dashed',
-        color: '#41bc95',
-        opacity: 0.37
+  yAxis: [
+    {
+      type: 'value',
+      name: '销售毛利',
+
+      // interval: 50,
+      axisLabel: {
+        formatter: '¥{value}'
       }
     },
-    min: 0,
-    splitNumber: 3
-  },
-  {
-    type: 'value',
-    axisTick: {
-      show: false,
-    },
-    axisLine: {
-      show: true,
-    },
-    axisLabel: {
-      show: true,
-    },
-    splitLine: {
-      lineStyle: {
-        type: 'dashed',
-        color: '#41bc95',
-        opacity: 0.37
+    {
+      type: 'value',
+      name: '销售毛利率',
+      // min: 0,
+      // max: 100,
+      // min: 0,
+      // max: 25,
+      // interval: 5,
+      axisLabel: {
+        formatter: '{value}%'
       }
-    },
-    min: 0,
-    splitNumber: 3
-  },
-],
+    }
+  ],
   series: [
     {
       name: '销售毛利',
-      barMinHeight:5,
-      barWidth: '20px',
-      data: [],
-      type: 'bar'
+      type: 'bar',
+      color: '#41be92',
+      tooltip: {
+        // valueFormatter: function (value) {
+        //   return value + ' ml';
+        // }
+      },
+      data: [
+        2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
+      ]
     },
     {
       name: '销售毛利率',
-      barMinHeight:5,
-      barWidth: '20px',
-      data: [],
-      type: 'bar'
+      type: 'line',
+      color: '#efc25b',
+      yAxisIndex: 1,
+      tooltip: {
+        // valueFormatter: function (value) {
+        //   return value + ' ml';
+        // }
+      },
+      data: [
+        2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
+      ]
     }
   ]
 };
 
-// const option2 = {
-//   grid: {
-//     left: '15%',
-//     top: '0%',
-//     height: '80%',
-//     width: '60%',
-//     y: '-7%',
-//   },
-//   xAxis: {
-//     axisTick: {
-//       show: false,
-//     },
-//     axisLine: {
-//       show: false,
-//     },
-//     axisLabel: {
-//       show: false,
-//     },
-//     splitLine: {
-//       show: false
-//     }
-//   },
-//   yAxis: [
-//     {
-//       type: 'category',
-//       "inverse":true,
-//       axisTick: {
-//         show: false,
-//       },
-//       axisLine: {
-//         show: false,
-//       },
-//       axisLabel:{
-//         textStyle: { fontSize: 10, color: '#1B365D' }
-//       },
-//       data: [],
-//       splitLine: {
-//         show: false,
-//       }
-//     },
-//     {
-//       type: 'category',
-//       inverse: true,
-//       axisTick: 'none',
-//       axisLine: 'none',
-//       show: true,
-//       axisLabel: {
-//         textStyle: {
-//           color: '#95A8CB',
-//           fontSize: '10'
-//         },
-//         formatter: (value) => {
-//           return '¥ '+value+ '.00';
-//         },
-//       },
-//       data:[]
-//     },
-//   ],
-//   series: [
-//     {
-//       showBackground: true,
-//       backgroundStyle: {
-//         color: '#F8F9FD',
-//         barBorderRadius: 8,
-//       },
-//       barWidth: '6px',
-//       itemStyle:{
-//         color: {
-//           type: 'linear',
-//           x: 0,
-//           y: 0,
-//           x2: 1,
-//           y2: 1,
-//           colorStops: [{
-//             offset: 0, color: '#FFC259' 
-//           }, {
-//             offset: 1, color: '#FFE3AF'
-//           }],
-//           global: false
-//         },
-//         barBorderRadius: 8,
-//       },
-//       data: [],
-//       type: 'bar'
-//     }
-//   ]
-// };
 const option2 = {
   grid: {
     left: '6%',
@@ -340,7 +239,7 @@ const option3 = {
     {
       showBackground: true,
       backgroundStyle: {
-        color: '#85a0f8',
+        color: '#f1f4f9',
         barBorderRadius: 6,
       },
       barWidth: '6px',
@@ -352,9 +251,7 @@ const option3 = {
           x2: 1,
           y2: 1,
           colorStops: [{
-            offset: 0, color: '#11B7C6'
-          }, {
-            offset: 1, color: '#73D5E2'
+            offset: 0, color: '#85a0f8'
           }],
           global: false 
         },
@@ -380,99 +277,10 @@ const getOpData = (data,labelKey,valueKey,optionType)=>{
 
   /* 1:正常的纵向 2:横向标题在左 3:横向标题在上*/
   if(optionType === 1){
-    // options = {...option1}
-    options = {
-      tooltip: {
-        trigger: 'axis',
-        axisPointer: {
-          type: 'cross',
-          crossStyle: {
-            color: '#999'
-          }
-        }
-      },
-      grid: {
-        left: '15%',
-        width: '70%',
-        // y: '-7%',
-      },
-      legend: {
-        data: ['销售毛利', '销售毛利率'],
-        left: '0%',
-        // top: '1%'
-      },
-      xAxis: [
-        {
-          type: 'category',
-          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
-          axisPointer: {
-            type: 'shadow'
-          }
-        }
-      ],
-      yAxis: [
-        {
-          type: 'value',
-          name: '销售毛利',
-    
-          // interval: 50,
-          axisLabel: {
-            formatter: '¥{value}'
-          }
-        },
-        {
-          type: 'value',
-          name: '销售毛利率',
-          // min: 0,
-          // max: 100,
-          // min: 0,
-          // max: 25,
-          // interval: 5,
-          axisLabel: {
-            formatter: '{value}%'
-          }
-        }
-      ],
-      series: [
-        {
-          name: '销售毛利',
-          type: 'bar',
-          color: '#41be92',
-          tooltip: {
-            // valueFormatter: function (value) {
-            //   return value + ' ml';
-            // }
-          },
-          data: [
-            2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
-          ]
-        },
-        {
-          name: '销售毛利率',
-          type: 'line',
-          color: '#efc25b',
-          yAxisIndex: 1,
-          tooltip: {
-            // valueFormatter: function (value) {
-            //   return value + ' ml';
-            // }
-          },
-          data: [
-            2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
-          ]
-        }
-      ]
-    };
-    // options.xAxis.data = data.map(it=>it[labelKey].length>2?(it[labelKey].substring(0,2)+'\n'+it[labelKey].substring(2,4)):it[labelKey])
+    options = {...option1}
     options.xAxis[0].data = data.map(it=>it[labelKey])
-    // options.yAxis[0].data = data.map(it=>getWAmount(it[valueKey]/divisor))
-    // options.yAxis[1].data = data.map(it=>it.profitRate)
-
-    // options.yAxis[0].data = data.map(it=>getWAmount(it[valueKey]/divisor))
-    // options.series[0].data = data.map((it,index)=>{return {value:getWAmount(it.profit/divisor),itemStyle: {color: option1BarColor[index],barBorderRadius: 1}}})
     options.series[0].data = data.map(it=>it.profit)
     options.series[1].data = data.map(it=>it.profitRate)
-console.log('options',options)
     return options;
   }
   if(optionType === 2){

+ 39 - 190
package-business-analysis/pages/profit-report/org-rank/org-rank.js

@@ -1,11 +1,8 @@
 // package5/pages/report/detail/detail.js
 
-const api = require('../../../../utils/api.js');
-const util = require('../../../../utils/util.js')
 const app = getApp()
 const Constants = require('../../../../utils/Constants.js');
 const mixins = require('@/mixins/index.js')
-const common = require('../../../../utils/common.js')
 
 Page({
   mixins: [mixins],
@@ -14,48 +11,43 @@ Page({
    */
   data: {
     service: app.globalData['reportService'],
-    active: 0,
-    createTimeType: {
-      "text": "本月",
-      "value": 3
+    // 查询条件
+    searchContent: [{
+      code: 'makeTime',
+      title: mixins.$t('currentMonth'),
+      defaultValue: 3,
+      searchType: Constants.searchType.date
     },
-    month: [
-      "2024-02-01",
-      "2024-02-29"
-    ],
-    monthFlag: false,
-    monthName: "2024年2月",
-    monthOnChoose: 1706749526365,
-    option1: [
-      {
-        "text": "本日",
-        "value": 1
-      },
-      {
-        "text": "本周",
-        "value": 2
-      },
-      {
-        "text": "本月",
-        "value": 3
-      },
-      {
-        "text": "本年",
-        "value": 5
-      },
-      {
-        "text": "自定义",
-        "value": 0
-      }
+    {
+      code: 'orderBy',
+      title: mixins.$t('sort'),
+      searchType: Constants.searchType.radio,
+      value: 1,
+      options: [
+        {
+          "text": "利润升序",
+          "value": "profitAsc"
+        },
+        {
+          "text": "利润倒序",
+          "value": "profitDesc"
+        },
+        {
+          "text": "利率升序",
+          "value": "rateAsc"
+        },
+        {
+          "text": "利率倒序",
+          "value": "rateDsc"
+        },
+      ],
+    }
     ],
-    orgFlag: false,
-    orgIds: [],
-    orgNames: null,
     tab1Columns: [
       {
         "name": "orgName",
         "title": "门店名称",
-        "width": "40%"
+        "width": "50%"
       },
       {
         "name": "profit",
@@ -67,7 +59,7 @@ Page({
         "after": "%",
         "name": "profitRate",
         "title": "利润率",
-        "width": "30%"
+        "width": "20%"
       }
     ],
     tab1TableData: [],
@@ -83,167 +75,24 @@ Page({
         "value": "0.00"
       }
     ],
-    tab2TableData: [],
-    value1: 3, 
-  },
-
-  dateClick(e){
-    if(e.detail === 0){
-      this.selectComponent("#month-components").toggle(true)  
-      this.dropdowncommit({currentTarget:{dataset:{type:'month'}}})
-    }else{
-      this.getReportData()
-    }
   },
-  onConfirmChooseDate(e) {
-    this.setData({
-      month: this.data.monthOnChoose,
-      monthName: this.formatDate(this.data.monthOnChoose)
-    })
-    this.setData({
-      monthFlag: false
-    })
-    let option1 = this.data.option1
-    option1[option1.length-1].text = this.data.monthName
-    this.setData({
-      option1: option1
-    })
-    this.selectComponent("#month-components").toggle(false)
-    this.getReportData()
-  },
-
-  onCloseChooseDate(e) {
-    this.setData({
-      // monthOnChoose: this.data.month
-      value1: 3,
-
-    })
-    this.setData({
-      monthFlag: false
-    })
-    this.selectComponent("#month-components").toggle()
-    this.getReportData()
-  },
-
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad(options) { },
-
-
+  onLoad(options) {
+    this.getReportData()
+  },
   /** 查询页面展示的所有 */
   getReportData() {
-    // Object.assign({
-      // byDate: this.data.byDate
-    // }, JSON.parse(this.data.searchForm))
-
-    this.excute(this.data.service, this.data.service.getSaleProfitGroupByOrg, {}).then(res => {
+    this.excute(this.data.service, this.data.service.getSaleProfitGroupByOrg, JSON.parse(this.data.searchForm)).then(res => {
       if (res.data.code == Constants.SUCESS_CODE) {
         this.setData({
-          tab1TopData: [{ title: '销售利润(总额)', type: 'amount', value: common.toThousandCents(res.data.data.profit.profit) },
-          { title: '利润率', type: '', value: res.data.data.profit.profitRate + '%' }
-        ],
-          // tab1TableData: util.calc10000(res.data.data,['profit'])
+          tab1TopData: [{ title: '销售利润(总额)', type: 'amount', value: res.data.data.profit ? res.data.data.profit.profit : 0 },
+          { title: '利润率', type: '', value: (res.data.data.profit ? res.data.data.profit.profitRate : 0) + '%' }
+          ],
           tab1TableData: res.data.data.orgProfit
         })
-
-
       }
     })
-
-
-    // let params = {
-    //   tab1:  Object.assign(this.getBeginDateAndEndDate(this.data.month),{ userId:app.globalData.user.userId,monthDate: util.formatDayTimeMoth(new Date(this.data.month)),type: 'f_report_s001_index_org_order', cpId: app.globalData.user.ascpId, orgIds: this.data.orgIds ,dateType:this.data.value1}),
-    // };
-    // api.request(Constants.WX_REPORT + 'select_report_batch', 'POST', params).then(res => {
-    //   if (res.data.code === 200) {
-    //     this.setData({
-    //       tab1TopData: [{ title: '成交额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.data.tab1.sumAmount/10000) },{ title: '成交额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.data.tab1.avgAmount/10000) }],
-    //       tab1TableData: util.calc10000(res.data.data.tab1.items,['kpiOrderAmount','orderAmount'])
-    //     })
-    //   } else {
-    //     console.error("获取报表失败", res)
-    //   }
-    // })
-  },
-     /**
-   * @desc : 日期组件后的回调
-   * @author : 于继渤
-   * @date : 2022/5/24 12:16
-   */
-  dateCommit(e) {
-    let dateType = e.detail.dateType
-    if (dateType === 'accountdate') {
-      if(e.detail.dateDefault.text === '自定义'){
-        this.setData({
-          value1: 0,
-        })
-      }
-      if(e.detail.dateDefault.text === '本月'){
-        this.setData({
-          value1: 3,
-        })
-      }
-      let data = e.detail.date
-      console.log(e)
-      this.setData({
-        month: data,
-        createTimeType: e.detail.dateDefault
-      })
-      this.selectComponent('#create-time-type').toggle();
-    }
-     this.getReportData()
-  },
-  //#region 基础内容
-  /** 根据月份查出第一天和最后一天 参数是时间戳*/
-  getBeginDateAndEndDate(timestamp) {
-    let month = this.data.month
-    let monthStart = month[0] ? month[0] : ''
-    let monthEnd = month[1] ? month[1] : ''
-    if (month && month[0] && (month[0].indexOf('/') != -1)) {
-      monthStart = month[0].replaceAll('/', '-')
-    }
-    if (month && month[1] && (month[1].indexOf('/') != -1)) {
-      monthEnd = month[1].replaceAll('/', '-')
-    }
-    return { beginDate: monthStart, endDate: monthEnd }
-  },
-  formatDate(value) {
-    var time = new Date(value);
-    var year = time.getFullYear();
-    var month = time.getMonth() + 1;
-    return year + "年" + month + "月"
-  },
-  onInput(e) {
-    this.setData({
-      monthOnChoose: e.detail
-    })
-  },
-
-
-  dropdowncommit(e) {
-    this.setData({
-      [e.currentTarget.dataset.type + 'Flag']: true
-    })
-  },
-
-  /** 下拉多选关闭 */
-  muticloseAll(e) {
-    this.setData({
-      orgFlag: false
-    })
-    this.selectComponent("#org-components").toggle()
-  },
-
-  /** 下拉多选确定 */
-  mutiSearchAll(e) {
-    this.setData({
-      orgIds: e.detail.idList,
-      orgNames: e.detail.names,
-      orgFlag: false
-    })
-    this.selectComponent("#org-components").toggle(false)
-    this.getReportData()
   },
-  //#endregion
 })

+ 1 - 1
package-business-analysis/pages/profit-report/org-rank/org-rank.json

@@ -1,4 +1,4 @@
 {
     "usingComponents": {},
     "navigationBarTitleText": "部门利润排行"
-  }
+}

+ 3 - 20
package-business-analysis/pages/profit-report/org-rank/org-rank.wxml

@@ -1,26 +1,9 @@
 <view>
   <!-- 顶部筛选条件 -->
-<van-dropdown-menu>
-  <van-dropdown-item id="create-time-type" title="{{createTimeType.text}}">
-    <dk-dropdown-date id="month-components"  dateType="accountdate" blankFlag="{{false}}" dateDefault='{{createTimeType}}' defaultValue='{{createTimeType.value}}' bind:dateCommit='dateCommit'></dk-dropdown-date>
-  </van-dropdown-item>
-  <van-dropdown-item id="org-components" title="{{orgNames?orgNames:'全部门店' }}" data-type="org" bind:open="dropdowncommit">
-  </van-dropdown-item>
-</van-dropdown-menu>
+  <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" bind:search="getReportData" flgSearchText="{{false}}">
+  </dk-dropdown-menu>
 
   <view style="width: calc(100% - 68rpx);padding: 40rpx 34rpx;">
     <dk-table columns="{{tab1Columns}}" table-data="{{tab1TableData}}" top-data="{{tab1TopData}}" />
   </view>
-</view>
-
-<!-- 选门店 -->
-<dk-muti-dropdown-item show="{{orgFlag}}" docName="客户资料" id='org' typeName='org' bind:muticommit='mutiSearchAll' bind:muticlose='muticloseAll'></dk-muti-dropdown-item>
-
-<!-- 选时间 -->
-<van-popup position="bottom" show="{{ monthFlag }}" bind:close="onCloseChooseDate" class="popup" style="width:100%" custom-style="border-radius:15rpx;">
-  <view style="display:flex;justify-content: space-around;height:80rpx;">
-    <view style="width:45%;text-align: left;color:#b6b6b6;line-height:80rpx;" catchtap="onCloseChooseDate">取消</view>
-    <view style="width:45%;text-align: right;color:#00A7B5;line-height:80rpx;" catchtap="onConfirmChooseDate">确定</view>
-  </view>
-  <van-datetime-picker type="year-month" value="{{ monthOnChoose }}" bind:input="onInput" show-toolbar="{{false}}" formatter="{{formatter}}" />
-</van-popup>
+</view>

+ 3 - 14
package-business-analysis/pages/profit-report/org-rank/org-rank.wxss

@@ -1,15 +1,4 @@
 /* package5/pages/report/detail/detail.wxss */
-page{
-    background: #f8f9fd;
-  }
-  
-  .tab-class{
-    color:  #95A8CB;
-    font-family: 'PingFang SC';
-    font-style: normal;
-    font-weight: 500;
-    font-size: 14px;
-  }
-  .tab-active-class{
-    color: #00A7B5 !important;
-  }
+page {
+  background: #f8f9fd;
+}

+ 6 - 575
package-business-analysis/pages/profit-report/profit-report.js

@@ -1,17 +1,7 @@
-/*******************************************************************************
- * Copyright(c) 2022 dongke All rights reserved. / Confidential
- * 类的信息:
- *		1.程序名称:
- *		2.功能描述:授权登录
- * 编辑履历:
- *		作者				日期					版本				修改内容
- *		于继渤		  2022-04-25	  1.00		   	首页
- *******************************************************************************/
 import * as echarts from '../../../pages/ec-canvas/echarts.min';
 import { getOpData } from '../echarts-data.js'
 const app = getApp()
 const Constants = require('../../../utils/Constants.js');
-const chooseGoodsCommon = require('../../../utils/chooseGoodsCommon.js');
 const util = require('../../../utils/util.js')
 const mixins = require('@/mixins/index.js')
 
@@ -29,231 +19,16 @@ Page({
       defaultValue: 3,
       searchType: Constants.searchType.date
     }],
-    menuBtnInfo: null,
-
-    skuloading: false,
-
-    statusItem: { text: '张三', value: "0" },
-
-    statusItem1: { text: '佛山居然店', value: "0" },
-
-    //用户信息
-    userInfo: {},
-
-    functionItem: {
-      text: '功能分区'
-    },
-    functionRegion: [{ text: '常用功能', checked: true }, { text: '待办工作', checked: true }],
-    functionRegions: [' ', '待办工作'],
-
-    //功能分类
-    regions: [{
-      FunctionName: ' ',
-      FunctionCodeOrder: '01'
-    },
-
-    ],
-
-    functionItems: [],
-    functionItems_two: [],
-    accountTimeType: {
-      text: '本日',
-      value: 3
-    },
-    createTimeType: {
-      text: '本月',
-      value: 3
-    },
     loading: false,
-    pageInfo: {
-      pageSize: 8,
-      currentPage: 1,
-      lastPage: 0,
-    },
-    promotionList_left: [],
-    promotionList_right: [],
-    windowHeight: 0,
-    choosedGoodsList: [],
-
-    currentDate: new Date().getTime() + 100,
-
-    //报表
-
-    lastDate: { text: '本月', value: 3 },
-    option1: [
-      { text: '本日', value: 1 },
-      { text: '本周', value: 2 },
-      { text: '本月', value: 3 },
-      // { text: '本季', value: 4 },
-      { text: '本年', value: 5 },
-      { text: '自定义', value: 0 },
-
-    ],
-    value1: 3,
-
-    orderAnalysis: {},
-    repayAnalysis: {},
-    csmAnalysisHome: {},
-
-    /** 报表数据 */
-
     ec: {},
-    monthName: util.formatDayYm(new Date()),
-    monthFlag: false,
-    month: new Date().getTime(),
-    monthOnChoose: new Date().getTime(),
-    orgFlag: false,
-    orgIds: [],
-    orgNames: null,
-    formatter(type, value) {
-      if (type === 'year') {
-        return `${value}年`;
-      }
-      if (type === 'month') {
-        return `${value}月`;
-      }
-      if (type === 'day') {
-        return `${value}日`;
-      }
-      if (type === 'hour') {
-        return `${value}时`;
-      }
-      if (type === 'minute') {
-        return `${value}分`;
-      }
-      return value;
-    },
-  },
-  // 设置
-  onClickSet() {
-    wx.navigateTo({
-      url: './home-page-setting'
-    })
-  },
-  // 去公告页
-  toNotice() {
-    wx.navigateTo({
-      url: '/package2/pages/notice/notice'
-    })
-  },
-
-
-
-  /**
-    * 选择下拉后查询
-    */
-  dropdowncommit(e) {
-    this.setData({
-      functionRegions: e.detail.dataList
-    })
-    this.selectComponent('#functionItem').toggle();
-  },
-
-  /**
-  * @desc : 非标商品选择事件
-  * @author : 于继渤
-  * @date : 2022/8/24 13:16
-  */
-  nonGlassSpuItemsTap(e) {
-    chooseGoodsCommon.nonGlassSpuItemsTap(e, this)
-  },
-
-  /**
-* @desc : 切换sku商品规格
-* @author : 周兴
-* @date : 2022/6/1 10:16
-*/
-  changeSkuSpecs(e) {
-    chooseGoodsCommon.changeSkuSpecsCommon(e, this);
-  },
-
-  /**
-  * @desc : 切换组合促销明细
-  * @date : 2022/7/5 16:49
-  * @author : 周兴
-  */
-  changeCombinedItem(e) {
-    chooseGoodsCommon.changeCombinedItemCommon(e, this)
-  },
-  /**
-   * @desc : 销售价格编辑
-   * @author : 常皓宁
-   * @date : 2022/5/31 14:45
-   */
-  changeSalesPriceField(e) {
-    let priceSale = e.detail.value;
-    chooseGoodsCommon.changeSalesPriceCommon(priceSale, this)
-  },
-  /**
- * @desc : 修改销售金额
- * @author : 周兴
- * @date : 2022/7/4 14:45
- */
-  changeItemAmountField(e) {
-    chooseGoodsCommon.changeItemAmountFieldCommon(e, this)
-  },
-  /**
-* @desc : 改变标识
-* @author : 周兴
-* @date : 2022/8/6 17:16
-*/
-  changeAllReadyCheckBox(e) {
-    chooseGoodsCommon.changeAllReadyCheckBoxCommon(e, this)
-  },
-
-  /**
-   * @desc : 修改销售价格
-  * @author : 周兴
-  * @date : 2022/7/6 14:45
-  */
-  changeSalesPrice(priceSale) {
-    chooseGoodsCommon.changeSalesPriceCommon(priceSale, this)
   },
 
-  /**
-   * 关闭产品
-   * @param {*} e 
-   */
-  closeAddItemInfo() {
-    chooseGoodsCommon.closeAddItemInfoCommon(this)
-  },
 
-  getCode() {
-    return new Promise((resolve, reject) => {
-      wx.qy.getQrCode({
-        success: function (res) {
-          var qrCode = res.qrCode
-          resolve(qrCode)
-        }
-      })
 
-    })
-  },
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.setData({
-      menuBtnInfo: wx.getMenuButtonBoundingClientRect()
-    })
-
-    let _this = this;
-    wx.getSystemInfo({
-      success: function (res) {
-        _this.setData({
-          windowHeight: res.windowHeight,
-          windowWidth: res.windowWidth
-        })
-      }
-    })
-
-    if (app.globalData.user) {
-      this.setData({
-        userInfo: app.globalData.user,
-      })
-    }
-    wx.setStorageSync('choosedGoodsList', [])
-
     // 报表查询数据
     this.getSaleProfit()
   },
@@ -277,265 +52,6 @@ Page({
 
 
 
-  /**
-   * @desc : 打开商品
-   * @author : 周兴
-   * @date : 2022/7/2 20:16
-   */
-  openAddItemInfo(e) {
-    // chooseGoodsCommon.openAddItemInfoCommon(e,this,'home-page')
-    this.setData({
-      goodsSkuList: []
-    })
-
-    let item = e.currentTarget.dataset.item
-    //促销类型
-    let promotionType = e.currentTarget.dataset.promotiontype
-    //促销类型
-    item.promotionTypeName = e.currentTarget.dataset.promotiontype == 2 ? '组合促销' : '单品促销'
-    item.itemQuantity = 1
-
-    item.activityId = e.currentTarget.dataset.item.activityId
-    item.warehouseId = app.globalData.user.whId
-    item.whId = app.globalData.user.whId
-    item.warehouseName = app.globalData.user.whName
-    item.wh_Name = app.globalData.user.whName
-    // if (item.activityIds && item.activityIds.length > 0) {
-    //   item.activityId = item.activityIds[0] ? item.activityIds[0] : null
-    // }
-    item.activityName = item.activityNames
-    item.orderItemQuantity = item.itemQuantity
-
-    item.pricePromotionName = item.priceName
-    item.promotionId = item.priceId
-    delete item['apvResult']
-    delete item['apvResultName']
-    delete item['apvUserIds']
-    // delete item['combinedTypeList']
-    delete item['flgValid']
-
-    // 组合促销
-    if (promotionType == "2") {
-
-      //促销价
-      item.pricePromotion = e.currentTarget.dataset.item.pricePromotion ? e.currentTarget.dataset.item.pricePromotion : e.currentTarget.dataset.item.sumPrice
-      item.priceSale = item.pricePromotion
-      item.promotionType = Constants.PROMOTION_TYPE.COMBINED
-      if (item.imageInfo.length > 0) {
-        item.iconThumPath = item.imageInfo[0].path
-      }
-      delete item['imageInfo']
-
-      chooseGoodsCommon.getCombinedByPriceId(e, this);
-      this.setData({
-        show1: false,
-        show2: false,
-        show3: false,
-        show4: true,
-        show5: false
-      })
-    }
-    else {
-      // item.titleTag = '单品促销'
-      // item.title = item.skuModel
-      // item.desc = item.skuName
-      item.promotionType = Constants.PROMOTION_TYPE.PRMOTION
-      item.itemAmount = item.sumPrice
-
-      item.pricePromotion = e.currentTarget.dataset.item.pricePromotion ?
-        e.currentTarget.dataset.item.pricePromotion : item.sumPrice
-      item.priceSale = item.sumPrice
-      // 根据spuId获取sku相关信息
-      chooseGoodsCommon.getSkuBySpuId(e, this);
-      this.setData({
-        show1: true,
-        show2: false,
-        show3: false,
-        show4: false,
-        show5: false
-      })
-    }
-
-    this.setData({
-      currentChoosedItem: item,
-      showAdd: true,
-    })
-  },
-
-  /**
-   * @desc : 选择数据
-   * @date : 2022/7/4 16:49
-   * @author : 周兴
-   */
-  chooseSkuInfo() {
-    let currentChoosedItem = this.data.currentChoosedItem
-    currentChoosedItem.goodsSkuList = this.data.goodsSkuList
-    //校验选择商品数量不能为0
-    if (currentChoosedItem.itemQuantity === 0 || !currentChoosedItem.itemQuantity) {
-      wx.showToast({
-        title: '数量不能为0',
-        image: '/static/image/warning.png',
-        duration: 1000
-      })
-      return
-    }
-    //校验除赠品标识外价格不能为0
-    else if (!currentChoosedItem.flgGift && currentChoosedItem.priceSale == 0) {
-      wx.showToast({
-        title: '销售价格未填写',
-        image: '/static/image/warning.png',
-        duration: 1000
-      })
-      return
-    }
-    // 如果是组合需要判断bom中子件是否有标价
-    else if (currentChoosedItem.combinedList && currentChoosedItem.combinedList.length > 0) {
-      // currentChoosedItem.combinedList.forEach(it => {
-      //   if (!it.priceStandard && it.priceStandard != 0) {
-      //     wx.showToast({
-      //       title: '商品标价未设置',
-      //       image: '/static/image/warning.png',
-      //       duration: 1000
-      //     })
-      //     return;
-      //   }
-      // })
-    }
-    // 如果标价为0 不允许加入购物车
-    else if (!currentChoosedItem.priceStandard && currentChoosedItem.priceStandard != 0) {
-      // wx.showToast({
-      //   title: '商品标价未设置',
-      //   image: '/static/image/warning.png',
-      //   duration: 1000
-      // })
-      // return;
-    }
-    // 如果没有sku 那么不允许
-    if (currentChoosedItem.promotionType != Constants.PROMOTION_TYPE.COMBINED && (!currentChoosedItem.skuId || currentChoosedItem.skuId == 0)) {
-      wx.showToast({
-        title: '未选择商品规格',
-        image: '/static/image/warning.png',
-        duration: 1000
-      })
-      return
-    }
-    // 已选商品列表
-    let choosedGoodsList = this.data.choosedGoodsList
-
-
-    // 判断商品是否在已选列表中存在
-    let filterRows = choosedGoodsList.filter(it => it.id == currentChoosedItem.id);
-    let currentChoosedItemTemp = { ...currentChoosedItem }
-    if (!filterRows || filterRows.length == 0) {
-      if (!this.data.showChoosedFlag) {
-        choosedGoodsList.push(currentChoosedItemTemp)
-      }
-
-    }
-    this.setData({
-      choosedGoodsList: choosedGoodsList,
-      showAdd: false
-    })
-
-    choosedGoodsList.forEach(res => {
-      res.id = util.getGuid()
-    })
-
-    let choosedGoodsListSync = wx.getStorageSync('choosedGoodsList')
-    if (choosedGoodsListSync.length > 0) {
-      let filterRows = choosedGoodsListSync.filter(it => it.priceId + '_' + it.spuId
-        == currentChoosedItem.priceId + '_' + currentChoosedItem.spuId);
-      if (!filterRows || filterRows.length == 0) {
-        choosedGoodsListSync.push(currentChoosedItem)
-      }
-    } else {
-      choosedGoodsListSync.push(currentChoosedItem)
-    }
-
-
-
-    wx.setStorageSync('choosedGoodsList', choosedGoodsListSync)
-    wx.setStorageSync('homeData', {
-      skuData: this.data.skuData ? this.data.skuData : [],
-      skuSpecsData: this.data.skuSpecsData ? this.data.skuSpecsData : [],
-      skuSpecsList: this.data.skuSpecsList ? this.data.skuSpecsList : [],
-    })
-
-    let cartNum = choosedGoodsListSync.length  //默认数据
-    if (cartNum != 0) {
-      //设置角标
-      wx.setTabBarBadge({
-        index: 2, //第几个tab
-        text: cartNum.toString()
-      })
-    } else {
-      //移除角标
-      wx.removeTabBarBadge({
-        index: 2,
-      })
-    }
-
-    //计算合计金额
-    chooseGoodsCommon.getSumAmount(this);
-  },
-
-
-
-  /**
- * 数量的变化事件
- * @param {*} e 
- */
-  changeAllreadyChooseQuantityPop(e) {
-    let currentChoosedItem = this.data.currentChoosedItem
-    currentChoosedItem.itemQuantity = e.detail
-    currentChoosedItem.itemAmount = Number(currentChoosedItem.priceSale * currentChoosedItem.itemQuantity).toFixed(2)
-    currentChoosedItem.itemAmount = isNaN(currentChoosedItem.itemAmount) ? 0 : currentChoosedItem.itemAmount
-    this.setData({
-      currentChoosedItem: currentChoosedItem
-    })
-
-  },
-
-  //触底分页函数
-  paging() {
-
-  },
-
-
-
-  /**
-   * @desc : 页面滚动时执行
-   * @date : 2022/5/12 16:49
-   * @author : 于继渤
-   */
-  onPageScroll: function () {
-
-    /**
-     * @desc : 关闭下拉  
-     * @date : 2022/5/12 16:49
-     * @author : 于继渤
-     */
-    //TODO  有ID同名问题记得修改
-    // this.selectComponent('#statusItem').onClosed()
-    // this.selectComponent('#statusItem').rerender()
-
-    // this.selectComponent('#statusItem1').onClosed()
-    // this.selectComponent('#statusItem1').rerender()
-
-    // this.selectComponent('#accountTimeType').onClosed()
-    // this.selectComponent('#accountTimeType').rerender()
-
-  },
-
-  // 报表相关
-  dateClick(e) {
-    if (e.detail === 0) {
-      this.selectComponent("#month-components").toggle(true)
-      this.dropdowncommit({ currentTarget: { dataset: { type: 'month' } } })
-    } else {
-      this.getSaleProfit()
-    }
-  },
 
 
   /** 去详细 */
@@ -543,78 +59,9 @@ Page({
     console.log(e, '/package-business-analysis/pages/profit-report/' + e.currentTarget.dataset.url)
     wx.navigateTo({
       url: '/package-business-analysis/pages/profit-report/' + e.currentTarget.dataset.url
-      //  + '?orgIds=' + encodeURIComponent(JSON.stringify(this.data.orgIds)) + '&orgNames=' + encodeURIComponent(JSON.stringify(this.data.orgNames))
-        // + '&dateType=' + this.data.value1 + '&date=' + this.data.month
-    })
-  },
-
-  formatDate(value) {
-    var time = new Date(value);
-    var year = time.getFullYear();
-    var month = time.getMonth() + 1;
-    return year + "年" + month + "月"
-  },
-
-  onInput(e) {
-    this.setData({
-      monthOnChoose: e.detail
-    })
-  },
-
-  onConfirmChooseDate(e) {
-    this.setData({
-      month: this.data.monthOnChoose,
-      monthName: this.formatDate(this.data.monthOnChoose)
-    })
-    this.setData({
-      monthFlag: false
-    })
-    let option1 = this.data.option1
-    option1[option1.length - 1].text = this.data.monthName
-    this.setData({
-      option1: option1
-    })
-    this.selectComponent("#month-components").toggle(false)
-    this.getSaleProfit()
-  },
-
-  onCloseChooseDate(e) {
-    this.setData({
-      // monthOnChoose: this.data.month
-      value1: 3,
-
-    })
-    this.setData({
-      monthFlag: false
-    })
-    this.selectComponent("#month-components").toggle()
-    this.getSaleProfit()
-  },
-
-  dropdowncommit(e) {
-    this.setData({
-      [e.currentTarget.dataset.type + 'Flag']: true
     })
   },
 
-  /** 下拉多选关闭 */
-  muticloseAll(e) {
-    this.setData({
-      orgFlag: false
-    })
-    this.selectComponent("#org-components").toggle()
-  },
-
-  /** 下拉多选确定 */
-  mutiSearchAll(e) {
-    this.setData({
-      orgIds: e.detail.idList,
-      orgNames: e.detail.names,
-      orgFlag: false
-    })
-    this.selectComponent("#org-components").toggle(false)
-    this.getSaleProfit()
-  },
 
   onShow() {
     this.echartsProfitDate = this.selectComponent("#echartsProfitDate")
@@ -636,29 +83,8 @@ Page({
       return chart;
     });
   },
-  /** 根据月份查出第一天和最后一天 参数是时间戳*/
-  getBeginDateAndEndDate(timestamp) {
-    // let date = new Date(timestamp)
-    // let year = date.getFullYear();
-    // let month = date.getMonth() + 1;
-    // let yearAndMonth = year + '-' + (month >= 10 ? month : '0' + month);
-    // return { beginDate: yearAndMonth + '-01', endDate: yearAndMonth + '-' + new Date(year, month, 0).getDate() }
-    let month = this.data.month
-    let monthStart = month[0] ? month[0] : ''
-    let monthEnd = month[1] ? month[1] : ''
-    if (month && month[0] && (month[0].indexOf('/') != -1)) {
-      monthStart = month[0].replaceAll('/', '-')
-    }
-    if (month && month[1] && (month[1].indexOf('/') != -1)) {
-      monthEnd = month[1].replaceAll('/', '-')
-    }
-    return { beginDate: monthStart, endDate: monthEnd }
 
 
-
-
-  },
-
   /**
    * 销售毛利点击按日或按月查询
    */
@@ -672,6 +98,9 @@ Page({
   /** 查询所有报表信息 */
   /** 查询页面展示的所有 */
   getSaleProfit() {
+    this.setData({
+      loading: true
+    })
     this.excute(this.data.service, this.data.service.getSaleProfit, Object.assign({
       byDate: this.data.byDate
     }, JSON.parse(this.data.searchForm))).then(res => {
@@ -689,6 +118,9 @@ Page({
         }, 1000)
 
       }
+      this.setData({
+        loading: false
+      })
     })
   },
 
@@ -696,7 +128,6 @@ Page({
     * 显示tip
     */
     showTip(e) {
-      console.log(e)
       let item = e.currentTarget.dataset.item
       if (item) {
         util.showToast(item);

+ 9 - 34
package-business-analysis/pages/profit-report/profit-report.wxml

@@ -80,11 +80,11 @@
       </view>
     </view>
 
-    <!-- 部门利润 -->
+    <!-- 部门利润排行 -->
     <view class="card-view">
       <view class="card-view-header">
         <view class="card-view-header-name">
-          <image src="/static/image/app.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
+          <!-- <image src="/static/image/app.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image> -->
           部门利润排行
         </view>
         <view class="card-view-header-tags" catchtap="toDetail" data-url="org-rank/org-rank">
@@ -93,54 +93,39 @@
           </view>
         </view>
       </view>
-      <!-- <view class="card-view-content-data-echarts">
-        <view class="card-view-content-data-echarts-data">
-          <view>
-            <text class="small-small-font">¥</text>{{indexOrgOrder.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(indexOrgOrder.sumAmount/10000)) : '0.00'}}
-          </view>
-          <view>成交额(万)</view>
-        </view>
-      </view> -->
       <view style="z-index: 0 !important;width: 100%; height: 327rpx;">
         <ec-canvas type="2d" canvas-id="echartsProfitOrg" id="echartsProfitOrg" ec="{{ ec }}" />
       </view>
     </view>
 
-    <!-- 部门收款 -->
+    <!-- 业务员利润排行 -->
     <view class="card-view">
       <view class="card-view-header">
         <view class="card-view-header-name">
-          <image src="/static/image/app.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
+          <!-- <image src="/static/image/app.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image> -->
           业务员利润排行
         </view>
-        <view class="card-view-header-tags" catchtap="toDetail" data-url="/org-repay-rank/org-repay-rank">
+        <view class="card-view-header-tags" catchtap="toDetail" data-url="staff-rank/staff-rank">
           <view class="card-view-header-tags-tag">详情
             <van-icon style="margin-left: 14rpx;" name="arrow" />
           </view>
         </view>
       </view>
-      <!-- <view class="card-view-content-data-echarts">
-        <view class="card-view-content-data-echarts-data">
-          <view>
-            <text class="small-small-font">¥</text>{{indexOrgRepay.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(indexOrgRepay.sumAmount/10000)) : '0.00'}}
-          </view>
-          <view>成交额(万)</view>
-        </view>
-      </view> -->
+
       <view style="z-index: 0 !important;width: 100%; height: 327rpx;">
         <ec-canvas type="2d" canvas-id="echartsProfitStaff" id="echartsProfitStaff" ec="{{ ec }}" />
       </view>
     </view>
 
 
-    <!-- 业务员成交 -->
+    <!-- 商品利润排行 -->
     <view class="card-view">
       <view class="card-view-header">
         <view class="card-view-header-name">
-          <image src="/static/image/app.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
+          <!-- <image src="/static/image/app.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image> -->
           商品利润排行
         </view>
-        <view class="card-view-header-tags" catchtap="toDetail" data-url="/staff-order-rank/staff-order-rank">
+        <view class="card-view-header-tags" catchtap="toDetail" data-url="sku-rank/sku-rank">
           <view class="card-view-header-tags-tag">详情
             <van-icon style="margin-left: 14rpx;" name="arrow" />
           </view>
@@ -163,15 +148,5 @@
   </view>
 
 
-
-
-  <!-- 选时间 -->
-  <van-popup position="bottom" show="{{ monthFlag }}" bind:close="onCloseChooseDate" class="popup" style="width:100%" custom-style="border-radius:15rpx;">
-    <view style="display:flex;justify-content: space-around;height:80rpx;">
-      <view style="width:45%;text-align: left;color:#b6b6b6;line-height:80rpx;" catchtap="onCloseChooseDate">取消</view>
-      <view style="width:45%;text-align: right;color:#00A7B5;line-height:80rpx;" catchtap="onConfirmChooseDate">确定</view>
-    </view>
-    <van-datetime-picker type="year-month" value="{{ monthOnChoose }}" bind:input="onInput" show-toolbar="{{false}}" formatter="{{formatter}}" />
-  </van-popup>
 </view>
 

+ 98 - 0
package-business-analysis/pages/profit-report/sku-rank/sku-rank.js

@@ -0,0 +1,98 @@
+// package5/pages/report/detail/detail.js
+
+const app = getApp()
+const Constants = require('../../../../utils/Constants.js');
+const mixins = require('@/mixins/index.js')
+
+Page({
+  mixins: [mixins],
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    service: app.globalData['reportService'],
+    // 查询条件
+    searchContent: [{
+      code: 'makeTime',
+      title: mixins.$t('currentMonth'),
+      defaultValue: 3,
+      searchType: Constants.searchType.date
+    },
+    {
+      code: 'orderBy',
+      title: mixins.$t('sort'),
+      searchType: Constants.searchType.radio,
+      value: 1,
+      options: [
+        {
+          "text": "利润升序",
+          "value": "profitAsc"
+        },
+        {
+          "text": "利润倒序",
+          "value": "profitDesc"
+        },
+        {
+          "text": "利率升序",
+          "value": "rateAsc"
+        },
+        {
+          "text": "利率倒序",
+          "value": "rateDsc"
+        },
+      ],
+    }
+    ],
+    tab1Columns: [
+      {
+        "name": "skuName",
+        "title": "商品型号/名称",
+        "width": "50%"
+      },
+      {
+        "name": "profit",
+        "title": "销售利润",
+        "type": "amount",
+        "width": "30%"
+      },
+      {
+        "after": "%",
+        "name": "profitRate",
+        "title": "利润率",
+        "width": "20%"
+      }
+    ],
+    tab1TableData: [],
+    tab1TopData: [
+      {
+        "title": "销售利润(总额)",
+        "type": "amount",
+        "value": "0.00"
+      },
+      {
+        "title": "利润率",
+        "type": "amount",
+        "value": "0.00"
+      }
+    ],
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.getReportData()
+  },
+  /** 查询页面展示的所有 */
+  getReportData() {
+    this.excute(this.data.service, this.data.service.getSaleProfitGroupBySku, JSON.parse(this.data.searchForm)).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        this.setData({
+          tab1TopData: [{ title: '销售利润(总额)', type: 'amount', value: res.data.data.profit ? res.data.data.profit.profit : 0 },
+          { title: '利润率', type: '', value: (res.data.data.profit ? res.data.data.profit.profitRate : 0) + '%' }
+          ],
+          tab1TableData: res.data.data.skuProfit
+        })
+      }
+    })
+  },
+})

+ 4 - 0
package-business-analysis/pages/profit-report/sku-rank/sku-rank.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "商品利润排行"
+}

+ 9 - 0
package-business-analysis/pages/profit-report/sku-rank/sku-rank.wxml

@@ -0,0 +1,9 @@
+<view>
+  <!-- 顶部筛选条件 -->
+  <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" bind:search="getReportData" flgSearchText="{{false}}">
+  </dk-dropdown-menu>
+
+  <view style="width: calc(100% - 68rpx);padding: 40rpx 34rpx;">
+    <dk-table columns="{{tab1Columns}}" table-data="{{tab1TableData}}" top-data="{{tab1TopData}}" />
+  </view>
+</view>

+ 4 - 0
package-business-analysis/pages/profit-report/sku-rank/sku-rank.wxss

@@ -0,0 +1,4 @@
+/* package5/pages/report/detail/detail.wxss */
+page {
+  background: #f8f9fd;
+}

+ 98 - 0
package-business-analysis/pages/profit-report/staff-rank/staff-rank.js

@@ -0,0 +1,98 @@
+// package5/pages/report/detail/detail.js
+
+const app = getApp()
+const Constants = require('../../../../utils/Constants.js');
+const mixins = require('@/mixins/index.js')
+
+Page({
+  mixins: [mixins],
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    service: app.globalData['reportService'],
+    // 查询条件
+    searchContent: [{
+      code: 'makeTime',
+      title: mixins.$t('currentMonth'),
+      defaultValue: 3,
+      searchType: Constants.searchType.date
+    },
+    {
+      code: 'orderBy',
+      title: mixins.$t('sort'),
+      searchType: Constants.searchType.radio,
+      value: 1,
+      options: [
+        {
+          "text": "利润升序",
+          "value": "profitAsc"
+        },
+        {
+          "text": "利润倒序",
+          "value": "profitDesc"
+        },
+        {
+          "text": "利率升序",
+          "value": "rateAsc"
+        },
+        {
+          "text": "利率倒序",
+          "value": "rateDsc"
+        },
+      ],
+    }
+    ],
+    tab1Columns: [
+      {
+        "name": "staffName",
+        "title": "员工名称",
+        "width": "50%"
+      },
+      {
+        "name": "profit",
+        "title": "销售利润",
+        "type": "amount",
+        "width": "30%"
+      },
+      {
+        "after": "%",
+        "name": "profitRate",
+        "title": "利润率",
+        "width": "20%"
+      }
+    ],
+    tab1TableData: [],
+    tab1TopData: [
+      {
+        "title": "销售利润(总额)",
+        "type": "amount",
+        "value": "0.00"
+      },
+      {
+        "title": "利润率",
+        "type": "amount",
+        "value": "0.00"
+      }
+    ],
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.getReportData()
+  },
+  /** 查询页面展示的所有 */
+  getReportData() {
+    this.excute(this.data.service, this.data.service.getSaleProfitGroupByStaff, JSON.parse(this.data.searchForm)).then(res => {
+      if (res.data.code == Constants.SUCESS_CODE) {
+        this.setData({
+          tab1TopData: [{ title: '销售利润(总额)', type: 'amount', value: res.data.data.profit ? res.data.data.profit.profit : 0 },
+          { title: '利润率', type: '', value: (res.data.data.profit ? res.data.data.profit.profitRate : 0) + '%' }
+          ],
+          tab1TableData: res.data.data.staffProfit
+        })
+      }
+    })
+  },
+})

+ 4 - 0
package-business-analysis/pages/profit-report/staff-rank/staff-rank.json

@@ -0,0 +1,4 @@
+{
+    "usingComponents": {},
+    "navigationBarTitleText": "业务员利润排行"
+}

+ 9 - 0
package-business-analysis/pages/profit-report/staff-rank/staff-rank.wxml

@@ -0,0 +1,9 @@
+<view>
+  <!-- 顶部筛选条件 -->
+  <dk-dropdown-menu model:value="{{searchForm}}" menuList="{{searchContent}}" bind:search="getReportData" flgSearchText="{{false}}">
+  </dk-dropdown-menu>
+
+  <view style="width: calc(100% - 68rpx);padding: 40rpx 34rpx;">
+    <dk-table columns="{{tab1Columns}}" table-data="{{tab1TableData}}" top-data="{{tab1TopData}}" />
+  </view>
+</view>

+ 4 - 0
package-business-analysis/pages/profit-report/staff-rank/staff-rank.wxss

@@ -0,0 +1,4 @@
+/* package5/pages/report/detail/detail.wxss */
+page {
+  background: #f8f9fd;
+}

BIN
static/img/index1.png


BIN
static/img/index2.png


BIN
static/img/index3.png