<template>
  <el-dialog
    :title="'新建备货入库单'"
    :center="true"
    align="left"
    top="5vh"
    width="500px"
    @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)"
  >
    <el-card style="margin-top: -20px">
      <el-row :gutter="10">
        <el-col :span="24">
          <wsm-in-order-addEdit-form
            v-if="showModelThis"
            :id="'add'"
            :newTime="newTime"
            :sitem="sitem"
            @refresh="(showModelThis = false), $emit('refresh')"
          />
        </el-col>
      </el-row>
    </el-card>
  </el-dialog>
</template>
   <script>
import resToken from "@/mixins/resToken";
import wsmInOrderAddEditForm from "./wsm-in-order-addEdit-form";

export default {
  name: "purchaseOrder",
  props: ["showModel", "id",  "sitem"],
  components: { wsmInOrderAddEditForm},
  mixins: [resToken],
  data() {
    return {
      showModelThis: this.showModel,
      loading: false,
      title: "",
      sitem: null,
      newTime: "",
    };
  },
  watch: {
    showModel: function (val) {
      this.showModelThis = val;
      if (val) {
        this.initForm();
      }
    },
    showModelThis(val) {
      if (!val) {
        this.$emit("cancel");
      }
    },
  },
  methods: {
    
    async initForm() {
      this.loading = true;

      this.loading = false;
    },

    
    getNewTime() {
      this.newTime = new Date().valueOf();
    },
  },
};
</script>

   <style lang="scss" scoped>
.purchaseOrder {
}
</style>
   