<template>
  <div>

    <el-dialog
      title="入仓-货物入仓"
      :visible.sync="opened"
      width="960px"
      :before-close="handleClose()"
    >
      <el-descriptions border :column="2">
        <el-descriptions-item label="中文品名"></el-descriptions-item>
        <el-descriptions-item label="英文品名"></el-descriptions-item>
        <el-descriptions-item label="品牌"></el-descriptions-item>
        <el-descriptions-item label="是否备案"></el-descriptions-item>
        <el-descriptions-item label="填单参数"></el-descriptions-item>
      </el-descriptions>
      <el-form ref="form" :model="form" label-width="80px" style="margin-top: 20px">
        <el-form-item label="材质">
          <dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.material"></dict-selector>
        </el-form-item>
        <el-form-item label="入仓时间">
          <el-date-picker v-model="form.time" type="datetime" placeholder="请选择入仓时间"></el-date-picker>
        </el-form-item>
      </el-form>

      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>入仓记录</span>
          <el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle></el-button>
          <el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle></el-button>
        </div>
        <el-table
          :data="[]"
          style="width: 100%">
          <el-table-column label="箱数">
          </el-table-column>
          <el-table-column label="包装类型">
          </el-table-column>
          <el-table-column label="长(cm)">
          </el-table-column>
          <el-table-column label="款(cm)">
          </el-table-column>
          <el-table-column label="高(cm)">
          </el-table-column>
          <el-table-column label="体积(m³)">
          </el-table-column>
          <el-table-column label="重量(Kg)">
          </el-table-column>
          <el-table-column label="数量">
          </el-table-column>
          <el-table-column label="快递单号">
          </el-table-column>
        </el-table>
      </el-card>

      <span slot="footer">
        <el-button @click="opened = false">关 闭</el-button>
        <el-button type="primary" @click="opened = false">提 交</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {getOrderWarehouseIn} from "@/api/ depository/orderWarehouseIn"
import dictSelector from "@/components/DictSelector"
import {DICT_TYPE} from "@/utils/dict"

export default {
  name: 'editDialog',

  components: {
    dictSelector
  },

  props: {
    visible: {
      type: Boolean,
      default: false
    },
    id:  Number
  },

  mounted() {
  },

  data() {
    return {
      DICT_TYPE,
      opened: false,
      form: {
        material: undefined,
        time: 0
      },
      orderItem: {}
    };
  },

  watch: {
    visible(val) {
      if (val) {
        this.opened = true
        if (this.id) {
          getOrderWarehouseIn(this.id).then(r => {
            this.orderItem = r.data
          })
        }
      } else {
      }
    },
    opened(val) {
      if (val) {
      } else {
        this.$emit('update:visible', false)
      }
    }
  },

  methods: {
    handleClose() {},
  }
}
</script>

<style scoped>

</style>
