<view>
  <view class="header margin-bottom">
    <view class="header-top flex-box flex-v-ce  margin-bottom">
      <view class="flex-box flex-v-ce flex-1 ">
        <img-box name="{{dataDetail.employee_name}}" a:if="{{dataDetail.employee_name}}" imgUrl="{{dataDetail.img_url}}" height="90rpx" width="90rpx" fSize="28rpx"></img-box>
        <view class="top-left">
          <view class="name">{{dataDetail.employee_name}}</view>
          <view a:if="{{dataDetail.dept_list[0]}}">{{dataDetail.dept_list[0].dept_name}}</view>
          <view a:else>暂无部门</view>
        </view>
      </view>
      <view class="top-right">
        <view>{{dataDetail.point_config.base_point}}</view>
        <view>{{dataDetail.pt_name}}</view>
      </view>
      <view class="top-right" a:if="{{dataDetail.status == 4}}">
        <view>{{dataDetail.point_config.review_point}}</view>
        <view>最终分</view>
      </view>
    </view>
    <view class="header-main">
      <view class="flex-box flex-v-ce">
        <view class="laber">工作内容</view>
        <view class="flex-1">{{dataDetail.task_name}}</view>
      </view>
      <view class="flex-box flex-v-ce">
        <view class="laber">截止时间</view>
        <view class="flex-1">{{dataDetail.expire_time}}
        <text style="padding-left: 10px;" class="red" a:if="{{dataDetail.expire_day > 0}}">逾期{{dataDetail.expire_day}}天</text>
        </view>
      </view>
      <view class="flex-box flex-v-ce">
        <view class="laber">逾期扣分</view>
        <view class="flex-1">{{dataDetail.point_config.timeout_deduction_point}}分/天</view>
      </view>
      <view class="flex-box flex-v-ce" a:if="{{dataDetail.task_remark}}">
        <view class="laber">任务备注</view>
        <view class="flex-1">{{dataDetail.task_remark}}</view>
      </view>
      <view class="flex-box flex-v-ce">
        <view class="laber">审批人</view>
        <view class="flex-1">{{dataDetail.reviewer_name}}</view>
      </view>
      <view class="flex-box flex-v-ce">
        <view class="laber">发布人</view>
        <view class="flex-1">{{dataDetail.publisher_name}}</view>
      </view>
      <view class="flex-box flex-v-ce">
        <view class="laber">积分种类</view>
        <view class="flex-1">{{dataDetail.pt_name}}</view>
      </view>
      <view class="flex-box" a:if="{{dataDetail.task_file_list.length>0}}">
        <view class="laber">任务图片</view>
        <view class="flex-1 flex-box flex-v-ce imgs">
          <image mode="scaleToFill" data-index="{{index}}" a:for="{{dataDetail.task_file_list}}" data-item="{{dataDetail.task_file_list}}" src="{{item}}" catchTap="showImg"/>
        </view>
      </view>
    </view>
  </view>
  <view class="main border-bottom">
    <view class="flex-box flex-v-ce titles">
      <view class="title flex-1">任务进度</view>
      <view class="blue" style="font-size:28rpx" catchTap="openSchedule" a:if="{{dataDetail.employee_id ==userId  && dataDetail.status == 1 && dataDetail.progress != 100}}">更新进度</view>
    </view>
    <view class="slider">
      <slider value="{{dataDetail.progress}}" disabled="true" onChange="slider4change" min="0" max="100" show-value></slider>
    </view>
  </view>
  <view class="footer">
    <view class="flex-box flex-v-ce selectItems">
      <view data-index="1" class="{{activeIndex == 1? 'active':''}} flex-1" catchTap="activeItem">任务过程</view>
      <view data-index="2" class="{{activeIndex == 2? 'active':''}} flex-1" catchTap="activeItem">记分记录</view>
      <view a:if="{{activeIndex == 1}}" class="flex-box-end flex-2 blue ji">
        <text style="padding-right:24rpx" catchTap="openJyt" a:if="{{dataDetail.employee_id == userId && (dataDetail.status < 3)}}">+记一条</text>
      </view>
      <view a:if="{{activeIndex == 2}}" class="flex-box-end flex-2 blue ji">
        <text style="padding-right:24rpx" catchTap="openJf"  a:if="{{(dataDetail.employee_id != userId) && (dataDetail.status < 3)}}">记分</text>
      </view>
    </view>
    <view a:if="{{activeIndex == 1}}" style="margin-bottom:0.8rem">
      <view class="flex-box gc_item" a:for="{{process}}" a:if="{{item.recorder_id==dataDetail.employee_id}}">
          <view class="flex-box  flex-1">
            <img-box name="{{item.recorder}}" imgUrl="{{item.img_url}}" height="90rpx" width="90rpx" fSize="28rpx"></img-box>
            <view class="top-left flex-1">
              <view class="flex-box flex-v-ce">
                <view class="fontColorX flex-1">{{item.recorder}}</view>
                <view style="font-size:28rpx">{{item.time}}</view>
              </view>
              <view style="color:#222;margin-right:80rpx;">{{item.remark}}</view>
            </view>
            <view class="delete" a:if="{{dataDetail.employee_id ==userId  && (dataDetail.status == 1) && dataDetail.progress != 100}}">
              <image mode="scaleToFill" data-index="{{index}}" src="../../../image/delete.png" class="img" catchTap="deleteItem"></image>
            </view>
          </view>
      </view>
      <view class="flex-box-v flex-center-center noTask" a:if="{{dataDetail.gc.length==0}}">
        <image mode="scaleToFill" src="../../../image/noTask.png"/>
        <text style="font-size:24rpx">还没有任务过程去记一条吧</text>
      </view>
    </view>
    <view a:else style="margin-bottom:0.8rem">
      <view class="sum" a:if="{{total&&total>0}}">合计 +{{total}}</view>
      <view class="sum" a:if="{{total&&total<0}}">合计  {{total}}</view>
      <view class="flex-box gc_item" a:for="{{process}}" a:if="{{item.recorder_id==dataDetail.publisher_id}}">
        <view class="flex-box flex-1">
          <img-box name="{{item.recorder}}" imgUrl="{{item.img_url}}" height="90rpx" width="90rpx" fSize="28rpx"></img-box>
          <view class="top-left flex-1">
            <view class="flex-box flex-v-ce">
              <view class="fontColorX flex-1">{{item.recorder}}</view>
              <view style="font-size:28rpx">{{item.time}}</view>
            </view>
            <view a:if="{{item.point*1 > 0}}" style="margin-bottom:10rpx;">+{{item.point}}</view>
            <view a:if="{{item.point*1 < 0}}" style="margin-bottom:10rpx;">{{item.point}}</view>
            <view style="color:#222;margin-right:80rpx;">{{item.remark}}</view>
          </view>
          <view class="delete" a:if="{{dataDetail.employee_id !=userId  && dataDetail.status<3}}">
            <image mode="scaleToFill" data-index="{{index}}" src="../../../image/delete.png" class="img"  catchTap="deleteItem"></image>
          </view>
        </view>
      </view>
      <view class="flex-box-v flex-center-center noTask" a:if="{{dataDetail.jf.length==0}}">
        <image mode="scaleToFill" src="../../../image/noTask.png"/>
        <text style="font-size:24rpx">还没有任务记录去记一条吧</text>
      </view>
    </view>
  </view>
  <view class="btn-area" style="margin-top:28rpx;" a:if="{{(dataDetail.reviewer_id == userId && dataDetail.status == 2)||(dataDetail.employee_id == userId && dataDetail.status == 1)}}">
      <button type="default" loading="{{disabled}}" a:if="{{dataDetail.reviewer_id == userId && dataDetail.status == 2}}" class="defBtn" disabled="{{disabled}}" catchTap="openWc">去审批</button>
      <button type="default" loading="{{disabled}}" a:if="{{dataDetail.employee_id == userId && dataDetail.status == 1}}" class="defBtn" disabled="{{disabled}}" catchTap="openPerform">完成</button>
  </view>
  <view class="pop-up" a:if="{{isPublisher}}">
    <picker onChange="bindPickerChange" value="{{index}}" range="{{array}}">
      <image class="img2" mode="scaleToFill" src="../../../image/Bj.png"/>
    </picker>
  </view>
</view>