king
2024-05-09 6b7d0fd448738e8780c8b865d17d293a4251f9be
2024-05-09
2个文件已修改
125 ■■■■■ 已修改文件
src/menu/components/share/actioncomponent/formconfig.jsx 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -1024,24 +1024,6 @@
    },
    {
      type: 'cascader',
      key: 'switchTab',
      label: '切换标签',
      initVal: card.switchTab || [],
      tooltip: '执行成功后,需要切换的标签页。' + (appType === 'mob' ? '注:小程序中无效' : ''),
      required: false,
      options: tabs
    },
    {
      type: 'cascader',
      key: 'anchors',
      label: '跳转锚点',
      initVal: card.anchors || [],
      tooltip: '执行成功后,需要跳转的锚点。' + (appType === 'mob' ? '注:小程序中无效' : ''),
      required: false,
      options: anchors
    },
    {
      type: 'cascader',
      key: 'refreshTab',
      label: '刷新菜单',
      initVal: card.refreshTab || [],
@@ -1064,6 +1046,24 @@
      forbid: viewType === 'popview'
    },
    {
      type: 'cascader',
      key: 'switchTab',
      label: '切换标签',
      initVal: card.switchTab || [],
      tooltip: '执行成功后,需要切换的标签页。' + (appType === 'mob' ? '注:小程序中无效' : ''),
      required: false,
      options: tabs
    },
    {
      type: 'cascader',
      key: 'anchors',
      label: '跳转锚点',
      initVal: card.anchors || [],
      tooltip: '执行成功后,需要跳转的锚点。' + (appType === 'mob' ? '注:小程序中无效' : ''),
      required: false,
      options: anchors
    },
    {
      type: 'select',
      key: 'preButton',
      label: '前置按钮',
src/utils/utils.js
@@ -2151,6 +2151,10 @@
    let detailId = ''
    let error = ''
    let userid = sessionStorage.getItem('UserID') || ''
    let checkIds = []
    let checkUsers = []
    let noticeIds = []
    let work_grade = sessionStorage.getItem('work_grade') || 0
    if (verify.flowType === 'start') {
      target = flow.cells.filter(cell => cell.mknode === 'start')[0]
@@ -2261,6 +2265,34 @@
        status = line.mkdata.status
        statusName = line.mkdata.statusName
        target = flow.cells.filter(cell => cell.id === line.target.cell)[0]
        line.mkdata.members && line.mkdata.members.forEach(item => {
          if (line.mkdata.approver === 'departmentManager') {
            if (item.job_type === 'manage' && departmentcode === item.parentIds[1]) {
              checkIds.push(item.worker_id)
              checkUsers.push(item)
            }
          } else if (line.mkdata.approver === 'directManager') {
            if (departmentcode === item.parentIds[1] && item.work_grade > work_grade) {
              checkIds.push(item.worker_id)
              checkUsers.push(item)
            }
          } else {
            checkIds.push(item.worker_id)
            checkUsers.push(item)
          }
        })
        line.mkdata.copys && line.mkdata.copys.forEach(item => {
          noticeIds.push(item.worker_id)
        })
        if (!target) {
          error = '未查询到工作流目标节点'
        } else if (checkIds.length === 0 && line.mknode !== 'startEdge' && line.mknode !== 'endEdge') {
          error = '未获取到下一步审批人'
        } else if (line.approvalMethod === 'countersign' && (!node.checkIds || !node.checkIds.includes(userid))) {
          error = '当前用户不在审批人列表中'
        }
      } else if (!error) {
        error = '工作流中无对应流程'
      }
@@ -2276,7 +2308,7 @@
      /* 工作流异常sql */
      select @ErrorCode='E',@retmsg='${error}' goto aaa
      `
    } else if (verify.flowSql === 'true' && target) {
    } else if (verify.flowSql === 'true') {
      if (verify.flowType === 'start') {
        _sql += `
      /* 工作流默认sql */
@@ -2289,15 +2321,7 @@
      insert into s_my_works_flow_role (works_flow_id,works_flow_code,userid,works_flow_detail_id,createuserid,CreateUser,CreateStaff,upid,typecharone)
      select @ID@,@works_flow_code@,@userid@,@works_flow_detail_id@,@userid@,@UserName,@FullName,@time_id@,'begin'
      `
      } else if (line && line.approvalMethod === 'countersign' && (!node.checkIds || !node.checkIds.includes(userid))) {
        status = 0
        statusName = '异常'
        _sql += `
        /* 工作流异常sql */
        select @ErrorCode='E',@retmsg='当前用户不在审批人列表中' goto aaa
        `
      } else if (line && line.approvalMethod === 'countersign' && node.checkIds.length > 1) {
      } else if (line.approvalMethod === 'countersign' && node.checkIds.length > 1) {
        let label = ''
        let field = ''
        let mark = line.mark || '已审核'
@@ -2427,51 +2451,10 @@
      end
      `
      }
    } else if (verify.flowSql === 'true') {
      status = 0
      statusName = '异常'
      _sql += `
      /* 工作流异常sql */
      select @ErrorCode='E',@retmsg='${error || '工作流执行异常'}' goto aaa
      `
    }
    let checkIds = []
    let checkUsers = []
    let work_grade = sessionStorage.getItem('work_grade') || 0
    if (verify.flowType !== 'start') {
      if (line) {
        let noticeIds = []
        line.mkdata.members && line.mkdata.members.forEach(item => {
          if (line.mkdata.approver === 'departmentManager') {
            if (item.job_type === 'manage' && departmentcode === item.parentIds[1]) {
              checkIds.push(item.worker_id)
              checkUsers.push(item)
            }
          } else if (line.mkdata.approver === 'directManager') {
            if (departmentcode === item.parentIds[1] && item.work_grade > work_grade) {
              checkIds.push(item.worker_id)
              checkUsers.push(item)
            }
          } else {
            checkIds.push(item.worker_id)
            checkUsers.push(item)
          }
        })
        line.mkdata.copys && line.mkdata.copys.forEach(item => {
          noticeIds.push(item.worker_id)
        })
        _sql = _sql.replace(/@check_userids@/ig, `'${checkIds.join(',')}'`)
        _sql = _sql.replace(/@notice_userids@/ig, `'${noticeIds.join(',')}'`)
      } else {
        _sql = _sql.replace(/@check_userids@/ig, `''`)
        _sql = _sql.replace(/@notice_userids@/ig, `''`)
      }
    } else {
      _sql = _sql.replace(/@check_userids@/ig, `''`)
      _sql = _sql.replace(/@notice_userids@/ig, `''`)
    }
    _sql = _sql.replace(/@check_userids@/ig, `'${checkIds.join(',')}'`)
    _sql = _sql.replace(/@notice_userids@/ig, `'${noticeIds.join(',')}'`)
    _sql = _sql.replace(/@start_type@/ig, `'开始'`)
    _sql = _sql.replace(/@check_type@/ig, verify.flowType === 'reject' ? `'驳回'` : `'审核'`)