TblSemiFinishedModal.vue 1.3 KB
<template>
  <j-modal :title="title" :width="1200" :visible="visible" :maskClosable="false" switchFullscreen @ok="handleOk"
    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel">
    <tbl-semi-finished-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" :excludeIds="excludeIds" />
  </j-modal>
</template>

<script>

import TblSemiFinishedForm from './TblSemiFinishedForm'

export default {
  name: 'TblSemiFinishedModal',
  components: {
    TblSemiFinishedForm
  },
  props: ["dataRes"],
  data() {
    return {
      title: '',
      width: 800,
      visible: false,
      disableSubmit: false,
      excludeIds: ''
    }
  },
  methods: {
    add() {
      this.excludeIds = '';
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.add();
      })
    },
    edit(record) {
      //console.log('record',record)
      this.excludeIds = record.partNumber
      this.visible = true
      this.$nextTick(() => {
        this.$refs.realForm.edit(record);
      })
    },
    close() {
      this.$emit('close');
      this.visible = false;
    },
    handleOk() {
      this.$refs.realForm.handleOk();
    },
    submitCallback() {
      this.$emit('ok');
      this.visible = false;
    },
    handleCancel() {
      this.close()
    }
  }
}
</script>

<style scoped>
</style>