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

import TblProtectionForm from './TblProtectionForm.vue'

export default {
    name: 'TblProtectionModal',
    components: {
        TblProtectionForm
    },
    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) {
            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>