KPIProgress.wxml 1.81 KB
<!--packageCustomer/components/KPIProgress/KPIProgress.wxml-->
<view class="KPI-progress">
  <view class="header">
    <view class="title-section">
      <view class="title-container">
        <block wx:for="{{menus}}" wx:key="index">
          <view class="title {{item.index==current?'active':''}}" data-index="{{item.index}}" bind:tap="selectMenu">{{item.title}}</view>
        </block>
      </view>
    </view>
    <view class="date-section">
      <view class="arrow left">
        <van-icon wx:if="{{!leftCurrent}}" class="arrow-left" name="arrow-left" bind:tap="last" />
      </view>
      <view class="date" bind:tap="onDisplayYear">{{year}}</view>
      <view class="arrow right">
        <van-icon wx:if="{{!rightCurrent}}" class="arrow-right" name="arrow" bind:tap="next" />
      </view>
    </view>
  </view>
  <view class="content">
    <view class="kpi-table">
      <view class="kpi-header">
        <view class="col month">时间</view>
        <view class="col done">已完成</view>
        <view class="col target">当月目标</view>
        <view class="col rate">完成率</view>
      </view>
      <block wx:for="{{kpiRows}}" wx:key="month">
        <view class="kpi-row">
          <view class="col month">{{item.month}}月</view>
          <view class="col done number">{{item.completed || '-'}}</view>
          <view class="col target number">{{item.target || '-'}}</view>
          <view class="col rate number">{{item.completionRate || '-'}}</view>
        </view>
      </block>
    </view>
  </view>
</view>

<popup bind:hidePopup="cancel" bind:confirm="confirm" show="{{yearShow}}" title="选择年份" height="50vh">
  <van-picker id="yearPicker" show-toolbar="{{false}}" model:value="{{ currentDate }}" default-index="{{defaultIndex}}" value-key="label" columns="{{ yearColumns }}" bind:change="onYearChange" />
</popup>