<template>
  <div>
    <el-form ref="subMaterialForm" :model="subMaterialObj" label-width="140px">
      <el-form-item label="代理商AGENT">
        <el-select v-model="subMaterialObj.agent" placeholder="请选择供应商">
        </el-select>
      </el-form-item>
      <el-form-item label="提单号M/BL NO." class="two-element">
        <el-input v-model="subMaterialObj.billNo" placeholder="请输入提单号"></el-input>
        <el-button type="primary">提单确认邮件</el-button>
      </el-form-item>
      <el-form-item label="SO NO.">
        <el-input v-model="subMaterialObj.soNo" placeholder="请输入SO NO"></el-input>
      </el-form-item>
      <el-form-item label="装货港">
        <el-select v-model="subMaterialObj.loadingPort" placeholder="请选择装货港">
        </el-select>
      </el-form-item>
      <el-form-item label="目的港">
        <el-select v-model="subMaterialObj.destination" placeholder="请选择目的港">
        </el-select>
      </el-form-item>
      <el-form-item label="船公司">
        <el-select v-model="subMaterialObj.shippingCompany" placeholder="请选择船公司">
        </el-select>
      </el-form-item>
      <el-form-item label="托运人">
        <el-select v-model="subMaterialObj.shipper" placeholder="请选择托运人">
        </el-select>
      </el-form-item>
      <el-form-item label="收货人">
        <el-select v-model="subMaterialObj.consignee" placeholder="请选择收货人">
        </el-select>
      </el-form-item>
      <el-form-item label="通知方">
        <el-select v-model="subMaterialObj.notifyParty" placeholder="请选择通知方">
        </el-select>
      </el-form-item>
      <el-form-item label="Mark & No.">
        <el-input v-model="subMaterialObj.markNo"></el-input>
      </el-form-item>
      <el-form-item label="包装数量与单位" class="two-element">
        <el-input v-model="subMaterialObj.quantity" placeholder="请输入包装数量"></el-input>
        <el-select v-model="subMaterialObj.unit" placeholder="请选择单位">
        </el-select>
      </el-form-item>
      <el-form-item label="毛重(KGS)">
        <el-input v-model="subMaterialObj.grossWeight" placeholder="请输入毛重(KGS)"></el-input>
      </el-form-item>
      <el-form-item label="立方数(CBM)">
        <el-input v-model="subMaterialObj.mesaurement" placeholder="请输入立方数(CBM)"></el-input>
      </el-form-item>
      <el-form-item label="货物描述">
        <el-input v-model="subMaterialObj.description" placeholder="请输入货物描述"></el-input>
      </el-form-item>
      <el-form-item label="柜号/封条">
        <el-input v-model="subMaterialObj.container" placeholder="请输入柜号/封条"></el-input>
      </el-form-item>
      <el-form-item label="柜型">
        111
      </el-form-item>
      <el-form-item label="出单方式">
        <el-radio-group v-model="subMaterialObj.billingMethod">
          <el-radio v-for="item in method" :key="item.value" :label="item.value">{{item.label}}</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="subMaterialObj.remark" type="textarea" rows="2" placeholder="请输入备注"></el-input>
      </el-form-item>
    </el-form>

    <el-row class="operate-button">
      <el-button type="primary">保存</el-button>
      <el-button type="success" @click="onSubmit">提交</el-button>
      <el-button @click="cancel">关闭</el-button>
    </el-row>
  </div>
</template>

<script>
/**
 * 提单补料
 */
export default {
  name: "subMaterial",
  data() {
    return {
      // 提单补料对象
      subMaterialObj: {
        markNo: "N/M",
      },
      // 出单方式
      method: [
        {
          value: "1",
          label: "正本",
        },
        {
          value: "2",
          label: "电放",
        },
      ],
    };
  },
  methods: {
    /** 提交 */
    onSubmit() {
      this.$refs["subMaterialForm"].validate((valid) => {
        if (valid) {
          alert("submit!");
        }
      });
    },
    /** 取消 */
    cancel() {
      this.$emit("closeDialog");
    },
  },
};
</script>

<style lang="scss">
</style>
