hongxudong 1 год назад
Родитель
Сommit
d47689ef46

+ 2 - 1
package.json

@@ -70,7 +70,8 @@
     "vuex": "^3.0.1",
     "vuex-persistedstate": "^2.5.4",
     "vxe-table": "3.5.9",
-    "xe-utils": "^3.5.7"
+    "xe-utils": "^3.5.7",
+    "vant": "^2.12.39"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "^3.0.1",

+ 11 - 0
src/api/pages/common/wxCommon.js

@@ -0,0 +1,11 @@
+/**
+ * @desc   : wx-控件数据源API
+ * @author : 洪旭东
+ * @date   : 2024-05-08 11:40
+ */
+export default {
+  wxCommonService: {
+    prefix: 'mdm-server/wxapi/basic/common/',
+    wxStoreList: 'get_wx_init_data',
+  },
+}

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

@@ -37,6 +37,10 @@ export default {
     getDailyReconciliationReportByPay: "get_daily_reconciliation_report_by_pay",
     // 资金日记账
     getFundReport:'get_fund_report',
+    //销售简报
+    getReportBatch: 'get_report_batch',
+    //导出的uuid
+    exportPushParams: 'export_push_params',
   }
 }
 

+ 1 - 0
src/api/pages/sale/order-out-return.js

@@ -10,6 +10,7 @@ export default {
     getOutReturnForUpdate: 'get_out_return_for_update',
     outboundInsert: 'outbound_insert',
     outboundUpdate: 'outbound_update',
+    handleOutbound: 'handle_outbound',
   }
 }
 

+ 48 - 0
src/components/process/index.vue

@@ -0,0 +1,48 @@
+<template>
+  <div class="out-div">
+    <div v-for="(item,dkprogressIndex) in 10" :key="dkprogressIndex">
+      <div v-if="(item) <= getInt(progress)" style="border-radius: 2px;background: #77C5D5;width: 100%;height: 100%;"></div>
+      <div v-if="(item) === (getInt(progress)+1)" style="border-radius: 2px;background: #77C5D5;height: 100%;" :style="{width:(getFloat(progress)*100)+'%'}"></div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "wx-progress",
+  props:{
+    progress:{
+      type:Number,
+      default:0
+    }
+  },
+  methods:{
+    getFloat(number){
+      let arr =  parseFloat(number/10).toFixed(2).split(".")
+      return parseFloat('0.'+arr[1])
+    },
+    getInt(number){
+      return parseInt(number/10)
+    }
+  }
+}
+</script>
+
+<style scoped>
+/* components/dk-progress/dk-progress.wxss */
+.out-div{
+  display: flex;
+  justify-content: flex-end;
+}
+.out-div>div:nth-child(n){
+  height: 12px;
+  width: 6px;
+  background: #AFBED9;
+  border-radius: 1px;
+  overflow: hidden;
+}
+
+.out-div>div:nth-child(n+2){
+  margin-left: 2px;
+}
+</style>

+ 212 - 0
src/components/wx-table/index.vue

@@ -0,0 +1,212 @@
+<template>
+  <div>
+    <div>
+      <div class="top-data">
+        <div v-for="(tdItem,tdIndex) in topData" :key="tdIndex" :style="{width: 100/topData.length+'%'}">
+          <div>
+            <div v-if="tdItem.type === 'amount'" style="display: flex;align-items: baseline;justify-content: center;">
+              <span style="font-size: 12px;">¥</span>
+              {{ tdItem.value ? toThousandCents(tdItem.value) : '0.00' }}
+            </div>
+            <div v-else>{{ tdItem.value }}</div>
+          </div>
+          <div>
+            {{ tdItem.title }}
+          </div>
+        </div>
+      </div>
+      <div class="header">
+        <div style="width:17px;"></div>
+        <div style="width: calc(100% - 17px);display: flex;">
+          <div :style="{width:colItem.width,textAlign:(colItem.align?colItem.align:'center')}"
+               v-for="(colItem,colIndex) in columns" :key="colIndex">{{ colItem.title }}
+          </div>
+        </div>
+      </div>
+
+      <div v-if="tableData && tableData.length>0" class="data">
+        <div v-for="(tableDataItem,tableDataIndex) in tableData" :key="tableDataIndex"
+             style="display: flex;background: #fff;padding: 0 9px;">
+          <div style="width:17px;position: relative;display: flex;align-items: center;"
+               :style="{borderBottom:(tableDataIndex!==tableData.length-1?1:0)+'px solid #E9F0FE;'}">
+            <img style="position: absolute;width: 20.16px;height: 15.26px;top:8px;left:-9.5px;" v-if="tableDataIndex<=2"
+                   :src="getImg(tableDataIndex)"/>
+            <div style="font-family: 'DIN Alternate';font-style: normal;font-weight: 700;font-size: 9px;color: #1B365D;"
+                 v-else>{{ tableDataIndex <= 8 ? ('0' + (tableDataIndex + 1)) : (tableDataIndex + 1) }}
+            </div>
+          </div>
+          <div style="width: calc(100% - 17px);display: flex;">
+            <div class="cell"
+                 :style="{width:col2Item.width,borderBottom:(tableDataIndex!==tableData.length-1?1:0)+'px solid #E9F0FE',textAlign:(col2Item.align?col2Item.align:'center')}"
+                 v-for="(col2Item,col2Index) in columns" :key="col2Index">
+          <span v-if="col2Item.type === 'amount'" style="display: inline-block;text-align: left;word-break: break-all;">
+            <span style="font-size: 10px;"
+                  v-if="(tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0)">¥</span>
+            {{ tableDataItem[col2Item.name] ? toThousandCents(tableDataItem[col2Item.name]) : (!col2Item.ifNull ? '0.00' : col2Item.ifNull) }}
+          </span>
+              <span v-else style="display: inline-block;text-align: left;word-break: break-all;">
+            {{ col2Item.before && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? col2Item.before : '' }}
+            {{ (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? tableDataItem[col2Item.name] : (col2Item.ifNull ? col2Item.ifNull : '') }}
+            {{ col2Item.after && (tableDataItem[col2Item.name] || tableDataItem[col2Item.name] === 0) ? col2Item.after : '' }}
+          </span>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div v-else
+           style="line-height: 100px;color: #95A8CB;width:100%;font-family: 'PingFang SC';font-style: normal;font-weight: 400;font-size: 14px;background:#fff;text-align: center;">
+        <div>暂无数据</div>
+      </div>
+    </div>
+    <div style="width:100%;height:7.5px;border-radius: 0px 0px 7.5px 7.5px;background: #fff;"></div>
+  </div>
+</template>
+
+<script>
+
+import index1 from '@/assets/images/index1.png'
+import index2 from '@/assets/images/index2.png'
+import index3 from '@/assets/images/index3.png'
+
+export default {
+  name: "index",
+  props: {
+    columns: {
+      type: Array,
+      default: () => [{title: '门店名称', name: 'storeName', width: '35%'}, {
+        title: '成交金额',
+        name: 'amount',
+        width: '25%'
+      }, {title: '任务目标', name: 'target', width: '25%'}, {title: '完成率', name: 'rate', width: '15%'}]
+    },
+    topData: {
+      type: Array,
+      default: () => []
+    },
+    tableData: {
+      type: Array,
+      default: () => [{storeName: '门店11a', amount: '1888', target: '2000', rate: '80%'}, {
+        storeName: '门店1',
+        amount: '1888',
+        target: '2000',
+        rate: '80%'
+      }, {storeName: '门店1', amount: '1888', target: '2000', rate: '80%'}, {
+        storeName: '门店1',
+        amount: '1888',
+        target: '2000',
+        rate: '80%'
+      }, {storeName: '门店23123123345345341', amount: '1888222222222222222222222', target: '2000', rate: '80%'}]
+    }
+  },
+  data(){
+    return{
+      index1,
+      index2,
+      index3
+    }
+  },
+  methods: {
+    getImg(tableDataIndex){
+      return this['index'+(tableDataIndex+1)]
+    },
+    //千分符
+    toThousandCents(num) {
+      if (num == undefined) {
+        return 0;
+      }
+      var num = num + '';
+      var d = '';
+      if (num.slice(0, 1) == '-') {
+        d = num.slice(0, 1);
+        num = num.slice(1);
+      }
+      var len = num.length;
+      var index = num.indexOf('.');
+      if (index == -1) {
+        num = num + '.00';
+      } else if ((index + 2) == len) {
+        num = num + '0';
+      }
+      var index = num.indexOf('.'); // 字符出现的位置
+      var num2 = num.slice(-3);
+      num = num.slice(0, index)
+      var result = '';
+      while (num.length > 3) {
+        result = ',' + num.slice(-3) + result;
+        num = num.slice(0, num.length - 3);
+      }
+      if (num) {
+        result = num + result;
+      }
+      return d + (result + num2)
+    }
+  }
+}
+</script>
+
+<style scoped>
+/* components/dk-table/dk-table.wxss */
+.top-data {
+  background: linear-gradient(180deg, #D9F2F8 0%, #FAFEFF 100%);
+  border-radius: 7.5px 7.5px 0px 0px;
+  display: flex;
+  padding: 17px 0;
+}
+
+.top-data > div:nth-child(n) {
+  text-align: center;
+
+}
+
+.top-data > div:nth-child(n) > div:nth-child(1) {
+  margin-bottom: 5px;
+  font-family: 'PingFang HK';
+  font-style: normal;
+  font-weight: 600;
+  font-size: 20px;
+  color: #1B365D;
+}
+
+.top-data > div:nth-child(n) > div:nth-child(2) {
+  font-family: 'PingFang SC';
+  font-style: normal;
+  font-weight: 400;
+  font-size: 12px;
+  color: #95A8CB;
+}
+
+.top-data > div:nth-child(n+2) {
+  border-left: 1px solid #ABC6CC;
+}
+
+
+.header {
+  display: flex;
+  width: calc(100%);
+  background: #fff;
+  padding: 0 9.5px;
+}
+
+.header > div:nth-child(n) {
+  font-family: 'PingFang SC';
+  font-style: normal;
+  font-weight: 400;
+  font-size: 10px;
+  line-height: 40px;
+  color: #00A7B5;
+}
+
+.cell {
+  font-family: 'PingFang HK';
+  font-style: normal;
+  font-weight: 400;
+  font-size: 13px;
+  color: #1B365D;
+  padding: 7.5px 5px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+
+</style>

+ 1 - 0
src/locale/lang/zh-CN.js

@@ -115,6 +115,7 @@ export const button = {
   addOrderOut:'销售出库',
   addOrderReturn:'销售退货',
   addOutReturn:'出库退货',
+  refreshReport: '更新报表',
 }
 
 /**

+ 7 - 0
src/main.js

@@ -258,6 +258,13 @@ import * as echarts from 'echarts'
 
 Vue.prototype.$echarts = echarts
 
+/* vant */
+import VantTabs from 'vant/es/tabs/index';
+Vue.component('van-tabs', VantTabs)
+
+import VantTab from 'vant/es/tab/index';
+Vue.component('van-tab', VantTab)
+import 'vant/lib/index.css';
 
 // 引入相关css
 import 'quill/dist/quill.core.css'

+ 100 - 0
src/view/report/sales-kit/details/collection-analysis.vue

@@ -0,0 +1,100 @@
+<template>
+  <div>
+    <div style="display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;z-index: 10;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+<!--      <Select transfer v-model="orgIds" size="small" multiple clearable style="width:45%;margin-left: 10px" @on-change="changeSearch" placeholder="请选择门店">-->
+<!--        <Option v-for="item in orgList" :value="item.id" :key="item.id">{{ item.name }}</Option>-->
+<!--      </Select>-->
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+    <van-tabs ref="van-tabs" animated>
+      <van-tab title="收款任务">
+        <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+      </van-tab>
+      <van-tab title="欠款情况">
+        <wx-table :columns="tab2Columns" :table-data="tab2TableData" :top-data="tab2TopData" />
+      </van-tab>
+    </van-tabs>
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin'
+
+export default {
+  name: "collection_analysis",
+  mixins:[mixin],
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+
+      month:new Date(),
+      orgIds:[],
+      orgList:[],
+
+      tab1Columns: [{name:'orgName',title:'门店名称',width:'35%'},{name:'repayAmount',title:'收款金额(万)',type:'amount',width:'25%'}],
+      tab2Columns: [{name:'orgName',title:'门店名称',width:'35%'},{name:'receivable',title:'欠款额(万)',type:'amount',width:'25%'},{name:'orderAmount',title:'成交额(万)',type:'amount',width:'25%'},{name:'csmCount',title:'欠款户数',width:'15%'}],
+
+      tab1TopData: [],
+      tab1TableData: [],
+
+      tab2TopData: [],
+      tab2TableData: [],
+
+      tabs: ['收款任务','欠款情况'],
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month),{ userId:this.$store.state.user.id,type: 'f_report_s001_index_org_repay',cpId:this.$store.state.user.cpId,orgIds:this.orgIds,dateType:this.dateType}),
+        tab2: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month),{ userId:this.$store.state.user.id,type: 'f_report_s001_repay_debt',cpId:this.$store.state.user.cpId,orgIds:this.orgIds,dateType:this.dateType})
+      }
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+            this.tab1TopData = [{title:'收款额(总额:万)',type:'amount',value:util.parseFloatFixed2(res.data.tab1.sumAmount/10000)},{title:'收款额(均值:万)',type:'amount',value:util.parseFloatFixed2(res.data.tab1.avgAmount/10000)}],
+            this.tab1TableData = util.calc10000(res.data.tab1.items,['repayAmount']),
+            this.tab2TopData = [{title:'欠款额(总额:万)',type:'amount',value:util.parseFloatFixed2(res.data.tab2.receivable/10000)},{title:'欠款额(均值:万)',type:'amount',value:util.parseFloatFixed2(res.data.tab2.avgAmount/10000)}],
+            this.tab2TableData = util.calc10000(res.data.tab2.items,['orderAmount','receivable'])
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 85 - 0
src/view/report/sales-kit/details/customer-analysis.vue

@@ -0,0 +1,85 @@
+<template>
+  <div>
+    <div style="z-index:10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+    <van-tabs ref="van-tabs" animated>
+      <van-tab title="潜客分析">
+        <wx-table :columns="tab2Columns" :table-data="tab2TableData" :top-data="tab2TopData" />
+      </van-tab>
+    </van-tabs>
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin.js'
+
+export default {
+  name: "customer_analysis",
+  mixins:[mixin],
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+
+      month:new Date(),
+      orgIds:[],
+      orgList:[],
+
+      tab2Columns: [{ name: 'orgName', title: '门店名称', width: '35%' }, { name: 'csmCount', title: '潜在客户', width: '20%' }, { name: 'measureCsmCount', title: '量尺', width: '15%' }, { name: 'designCsmCount', title: '设计制图', width: '15%' }, { name: 'orderRate', title: '成交率', width: '15%' ,after:'%'}],
+      tab2TopData: [],
+      tab2TableData: [],
+
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab2: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month), { userId:this.$store.state.user.id,type: 'f_report_s001_csm_analysis_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds ,dateType:this.dateType}),
+      }
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+          this.tab2TopData = [{ title: '新增潜客', value: res.data.tab2.csmCount }, { title: '新增成交', value: res.data.tab2.orderCsmCount }, { title: '设计制图', value: res.data.tab2.designCsmCount }],
+          this.tab2TableData = res.data.tab2.items
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 105 - 0
src/view/report/sales-kit/details/customer-from-analysis.vue

@@ -0,0 +1,105 @@
+<template>
+  <div>
+    <div style="z-index: 10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+    <van-tabs ref="van-tabs" animated>
+      <van-tab title="成交情况">
+        <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+      </van-tab>
+      <van-tab title="潜客分析">
+        <wx-table :columns="tab3Columns" :table-data="tab3TableData" :top-data="tab3TopData" />
+      </van-tab>
+    </van-tabs>
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin.js'
+
+export default {
+  name: "customer_from_analysis",
+  mixins:[mixin],
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+
+      month:new Date(),
+      orgIds:[],
+      orgList:[],
+
+      tab1Columns: [
+        { name: 'fromName', title: '客户来源', width: '25%' },
+        { name: 'orderAmount', title: '成交金额(万)', type: 'amount', width: '35%' },
+        { name: 'customerQty', title: '成交客户', width: '20%' },
+        { name: 'rate', title: '占比', width: '20%',after:'%' }
+      ],
+      tab3Columns: [
+        { name: 'fromName', title: '客户来源', width: '25%' },
+        { name: 'csmCount', title: '潜在客户', width: '25%' },
+        { name: 'orderCsmCount', title: '成交客户', width: '25%' },
+        { name: 'designCsmCount', title: '设计制图', width: '25%' }
+      ],
+      tab1TopData: [],
+      tab1TableData: [],
+
+      tab3TopData: [],
+      tab3TableData: [],
+
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month), { userId:this.$store.state.user.id,type: 'f_report_s001_csm_from_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+        tab3: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month), { userId:this.$store.state.user.id,type: 'f_report_s001_csm_from_filing', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+      };
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+            this.tab1TopData = [{ title: '成交额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.sumAmount/10000) }, { title: '成交额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.avgAmount/10000) }],
+            this.tab1TableData =  util.calc10000(res.data.tab1.items,['orderAmount']),
+            this.tab3TopData = [{ title: '新增潜客', value: res.data.tab3.csmCount }, { title: '新增成交', value: res.data.tab3.orderCsmCount }, { title: '设计制图', value: res.data.tab3.designCsmCount }],
+            this.tab3TableData =  res.data.tab3.items
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 12 - 0
src/view/report/sales-kit/details/index.js

@@ -0,0 +1,12 @@
+export {  default as OrderAnalysis } from './order-analysis.vue'
+export {  default as CollectionAnalysis } from './collection-analysis.vue'
+export {  default as CustomerAnalysis } from './customer-analysis.vue'
+export {  default as CustomerFromAnalysis } from './customer-from-analysis.vue'
+export {  default as ProductAnalysis } from './product-analysis.vue'
+
+export {  default as OrgOrderRank } from './org-order-rank.vue'
+export {  default as OrgRepayRank } from './org-repay-rank.vue'
+export {  default as StaffOrderRank } from './staff-order-rank.vue'
+export {  default as StaffRepayRank } from './staff-repay-rank.vue'
+
+

+ 98 - 0
src/view/report/sales-kit/details/mixin.js

@@ -0,0 +1,98 @@
+export const mixin = {
+  data() {
+    let _self = this
+    return {
+      btDateShow:false,
+      btDate:[],
+      dateType:3,
+      format:'本月',
+      options2: {
+        shortcuts: [
+          {
+            text: '本日',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本日'
+              _self.dateType = 1
+              _self.getReport()
+            }
+          },
+          {
+            text: '本周',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本周'
+              _self.dateType = 2
+              _self.getReport()
+            }
+          },
+          {
+            text: '本月',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本月'
+              _self.dateType = 3
+              _self.getReport()
+
+            }
+          },
+          {
+            text: '本年',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本年'
+              _self.dateType = 5
+              _self.getReport()
+            }
+          },
+          {
+            text: '区间',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              // _self.format = '区间'
+              _self.dateType = 6
+              _self.btDateShow = true
+              // _self.getReport()
+            }
+          }
+        ]
+      },
+      date:new Date(),
+    }
+  },
+  methods:{
+    init(date,dateType,format,staffIds,staffList,orgIds,orgList,btDate){
+      this.active = 0
+      this.month = date
+      this.orgIds = orgIds
+      this.orgList = orgList
+      this.staffIds = staffIds
+      this.staffList = staffList
+      this.format = format
+      this.dateType = dateType
+      this.btDate = btDate
+      this.getReport()
+      this.$nextTick(()=>{
+        if(this.$refs['van-tabs']){
+          this.$refs['van-tabs'].resize()
+        }
+      })
+    },
+    onChangeDate(){
+      this.format = 'yyyy年MM月'
+      this.dateType = 0
+      // this.getReport()
+    },
+    changeSearch(){
+      // this.getReport()
+    },
+    btOk(){
+      this.format = '区间:'+this.btDate[0].format('yyyy-MM-dd') + '-' + this.btDate[1].format('yyyy-MM-dd')
+      this.btDateShow = false
+      this.getReport()
+    },
+    getQjDate(){
+      return {beginDate: this.btDate[0].format('yyyy-MM-dd'),endDate: this.btDate[1].format('yyyy-MM-dd')}
+    },
+  }
+}

+ 108 - 0
src/view/report/sales-kit/details/order-analysis.vue

@@ -0,0 +1,108 @@
+<template>
+  <div>
+    <div style="z-index: 10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+    </div>
+    <div style="height:50px;"></div>
+    <van-tabs ref="van-tabs" animated v-model="active">
+      <van-tab title="销售任务">
+        <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+      </van-tab>
+      <van-tab title="退货情况">
+        <wx-table :columns="tab2Columns" :table-data="tab2TableData" :top-data="tab2TopData" />
+      </van-tab>
+      <van-tab title="客单价">
+        <wx-table :columns="tab3Columns" :table-data="tab3TableData" :top-data="tab3TopData" />
+      </van-tab>
+    </van-tabs>
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin'
+
+export default {
+  name: "order_analysis",
+  mixins: [mixin],
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      active:0,
+      month:new Date(),
+      orgIds:[],
+      orgList:[],
+
+      tab1Columns: [{ name: 'orgName', title: '门店名称', width: '35%' }, { name: 'orderAmount', title: '成交金额(万)', type: 'amount', width: '25%' }],
+      tab2Columns: [{ name: 'orgName', title: '门店名称', width: '30%' }, { name: 'rejectAmount', title: '退货额(万)', type: 'amount', width: '25%' }, { name: 'outAmount', title: '出库额(万)', type: 'amount', width: '25%' }, { name: 'kpiRate', title: '退货占率', width: '20%', after: '%' }],
+      tab3Columns: [{ name: 'orgName', title: '门店名称', width: '30%' }, { name: 'csmRate', title: '客单价(万)', type: 'amount', width: '25%' }, { name: 'sumAmount', title: '成交金额(万)', type: 'amount', width: '25%' }, { name: 'csmCount', title: '成交户数', width: '20%' }],
+
+      tab1TopData: [],
+      tab1TableData: [],
+
+      tab2TopData: [],
+      tab2TableData: [],
+
+      tab3TopData: [],
+      tab3TableData: [],
+
+      tabs: ['销售任务', '退货情况', '客单价', '活动效果', '定+智品类'],
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month),{ userId:this.$store.state.user.id,type: 'f_report_s001_index_org_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+        tab2:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month), { userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_reject', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+        tab3:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month), { userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_csm', cpId: this.$store.state.user.cpId, orgIds: this.orgIds ,dateType:this.dateType}),
+      }
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+            this.tab1TopData = [{ title: '成交额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.sumAmount / 10000) }, { title: '成交额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.avgAmount / 10000) }],
+            this.tab1TableData =  util.calc10000(res.data.tab1.items, ['orderAmount'])
+
+            this.tab2TopData = [{ title: '退货额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab2.sumAmount / 10000) }, { title: '退货额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab2.avgAmount / 10000) }],
+            this.tab2TableData = util.calc10000(res.data.tab2.items, ['rejectAmount', 'outAmount'])
+
+            this.tab3TopData = [{ title: '客户单价(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab3.avgAmount / 10000) }, { title: '成交户数', value: res.data.tab3.csmCount }],
+            this.tab3TableData = util.calc10000(res.data.tab3.items, ['sumAmount', 'csmRate'])
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+  /deep/.van-tabs__line{
+   background-color: #00A7B5 !important;
+  }
+</style>

+ 89 - 0
src/view/report/sales-kit/details/org-order-rank.vue

@@ -0,0 +1,89 @@
+<template>
+  <div>
+    <div style="z-index: 10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+
+    <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin.js'
+
+export default {
+  name: "order_order_rank",
+  mixins:[mixin],
+
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      active:0,
+      month:new Date(),
+      orgIds:[],
+      orgList:[],
+
+      tab1Columns: [
+        { name: 'orgName', title: '门店名称', width: '35%' },
+        { name: 'orderAmount', title: '成交金额(万)', type: 'amount', width: '25%' },
+      ],
+
+      tab1TopData: [],
+      tab1TableData: [],
+
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1:  Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month),
+          { userId:this.$store.state.user.id,type: 'f_report_s001_index_org_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+      }
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+          this.tab1TopData = [{ title: '成交额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.sumAmount/10000) },{ title: '成交额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.avgAmount/10000) }],
+          this.tab1TableData = util.calc10000(res.data.tab1.items,['orderAmount'])
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 89 - 0
src/view/report/sales-kit/details/org-repay-rank.vue

@@ -0,0 +1,89 @@
+<template>
+  <div>
+    <div style="z-index: 10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+
+    <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin.js'
+
+export default {
+  name: "order_repay_rank",
+  mixins:[mixin],
+
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      active:0,
+      month:new Date(),
+      orgIds:[],
+      orgList:[],
+
+      tab1Columns: [
+        { name: 'orgName', title: '门店名称', width: '35%' },
+        { name: 'repayAmount', title: '收款金额(万)', type: 'amount', width: '25%' },
+      ],
+
+      tab1TopData: [],
+      tab1TableData: [],
+
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1:  Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month),
+          { userId:this.$store.state.user.id,type: 'f_report_s001_index_org_repay', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+      };
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+          this.tab1TopData = [{ title: '收款额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.sumAmount/10000) },{ title: '收款额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.avgAmount/10000) }],
+          this.tab1TableData = util.calc10000(res.data.tab1.items,['repayAmount'])
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 88 - 0
src/view/report/sales-kit/details/product-analysis.vue

@@ -0,0 +1,88 @@
+<template>
+  <div>
+    <div style="z-index: 10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%">
+      </DatePicker>
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+      <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin.js'
+
+export default {
+  name: "product_analysis",
+  mixins:[mixin],
+
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+
+      month:new Date(),
+      orgIds:[],
+      orgList:[],
+
+      tab1Columns: [
+        { name: 'specsName', title: '品类名称', width: '35%' },
+        { name: 'sumAmount', title: '成交金额(万)', type: 'amount', width: '25%' },
+        { name: 'sumCount', title: '成交数量', width: '20%' },
+        { name: 'countRate', title: '数量占比', width: '20%',after:'%' }
+      ],
+      tab1TopData: [],
+      tab1TableData: [],
+
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month), { userId:this.$store.state.user.id,type: 'f_report_s001_spu_analysis', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+      }
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+          this.tab1TopData = [{ title: '成交额(万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.sumAmount/10000) }],
+          this.tab1TableData = util.calc10000(res.data.tab1.items,['sumAmount'])
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 89 - 0
src/view/report/sales-kit/details/staff-order-rank.vue

@@ -0,0 +1,89 @@
+<template>
+  <div>
+    <div style="z-index:10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+      <SelectPop v-model="staffIds" ref="staffIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="staffList"
+                 :title="$t('staffId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+
+    <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin.js'
+
+export default {
+  name: "staff_order_rank",
+  mixins:[mixin],
+
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      active:0,
+      month:new Date(),
+      staffIds:[],
+      staffList:[],
+
+      tab1Columns: [
+        { name: 'staffName', title: '业务员名称', width: '35%' },
+        { name: 'orderAmount', title: '成交金额(万)', type: 'amount', width: '25%' },
+      ],
+
+      tab1TopData: [],
+      tab1TableData: [],
+
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "staff",
+        docName: "员工信息",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.staffList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1:  Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month),
+          {userId:this.$store.state.user.id, type: 'f_report_s001_index_staff_order', cpId: this.$store.state.user.cpId,orgIds:[], staffIds: this.staffIds,dateType:this.dateType }),
+      };
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+          this.tab1TopData = [{ title: '成交额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.sumAmount/10000) },{ title: '成交额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.avgAmount/10000) }],
+          this.tab1TableData = util.calc10000(res.data.tab1.items,['orderAmount'])
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 87 - 0
src/view/report/sales-kit/details/staff-repay-rank.vue

@@ -0,0 +1,87 @@
+<template>
+  <div>
+    <div style="z-index:10;display: flex;height: 50px;width: 480px;align-items: center;position: fixed;top: 51px;background: #fff;justify-content: space-between;">
+      <DatePicker transfer ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="month" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 45%"></DatePicker>
+      <SelectPop v-model="staffIds" ref="staffIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="staffList"
+                 :title="$t('staffId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;width: 50px" size="small"  type="success" @click="getReport()">更新</Button>
+
+    </div>
+    <div style="height:50px;"></div>
+    <wx-table :columns="tab1Columns" :table-data="tab1TableData" :top-data="tab1TopData" />
+  </div>
+</template>
+<script>
+import wxTable from '@/components/wx-table/index.vue'
+import util from './util.js'
+import {mixin} from './mixin.js'
+
+export default {
+  name: "staff_repay_rank",
+  mixins:[mixin],
+
+  components:{
+    wxTable
+  },
+  data(){
+    return{
+      active:0,
+      month:new Date(),
+      staffIds:[],
+      staffList:[],
+
+      tab1Columns: [
+        { name: 'staffName', title: '业务员姓名', width: '35%' },
+        { name: 'repayAmount', title: '收款金额(万)', type: 'amount', width: '25%' },
+      ],
+
+      tab1TopData: [],
+      tab1TableData: [],
+
+    }
+  },
+  methods:{
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        dataSourceCode: "staff",
+        docName: "员工信息",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.staffList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getReport(){
+      let params = {
+        tab1:  Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.month),
+          { userId:this.$store.state.user.id,type: 'f_report_s001_index_staff_repay', cpId: this.$store.state.user.cpId,orgIds:[],staffIds: this.staffIds,dateType:this.dateType }),
+      };
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        if(res.code === 200){
+          this.tab1TopData = [{ title: '收款额(总额:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.sumAmount/10000) }, { title: '收款额(均值:万)', type: 'amount', value: util.parseFloatFixed2(res.data.tab1.avgAmount/10000) }],
+          this.tab1TableData = util.calc10000(res.data.tab1.items, ['repayAmount'])
+        }else{
+          this.$Message.error(res.message)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+/deep/.van-tabs__line{
+  background-color: #00A7B5 !important;
+}
+</style>

+ 79 - 0
src/view/report/sales-kit/details/util.js

@@ -0,0 +1,79 @@
+const 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() }
+}
+
+const formatDayTimeMoth = date => {
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = '01'
+  return [year, month, day].map(n => {
+    n = n.toString()
+    return n[1] ? n : '0' + n
+  }).join('-')
+}
+
+const parseFloatFixed2 = num => {
+  return parseFloat(num).toFixed(2)
+}
+
+const calc10000 = (arr, keySet) => {
+  arr.forEach(it => {
+    keySet.forEach(kIt => {
+      if (it[kIt]) {
+        it[kIt] = parseFloat(it[kIt] / 10000).toFixed(2)
+      }
+    })
+  })
+  return arr
+}
+
+const getDateByDateType = (dateType) =>{
+  let now = new Date(); //当前日期
+  let nowDayOfWeek = now.getDay(); //今天本周的第几天
+  let nowDay = now.getDate(); //当前日
+  let nowMonth = now.getMonth(); //当前月
+  let nowYear = now.getFullYear(); //当前年
+  nowYear += (nowYear < 2000) ? 1900 : 0; //
+  let lastMonthDate = new Date(); //上月日期
+  lastMonthDate.setDate(1);
+  lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
+  let lastYear = lastMonthDate.getFullYear();
+  let lastMonth = lastMonthDate.getMonth();
+
+  const getMonthDays = (myMonth) => {
+    var monthStartDate = new Date(nowYear, myMonth, 1);
+    var monthEndDate = new Date(nowYear, myMonth + 1, 1);
+    var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
+    return days;
+  }
+
+  if(dateType === 1){
+    /*今天*/
+    return [new Date().format('yyyy-MM-dd'),new Date().format('yyyy-MM-dd')]
+  }
+
+  if(dateType === 2){
+    /* 本周 */
+    return [new Date(nowYear, nowMonth, nowDay - nowDayOfWeek).format('yyyy-MM-dd'),new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek)).format('yyyy-MM-dd')]
+  }
+
+  if(dateType === 3){
+    /* 本月 */
+    return [new Date(nowYear, nowMonth, 1).format('yyyy-MM-dd'),new Date(nowYear, nowMonth, getMonthDays(nowMonth)).format('yyyy-MM-dd')]
+  }
+
+  if(dateType === 5){
+    /* 本年 */
+    if(nowMonth>=11){
+      return [new Date(nowYear, 11, 1).format('yyyy-MM-dd'),new Date(nowYear+1, 10, 30).format('yyyy-MM-dd')]
+    }else{
+      return [new Date(nowYear-1, 11, 1).format('yyyy-MM-dd'),new Date(nowYear, 10, 30).format('yyyy-MM-dd')]
+    }
+  }
+}
+
+export default { getDateByDateType,getBeginDateAndEndDate,formatDayTimeMoth,parseFloatFixed2,calc10000 }

+ 282 - 0
src/view/report/sales-kit/echarts.js

@@ -0,0 +1,282 @@
+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'
+    }
+  },
+  grid: {
+    left: '13%',
+    height: '79%',
+    width: '74%',
+    y: '-7%',
+  },
+  xAxis: {
+    offset: 5,
+    axisTick: {
+      show: false,
+    },
+    axisLine: {
+      onZero: false,
+      lineStyle: {
+        color: '#E9F0FE',
+        width: 2
+      },
+    },
+    axisLabel:{textStyle: { fontSize: 8, color: '#95A8CB' }},
+    type: 'category',
+    data: [],
+  },
+  yAxis: {
+    axisTick: {
+      show: false,
+    },
+    axisLine: {
+      show: false,
+    },
+    axisLabel: {
+      show: false,
+    },
+    splitLine: {
+      lineStyle: {
+        type: 'dashed',
+        color: '#95A8CB',
+        opacity: 0.37
+      }
+    },
+    min: 0,
+    splitNumber: 3
+  },
+  series: [
+    {
+      barMinHeight:5,
+      barWidth: '20px',
+      data: [],
+      type: 'bar'
+    }
+  ]
+};
+
+const option2 = {
+  grid: {
+    left: '6%',
+    top: '4%',
+    height: '90%',
+    width: '70%',
+    y: '-7%',
+  },
+  xAxis: {
+    axisTick: {
+      show: false,
+    },
+    axisLine: {
+      show: false,
+    },
+    axisLabel: {
+      show: false,
+    },
+    splitLine: {
+      show: false
+    }
+  },
+  yAxis: [
+    {
+      type: 'category',
+      inverse:true,
+      axisLabel: {
+        verticalAlign: "bottom",
+        align: "left",
+        padding: [0, 20, 8, 10],
+        textStyle: {
+          fontSize: 10,
+          color: "#1B365D",
+        }
+      },
+      data: [],
+      yAxisIndex: 0,
+      axisTick: {
+        show: false,
+      },
+      axisLine: {
+        show: false,
+      },
+    },
+    {
+      type: 'category',
+      inverse: true,
+      axisTick: 'none',
+      axisLine: 'none',
+      show: true,
+      axisLabel: {
+        textStyle: {
+          color: '#95A8CB',
+          fontSize: '10'
+        },
+        formatter: (value) => {
+          return '¥ '+value;
+        },
+      },
+      data:[]
+    },
+  ],
+  series: [
+    {
+      showBackground: true,
+      backgroundStyle: {
+        color: '#F8F9FD',
+        barBorderRadius: 6,
+      },
+      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 option3 = {
+  grid: {
+    left: '6%',
+    top: '4%',
+    height: '90%',
+    width: '70%',
+    y: '-7%',
+  },
+  xAxis: {
+    axisTick: {
+      show: false,
+    },
+    axisLine: {
+      show: false,
+    },
+    axisLabel: {
+      show: false,
+    },
+    splitLine: {
+      show: false
+    }
+  },
+  yAxis: [
+    {
+      type: 'category',
+      inverse:true,
+      axisLabel: {
+        verticalAlign: "bottom",
+        align: "left",
+        padding: [0, 20, 8, 10],
+        textStyle: {
+          fontSize: 10,
+          color: "#1B365D",
+        }
+      },
+      data: [],
+      yAxisIndex: 0,
+      axisTick: {
+        show: false,
+      },
+      axisLine: {
+        show: false,
+      },
+    },
+    {
+      type: 'category',
+      inverse: true,
+      axisTick: 'none',
+      axisLine: 'none',
+      show: true,
+      axisLabel: {
+        textStyle: {
+          color: '#95A8CB',
+          fontSize: '10'
+        },
+        formatter: (value) => {
+          return '¥ '+value;
+        },
+      },
+      data:[]
+    },
+  ],
+  series: [
+    {
+      showBackground: true,
+      backgroundStyle: {
+        color: '#F8F9FD',
+        barBorderRadius: 6,
+      },
+      barWidth: '6px',
+      itemStyle: {
+        color: {
+          type: 'linear',
+          x: 0,
+          y: 0,
+          x2: 1,
+          y2: 1,
+          colorStops: [{
+            offset: 0, color: '#11B7C6'
+          }, {
+            offset: 1, color: '#73D5E2'
+          }],
+          global: false
+        },
+        barBorderRadius: 8,
+      },
+      data: [],
+      type: 'bar'
+    }
+  ]
+};
+
+const getWAmount = (number)=>{
+  number =	number.toFixed(2);
+  var arr = number.split('.')
+  return parseInt(arr[0]).toLocaleString()+'.'+arr[1]
+}
+
+const getOpData = ({data, labelKey, valueKey, optionType})=>{
+  let options;
+  /* 1:正常的纵向 2:横向标题在左 3:横向标题在上*/
+  if(optionType === 1){
+    options = {...option1}
+    options.xAxis.data = data.map(it=>it[labelKey].length>2?(it[labelKey].substring(0,2)+'\n'+it[labelKey].substring(2,4)):it[labelKey])
+    options.series[0].data = data.map((it,index)=>{return {value:getWAmount(it[valueKey]/10000),itemStyle: {color: option1BarColor[index],barBorderRadius: 1}}})
+    return options;
+  }
+  if(optionType === 2){
+    options = {...option2} /** 业务员姓名太长 type2也用type3的展现形式 单独换下颜色*/
+    options.yAxis[0].data = data.map(it=>it[labelKey])
+    options.yAxis[1].data = data.map(it=>getWAmount(it[valueKey]/10000))
+    options.series[0].data = data.map(it=>getWAmount(it[valueKey]/10000))
+    return options
+  }
+  if(optionType === 3){
+    options = {...option3}
+    options.yAxis[0].data = data.map(it=>it[labelKey])
+    options.yAxis[1].data = data.map(it=>getWAmount(it[valueKey]/10000))
+    options.series[0].data = data.map(it=>getWAmount(it[valueKey]/10000))
+    return options
+  }
+}
+
+export default {getOpData};
+
+

+ 173 - 0
src/view/report/sales-kit/index.less

@@ -0,0 +1,173 @@
+.main-div {
+}
+
+.line {
+  width: 100%;
+  height: 350px;
+  display: flex;
+  >.line-item {
+    width: 33.33333%;
+    height: 100%;
+    padding: 10px;
+
+    >.line-item-inner {
+      position: relative;
+      width: 100%;
+      height: 100%;
+      box-shadow: 0px 10px 20px rgba(225, 229, 238, 0.6);
+
+      >.title {
+        width: 100%;
+        height: 20%;
+        background: linear-gradient(90deg, #D9F2F8 0%, #FAFEFF 100%);
+        border-radius: 8px 8px 0 0;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        padding: 0 10px;
+        >.left{
+          display: flex;
+          align-items: center;
+          justify-content: left;
+          font-size: 16px;
+          >div{
+            margin-left: 10px;
+          }
+        }
+        >.right{
+          display: flex;
+          align-items: center;
+          justify-content: space-around;
+          width: 80px;
+          border: 1px solid #00A7B5;
+          color: #00A7B5;
+          padding: 5px 4px;
+          border-radius: 40px;
+          cursor: pointer;
+        }
+      }
+
+      >.content {
+        width: 100%;
+        height: 80%;
+        background: #fff;
+        border-radius: 0 0 8px 8px;
+        >.top{
+          height: 40%;
+          padding: 5px 10px;
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          >.left{
+            >.amount{
+              display: block;
+              >.cny{
+                font-size: 14px;
+              }
+              >.number{
+                font-size: 28px;
+              }
+            }
+            >.text{
+              display: block;
+              color: #95A8CB;
+            }
+            >.yay-mam{
+              font-size: 10px;
+              >.yy{
+
+              }
+              >.mm{
+
+              }
+            }
+          }
+          >.right{
+            >.rate{
+              display: block;
+              text-align: right;
+            }
+            >.text{
+              display: block;
+              color: #95A8CB;
+              font-size: 10px;
+              text-align: right;
+            }
+          }
+        }
+        >.bottom{
+          width: 100%;
+          height: calc(60% - 5px);
+          >:nth-child(2){
+            margin-top: 5px;
+          }
+          >.bottom-line{
+            width: 100%;
+            height: 50%;
+            display: flex;
+            justify-content: space-around;
+            padding: 0 5px;
+            >.bottom-line-item{
+              background: #F8F8F8;
+              border-radius: 5px;
+              width: ~'calc(33.33% - 5px)';
+              height: 100%;
+              display: grid;
+              align-items: flex-end;
+              justify-content: center;
+              padding: 10px 0;
+              >.top{
+                display: block;
+                line-height: 1;
+                font-size: 18px;
+                text-align: center;
+                .cny{
+                  font-size: 10px;
+                }
+              }
+              >.bottom{
+                font-size: 10px;
+                color:#95A8CB;
+                display: block;
+                line-height: 1;
+                text-align: center;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
+.search-modal{
+  transition: .2s;
+  position: fixed;
+  right: 20px;
+  bottom: 20px;
+}
+
+.search-modal-true{
+  width: 300px;
+  height: 100px;
+  background: #fff;
+  opacity: 1;
+  border-radius: 5px;
+  cursor: pointer;
+  box-shadow: 0px 10px 20px rgba(225, 229, 238, 0.6);
+  border: 1px solid #dedede;
+}
+
+.search-modal-false{
+  width: 30px;
+  height: 30px;
+  background: #2d8cf0;
+  opacity: 0.5;
+  border-radius: 5px;
+  cursor: pointer;
+}
+
+.search-modal-false:hover{
+  background: #2db7f5;
+}
+
+

+ 816 - 0
src/view/report/sales-kit/index.vue

@@ -0,0 +1,816 @@
+<template>
+  <div class="main-div" style="position: relative;background: #f5f5f5;min-width: 1300px;">
+    <Modal
+      v-model="btDataShow"
+      title="自定义时间区间">
+      <DatePicker type="daterange" v-model="btDate" placeholder="请选择" style="width: 100%" confirm @on-ok="btOk"></DatePicker>
+      <div slot="footer"></div>
+    </Modal>
+    <div style="z-index: 10;box-shadow: 0px 2px 5px #c5c5c575;display: flex;height: 50px;width: 100%;align-items: center;padding: 0 20px;position: fixed;top: 40px;background: #fff;">
+      <DatePicker ref="date-picker" @on-change="onChangeDate" :editable="false" v-model="date" :clearable="false" placement="bottom-start" type="month" :format="format" :options="options2" placeholder="Select date" style="width: 200px"></DatePicker>
+
+      <SelectPop v-model="orgIds" ref="orgIds" :multiple="true" style="width:250px;margin-left: 10px"
+                 @on-change="changeSearch"
+                 :options="orgList"
+                 :title="$t('orgId')"
+                 labelKey="name"
+                 valueKey=id>
+      </SelectPop>
+      <Button style="margin-left: 5px;" type="success" @click="getReport()">{{$t('refreshReport')}}</Button>
+      <Button style="margin-left: 5px;" type="success" @click="exportAll()">导出报表</Button>
+<!--      v-if="$libaray.checkButtonHasRight('report-sales-kit-export')"-->
+
+    </div>
+    <div style="height: 50px;"></div>
+    <!--  浮窗可能不明显先注释掉吧 然后没做完全 只做个大概  -->
+<!--    <div :class="(searchModalFlag?'search-modal-true':'search-modal-false') + ' search-modal'">-->
+<!--      <div v-show="!searchModalFlag" style="width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;" @click="searchModalFlag = true">-->
+<!--        <Icon type="ios-search" color="#fff" size="24"/>-->
+<!--      </div>-->
+<!--      <div v-show="searchModalFlag" style="width: 100%;height: 100%;display: flex;position: relative;" >-->
+<!--        <div style="position:absolute;top: 5px;right: 5px;" @click="searchModalFlag = false">-->
+<!--          <Icon type="ios-close" color="#7f7f7f" size="24"/>-->
+<!--        </div>-->
+<!--        <DatePicker type="month" v-model="date" format="yyyy年MM月" :clearable="false" placeholder="Select date" style="width: 200px"></DatePicker>-->
+<!--      </div>-->
+<!--    </div>-->
+
+    <div class="line">
+      <!--   销售分析   -->
+      <div class="line-item">
+
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>销售分析</div>
+              <a class="single-export" @click="exportSingle('sale')">导出</a>
+            </div>
+            <div class="right" @click="clickDetail('order-analysis')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top">
+              <div class="left">
+                <span class="amount">
+                  <span class="cny">¥</span>
+                  <span class="number">{{ toFixAndToLocaleString(orderAnalysis.sumAmount/10000) }}</span>
+                </span>
+                <span class="text">成交额(万)</span>
+                <span class="yay-mam">
+                  同比<span class="yy">{{orderAnalysis.mmRate}}%</span>环比<span class="mm">{{orderAnalysis.yyRate}}%</span>
+                </span>
+              </div>
+            </div>
+            <div class="bottom">
+              <div class="bottom-line">
+                <div class="bottom-line-item bottom-line-item2">
+                  <span class="top"><span class="cny">¥</span>{{toFixAndToLocaleString(orderAnalysis.rejectAmount/10000)}}</span>
+                  <span class="bottom">退货额(万)</span>
+                </div>
+                <div class="bottom-line-item bottom-line-item2">
+                  <span class="top"><span class="cny">¥</span>{{ toFixAndToLocaleString(orderAnalysis.outAmount/10000) }}</span>
+                  <span class="bottom">出库额(万)</span>
+                </div>
+              </div>
+              <div class="bottom-line">
+                <div class="bottom-line-item bottom-line-item2">
+                  <span class="top">{{ orderAnalysis.csmCount }}</span>
+                  <span class="bottom">成交户数</span>
+                </div>
+                <div class="bottom-line-item bottom-line-item2">
+                  <span class="top"><span class="cny">¥</span>{{ toFixAndToLocaleString(orderAnalysis.csmUnitPrice/10000) }}</span>
+                  <span class="bottom">客单价(万)</span>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <!--   收款分析   -->
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>收款分析</div>
+              <a class="single-export" @click="exportSingle('received')">导出</a>
+            </div>
+            <div class="right" @click="clickDetail('collection-analysis')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top">
+              <div class="left">
+                <span class="amount">
+                  <span class="cny">¥</span>
+                  <span class="number">{{toFixAndToLocaleString(repayAnalysis.repayAmount/10000)}}</span>
+                </span>
+                <span class="text">收款额(万)</span>
+              </div>
+            </div>
+            <div class="bottom">
+              <div class="bottom-line" style="height: 100%">
+                <div class="bottom-line-item" style="width: calc(50% - 5px);padding: 26px 0;">
+                  <span class="top"><span class="cny">¥</span>{{toFixAndToLocaleString(repayAnalysis.debtAmount/10000)}}</span>
+                  <span class="bottom">欠款额(万)</span>
+                </div>
+                <div class="bottom-line-item" style="width: calc(50% - 5px);padding: 26px 0;">
+                  <span class="top">{{repayAnalysis.debtCount}}</span>
+                  <span class="bottom">欠款户数</span>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <!--   客户分析   -->
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>客户分析</div>
+              <a class="single-export" @click="exportSingle('customerAnalysis')">导出</a>
+            </div>
+            <div class="right" @click="clickDetail('customer-analysis')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="bottom" style="height: calc(100% - 20px); padding-top: 10px">
+              <div class="bottom-line">
+                <div class="bottom-line-item bottom-line-item1">
+                  <span class="top">{{csmAnalysisHome.csmCount}}</span>
+                  <span class="bottom">新增潜客数</span>
+                </div>
+              </div>
+              <div class="bottom-line">
+                <div class="bottom-line-item bottom-line-item2">
+                  <span class="top">{{csmAnalysisHome.agreedMmeasureCount}}</span>
+                  <span class="bottom">约尺客户数</span>
+                </div>
+                <div class="bottom-line-item bottom-line-item2">
+                  <span class="top">{{csmAnalysisHome.completeMmeasureCount}}</span>
+                  <span class="bottom">量尺客户数</span>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <div class="line">
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>客户来源分布</div>
+              <a class="single-export" @click="exportSingle('customerFrom')">导出</a>
+            </div>
+            <div class="right" @click="clickDetail('customer-from-analysis')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top" style="height: 30%;">
+              <div class="left">
+                <span class="amount" style="display: inline;">
+                  <span class="cny">¥</span>
+                  <span class="number">{{toFixAndToLocaleString(csmFromOrder.sumAmount/10000)}}</span>
+                </span>
+                <span class="text" style="display: inline;">成交额(万)</span>
+              </div>
+            </div>
+            <div class="bottom" style="height: calc(70% - 10px);">
+              <div id="echarts-khlyfb" style="height: 100%;width: 100%"></div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>产品分布</div>
+              <a class="single-export" @click="exportSingle('product')">导出</a>
+
+            </div>
+            <div class="right" @click="clickDetail('product-analysis')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top" style="height: 30%;">
+              <div class="left">
+                <span class="amount" style="display: inline;">
+                  <span class="cny">¥</span>
+                  <span class="number">{{toFixAndToLocaleString(spuAnalysis.sumAmount/10000)}}</span>
+                </span>
+                <span class="text" style="display: inline;">成交额(万)</span>
+              </div>
+            </div>
+            <div class="bottom" style="height: calc(70% - 10px);">
+              <div id="echarts-cpfb" style="height: 100%;width: 100%"></div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>部门成交排行</div>
+              <a class="single-export" @click="exportSingle('departmentTransactionRanking')">导出</a>
+            </div>
+            <div class="right"  @click="clickDetail('org-order-rank')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top" style="height: 30%;">
+              <div class="left">
+                <span class="amount" style="display: inline;">
+                  <span class="cny">¥</span>
+                  <span class="number">{{toFixAndToLocaleString(indexOrgOrder.sumAmount/10000)}}</span>
+                </span>
+                <span class="text" style="display: inline;">成交额(万)</span>
+              </div>
+            </div>
+            <div class="bottom" style="height: calc(70% - 10px);">
+              <div id="echarts-bmcjph" style="height: 100%;width: 100%"></div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+    </div>
+
+    <div class="line">
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>部门收款排行</div>
+              <a class="single-export" @click="exportSingle('departmentCollectionRanking')">导出</a>
+
+            </div>
+            <div class="right"  @click="clickDetail('org-repay-rank')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top" style="height: 30%;">
+              <div class="left">
+                <span class="amount" style="display: inline;">
+                  <span class="cny">¥</span>
+                  <span class="number">{{toFixAndToLocaleString(indexOrgRepay.sumAmount/10000)}}</span>
+                </span>
+                <span class="text" style="display: inline;">收款额(万)</span>
+              </div>
+            </div>
+            <div class="bottom" style="height: calc(70% - 10px);">
+              <div id="echarts-bmskph" style="height: 100%;width: 100%"></div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>业务员成交排行</div>
+              <a class="single-export" @click="exportSingle('staffTransactionRanking')">导出</a>
+
+            </div>
+            <div class="right"  @click="clickDetail('staff-order-rank')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top" style="height: 30%;">
+              <div class="left">
+                <span class="amount" style="display: inline;">
+                  <span class="cny">¥</span>
+                  <span class="number">{{toFixAndToLocaleString(indexStaffOrder.sumAmount/10000)}}</span>
+                </span>
+                <span class="text" style="display: inline;">成交额(万)</span>
+              </div>
+            </div>
+            <div class="bottom" style="height: calc(70% - 10px);">
+              <div id="echarts-ywycjph" style="height: 100%;width: 100%"></div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="line-item">
+        <div class="line-item-inner">
+          <Spin size="large" v-if="loading" fix ></Spin>
+
+          <div class="title">
+            <div class="left">
+              <img :src="icon" style="width: 30px;height: 30px"/>
+              <div>业务员收款排行</div>
+              <a class="single-export" @click="exportSingle('staffCollectionRanking')">导出</a>
+
+            </div>
+            <div class="right"  @click="clickDetail('staff-repay-rank')">
+              <div>详情</div>
+              <Icon type="ios-arrow-forward"/>
+            </div>
+          </div>
+          <div class="content">
+            <div class="top" style="height: 30%;">
+              <div class="left">
+                <span class="amount" style="display: inline;">
+                  <span class="cny">¥</span>
+                  <span class="number">{{toFixAndToLocaleString(indexStaffRepay.sumAmount/10000)}}</span>
+                </span>
+                <span class="text" style="display: inline;">收款额(万)</span>
+              </div>
+            </div>
+            <div class="bottom" style="height: calc(70% - 10px);">
+              <div id="echarts-ywyskph" style="height: 100%;width: 100%"></div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+
+    <Drawer title="报表明细" width="520" :closable="false" v-model="detailFlag">
+      <div style="padding: 10px;width: 500px;">
+        <OrderAnalysis v-show="type === 'order-analysis'" ref="order-analysis"></OrderAnalysis>
+        <CollectionAnalysis v-show="type === 'collection-analysis'" ref="collection-analysis"></CollectionAnalysis>
+        <CustomerAnalysis v-show="type === 'customer-analysis'" ref="customer-analysis"></CustomerAnalysis>
+        <CustomerFromAnalysis v-show="type === 'customer-from-analysis'" ref="customer-from-analysis"></CustomerFromAnalysis>
+        <ProductAnalysis v-show="type === 'product-analysis'" ref="product-analysis"></ProductAnalysis>
+        <OrgOrderRank v-show="type === 'org-order-rank'" ref="org-order-rank"></OrgOrderRank>
+        <OrgRepayRank v-show="type === 'org-repay-rank'" ref="org-repay-rank"></OrgRepayRank>
+        <StaffOrderRank v-show="type === 'staff-order-rank'" ref="staff-order-rank"></StaffOrderRank>
+        <StaffRepayRank v-show="type === 'staff-repay-rank'" ref="staff-repay-rank"></StaffRepayRank>
+      </div>
+    </Drawer>
+  </div>
+</template>
+
+<script>
+import './index.less'
+import icon from '@/assets/images/func-icon.png'
+import echartsJs from './echarts.js'
+import wxProcess from '@/components/process/index.vue'
+import { OrderAnalysis,CollectionAnalysis,CustomerAnalysis,CustomerFromAnalysis,ProductAnalysis,OrgOrderRank,OrgRepayRank,StaffOrderRank,StaffRepayRank } from './details'
+import util from "@/view/report/sales-kit/details/util";
+import store from '@/store'
+
+
+export default {
+  name: "sales-kit",
+  components:{
+    OrderAnalysis,CollectionAnalysis,CustomerAnalysis,CustomerFromAnalysis,ProductAnalysis,OrgOrderRank,OrgRepayRank,StaffOrderRank,StaffRepayRank,wxProcess
+  },
+  data() {
+    let _self = this
+    return {
+      dateType:3,
+      format:'本月',
+      options2: {
+        shortcuts: [
+          {
+            text: '本日',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本日'
+              _self.dateType = 1
+              _self.getReport()
+            }
+          },
+          {
+            text: '本周',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本周'
+              _self.dateType = 2
+              _self.getReport()
+            }
+          },
+          {
+            text: '本月',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本月'
+              _self.dateType = 3
+              _self.getReport()
+
+            }
+          },
+          {
+            text: '本年',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              _self.format = '本年'
+              _self.dateType = 5
+              _self.getReport()
+            }
+          },
+          {
+            text: '区间',
+            onClick(){
+              _self.$refs['date-picker'].visible = false
+              // _self.format = '区间'
+              _self.dateType = 6
+              _self.btDataShow = true
+              // _self.getReport()
+            }
+          }
+        ]
+      },
+      date:new Date(),
+      type:null,
+      icon,
+      tabs:[],
+      loading:false,
+      detailFlag:false,
+      dateRange:[],
+      orgIds:[],
+      orgList:[],
+      staffIds:[],
+      staffList:[],
+      searchModalFlag:false,
+      orderAnalysis :{},
+      repayAnalysis :{},
+      csmAnalysisHome:{},
+      csmFromOrder :{},
+      spuAnalysis :{},
+      indexOrgOrder :{},
+      indexOrgRepay:{},
+      indexStaffOrder:{},
+      indexStaffRepay:{},
+      btDate:[],
+      btDataShow:false
+    }
+  },
+  methods: {
+    btOk(){
+      this.format = '区间:'+this.btDate[0].format('yyyy-MM-dd') + '-' + this.btDate[1].format('yyyy-MM-dd')
+      this.btDataShow = false
+      this.getReport()
+    },
+    /* 单独导出方法 */
+    exportSingle(type){
+      const enumType = {
+        sale:"销售简报-销售分析",
+        received:"销售简报-收款分析",
+        customerAnalysis:"销售简报-客户分析",
+        customerFrom:"销售简报-客户来源分布",
+        product:"销售简报-产品分布",
+        departmentTransactionRanking:"销售简报-部门成交排行",
+        departmentCollectionRanking:"销售简报-部门收款排行",
+        staffTransactionRanking:"销售简报-业务员成交排行",
+        staffCollectionRanking:"销售简报-业务员收款排行"
+      }
+      this.doExport([type],enumType[type])
+    },
+    onChangeDate(){
+      this.format = 'yyyy年MM月'
+      this.dateType = 0
+      // this.getReport()
+    },
+    getDateStr(now) {
+      let year = now.getFullYear(); // 年
+      let month = now.getMonth() + 1; // 月
+      let day = now.getDate(); // 日
+      if(day < 10) {
+        day = '0' + day;
+      }
+
+      if(month < 10) {
+        month = '0' + month;
+      }
+      return year + "-" + month + "-" + day;
+    },
+    echarts(id,data) {
+      let echarts = require('echarts')
+      let echarts_div = echarts.init(document.getElementById(id))
+      echarts_div.setOption(
+        data
+      )
+    },
+    getDateSingle(date){
+      const year = date.getFullYear()
+      const month = date.getMonth() + 1
+      const day = date.getDate()
+      return [year, month, day].map(n => {
+        n = n.toString()
+        return n[1] ? n : '0' + n
+      }).join('-')
+    },
+    getDateBetween(date){
+      if(this.dateType === 6){
+        return {beginDate: this.btDate[0].format('yyyy-MM-dd'),endDate: this.btDate[1].format('yyyy-MM-dd')}
+      }
+      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()}
+    },
+    clickDetail(type){
+      this.type = type
+      this.$refs[type].init(this.date,this.dateType,this.format,this.staffIds,this.staffList,this.orgIds,this.orgList,this.btDate)
+      this.detailFlag = true
+    },
+    toFixAndToLocaleString(number){
+      if(!number){
+        return '0.00'
+      }
+      let arr = number.toString().split('.')
+      if(arr.length>1){
+        return parseInt(arr[0]).toLocaleString()+(parseFloat('.'+arr[1]).toFixed(2).slice(1,4))
+      }else{
+        return parseInt(arr[0]).toLocaleString()+'.00'
+      }
+    },
+    changeSearch(){
+      // this.getReport();
+    },
+    getOrgList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        ascpId:this.$store.state.user.cpId,
+        dataSourceCode: "org",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId,
+        userId:this.$store.state.user.id,
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.orgList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getStoreList(){
+      let params = {
+        cpId: this.$store.state.user.cpId,
+        ascpId:this.$store.state.user.cpId,
+        dataSourceCode: "staff",
+        docName: "客户资料",
+        orgId: this.$store.state.user.orgId,
+        sysId: this.$store.state.user.sysId,
+        userId:this.$store.state.user.id,
+      }
+      this.excute(this.$service.wxCommonService, this.$service.wxCommonService.wxStoreList, params).then(res=>{
+        if (res.code === 200) {
+          this.staffList = res.data
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    getQjDate(){
+      return {beginDate: this.btDate[0].format('yyyy-MM-dd'),endDate: this.btDate[1].format('yyyy-MM-dd')}
+    },
+
+    getExportParams(exportTypes){
+      console.log("exportTypes",exportTypes)
+      let p = {
+        /*
+        * secondTitle:合计行字符串,
+        * calc10000:需要除以一万的字段
+        * items:items对应的字段
+        * */
+        sale:{
+          saleTask:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date),{ "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"成交额(总额:万)${sumAmount},成交额(均值:万)${avgAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_index_org_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+          returnSituation:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"退货额(总额:万)${sumAmount},退货额(均值:万)${avgAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_reject', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+          customerUnitPrice:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":["avgAmount"],"secondTitle":"客户单价(均值:万)${avgAmount},成交户数 ${csmCount}",userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_csm', cpId: this.$store.state.user.cpId, orgIds: this.orgIds ,dateType:this.dateType}),
+          // activityEffect1:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"comItems","calc10000":["comAmount","sumAmount"],"secondTitle":"活动成交(万)${sumAmount},促销成交(万)${comAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_activity', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+          // activityEffect2:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"pomItems","calc10000":["pomAmount","sumAmount"],"secondTitle":"活动成交(万)${sumAmount},单品促销(万)${pomAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_activity', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+          // customizedWisdom1:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), {"items":"items","calc10000":["sumAmount","dzAmount","znAmount"],"secondTitle":"定+智品类(万)${sumAmount},定制品(万)${dzAmount},智能单品(万)${znAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_specs', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+          // customizedWisdom2:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), {"items":"dzItems","calc10000":['cabinetAmount', 'glassAmount', 'dzAmount'],"secondTitle":"定制品(万) ${dzAmount},定制柜(万) ${cabinetAmount},订制玻璃(万) ${glassAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_order_analysis_specs', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+        },
+        received:{
+          receivedTask: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date),{ "items":"items","calc10000":["avgAmount","sumAmount"],"secondTitle":"收款额(总额:万)${sumAmount},收款额(均值:万)${avgAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_index_org_repay',cpId:this.$store.state.user.cpId,orgIds:this.orgIds,dateType:this.dateType}),
+          arrearsInfo: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date),{ "items":"items","calc10000":["avgAmount","receivable"],"secondTitle":"欠款额(总额:万)${receivable},欠款额(均值:万)${avgAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_repay_debt',cpId:this.$store.state.user.cpId,orgIds:this.orgIds,dateType:this.dateType})
+        },
+        customerAnalysis:{
+          // budgetQuotation: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":["avgAmount","offerAmount"],"secondTitle":"报价(总额:万)${offerAmount},报价额(均值:万)${avgAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_csm_analysis_offer', cpId: this.$store.state.user.cpId, orgIds: this.orgIds ,dateType:this.dateType}),
+          potentialCustomerAnalysis: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":[],"secondTitle":"新增潜客${csmCount},新增成交${orderCsmCount},新增量尺${measureCsmCount},新增制图${designCsmCount}",userId:this.$store.state.user.id,type: 'f_report_s001_csm_analysis_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds ,dateType:this.dateType}),
+        },
+        customerFrom:{
+          transaction: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"成交额(总额:万)${sumAmount},成交额(均值:万)${avgAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_csm_from_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,staffIds:this.staffIds, dateType:this.dateType }),
+          // offer: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"报价(总额:万)${sumAmount},报价额(均值:万)${avgAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_csm_from_offer', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,staffIds:this.staffIds, dateType:this.dateType }),
+          potentialCustomerAnalysisFrom: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":[],"secondTitle":"新增潜客${csmCount},新增成交${orderCsmCount},新增制图${designCsmCount}",userId:this.$store.state.user.id,type: 'f_report_s001_csm_from_filing', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,staffIds:this.staffIds,dateType:this.dateType }),
+        },
+        product:{
+          productDistribution: Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date), { "items":"items","calc10000":["sumAmount"],"secondTitle":"成交额(万)${sumAmount}",userId:this.$store.state.user.id,type: 'f_report_s001_spu_analysis', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,staffIds:this.staffIds,dateType:this.dateType }),
+        },
+        departmentTransactionRanking:{
+          departmentTransactionRanking:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date),
+            { "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"成交额(总额:万)${sumAmount},成交额(均值:万)${avgAmount}", userId:this.$store.state.user.id,type: 'f_report_s001_index_org_order', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType })
+        },
+        departmentCollectionRanking:{
+          departmentCollectionRanking:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date),
+            { "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"收款额(总额:万)${sumAmount},收款额(均值:万)${avgAmount}", userId:this.$store.state.user.id,type: 'f_report_s001_index_org_repay', cpId: this.$store.state.user.cpId, orgIds: this.orgIds,dateType:this.dateType }),
+        },
+        staffTransactionRanking:{
+          staffTransactionRanking:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date),
+            { "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"成交额(总额:万)${sumAmount},成交额(均值:万)${avgAmount}",userId:this.$store.state.user.id, type: 'f_report_s001_index_staff_order', cpId: this.$store.state.user.cpId,orgIds:[], staffIds: this.staffIds,dateType:this.dateType }),
+        },
+        staffCollectionRanking:{
+          staffCollectionRanking:Object.assign(this.dateType===6?this.getQjDate():util.getBeginDateAndEndDate(this.date),
+            { "items":"items","calc10000":["sumAmount","avgAmount"],"secondTitle":"收款额(总额:万)${sumAmount},收款额(均值:万)${avgAmount}", userId:this.$store.state.user.id,type: 'f_report_s001_index_staff_repay', cpId: this.$store.state.user.cpId,orgIds:[],staffIds: this.staffIds,dateType:this.dateType }),
+        }
+      }
+      let params = {};
+      for (let i = 0; i < exportTypes.length; i++) {
+        console.log(exportTypes[i])
+        params = Object.assign(params,p[exportTypes[i]])
+      }
+      return params;
+    },
+    exportAll(){
+      this.doExport(["sale","received","customerAnalysis","customerFrom","product","departmentTransactionRanking","departmentCollectionRanking","staffTransactionRanking","staffCollectionRanking"],"销售简报-全部")
+    },
+    doExport(exportTypes,fileName){
+      let p  = this.getExportParams(exportTypes)
+      let searchCond = p[Object.keys(p)[0]]
+      let orgNameList = (searchCond.orgIds.length>0?this.orgList.filter(it=>searchCond.orgIds.indexOf(it.id)>-1):[]).map(it=>it.name)
+      // let staffList = (searchCond.orgIds.length>0?this.staffList.filter(it=>searchCond.staffIds.indexOf(it.id)>-1):this.staffList).map(it=>it.name)
+
+      let reportDate = util.getDateByDateType(this.dateType);
+      if(!reportDate){
+        reportDate = [searchCond.beginDate,searchCond.endDate]
+      }
+
+      let p2 = {
+        params:p,
+        searchCond:"开始时间:"+reportDate[0] + ",结束时间:" + reportDate[1]
+          + (orgNameList.length>0?",门店:"+orgNameList.toString():''),
+        fileName:fileName,
+        filePath: "销售管理/销售分析/",
+      }
+      // console.log(p2)
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.exportPushParams, p2).then(res=>{
+        if(res.code === 200){
+          //拼接业务服务编码
+          window.location.href = this.$config.serviceUrl + '/mdm-server'+ '-' + this.$store.state.user.svcCode.replace('_', '-') +'/mst/report/export?uuid='+res.data
+        }
+      })
+    },
+    getReport() {
+      this.loading = true
+      console.log('user',this.$store.state.user)
+      let params = {
+        orderAnalysis: Object.assign(this.getDateBetween(this.date),{
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          type: 'f_report_s001_order_analysis_home',
+          dateType:this.dateType
+        }),
+        repayAnalysis: Object.assign(this.getDateBetween(this.date),{
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          type: 'f_report_s001_repay_analysis',
+          dateType:this.dateType
+        }),
+        csmAnalysisHome: Object.assign(this.getDateBetween(this.date), {
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          type: 'f_report_s001_csm_analysis_home',
+          dateType:this.dateType
+        }),
+        csmFromOrder: Object.assign(this.getDateBetween(this.date), {
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          type: 'f_report_s001_csm_from_order',
+          dateType:this.dateType
+        }),
+        spuAnalysis: Object.assign(this.getDateBetween(this.date), {
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          type: 'f_report_s001_spu_analysis',
+          dateType:this.dateType
+        }),
+        indexOrgOrder: Object.assign(this.getDateBetween(this.date),{
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          type: 'f_report_s001_index_org_order',
+          dateType:this.dateType
+        }),
+        indexOrgRepay: Object.assign(this.getDateBetween(this.date),{
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          type: 'f_report_s001_index_org_repay',
+          dateType:this.dateType
+        }),
+        indexStaffOrder: Object.assign(this.getDateBetween(this.date),{
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          staffIds: [],
+          type: 'f_report_s001_index_staff_order',
+          dateType:this.dateType
+        }),
+        indexStaffRepay: Object.assign(this.getDateBetween(this.date),{
+          userId: this.$store.state.user.id,
+          cpId: this.$store.state.user.cpId,
+          orgIds: this.orgIds,
+          staffIds: [],
+          type: 'f_report_s001_index_staff_repay',
+          dateType:this.dateType
+        }),
+      }
+      this.excute(this.$service.detailReportService, this.$service.detailReportService.getReportBatch, params).then(res => {
+        this.loading = false
+        if (res.code === 200) {
+            this.orderAnalysis = res.data.orderAnalysis
+            this.repayAnalysis = res.data.repayAnalysis
+            this.csmAnalysisHome = res.data.csmAnalysisHome
+            this.csmFromOrder = Object.assign(res.data.csmFromOrder,{items:res.data.csmFromOrder.items.slice(0,8)})
+            this.spuAnalysis = Object.assign(res.data.spuAnalysis,{items:res.data.spuAnalysis.items.slice(0,8)})
+            this.indexOrgOrder = Object.assign(res.data.indexOrgOrder,{items:res.data.indexOrgOrder.items.slice(0,5)})
+            this.indexOrgRepay = Object.assign(res.data.indexOrgRepay,{items:res.data.indexOrgRepay.items.slice(0,5)})
+            this.indexStaffOrder = Object.assign(res.data.indexStaffOrder,{items:res.data.indexStaffOrder.items.slice(0,5)})
+            this.indexStaffRepay = Object.assign(res.data.indexStaffRepay,{items:res.data.indexStaffRepay.items.slice(0,5)})
+            this.$nextTick(() => {
+              this.echarts('echarts-khlyfb',echartsJs.getOpData({ data: res.data.csmFromOrder.items, labelKey: 'fromName', valueKey: 'orderAmount', optionType: 1 }))
+              this.echarts('echarts-cpfb', echartsJs.getOpData({ data: res.data.spuAnalysis.items, labelKey: 'specsName', valueKey: 'sumAmount', optionType: 1 }))
+              this.echarts('echarts-bmcjph', echartsJs.getOpData({ data: res.data.indexOrgOrder.items, labelKey: 'orgName', valueKey: 'orderAmount', optionType: 3 }))
+              this.echarts('echarts-bmskph', echartsJs.getOpData({ data: res.data.indexOrgRepay.items, labelKey: 'orgName', valueKey: 'repayAmount', optionType: 3 }))
+              this.echarts('echarts-ywycjph', echartsJs.getOpData({ data: res.data.indexStaffOrder.items, labelKey: 'staffName', valueKey: 'orderAmount', optionType: 2 }))
+              this.echarts('echarts-ywyskph', echartsJs.getOpData({ data: res.data.indexStaffRepay.items, labelKey: 'staffName', valueKey: 'repayAmount', optionType: 2 }))
+             })
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+  },
+  created() {
+    this.getReport()
+    this.getStoreList()
+    this.getOrgList()
+  }
+}
+</script>
+
+<style scoped>
+
+/deep/.ivu-picker-confirm>.ivu-btn-default{
+  display: none !important;
+}
+.bottom-line-item4  {
+  width: calc(25% - 5px) !important;
+}
+.bottom-line-item2  {
+  width: calc(50% - 5px) !important;
+}
+.bottom-line-item1  {
+  width: calc(100% - 5px) !important;
+}
+.single-export{
+  font-size: 14px;margin-left: 10px;
+}
+</style>