Your Name před 2 roky
rodič
revize
4bad085ffe

+ 2
- 2
config/dev.js Zobrazit soubor

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    // HOST: '"http://127.0.0.1:9087"'
7
-    HOST: '"http://192.168.1.2:9087"'
6
+    HOST: '"http://127.0.0.1:9087"'
7
+    // HOST: '"http://192.168.1.2:9087"'
8
   },
8
   },
9
   mini: {},
9
   mini: {},
10
   h5: {}
10
   h5: {}

+ 2
- 0
src/app.config.js Zobrazit soubor

11
     'pages/apply/list/index',
11
     'pages/apply/list/index',
12
     'pages/apply/apply/index',
12
     'pages/apply/apply/index',
13
     'pages/apply/verify/index',
13
     'pages/apply/verify/index',
14
+    'pages/apply/detail/index',
15
+    'pages/message/list/index',
14
     'pages/index3/index',
16
     'pages/index3/index',
15
     'pages/index4/index',
17
     'pages/index4/index',
16
     'pages/index5/index',
18
     'pages/index5/index',

+ 2
- 2
src/components/IssueCard/index.jsx Zobrazit soubor

29
     const {value : bizStatus = 0, label : statusText} = getIssueStatus(detail);
29
     const {value : bizStatus = 0, label : statusText} = getIssueStatus(detail);
30
 
30
 
31
     return [
31
     return [
32
-      (detail.content || '').replace('\r\n', '<br>').replace('\n', '<br>'),
32
+      (detail.issueContent || detail.content || '').replace('\r\n', '<br>').replace('\n', '<br>'),
33
       dayjs(detail.createDate).format('YYYY-MM-DD HH:mm'),
33
       dayjs(detail.createDate).format('YYYY-MM-DD HH:mm'),
34
       colors[color ?? bizStatus],
34
       colors[color ?? bizStatus],
35
       stText || statusText,
35
       stText || statusText,
50
       <View className={style['issue-card-footer']}>
50
       <View className={style['issue-card-footer']}>
51
         <View>
51
         <View>
52
           <Image src={icon} />
52
           <Image src={icon} />
53
-          <Text>{detail?.addr || ''}</Text>
53
+          <Text>{detail?.issueAddr || detail?.addr || ''}</Text>
54
         </View>
54
         </View>
55
         <View style={{ color: styleColor[1] }}>{statusTxt}</View>
55
         <View style={{ color: styleColor[1] }}>{statusTxt}</View>
56
       </View>
56
       </View>

+ 1
- 0
src/components/Pickerful/style.module.less Zobrazit soubor

2
 .pickerful-box {
2
 .pickerful-box {
3
   width: 90vw;
3
   width: 90vw;
4
   height: 100vh;
4
   height: 100vh;
5
+  padding-bottom: env(safe-area-inset-bottom);
5
   display: flex;
6
   display: flex;
6
   flex-direction: column;
7
   flex-direction: column;
7
 
8
 

+ 2
- 2
src/components/PowerList/index.jsx Zobrazit soubor

4
 import { PowerScrollView } from '@antmjs/vantui';
4
 import { PowerScrollView } from '@antmjs/vantui';
5
 
5
 
6
 export default (props) => {
6
 export default (props) => {
7
-  const { request, params = {}, renderItem } = props;
7
+  const { request, params, renderItem } = props;
8
 
8
 
9
   const pageSize = 20;
9
   const pageSize = 20;
10
   const pageNumRef = React.useRef(1);
10
   const pageNumRef = React.useRef(1);
17
     return new Promise((resolve, reject) => {
17
     return new Promise((resolve, reject) => {
18
       request({
18
       request({
19
         pageSize,
19
         pageSize,
20
-        ...params,
20
+        ...(params || {}),
21
         ...options
21
         ...options
22
       }).then((res) => {
22
       }).then((res) => {
23
         const { records, current, pages } = res;
23
         const { records, current, pages } = res;

+ 8
- 0
src/layouts/TabBar.jsx Zobrazit soubor

75
       ]
75
       ]
76
     }
76
     }
77
 
77
 
78
+    if (user.dutyList.indexOf(ROLE_ORG_USER) > -1) {
79
+      return [
80
+        home,
81
+        notice,
82
+        mine,
83
+      ]
84
+    }
85
+
78
     return [];
86
     return [];
79
   }, [user]);
87
   }, [user]);
80
 
88
 

+ 1
- 1
src/pages/apply/components/Issue.jsx Zobrazit soubor

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 { getDtStr } from '@/utils/date';
7
 
8
 
8
-const getDtStr = dt => !dt ? '' : dt.replace('T', ' ').substring(0, 16)
9
 export default (props) => {
9
 export default (props) => {
10
   const { issueId, onLoading } = props;
10
   const { issueId, onLoading } = props;
11
 
11
 

+ 7
- 10
src/pages/apply/detail/index.jsx Zobrazit soubor

4
 import Page from '@/layouts/index';
4
 import Page from '@/layouts/index';
5
 import { Cell, CellGroup, Field, Radio, RadioGroup } from '@antmjs/vantui';
5
 import { Cell, CellGroup, Field, Radio, RadioGroup } from '@antmjs/vantui';
6
 import { getTaIssueApplyById } from '@/services/taissueapply';
6
 import { getTaIssueApplyById } from '@/services/taissueapply';
7
+import { getDtStr } from '@/utils/date';
7
 import Issue from '../components/Issue';
8
 import Issue from '../components/Issue';
8
 
9
 
9
 // const today = new Date();
10
 // const today = new Date();
69
       <CellGroup style={{marginTop: '20px'}}>
70
       <CellGroup style={{marginTop: '20px'}}>
70
         <Cell
71
         <Cell
71
           title="审批结果"
72
           title="审批结果"
72
-        >
73
-          <RadioGroup
74
-            readonly
75
-            direction="horizontal"
76
-            value={applyInfo.verifyStatus}
77
-          >
78
-            <Radio name="pass" checkedColor="var(--main-bg-color)">通过</Radio>
79
-            <Radio name="reject" checkedColor="red">驳回</Radio>
80
-          </RadioGroup>
81
-        </Cell>
73
+          value={applyInfo.verifyStatus == 'pass' ? '通过' : '驳回'}
74
+        />
82
         <Cell title="审批说明" />
75
         <Cell title="审批说明" />
83
         <Field
76
         <Field
84
           readonly
77
           readonly
86
           autosize={{ minHeight: '120px' }}
79
           autosize={{ minHeight: '120px' }}
87
           value={applyInfo.verifyDesc}
80
           value={applyInfo.verifyDesc}
88
         />
81
         />
82
+        <Cell
83
+          title="审核日期"
84
+          value={getDtStr(applyInfo.verifyDate)}
85
+        />
89
       </CellGroup>
86
       </CellGroup>
90
     </Page>
87
     </Page>
91
   )
88
   )

+ 14
- 14
src/pages/apply/list/index.jsx Zobrazit soubor

26
   const { user } = useModel('user');
26
   const { user } = useModel('user');
27
 
27
 
28
   const onClick = (item) => {
28
   const onClick = (item) => {
29
+    if (!user) return ;
29
 
30
 
30
-    let act = '';
31
-    const status = getIssueStatus(item);
32
-
33
-    // 如果是管理员
34
     if (user.dutyList.indexOf(ROLE_MANAGER) > -1) {
31
     if (user.dutyList.indexOf(ROLE_MANAGER) > -1) {
35
-      // 如果是待交办
36
-      if (status.value === 0) {
37
-        act = 'assigned';
32
+      if (item.verifyStatus) {
33
+        Taro.navigateTo({
34
+          url: `/pages/apply/detail/index?id=${item.applyId}&issueId=${item.issueId}&applyType=${item.applyType}`
35
+        })
36
+      } else {
37
+        Taro.navigateTo({
38
+          url: `/pages/apply/verify/index?id=${item.applyId}&issueId=${item.issueId}&applyType=${item.applyType}`
39
+        })
38
       }
40
       }
39
     } else {
41
     } else {
40
-      
42
+      Taro.navigateTo({
43
+        url: `/pages/apply/detail/index?id=${item.applyId}&issueId=${item.issueId}&applyType=${item.applyType}`
44
+      })
41
     }
45
     }
42
-
43
-    Taro.navigateTo({
44
-      url: `/pages/issue/edit/index?id=${item.issueId}&act=${act}`
45
-    })
46
   }
46
   }
47
   
47
   
48
   return (
48
   return (
53
             request={getTaIssueApply}
53
             request={getTaIssueApply}
54
             params={{applyType, sourceType: 'inspector'}}
54
             params={{applyType, sourceType: 'inspector'}}
55
             renderItem={(item) => (
55
             renderItem={(item) => (
56
-              <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
56
+              <Card key={item.issueId} detail={item} stText={title} onClick={() => onClick(item)} />
57
             )}
57
             )}
58
           />
58
           />
59
         </Tab>
59
         </Tab>
62
             request={getTaIssueApply}
62
             request={getTaIssueApply}
63
             params={{applyType, sourceType: 'feedback'}}
63
             params={{applyType, sourceType: 'feedback'}}
64
             renderItem={(item) => (
64
             renderItem={(item) => (
65
-              <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
65
+              <Card key={item.issueId} detail={item} stText={title} onClick={() => onClick(item)} />
66
             )}
66
             )}
67
           />
67
           />
68
         </Tab>
68
         </Tab>

+ 11
- 4
src/pages/home/index.jsx Zobrazit soubor

3
 import Page from '@/layouts/index';
3
 import Page from '@/layouts/index';
4
 import { useModel } from '@/store';
4
 import { useModel } from '@/store';
5
 import MenuIcon from '@/components/MenuIcon';
5
 import MenuIcon from '@/components/MenuIcon';
6
-import { ROLE_INSPECTOR, ROLE_MANAGER } from '@/utils/user';
6
+import { ROLE_INSPECTOR, ROLE_MANAGER, ROLE_ORG_USER } from '@/utils/user';
7
 import Head from './components/Head';
7
 import Head from './components/Head';
8
 import BannerCard from './components/BannerCard';
8
 import BannerCard from './components/BannerCard';
9
 import './index.less';
9
 import './index.less';
16
   ],
16
   ],
17
 
17
 
18
   [ROLE_MANAGER]: [
18
   [ROLE_MANAGER]: [
19
-    { icon: 'icon9', text: '我的上报', link: '/pages/issue/list2/index?title=我的上报&mine=true' },
20
-    { icon: 'icon11', text: '消息通知', link: '' },
21
-    { icon: 'icon10', text: '模拟测评', link: '' },
22
     { icon: 'icon1', text: '待 交 办', link: '/pages/issue/list2/index?title=待交办&bizStatus=start' },
19
     { icon: 'icon1', text: '待 交 办', link: '/pages/issue/list2/index?title=待交办&bizStatus=start' },
23
     { icon: 'icon2', text: '已 交 办', link: '/pages/issue/list2/index?title=已交办&bizStatus=assigned' },
20
     { icon: 'icon2', text: '已 交 办', link: '/pages/issue/list2/index?title=已交办&bizStatus=assigned' },
24
     { icon: 'icon3', text: '已 办 结', link: '/pages/issue/list2/index?title=已办结报&bizStatus=end' },
21
     { icon: 'icon3', text: '已 办 结', link: '/pages/issue/list2/index?title=已办结报&bizStatus=end' },
26
     { icon: 'icon5', text: '逾期警告', link: '/pages/issue/list2/index?title=逾期警告&bizStatus=expired' },
23
     { icon: 'icon5', text: '逾期警告', link: '/pages/issue/list2/index?title=逾期警告&bizStatus=expired' },
27
     { icon: 'icon6', text: '延期申请', link: '/pages/apply/list/index?title=延期申请&applyType=delay' },
24
     { icon: 'icon6', text: '延期申请', link: '/pages/apply/list/index?title=延期申请&applyType=delay' },
28
     { icon: 'icon7', text: '统计查询', link: '' },
25
     { icon: 'icon7', text: '统计查询', link: '' },
26
+    { icon: 'icon9', text: '我的上报', link: '/pages/issue/list2/index?title=我的上报&mine=true' },
27
+    { icon: 'icon11', text: '消息通知', link: '' },
28
+  ],
29
+
30
+  [ROLE_ORG_USER]: [
31
+    { icon: 'icon2', text: '处 理 中', link: '/pages/org/issue/list/index?title=处理中&bizStatus=assigned' },
32
+    { icon: 'icon3', text: '已 办 结', link: '/pages/org/issue/list/index?title=已办结报&bizStatus=end' },
33
+    { icon: 'icon5', text: '已 逾 期', link: '' },
34
+    { icon: 'icon7', text: '统计查询', link: '' },
35
+    { icon: 'icon11', text: '消息通知', link: '/pages/message/list/index' },
29
   ]
36
   ]
30
 }
37
 }
31
 
38
 

+ 29
- 0
src/pages/issue/components/Issue/index.jsx Zobrazit soubor

11
 import { getIssueStatus } from '@/utils/biz';
11
 import { getIssueStatus } from '@/utils/biz';
12
 import { getDateStr } from '@/utils/date';
12
 import { getDateStr } from '@/utils/date';
13
 import mapIcon from '@/assets/icons/marker.png';
13
 import mapIcon from '@/assets/icons/marker.png';
14
+import { getIssueProcess } from '@/services/taissue';
14
 
15
 
15
 const today = new Date();
16
 const today = new Date();
16
 
17
 
39
   const [showOrgPicker, setShowOrgPicker] = React.useState(false);
40
   const [showOrgPicker, setShowOrgPicker] = React.useState(false);
40
   const [showDatePicker, setShowDatePicker] = React.useState(false);
41
   const [showDatePicker, setShowDatePicker] = React.useState(false);
41
   const [bizStatus, setBizStatus] = React.useState();
42
   const [bizStatus, setBizStatus] = React.useState();
43
+  const [issueProcess, setIssueProcess] = React.useState([]);
42
   
44
   
45
+  const issueReject = React.useMemo(() => {
46
+    if (!issueProcess || !issueProcess.length) return {};
47
+
48
+    return issueProcess.filter(x => x.processStatus === 'reject')[0] || {};
49
+  }, [issueProcess]);
50
+    
43
   const onLocTypeChange = (_, it) => {
51
   const onLocTypeChange = (_, it) => {
44
     setFormData({
52
     setFormData({
45
       ...formData,
53
       ...formData,
87
     if (issue) {
95
     if (issue) {
88
       setFormData(issue);
96
       setFormData(issue);
89
       setBizStatus(getIssueStatus(issue));
97
       setBizStatus(getIssueStatus(issue));
98
+      
99
+      if (issue.processStatus == 'reject') {
100
+        getIssueProcess({pageSize: 100, issueId: issue.issueId}).then(res => {
101
+          setIssueProcess(res.records || []);
102
+        })
103
+      }
90
     }
104
     }
91
   }, [issue]);
105
   }, [issue]);
92
   
106
   
147
               title="状态"
161
               title="状态"
148
               value={bizStatus.label}
162
               value={bizStatus.label}
149
             />
163
             />
164
+
165
+          {
166
+            issueReject.processId && (
167
+              <>
168
+                <Cell title="驳回原因" />        
169
+                <Field
170
+                  readonly
171
+                  type="textarea"
172
+                  autosize={{ minHeight: '120px' }}
173
+                  value={issueReject.processResult}
174
+                />
175
+              </>
176
+            )
177
+          }
150
           </CellGroup>
178
           </CellGroup>
151
         )
179
         )
152
       }
180
       }
181
+      
153
 
182
 
154
       <CellGroup style={{marginTop: '20px'}}>
183
       <CellGroup style={{marginTop: '20px'}}>
155
         <Cell
184
         <Cell

+ 22
- 99
src/pages/issue/edit/components/Assigned.jsx Zobrazit soubor

1
 import React from 'react';
1
 import React from 'react';
2
 import Taro from '@tarojs/taro';
2
 import Taro from '@tarojs/taro';
3
 import { View } from '@tarojs/components';
3
 import { View } from '@tarojs/components';
4
-import { Button, Popup, CellGroup, Cell, Field } from '@antmjs/vantui';
5
-import { postIssueAssigned, deleteTaIssue, postIssueRejct } from '@/services/taissue';
4
+import { Button } from '@antmjs/vantui';
5
+import { postIssueAssigned, putTaIssue } from '@/services/taissue';
6
 import { warn } from '@/utils/message';
6
 import { warn } from '@/utils/message';
7
-import style from './style.module.less';
8
 
7
 
9
 export default (props) => {
8
 export default (props) => {
10
 
9
 
11
   const { issue, formData } = props;
10
   const { issue, formData } = props;
12
 
11
 
13
   const [loading1, setLoading1] = React.useState(false);
12
   const [loading1, setLoading1] = React.useState(false);
14
-  const [loading2, setLoading2] = React.useState(false);
15
-  const [loading3, setLoading3] = React.useState(false);
16
-  const [show, setShow] = React.useState(false);
17
-  const [processResult, setProcessResult] = React.useState();
18
   
13
   
19
   // 交办
14
   // 交办
20
   const onAssigned = () => {
15
   const onAssigned = () => {
31
     }
26
     }
32
 
27
 
33
     setLoading1(true)
28
     setLoading1(true)
34
-    postIssueAssigned({ ...issue, formData }).then(() => {
35
-      setLoading1(false);
36
-      Taro.navigateBack({delta: 1});
37
-    }).catch(() => {
38
-      setLoading1(false);
39
-    })
40
-  }
41
-
42
-  const onDelete = () => {
43
-    Taro.showModal({
44
-      title: '删除',
45
-      content: '确定进行删除操作?',
46
-      success (res) {
47
-        if (res.confirm) {
48
-          setLoading2(true)
49
-          deleteTaIssue(issue.issueId).then(() => {
50
-            setLoading2(false);
51
-            Taro.navigateBack({delta: 1});
52
-          }).catch(() => {
53
-            setLoading2(false);
54
-          })
55
-        }
56
-      }
57
-    })
58
-  }
59
-
60
-  const onReject = () => {
61
-    try {
62
-      warn(!processResult, '请填写退单理由')
63
-    } catch (e) {
64
-      return;
65
-    }
66
-
67
-    setShow(false);
68
 
29
 
69
-    const data = {
70
-      processResult,
71
-      issueId: issue.issueId,
72
-    }
73
-
74
-    setLoading3(true)
75
-    postIssueRejct(data).then(() => {
76
-      setLoading3(false);
77
-      Taro.navigateBack({delta: 1});
30
+    const data = { ...issue, ... formData };
31
+
32
+    // 先提交修改
33
+    putTaIssue(issue.issueId, data).then(() => {
34
+      // 再提交交办
35
+      postIssueAssigned(data).then(() => {
36
+        setLoading1(false);
37
+        Taro.navigateBack({delta: 1});
38
+      }).catch(() => {
39
+        setLoading1(false);
40
+      })
78
     }).catch(() => {
41
     }).catch(() => {
79
-      setLoading3(false);
42
+      setLoading1(false);
80
     })
43
     })
81
   }
44
   }
82
-  
45
+ 
83
   return (
46
   return (
84
-    <View class={style['assigned-btn-wrapper']}>
85
-      <Popup position="bottom" show={show} onClose={() => setShow(false)}>
86
-        <CellGroup>
87
-          <Cell title="退单理由" />
88
-          <Field
89
-            type="textarea"
90
-            placeholder="请输入退单理由"
91
-            value={processResult}
92
-            autosize={{ minHeight: '240px' }}
93
-            onChange={e => setProcessResult(e.detail)}
94
-          />
95
-          <View style={{display: 'flex', justifyContent: 'space-around'}}>
96
-            <Button plain type="default" onClick={() => setShow(false)}>取消</Button>
97
-            <Button plain type="primary" onClick={onReject}>确定</Button>
98
-          </View>
99
-        </CellGroup>
100
-      </Popup>
101
-      <View>          
102
-        <Button
103
-          block
104
-          type="primary"
105
-          loading={loading1}
106
-          disabled={loading2 && loading3}
107
-          onClick={onAssigned}
108
-        >交办</Button>
109
-      </View>
110
-      <View style={{marginTop: '20px', display: 'flex'}}>
111
-        <Button
112
-          plain
113
-          hairline
114
-          type="danger"
115
-          loading={loading2}
116
-          disabled={loading1 && loading3}
117
-          style={{ flex: 1 }}
118
-          onClick={onDelete}
119
-        >删除</Button>
120
-        <Button
121
-          plain
122
-          hairline
123
-          type="info"
124
-          loading={loading3}
125
-          disabled={loading1 && loading2}
126
-          style={{ flex: 1, marginLeft: 'var(--main-space)' }}
127
-          onClick={() => setShow(true)}
128
-        >退单</Button>
129
-      </View>
130
-    </View>
47
+    <Button
48
+      block
49
+      type="primary"
50
+      loading={loading1}
51
+      onClick={onAssigned}
52
+      style={{marginTop: '20px'}}
53
+    >交办</Button>
131
   )
54
   )
132
 }
55
 }

+ 98
- 0
src/pages/issue/edit/components/Cancel.jsx Zobrazit soubor

1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components';
4
+import { Button, Popup, CellGroup, Cell, Field } from '@antmjs/vantui';
5
+import { deleteTaIssue, postIssueRejct } from '@/services/taissue';
6
+import { warn } from '@/utils/message';
7
+
8
+export default (props) => {
9
+
10
+  const { issue } = props;
11
+
12
+  const [loading2, setLoading2] = React.useState(false);
13
+  const [loading3, setLoading3] = React.useState(false);
14
+  const [show, setShow] = React.useState(false);
15
+  const [processResult, setProcessResult] = React.useState();
16
+  
17
+  const onDelete = () => {
18
+    Taro.showModal({
19
+      title: '删除',
20
+      content: '确定进行删除操作?',
21
+      success (res) {
22
+        if (res.confirm) {
23
+          setLoading2(true)
24
+          deleteTaIssue(issue.issueId).then(() => {
25
+            setLoading2(false);
26
+            Taro.navigateBack({delta: 1});
27
+          }).catch(() => {
28
+            setLoading2(false);
29
+          })
30
+        }
31
+      }
32
+    })
33
+  }
34
+
35
+  const onReject = () => {
36
+    try {
37
+      warn(!processResult, '请填写退单理由')
38
+    } catch (e) {
39
+      return;
40
+    }
41
+
42
+    setShow(false);
43
+
44
+    const data = {
45
+      processResult,
46
+      issueId: issue.issueId,
47
+    }
48
+
49
+    setLoading3(true)
50
+    postIssueRejct(data).then(() => {
51
+      setLoading3(false);
52
+      Taro.navigateBack({delta: 1});
53
+    }).catch(() => {
54
+      setLoading3(false);
55
+    })
56
+  }
57
+  
58
+  return (
59
+    <>
60
+      <Popup position="bottom" show={show} onClose={() => setShow(false)}>
61
+        <CellGroup>
62
+          <Cell title="退单理由" />
63
+          <Field
64
+            type="textarea"
65
+            placeholder="请输入退单理由"
66
+            value={processResult}
67
+            autosize={{ minHeight: '240px' }}
68
+            onChange={e => setProcessResult(e.detail)}
69
+          />
70
+          <View style={{display: 'flex', justifyContent: 'space-around'}}>
71
+            <Button plain type="default" onClick={() => setShow(false)}>取消</Button>
72
+            <Button plain type="primary" onClick={onReject}>确定</Button>
73
+          </View>
74
+        </CellGroup>
75
+      </Popup>
76
+      <View style={{marginTop: '20px', display: 'flex'}}>
77
+        <Button
78
+          plain
79
+          hairline
80
+          type="danger"
81
+          loading={loading2}
82
+          disabled={loading3}
83
+          style={{ flex: 1 }}
84
+          onClick={onDelete}
85
+        >删除</Button>
86
+        <Button
87
+          plain
88
+          hairline
89
+          type="info"
90
+          loading={loading3}
91
+          disabled={loading2}
92
+          style={{ flex: 1, marginLeft: 'var(--main-space)' }}
93
+          onClick={() => setShow(true)}
94
+        >退单</Button>
95
+      </View>
96
+    </>
97
+  )
98
+}

+ 16
- 4
src/pages/issue/edit/components/Edit.jsx Zobrazit soubor

26
     setLoading(true)
26
     setLoading(true)
27
     putTaIssue(issue.issueId, { ...issue, formData }).then(() => {
27
     putTaIssue(issue.issueId, { ...issue, formData }).then(() => {
28
       setLoading(false);
28
       setLoading(false);
29
-      Taro.navigateBack({delta: 1});
29
+      Taro.navigateBack({
30
+        delta: 1,
31
+        fail: () => {
32
+          Taro.reLaunch({
33
+            url: 'pages/home/index'
34
+          })
35
+        } 
36
+      });
30
     }).catch(() => {
37
     }).catch(() => {
31
       setLoading(false);
38
       setLoading(false);
32
     })
39
     })
33
   }
40
   }
34
   
41
   
35
   return (
42
   return (
36
-    <View style={{ padding: '0 1em' }}>
37
-      <Button block type="primary" loading={loading} onClick={onSubmit}>修改</Button>
38
-    </View>
43
+    <Button
44
+      block
45
+      plain
46
+      hairline
47
+      type="primary"
48
+      loading={loading}
49
+      onClick={onSubmit}
50
+    >修改</Button>
39
   )
51
   )
40
 }
52
 }

+ 0
- 126
src/pages/issue/edit/components/Form.jsx Zobrazit soubor

1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View } from '@tarojs/components';
4
-import { Button, Notify, Field, Cell, CellGroup } from '@antmjs/vantui';
5
-import LocType from '@/components/LocType';
6
-import IssueType from '@/components/IssueType';
7
-import Map from '@/components/map';
8
-import Uploader from '@/components/Uploader/index';
9
-import mapIcon from '@/assets/icons/marker.png';
10
-
11
-export default (props) => {
12
-  const { issue, renderAction } = props;
13
-
14
-  const [formData, setFormData] = React.useState({
15
-    typeId: undefined,
16
-    typeName: undefined,
17
-    locId: undefined,
18
-    locName: undefined,
19
-    location: undefined,
20
-    addr: undefined,
21
-    content: undefined,
22
-    attachList: [],
23
-  });
24
-  const [showLocType, setShowLocType] = React.useState(false);
25
-  const [showIssueType, setShowIssueType] = React.useState(false);
26
-  
27
-  const onLocTypeChange = (_, it) => {
28
-    setFormData({
29
-      ...formData,
30
-      locId: it.typeId,
31
-      locName: it.name,
32
-    });
33
-    setShowLocType(false);
34
-  }
35
-
36
-  const onIssueTypeChange = (_, it) => {
37
-    setFormData({
38
-      ...formData,
39
-      typeId: it.typeId,
40
-      typeName: it.name,
41
-    });
42
-    setShowIssueType(false);
43
-  }
44
-
45
-  const onFieldChange = (field, value) => {
46
-    setFormData({
47
-      ...formData,
48
-      [field]: value,
49
-    })
50
-  }
51
-
52
-  React.useEffect(() => {
53
-    if (issue) {
54
-      setFormData(issue);
55
-    }
56
-  }, [issue]);
57
-  
58
-  return (
59
-    <View>
60
-      <LocType
61
-        show={showLocType}
62
-        value={formData.addr}
63
-        onCancel={() => setShowLocType(false)}
64
-        onChange={onLocTypeChange}
65
-      />
66
-
67
-      <IssueType
68
-        show={showIssueType}
69
-        value={formData.typeName}
70
-        onCancel={() => setShowIssueType(false)}
71
-        onChange={onIssueTypeChange}
72
-      />
73
-
74
-      <Map location={formData.location} />
75
-
76
-      <CellGroup>
77
-        <Cell
78
-          isLink
79
-          title="点位"
80
-          value={formData.locName}
81
-          onClick={() => setShowLocType(true)}
82
-        />
83
-        <Field
84
-          value={formData.addr}
85
-          leftIcon={mapIcon}
86
-          placeholder="请输入地址"
87
-          onChange={e => onFieldChange('addr', e.detail)}
88
-        />
89
-      </CellGroup>
90
-
91
-      <CellGroup style={{marginTop: '20px'}}>
92
-
93
-        <Cell
94
-          isLink
95
-          title="问题分类"
96
-          style={{marginTop: '20px'}}
97
-          value={formData.typeName}
98
-          onClick={() => setShowIssueType(true)}
99
-        />
100
-        <Cell title="问题描述" border={false} />
101
-
102
-        <Field
103
-          type="textarea"
104
-          placeholder="请输入问题描述"
105
-          autosize={{ minHeight: '120px' }}
106
-          value={formData.content}
107
-          onChange={e => onFieldChange('content', e.detail)}
108
-        />
109
-      </CellGroup>
110
-            
111
-      <CellGroup style={{marginTop: '20px'}}>        
112
-        <Cell title="拍照或视频" border={false} />
113
-
114
-        <Cell
115
-          renderTitle={
116
-            <Uploader value={formData.attachList} onChange={e => onFieldChange('attachList',e)} />
117
-          }
118
-        />
119
-      </CellGroup>
120
-
121
-      <View style={{margin: '20px auto'}}>
122
-        {renderAction(formData)}
123
-      </View>
124
-    </View>
125
-  )
126
-}

+ 9
- 4
src/pages/issue/edit/components/Save.jsx Zobrazit soubor

26
     setLoading(true)
26
     setLoading(true)
27
     postTaIssue(formData).then(() => {
27
     postTaIssue(formData).then(() => {
28
       setLoading(false);
28
       setLoading(false);
29
-      Taro.navigateBack({delta: 1});
29
+      Taro.navigateBack({
30
+        delta: 1,
31
+        fail: () => {
32
+          Taro.reLaunch({
33
+            url: '/pages/home/index'
34
+          });
35
+        }
36
+      });
30
     }).catch(() => {
37
     }).catch(() => {
31
       setLoading(false);
38
       setLoading(false);
32
     })
39
     })
33
   }
40
   }
34
   
41
   
35
   return (
42
   return (
36
-    <View style={{ padding: '0 1em' }}>
37
-      <Button block type="primary" loading={loading} onClick={onSubmit}>提交</Button>
38
-    </View>
43
+    <Button block type="primary" loading={loading} onClick={onSubmit}>提交</Button>
39
   )
44
   )
40
 }
45
 }

+ 0
- 6
src/pages/issue/edit/components/style.module.less Zobrazit soubor

1
-
2
-
3
-.assigned-btn-wrapper {
4
-  background: #fff;
5
-  padding: var(--main-space);  
6
-}

+ 1
- 0
src/pages/issue/edit/index.config.js Zobrazit soubor

1
+// eslint-disable-next-line no-undef
1
 export default definePageConfig({
2
 export default definePageConfig({
2
   navigationBarTitleText: '我要上报'
3
   navigationBarTitleText: '我要上报'
3
 })
4
 })

+ 53
- 8
src/pages/issue/edit/index.jsx Zobrazit soubor

1
 import React from 'react';
1
 import React from 'react';
2
 import Taro from '@tarojs/taro';
2
 import Taro from '@tarojs/taro';
3
-import { Block } from '@tarojs/components';
3
+import { View } from '@tarojs/components';
4
 import { CellGroup, Cell } from '@antmjs/vantui';
4
 import { CellGroup, Cell } from '@antmjs/vantui';
5
 import Page from '@/layouts/index';
5
 import Page from '@/layouts/index';
6
+import { useModel } from '@/store';
6
 import { ROLE_INSPECTOR, ROLE_MANAGER } from '@/utils/user';
7
 import { ROLE_INSPECTOR, ROLE_MANAGER } from '@/utils/user';
7
 import { getTaIssueById } from '@/services/taissue';
8
 import { getTaIssueById } from '@/services/taissue';
8
 import IssueForm from '../components/Issue';
9
 import IssueForm from '../components/Issue';
9
 import Save from './components/Save';
10
 import Save from './components/Save';
10
 import Edit from './components/Edit';
11
 import Edit from './components/Edit';
11
 import Assigned from './components/Assigned';
12
 import Assigned from './components/Assigned';
13
+import Cancel from './components/Cancel';
12
 
14
 
13
 export default (props) => {
15
 export default (props) => {
14
 
16
 
15
   const router = Taro.useRouter();
17
   const router = Taro.useRouter();
16
   const { id, act } = router.params;
18
   const { id, act } = router.params;
17
 
19
 
20
+  const { user } = useModel('user');
21
+
18
   const [loading, setLoading] = React.useState(false);
22
   const [loading, setLoading] = React.useState(false);
19
   const [issue, setIssue] = React.useState();
23
   const [issue, setIssue] = React.useState();
20
 
24
 
25
+  // 各按钮状态
26
+  const [
27
+    readOnly,
28
+    canEdit,
29
+    canAssigned,
30
+    canCancel,
31
+  ] = React.useMemo(() => {
32
+    if (!issue) return [];
33
+    if (!user) return [];
34
+
35
+    // 如果是督察员
36
+    if (user.dutyList.indexOf(ROLE_INSPECTOR) > -1) {
37
+      return [
38
+        issue.processNode != 'start' && issue.processStatus != 'reject',
39
+        issue.processNode == 'start' || issue.processStatus == 'reject',
40
+        false,
41
+        false,
42
+      ]
43
+    }
44
+
45
+    // 如果是管理员
46
+    if (user?.dutyList.indexOf(ROLE_MANAGER) > -1) {
47
+      return [
48
+        issue.processNode != 'start',
49
+        false,
50
+        issue.processNode == 'start',
51
+        issue.processNode == 'start',
52
+      ]
53
+    }
54
+
55
+    return [];
56
+  }, [issue, user]);
57
+
58
+  const onIssueChange = (val = {}) => {
59
+    setIssue({
60
+      ...(issue || {}),
61
+      ...val,
62
+    })
63
+  }
64
+  
21
   React.useEffect(() => {
65
   React.useEffect(() => {
22
     if (id) {
66
     if (id) {
23
       setLoading(true)
67
       setLoading(true)
34
     <Page roles={[ROLE_INSPECTOR, ROLE_MANAGER]} loading={loading}>
78
     <Page roles={[ROLE_INSPECTOR, ROLE_MANAGER]} loading={loading}>
35
       <IssueForm
79
       <IssueForm
36
         issue={issue}
80
         issue={issue}
37
-        readOnly={id&&!act}
38
-        showOrg={act === 'assigned'}
39
-        showExpireDate={act === 'assigned'}
81
+        readOnly={readOnly}
82
+        showOrg={canAssigned}
83
+        showExpireDate={canAssigned}
40
         renderAction={(formData) => (
84
         renderAction={(formData) => (
41
-          <Block>
85
+          <View style={{ padding: 'var(--main-space)', background: '#fff' }}>
42
             {!id && <Save formData={formData} />}
86
             {!id && <Save formData={formData} />}
43
-            {act === 'edit' && <Edit issue={issue} formData={formData} />}
44
-            {act === 'assigned' && <Assigned issue={issue} formData={formData} />}
45
-          </Block>
87
+            {canEdit && <Edit issue={issue} formData={formData} />}
88
+            {canAssigned && <Assigned issue={issue} formData={formData} />}
89
+            {canCancel && <Cancel issue={issue} />}
90
+          </View>
46
         )}
91
         )}
47
       />
92
       />
48
     </Page>
93
     </Page>

+ 8
- 25
src/pages/issue/list/index.jsx Zobrazit soubor

12
 
12
 
13
 // 只有督察员能看到当前页面
13
 // 只有督察员能看到当前页面
14
 export default (props) => {
14
 export default (props) => {
15
-  const { user } = useModel('user');
15
+  // const { user } = useModel('user');
16
 
16
 
17
   const onClick = (item) => {
17
   const onClick = (item) => {
18
-    let act = '';
19
-    const status = getIssueStatus(item);
20
-    
21
-    // 如果是管理员
22
-    if (user.dutyList.indexOf(ROLE_MANAGER) > -1) {
23
-      // 如果是待交办
24
-      if (status.value === 0) {
25
-        act = 'assigned';
26
-      }
27
-    } else if (user.dutyList.indexOf(ROLE_INSPECTOR) > -1) {
28
-      // 如果是待交办
29
-      if (status.value === 0) {
30
-        act = 'edit';
31
-      }
32
-    }
33
-
34
     Taro.navigateTo({
18
     Taro.navigateTo({
35
-      url: `/pages/issue/edit/index?id=${item.issueId}&act=${act}`
19
+      url: `/pages/issue/edit/index?id=${item.issueId}`
36
     })
20
     })
37
   }
21
   }
38
   
22
   
39
   return (
23
   return (
40
-    <Page>
24
+    <Page roles={[ROLE_INSPECTOR]}>
41
       <Tabs sticky>
25
       <Tabs sticky>
42
         <Tab title="全部">
26
         <Tab title="全部">
43
           <PowerList
27
           <PowerList
44
             request={getTaIssue}
28
             request={getTaIssue}
45
-            params={{mine: true}}
46
             renderItem={(item) => (
29
             renderItem={(item) => (
47
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
30
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
48
             )}
31
             )}
51
         <Tab title="未交办">
34
         <Tab title="未交办">
52
           <PowerList
35
           <PowerList
53
             request={getTaIssue}
36
             request={getTaIssue}
54
-            params={{bizStatus: 'start', mine: true}}
37
+            params={{bizStatus: 'start'}}
55
             renderItem={(item) => (
38
             renderItem={(item) => (
56
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
39
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
57
             )}
40
             )}
60
         <Tab title="已交办">
43
         <Tab title="已交办">
61
           <PowerList
44
           <PowerList
62
             request={getTaIssue}
45
             request={getTaIssue}
63
-            params={{bizStatus: 'start', mine: true}}
46
+            params={{bizStatus: 'assigned'}}
64
             renderItem={(item) => (
47
             renderItem={(item) => (
65
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
48
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
66
             )}
49
             )}
69
         <Tab title="已办结">
52
         <Tab title="已办结">
70
           <PowerList
53
           <PowerList
71
             request={getTaIssue}
54
             request={getTaIssue}
72
-            params={{bizStatus: 'end', mine: true}}
55
+            params={{bizStatus: 'end'}}
73
             renderItem={(item) => (
56
             renderItem={(item) => (
74
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
57
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
75
             )}
58
             )}
78
         <Tab title="已逾期">
61
         <Tab title="已逾期">
79
           <PowerList
62
           <PowerList
80
             request={getTaIssue}
63
             request={getTaIssue}
81
-            params={{bizStatus: 'expired', mine: true}}
64
+            params={{bizStatus: 'expired'}}
82
             renderItem={(item) => (
65
             renderItem={(item) => (
83
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
66
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
84
             )}
67
             )}
87
         <Tab title="已打回">
70
         <Tab title="已打回">
88
           <PowerList
71
           <PowerList
89
             request={getTaIssue}
72
             request={getTaIssue}
90
-            params={{bizStatus: 'reject', mine: true}}
73
+            params={{bizStatus: 'reject'}}
91
             renderItem={(item) => (
74
             renderItem={(item) => (
92
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
75
               <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
93
             )}
76
             )}

+ 46
- 0
src/pages/message/list/components/Card.jsx Zobrazit soubor

1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components';
4
+import { Cell } from '@antmjs/vantui';
5
+import { getDtStr } from '@/utils/date';
6
+import style from './card.module.less';
7
+
8
+export default (props) => {
9
+  const { item } = props;
10
+
11
+  const url = React.useMemo(() => {
12
+    if (item.targetType == 'issue') {
13
+
14
+    } else if (item.targetType == 'apply') {
15
+
16
+    }
17
+
18
+    return '';
19
+  }, [item])
20
+  
21
+  return (
22
+    <View className={style['msg-card-wrapper']}>
23
+      <Cell
24
+        isLink
25
+        url={url}
26
+        renderTitle={(
27
+          <View style={{ display: 'flex', justifyContent: 'space-between' }}>
28
+            <View>
29
+              {item?.title}
30
+            </View>
31
+            <View>
32
+              {getDtStr(item?.createDate)}
33
+            </View>
34
+          </View>
35
+        )}
36
+        renderLabel={(
37
+          <View style={{ width: '100%' }}>
38
+            <View>
39
+              {item?.content}
40
+            </View>
41
+          </View>
42
+        )}
43
+      />
44
+    </View>
45
+  )
46
+}

+ 8
- 0
src/pages/message/list/components/card.module.less Zobrazit soubor

1
+
2
+.msg-card-wrapper {
3
+  background: #FFFFFF;
4
+  box-shadow: 0px 9px 11px 0px rgba(0,0,0,0.06);
5
+  border-radius: 8px;
6
+  width: calc(100% - var(--main-space) * 2);
7
+  margin: var(--main-space);
8
+}

+ 4
- 0
src/pages/message/list/index.config.js Zobrazit soubor

1
+// eslint-disable-next-line no-undef
2
+export default definePageConfig({
3
+  navigationBarTitleText: '消息列表'
4
+})

+ 22
- 0
src/pages/message/list/index.jsx Zobrazit soubor

1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components';
4
+import Page from '@/layouts/index';
5
+import PowerList from '@/components/PowerList';
6
+import { getTaMessage } from '@/services/tamessage';
7
+import Card from './components/Card';
8
+
9
+export default (props) => {
10
+
11
+  
12
+  return (
13
+    <Page>
14
+      <PowerList
15
+        request={getTaMessage}
16
+        renderItem={(item) => (
17
+          <Card key={item.msgId} item={item} />
18
+        )}
19
+      />
20
+    </Page>
21
+  )
22
+}

+ 1
- 1
src/pages/org/components/issue-info/index.jsx Zobrazit soubor

3
 import { View } from '@tarojs/components';
3
 import { View } from '@tarojs/components';
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 { getDtStr } from '@/utils/date';
6
 
7
 
7
-const getDtStr = dt => !dt ? '' : dt.replace('T', ' ').substring(0, 16)
8
 export default (props) => {
8
 export default (props) => {
9
   const { issue } = props;
9
   const { issue } = props;
10
   return (
10
   return (

+ 1
- 1
src/pages/org/issue/detail/components/Apply.jsx Zobrazit soubor

46
 
46
 
47
   const onSubmit = () => {
47
   const onSubmit = () => {
48
     try {
48
     try {
49
-      warn(!orgIssue || !orgIssue.issueId, '未找问题单');
49
+      warn(!orgIssue || !orgIssue.issueId, '未找问题单');
50
       if (applyType === 'delay') {
50
       if (applyType === 'delay') {
51
         warn(!formData.content, '请选择延期时间');
51
         warn(!formData.content, '请选择延期时间');
52
       }
52
       }

+ 69
- 34
src/pages/org/issue/detail/index.jsx Zobrazit soubor

10
 import IssueInfo from '../../components/issue-info';
10
 import IssueInfo from '../../components/issue-info';
11
 import Apply from './components/Apply';
11
 import Apply from './components/Apply';
12
 
12
 
13
+const status = {
14
+  delay: '延期申请中',
15
+  reject: '驳回申请中',
16
+  end: '办结申请中',
17
+}
18
+
13
 export default (props) => {
19
 export default (props) => {
14
 
20
 
15
   const router = Taro.useRouter();
21
   const router = Taro.useRouter();
19
   const [issue, setIssue] = React.useState();
25
   const [issue, setIssue] = React.useState();
20
   const [orgIssue, setOrgIssue] = React.useState({});
26
   const [orgIssue, setOrgIssue] = React.useState({});
21
 
27
 
22
-  const showEditBtn = React.useMemo(() => !orgIssue.result, [orgIssue.issueId]);
28
+  const [
29
+    readOnly,
30
+    statusTxt,
31
+    showEditBtn,
32
+  ] = React.useMemo(() => {
33
+    if (!orgIssue.issueId) return [];
34
+
35
+    return [
36
+      issue?.applyId,
37
+      status[orgIssue.result],
38
+      orgIssue.processStatus == 'start' && !issue?.applyId
39
+    ]
40
+
41
+  }, [issue, orgIssue.issueId]);
23
 
42
 
24
   const setFormData = (key, value) => {
43
   const setFormData = (key, value) => {
25
     setOrgIssue({
44
     setOrgIssue({
49
         <Cell title="整改结果" />
68
         <Cell title="整改结果" />
50
         <Field
69
         <Field
51
           type="textarea"
70
           type="textarea"
71
+          readonly={readOnly}
52
           autosize={{ minHeight: '120px' }}
72
           autosize={{ minHeight: '120px' }}
53
           value={orgIssue.result}
73
           value={orgIssue.result}
54
           onChange={e => setFormData('result', e.detail)}
74
           onChange={e => setFormData('result', e.detail)}
59
 
79
 
60
         <Cell
80
         <Cell
61
           renderTitle={
81
           renderTitle={
62
-            <Uploader value={orgIssue.attachList} onChange={e => setFormData('attachList',e)} />
82
+            <Uploader disabled={readOnly} value={orgIssue.attachList} onChange={e => setFormData('attachList',e)} />
63
           }
83
           }
64
         />
84
         />
65
       </CellGroup>
85
       </CellGroup>
66
-      <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
67
-        <View>
68
-          {
69
-            showEditBtn ?
70
-              <Button block type="primary">保存修改</Button> :
71
-              <Apply block type="primary" applyType="end">申请办结</Apply>
72
-          }
73
-        </View>
74
-        {
75
-          !showEditBtn && (
76
-            <View style={{marginTop: '20px'}}>
77
-              <Apply block type="primary" applyType="org-verify">申请审核</Apply>
86
+
87
+      {
88
+        readOnly && (
89
+          <CellGroup style={{marginTop: '20px'}}>
90
+            <Cell title="状态" value={statusTxt} />
91
+          </CellGroup>
92
+        )
93
+      }
94
+
95
+      {
96
+        !readOnly && (
97
+          <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
98
+            <View>
99
+              {
100
+                showEditBtn ?
101
+                  <Button block type="primary">保存修改</Button> :
102
+                  <Apply block type="primary" applyType="end" orgIssue={orgIssue}>申请办结</Apply>
103
+              }
104
+            </View>
105
+            {
106
+              !showEditBtn && (
107
+                <View style={{marginTop: '20px'}}>
108
+                  <Apply block type="primary" applyType="org-verify" orgIssue={orgIssue}>申请审核</Apply>
109
+                </View>
110
+              )
111
+            }
112
+            <View style={{marginTop: '20px', display: 'flex' }}>
113
+              <Apply
114
+                block
115
+                plain
116
+                hairline
117
+                type="info"
118
+                applyType="delay"
119
+                orgIssue={orgIssue}
120
+              >申请延期</Apply>
121
+              <Apply
122
+                block
123
+                plain
124
+                hairline
125
+                type="danger"
126
+                applyType="reject"
127
+                orgIssue={orgIssue}
128
+                style={{marginLeft: 'var(--main-space)'}}
129
+              >申请驳回</Apply>
78
             </View>
130
             </View>
79
-          )
80
-        }
81
-        <View style={{marginTop: '20px', display: 'flex' }}>
82
-          <Apply
83
-            block
84
-            plain
85
-            hairline
86
-            type="info"
87
-            applyType="delay"
88
-          >申请延期</Apply>
89
-          <Apply
90
-            block
91
-            plain
92
-            hairline
93
-            type="danger"
94
-            applyType="reject"
95
-            style={{marginLeft: 'var(--main-space)'}}
96
-          >申请驳回</Apply>
97
-        </View>
98
-      </View>
131
+          </View>
132
+        )
133
+      }
99
     </Page>
134
     </Page>
100
   )
135
   )
101
 }
136
 }

+ 4
- 13
src/pages/org/issue/list/index.jsx Zobrazit soubor

13
 export default (props) => {
13
 export default (props) => {
14
 
14
 
15
   const router = Taro.useRouter();
15
   const router = Taro.useRouter();
16
-  const { title, bizStatus } = router.params;
16
+  const { title, bizStatus, color } = router.params;
17
 
17
 
18
   React.useMemo(() => {
18
   React.useMemo(() => {
19
     if (title) {
19
     if (title) {
26
   // const { user } = useModel('user');
26
   // const { user } = useModel('user');
27
 
27
 
28
   const onClick = (item) => {
28
   const onClick = (item) => {
29
-
30
-    let act = '';
31
-    const status = getIssueStatus(item);
32
-
33
-    // 如果是待交办
34
-    if (status.value === 0) {
35
-      act = 'assigned';
36
-    }
37
-
38
     Taro.navigateTo({
29
     Taro.navigateTo({
39
-      url: `/pages/issue/edit/index?id=${item.issueId}&act=${act}`
30
+      url: `/pages/org/issue/detail/index?id=${item.issueId}`
40
     })
31
     })
41
   }
32
   }
42
   
33
   
48
             request={getTaOrgIssue}
39
             request={getTaOrgIssue}
49
             params={{bizStatus, sourceType: 'inspector'}}
40
             params={{bizStatus, sourceType: 'inspector'}}
50
             renderItem={(item) => (
41
             renderItem={(item) => (
51
-              <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
42
+              <Card key={item.issueId} detail={item} stText={title} color={color} onClick={() => onClick(item)} />
52
             )}
43
             )}
53
           />
44
           />
54
         </Tab>
45
         </Tab>
57
             request={getTaOrgIssue}
48
             request={getTaOrgIssue}
58
             params={{bizStatus, sourceType: 'feedback'}}
49
             params={{bizStatus, sourceType: 'feedback'}}
59
             renderItem={(item) => (
50
             renderItem={(item) => (
60
-              <Card key={item.issueId} detail={item} onClick={() => onClick(item)} />
51
+              <Card key={item.issueId} detail={item} stText={title} color={color} onClick={() => onClick(item)} />
61
             )}
52
             )}
62
           />
53
           />
63
         </Tab>
54
         </Tab>

+ 5
- 0
src/services/taissue.js Zobrazit soubor

34
  * 驳回
34
  * 驳回
35
  */
35
  */
36
 export const postIssueRejct = (data) => request('/api/taIssueProcess/reject', { data, method: 'post' });
36
 export const postIssueRejct = (data) => request('/api/taIssueProcess/reject', { data, method: 'post' });
37
+
38
+/*
39
+ * 获取所有流程节点
40
+ */
41
+export const getIssueProcess = (params) => request('/api/taIssueProcess', { params });

+ 29
- 0
src/services/tamessage.js Zobrazit soubor

1
+import request from '@/utils/request';
2
+
3
+/*
4
+ * 分页查询
5
+ */
6
+export const getTaMessage = (params) => request('/api/taMessage', { params });
7
+
8
+/*
9
+ * 新增数据
10
+ */
11
+export const postTaMessage = (data) => request('/api/taMessage', { data, method: 'post' });
12
+
13
+/*
14
+ * 通过ID查询单条数据
15
+ */
16
+export const getTaMessageById = (id) => request(`/api/taMessage/${id}`);
17
+
18
+/**
19
+ * 更新数据
20
+ * @param {*} id
21
+ * @param {*} data
22
+ * @returns
23
+ */
24
+export const putTaMessage = (id, data) => request(`/api/taMessage/${id}`, { data, method: 'put' });
25
+
26
+/*
27
+ * 通过主键删除数据
28
+ */
29
+export const deleteTaMessage = (id) => request(`/api/taMessage/${id}`, { method: 'delete' });

+ 6
- 6
src/utils/biz.js Zobrazit soubor

1
 import dayjs from 'dayjs';
1
 import dayjs from 'dayjs';
2
 
2
 
3
 export function getIssueStatus(taIssue) {
3
 export function getIssueStatus(taIssue) {
4
-  if (taIssue.processNode === 'start') {
4
+  if (taIssue.processStatus === 'reject') {
5
+    return {
6
+      value: 4,
7
+      label: '已打回',
8
+    };
9
+  } else if (taIssue.processNode === 'start') {
5
     return {
10
     return {
6
       value: 0,
11
       value: 0,
7
       label: '未交办',
12
       label: '未交办',
16
       value: 3,
21
       value: 3,
17
       label: '已逾期',
22
       label: '已逾期',
18
     };
23
     };
19
-  } else if (taIssue.processNode !== 'end' && taIssue.processStatus === 'reject') {
20
-    return {
21
-      value: 4,
22
-      label: '已打回',
23
-    };
24
   } else if (taIssue.processNode === 'assigned') {
24
   } else if (taIssue.processNode === 'assigned') {
25
     return {
25
     return {
26
       value: 1,
26
       value: 1,

+ 4
- 0
src/utils/date.js Zobrazit soubor

10
 
10
 
11
   return `${y}-${fill0(m)}-${fill0(d)}`
11
   return `${y}-${fill0(m)}-${fill0(d)}`
12
 }
12
 }
13
+
14
+export function getDtStr(dtStr) {
15
+  return !dtStr ? '' : dtStr.replace('T', ' ').substring(0, 16);
16
+}