<!--pages/transaction/transactionDetail/transactionDetail.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"></image>
  <text style="top:{{isIPX?'54px':'30px'}};">新增乡镇账户</text>
</view>
<view class="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};">

    <van-field required readonly label="所属银行" value="{{ form.bankTypeText }}" placeholder="所属银行" border="{{ false }}" input-align="right"  is-link arrow-direction	="down" data-name="showBankType" bindtap="showPopup" />
    <van-popup show="{{showBankType}}" round position="bottom"  bind:close="closePopup" data-name="showBankType">
      <van-picker
        columns="{{bankTypeOptions}}"
        show-toolbar
        value-key="dictLabel"
        bind:cancel="closePopup"
        bind:confirm="onConfirmBank"
        data-name="showBankType"
        data-formname="form.bankType"
      />
    </van-popup>

    <van-field required readonly label="账户分类" value="{{ form.townAccountTypeText }}" placeholder="账户分类" border="{{ false }}" input-align="right"  is-link arrow-direction	="down" data-name="showTownAccountType" bindtap="showPopup" />
    <van-popup show="{{showTownAccountType}}" round position="bottom"  bind:close="closePopup" data-name="showTownAccountType">
      <van-picker
        columns="{{townAccountTypeOptions}}"
        show-toolbar
        value-key="dictLabel"
        bind:cancel="closePopup"
        bind:confirm="onConfirm"
        data-name="showTownAccountType"
        data-formname="form.townAccountType"
      />
    </van-popup>

    <van-field required readonly label="管控类型" value="{{ form.managementControlTypeText }}" placeholder="管控类型" border="{{ false }}" input-align="right"  is-link arrow-direction	="down" wx:if="{{form.townAccountType == 1}}" data-name="showManagementControlType" bindtap="showPopup" />
    <van-popup show="{{showManagementControlType}}" round position="bottom"  bind:close="closePopup" data-name="showManagementControlType">
      <van-picker
        columns="{{managementControlTypeOptions}}"
        show-toolbar
        value-key="dictLabel"
        bind:cancel="closePopup"
        bind:confirm="onConfirm"
        data-name="showManagementControlType"
        data-formname="form.managementControlType"
      />
    </van-popup>

    <van-field required readonly label="中心账套" value="{{ form.centralBookIdText }}" placeholder="中心账套" border="{{ false }}" input-align="right"  is-link arrow-direction	="down" wx:if="{{form.townAccountType == 1 && form.managementControlType == 2}}" data-name="showCentralBookId" bindtap="showPopup" />
    <van-popup show="{{showCentralBookId}}" round position="bottom"  bind:close="closePopup" data-name="showCentralBookId">
      <van-picker
        columns="{{centralBookIdOptions}}"
        show-toolbar
        value-key="bookName"
        bind:cancel="closePopup"
        bind:confirm="onConfirmBook"
        data-name="showCentralBookId"
        data-formname="form.centralBookId"
      />
    </van-popup>

    <van-field required readonly label="会计科目" value="{{ form.centralSubjectIdText }}" placeholder="会计科目" border="{{ false }}" input-align="right"  is-link arrow-direction	="down" wx:if="{{form.townAccountType == 1 && form.managementControlType == 2}}" data-name="showCentralSubjectId" bindtap="showPopup" />
    <van-popup show="{{showCentralSubjectId}}" round position="bottom"  bind:close="closePopup" data-name="showCentralSubjectId">
      <van-picker
        columns="{{centralSubjectIdOptions}}"
        show-toolbar
        value-key="subjectName"
        bind:cancel="closePopup"
        bind:confirm="onConfirmSubjectId"
        data-name="showCentralSubjectId"
        data-formname="form.centralSubjectId"
      />
    </van-popup>
    
    <van-field readonly label="账户类型" value="{{ form.accountType }}" border="{{ false }}" input-align="right" required>
      <view slot="input">
        <van-radio-group
          value="{{ form.accountType }}"
          bind:change="onChange"
          direction="horizontal"
          data-formname="form.accountType"
        >
          <van-radio name="1" checked-color="#2C8E68">公户</van-radio>
          <van-radio name="2" checked-color="#2C8E68">私户</van-radio>
        </van-radio-group>
      </view>
    </van-field>

    <van-field required  label="账户名称" value="{{ form.payee }}" placeholder="账户名称" border="{{ false }}" input-align="right" data-formname="form.payee" bind:change="inputChange" />

    <van-field required  label="银行账号" value="{{ form.payeeAccount }}" placeholder="银行账号" border="{{ false }}" input-align="right" data-formname="form.payeeAccount" bind:change="inputChange" />

    <van-field required readonly label="开户银行" value="{{ form.bankDeposit }}" placeholder="开户银行" border="{{ false }}" input-align="right"  is-link arrow-direction	="down" data-name="showDepositType" bindtap="showPopup" />
    <van-popup show="{{showDepositType}}" round position="bottom"  bind:close="closePopup" data-name="showDepositType">
      <van-picker
        columns="{{depositOptions}}"
        show-toolbar
        value-key="bankDeposit"
        bind:cancel="closePopup"
        bind:confirm="onConfirmaDeposit"
        data-name="showDepositType"
        data-formname="form.bankDeposit"
      />
    </van-popup>

    <van-field required readonly label="联行号" value="{{ form.payeePaymentLines }}" placeholder="联行号" border="{{ false }}" input-align="right" bind:change="inputChange"/>

    <van-field required  label="支付口令" value="{{ form.accountPassword }}" placeholder="支付口令" border="{{ false }}" input-align="right" data-formname="form.accountPassword" bind:change="inputChange"/>

    <van-field  label="客户编号" value="{{ form.cifNo }}" placeholder="客户编号" border="{{ false }}" input-align="right" data-formname="form.cifNo" bind:change="inputChange"/>

    <van-field  label="清分账簿号" value="{{ form.accountNo }}" placeholder="清分账簿号" border="{{ false }}" input-align="right" data-formname="form.accountNo" bind:change="inputChange"/>

    <van-field readonly label="数据状态" value="{{ form.status }}" border="{{ false }}" input-align="right" >
      <view slot="input">
        <van-radio-group
          value="{{ form.status }}"
          bind:change="onChange"
          direction="horizontal"
          data-value="form.status"
        >
          <van-radio name="0" checked-color="#2C8E68">正常</van-radio>
          <van-radio name="1" checked-color="#2C8E68">停用</van-radio>
        </van-radio-group>
      </view>
    </van-field>

    <van-field  label="备注" value="{{ form.remark }}" placeholder="备注" border="{{ false }}" input-align="right" data-formname="form.remark" bind:change="inputChange"/>

  </view>
  <view class="bottom">
    <view class="btn2" bindtap="goSubmit">保存</view>
  </view> 