<template>
  <a-drawer
    width="45%"
    :title="formTitle"
    :label-col="4"
    :wrapper-col="14"
    :visible="open"
    :body-style="{height:'calc(100vh - 100px)',overflow:'auto'}"
    @close="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
      <a-row :gutter="32">
        <a-col :span="12">
          <a-form-model-item label="运单号" prop="waybillNo">
            <a-input v-model="form.waybillNo" placeholder="请输入运单号"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="运单来源" prop="dataSource">
            <a-input v-model="form.dataSource" placeholder="请输入运单来源"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="航班号" prop="flightNo">
            <a-input v-model="form.flightNo" placeholder="请输入航班号"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="航班类型" prop="flightType">
            <a-input v-model="form.flightType" placeholder="请输入航班类型"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="航班日期" prop="flightDate">
            <a-date-picker
              v-model="form.flightDate"
              valueFormat="YYYY-MM-DD"
              :show-today="true"
              placeholder="选择日期"
            />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="销售代理人名称" prop="organization">
            <a-input v-model="form.organization" placeholder="请输入销售代理人名称"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="交货或发货代理人编码" prop="agentCode">
            <a-input v-model="form.agentCode" placeholder="请输入交货或发货代理人编码"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="品名" prop="goodsName">
            <a-input v-model="form.goodsName" placeholder="请输入品名"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="货物性质" prop="goodsType">
            <a-input v-model="form.goodsType" placeholder="请输入货物性质"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="特货代码" prop="specialGoodsCode">
            <a-input v-model="form.specialGoodsCode" placeholder="请输入特货代码"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="差异化备案产品序号" prop="diffProductSn">
            <a-input v-model="form.diffProductSn" placeholder="请输入差异化备案产品序号"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="报检员" prop="shipper">
            <a-input v-model="form.shipper" placeholder="请输入报检员"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="始发站机场三字码" prop="origin">
            <a-input v-model="form.origin" placeholder="请输入始发站机场三字码"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="目的站机场三字码" prop="destination">
            <a-input v-model="form.destination" placeholder="请输入目的站机场三字码"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="承运人代码" prop="carrierCode">
            <a-input v-model="form.carrierCode" placeholder="请输入承运人代码"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="重点航班标识 Y 是 N 不是" prop="isImportantFlights">
            <a-input v-model="form.isImportantFlights" placeholder="请输入重点航班标识 Y 是 N 不是"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="代理人信用等级 A\B\C\D" prop="agentLevel">
            <a-input v-model="form.agentLevel" placeholder="请输入代理人信用等级 A\B\C\D"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="货物风险等级分类 高风险\低风险\普通" prop="riskClassification">
            <a-input v-model="form.riskClassification" placeholder="请输入货物风险等级分类 高风险\低风险\普通"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="综合风险等级评估 低风险\优先\普通\高风险\严控" prop="riskRating">
            <a-input v-model="form.riskRating" placeholder="请输入综合风险等级评估 低风险\优先\普通\高风险\严控"/>
          </a-form-model-item>
        </a-col>
        <a-col :span="12" >
          <a-form-model-item label="是否已处理 0 未处理 1 已处理" prop="status">
            <a-radio-group v-model="form.status" button-style="solid">
              <a-radio-button
                v-for="(dict, index) in statusOptions"
                :key="index"
                :value="dict.dictValue"
              >
                {{ dict.dictLabel }}
              </a-radio-button>
            </a-radio-group>
          </a-form-model-item>
        </a-col>
      </a-row>
      </a-spin>
       <div class="bottom-control">
              <a-space>
              <a-button @click="cancel">
                  取消
              </a-button>
              <a-button type="primary" @click="submitForm">
                  保存
              </a-button>
              </a-space>
       </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import WaybillEditForm from './WaybillForm'
export default {
  ...WaybillEditForm
}
</script>
