<!--pages/reservationLoadAppoint/edit.wxml-->
<view class="container" style="padding-bottom:100px;">
  <view class="height20"></view>
  <view>
    <form bindsubmit="formSubmit">
      <input name="id" value='{{info.id}}' hidden='true' />
      <view class="part">
        <van-field label="订单编号" wx:if="{{loadNumber}}" name="loadNumber" readonly value="{{ loadNumber }}" placeholder="自动填入" input-align="right">
          <input name="orderId" value='{{orderId}}' hidden='true' />
        </van-field>
        <van-field label="客户名称" wx:if="{{customerName}}" name="customerName" readonly value="{{ customerName }}" placeholder="自动填入" input-align="right">
        </van-field>
        <van-field label="货品信息" wx:if="{{goodsName}}" name="goodsName" readonly value="{{ goodsName?goodsName:''  + goodsModel?' / ' + goodsModel:'' }}" placeholder="自动填入" input-align="right">
        </van-field>
      </view>

      <view class="part">
        <!-- 装卸点位 -->
        <van-field label="装卸点位" required input-align="right" bindtap="hideKeybord">
          <view slot="input" style="width: 100%;">
            <input name="loadPointId" value='{{loadPointArray[loadPointIndex].loadPointId}}' hidden='true' />
            <picker bindchange="bindPickerChange" value="{{loadPointIndex}}" range="{{loadPointArray}}" range-key="loadPoint" data-pickername='loadPoint'>
              <view wx:if="{{loadPointArray[loadPointIndex].loadPoint}}"> {{loadPointArray[loadPointIndex].loadPoint}}</view>
              <view wx:else class="selectPlaceholder">{{defaultText}}</view>
            </picker>
          </view>
          <view slot="right-icon">
            <van-icon name="arrow" />
          </view>
        </van-field>

        <!-- 装卸时间 -->
        <van-field label="装卸时间" required input-align="right" bindtap="hideKeybord" wx:if="{{loadTimeArray.length>0}}" type="textarea" autosize>
          <view slot="input" style="width: 100%;">
            <input name="loadTimeId" value='{{loadTimeArray[loadTimeIndex].loadTimeId}}' hidden='true' />
            <picker bindchange="bindPickerChange" value="{{loadTimeIndex}}" range="{{loadTimeArray}}" range-key="time" data-pickername='loadTime'>
              <view wx:if="{{loadTimeArray[loadTimeIndex].time}}"> {{loadTimeArray[loadTimeIndex].time}}</view>
              <view wx:else class="selectPlaceholder">{{defaultText}}</view>
            </picker>
          </view>
          <view slot="right-icon">
            <van-icon name="arrow" />
          </view>
        </van-field>
        <van-field required wx:else label="装卸时间" name="deliveryTimeId" value="" readonly input-align="right" placeholder="请先选择装卸点位" placeholder-style="color:red;" />
      </view>
        
      <view class="part">
        <van-field required label="车牌号码" readonly border="{{false}}"></van-field>
        <car-num-input bind:setCarNum="licensePlate" isKeyboard="{{isKeyboard}}" inputOnFocusIndex="{{inputOnFocusIndex}}" inputPlates="{{inputPlates}}" isNewEnergy="{{isNewEnergy}}"></car-num-input>
        <input name="licenseNumber" value='{{licensePlate}}' hidden='true' />

        <van-field label="车辆轴数" required input-align="right">
          <view slot="input" style="width: 100%;">
            <input name="overId" value='{{excessConfigArray[excessConfigIndex].id}}' hidden='true' />
            <picker bindchange="bindPickerChange" value="{{excessConfigIndex}}" range="{{excessConfigArray}}" range-key="name" data-pickername='excessConfig'>
              <view wx:if="{{excessConfigArray[excessConfigIndex].name}}"> {{excessConfigArray[excessConfigIndex].name}}</view>
              <view wx:else class="selectPlaceholder">{{ defaultText }}</view>
            </picker>
          </view>
          <view slot="right-icon">
            <van-icon name="arrow" />
          </view>
        </van-field>

        <van-field label="司机姓名" required name="driverName" value="{{ info.driverName }}" placeholder="请填写司机姓名" input-align="right" ></van-field>
        <van-field label="司机电话" required name="driverMobile" value="{{ info.driverMobile }}" placeholder="请填写司机电话" input-align="right" ></van-field>
      </view>

      <view class="fixedBtn submitBtn">
        <van-button loading="{{isSubmitting}}" round block disabled="{{isSubmitting}}" loading-text="{{isSubmitting?'提交中...':''}}" type="info" form-type="submit">确定
        </van-button>
      </view>

    </form>
  </view>
</view>

<wxs module="filters" src="../../utils/filter.wxs"></wxs>