张涛 1 anno fa
parent
commit
08a738b292

+ 3
- 3
config/prod.js Vedi File

@@ -3,11 +3,11 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"http://192.168.89.25:9087"',
7
-    // HOST: '"https://wmcj.huoshannews.com"',
6
+    // HOST: '"http://192.168.89.25:9087"',
7
+    HOST: '"https://wmcj.huoshannews.com"',
8 8
     AD_IMAGE: '"https://h5.njyunzhi.com/images/citizen_banner.png"',
9 9
     DEFAULT_POS: '"116.3476917447715,31.409912844296578"', // 霍山县人民政府 gcj02
10
-    VERSION: '"1.1.25-20230524"',
10
+    VERSION: '"1.1.26-20230609"',
11 11
   },
12 12
   mini: {},
13 13
   h5: {

+ 5
- 3
src/pages/issue/components/Issue/index.jsx Vedi File

@@ -13,7 +13,9 @@ import mapIcon from '@/assets/icons/marker.png';
13 13
 import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
14 14
 import { PROCESS_END } from '@/utils/biz';
15 15
 import { geocoder } from '@/utils/map';
16
-
16
+import {
17
+  ROLE_ORG_USER,
18
+} from "@/utils/user";
17 19
 import IssueStatus from './IssueStatus';
18 20
 
19 21
 const today = new Date();
@@ -241,7 +243,7 @@ export default (props) => {
241 243
       </CellGroup>
242 244
 
243 245
       {
244
-        (showOrg || showExpireDate) && (
246
+        (showOrg ) && (
245 247
           <CellGroup style={{ marginTop: '20px' }}>
246 248
             {
247 249
               showOrg && (
@@ -254,7 +256,7 @@ export default (props) => {
254 256
               )
255 257
             }
256 258
             {
257
-              showExpireDate && (
259
+              (showExpireDate)  && (
258 260
                 <Cell
259 261
                   title="办结时间"
260 262
                   isLink={!readOnly}

+ 58
- 31
src/pages/issue/edit/components/Save.jsx Vedi File

@@ -1,45 +1,72 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View } from '@tarojs/components';
4
-import { Button } from '@antmjs/vantui';
5
-import { postTaIssue } from '@/services/taissue';
6
-import { warn } from '@/utils/message';
7
-
1
+import React from "react";
2
+import Taro from "@tarojs/taro";
3
+import { View } from "@tarojs/components";
4
+import { Button } from "@antmjs/vantui";
5
+import { postTaIssue, postIssueAssigned } from "@/services/taissue";
6
+import { warn } from "@/utils/message";
7
+import { useModel } from "@/store";
8
+import {
9
+  ROLE_INSPECTOR
10
+} from "@/utils/user";
8 11
 export default (props) => {
9
-
10 12
   const { formData } = props;
11
-
13
+  const { duty } = useModel("user");
12 14
   const [loading, setLoading] = React.useState(false);
13 15
 
16
+  console.log(ROLE_INSPECTOR == duty);
17
+
18
+  function jump() {
19
+    return Taro.navigateBack({
20
+      delta: 1,
21
+      fail: () => {
22
+        Taro.reLaunch({
23
+          url: "/pages/home/index",
24
+        });
25
+      },
26
+    });
27
+  }
28
+
14 29
   // 新增问题单
15 30
   const onSubmit = () => {
31
+    console.log(formData);
16 32
     try {
17
-      warn(!formData.addr, '请填写地址')
18
-      warn(!formData.locId, '请选择点位')
19
-      warn(!formData.content, '请填写问题描述')
20
-      warn(!formData.typeId, '请选择问题分类')
21
-      warn(!formData.attachList || formData.attachList.length < 1, '请上传照片')
33
+      warn(!formData.addr, "请填写地址");
34
+      warn(!formData.locId, "请选择点位");
35
+      warn(!formData.content, "请填写问题描述");
36
+      warn(!formData.typeId, "请选择问题分类");
37
+      warn(
38
+        !formData.attachList || formData.attachList.length < 1,
39
+        "请上传照片"
40
+      );
22 41
     } catch (e) {
23 42
       return;
24 43
     }
25 44
 
26
-    setLoading(true)
27
-    postTaIssue(formData).then(() => {
28
-      setLoading(false);
29
-      Taro.navigateBack({
30
-        delta: 1,
31
-        fail: () => {
32
-          Taro.reLaunch({
33
-            url: '/pages/home/index'
34
-          });
35
-        }
45
+    setLoading(true);
46
+    postTaIssue(formData)
47
+      .then((res) => {
48
+        const data = { ...res, ...formData };
49
+        console.log(data);
50
+        ROLE_INSPECTOR == duty
51
+          ? postIssueAssigned({ ...data, nextOrg: formData.orgId })
52
+              .then(() => {
53
+                setLoading(false);
54
+                jump();//跳转
55
+              })
56
+              .catch((e) => {
57
+                console.log(e);
58
+                setLoading(false);
59
+              })
60
+          : jump();
61
+      })
62
+      .catch(() => {
63
+        setLoading(false);
36 64
       });
37
-    }).catch(() => {
38
-      setLoading(false);
39
-    })
40
-  }
65
+  };
41 66
 
42 67
   return (
43
-    <Button block type="primary" loading={loading} onClick={onSubmit}>提交</Button>
44
-  )
45
-}
68
+    <Button block type="primary" loading={loading} onClick={onSubmit}>
69
+      提交
70
+    </Button>
71
+  );
72
+};

+ 2
- 1
src/pages/issue/edit/index.jsx Vedi File

@@ -49,7 +49,8 @@ export default (props) => {
49 49
       if (duty == ROLE_INSPECTOR) {
50 50
         return [
51 51
           issue && issue.processNode != PROCESS_START,
52
-          issue?.processNode && issue?.processNode != PROCESS_START, // true,
52
+          true,
53
+          // issue?.processNode && issue?.processNode != PROCESS_START, // true,
53 54
           issue && issue.processNode == PROCESS_START,
54 55
           false,
55 56
           false,