Yansen il y a 11 mois
Parent
révision
28ac56097b

+ 1
- 1
src/components/OrgPicker/index.jsx Voir le fichier

@@ -4,6 +4,6 @@ import { getSysOrg } from '@/services/sysorg';
4 4
 
5 5
 export default (props) => {
6 6
   return (
7
-    <Pickerful {...props} keyValue="orgId" dictAPI={getSysOrg} params={{ isResponsible: 1 }} />
7
+    <Pickerful {...props} keyValue="orgId" dictAPI={getSysOrg} params={{ isResponsible: 1, parentId: props.parentId }} />
8 8
   )
9 9
 }

+ 1
- 1
src/components/Uploader/index.jsx Voir le fichier

@@ -116,7 +116,7 @@ export default (props) => {
116 116
             <Image src={icon} onClick={onAdd} />
117 117
           </View>
118 118
         )}
119
-        {valueCopy.map((item, inx) => (
119
+        {valueCopy?.map((item, inx) => (
120 120
           <View key={item?.url || '123'} className={style["uploader-item"]}>
121 121
             {
122 122
               !item ? (

+ 4
- 4
src/pages/apply/useTitle.js Voir le fichier

@@ -6,16 +6,16 @@ export default function useTitle(applyType) {
6 6
   React.useMemo(() => {
7 7
     switch (applyType) {
8 8
       case PROCESS_APPLY_DELAY:
9
-        Taro.setNavigationBarTitle('申请延期');
9
+        Taro.setNavigationBarTitle({ title: '申请延期' });
10 10
         break;
11 11
       case PROCESS_APPLY_REJECT:
12
-        Taro.setNavigationBarTitle('申请驳回');
12
+        Taro.setNavigationBarTitle({ title: '申请驳回' });
13 13
         break;
14 14
       case PROCESS_APPLY_VERIFY:
15
-        Taro.setNavigationBarTitle('申请审核');
15
+        Taro.setNavigationBarTitle({ title: '申请审核' });
16 16
         break;
17 17
       case PROCESS_APPLY_END:
18
-        Taro.setNavigationBarTitle('申请办结');
18
+        Taro.setNavigationBarTitle({ title: '申请办结' });
19 19
         break;
20 20
     }
21 21
   }, [applyType]);

+ 2
- 0
src/pages/apply/verify/index.jsx Voir le fichier

@@ -76,6 +76,8 @@ export default (props) => {
76 76
         } else {
77 77
           Taro.navigateBack({ delta: 1 });
78 78
         }
79
+      } else {
80
+        Taro.navigateBack({ delta: 1 });
79 81
       }
80 82
     }).catch(() => {
81 83
       setSubmitting(false);

+ 2
- 0
src/pages/issue/components/Issue/index.jsx Voir le fichier

@@ -147,6 +147,8 @@ export default (props) => {
147 147
     const value = e.detail.value||e.target.value||e.detail;
148 148
     setFieldChange("content", value);
149 149
   };
150
+  
151
+      console.log('---------issue---issue----->')
150 152
 
151 153
   return (
152 154
     <View>

+ 80
- 0
src/pages/org/issue/detail/components/Assigned.jsx Voir le fichier

@@ -0,0 +1,80 @@
1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components';
4
+import { Button, Dialog } from '@antmjs/vantui';
5
+import OrgPicker from "@/components/OrgPicker";
6
+import { postIssueAssignedAgain, putTaIssue, copyTaIssue } from '@/services/taissue';
7
+import { warn } from '@/utils/message';
8
+
9
+export default (props) => {
10
+
11
+  const { issue } = props;
12
+  const formDataRef = React.useRef();
13
+
14
+  const dialogId = React.useMemo(() => `dialog-${Math.random().toString(36).substring(2, 7)}`, []);
15
+  const [loading1, setLoading1] = React.useState(false);
16
+  const [loading2, setLoading2] = React.useState(false);
17
+  const [showOrgPicker, setShowOrgPicker] = React.useState(false);
18
+
19
+  // 交办
20
+  const onAssigned = () => {
21
+    try {
22
+      // warn(!formData.addr, '请填写地址')
23
+      // warn(!formData.locId, '请选择点位')
24
+      // warn(!formData.content, '请填写问题描述')
25
+      // warn(!formData.typeId, '请选择问题分类')
26
+      // warn(!formData.attachList || formData.attachList.length < 1, '请上传照片')
27
+      warn(!formDataRef.current?.orgId, '请选择交办单位')
28
+      // warn(!formData.expireDate, '请选择办结时间')
29
+    } catch (e) {
30
+      return;
31
+    }
32
+
33
+    setLoading1(true)
34
+
35
+    const data = { ...issue, ...(formDataRef.current || {}) };
36
+    // 先提交修改
37
+    putTaIssue(issue.issueId, data).then(() => {
38
+      // 再提交交办
39
+      postIssueAssignedAgain({ ...data, nextOrg: data.orgId }).then(() => {
40
+        setLoading1(false);
41
+        Taro.navigateBack({ delta: 1 });
42
+      }).catch(() => {
43
+        setLoading1(false);
44
+      })
45
+    }).catch(() => {
46
+      setLoading1(false);
47
+    })
48
+  }
49
+
50
+  
51
+  const onOrgChange = (_, it) => {
52
+    const data = {
53
+      ...(formDataRef.current || {}),
54
+      orgId: it.orgId,
55
+      orgName: it.name,
56
+    };
57
+    formDataRef.current = data;
58
+    setShowOrgPicker(false);
59
+    onAssigned();
60
+  };
61
+
62
+  return (
63
+    <View style={{ marginTop: '20px', display: 'flex' }}>
64
+      <Dialog id={dialogId} />
65
+      <OrgPicker
66
+        parentId={issue.orgId}
67
+        show={showOrgPicker}
68
+        value={formDataRef.current?.orgName}
69
+        onCancel={() => setShowOrgPicker(false)}
70
+        onChange={onOrgChange}
71
+      />
72
+      <Button
73
+        block
74
+        type="primary"
75
+        loading={loading1}
76
+        onClick={() => setShowOrgPicker(true)}
77
+      >交办</Button>
78
+    </View>
79
+  )
80
+}

+ 11
- 1
src/pages/org/issue/detail/index.jsx Voir le fichier

@@ -21,6 +21,7 @@ import { useModel } from '@/store';
21 21
 import IssueStatus from './components/IssueStatus';
22 22
 import IssueInfo from '../../components/issue-info';
23 23
 import Apply from './components/Apply';
24
+import Assigned from './components/Assigned';
24 25
 
25 26
 export default (props) => {
26 27
 
@@ -36,6 +37,7 @@ export default (props) => {
36 37
     readOnly,
37 38
     showApplyVerify,
38 39
     showApplyEnd,
40
+    showAssign,
39 41
   ] = React.useMemo(() => {
40 42
     if (!orgIssue.issueId) return [];
41 43
 
@@ -43,6 +45,7 @@ export default (props) => {
43 45
       orgIssue?.processStatus == APPLY_READY || orgIssue?.processNode == PROCESS_END,
44 46
       orgIssue.processNode == PROCESS_ASSIGNED && duty != ROLE_ORG_MANAGER,
45 47
       orgIssue.processNode != PROCESS_END && orgIssue.processNode != PROCESS_APPLY_END ,
48
+      orgIssue.processNode == PROCESS_ASSIGNED && duty == ROLE_ORG_MANAGER,
46 49
     ]
47 50
 
48 51
   }, [orgIssue, duty]);
@@ -64,7 +67,7 @@ export default (props) => {
64 67
         setLoading(false);
65 68
       });
66 69
 
67
-      getTaOrgIssueByIssueId(id, user?.orgId ).then(res => setOrgIssue(res));
70
+      getTaOrgIssueByIssueId(id, user?.orgId ).then(res => setOrgIssue(res || {}));
68 71
     }
69 72
   }, [id, user]);
70 73
   
@@ -134,6 +137,13 @@ export default (props) => {
134 137
                 style={{marginLeft: 'var(--main-space)'}}
135 138
               >申请驳回</Apply>
136 139
             </View>
140
+            {
141
+              showAssign && (
142
+                <View style={{ marginTop: '20px' }}>
143
+                  <Assigned issue={issue} />
144
+                </View>
145
+              )
146
+            }
137 147
           </View>
138 148
         )
139 149
       }

+ 5
- 0
src/services/taissue.js Voir le fichier

@@ -35,6 +35,11 @@ export const deleteTaIssue = (id) => request(`/api/taIssue/${id}`, { method: 'de
35 35
  */
36 36
 export const postIssueAssigned = (data) => request('/api/taIssueProcess/assigned', { data, method: 'post' });
37 37
 
38
+/*
39
+ * 再次交办
40
+ */
41
+export const postIssueAssignedAgain = (data) => request('/api/taIssueProcess/assigned2', { data, method: 'post' });
42
+
38 43
 /*
39 44
  * 驳回
40 45
  */