ZhaoJun hai 1 ano
pai
achega
72e1dd3cc9
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 4 1
      src/pages/EqSelfInspection/index.js
  2. 1 1
      src/services/eqSelfInspection.js

+ 4 - 1
src/pages/EqSelfInspection/index.js

@@ -78,13 +78,16 @@ const EqSelfInspection = (props) => {
     if (!autoReport.Id) {
       return;
     }
-    const mandateIDs = await getMandateIDs({
+    let mandateIDs = await getMandateIDs({
       project_id: projectId,
       id: autoReport.Id,
     }).catch((err) => {
       console.log(err);
     });
+    console.log(mandateIDs);
     if (mandateIDs?.length) {
+      mandateIDs = [...new Set(mandateIDs)];
+      console.log(mandateIDs.join());
       UnityAction.sendMsg('OpenTaskModal', `mandate_id=${mandateIDs.join()}`);
     } else {
       message.info('未查询到相关任务');

+ 1 - 1
src/services/eqSelfInspection.js

@@ -94,5 +94,5 @@ export async function getMandateIDs(params) {
   const res = await request(
     `/api/v1//patrol/relation-task?${stringify(params)}`,
   );
-  return res?.data?.list || [];
+  return res?.data || [];
 }