Explorar o código

feat(wise-cose-util): 调整流程状态判断

zhangweicheng %!s(int64=4) %!d(string=hai) anos
pai
achega
759f3f6d64
Modificáronse 2 ficheiros con 4 adicións e 5 borrados
  1. 1 1
      wise-cost-util/package.json
  2. 3 4
      wise-cost-util/src/process.ts

+ 1 - 1
wise-cost-util/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@sc/wise-cost-util",
-  "version": "1.0.7",
+  "version": "1.0.8",
   "description": "wise-cost项目前后端业务通用工具包",
   "main": "./dist/index.cjs.js",
   "module": "./dist/index.esm.js",

+ 3 - 4
wise-cost-util/src/process.ts

@@ -6,10 +6,9 @@ export const getProcessStatus = (approvalWay: ApprovalWay, accounts: IProcessAcc
   if (!isArray(accounts)) {
     return accounts.status;
   }
-  // 若为上报审批,则流程状态直接为 success
-  if (approvalWay === ApprovalWay.REPORT) return ProcessStatus.APPROVED;
-  // 指定用户
-  if (approvalWay === ApprovalWay.ACCOUNT) {
+
+  // 指定用户 退回上一环节为上报审批时,判断流程状态和指定用户一样
+  if (approvalWay === ApprovalWay.ACCOUNT || approvalWay === ApprovalWay.REPORT) {
     const { status } = accounts[0];
     if (status === ProcessStatus.ACTIVATING) return ProcessStatus.ACTIVATING;
     if (status === ProcessStatus.APPROVED) return ProcessStatus.APPROVED;