<!--pages/regular/index.wxml-->
<view class="ns" id="top_ban" style="height:{{isIPX?'88px':'64px'}};">
  <image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};height: 19.0909px;" mode="widthFix" bindtap="back" referrer="no-referrer|origin|unsafe-url"></image>
  <text style="top:{{isIPX?'54px':'30px'}};">票据签收</text>
</view>

<view class="top_view" style="margin-top:{{isIPX?'88px':'64px'}};">
  <van-dropdown-menu active-color="#5CAE77" bind:change="changeTab" id="top_view1" style="flex: 1;">
    <van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" bind:change="changeTab1" />
    <van-dropdown-item value="{{ value3 }}" options="{{ option3 }}" bind:change="changeTab3" />
  </van-dropdown-menu>
  <!-- <view class="sx_view" bindtap="showPopup">
    <view class="add_btn" bindtap="goAdd"><text>新增</text></view>
  </view> -->
</view>
<scroll-view scroll-y refresher-threshold="0" style="height:100%" bindscrolltolower="paging" lower-threshold="100">
  <!-- wx:for="{{list}}" wx:key="index" wx:for-item="item" right-width="{{ 50 }}" -->
<van-swipe-cell class="workflow" right-width="{{item.billType == '2'||item.billType == '3'?'65':''}}" wx:for="{{billList}}" wx:key="index" >
  <view class="li" >
    <view style="width:70%;flex:7;">
      <view class="tit_box">
        <text class="tit_tab4">批次编码</text>
        <text class="tit">{{item.batchNum}}</text>
        <text class="tit_tab">{{item.year}}</text>
        <text class="tit_tab5">{{item.billTypeText}}</text>
      </view>
      <view class="tit_box ju_c">
        <view>
          <image src="/image/icon/icon_ss.png" style="width: 14px;height: 14px;margin-right: 2px;"></image>
          <text class="tit">{{item.startNum}}</text>
        </view>
        <view>
          <image src="/image/icon/icon_xj.png" style="width: 14px;height: 14px;margin-right: 2px;"></image>
          <text class="tit">{{item.endNum}}</text>
        </view>
      </view>
      <view class="tit_box">
          <text class="tit">下发单位：{{item.deptName}}</text>
      </view>
      <view class="tit_box mr_10">
        <!-- <view>
          <image src="/image/icon/icon_js1.png" style="width: 14px;height: 14px;margin-right: 2px;"></image>
          <text class="tit">10</text>
        </view>
        <view>
          <image src="/image/icon/icon_js2.png" style="width: 14px;height: 14px;margin-right: 2px;"></image>
          <text class="tit">2</text>
        </view>
        <view>
          <image src="/image/icon/icon_js3.png" style="width: 14px;height: 14px;margin-right: 2px;"></image>
          <text class="tit">100</text>
        </view> -->
        <view>
          <image src="/image/icon/icon_js3.png" style="width: 14px;height: 14px;margin-right: 2px;"></image>
          <text class="tit">第{{item.per}}本</text>
        </view>
      </view>
      
    </view>
    <!-- <view class="list_btn" wx:if="{{item.billType != 5}}">
      <view>
        <view class="btn btn_qs" wx:if="{{item.billType == '2'}}" data-id="{{item.id}}" bindtap="goQS">签收</view>
        <view class="btn btn_zf" wx:if="{{item.billType == '3'}}" data-id="{{item.id}}" bindtap="goZF">作废</view>
        <view class="btn btn_xf" wx:if="{{item.billType == '2'}}" data-id="{{item.id}}" bindtap="showReceiptDialog">下发</view>
      </view>
    </view>  -->
  </view>
  <view slot="right" class="cell_right">
    <view class="button_box qs" wx:if="{{item.billType == '2'}}" data-id="{{item.id}}" bindtap="goQS">         
      <view>
        <image src="/image/icon/icon_xg2.png" style="width: 20.55px;height: 20.55px;"></image>
        <text>签收</text>
      </view>
    </view>
    <view class="button_box zf" wx:if="{{item.billType == '3'}}" data-id="{{item.id}}" bindtap="goZF">
      <view>
        <image src="/image/icon/icon_sc.png" style="width: 20.55px;height: 20.55px;"></image>
        <text>作废</text>
      </view>
    </view>
  </view>
  <!-- <view slot="right" class="deleteBox">
    <view style="flex: 1;height: 100%;display: flex;align-items: center;flex-direction: column;justify-content: center;background-color: rgb(98,173,102,0.2);" data-id="{{item.id}}" data-index="{{index}}" bindtap="upload">
      <view>
        <image src="../../image/icon/upload_icon.png" style="width: 25px;height: 25px;margin: 0 auto;display: block;"  ></image>
      </view>
      <view>
        <text style="color: #62AD66;">附件</text>
      </view>
    </view>
  </view> -->
</van-swipe-cell>
</scroll-view>

<van-dialog
  use-slot
  show="{{ showReceiptDialog }}"
  bind:close="onClose"
  theme='round-button'
  confirmButtonText="票本下发"
  data-type="1"
  bind:confirm="goXF"
  before-close="{{beforeClose}}"
  closeOnClickOverlay="{{ true }}"
>
  <!-- <image src="/image/icon/icon_delete.png" style="width: 20px; height: 20px;position: absolute;top: 0;"></image> -->
  
  <view style="text-align: center;padding: 20px;border-bottom: 1px dashed #e6e6e6;width: 92%;margin: 0 auto;color: #2C8E68;font-size: 18px;">票本下发</view>
  <van-cell title="下发单位" required is-link arrow-direction="down">
    <view>
      <picker bindchange="bindSelectTypePickerChange" range="{{deptOptions}}" data-name="selectType" range-key="deptName">
        <view class="picker">
          <text>{{deptName == '' ? '请选择下发单位':deptName}}</text>
        </view>
      </picker>
    </view>
  </van-cell>
</van-dialog>
<wxs module="iOf">
  var indexOf = function(name,value){
    return name.indexOf(value);
  }
  module.exports.indexOf = indexOf;
</wxs>