xujunjie há 2 anos atrás
pai
commit
d76d6ee0d3

+ 10 - 7
src/pages/PurchaseAdmin/PurchaseList/Detail/AuditFlow.js

@@ -32,12 +32,15 @@ function AuditFlow(props) {
       let current = 0;
       const activityId = tasks[tasks.length - 1].activity_id;
       flow.workflowActivityRules.forEach((item, index) => {
-        if (tasks.find(task => task.activity_id == item.activityId)) {
-          current = index;
-        }
-        // 判断是否只剩抄送节点未被选中
-        if (item.activityName == '抄送人' && current == index - 1) {
-          current = index;
+        let task = tasks.find(task => task.activity_id == item.activityId);
+        if (task) {
+          if (task.task_status == 'COMPLETED') {
+            // 完成时节点为下一级
+            current = index + 1;
+          } else {
+            // 未完成则为当前节点
+            current = index;
+          }
         }
       });
       return current;
@@ -64,7 +67,7 @@ function AuditFlow(props) {
         result = (
           <>
             <br />
-            结果: {TASK_RESULT[task.task_result]}
+            审批结果: {TASK_RESULT[task.task_result]}
             <br />
           </>
         );

+ 7 - 6
src/pages/PurchaseAdmin/PurchaseList/Detail/CommitAuditModal.js

@@ -167,12 +167,13 @@ function CommitAuditModal(props) {
                   id: itemProps.id,
                   ...val,
                 };
+              } else if (allValues[itemProps.id]) {
+                return {
+                  name: itemProps.label,
+                  // id: itemProps.id,
+                  value: allValues[itemProps.id] || undefined,
+                };
               }
-              return {
-                name: itemProps.label,
-                // id: itemProps.id,
-                value: allValues[itemProps.id] || '',
-              };
             })
             .filter(item => item);
           setFormComponentValues({ ...formComponentValues });
@@ -215,7 +216,7 @@ function CommitAuditModal(props) {
         originatorUserId: currentUser.DingUserId || getCurrentUser()?.DingUserId, //'16569001414345099',
         deptId: '14237557', //currentUser.DingDepId || getCurrentUser()?.DingDepId,
         template_node_id: `${approvalNode.Id}`,
-        formComponentValues: data[approvalNode.Id],
+        formComponentValues: data[approvalNode.Id] || [],
       };
       result.push(JSON.stringify(formItem));
     });