瀏覽代碼

Merge branch 'dev1.0' of http://git.ycjcjy.com/civilized_city/miniapp into dev1.0

Yansen 2 年之前
父節點
當前提交
20b3011a82
共有 2 個文件被更改,包括 39 次插入7 次删除
  1. 17
    3
      src/pages/apply/components/Issue.jsx
  2. 22
    4
      src/pages/apply/verify/index.jsx

+ 17
- 3
src/pages/apply/components/Issue.jsx 查看文件

@@ -4,12 +4,14 @@ import { View } from '@tarojs/components';
4 4
 import { Cell, CellGroup, Field, Button } from '@antmjs/vantui';
5 5
 import Uploader from '@/components/Uploader/index';
6 6
 import { getTaIssueById } from '@/services/taissue';
7
+import { getSysOrgById } from '@/services/sysorg';
7 8
 import { getDtStr } from '@/utils/date';
8 9
 
9 10
 export default (props) => {
10 11
   const { issueId, onLoading } = props;
11 12
 
12 13
   const [issue, setIssue] = React.useState({});
14
+  const [org, setOrg] = React.useState({});
13 15
 
14 16
   const setLoading = (val) => {
15 17
     if (onLoading) {
@@ -22,6 +24,17 @@ export default (props) => {
22 24
       setLoading(true);
23 25
       getTaIssueById(issueId).then((res) => {
24 26
         setIssue(res);
27
+        //拿到机构ID
28
+        if (res.orgId) {
29
+          // console.log('res.orgId', res.orgId)
30
+          setLoading(true);
31
+          getSysOrgById(res.orgId).then((r) => {
32
+            setOrg(r);
33
+            setLoading(false);
34
+          }).catch(() => {
35
+            setLoading(false);
36
+          });
37
+        }
25 38
         setLoading(false);
26 39
       }).catch(() => {
27 40
         setLoading(false);
@@ -35,18 +48,19 @@ export default (props) => {
35 48
         <Cell title="ID" value={issue?.issueId} />
36 49
         <Cell title="上报时间" value={getDtStr(issue?.createDate)} />
37 50
         <Cell title="办结时间" value={issue?.expireDate} />
51
+        <Cell title="交办单位" value={org?.name} />
38 52
         <Cell title="交办次数" value={issue?.processNum || 0} />
39 53
       </CellGroup>
40
-      <CellGroup style={{marginTop: '20px'}}>
54
+      <CellGroup style={{ marginTop: '20px' }}>
41 55
         <Cell title="抽检位置" value={issue?.locName} />
42 56
         <Cell title="定 位 点" value={issue?.addr} />
43
-        <Cell title="问题详情" />        
57
+        <Cell title="问题详情" />
44 58
         <Field
45 59
           readonly
46 60
           type="textarea"
47 61
           autosize={{ minHeight: '120px' }}
48 62
           value={issue?.content}
49
-        /> 
63
+        />
50 64
         <Cell
51 65
           renderTitle={
52 66
             <Uploader

+ 22
- 4
src/pages/apply/verify/index.jsx 查看文件

@@ -53,9 +53,27 @@ export default (props) => {
53 53
     }
54 54
 
55 55
     setSubmitting(true);
56
-    putTaIssueApply(data.applyId, data).then(() => {
57
-      Taro.navigateBack({ delta: 1 });
58
-      setSubmitting(false);
56
+    putTaIssueApply(data.applyId, data).then((res) => {
57
+      if (formData.verifyStatus == 'pass') {
58
+        // Dialog 有 bug,
59
+        // 使用 setTimeout 延迟一会规避一下
60
+        const t = setTimeout(() => {
61
+          clearTimeout(t);
62
+          Dialog.confirm({
63
+            title: '审批通过',
64
+            message: `确定要跳转问题单详情页吗?`,
65
+            selector: dialogId,
66
+          }).then((value2) => {
67
+            if ('confirm' === value2) {
68
+              Taro.navigateTo({
69
+                url: `/pages/issue/edit/index?id=${res.issueId}`
70
+              })
71
+            }
72
+          });
73
+        }, 500);
74
+        // Taro.navigateBack({ delta: 1 });
75
+        setSubmitting(false);
76
+      }
59 77
     }).catch(() => {
60 78
       setSubmitting(false);
61 79
     })
@@ -107,7 +125,7 @@ export default (props) => {
107 125
       message: '确认复制当前问题单?',
108 126
       selector: dialogId,
109 127
     }).then((value) => {
110
-      console.log('2value', value);
128
+      // console.log('2value', value);
111 129
       if ('confirm' === value) {
112 130
         setLoading2(true)
113 131
         copyTaIssue(issue.issueId).then(res => {