<template>
  <el-dialog
    :title="title"
    :center="true"
    align="left"
    top="8vh"
    width="1040px"
    @close="showModelThis = false"
    :close-on-click-modal="false"
    :visible.sync="showModelThis"
    v-loading="loading"
    element-loading-text="拼命加载中"
    element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.8)"
    append-to-body
  >
    <show-goods-data-table style="margin:-20px 0 0 0"
      :newTime="newTime"
      v-if="newTime !== ''"
      :type="type"
      :skucode="skuCode"
      :spucode="spuCode"
      :iscgd="iscgd"
      :border="true"
    >
    </show-goods-data-table>
  </el-dialog>
</template>

<script>
export default {
  name: "showGoodsDataTableModal",
  props: ["showModel", 'title',"type", "skuCode", "spuCode", "iscgd"],


  data() {
    return {
      newTime: "",
      loading: true,
      showModelThis:this.showModel
    };
  },
  watch: {
    showModel: function (val) {
      this.showModelThis = val;
      if (val) {
        this.loading = true;
        this.getNewTime();
      }
    },
    showModelThis(val) {
      if (!val) {
        this.$emit("cancel");
      }
    },
  },

  methods: {
    getNewTime() {
      this.newTime = new Date().valueOf() + "";
      this.loading = false;
    },
  },
};
</script>

<style>
</style>