|
@@ -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);
|