Yansen 2 年前
父节点
当前提交
27f70b286b

+ 8
- 4
src/pages/check/edit/components/LocForm.jsx 查看文件

@@ -46,10 +46,14 @@ export default (props) => {
46 46
     <View>
47 47
       <Map location={answer?.location} onLocChange={setLoc} />
48 48
       <CellGroup>
49
-        <Cell
50
-          title="点位"
51
-          value={checkItemInfo?.name}
52
-        />
49
+        {
50
+          checkType == 'loc' && (
51
+            <Cell
52
+              title="点位"
53
+              value={checkItemInfo?.name}
54
+            />
55
+          )
56
+        }
53 57
         <Field
54 58
           readonly={readonly}
55 59
           placeholder={checkType == 'loc' ? '请输入地址' : '请填写小区名称'}

+ 23
- 21
src/pages/check/edit/components/Question.jsx 查看文件

@@ -81,29 +81,31 @@ export default (props) => {
81 81
           }
82 82
         </CellGroup>
83 83
       </RadioGroup>
84
-      <CellGroup style={{marginTop: '20px'}}>
85
-        <Cell title="测评标准" />
86
-        <Cell
87
-          renderTitle={
88
-            <RichText nodes={quInfo?.stand} />
89
-          }
90
-        />
91
-      </CellGroup>
92 84
       {
93 85
         checkType != 'survey' && (
94
-          <CellGroup style={{marginTop: '20px'}}>        
95
-            <Cell title="拍照或视频" border={false} />
96
-    
97
-            <Cell
98
-              renderTitle={
99
-                <Uploader
100
-                  disabled={readonly}
101
-                  value={answerItem?.attachList}
102
-                  onChange={e => setFieldChange('attachList',e)}
103
-                />
104
-              }
105
-            />
106
-          </CellGroup>
86
+          <>
87
+            <CellGroup style={{marginTop: '20px'}}>
88
+              <Cell title="测评标准" />
89
+              <Cell
90
+                renderTitle={
91
+                  <RichText nodes={quInfo?.stand} />
92
+                }
93
+              />
94
+            </CellGroup>
95
+            <CellGroup style={{marginTop: '20px'}}>        
96
+              <Cell title="拍照或视频" border={false} />
97
+      
98
+              <Cell
99
+                renderTitle={
100
+                  <Uploader
101
+                    disabled={readonly}
102
+                    value={answerItem?.attachList}
103
+                    onChange={e => setFieldChange('attachList',e)}
104
+                  />
105
+                }
106
+              />
107
+            </CellGroup>
108
+          </>
107 109
         )
108 110
       }
109 111
     </View>

+ 8
- 13
src/pages/check/edit/index.jsx 查看文件

@@ -13,6 +13,7 @@ import {
13 13
 import { getTaCheckItemQu } from '@/services/tacheckitemqu';
14 14
 import VABC from '@/components/VABC';
15 15
 import { ROLE_INSPECTOR } from '@/utils/user';
16
+import { warn } from '@/utils/message';
16 17
 import LocForm from './components/LocForm';
17 18
 import Question from './components/Question';
18 19
 import Footer from './components/Footer/index';
@@ -42,18 +43,12 @@ export default (props) => {
42 43
   const onIndexChange = (n) => {
43 44
     if (index == -1 && n != -1) {
44 45
       if (!readonly) {
45
-        if (!answer?.addr) {
46
-          Notify.show({
47
-            message: typ == 'loc' ? '请填写地址' : '请填写小区名称',
48
-            type: 'warning',
49
-          })
50
-          return;
51
-        }
52
-        if (!answer?.location) {
53
-          Notify.show({
54
-            message: '未能获取定位信息, 请重试',
55
-            type: 'warning',
56
-          })
46
+        try {
47
+          warn(!answer?.addr, typ == 'loc' ? '请填写地址' : '请填写小区名称');
48
+          warn(!answer?.location, '未能获取定位信息, 请重试');
49
+          warn(typ == 'survey' && !answer?.sex, '请选择性别');
50
+          warn(typ == 'survey' && !answer?.age, '请选择年龄段');
51
+        } catch (error) {
57 52
           return;
58 53
         }
59 54
       }
@@ -116,7 +111,7 @@ export default (props) => {
116 111
     }
117 112
 
118 113
     setLoading(true);
119
-    putTaCheckItemAnswer(id, answer).then(() => {
114
+    putTaCheckItemAnswer(checkItemInfo.itemId, answer).then(() => {
120 115
       setLoading(false);
121 116
       const t = setTimeout(() => {
122 117
         clearTimeout(t);