<view class="bg">
  <scroll-view class="scroll" scroll-y="{{true}}">
    <view class="flex-box height">
      <image mode="scaleToFill" src="../../../image/logo.png"></image>
      <view class="flex-1">
        <view style="font-size:36rpx;color:#222;">{{result.date.start}}~{{result.date.end}}积分周报</view>
        <view class="flex-box-ce">
          <text style="padding-right:20rpx">{{result.employee.name}}</text>
          <text class="font-flex-word flex-1" style="width:3rem">{{result.site.name}}</text></view>
      </view>
    </view>
    <!-- 任务模块 -->
    <view class="task" style="padding-bottom:0rpx;position:relative">
      <view class="flex-box-end" style="color:#666;font-size:24rpx;position:absolute;top:30rpx;right:32rpx">该数据实时更新</view>
      <image mode="widthFix" src="../../../image/ch2.png" style="width:360rpx" />
      <view class="title">任务情况</view>
      <view class="item" data-index="1" catchTap="openView">
        <view class="text">你负责的任务中</view>
        <view>目前有
          <text class="num">{{result.my_tasks.doing_task_count}}</text>项任务待完成</view>
        <view>其中逾期
          <text class="num">{{result.my_tasks.overdue_task_count}}</text>项</view>
      </view>
      <view class="openUrl" a:if="{{isUrl}}" data-index="1" catchTap="openView">查看我的任务<text class="jt" style="top:2rpx">»</text></view>
      <view class="item" data-index="7" catchTap="openView">
        <view class="text margin-Top">本周任务</view>
        <view>共完成
          <text class="num">{{result.my_tasks.range_overdue_count+result.my_tasks.range_before_count+result.my_tasks.range_on_time_count}}</text>项任务</view>
        <view>其中按时完成
          <text class="num">{{result.my_tasks.range_on_time_count}}</text>项</view>
        <view>其中提前
          <text class="num">{{result.my_tasks.range_before_count}}</text>项</view>
        <view>其中逾期
          <text class="num">{{result.my_tasks.range_overdue_count}}</text>项</view>
      </view>
      <view class="openUrl" a:if="{{isUrl}}" data-index="7" catchTap="openView">查看任务详情<text class="jt" style="top:2rpx">»</text></view>
    </view>
    <view class="task" style="padding-top:0rpx;">
      <image mode="widthFix" src="../../../image/ch3.png" style="width:360rpx" />
      <view class="item" data-index="2" catchTap="openView">
        <view class="text margin-Top">你发布的任务中</view>
        <view>目前有
          <text class="num">{{result.tasks.doing_task_count}}</text>项任务待完成</view>
        <view>其中逾期
          <text class="num">{{result.tasks.overdue_task_count}}</text>项</view>
      </view>
      <view class="openUrl" data-index="2" a:if="{{isUrl}}" catchTap="openView">查看相关任务
        <text class="jt" style="top:2rpx">»</text></view>
      <view class="item" data-index="8" catchTap="openView">
        <view class="text margin-Top">本周任务</view>
        <view>共完成
          <text class="num">{{result.tasks.range_before_count+result.tasks.range_overdue_count+result.tasks.range_on_time_count}}</text>项任务</view>
        <view>其中按时完成
          <text class="num">{{result.tasks.range_on_time_count}}</text>项</view>
        <view>其中提前
          <text class="num">{{result.tasks.range_before_count}}</text>项</view>
        <view>其中逾期
          <text class="num">{{result.tasks.range_overdue_count}}</text>项</view>
      </view>
      <view class="openUrl" data-index="8" a:if="{{isUrl}}" catchTap="openView">查看相关任务
        <text class="jt" style="top:1rpx">»</text></view>
    </view>
    <!-- 积分模块 -->
    <view class="task" data-index="3" catchTap="openView" style="margin-top:40rpx">
      <image mode="widthFix" src="../../../image/ch11.png" style="width:360rpx;top:3rem" />
      <view class="title">积分执行情况</view>
      <view class="item">
        <view class="text">本周共完成
          <text class="num">{{result.award.count_all}}</text>次积分奖扣</view>
        <view>B分情况 人次
          <text class="num">{{result.award.count_b}}</text>次</view>
        <view>奖分
          <text class="num">{{result.award.sum_add_b}}</text>分</view>
        <view>扣分
          <text class="num">{{result.award.sum_sub_b}}</text>分</view>
        <view style="margin-top:40rpx">A分情况</view>
        <view>奖分
          <text class="num">{{result.award.sum_add_a}}</text>分</view>
        <view>扣分
          <text class="num">{{result.award.sum_sub_a}}</text>分</view>
      </view>
      <view class="openUrl" data-index="3" a:if="{{isUrl}}" catchTap="openView">查看奖扣统计
        <text class="jt" style="top:2rpx">»</text></view>
    </view>
    <view class="task" style="margin-top:40rpx">
      <view class="title" style="margin-bottom:20rpx"><text class="blue">{{result.rank.free_man.length}}</text>人在本周内未被奖扣</view>
      <view data-index="5" catchTap="openView" a:if="{{isUrl}}" class="openUrl">查看名单<text class="jt" style="top:0rpx">»</text></view>
    </view>
    <view class="task">
      <view class="title">出现最多的事项</view>
      <view class="item">
        <block a:if="{{result.rule.max_three_event.length>0}}">
          <view class="li" a:for="{{result.rule.max_three_event}}" data-index="4" data-item="{{item}}" catchTap="openView">
            <view class="flex-box" style="margin-bottom:0rpx">
              <view class="flex-1">{{item.detail.remark}}</view>
              <text class="jt blue" a:if="{{isUrl}}">»</text>
            </view>
            <view class="cis">
              <text class="num">{{item.count}}</text>次</view>
          </view>
        </block>
        <view a:else style="text-align: center;color:#666">暂无数据</view>
      </view>
    </view>
    <view class="task">
      <view class="title">分值最高的事项</view>
      <view class="text">B分</view>
      <view class="item" a:if="{{result.rule.point_top_b_events.length>0}}">
        <view class="li" a:for="{{result.rule.point_top_b_events}}">
          <view class="flex-box" style="margin-bottom:0rpx">
            <view class="flex-1">{{item.remark.customize}}</view>
          </view>
          <view class="cis">
            {{item.employee.name}}
            <text class="num" a:if="{{item.point>0}}">{{item.point}}</text>
            <text class="num" a:else>{{item.point}}</text>分
          </view>
        </view>
      </view>
      <view a:else style="text-align: center;color:#666">暂无数据</view>
      <view class="text">A分</view>
      <view class="item" a:if="{{result.rule.point_top_a_events.length>0}}">
        <view class="li" a:for="{{result.rule.point_top_a_events}}">
          <view class="flex-box" style="margin-bottom:0rpx">
            <view class="flex-1">{{item.remark.customize}}</view>
          </view>
          <view class="cis">
            {{item.employee.name}}
            <text class="num" a:if="{{item.point>0}}">{{item.point}}</text>
            <text class="num" a:else>{{item.point}}</text>分
          </view>
        </view>
      </view>
      <view a:else style="text-align: center;color:#666">暂无数据</view>
    </view>
    <view class="footer" data-index="6" catchTap="openView">
      <image mode="scaleToFill" src="../../../image/logo.png"></image>
      <text>以上数据统计由功道云积分制提供</text>
    </view>
  </scroll-view>
</view>