<!--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="search_box" style="margin-top:{{isIPX?'88px':'64px'}};">
  <van-search
    value="{{ value }}"
    shape="round"
    background="transparent"
    placeholder="请输入收款人/收款账号搜索"
    clearable
    bind:change="goSearch"
  />
</view>
<view class="top_view">
  <van-dropdown-menu active-color="#5CAE77" bind:change="changeTab" id="top_view1" style="width: 82%;">
    <van-dropdown-item value="{{ value1 }}" options="{{ option1 }}" bind:change="changeTab1" />
    <!-- <van-dropdown-item value="{{ value2 }}" options="{{ option2 }}" bind:change="changeTab2" /> -->
    <van-dropdown-item value="{{ value3 }}" options="{{ option3 }}" bind:change="changeTab3" />
  </van-dropdown-menu>
  <view class="sx_view" bindtap="showPopup">
    <text style="flex-shrink: 0;">筛选</text>
    <image src="/image/icon/icon_sx.png" style="width: 15px;height: 15px;margin-left: 5px;"></image>
  </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 right-width="{{ item.checkStatus != 1 ? 195 : 130 }}" class="workflow" wx:for="{{list}}" wx:key="index" >
  <view class="li" data-id="{{item.approvalItemTemplateId}}" data-ids="{{item.transferId}}" bindtap="toPayDetail"  >
    <view style="width:70%;flex:7;">
      <view class="tit_box">
        <image src="/image/icon/icon_fu16.png" style="width: 16px;height: 16px;margin-right: 10px;"  referrer="no-referrer|origin|unsafe-url"></image>
        <view>
          <text class="tit">{{item.payer}}</text>
          <text class="tit">{{item.payerAccount}}</text>
        </view>
        <text class="tit_tab2 {{item.checkStatus == 0 ? 'tit_dhd':item.checkStatus == 1 ? 'tit_cg':item.checkStatus == 2 ? 'tit_sb':item.checkStatus == 3 ? 'tit_rgqr':''}}">{{item.checkStatusText}}</text>
      </view>
      <view class="tit_box" wx:if="{{item.payee!=null}}">
        <image src="/image/icon/icon_yn.png" style="width: 16px;height: 36px;margin-right: 10px;flex-shrink: 0;"></image>
        <view>
          <text class="tit">{{item.payee}}</text>
          <text class="tit">{{item.payeeAccount}}</text>
        </view>
        <text class="tit_tab3 red">￥{{item.incomeAmount}}</text>
      </view>
      <view class="tit_box" wx:if="{{item.payeeToname!=null}}">
        <image src="/image/icon/icon_yh.png" style="width: 16px;height: 36px;margin-right: 10px;flex-shrink: 0;"></image>
        <view>
          <text class="tit">{{item.payeeToname}}</text>
          <text class="tit">{{item.payeeActacn}}</text>
        </view>
        <text class="tit_tab3 green">￥{{item.txnamt}}</text>
      </view>
      <view style="display: flex;align-items: center;margin-top: 10px;">
        <image src="/image/icon/clock_icon.png" style="width: 15px;height: 15px;border-radius:5px;margin-right: 5px;"></image>
        <text style="color: #878787;line-height: 1;">{{item.applyTime}}</text>
      </view>
     </view>
  </view>
  <view slot="right" class="cell_right">
    <!-- <view class="button_box"><view></view></view> -->
    <view class="button_box" data-id="{{item.recordId}}" bindtap="goMX">
      <view>
        <image src="/image/icon/icon_mx.png" style="width: 15px;height: 17px;"></image>
        <text>明细</text>
      </view>
    </view>
    <view class="button_box" bindtap="goRegular" wx:if="{{item.checkStatus != 1}}">
      <view data-id="{{item.id}}" bindtap="openDZ">
        <image src="/image/icon/icon_dz.png" style="width: 15px;height: 17px;"></image>
        <text>对账</text>
      </view>
    </view>
    <view class="button_box" 
      data-url="{{item.alternateField2}}" 
      data-field1="{{item.alternateField1}}" 
      data-field4="{{item.alternateField4}}" 
      data-field9="{{item.alternateField9}}" 
      data-id="{{item.id}}"
      bindtap="goHD">
      <view>
        <image src="/image/icon/icon_hd.png" style="width: 15px;height: 17px;"></image>
        <text>回单</text>
      </view>
    </view>
  </view>
</van-swipe-cell>
</scroll-view>

<van-popup
  show="{{ showPopup }}"
  round
  position="right"
  custom-style="height: 100%;width:90%;"
  bind:close="onClose"
>
  <view class="sx_box" style="margin-top:{{isIPX?'88px':'64px'}};">
    <text class="sx_tit">我方账户</text>

    <van-radio-group value="{{ result1 }}" bind:change="onChangeZH">
      <van-radio use-icon-slot name="{{item.bankAccountNumber}}" wx:for="{{accountList}}" wx:key="index">
        <view slot="icon" class="{{result1 == item.bankAccountNumber ? 'ys_checkbox_icon':'checkbox_icon'}}">
          {{item.accountName}}
        </view>
      </van-radio>
    </van-radio-group>
<!-- 
    <text class="sx_tit">业务类型</text>

    <van-radio-group value="{{ result2 }}" bind:change="onChangeLX">
      <van-radio use-icon-slot name="{{item.value}}" wx:for="{{option2}}" wx:key="index" >
        <view slot="icon" class="{{result2 == item.value ? 'ys_checkbox_icon':'checkbox_icon'}}">
          {{item.text}}
        </view>
      </van-radio>
    </van-radio-group> -->
     
    <text class="sx_tit">来往帐标识</text>

    <van-radio-group value="{{ result3 }}" bind:change="onChangeBS">
      <van-radio use-icon-slot name="{{item.value}}" wx:for="{{option3}}" wx:key="index" >
        <view slot="icon" class="{{result3 == item.value ? 'ys_checkbox_icon':'checkbox_icon'}}">
          {{item.text}}
        </view>
      </van-radio>
    </van-radio-group>

    <text class="sx_tit">金额范围</text>
    
    <view class="sx_input_box">
      <input placeholder="最低价" value="{{txnamtMin}}" bindinput="minInput" /><text> - </text><input placeholder="最高价" value="{{xnamtMax}}" bindinput="maxInput" />
    </view>

    <text class="sx_tit">交易日期</text>

    <view class="sx_input_box">
      <picker mode="date" value="{{beginApplyDate}}" bindchange="bindDateBeginChange">
        <view class="picker">
          <input disabled placeholder="开始日期" value="{{beginApplyDate}}" />
        </view>
      </picker>
      <text> - </text>
      <picker mode="date" value="{{endApplyDate}}" bindchange="bindDateEndChange">
        <view class="picker">
          <input disabled placeholder="结束日期" value="{{endApplyDate}}" />
        </view>
      </picker>
    </view>


    <view class="bottom">
      <!-- <view class="btn1" data-type="3" bindtap="goSubmit">提交复核</view> -->
      <view class="btn1" bindtap="reset">重置</view>
      <view class="btn2" data-type="0" bindtap="goSubmit" hover-class="btnView">确定</view>
    </view>
  </view>
</van-popup>
<van-dialog
  use-slot
  title="人工对账备注"
  show="{{ showDialog }}"
  bind:close="onClose"
  theme='round-button'
  confirmButtonText="保存"
  bind:confirm="goDZ"
  before-close="{{beforeClose }}"
  closeOnClickOverlay="{{ true }}"
>
  <input class="input_tit" placeholder="请输入人工对账备注" style="width: 90%;margin: 0 auto;margin-top: 25px;margin-bottom: 10px;text-align: center;border: 1px solid #ddd;height: 35px;line-height: 35px;" value="{{manualRemark}}" bindinput="bindNameInput"/> 
</van-dialog>

<wxs module="iOf">
  var indexOf = function(name,value){
    return name.indexOf(value);
  }
  module.exports.indexOf = indexOf;
</wxs>