<view>
  <view class="{{popupCx}}">
    <view class="inputs">
      <!-- <view class="flex-box flex-v-ce li" style="padding:26rpx 28rpx;">
        <view class="label">指定规则</view>
        <view class="flex-1"></view>
        <switch onChange="switchChange"  checked="{{items.checked}}" color="#26A2FF"></switch>
      </view> -->
      <!-- <view class="flex-box flex-v-ce li" data-ruleId="{{items.item_id}}" a:if="{{items.checked}}"  data-num="3" catchTap="openSelect">
        <view class="label isBt">选择规则</view>
        <view class="flex-1" a:if="{{selectRule}}">已选择1条</view>
        <view class="flex-1" a:else></view>
        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
      </view> -->
      <view class="li">
        <textarea class="textarea" maxlength="20" value="{{items.task_name}}" onInput="bindTextAreaBlur" placeholder="请输入任务内容"></textarea>
        <image mode="scaleToFill" src="../../../image/addImg.png" class="addImg" catchTap="openImg"/>
      </view>
      <view style="background:#fff;padding:0 28rpx;" a:if="{{items.file_list[0]}}" class="flex-box flex-v-ce">
        <view a:for="{{items.file_list}}" key="index" a:for-item="imgs" a:for-index="imgIndex" style="position:relative">
          <text class="detele" data-itemIndx="{{index}}" data-index="{{imgIndex}}" catchTap="deteleImg">×</text>
          <image mode="scaleToFill" class="showImg" src="{{imgs}}" data-index="{{imgIndex}}" data-item="{{items.file_list}}" catchTap="showImg"/>
        </view>
      </view>

      <view class="flex-box flex-v-ce li">
        <view class="label isBt">任务类型</view>
        <view class="flex-1 flex-box-end flex-flex-v-ce">
          <view a:for="{{types}}">
            <text a:if="{{item.code!=='JX'}}" catchTap="openType" data-id="{{item.id}}" class="van-radio {{items.pt_id==item.id? 'isTypes':''}}">{{item.name}}</text>
          </view>
        </view>
      </view>

      <view class="flex-box flex-v-ce li" style="padding:26rpx 28rpx;">
        <view class="label">指定规则</view>
        <view class="flex-1"></view>
        <switch onChange="switchChange"  checked="{{items.checked}}" color="#26A2FF"></switch>
      </view>

      <view class="flex-box flex-v-ce li"  data-ruleId="{{items.item_id}}" a:if="{{items.checked}}" data-num="3" catchTap="openSelect">
        <view class="label isBt">选择规则</view>
        <view class="flex-1" a:if="{{selectRule}}">已选择1条</view>
        <view class="flex-1" a:else></view>
        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
      </view>
      <view class="flex-box flex-v-ce li" a:else data-ruleId="{{items.rule_id2}}"  data-num="4" catchTap="openSelect">
        <view class="label isBt">选择分类</view>
        <view class="flex-1">{{items.rule_name}}</view>
        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
      </view>
      
      <view class="flex-box li margin-bottom" style="padding:15rpx 28rpx;margin-top:24rpx" a:if="{{items.checked}}">
        <view class="label isBt" style="position: relative;top:8rpx;">任务积分</view>
        <text class="red" style="position: relative;top:8rpx;" a:if="{{isArrindex==true}}">+</text>
        <text class="green" a:else style="position: relative;top:8rpx;">-</text>
        <view class="flex-1">
          <view class="flex-box flex-v-ce">
            <view a:if="{{selectRule.range_type==1&&selectRule.min_point==selectRule.max_point}}" style="padding-left:10rpx; height:60rpx;line-height:60rpx;" class="flex-1">{{items.base_point}}</view>
            <input a:else value="{{items.base_point}}" placeholder="0" type="number" onInput="bindKeyInput1"  class="flex-1"/>
            <view class="picker-box" catchTap="bindPickerChange" a:if="{{selectRule.range_type!=1}}">
              <view class="{{isArrindex==true? 'picker-right':'picker-left'}} yuan"></view>
              <view class="flex-box flex-v-ce">
                <text class="red flex-1">奖</text>
                <text class="green flex-1">扣</text>
              </view>
            </view>
          </view>
          <block a:if="{{selectRule}}">
            <view class="fontColorT input_text" a:if="{{selectRule.range_type==1&&selectRule.min_point==selectRule.max_point}}">固定：{{selectRule.min_point}} {{selectRule.pt_Obj[0].name}}</view>
            <view class="fontColorT input_text" a:else> 范围(可修改)：{{selectRule.min_point}}至{{selectRule.max_point}}
              <text>{{selectRule.pt_Obj[0].name}}</text></view>
          </block>
        </view>
      </view>
      
      <view class="flex-box li margin-bottom" style="padding:15rpx 28rpx;margin-top:24rpx" a:else>
        <view class="label isBt" style="position: relative;top:10rpx;">任务积分</view>
        <text class="red" style="position: relative;top:10rpx;">+</text>
        <view class="flex-1">
          <input value="{{items.base_point2}}" placeholder="0" type="number" onInput="bindKeyInput2" class="flex-1"/>
        </view>
      </view>


      <view class="flex-box flex-v-ce form-top" catchTap="openSelect" data-num="1">
        <view class="label isBt">执行人</view>
        <view class="flex-1 font-flex-word userList">
          <block a:for="{{users}}">
            <text style="font-size:32rpx">{{item.name}},</text>
          </block>
        </view>
        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
      </view>
      <view class="flex-box flex-v-ce li" data-num="2" data-item="{{{id:items.reviewer_id,name:items.revieweName}}}" catchTap="openSelect">
        <view class="label isBt">审批人</view>
        <view class="flex-1">{{items.revieweName}}</view>
        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
      </view>
      <view class="flex-box flex-v-ce li  margin-bottom">
        <view class="label isBt">截止时间</view>
        <view class="flex-1" a:if="{{items.task_cycle==0}}" catchTap="openDate">{{items.expire_time}}</view>
        <view class="flex-1" a:else>
          <picker onChange="activeDate" value="{{columnsIndex}}" range="{{columnsArray}}" range-key="name">
            <text >{{columnsArray[columnsIndex].name}}</text>
          </picker>
        </view>
        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
      </view>
      <view class="li">
        <textarea maxlength="100" value="{{items.task_remark}}" onInput="bindTextAreaBlur2" placeholder="请输入任务描述" data-index="{{index}}"></textarea>
      </view>
      <view class="flex-box flex-v-ce li">
        <view class="label">重复周期</view>
        <view class="flex-1">
          <picker onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{objectArray}}" range-key="name">
            <view class="row-extra">{{objectArray[arrIndex].name}}</view>
          </picker>
        </view>
        <image mode="scaleToFill" src="../../../image/right.png" class="rightImg"/>
      </view>
      <view class="flex-box li" style="padding:15rpx 28rpx;">
        <view class="label2" style="position: relative;top:10rpx;">提前奖分(天)</view>
        <text class="red" style="position: relative;top:10rpx;">+</text>
        <view class="flex-box-ce flex-1">
          <input value="{{items.ahead_award_point}}" data-name="ahead_award_point" placeholder="提前奖多少分" type="number" onInput="bindKeyInput3"/>
          <input style="border-left:1px solid #f1f1f1" data-name="ahead_award_point_limit" value="{{items.ahead_award_point_limit}}" placeholder="奖分上限" type="number" onInput="bindKeyInput3"/>
        </view>
      </view>
      <view class="flex-box li" style="padding:15rpx 28rpx;">
        <view class="label2" style="position: relative;top:10rpx;">逾期扣分(天)</view>
        <text class="green" style="position: relative;top:10rpx;">-</text>
        <view class="flex-1 flex-box-ce">
          <input value="{{items.timeout_deduction_point}}" data-name="timeout_deduction_point" placeholder="逾期扣多少分" type="number" onInput="bindKeyInput3"/>
          <input style="border-left:1px solid #f1f1f1" data-name="timeout_deduction_point_limit" value="{{items.timeout_deduction_point_limit}}" placeholder="扣分上限" type="number" onInput="bindKeyInput3"/>
        </view>
      </view>
    </view>
    <view class="btn-area">
      <button type="default" loading="{{disabled}}" class="defBtn" disabled="{{disabled}}" catchTap="formSubmit">提交</button>
    </view>
  </view>
  <view class="box" animation="{{animationInfo}}">
    <select-rule defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectItem" onClose="onClose" a:if="{{isShowType=='3'}}"/>
    <select-type defaultId="{{defaultRuleId}}" isGzType="{{isGzType}}" onConfirm="onSelectType" onClose="onClose" a:if="{{isShowType=='4'}}"/>
    <select-section-staff isLeadership="{{true}}" isBoss="{{true}}" selectUser="{{users}}" onClose="onClose" onConfirm="onSelectUser" a:if="{{isShowType=='1'}}"/>
    <select-section-staff-two islead="{{true}}" selectUser="{{reviewerObj}}" onClose="onClose" onConfirm="onSelectUser2" a:if="{{isShowType=='2'}}"/>
  </view>
</view>