فهرست منبع

feat: 系统自检打开任务弹窗

ZhaoJun 1 سال پیش
والد
کامیت
ea26d16b25
1فایلهای تغییر یافته به همراه19 افزوده شده و 1 حذف شده
  1. 19 1
      src/pages/EqSelfInspection/index.js

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

@@ -1,5 +1,6 @@
 import PageContent from '@/components/PageContent';
 import PageTitle from '@/components/PageTitle';
+import { getMandateIDs } from '@/services/eqSelfInspection';
 import { GetTokenFromUrl, UnityAction } from '@/utils/utils';
 import { connect, history, useLocation, useParams } from '@umijs/max';
 import { Button, Form, Modal, Select, Spin, message } from 'antd';
@@ -73,6 +74,23 @@ const EqSelfInspection = (props) => {
     form.resetFields();
   };
 
+  const openTaskModal = async () => {
+    if (!autoReport.Id) {
+      return;
+    }
+    const mandateIDs = await getMandateIDs({
+      project_id: projectId,
+      id: autoReport.Id,
+    }).catch((err) => {
+      console.log(err);
+    });
+    if (mandateIDs?.length) {
+      console.log('打开任务弹窗');
+    } else {
+      message.info('未查询到相关任务');
+    }
+  };
+
   useEffect(() => {
     if (routeId) {
       dispatch({
@@ -172,7 +190,7 @@ const EqSelfInspection = (props) => {
             className={styles.reportBtn}
             type="primary"
             onClick={() => {
-              // 打开任务弹窗
+              openTaskModal();
             }}
           >
             查看任务