张涛 преди 1 година
родител
ревизия
61ea1f3324

+ 0
- 1
src/pages/check/components/CheckForm.jsx Целия файл

@@ -38,7 +38,6 @@ export default (props) => {
38 38
     if (!checkInfo) {
39 39
       const res = await postTaCheck(data);
40 40
       onChange(res);
41
-      console.log(123);
42 41
     } else {
43 42
       const res = await putTaCheck(checkInfo.checkId, data);
44 43
       onChange(res);

+ 13
- 5
src/pages/check/components/LocTable.jsx Целия файл

@@ -1,8 +1,12 @@
1
-import React from "react";
1
+import React, { useRef } from "react";
2 2
 import { Link } from "react-router-dom";
3 3
 import useBool from "@/utils/hooks/useBool";
4 4
 import { Table, Space, Button, Row, Col, Card } from "antd";
5
-import { getTaCheckItem, exportTaCheckItem } from "@/service/tacheckitem";
5
+import {
6
+  getTaCheckItem,
7
+  exportTaCheckItem,
8
+  putSync,
9
+} from "@/service/tacheckitem";
6 10
 import QuList from "./QuList";
7 11
 import LocForm from "./LocForm";
8 12
 import styles from "./style.module.less";
@@ -15,6 +19,7 @@ export default (props) => {
15 19
   const [loading, startLoading, stopLoading] = useBool();
16 20
   const [open, setOpen] = React.useState(false);
17 21
   const [expLoading, startExpLoading, stopExpLoading] = useBool();
22
+  const cardRef = useRef();
18 23
 
19 24
   const columns = [
20 25
     {
@@ -151,9 +156,11 @@ export default (props) => {
151 156
   }, [queryList]);
152 157
 
153 158
   const onSync = () => {
154
-    // getTaCheckItem({ pageSize: 500, checkId, itemType: "loc" }).then((res) => {
155
-    // setList(res.records || []);
156
-    // });
159
+    putSync(checkId).then((res) => {
160
+      if (res == "success") {
161
+        queryList()
162
+      }
163
+    });
157 164
   };
158 165
   return (
159 166
     <Row gutter={24}>
@@ -180,6 +187,7 @@ export default (props) => {
180 187
           }
181 188
         >
182 189
           <Table
190
+            ref={cardRef}
183 191
             sticky
184 192
             summary={() => (
185 193
               <Table.Summary fixed="top">

+ 0
- 1
src/pages/check/components/QuForm.jsx Целия файл

@@ -27,7 +27,6 @@ export default (props) => {
27 27
     }
28 28
 
29 29
     const res = await postTaCheckItemQu(data);
30
-    console.log(res)
31 30
     onChange(res);
32 31
     return true;
33 32
   }

+ 0
- 1
src/pages/check/components/SurveyForm.jsx Целия файл

@@ -24,7 +24,6 @@ const SurveyForm = (props) => {
24 24
   const onFinish = async (values) => {
25 25
     const data = { ...(checkItem || {}), ...values, itemType }
26 26
     const res = await postTaCheckItem(data);
27
-    console.log(res)
28 27
     setCheckItem(res);
29 28
     form.setFieldsValue(res);
30 29
     return true;

+ 8
- 0
src/service/tacheckitem.js Целия файл

@@ -36,3 +36,11 @@ export const getByCheckId = (checkId, typeId) => request(`/api/taCheck/${checkId
36 36
 
37 37
 
38 38
 export const exportTaCheckItem = (checkId) => request(`/api/taCheck/${checkId}/loc/export`, { method: 'post', download: true });
39
+
40
+
41
+/**
42
+ * 同步点位
43
+ */
44
+
45
+
46
+export const  putSync=(checkId)=>request(`/api/taCheck/${checkId}/sync`,{ method: 'put'})