Yansen 2 år sedan
förälder
incheckning
5d5b439004

+ 14
- 14
src/pages/check/edit/components/LocForm.jsx Visa fil

@@ -25,20 +25,20 @@ export default (props) => {
25 25
     })
26 26
   }
27 27
 
28
-  // 获取答题主记录信息
29
-  React.useEffect(() => {
30
-    if (checkItemInfo?.itemId) {
31
-      setLoading(true);
32
-      getTaCheckItemAnswer(checkItemInfo?.itemId).then((res) => {
33
-        if (res) {
34
-          onChange(res);
35
-        }
36
-        setLoading(false);
37
-      }).catch(() => {
38
-        setLoading(false);
39
-      });
40
-    }
41
-  }, [checkItemInfo?.itemId])
28
+  // // 获取答题主记录信息
29
+  // React.useEffect(() => {
30
+  //   if (checkItemInfo?.itemId) {
31
+  //     setLoading(true);
32
+  //     getTaCheckItemAnswer(checkItemInfo?.itemId).then((res) => {
33
+  //       if (res) {
34
+  //         onChange(res);
35
+  //       }
36
+  //       setLoading(false);
37
+  //     }).catch(() => {
38
+  //       setLoading(false);
39
+  //     });
40
+  //   }
41
+  // }, [checkItemInfo?.itemId])
42 42
   
43 43
   return (
44 44
     <View>

+ 13
- 13
src/pages/check/edit/components/Question.jsx Visa fil

@@ -25,19 +25,19 @@ export default (props) => {
25 25
     })
26 26
   }
27 27
 
28
-  React.useEffect(() => {
29
-    if (quInfo?.quId) {
30
-      setLoading(true);
31
-      getTaCheckAnswerItem({ quId: quInfo.quId, isMine: true }).then(res => {
32
-        if (res && res[0]) {
33
-          onChange(res[0]);
34
-        }
35
-        setLoading(false);
36
-      }).catch(() => {
37
-        setLoading(false);
38
-      });
39
-    }
40
-  }, [quInfo?.quId]);
28
+  // React.useEffect(() => {
29
+  //   if (quInfo?.quId) {
30
+  //     setLoading(true);
31
+  //     getTaCheckAnswerItem({ quId: quInfo.quId, isMine: true }).then(res => {
32
+  //       if (res && res[0]) {
33
+  //         onChange(res[0]);
34
+  //       }
35
+  //       setLoading(false);
36
+  //     }).catch(() => {
37
+  //       setLoading(false);
38
+  //     });
39
+  //   }
40
+  // }, [quInfo?.quId]);
41 41
   
42 42
   return (
43 43
     <View>

+ 1
- 1
src/pages/check/edit/index.jsx Visa fil

@@ -178,7 +178,7 @@ export default (props) => {
178 178
         }
179 179
         
180 180
         // 查询我的答案
181
-        getTaCheckItemAnswer(itemId).then(setAnswer);
181
+        // getTaCheckItemAnswer(itemId).then(setAnswer);
182 182
     
183 183
         // 查询当前测评主记录的所有问题
184 184
         getTaCheckItemQu({pageSize: 200, itemId}).then(res => {

+ 10
- 2
src/pages/check/loc/list/index.jsx Visa fil

@@ -1,7 +1,7 @@
1 1
 import React from 'react';
2 2
 import Taro from '@tarojs/taro';
3 3
 import { View } from '@tarojs/components';
4
-import { Cell, Tag } from '@antmjs/vantui';
4
+import { Cell, Tag, Notify } from '@antmjs/vantui';
5 5
 import Page from '@/layouts/index';
6 6
 import PowerList from '@/components/PowerList';
7 7
 import { getTaCheckItem } from '@/services/tacheckitem';
@@ -22,6 +22,14 @@ export default (props) => {
22 22
   }), [checkId]);
23 23
 
24 24
   const onClick = (item) => {
25
+    if (item.answerNum >= item.num) {
26
+      Notify.show({
27
+        message: '当前测评问卷已收齐',
28
+        type: 'warning',
29
+      })
30
+      return;
31
+    }
32
+
25 33
     Taro.navigateTo({
26 34
       url: `/pages/check/edit/index?id=${item.itemId}&typ=${item.itemType}`
27 35
     })
@@ -40,7 +48,7 @@ export default (props) => {
40 48
             onClick={() => onClick(item)}
41 49
           >
42 50
             {
43
-              item.readonly ? <Tag color="var(--main-bg-color)">已答完</Tag> : null
51
+              item.num <= item.answerNum ? <Tag color="var(--main-bg-color)">{`${item.answerNum}/${item.num}`}</Tag> : null
44 52
             }
45 53
           </Cell>
46 54
         )}