<!--pages/billUse/flowAdd/flowAdd.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="main-box table-box" style="margin-top:{{isIPX?'100px':'75px'}};">

  <view class="headTit"><text>结算票据</text></view>

  <view  class="flex-block">
    <text class="rules">票据编号</text>
    <view bindtap="onpjbhShow" class="wrap">
      <text wx:if="{{!formData.billNum}}" class="color-gray">请选择票据编号</text>
      <text wx:else>{{formData.billNum}}</text>
    </view>
  </view>
  <van-popup
    show="{{ pjbhShow }}"
    position="bottom"
    bind:close="onCancelcrlx"
  >
  <van-picker 
    columns="{{ pjbhOptions }}"
    value-key="billNum"
    bind:cancel="onCancelcrlx"
    show-toolbar="{{true}}"
    bind:confirm="bindPickerChange"/>
  </van-popup>

  <view class="flex-block">
    <text class="rules">开票日期</text>
    <view class="wrap" bindtap="onsrDate" >
      {{formData.billDate}}
    </view>
    <van-calendar
      show="{{ srShow }}"
      min-date="{{ minDate }}"
      max-date="{{ maxDate }}"
      bind:close="onClose"
      bind:confirm="onConfirm"
    />
  </view>

  <view class="payerBox" style="border: 1px dashed #DCDCDC;padding: 20px;">
    <view  class="flex-block">
      <text class="rules">收款方</text> 
      <input class="wrap" value="{{formData.payee}}" data-name="formData.payee" bindinput="inputChange" placeholder="请输入收款方"/>
    </view>
    <view  class="flex-block">
      <text class="rules">付款方</text> 
      <input class="wrap" value="{{formData.payer}}" data-name="formData.payer" bindinput="inputChange" placeholder="请输入付款方"/>
    </view>
    <view  class="flex-block">
      <text class="rules">结算事项</text> 
      <input class="wrap" value="{{formData.accountSummary}}" data-name="formData.accountSummary" bindinput="inputChange" placeholder="请输入结算事项"/>
    </view>
    <view  class="flex-block">
      <text>收支类型</text> 
      <van-radio-group
        value="{{ formData.incomeExpensesType }}"
        bind:change="onChange"
        direction="horizontal"
        data-value="formData.incomeExpensesType"
        style="padding: 10px 0;"
      >
        <van-radio name="1" checked-color="#2C8E68">收入</van-radio>
        <van-radio name="2" checked-color="#2C8E68">支出</van-radio>
      </van-radio-group>
    </view>
    <view  class="flex-block">
      <text>结算方式</text> 
      <view bindtap="onjsfsShow" class="wrap">
        <text wx:if="{{!formData.settleStyle}}" class="color-gray">请选择结算方式</text>
        <text wx:else>{{formData.settleStyleText}}</text>
      </view>
      <van-popup
        show="{{ jsfsShow }}"
        position="bottom"
        bind:close="onCanceljsfs"
      >
      <van-picker 
        columns="{{ jsfsOptions }}"
        value-key="dictLabel"
        bind:cancel="onCanceljsfs"
        show-toolbar="{{true}}"
        bind:confirm="bindPickerChangeJsfs"/>
      </van-popup>
    </view>
    <view  class="flex-block" wx:if="{{ formData.incomeExpensesType == 1 }}">
      <text>收入金额</text> 
      <input class="wrap" value="{{formData.jieAmount}}" data-name="formData.jieAmount" bindinput="inputChange" placeholder="请输入收入金额"/>
    </view>
    <view  class="flex-block" wx:if="{{ formData.incomeExpensesType == 2 }}">
      <text>支出金额</text> 
      <input class="wrap" value="{{formData.daiAmount}}" data-name="formData.daiAmount" bindinput="inputChange" placeholder="请输入支出金额"/>
    </view>
  </view>

  
  <view  class="flex-block" style="margin-top: 15px;">
    <text class="rules">出纳账户</text>
    <view bindtap="oncnzhShow" class="wrap">
      <text wx:if="{{!formData.accountName}}" class="color-gray">请选择出纳账户</text>
      <text wx:else>{{formData.accountName}}</text>
    </view>
  </view>
  <van-popup
    show="{{ cnzhShow }}"
    position="bottom"
    bind:close="onCancelcrcnzh"
  >
  <van-picker 
    columns="{{ accountList }}" 
    value-key="accountName"
    bind:cancel="onCancelcrcnzh"
    show-toolbar="{{true}}"
    bind:confirm="bindPickerChangeCnzh"/>
  </van-popup>
  <view  class="flex-block"><text>经办人</text> <input class="wrap" data-name="formData.preparedBy" bindinput="inputChange"  data-prop="formData.billNum" value="{{formData.preparedBy}}" placeholder="请输入经办人"/></view>
</view>

<view class="bottom">
  <view class="btn2" data-code="2" bindtap="swichAccounting">保存</view>
</view>