业务跳转流程

用于获取流程,并跳转到发起/编辑

一、需求/效果

1.点击


2.跳转


二、实现方法/逻辑

  • 1.封装方法 getFlow

    // 获取流程,并跳转到发起
    // query: {  }
    async getFlow(query, businessId) {
      let res = await ApiGetFlow(query).catch(() => {})
    
      let flowId = ''
      if (res && res.data && res.data.flowId) {
        flowId = res.data.flowId
      } else {
        Notification({
          type: 'warning',
          title: '提示',
          message: '暂无法找到流程!'
        })
        return
      }
    
      let curServer =
        process.env.NODE_ENV !== 'development'
          ? window.location.origin
          : process.env.SERVER_URL
      let appUrl = '/approve'
    
      if (flowId) {
        appUrl = `/approve/form?flowId=${flowId}`
        if (businessId) {
          appUrl = `${appUrl}&businessId=${businessId}`
        }
      }
      const url = curServer + appUrl
      window.location.href = url
    },
  • 2.获取流程信息接口

    /**
    * 根据标识,获取流程
    * @query.bizKey 流程标识
    * @query.suiteKey 套件标识
    * @query.tenantId 企业ID/租户ID
    */
    export const ApiGetFlow = (query) => {
      return request({
          url: `/workflow-api/flow`,
          method: 'GET',
          params: query
      })
    }
  • 2.调用

    const query = {
      bizKey: 'xxx_contract_add',
      suiteKey: 'cn.flyrise.xxx.xxx',
      tenantId: this.$store.state.user_info.entId,
    }
    this.vueFn.getFlow(query)
文档更新时间: 2022-07-15 10:20   作者:戴均豪