<!--pages/apply/paymentTemplate/add/add.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="pure_top" style="top:{{isIPX?'88px':'64px'}};"></view>
<!-- <view class="main-box top-box" style="margin-top:{{isIPX?'100px':'75px'}};">
  <text class="box-title">审批事项</text>
  <input class="input_tit" placeholder="请输入审批事项" value="{{form.approvalItemTemplate.approvalItems}}" bindinput="bindKeyInput"/>
  <text>提交单位：{{form.approvalItemTemplate.submitCompany}}</text>
  <text>提交日期：{{form.approvalItemTemplate.submitDate}}</text>
  <text>提  交  人：{{form.approvalItemTemplate.submitter}}</text>
  <text>联系电话：{{form.approvalItemTemplate.telephone}}</text>
  <text>总  金  额：{{form.approvalItemTemplate.totalAmount}}</text>
</view> -->
<!-- 
  顶部审批事项红星  没填标红框
  非空验证定位位置
  支出总金额默认0.00
 -->
<view class="main-box top-box topBox" style="margin-top:{{isIPX?'100px':'75px'}};">
  <text class="box-title">审批事项</text>

  <van-field required focus="{{topInputTirme}}" error="{{topInputTirme}}" class="input_tittop {{topInputTirme?'error':''}}" data-formname="topInput" value="{{ form.approvalItemTemplate.approvalItems }}" placeholder="请输入审批事项" border="{{ false }}" bind:input="bindKeyInput"/>
  <text>支出总金额</text>
  <view class="money_box">￥<input class="input_money" type="digit" disabled placeholder="总金额" placeholder-style="color:#E90000;" value="{{form.approvalItemTemplate.totalAmount}}"/></view>
  <text>提交单位：{{form.approvalItemTemplate.submitCompany}}</text>
  <!-- <text>提交日期：{{form.approvalItemTemplate.submitDate}}</text> class="input_tit" -->
  <text>提<text style="margin-right:0.5rem;display: inline-block;"></text>交<text style="margin-right:0.5rem;display: inline-block;"></text>人：{{form.approvalItemTemplate.submitter}}</text>


  <text>联系电话：{{form.approvalItemTemplate.telephone}}</text>
  <van-field required label="申请时间：" readonly is-link value="{{ applyDate }}" placeholder="请选择申请时间" border="{{ false }}" bind:change="onChangeTime" bindtap="openBox" data-name="showApplyDate" />
  <van-calendar show="{{ showApplyDate }}" bind:close="closeBox"  data-name="showApplyDate" bind:confirm="onConfirmTime" data-value="form.transfers[{{index}}].applyDate" show-confirm="{{ false }}" />
</view>

  <van-collapse accordion value="{{ activeNames }}" bind:change="onChangeBox" bind:open="onOpen" bind:close="onCloseSecond">
    <van-collapse-item name="{{index}}" disabled="{{item.collapseDis}}" is-link="{{false}}" wx:for="{{form.transfers}}" wx:key="index" data-index="{{index}}" >
      <view slot="title" wx:if="{{item.showTitle}}" class="main-title">事项{{form.transfers[index].num}}
        <image src="/image/apply/delete.png" style="width: 24px;height: 24px;position: absolute;right: 4%;top: 10px;" data-index="{{index}}" bindtap="deleteTransfers"></image>
        <image src="/image/apply/icon_close.png" style="width: 24px;height: 24px;position: absolute;right: calc(4% + 30px);top: 10px;transform: rotateX(180deg);" data-index="{{index}}" bindtap="disabledBlock"></image>
      </view>
      <view slot="title" class="tit_box" wx:if="{{!item.showTitle}}">
        <text class="title" style="text-align: center;color: #000;">事项{{item.num}}</text>
        <view class="top-box">
          <text style="color: #000;">支出金额</text>

          <view class="money_box" data-index="{{index}}" bindtap="disabledNone">￥<input disabled="{{form.transfers[index].amountReadonly}}" class="input_money" type="digit" placeholder="0.00" placeholder-style="color:#E90000;" value="{{form.transfers[index].expenditureAmount}}" data-formname="form.transfers[{{index}}].expenditureAmount" data-index="{{index}}" input-align="right"  bindinput="onChangeMoneyOut"/></view>

          <van-cell-group border="{{ false }}">
            <van-cell title="{{item.remark}}" border="{{ false }}">
              <view slot="icon" style="width: 15%;">事由：</view>
            </van-cell>
            <van-cell title="{{item.payer}}" border="{{ false }}" center>
              <view slot="icon" style="width: 15%;"><image src="/image/apply/icon_fu.png" style="width: 20px;height: 20px;"></image></view>
            </van-cell>
            
            <van-cell title="{{item.payeeList[0].payee}}" wx:if="{{form.transfers[index].payeeList.length < 2}}" center border="{{ false }}">
              <view slot="icon" style="width: 15%;"><image src="/image/apply/icon_shou.png" style="width: 20px;height: 20px;"></image></view>
            </van-cell>
            <van-cell title="共{{form.transfers[index].payeeList.length}}条" wx:if="{{form.transfers[index].payeeList.length > 1}}" center border="{{ false }}">
              <view slot="icon" style="width: 15%;"><image src="/image/apply/icon_shou.png" style="width: 20px;height: 20px;"></image></view>
            </van-cell>
            <view class="btnBox">
              <image src="/image/apply/down.png" data-index="{{index}}" class="down" bindtap="disabledBlock"></image>
              <!-- <image src="/image/apply/icon_update.png" class="update" bindtap="goUpdate"></image> -->
              <image src="/image/apply/icon_delete.png" class="delete" data-index="{{index}}" data-id="{{item.id}}" bindtap="deleteTransfers"></image>
            </view>
          </van-cell-group>
        </view>
      </view>
      <view class="center">
        <text class="title">基础信息</text>
        <view class="main-box table-box">
          <!-- <van-field label="申请流水号" value="{{ form.approvalItemTemplate.telephone }}" placeholder="请输入申请流水号" border="{{ false }}" bind:change="onChange" input-align="right"/> -->
          
          <van-field readonly="{{form.transfers[index].amountReadonly}}" required label="支出金额" type="digit" type="digit" value="{{ form.transfers[index].expenditureAmount }}" placeholder="0.00" border="{{ false }}"  data-formname="form.transfers[{{index}}].expenditureAmount" data-index="{{index}}" input-align="right"  bind:input="onChangeMoney"/>

          <!-- <van-field required label="收入金额" value="{{ form.transfers[index].payeeList[childrenIndex].incomeAmount }}" placeholder="请输入收入金额" border="{{ false }}" bind:change="onChangeMoney" input-align="right" data-formname="form.transfers[{{index}}].payeeList[{{childrenIndex}}]" data-index="{{index}}" data-childrenIndex="{{childrenIndex}}"/> -->

          <van-field required label="支出原因" focus="{{form.transfers[index].remarkTirme}}" value="{{  form.transfers[index].remark }}" placeholder="请输入支出原因" border="{{ false }}" bind:change="onChange" input-align="right" data-formname="form.transfers[{{index}}].remark" data-value="form.transfers[{{index}}].remark"/>
          
          <van-popup show="{{form.transfers[index].showTransferType}}" round position="bottom"  bind:close="closeBox" data-name="form.transfers[{{index}}].showTransferType">
            <van-picker
              columns="{{transferTypeOptions}}"
              show-toolbar
              value-key="dictLabel"
              bind:cancel="closeBox"
              bind:confirm="onConfirmaTransfer"
              data-name="form.transfers[{{index}}].showTransferType"
              data-value="form.transfers[{{index}}]"
            />
          </van-popup>

          <van-field required label="支付方式" readonly value="{{ form.transfers[index].transferTypeText }}" placeholder="请选择支付方式" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="form.transfers[{{index}}].showTransferType"/>

          <van-popup show="{{form.transfers[index].showCapitalExpenditureType}}" round position="bottom"  bind:close="closeBox" data-name="form.transfers[{{index}}].showCapitalExpenditureType">
            <van-picker
              columns="{{capitalExpenditureTypeOptions}}"
              show-toolbar
              value-key="dictLabel"
              bind:cancel="closeBox"
              bind:confirm="onConfirmPick"
              data-name="form.transfers[{{index}}].showCapitalExpenditureType"
              data-value="form.transfers[{{index}}].capitalExpenditureType"
            />
          </van-popup>
          <van-field required label="支出类别" readonly value="{{ form.transfers[index].capitalExpenditureTypeText }}" placeholder="请选择支出类别" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="form.transfers[{{index}}].showCapitalExpenditureType"/>
        </view>
        <block wx:if="{{form.transfers[index].capitalExpenditureType == 2}}">
          <text class="title">关联项目</text>
          <view class="main-box table-box">
            <van-popup show="{{form.transfers[index].showProject}}" round position="bottom"  bind:close="closeBox" data-name="form.transfers[{{index}}].showProject">
              <van-picker
                columns="{{projectOptions}}"
                show-toolbar
                value-key="projectName"
                bind:cancel="closeBox"
                bind:confirm="onConfirmProject"
                data-name="form.transfers[{{index}}].showProject"
                data-value="form.transfers[{{index}}].projectForm"
              />
            </van-popup>
            <van-field label="项目名称" readonly value="{{ form.transfers[index].projectForm.projectName }}" placeholder="请输入项目名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link bindtap="openBox" data-name="form.transfers[{{index}}].showProject"/>
            <van-field label="承建单位" readonly value="{{ form.transfers[index].projectForm.projectContractor }}" placeholder="请输入承建单位" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field label="合同价款(元)" readonly value="{{ form.transfers[index].projectForm.projectAmount }}" placeholder="请输入合同价款（元）" border="{{ false }}" bind:change="onChange" input-align="right"/>

            <van-popup show="{{form.transfers[index].showProjectFundType}}" round position="bottom"  bind:close="closeBox" data-name="form.transfers[{{index}}].showProjectFundType">
              <van-picker
                columns="{{projectFundTypeOptions}}"
                show-toolbar
                value-key="dictLabel"
                bind:cancel="closeBox"
                bind:confirm="onConfirmPick"
                data-name="form.transfers[{{index}}].showProjectFundType"
                data-value="form.transfers[{{index}}].projectForm.projectFundType"
              />
            </van-popup>
            <van-field label="工程款类型" readonly value="{{ form.transfers[index].projectForm.projectFundTypeText }}" placeholder="请选择工程款类型" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="form.transfers[{{index}}].showProjectFundType"/>

            <van-field label="工程发票号" value="{{ form.transfers[index].projectForm.projectBillNum }}" placeholder="请输入工程发票号" border="{{ false }}" data-value="form.transfers[{{index}}].projectForm.projectBillNum" bind:change="onChange" input-align="right"/>
          </view>
        </block>

        <block wx:if="{{form.transfers[index].capitalExpenditureType == 4}}">
          <text class="title">关联合同</text>
          <view class="main-box table-box">
            <van-popup show="{{form.transfers[index].showContraction}}" round position="bottom"  bind:close="closeBox" data-name="form.transfers[{{index}}].showContraction">
              <van-picker
                columns="{{contractionOptions}}"
                show-toolbar
                value-key="name"
                bind:cancel="closeBox"
                bind:confirm="onConfirmContraction"
                data-name="form.transfers[{{index}}].showContraction"
                data-value="form.transfers[{{index}}].contractionForm"
              />
            </van-popup>
            <van-field label="合同名称" readonly value="{{ form.transfers[index].contractionForm.name }}" placeholder="请选择合同名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link bindtap="openBox" data-name="form.transfers[{{index}}].showContraction"/>
            <van-field label="合同编码" readonly value="{{ form.transfers[index].contractionForm.code }}" placeholder="请输入合同编码" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field label="合同价款(元)" readonly value="{{ form.transfers[index].contractionForm.totalAmount }}" placeholder="请输入合同价款（元）" border="{{ false }}" bind:change="onChange" input-align="right"/>
            
          </view>
        </block>


        <text class="title">付款方信息</text>
        <view class="main-box table-box">
          <!-- <van-popup show="{{form.transfers[index].showTransferType}}" round position="bottom"  bind:close="closeBox" data-name="form.transfers[{{index}}].showTransferType">
            <van-picker
              columns="{{transferTypeOptions}}"
              show-toolbar
              value-key="dictLabel"
              bind:cancel="closeBox"
              bind:confirm="onConfirmaTransfer"
              data-name="form.transfers[{{index}}].showTransferType"
              data-value="form.transfers[{{index}}]"
            />
          </van-popup>
          <van-field required label="付款方式" readonly value="{{ form.transfers[index].transferTypeText }}" placeholder="请输入付款方式" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="form.transfers[{{index}}].showTransferType"/> -->

          <van-popup show="{{form.transfers[index].showAccount}}" round position="bottom"  bind:close="closeBox" data-name="form.transfers[{{index}}].showAccount">
            <van-picker
              columns="{{accountOptions}}"
              show-toolbar
              value-key="accountName"
              bind:cancel="closeBox"
              bind:confirm="onConfirmAccount"
              data-name="form.transfers[{{index}}].showAccount"
              data-value="form.transfers[{{index}}]"
            />
          </van-popup>
          <van-field required wx:if="{{form.transfers[index].transferType != 12}}" readonly value="{{ form.transfers[index].payer }}" placeholder="请选择付款方名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="form.transfers[{{index}}].showAccount">
            <view slot="label" style="color: var(--field-label-color,#646566);">
              付款方<van-tag plain type="danger" color="#5CAE77" round style="margin-left:10px;">选择</van-tag>
            </view>
          </van-field>

          <van-field readonly wx:if="{{form.transfers[index].transferType == 11}}" label="可用余额(元)" value="{{ form.transfers[index].payerAccount }}" placeholder="可用余额" border="{{ false }}" data-value="form.transfers[{{index}}].payerAccount" bind:change="onChange" input-align="right"/>
          <block wx:elif="{{form.transfers[index].transferType == 12}}">
            <van-popup show="{{form.transfers[index].showMoneyOrder}}" round position="bottom"  bind:close="closeBox" data-name="showMoneyOrder">
              <van-picker
                columns="{{moneyOrderOptions}}"
                show-toolbar
                value-key="billPayUnit"
                bind:cancel="closeBox"
                bind:confirm="onConfirmMoneyOrder"
                data-name="form.transfers[{{index}}].showMoneyOrder"
                data-value="form.transfers[{{index}}]"
                data-index="{{index}}"
              />
            </van-popup>
            <van-field readonly label="出票方" value="{{form.transfers[index].moneyOrderForm.billPayUnit }}" placeholder="请选择出票方" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="form.transfers[{{index}}].showMoneyOrder"/>

            <van-field readonly label="汇票号码" value="{{ form.transfers[index].moneyOrderForm.orderNum }}" placeholder="汇票号码" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field readonly label="出票金额(元)" value="{{ form.transfers[index].moneyOrderForm.orderAmount }}" placeholder="出票金额(元)" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field readonly label="汇票类型" value="{{ form.transfers[index].moneyOrderForm.orderType }}" placeholder="汇票类型" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field readonly label="开票日" value="{{ form.transfers[index].moneyOrderForm.startTime }}" placeholder="开票日" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field readonly label="到期日" value="{{ form.transfers[index].moneyOrderForm.endTime }}" placeholder="到期日" border="{{ false }}" bind:change="onChange" input-align="right"/>
          </block>
          <block wx:else>
            <van-field required readonly label="付款账号" value="{{ form.transfers[index].payerAccount }}" placeholder="请输入付款方账号" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field required readonly label="所属银行" value="{{ form.transfers[index].bankTypeText }}" placeholder="请输入所属银行" border="{{ false }}" bind:change="onChange" input-align="right"/>
            <van-field readonly label="可用余额(元)" value="{{ form.transfers[index].balance }}" placeholder="可用余额" border="{{ false }}" input-align="right"/>
          </block>

        </view>

        <view class="payee_box">
          <text class="title">收款方信息</text>
          <view data-index="{{index}}" data-payer="{{form.transfers[index].payer}}" data-isPeers="{{ form.transfers[index].isPeers }}" data-bankType="{{ form.transfers[index].bankType }}" data-expenditureAmount="{{form.transfers[index].expenditureAmount}}" data-accountType="{{ form.transfers[index].bankAccountType }}" data-totalAmount="{{form.approvalItemTemplate.totalAmount}}" bindtap="uploadFile">
            <image src="/image/apply/icon_exel.png" style="width: 15px;height: 15px;"></image>
            <text>批量上传</text>
          </view>
        </view>
        <view class="center-box">
          <block wx:if="{{form.transfers[index].transferType == 12}}">
            <view class="main-box table-box" wx:for="{{form.transfers[index].payeeList}}" wx:for-index="childrenIndex" wx:key="payeeId">
              <van-field required value="{{ form.transfers[index].payeeList[childrenIndex].payee }}" placeholder="请输入收款方" border="{{ false }}" bind:change="onChange" input-align="right" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].payee">
              <view slot="label">
                收票方<van-tag plain type="danger" color="#5CAE77" round style="margin-left:10px;">输入</van-tag>
              </view>
              </van-field>
              <van-field required  label=" 联系方式" value="{{ form.transfers[index].payeeList[childrenIndex].phone }}" placeholder="请输入联系方式" border="{{ false }}" bind:change="onChange" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].phone" input-align="right"/>
              <van-field required  label="所属单位" value="{{ form.transfers[index].payeeList[childrenIndex].unit }}" placeholder="请输入所属单位" border="{{ false }}" bind:change="onChange" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].unit" input-align="right"/>
              <van-field required  label="负责人全称" value="{{ form.transfers[index].payeeList[childrenIndex].leader }}" placeholder="请输入负责人全称" border="{{ false }}" bind:change="onChange" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].leader" input-align="right"/>
              <van-field required  label="资金用途" value="{{ form.transfers[index].payeeList[childrenIndex].remark }}" placeholder="请输入资金用途" border="{{ false }}" bind:change="onChange" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].remark" input-align="right"/>
            </view>
          </block>
          <block wx:elif="{{form.transfers[index].transferType == 11}}">
            <view class="main-box table-box" wx:for="{{form.transfers[index].payeeList}}" wx:for-index="childrenIndex" wx:key="payeeId">
              <van-field required value="{{ form.transfers[index].payeeList[childrenIndex].payee }}" placeholder="请输入收款方" border="{{ false }}" bind:change="onChange" input-align="right" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].payee">
              <view slot="label">
                收款方<van-tag plain type="danger" color="#5CAE77" round style="margin-left:10px;">输入</van-tag>
              </view>
              </van-field>
              <van-field required  label=" 联系方式" value="{{ form.transfers[index].payeeList[childrenIndex].phone }}" placeholder="请输入联系方式" border="{{ false }}" bind:change="onChange" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].phone" input-align="right"/>
              <!-- <van-field required  label="申请使用金额" value="{{ form.transfers[index].payeeList[childrenIndex].incomeAmount }}" placeholder="请输入申请使用金额" border="{{ false }}" bind:change="onChange" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].incomeAmount" input-align="right"/> -->
              <van-field required  label="资金用途" value="{{ form.transfers[index].payeeList[childrenIndex].remark }}" placeholder="请输入资金用途" border="{{ false }}" bind:change="onChange" data-value="form.transfers[{{index}}].payeeList[{{childrenIndex}}].remark" input-align="right"/>
            </view>
          </block>
          <block wx:else>

            <view class="main-box table-box" wx:for="{{form.transfers[index].payeeList}}" wx:if="{{form.transfers[index].payeeList.length < 2}}" wx:for-index="childrenIndex" wx:key="payeeId">
              <van-field required readonly value="{{ form.transfers[index].payeeList[childrenIndex].payee }}" placeholder="请选择收款方" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="goPayeeList" data-payer="{{form.transfers[index].payer}}" data-index="{{index}}" data-isPeers="{{ form.transfers[index].isPeers }}" data-bankType="{{ form.transfers[index].bankType }}" data-accountType="{{ form.transfers[index].bankAccountType }}" data-transferType="{{ form.transfers[index].transferType }}">
                <view slot="label" style="color: var(--field-label-color,#646566);">
                  收款方<van-tag plain type="danger" color="#5CAE77" round style="margin-left:10px;">选择</van-tag>
                </view>
              </van-field>
              <van-field required readonly label="收款账号" value="{{ form.transfers[index].payeeList[childrenIndex].payeeAccount }}" placeholder="请输入收款账户" border="{{ false }}" bind:change="onChange" input-align="right"/>
              <van-field required readonly label="开户银行" value="{{ form.transfers[index].payeeList[childrenIndex].bankDeposit }}" placeholder="请输入开户银行" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down"/>
            </view>

            <view class="main-box table-box payeeList" wx:if="{{form.transfers[index].payeeList.length > 1}}">

              <van-collapse accordion value="{{ form.transfers[index].activeName }}" data-index="{{index}}" bind:change="onChangePayee" bind:close="onClosePayee">
                <van-collapse-item name="{{childrenIndex}}" wx:for="{{form.transfers[index].payeeList}}" wx:if="{{childrenIndex<10}}" wx:for-index="childrenIndex" wx:key="payeeId">

                  <view slot="title">
                    {{ form.transfers[index].payeeList[childrenIndex].payee }}<van-tag wx:if="{{ form.transfers[index].activeName == childrenIndex && form.transfers[index].activeName != '' }}" plain type="danger" color="#5CAE77" round style="margin-left:10px;">收款方</van-tag>
                  </view>
                  <view slot="value" wx:if="{{ form.transfers[index].activeName != childrenIndex }}">
                    ￥{{ form.transfers[index].payeeList[childrenIndex].incomeAmount }}
                  </view>
                  
                  <van-field required readonly label="收款账号" value="{{ form.transfers[index].payeeList[childrenIndex].payeeAccount }}"  border="{{ false }}"  input-align="right"/>
                  <van-field required readonly label="开户银行" value="{{ form.transfers[index].payeeList[childrenIndex].bankDeposit }}" border="{{ false }}"  input-align="right"/>
                  <van-field required readonly label="收入金额" value="{{ form.transfers[index].payeeList[childrenIndex].incomeAmount }}" border="{{ false }}"  input-align="right"/>
                  <van-field required readonly label="所属银行" value="{{ form.transfers[index].payeeList[childrenIndex].bankTypeText }}" border="{{ false }}" input-align="right"/>
                  <!-- <van-field required readonly label="转账状态" value="{{ form.transfers[index].payeeList[childrenIndex].transferStatusText }}" border="{{ false }}" input-align="right"/>
                  <van-field required readonly label="交易结果描述" value="{{ form.transfers[index].payeeList[childrenIndex].causeFailure }}" border="{{ false }}" input-align="right"/> -->
                  
                </van-collapse-item>
              </van-collapse>
              <text wx:if="{{form.transfers[index].payeeList.length>10}}" style="text-align: center;color: #2C8E68;padding-top: 10px;" data-option="{{form.transfers[index].payeeList}}" bindtap="goPayee">查看更多</text>
<!-- 

              <van-field required readonly label="{{ form.transfers[index].payeeList[childrenIndex].payee }}" value="￥{{ form.transfers[index].payeeList[childrenIndex].incomeAmount }}" wx:for="{{form.transfers[index].payeeList}}"  wx:for-index="childrenIndex" wx:key="payeeId" is-link placeholder="请输入收款方" border="{{ false }}" bind:change="onChange" input-align="right" input-class="aaa" /> -->
            </view>


          </block>  
        </view>

        <view class="main-box">
          <van-cell>
            <!-- <view slot="icon">
              <van-icon class-prefix="my-icon" name="extra" />
            </view> -->
            <view slot="title">
              <view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view>
            </view>
            <view>
              <view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> {{form.transfers[index].fileNum?form.transfers[index].fileNum:0}}张 </van-tag></view>
            </view>
          </van-cell>
          <view class="fj-box">
            <view class="fj-li">
              <view>
                <text>收\n据</text>
              </view>
              <view class="img_box">
                <view class="img_list" wx:for="{{form.transfers[index].SJimage}}" wx:for-index="childrenIndex" wx:key="id">
                  <image class="img_li" src="{{item.tempFilePath}}" data-option="{{form.transfers[index].SJimage}}" data-index="{{childrenIndex}}" bindtap="openPreview"></image>
                  <van-icon name="/image/apply/img_delete.png" size="20px" data-index="{{childrenIndex}}" data-parentsIndex="{{index}}" data-name="form.transfers[{{index}}].SJimage" data-options="{{form.transfers[index].SJimage}}" data-id="{{item.id}}" bindtap="deleteimg" />
                </view>
                <view class="img_list">
                  <image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="SJtakephoto"></image>
                </view>
              </view>
            </view>
            <view class="fj-li">
              <view>
                <text>发\n票</text>
              </view>
              <view class="img_box">

                <view class="img_list" wx:for="{{form.transfers[index].FPimage}}" wx:for-index="childrenIndex" wx:key="id">
                  <image class="img_li" src="{{item.tempFilePath}}" data-option="{{form.transfers[index].FPimage}}" data-index="{{childrenIndex}}" bindtap="openPreview"></image>
                  <van-icon name="/image/apply/img_delete.png" size="20px" data-index="{{childrenIndex}}" data-parentsIndex="{{index}}" data-name="form.transfers[{{index}}].FPimage" data-options="{{form.transfers[index].FPimage}}" data-id="{{item.id}}" bindtap="deleteimg" />
                </view>
                <view class="img_list">
                  <image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="FPtakephoto"></image>
                </view>
              </view>
            </view>
            <view class="fj-li">
              <view>
                <text>其\n他</text>
              </view>
              <view class="img_box">
                <view class="img_list" wx:for="{{form.transfers[index].QTimage}}" wx:for-index="childrenIndex" wx:key="id">
                  <image class="img_li" src="{{item.tempFilePath}}" data-option="{{form.transfers[index].QTimage}}" data-index="{{childrenIndex}}" bindtap="openPreview" ></image>
                  <van-icon name="/image/apply/img_delete.png" size="20px" data-index="{{childrenIndex}}" data-parentsIndex="{{index}}" data-name="form.transfers[{{index}}].QTimage" data-options="{{form.transfers[index].QTimage}}" data-id="{{item.id}}" bindtap="deleteimg" />
                </view>
                <view class="img_list">
                  <image class="img_li img_add" src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="QTtakephoto"></image>
                </view>
              </view>
            </view>
          </view>
        </view>

        <!-- <view class="main-box steps-box">
          <view class="steps-tit">审批流程</view>
          <van-row wx:for="{{steps}}" wx:key="index">
            <van-col span="3">
              <view class="index">{{index+1}}</view>
              <block wx:if="{{index==0}}">
                <view class="indexBorder">
                  <view class="ssT" wx:if="{{index>0}}"></view>
                  <view class="yq"></view>
                  <view class="ss" wx:if="{{steps.length != index+1}}"></view>
                </view>
              </block>
              <block wx:else>
                <view class="indexBorder indexCenter">
                  <view class="ssT" wx:if="{{index>0}}"></view>
                  <view class="yq"></view>
                  <view class="ss" wx:if="{{steps.length != index+1}}"></view>
                </view>
              </block>
            </van-col>
            <van-col span="21">
              <van-cell title="{{item.activityName}}" center="{{true}}" border="{{false}}">
                <view class="agree" wx:if="{{item.type=='1'}}">{{ item.assigneeName }}</view>
                <view class="in" wx:if="{{item.type=='2'}}">{{ item.assigneeName }}</view>
                <view class="disagree" wx:if="{{item.type=='3'}}">{{ item.assigneeName }}</view>
              </van-cell>

              <van-cell center border="{{false}}">
                <view slot="title">
                  <view style="color: #999999;">{{ item.durationInMillis }}</view>
                </view>
                <view style="color: #999999;font-size: 12px;">{{ item.endTime }}</view>
              </van-cell>
            </van-col>
          </van-row>
        </view> -->
      </view>
    </van-collapse-item>
  </van-collapse>

   <!--  <block wx:for="{{form.transfers}}" wx:key="index">
<view class="main-title">事项{{form.transfers[index].num}}<image src="/image/apply/delete.png" style="width: 25px;height: 25px;position: absolute;right: 4%;top: 7px;" data-index="{{index}}" bindtap="deleteTransfers"></image></view>
  <view class="center">
    <text class="title">基础信息</text>
    <view class="main-box table-box">
      
      <van-field required label="申请时间" readonly is-link value="{{ form.transfers[index].applyDate }}" placeholder="请选择申请时间" border="{{ false }}" bind:change="onChange" input-align="right" bindtap="openBox" data-name="showApplyDate" />
      <van-calendar show="{{ showApplyDate }}" bind:close="closeBox"  data-name="showApplyDate" bind:confirm="onConfirm" data-value="form.transfers[{{index}}].applyDate" show-confirm="{{ false }}" />

      <van-field readonly label="合计支出" value="{{ form.transfers[index].expenditureAmount }}" placeholder="(自动计算)" border="{{ false }}"  data-formname="form.transfers[{{index}}].expenditureAmount" input-align="right"/>
      <van-field required label="支出原因" value="{{  form.transfers[index].remark }}" placeholder="请输入支出原因" border="{{ false }}" bind:change="onChange" input-align="right" data-formname="form.transfers[{{index}}].remark" data-value="form.transfers[{{index}}].remark"/>
      <van-popup show="{{showCapitalExpenditureType}}" round position="bottom"  bind:close="closeBox" data-name="showCapitalExpenditureType">
        <van-picker
          columns="{{capitalExpenditureTypeOptions}}"
          show-toolbar
          value-key="dictLabel"
          bind:cancel="closeBox"
          bind:confirm="onConfirmPick"
          data-name="showCapitalExpenditureType"
          data-value="form.transfers[{{index}}].capitalExpenditureType"
        />
      </van-popup>
      <van-field required label="资金支出类别" readonly value="{{ form.transfers[index].capitalExpenditureTypeText }}" placeholder="请选择资金支出类别" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="showCapitalExpenditureType"/>
    </view>
    <block wx:if="{{form.transfers[index].capitalExpenditureType == 2}}">
      <text class="title">关联项目</text>
      <view class="main-box table-box">
        <van-popup show="{{showProject}}" round position="bottom"  bind:close="closeBox" data-name="showProject">
          <van-picker
            columns="{{projectOptions}}"
            show-toolbar
            value-key="projectName"
            bind:cancel="closeBox"
            bind:confirm="onConfirmProject"
            data-name="showProject"
            data-value="form.transfers[{{index}}].projectForm"
          />
        </van-popup>
        <van-field label="项目名称" readonly value="{{ form.transfers[index].projectForm.projectName }}" placeholder="请输入项目名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link bindtap="openBox" data-name="showProject"/>
        <van-field label="承建单位" readonly value="{{ form.transfers[index].projectForm.projectContractor }}" placeholder="请输入承建单位" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field label="合同价款(元)" readonly value="{{ form.transfers[index].projectForm.projectAmount }}" placeholder="请输入合同价款（元）" border="{{ false }}" bind:change="onChange" input-align="right"/>

        <van-popup show="{{showProjectFundType}}" round position="bottom"  bind:close="closeBox" data-name="showProjectFundType">
          <van-picker
            columns="{{projectFundTypeOptions}}"
            show-toolbar
            value-key="dictLabel"
            bind:cancel="closeBox"
            bind:confirm="onConfirmPick"
            data-name="showProjectFundType"
            data-value="form.transfers[{{index}}].projectForm.projectFundType"
          />
        </van-popup>
        <van-field label="工程款类型" readonly value="{{ form.transfers[index].projectForm.projectFundTypeText }}" placeholder="请选择工程款类型" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="showProjectFundType"/>

        <van-field label="工程发票号" value="{{ form.transfers[index].projectForm.projectBillNum }}" placeholder="请输入工程发票号" border="{{ false }}" data-value="form.transfers[{{index}}].projectForm.projectBillNum" bind:change="onChange" input-align="right"/>
      </view>
    </block>

    <block wx:if="{{form.transfers[index].capitalExpenditureType == 4}}">
      <text class="title">关联合同</text>
      <view class="main-box table-box">
        <van-popup show="{{showContraction}}" round position="bottom"  bind:close="closeBox" data-name="showContraction">
          <van-picker
            columns="{{contractionOptions}}"
            show-toolbar
            value-key="name"
            bind:cancel="closeBox"
            bind:confirm="onConfirmContraction"
            data-name="showContraction"
            data-value="contractionForm.name"
          />
        </van-popup>
        <van-field label="合同名称" readonly value="{{ contractionForm.name }}" placeholder="请选择合同名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link bindtap="openBox" data-name="showContraction"/>
        <van-field label="合同编码" value="{{ contractionForm.code }}" placeholder="请输入合同编码" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field label="合同价款(元)" readonly value="{{ contractionForm.totalAmount }}" placeholder="请输入合同价款（元）" border="{{ false }}" bind:change="onChange" input-align="right"/>
        
      </view>
    </block>


    <text class="title">付款方信息</text>
    <view class="main-box table-box">
      <van-popup show="{{showTransferType}}" round position="bottom"  bind:close="closeBox" data-name="showTransferType">
        <van-picker
          columns="{{transferTypeOptions}}"
          show-toolbar
          value-key="dictLabel"
          bind:cancel="closeBox"
          bind:confirm="onConfirmaTransfer"
          data-name="showTransferType"
          data-value="form.transfers[{{index}}]"
        />
      </van-popup>
      <van-field required label="付款方式" readonly value="{{ form.transfers[index].transferTypeText }}" placeholder="请输入付款方式" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="showTransferType"/>

      <van-popup show="{{showAccount}}" round position="bottom"  bind:close="closeBox" data-name="showAccount">
        <van-picker
          columns="{{accountOptions}}"
          show-toolbar
          value-key="accountName"
          bind:cancel="closeBox"
          bind:confirm="onConfirmAccount"
          data-name="showAccount"
          data-value="form.transfers[{{index}}]"
        />
      </van-popup>
      <van-field required wx:if="{{form.transfers[index].transferType != 12}}" readonly value="{{ form.transfers[index].payer }}" placeholder="请选择付款方名称" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="showAccount">
        <view slot="label">
          付款方<van-tag plain type="danger" color="red" round style="margin-left:10px;">必填</van-tag>
        </view>
      </van-field>

      <van-field readonly wx:if="{{form.transfers[index].transferType == 11}}" label="可用余额(元)" value="{{ balance }}" placeholder="可用余额" border="{{ false }}" bind:change="onChange" input-align="right"/>
      <block wx:elif="{{form.transfers[index].transferType == 12}}">
        <van-popup show="{{showAccount}}" round position="bottom"  bind:close="closeBox" data-name="showMoneyorder">
          <van-picker
            columns="{{moneyorderOptions}}"
            show-toolbar
            value-key="accountName"
            bind:cancel="closeBox"
            bind:confirm="onConfirmMoneyorder"
            data-name="showMoneyorder"
            data-value="form.transfers[{{index}}]"
          />
        </van-popup>
        <van-field readonly label="出票方" value="{{ form.transfers[index].payerAccount }}" placeholder="请选择出票方" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="openBox" data-name="showMoneyorder"/>

        <van-field readonly label="汇票号码" value="{{ form.transfers[index].bankTypeText }}" placeholder="汇票号码" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field readonly label="出票金额(元)" value="{{ form.transfers[index].bankTypeText }}" placeholder="出票金额(元)" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field readonly label="汇票类型" value="{{ form.transfers[index].bankTypeText }}" placeholder="汇票类型" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field readonly label="开票日" value="{{ form.transfers[index].bankTypeText }}" placeholder="开票日" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field readonly label="到期日" value="{{ form.transfers[index].bankTypeText }}" placeholder="到期日" border="{{ false }}" bind:change="onChange" input-align="right"/>
      </block>
      <block wx:else>
        <van-field required readonly label="付款方账号" value="{{ form.transfers[index].payerAccount }}" placeholder="请输入付款方账号" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field required readonly label="所属银行" value="{{ form.transfers[index].bankTypeText }}" placeholder="请输入所属银行" border="{{ false }}" bind:change="onChange" input-align="right"/>
      </block>

    </view>
    <text class="title">收款方信息</text>
    <view class="center-box">
      <view class="main-box table-box" wx:if="{{form.transfers[index].bankType == 1 && form.transfers[index].transferType != 10 && form.transfers[index].transferType != 11 && form.transfers[index].transferType != 12}}">
        <van-cell title="收款账户类型" center border="{{false}}">
          <view style="float: right;">
            <van-radio-group
              value="{{ form.transfers[index].bankAccountType }}"
              bind:change="onChange"
              direction="horizontal"
              data-value="form.transfers[{{index}}].bankAccountType"
            >
              <van-radio name="1" checked-color="#2C8E68">公户</van-radio>
              <van-radio name="2" checked-color="#2C8E68">私户</van-radio>
            </van-radio-group>
          </view>
        </van-cell>
      </view>
      <view class="main-box table-box" wx:if="{{(form.transfers[index].bankType == 2 || form.transfers[index].bankType == 3 || form.transfers[index].bankType == 4) && (form.transfers[index].transferType != 10 && form.transfers[index].transferType != 11 && form.transfers[index].transferType != 12)}}">
        <van-cell title="是否同行" center border="{{false}}">
          <view style="float: right;">
            <van-radio-group
              value="{{ form.transfers[index].isPeers }}"
              bind:change="onChange"
              direction="horizontal"
              data-value="form.transfers[{{index}}].isPeers"
            >
              <van-radio name="Y" checked-color="#2C8E68">是</van-radio>
              <van-radio name="N" checked-color="#2C8E68">否</van-radio>
            </van-radio-group>
          </view>
        </van-cell>
      </view>

      <view class="main-box table-box" wx:for="{{form.transfers[index].payeeList}}" wx:for-index="childrenIndex" wx:key="payeeId">
        <van-field required readonly value="{{ form.transfers[index].payeeList[childrenIndex].payee }}" placeholder="请输入姓名" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down" bindtap="goPayeeList" data-payer="{{form.transfers[index].payer}}" data-index="{{index}}" data-isPeers="{{ form.transfers[index].isPeers }}" data-bankType="{{ form.transfers[index].bankType }}" data-accountType="{{ form.transfers[index].bankAccountType }}" data-transferType="{{ form.transfers[index].transferType }}">
          <view slot="label">
            姓名<van-tag plain type="danger" color="#5CAE77" round style="margin-left:10px;">收款方</van-tag>
          </view>
        </van-field>
        <van-field required readonly label="收款账户" value="{{ form.transfers[index].payeeList[childrenIndex].payeeAccount }}" placeholder="请输入收款账户" border="{{ false }}" bind:change="onChange" input-align="right"/>
        <van-field required readonly label="开户银行" value="{{ form.transfers[index].payeeList[childrenIndex].bankDeposit }}" placeholder="请输入开户银行" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down"/>
        <van-field required label="收入金额" value="{{ form.transfers[index].payeeList[childrenIndex].incomeAmount }}" placeholder="请输入收入金额" border="{{ false }}" bind:change="onChangeMoney" input-align="right" data-formname="form.transfers[{{index}}].payeeList[{{childrenIndex}}]" data-index="{{index}}" data-childrenIndex="{{childrenIndex}}"/>

        <van-field required readonly label="所属银行" value="{{ form.transfers[index].payeeList[childrenIndex].bankTypeText }}" placeholder="请输入所属银行" border="{{ false }}" bind:change="onChange" input-align="right" is-link arrow-direction	="down"/>
      </view>
    </view>

    <view class="main-box">
      <van-cell>
        <view slot="title">
          <view class="van-cell-text">附件<van-tag type="danger" style="margin-left: 10px;">可拍照</van-tag></view>
        </view>
        <view>
          <view class="van-cell-text">总数<van-tag round color="#5CAE77" plain style="margin-left: 10px;"> {{form.transfers[index].fileNum?form.transfers[index].fileNum:0}}张 </van-tag></view>
        </view>
      </van-cell>
      <view class="fj-box">
        <view class="fj-li">
          <view>
            <text>收\n据</text>
          </view>
          <view class="img_box">
            <image wx:for="{{form.transfers[index].SJimage}}" src="{{item.tempFilePath}}" wx:key="index" data-option="{{form.transfers[index].SJimage}}" data-index="{{index}}" bindtap="openPreview"></image>
            <image src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="SJtakephoto"></image>
          </view>
        </view>
        <view class="fj-li">
          <view>
            <text>发\n票</text>
          </view>
          <view class="img_box">
            <image wx:for="{{form.transfers[index].FPimage}}" src="{{item.tempFilePath}}" data-option="{{form.transfers[index].FPimage}}" data-index="{{index}}" bindtap="openPreview" wx:key="index"></image>
            <image src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="FPtakephoto"></image>
          </view>
        </view>
        <view class="fj-li">
          <view>
            <text>其\n他</text>
          </view>
          <view class="img_box">
            <image wx:for="{{form.transfers[index].QTimage}}" src="{{item.tempFilePath}}" data-option="{{form.transfers[index].QTimage}}" data-index="{{index}}" bindtap="openPreview" wx:key="index"></image>
            <image src="/image/apply/fj_upload.png" data-index="{{index}}" bindtap="QTtakephoto"></image>
          </view>
        </view>
      </view>
    </view>
  </view>
</block> -->

<block wx:if="{{!isUpdate}}">
  <view class="bottomBtn">
    <!-- <view bindtap="goSubmitMB">
      <image src="/image/apply/icon_pres.png"></image>
      <text>保存模板</text>  
    </view> -->
    <view bindtap="addList">
      <image src="/image/apply/icon_add.png"></image>
      <text>新增事项</text>  
    </view>
  </view>

  <view class="bottom">
    <!-- <view class="btn1" data-type="3" bindtap="goSubmit">提交复核</view> -->
    <view class="btn1" bindtap="back">上一步</view>
    <view class="btn2" data-type="0" bindtap="goSubmit" hover-class="btnView">下一步</view>
  </view>
</block>
<block wx:if="{{isUpdate}}">
  <view class="bottom">
    <view class="btn3" data-type="2" bindtap="goKeep">保存</view>
  </view>
</block>
<view class="ipXbtn"></view>
<van-dialog
  use-slot
  title="支付模板"
  show="{{ showDialog }}"
  bind:close="onClose"
  theme='round-button'
  confirmButtonText="保存"
  data-type="1"
  bind:confirm="goSubmit"
  closeOnClickOverlay="{{ true }}"
>
  <input class="input_tit" placeholder="请输入模板名称" style="width: 90%;margin: 0 auto;margin-top: 15px;margin-bottom: 10px;text-align: center;" value="{{form.approvalItemTemplate.templateName}}" bindinput="bindNameInput"/> 
</van-dialog>