Yansen 2 years ago
parent
commit
5d5b439004

+ 14
- 14
src/pages/check/edit/components/LocForm.jsx View File

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
   return (
43
   return (
44
     <View>
44
     <View>

+ 13
- 13
src/pages/check/edit/components/Question.jsx View File

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
   return (
42
   return (
43
     <View>
43
     <View>

+ 1
- 1
src/pages/check/edit/index.jsx View File

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

+ 10
- 2
src/pages/check/loc/list/index.jsx View File

1
 import React from 'react';
1
 import React from 'react';
2
 import Taro from '@tarojs/taro';
2
 import Taro from '@tarojs/taro';
3
 import { View } from '@tarojs/components';
3
 import { View } from '@tarojs/components';
4
-import { Cell, Tag } from '@antmjs/vantui';
4
+import { Cell, Tag, Notify } from '@antmjs/vantui';
5
 import Page from '@/layouts/index';
5
 import Page from '@/layouts/index';
6
 import PowerList from '@/components/PowerList';
6
 import PowerList from '@/components/PowerList';
7
 import { getTaCheckItem } from '@/services/tacheckitem';
7
 import { getTaCheckItem } from '@/services/tacheckitem';
22
   }), [checkId]);
22
   }), [checkId]);
23
 
23
 
24
   const onClick = (item) => {
24
   const onClick = (item) => {
25
+    if (item.answerNum >= item.num) {
26
+      Notify.show({
27
+        message: '当前测评问卷已收齐',
28
+        type: 'warning',
29
+      })
30
+      return;
31
+    }
32
+
25
     Taro.navigateTo({
33
     Taro.navigateTo({
26
       url: `/pages/check/edit/index?id=${item.itemId}&typ=${item.itemType}`
34
       url: `/pages/check/edit/index?id=${item.itemId}&typ=${item.itemType}`
27
     })
35
     })
40
             onClick={() => onClick(item)}
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
           </Cell>
53
           </Cell>
46
         )}
54
         )}