fangmingyue 2 years ago
parent
commit
7fa144686a
2 changed files with 36 additions and 5 deletions
  1. 14
    1
      src/pages/apply/components/Issue.jsx
  2. 22
    4
      src/pages/apply/verify/index.jsx

+ 14
- 1
src/pages/apply/components/Issue.jsx View File

4
 import { Cell, CellGroup, Field, Button } from '@antmjs/vantui';
4
 import { Cell, CellGroup, Field, Button } from '@antmjs/vantui';
5
 import Uploader from '@/components/Uploader/index';
5
 import Uploader from '@/components/Uploader/index';
6
 import { getTaIssueById } from '@/services/taissue';
6
 import { getTaIssueById } from '@/services/taissue';
7
+import { getSysOrgById } from '@/services/sysorg';
7
 import { getDtStr } from '@/utils/date';
8
 import { getDtStr } from '@/utils/date';
8
 
9
 
9
 export default (props) => {
10
 export default (props) => {
10
   const { issueId, onLoading } = props;
11
   const { issueId, onLoading } = props;
11
 
12
 
12
   const [issue, setIssue] = React.useState({});
13
   const [issue, setIssue] = React.useState({});
14
+  const [org, setOrg] = React.useState({});
13
 
15
 
14
   const setLoading = (val) => {
16
   const setLoading = (val) => {
15
     if (onLoading) {
17
     if (onLoading) {
22
       setLoading(true);
24
       setLoading(true);
23
       getTaIssueById(issueId).then((res) => {
25
       getTaIssueById(issueId).then((res) => {
24
         setIssue(res);
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
         setLoading(false);
38
         setLoading(false);
26
       }).catch(() => {
39
       }).catch(() => {
27
         setLoading(false);
40
         setLoading(false);
35
         <Cell title="ID" value={issue?.issueId} />
48
         <Cell title="ID" value={issue?.issueId} />
36
         <Cell title="上报时间" value={getDtStr(issue?.createDate)} />
49
         <Cell title="上报时间" value={getDtStr(issue?.createDate)} />
37
         <Cell title="办结时间" value={issue?.expireDate} />
50
         <Cell title="办结时间" value={issue?.expireDate} />
38
-        <Cell title="交办单位" value={issue?.locName} />
51
+        <Cell title="交办单位" value={org?.name} />
39
         <Cell title="交办次数" value={issue?.processNum || 0} />
52
         <Cell title="交办次数" value={issue?.processNum || 0} />
40
       </CellGroup>
53
       </CellGroup>
41
       <CellGroup style={{ marginTop: '20px' }}>
54
       <CellGroup style={{ marginTop: '20px' }}>

+ 22
- 4
src/pages/apply/verify/index.jsx View File

53
     }
53
     }
54
 
54
 
55
     setSubmitting(true);
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
     }).catch(() => {
77
     }).catch(() => {
60
       setSubmitting(false);
78
       setSubmitting(false);
61
     })
79
     })
107
       message: '确认复制当前问题单?',
125
       message: '确认复制当前问题单?',
108
       selector: dialogId,
126
       selector: dialogId,
109
     }).then((value) => {
127
     }).then((value) => {
110
-      console.log('2value', value);
128
+      // console.log('2value', value);
111
       if ('confirm' === value) {
129
       if ('confirm' === value) {
112
         setLoading2(true)
130
         setLoading2(true)
113
         copyTaIssue(issue.issueId).then(res => {
131
         copyTaIssue(issue.issueId).then(res => {