<template>
  <!-- 详情 装箱单-成衣 全部回显  -->
  <a-card :bordered="false">
    <a-drawer
      title="详情"
      width="89%"
      placement="right"
      :closable="true"
      :visible="visible"
      @close="handleCancel">
      <!-- 主表信息 展示-->
      <div class="table-page-search-wrapper">
        <a-form-model layout="inline" ref="form" :model="clothesAdd">
          <a-row :gutter="24">
            <a-col :md="6" :sm="8">
              <a-form-model-item label="订单号" prop="orderNum">
                7394jhg
                <!-- <a-input v-model="clothesAdd.orderNum"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="款号" prop="styleNum">
                736485
                <!-- <a-input v-model="clothesAdd.styleNum"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="品名" prop="name">
                品种6253
                <!-- <a-input v-model="clothesAdd.name"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="尺码范围" prop="sizeRange">
                S-3XL
                <!-- <a-input v-model="clothesAdd.sizeRange"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="客户" prop="customer">
                客户2
                <!-- <a-input v-model="clothesAdd.customer"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="集装箱代号" prop="containerCode">
                HY890
                <!-- <a-input v-model="clothesAdd.containerCode"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="集装箱号" prop="containerNo">
                HY89087
                <!-- <a-input v-model="clothesAdd.containerNo"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="备注" prop="note">
                务必按时发货，紧急
                <!-- <a-input v-model="clothesAdd.note"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="成衣工厂" prop="clothesFactory">
                成衣工厂1
                <!-- <a-input v-model="clothesAdd.clothesFactory"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="外销发票号" prop="exportInvoiceNo">
                12034
                <!-- <a-input v-model="clothesAdd.exportInvoiceNo"></a-input> -->
              </a-form-model-item>
            </a-col>

            <a-col :md="6" :sm="8">
              <a-form-model-item label="托书号" prop="bookNum">
                jdkd3
                <!-- <a-input v-model="clothesAdd.bookNum"></a-input> -->
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-form-model>
      </div>

      <!-- 子表 :pagination="ipagination"  -->
      <a-spin :spinning="confirmLoading">
        <a-form-model ref="formRef">
          <a-table
            bordered
            :row-key="record => record.id"
            :columns="columns"
            :data-source="data"
            :loading="loading"
            :pagination="false"
            :scroll="{ x: 1500 }"
            @change="handleTableChange"
          >
          </a-table>
        </a-form-model>
      </a-spin>
    </a-drawer>
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin' // 分页等
import JEllipsis from '@/components/jeecg/JEllipsis'

export default {
  name: 'DetailsClothesDrawer', //  详情 ---装箱单 -成衣
  mixins: [JeecgListMixin],

  components: { JEllipsis },
  data() {
    let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略

    return {
      // 表头
      columns: [
        {
          title: '账套',
          dataIndex: 'accountSet',
          width: 160,
          fixed: 'left',
          className: 'replacecolor'
        },
        {
          title: '成衣工厂',
          dataIndex: 'clothesFactory',
          width: 120,
          fixed: 'left',
          className: 'replacecolor'
        },
        {
          title: 'HOD',
          dataIndex: 'hod',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: 'STYLE NO.',
          dataIndex: 'styleNo',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: 'PO NO.',
          dataIndex: 'poNo',
          width: 90,
          className: 'replacecolor'
        },

        {
          title: 'ITEM NO./SKU NO./UPC NO./PACKS CODE',
          dataIndex: 'itemNo',
          width: 340,
          className: 'replacecolor'
        },
        {
          title: '分销点/DC/LABEL',
          dataIndex: 'dcLabel',
          width: 200,
          className: 'replacecolor'
        },
        {
          title: 'S',
          dataIndex: 's',
          width: 90,
          className: 'replacecolor'
        },
        {
          title: 'M',
          dataIndex: 'm',
          width: 90,
          className: 'replacecolor'
        },
        {
          title: 'L',
          dataIndex: 'l',
          width: 90,
          className: 'replacecolor'
        },
        {
          title: 'XL',
          dataIndex: 'xl',
          width: 90,
          className: 'replacecolor'
        },
        {
          title: 'XXL',
          dataIndex: 'xxl',
          width: 90,
          className: 'replacecolor'
        },

        {
          title: '3XL',
          dataIndex: '3xl',
          width: 90,
          className: 'replacecolor'
        },

        {
          title: '启始箱号',
          dataIndex: 'inceptionBoxNo',
          // scopedSlots: { customRender: 'inceptionBoxNo' },
          width: 120,
          className: 'replacecolor'
        },

        {
          title: '结束箱号',
          dataIndex: 'endBoxNo',
          width: 120,
          // scopedSlots: { customRender: 'endBoxNo' },
          className: 'replacecolor'
        },

        {
          title: '颜色（中英文）',
          dataIndex: 'colorChUsa',
          width: 140,
          className: 'replacecolor'
        },
        {
          title: '配码',
          dataIndex: 'configCode',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '件数/箱',
          dataIndex: 'packagesBox',
          width: 120,
          // scopedSlots: { customRender: 'packagesBox' },
          className: 'replacecolor'
        },
        {
          title: '箱数',
          dataIndex: 'boxes',
          width: 120,
          // scopedSlots: { customRender: 'boxes' },
          className: 'replacecolor'
        },

        {
          title: '总件数',
          dataIndex: 'totalPackagesNum',
          width: 90,
          className: 'replacecolor'
        },
        {
          title: '净重/箱',
          dataIndex: 'suttle',
          width: 120,
          // scopedSlots: { customRender: 'suttle' },
          className: 'replacecolor'
        },
        {
          title: '总净重',
          dataIndex: 'totalSuttle',
          width: 90,
          className: 'replacecolor'
        },
        {
          title: '毛重/箱',
          dataIndex: 'roughWeight',
          width: 120,
          // scopedSlots: { customRender: 'roughWeight' },
          className: 'replacecolor'
        },
        {
          title: '总毛重',
          dataIndex: 'totalRoughWeigh',
          width: 90,
          className: 'replacecolor'
        },
        {
          title: '外箱长度',
          dataIndex: 'boxLength',
          width: 120,
          // scopedSlots: { customRender: 'boxLength' },
          className: 'replacecolor'
        },
        {
          title: '外箱宽度',
          dataIndex: 'boxWidth',
          width: 120,
          // scopedSlots: { customRender: 'boxWidth' },
          className: 'replacecolor'
        },
        {
          title: '外箱高度',
          dataIndex: 'boxHeight',
          width: 120,
          // scopedSlots: { customRender: 'boxHeight' },
          className: 'replacecolor'
        },
        {
          title: '总体积',
          dataIndex: 'totalVolume',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '净净重',
          dataIndex: 'netNetWeight',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '单价',
          dataIndex: 'price',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '总价',
          dataIndex: 'totalPrices',
          width: 120,
          className: 'replacecolor'
        },
        {
          title: '备注',
          dataIndex: 'note',
          width: 140,
          customRender: t => ellipsis(t),
          fixed: 'right',
          className: 'replacecolor'
        }
      ],
      data: [{}, {}, {}],
      loading: false,
      clothesAdd: {},
      visible: false,
      confirmLoading: false
      // dateFormat: 'YYYY-MM-DD'
    }
  },
  created() {},
  methods: {
    // 抽屉 取消
    handleCancel() {
      console.log('抽屉取消')
      this.close()
    },

    close() {
      this.$emit('close')
      this.visible = false
    }
  },
  computed: {},
  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;
// }
</style>
