zhaowei
2025-01-13 58848b1a18d29929ba84b0336860f258b913070f
src/views/dnc/base/modules/ProductStructure/Process/ProcessModal.vue
@@ -20,6 +20,11 @@
    components: {
      ProcessModalForm
    },
    props: {
      currentTreeNodeInfo: {
        type: Object
      }
    },
    data() {
      return {
        title: '',
@@ -27,29 +32,62 @@
        visible: false
      }
    },
    created() {
      this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod)
    },
    methods: {
      add() {
      /**
       * 创建
       * @param modalTitle
       */
      handleComponentAddRelative(modalTitle) {
        this.title = modalTitle
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
        })
      },
      edit(record) {
      handleProcessAdd(modalTitle) {
        this.title = modalTitle
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.edit(record)
          this.$refs.realForm.add()
        })
      },
      handlePartsAddRelative(modalTitle) {
        this.title = modalTitle
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.add()
        })
      },
      handleProcessEdit(modalTitle) {
        this.title = modalTitle
        this.visible = true
        this.$nextTick(() => {
          this.$refs.realForm.edit(this.currentTreeNodeInfo.entity)
        })
      },
      handleOk() {
        this.$refs.realForm.submitForm()
      },
      submitCallback() {
        this.$emit('ok')
        this.visible = false
      },
      handleCancel() {
        this.$emit('close')
        this.visible = false
      },
      triggerCorrespondingMethod({ methodName, modalTitle }) {
        if (this[methodName]) this[methodName](modalTitle)
      }
    }
  }