<wxs src='../../../utils/numberFormat.wxs' module="numberFormat"></wxs>

<loading wx:if="{{loadingShow}}" loadingName="加载中" backgroundColor="#f2f2f2;" opacity="0.8"></loading>
<!-- 顶部筛选条件 -->
<van-sticky>

<van-dropdown-menu>
  <van-dropdown-item id="org-components" title="{{orgNames?orgNames:'全部门店' }}" data-type="org" bind:open="dropdowncommit">
  </van-dropdown-item>
  <!-- <van-dropdown-item id="month-components" title="{{monthName?monthName:'本月' }}" data-type="month" bind:open="dropdowncommit">
  </van-dropdown-item> -->
  <!-- <van-dropdown-item id="month-components" model:value="{{ value1 }}" options="{{ option1 }}" data-type="month"  bind:click="dateClick" /> -->
  <van-dropdown-item id="create-time-type" title="{{createTimeType.text}}">
    <dk-dropdown-date id="month-components"  dateType="accountdate" blankFlag="{{false}}" defaultValue='{{createTimeType.value}}' bind:dateCommit='dateCommit'></dk-dropdown-date>
  </van-dropdown-item>


</van-dropdown-menu>
</van-sticky>


<view class="main">
  <!-- 销售分析 (没函数)-->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/xsfx.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        销售分析
      </view>
      <view class="card-view-header-tags" catchtap="toDetail" data-url="/sale-analysis/sale-analysis">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content">
      <view class="card-view-content-data">
        <view class="card-view-content-data-left">
          <view>
            <view><text class="small-cny">￥</text>{{orderAnalysis.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(orderAnalysis.sumAmount/10000)) : '0.00'}}</view>
          </view>
          <view>成交额(万)</view>
          <view>
            <view>同比<view style="{{'color:'+(orderAnalysis.mmRate>0?'#00B377':orderAnalysis.mmRate<0?'#FF3500':'#19b5fe')}}"> 
                <view>{{orderAnalysis.mmRate}}%</view>
                <van-icon wx:if="{{orderAnalysis.mmRate<0}}" name="down" />
                <van-icon style="transform:rotate(180deg);" wx:if="{{orderAnalysis.mmRate>0}}" name="down" />
              </view>
            </view>
            <view>环比<view style="{{'color:'+(orderAnalysis.mmRate>0?'#00B377':orderAnalysis.mmRate<0?'#FF3500':'#19b5fe')}}"> 
              <view>{{orderAnalysis.yyRate}}%</view>
                <van-icon wx:if="{{orderAnalysis.yyRate<0}}" name="down" />
                <van-icon style="transform:rotate(180deg);" wx:if="{{orderAnalysis.yyRate>0}}" name="down" />
              </view>
            </view>
          </view>
        </view>
        <view class="card-view-content-data-right">
          <view>{{orderAnalysis.kpiRate}}%</view>
          <view>销售任务进度</view>
          <view>
            <dk-progress progress="{{orderAnalysis.kpiRate}}"></dk-progress>
          </view>
          <view style="color:#95A8CB;font-size: 10px;margin-top: 10rpx;text-align: right;">
            目标：<text style="font-size: 8px;" class="small-cny">￥</text>{{orderAnalysis.kpiAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(orderAnalysis.kpiAmount/10000)) : '0.00'}}(万)
          </view>
        </view>
      </view>

      <!-- 小电视 -->
      <view class="card-view-content-screen" style="position: relative;">
        <view class="card-view-content-screen-item" style="--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <view><text class="small-small-font">￥</text>{{orderAnalysis.rejectAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(orderAnalysis.rejectAmount/10000)) : '0.00'}}</view>
          </view>
          <view class="card-view-content-screen-item-text">退货额(万)</view>
        </view>
        <view class="card-view-content-screen-item" style="--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <view><text class="small-small-font">￥</text>{{orderAnalysis.outAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(orderAnalysis.outAmount/10000)) : '0.00'}}</view>
          </view>
          <view class="card-view-content-screen-item-text">出库额(万)</view>
        </view>
        <view class="card-view-content-screen-item" style="--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <view><text class="small-small-font">￥</text>{{orderAnalysis.activityAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(orderAnalysis.activityAmount/10000)) : '0.00'}}</view>
          </view>
          <view class="card-view-content-screen-item-text">活动成交(万)</view>
        </view>
        <view class="card-view-content-screen-item" style="--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            {{orderAnalysis.csmCount}}
          </view>
          <view class="card-view-content-screen-item-text">成交户数</view>
        </view>
        <view class="card-view-content-screen-item" style="--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <view><text class="small-small-font">￥</text>{{orderAnalysis.csmUnitPrice ? numberFormat.toThousandCents(numberFormat.numberFormat(orderAnalysis.csmUnitPrice/10000)) : '0.00'}}</view>
          </view>
          <view class="card-view-content-screen-item-text">客单价(万)</view>
        </view>
        <view class="card-view-content-screen-item" style="--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <view><text class="small-small-font">￥</text>{{orderAnalysis.specsAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(orderAnalysis.specsAmount/10000)) : '0.00'}}</view>
          </view>
          <view class="card-view-content-screen-item-text">定+智能类</view>
        </view>
      </view>
    </view>
  </view>

  <!-- 收款分析 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/skfx.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        收款分析
      </view>
      <view class="card-view-header-tags">
        <view class="card-view-header-tags-tag" catchtap="toDetail" data-url="/collection-analysis/collection-analysis">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content">
      <view class="card-view-content-data">
        <view class="card-view-content-data-left">
          <!-- <view>￥152.546.00</view> -->
          <view><text class="small-cny">￥</text>{{repayAnalysis.repayAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(repayAnalysis.repayAmount/10000)) : '0.00'}}</view>

          <view>收款额(万)</view>
          <!-- <view>
            <view>同比<view style="color:#00B377;">
                <view>{{repayAnalysis.yyRate}}</view>
                <van-icon style="transform:rotate(180deg);" name="down" />
              </view>
            </view>
            <view>环比<view style="color:#FF3500;">
                <view>{{repayAnalysis.mmRate}}</view>
                <van-icon name="down" />
              </view>
            </view>
          </view> -->
        </view>
        <view class="card-view-content-data-right">
          <view>{{repayAnalysis.repayRate}}%</view>
          <view>收款任务进度</view>
          <view>
            <dk-progress progress="{{repayAnalysis.repayRate}}"></dk-progress>
          </view>
          <view style="color:#95A8CB;font-size: 10px;margin-top: 10rpx;text-align: right;">
            目标：<text style="font-size: 8px;" class="small-cny">￥</text>{{orderAnalysis.kpiAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(repayAnalysis.kpiAmount/10000)) : '0.00'}}(万)
          </view>
        </view>
      </view>

      <!-- 小电视 -->
      <view class="card-view-content-screen" style="position: relative;">
        <view class="card-view-content-screen-item" style="width:49%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <!-- <text class="small-small-font">￥</text>{{repayAnalysis.debtAmount}} -->
            <view><text class="small-small-font">￥</text>{{repayAnalysis.debtAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(repayAnalysis.debtAmount/10000)) : '0.00'}}</view>

          </view>
          <view class="card-view-content-screen-item-text">欠款额(万)</view>
        </view>
        <view class="card-view-content-screen-item" style="width:49%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{repayAnalysis.debtCount}}</text><text class="small-small-font">户</text>
          </view>
          <view class="card-view-content-screen-item-text">欠款户数</view>
        </view>
      </view>
    </view>
  </view>

  <!-- 客户分析 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/khfx.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        客户分析
      </view>
      <view class="card-view-header-tags" catchtap="toDetail" data-url="/customer-analysis/customer-analysis">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content">
    
      <view class="card-view-content-data">
        <view class="card-view-content-data-echarts" style="padding: 0;">
          <view class="card-view-content-data-echarts-data" style="border:0;">
            <view>
              <text class="small-small-font">￥</text>{{csmAnalysisHome.offerAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(csmAnalysisHome.offerAmount/10000)) : '0.00'}}
            </view>
            <view>报价额(万)</view>
          </view>
        </view>
      </view>

      <!-- 小电视 -->
      <view class="card-view-content-screen" style="position: relative;">
        <view class="card-view-content-screen-item" style="width:24.5%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.csmCount}}</text><text class="small-small-font">户</text>
          </view>
          <view class="card-view-content-screen-item-text">新增潜客数</view>
        </view>

        <view class="card-view-content-screen-item" style="width:24.5%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.designCsmCount}}</text><text class="small-small-font">户</text>
          </view>
          <view class="card-view-content-screen-item-text">设计客户数</view>
        </view>

        <view class="card-view-content-screen-item" style="width:24.5%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.offerCsmCount}}</text><text class="small-small-font">户</text>
          </view>
          <view class="card-view-content-screen-item-text">报价客户数</view>
        </view>

        <view class="card-view-content-screen-item" style="width:24.5%;margin-top:0;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.offerRate}}</text><text class="small-small-font">%</text>
          </view>
          <view class="card-view-content-screen-item-text">报价率</view>
        </view>

        <view class="card-view-content-screen-item" style="width:24.5%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.agreedMmeasureCount}}</text><text class="small-small-font">户</text>
          </view>
          <view class="card-view-content-screen-item-text">约尺客户数</view>
        </view>

        <view class="card-view-content-screen-item" style="width:24.5%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.completeMmeasureCount}}</text><text class="small-small-font">户</text>
          </view>
          <view class="card-view-content-screen-item-text">量尺客户数</view>
        </view>

        <view class="card-view-content-screen-item" style="width:24.5%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.orderCsmCount}}</text><text class="small-small-font">户</text>
          </view>
          <view class="card-view-content-screen-item-text">新增成交客户数</view>
        </view>

        <view class="card-view-content-screen-item" style="width:24.5%;--filterBlur--:{{filterBlur}}">
          <view class="card-view-content-screen-item-important">
            <text>{{csmAnalysisHome.orderRate}}</text><text class="small-small-font">%</text>
          </view>
          <view class="card-view-content-screen-item-text">成交率</view>
        </view>
      </view>
    </view>
  </view>

  <!-- 客户来源分布 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/khlyfb.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        客户来源分布
      </view>
      <view class="card-view-header-tags" catchtap="toDetail" data-url="/customer-from-analysis/customer-from-analysis">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content-data-echarts">
      <view class="card-view-content-data-echarts-data">
        <view>
          <text class="small-small-font">￥</text>{{csmFromOrder.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(csmFromOrder.sumAmount/10000)) : '0.00'}}
        </view>
        <view>成交额(万)</view>
      </view>
    </view>
    <view style="z-index: 0 !important;width: 100%; height: 271rpx;">
      <ec-canvas type="2d" canvas-id="echarts-khlyfb" id="echarts-khlyfb" ec="{{ ec }}" />
    </view>
  </view>

  <!-- 产品分布 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/cpfb.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        产品分布
      </view>
      <view class="card-view-header-tags"  catchtap="toDetail" data-url="/product-analysis/product-analysis">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content-data-echarts">
      <view class="card-view-content-data-echarts-data">
        <!-- <view>￥152.00</view> -->
        <view><text class="small-cny">￥</text>{{spuAnalysis.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(spuAnalysis.sumAmount/10000)) : '0.00'}}</view>
        <view>成交额(万)</view>
      </view>
    </view>
    <view style="z-index: 0 !important;width: 100%; height: 271rpx;">
      <ec-canvas type="2d" canvas-id="echarts-cpfb" id="echarts-cpfb" ec="{{ ec }}" />
    </view>
  </view>

  <!-- 部门成交 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/bmcjeph.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        部门成交额排行
      </view>
      <view class="card-view-header-tags" catchtap="toDetail" data-url="/org-order-rank/org-order-rank">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content-data-echarts">
      <view class="card-view-content-data-echarts-data">
        <view>
          <text class="small-small-font">￥</text>{{indexOrgOrder.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(indexOrgOrder.sumAmount/10000)) : '0.00'}}
        </view>
        <view>成交额(万)</view>
      </view>
    </view>
    <view style="z-index: 0 !important;width: 100%; height: 327rpx;">
      <ec-canvas type="2d" canvas-id="echarts-bmcj" id="echarts-bmcj" ec="{{ ec }}" />
    </view>
  </view>

  <!-- 部门收款 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/bmskeph.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        部门收款额排行
      </view>
      <view class="card-view-header-tags" catchtap="toDetail" data-url="/org-repay-rank/org-repay-rank">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content-data-echarts">
      <view class="card-view-content-data-echarts-data">
        <view>
          <text class="small-small-font">￥</text>{{indexOrgRepay.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(indexOrgRepay.sumAmount/10000)) : '0.00'}}
        </view>
        <view>成交额(万)</view>
      </view>
    </view>
    <view style="z-index: 0 !important;width: 100%; height: 327rpx;">
      <ec-canvas type="2d" canvas-id="echarts-bmsk" id="echarts-bmsk" ec="{{ ec }}" />
    </view>
  </view>

  
  <!-- 业务员成交 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/ywycjeph.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        业务员成交额排行
      </view>
      <view class="card-view-header-tags" catchtap="toDetail" data-url="/staff-order-rank/staff-order-rank">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content-data-echarts">
      <view class="card-view-content-data-echarts-data">
        <view>
          <text class="small-small-font">￥</text>{{indexStaffOrder.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(indexStaffOrder.sumAmount/10000)) : '0.00'}}
        </view>
        <view>成交额(万)</view>
      </view>
    </view>
    <view style="z-index: 0 !important;width: 100%; height: 327rpx;">
      <ec-canvas type="2d" canvas-id="echarts-ywycj" id="echarts-ywycj" ec="{{ ec }}" />
    </view>
  </view>

  <!-- 业务员收款 -->
  <view class="card-view">
    <view class="card-view-header">
      <view class="card-view-header-name">
        <image src="../../../static/img/ywyskeph.png" class="header-icon" style="width: 30rpx;height:30rpx;margin-right: 15rpx;"></image>
        业务员收款额排行
      </view>
      <view class="card-view-header-tags" catchtap="toDetail" data-url="/staff-repay-rank/staff-repay-rank">
        <view class="card-view-header-tags-tag">详情
          <van-icon style="margin-left: 14rpx;" name="arrow" />
        </view>
      </view>
    </view>
    <view class="card-view-content-data-echarts">
      <view class="card-view-content-data-echarts-data">
        <view>
          <text class="small-small-font">￥</text>{{indexStaffRepay.sumAmount ? numberFormat.toThousandCents(numberFormat.numberFormat(indexStaffRepay.sumAmount/10000)) : '0.00'}}
        </view>
        <view>成交额(万)</view>
      </view>
    </view>
    <view style="z-index: 0 !important;width: 100%; height: 327rpx;">
      <ec-canvas type="2d" canvas-id="echarts-ywysk" id="echarts-ywysk" ec="{{ ec }}" />
    </view>
  </view>

</view>




<!-- 选门店 -->
<dk-muti-dropdown-item show="{{orgFlag}}" docName="客户资料" id='org' typeName='org' bind:muticommit='mutiSearchAll' bind:muticlose='muticloseAll'></dk-muti-dropdown-item>

