zhaowei
2025-07-15 86f0166e2a759e6ec2c34b0dd0b388bafa80cedd
src/views/dnc/base/modules/ProductStructure/Cutter/CutterModal.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    :maskClosable="false"
    @ok="handleOk"
    @cancel="handleCancel"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    cancelText="关闭">
    <CutterModalForm ref="realForm" @ok="submitCallback" :disableSubmit="disableSubmit"/>
  </j-modal>
</template>
<script>
import CutterModalForm from './CutterModalForm.vue'
export default {
  name: 'CutterModal',
  components: {
    CutterModalForm
  },
  props: {
    currentTreeNodeInfo: {
      type: Object
    }
  },
  data() {
    return {
      title: '',
      width: 700,
      visible: false,
      disableSubmit: false
    }
  },
  methods: {
    // æ·»åŠ æ‰€ç”¨åˆ€å…·
    handleCutterAdd() {
      const { attributionId, attributionType, docId } = this.currentTreeNodeInfo
      this.visible = true
      this.$nextTick(() => {
        if (this.$refs.realForm) {
          this.$refs.realForm.add({
            attributionId: attributionId,
            attributionType: attributionType,
            docId: docId
          })
        }
      })
    },
    // ç¼–辑刀具信息
    handleCutterEdit(record) {
      this.visible = true
      this.$nextTick(() => {
        if (this.$refs.realForm) {
          this.$refs.realForm.edit({ ...record })
        }
      })
    },
    handleOk() {
      this.$refs.realForm.submitForm()
    },
    submitCallback() {
      this.$emit('submitSuccess')
      this.visible = false
    },
    handleCancel() {
      this.$emit('close')
      this.visible = false
    }
  }
}
</script>