<template>
  <!-- 详情预托书  回显所有信息-->
  <div id="detailPreBookDrawer">
    <a-drawer title="详情" width="89%" placement="right" :closable="true" :visible="visible" @close="onClose">
      <!-- 主表信息 展示-->
      <a-card :bordered="true">
        <div class="table-page-search-wrapper">
          <a-form-model layout="inline" ref="form" :model="preBook">
            <a-row :gutter="24">
              

              <a-col :md="6" :sm="8">
                <a-form-model-item label="预托书号" prop="depositaryReceiptNo">
                  {{ preBookDetails.depositaryReceiptNo }}
                </a-form-model-item>
              </a-col>
              <a-col :md="6" :sm="8">
                <a-form-model-item label="托书日期" prop="shippingOrderDate">
                  {{ preBookDetails.shippingOrderDate }}
                </a-form-model-item>
              </a-col>

              <!-- <a-col :md="12" :sm="12">
                <a-form-model-item label="外销发票号码" prop="exportInvoiceNo">
                  {{ preBookDetails.exportInvoiceNo }}
                </a-form-model-item>
              </a-col> -->

              <a-col :md="6" :sm="8">
                <a-form-model-item label="经营单位" prop="unitInOperation">
                  {{ preBookDetails.unitInOperation }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="经营单位地址" prop="unitInOperationAddress">
                  {{ preBookDetails.unitInOperationAddress }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="进仓/装柜日期" prop="latestDateOfShipment">
                  {{ preBookDetails.latestDateOfShipment }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="最终船期" prop="theFinalShippingDate">
                  {{ preBookDetails.theFinalShippingDate }}
                </a-form-model-item>
              </a-col>
                <a-col :md="6" :sm="8">
                <a-form-model-item label="贸易国别" prop="tradeCountry">
                  {{ preBookDetails.tradeCountry }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="运抵国别" prop="arriveInCountry">
                  {{ preBookDetails.arriveInCountry }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="收货人" prop="consignee">
                  {{ preBookDetails.consignee }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="收货人地址" prop="consigneeAddress">
                  {{ preBookDetails.consigneeAddress }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="通知方" prop="notifyParty">
                  {{ preBookDetails.notifyParty }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="通知方地址" prop="notifyPartyAddress">
                  {{ preBookDetails.notifyPartyAddress }}
                </a-form-model-item>
              </a-col>

            
              <a-col :md="6" :sm="8">
                <a-form-model-item label="出口口岸" prop="exportPort">
                  {{ preBookDetails.exportPort }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="目的港" prop="destinationPort">
                  {{ preBookDetails.destinationPort }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="收汇方式" prop="exchangeEarningsValue">
                  {{ preBookDetails.exchangeEarningsValue }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="成交方式" prop="termsOfDeliveryvalue">
                  {{ preBookDetails.termsOfDeliveryvalue }}
                </a-form-model-item>
              </a-col>

              <a-col :md="6" :sm="8">
                <a-form-model-item label="金额" prop="money">
                  {{ preBookDetails.money }}
                </a-form-model-item>
              </a-col>

            </a-row>
          </a-form-model>
        </div>
      </a-card>

      <!--子表 -->
      <a-card :bordered="true" style="marginTop:10px;">
        <a-spin :spinning="confirmLoading">
          <a-form-model ref="formRef">
            <a-table
              bordered
              rowKey="id"
              :columns="columns"
              :data-source="data"
              :loading="loading"
              :pagination="ipagination"
              :scroll="{ x: 1500,y: 350 }"
            >
            </a-table>
          </a-form-model>
        </a-spin>

      </a-card>
    </a-drawer>
  </div>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import JEllipsis from '@/components/jeecg/JEllipsis'
import moment from 'moment'

export default {
  name: 'DetailsPreBookDrawer', //  详情 预托书
  computed: {},
  mixins: [JeecgListMixin],
  components: { JEllipsis, moment },
  data() {
    return {
      // 表头
      columns: [
        // {
        //   title: '英文名称',
        //   dataIndex: 'englishName',
        //   width: 120,

        //   fixed: 'left',
        //   className: 'replacecolor'
        // },
        {
          title: '款号',
          dataIndex: 'itemNumber',
          width: 120,

          // fixed: 'left',
          className: 'replacecolor'
        },
        {
          title: '小po号',
          dataIndex: 'smallPo',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '数量',
          dataIndex: 'total',
          width: 120,

          className: 'replacecolor'
        },
        {
          title: '箱数',
          dataIndex: 'boxNumber',
          width: 90,

          className: 'replacecolor'
        },

        {
          title: '毛重',
          dataIndex: 'totalGrossWeight',
          width: 120,

          className: 'replacecolor'
        },
        {
          title: '净重',
          dataIndex: 'totalNetWeight',
          width: 120,

          className: 'replacecolor'
        },
        {
          title: '体积',
          dataIndex: 'totalVolume',
          width: 160,

          className: 'replacecolor'
        },
        {
          title: '分销点',
          dataIndex: 'distributionPoint',
          width: 120,

          className: 'replacecolor'
        },
        {
          title: '集装箱代号',
          dataIndex: 'containerCode',
          width: 120,
          scopedSlots: { customRender: 'containerCode' },
          className: 'replacecolor'
        },

        {
          title: '集装箱号',
          dataIndex: 'containerNumber',
          width: 120,
          scopedSlots: { customRender: 'containerNo' },
          className: 'replacecolor'
        },
        {
          title: '单价',
          dataIndex: 'unitPrice',
          width: 120,

          className: 'replacecolor'
        },
        //         {
        //   title: '创建时间',
        //   dataIndex: 'createTime',
        //   align: 'center',
        //   sorter: true,
        //   customRender: text => {
        //     return moment(text).format('YYYY-MM-DD')
        //   }
        // },
        {
          title: '金额',
          dataIndex: 'totalPrice',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '预发货日期',
          dataIndex: 'preDeliveryDate',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '业务员',
          dataIndex: 'salesman',
          width: 120,
          className: 'replacecolor'
        },

        {
          title: '业务部门',
          dataIndex: 'salesDepartment',
          width: 120,

          className: 'replacecolor'
        },
        {
          title: '采购/委外订单号',
          dataIndex: 'spurOrSubOrder',
          width: 160,

          className: 'replacecolor'
        },

        {
          title: '采购/委外工厂',
          dataIndex: 'supplier',
          width: 160,

          className: 'replacecolor'
        }
      ],
      data: [],

      loading: false, // 表格加载
      preBook: {},
      confirmLoading: false,
      visible: false,
      dateFormat: 'YYYY-MM-DD',
      preBookDetails: {} //主表信息
    }
  },
  created() {},
  methods: {
    // 抽屉 取消
    onClose() {
      this.$emit('close')
      this.visible = false
    },

    modalFormOk() {}
  },

  mounted() {}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
@import '~@assets/less/overwriter.less';
/deep/ .ant-table-thead > tr > th {
  text-align: center;
  // font-weight: 700;
}
/deep/ .ant-table-tbody {
  text-align: center;
}
// /deep/ th.replacecolor {
//   background-color: #ccc;
// }

// 抽屉里的card样式
/deep/ .ant-drawer-content {
  background-color: #f0f2f5;
}
/deep/ .ant-drawer-body {
  padding: 10px;
}
</style>
