<!--pages/drawee/drawee.wxml-->
<view class="ns" style="height:{{isIPX?'88px':'64px'}};">
  <image src="../../image/apply/back.png" style="top:{{isIPX?'54px':'30px'}};" mode="widthFix" bindtap="back"></image>
  <text style="top:{{isIPX?'54px':'30px'}};">村账户</text>
</view>
<!-- 付款单位开始 -->
<view class="top" style="margin-top:{{isIPX?'100px':'75px'}};">
  <image src="../../image/apply/dress_icon.png" mode="widthFix"></image>
  <view class="top-tit">付款单位</view>
  <view class="top-title">{{bookName}}</view>
</view>

<view class="main">
  <van-tabs sticky color="#000" animated>
    <van-tab title="银行账户">
      <view class="list_box" style="padding: 0 3%;">
        <van-swipe-cell right-width="{{ 195 }}" wx:for="{{accountList}}" wx:key="index">
          <view class="bank_box">
            <text class="zt">{{item.bankUseType == 1 ?'基本户':'一般户'}}</text>
            <image src="../../image/apply/bgt.png" wx:if="{{item.bankUseType == 1}}" style="width: 100%;position: absolute;top:0;right:0;z-index: 9;height: 100%;"></image>
            <image src="../../image/apply/bgy.png" wx:else style="width: 100%;position: absolute;top:0;right:0;z-index: 9;height: 100%;"></image>
            <view class="bank_content {{iOf.indexOf(item.bankTypeText,'中国银行') > -1 ? 'ICBC':iOf.indexOf(item.bankTypeText,'农商行') > -1 ? 'RCB':iOf.indexOf(item.bankTypeText,'农业银行') > -1 ? 'ABC':iOf.indexOf(item.bankTypeText,'建设银行') > -1 ? 'CCB':iOf.indexOf(item.bankTypeText,'邮储银行') > -1 ? 'EMS':iOf.indexOf(item.bankTypeText,'工商银行') > -1 ? 'BOC':iOf.indexOf(item.bankTypeText,'中原银行') > -1 ? 'ZYB':'bank_other'}}">
              <view class="bankName">
                <image src="../../image/apply/{{iOf.indexOf(item.bankTypeText,'中国银行') > -1 ? 'ICBC':iOf.indexOf(item.bankTypeText,'农商行') > -1 ? 'RCB':iOf.indexOf(item.bankTypeText,'农业银行') > -1 ? 'ABC':iOf.indexOf(item.bankTypeText,'建设银行') > -1 ? 'CCB':iOf.indexOf(item.bankTypeText,'邮储银行') > -1 ? 'EMS':iOf.indexOf(item.bankTypeText,'工商银行') > -1 ? 'BOC':iOf.indexOf(item.bankTypeText,'中原银行') > -1 ? 'ZYB':'other'}}.png" style="width: 25px"  mode="widthFix"></image>
                <text>{{item.accountName}}</text>
              </view>
              
              <view style="margin-top: 2vh;">{{item.bankAccountNumber}}<text>卡号</text></view> 
              <view>可用余额</view> 
              <view style="font-weight: bold;font-size: 22px;margin-top: 2vh;">
                {{item.balance}}
                
                <image src="/image/icon/icon_zfkl.png" data-id="{{item.id}}" data-index="{{index}}" data-name="{{item.accountName}}" bindtap="showDialog" style="width: 20px;height: 20px;vertical-align: middle;position: absolute;right: calc(2vh + 30px);z-index: 10;"></image>

                <image src="/image/apply/update.png" data-id="{{item.id}}" data-index="{{index}}" bindtap="updateMoney" style="width: 20px;height: 20px;vertical-align: middle;position: absolute;right: 2vh;z-index: 10;"></image>
              </view> 
            </view>
          </view>
          <view slot="right" class="cell_right">
            <view class="button_box"><view></view></view>
            <view class="button_box" data-id="{{item.id}}" bindtap="showTransactionDialog">
              <view>
                <image src="/image/icon/icon_mx.png" style="width: 15px;height: 17px;"></image>
                <text>明细</text>
              </view>
            </view>
            <view class="button_box" data-id="{{item.id}}" bindtap="goRegular">
              <view>
                <image src="/image/icon/icon_dq.png" style="width: 15px;height: 17px;"></image>
                <text>定期</text>
              </view>
            </view>
            <view class="button_box" data-id="{{item.id}}" bindtap="showReceiptDialog">
              <view>
                <image src="/image/icon/icon_hd.png" style="width: 15px;height: 17px;"></image>
                <text>回单</text>
              </view>
            </view>
          </view>
        </van-swipe-cell>
      </view>
      <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" />
      <!-- <view class="addBtn" data-url="/pages/drawee/add/add" bindtap="navigate">
        <image src="/image/icon/icon_add.png"></image>
        <text>添加银行账户</text>
      </view> -->
    </van-tab>
    <van-tab title="现金账户">
    
    <view class="list_box" style="padding: 0 3%;">
      <view class="bank_box" wx:for="{{accountListXJ}}" wx:key="index" style="margin-top: 20px;">
        <view class="bank_content XJ">
          <view class="bankName">
            <image src="../../image/apply/XJ.png" style="width: 25px"  mode="widthFix"></image>
            <text>{{item.accountName}}</text>
          </view>
          
          <view style="margin-top: 2vh;">{{item.subjectId}}<text>{{item.subjectNameAll}}</text></view> 
          <view>可用余额</view> 
          <view style="font-weight: bold;font-size: 22px;margin-top: 2vh;">
            {{item.balance}}
            <image src="/image/apply/update.png" data-id="{{item.id}}" data-index="{{index}}" bindtap="updateMoney" style="width: 20px;height: 20px;vertical-align: middle;position: absolute;right: 2vh;z-index: 10;"></image>
          </view> 
        </view>
      </view>
    </view>
      <!-- <view class="addBtn">
        <image src="/image/icon/icon_add.png"></image>
        <text>添加现金账户</text>
      </view> -->

      <van-empty wx:if="{{accountList.length == 0}}" description="暂无现金账户" />
      
      <!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" /> -->
    </van-tab>

    <van-tab title="公务卡">
      <view class="list_box" style="padding: 0 3%;">
      <view class="bank_box" wx:for="{{accountListGWK}}" wx:key="index" style="margin-top: 20px;">
        <view class="bank_content gwk">
          <view class="bankName">
            <image src="../../image/apply/icon_GWK.png" style="width: 25px"  mode="widthFix"></image>
            <text>公务卡</text>
          </view>
          <view style="margin-top: 2vh;">{{item.payeeAccount}}<text>卡号</text></view> 
          <view>{{item.bankDeposit}}</view>
          <!-- <view>可用余额</view> 
          <view style="font-weight: bold;font-size: 22px;margin-top: 2vh;">10,288.83</view>  -->
        </view>
        <view class="holder">持有人：{{item.payee}}</view>
      </view>
      </view>
      <!-- <van-empty wx:if="{{accountList.length == 0}}" description="暂无银行账户" />

      <view class="addBtn">
        <image src="/image/icon/icon_add.png"></image>
        <text>添加公务卡</text>
      </view> -->

    </van-tab>
  </van-tabs>
</view>
<van-dialog
  use-slot
  title="修改支付口令"
  show="{{ showDialog }}"
  bind:close="onClose"
  theme='round-button'
  confirmButtonText="保存"
  data-type="1"
  bind:confirm="edit"
  before-close="{{beforeClose }}"
  closeOnClickOverlay="{{ true }}"
>
  <text style="display: block;text-align: center;color: #2C8E68;margin-top: 10px;">{{bankName}}</text>
  <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="{{password}}" bindinput="bindNameInput"/> 
  <text style="width: 90%;margin: 0 auto;margin-top: 15px;margin-bottom: 10px;font-size: 12px;display: block;color: red;text-align: center;">提示：\n此口令为银农直联平台支付人员权限的验证！\n至少6个字符，必须包括字母、数字和符号</text>
</van-dialog>
<view class="ipXbtn"></view>

<van-dialog
  use-slot
  show="{{ showTransactionDialog }}"
  bind:close="onClose"
  theme='round-button'
  confirmButtonText="查询"
  data-type="1"
  bind:confirm="selectAccount"
  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>

  <image src="/image/icon/icon_deleteNew.png" style="width: 22px ;height:22px;position: absolute;top: 18px;right: 16px;" data-name="showTransactionDialog" bindtap="onClose"></image>
  <van-cell title="查询类型" required is-link arrow-direction="down">
    <view>
      <picker bindchange="bindSelectTypePickerChange" range="{{selectTypeOptions}}" data-name="selectType" range-key="dictLabel">
        <view class="picker">
          <text>{{form.selectTypeText == '' ? '请选择查询类型':form.selectTypeText}}</text>
        </view>
      </picker>
    </view>
  </van-cell>

  <van-cell title="来往账标识" required is-link arrow-direction="down">
    <view>
      <picker bindchange="bindDirectionPickerChange" range="{{directionOptions}}" data-name="direction" range-key="dictLabel">
        <view class="picker">
          <text>{{form.directionText == '' ? '请选择来往账标识':form.directionText}}</text>
        </view>
      </picker>
    </view>
  </van-cell>

  <van-cell title="开始日期" required is-link arrow-direction="down">
    <view>
      <picker mode="date" bindchange="bindDatescopeFromPickerChange">
        <view class="picker">
          <text>{{form.datescopeFrom == '' ? '请选择开始日期':form.datescopeFrom}}</text>
        </view>
      </picker>
    </view>
  </van-cell>

  <van-cell title="截止日期" required is-link arrow-direction="down">
    <view>
      <picker mode="date" bindchange="bindDatescopeToPickerChange">
        <view class="picker">
          <text>{{form.datescopeTo == '' ? '请选择截止日期':form.datescopeTo}}</text>
        </view>
      </picker>
    </view>
  </van-cell>
 
  <van-field value="{{ form.amountscopeFrom }}" label="下限" placeholder="请输入下限" input-align="right" data-name="form.amountscopeFrom" bind:change="onChange" />
  <van-field value="{{ form.amountscopeTo }}" label="上限" placeholder="请输入上限" input-align="right" data-name="form.amountscopeTo" bind:change="onChange" />
</van-dialog>

<van-dialog
  use-slot
  show="{{ showReceiptDialog }}"
  bind:close="onClose"
  theme='round-button'
  confirmButtonText="查询"
  data-type="1"
  bind:confirm="bankReceipt"
  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>
  <image src="/image/icon/icon_deleteNew.png" style="width: 22px ;height:22px;position: absolute;top: 18px;right: 16px;" data-name="showReceiptDialog" bindtap="onClose"></image>
  <van-cell title="查询类型" required is-link arrow-direction="down">
    <view>
      <picker bindchange="bindSelectTypePickerChange" range="{{selectTypeOptions}}" data-name="selectType" range-key="dictLabel">
        <view class="picker">
          <text>{{form.selectTypeText == '' ? '请选择查询类型':form.selectTypeText}}</text>
        </view>
      </picker>
    </view>
  </van-cell>

  <van-cell title="业务类型" required is-link arrow-direction="down">
    <view>
      <picker bindchange="bindReceiptPickerChange" range="{{receiptOptions}}" data-name="direction" range-key="dictLabel">
        <view class="picker">
          <text>{{form.directionText == '' ? '请选择业务类型':form.directionText}}</text>
        </view>
      </picker>
    </view>
  </van-cell>

  <van-cell title="开始日期" required is-link arrow-direction="down">
    <view>
      <picker mode="date" bindchange="bindDatescopeFromPickerChange">
        <view class="picker">
          <text>{{form.datescopeFrom == '' ? '请选择开始日期':form.datescopeFrom}}</text>
        </view>
      </picker>
    </view>
  </van-cell>

  <van-cell title="截止日期" required is-link arrow-direction="down">
    <view>
      <picker mode="date" bindchange="bindDatescopeToPickerChange">
        <view class="picker">
          <text>{{form.datescopeTo == '' ? '请选择截止日期':form.datescopeTo}}</text>
        </view>
      </picker>
    </view>
  </van-cell>

</van-dialog>
<view class="ipXbtn"></view>


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