src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue
@@ -79,7 +79,7 @@
<script>
  import dncApi from '@/api/dnc'
  import { deleteAction } from '@/api/manage'
  import { deleteAction, getAction } from '@/api/manage'
  import ProductStructureTreeContextMenu from './ProductStructureTreeContextMenu'
  import ProductModal from './Product/ProductModal'
  import ComponentModal from './Component/ComponentModal'
@@ -130,7 +130,8 @@
        rightClickSelected: {},
        fullScreenSpinning: false,
        url: {
          delete: '/nc/product/delete'
          delete: '/nc/product/delete',
          webServiceDNCToPlm: '/dnc/guideCardBatch/webServiceDNCToPlm'
        }
      }
    },
@@ -271,6 +272,46 @@
        })
      },
      // 树节点右键单击菜单中删除按钮时触发
      handleSendNcToPlm() {
        const that = this
        const { rightClickSelected: { id, type }, $confirm, url, $notification } = that
        $confirm({
          title: '提示',
          content: '确认发送该nc程序?',
          okText: '确认',
          okType: 'danger',
          cancelText: '取消',
          onOk: () => {
            if (!url.webServiceDNCToPlm) {
              this.$message.error('请设置url.webServiceDNCToPlm!')
              return
            }
            getAction(url.webServiceDNCToPlm, {id: id})
              .then((res) => {
                if (res.success) {
                  that.getTreeDataByApi()
                  $notification.success({
                    message: '消息',
                    description: res.message
                  })
                } else {
                  $notification.warning({
                    message: '消息',
                    description: res.message
                  })
                }
              })
              .finally(() => {
                that.$destroyAll()
              })
          },
          onCancel: () => {
            that.$destroyAll()
          }
        })
      },
      /**
       * 自动展开添加下级节点的父节点
       * @param isAddNextLevel 是否需要展开下级