Yansen 2 years ago
parent
commit
dcc04835a4

+ 1
- 1
src/app.config.js View File

9
     'pages/org/issue/list/index',
9
     'pages/org/issue/list/index',
10
     'pages/org/issue/detail/index',
10
     'pages/org/issue/detail/index',
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',
14
     'pages/apply/detail/index',
15
     'pages/message/list/index',
15
     'pages/message/list/index',

+ 9
- 7
src/components/Uploader/style.modules.less View File

1
 
1
 
2
 .uploader-wrapper {
2
 .uploader-wrapper {
3
   display: inline-block;
3
   display: inline-block;
4
+
4
   .uploader-box {
5
   .uploader-box {
5
-    display: flex;
6
+    display: grid;
7
+    grid-template-columns: repeat(3, 28vw);
8
+    column-gap: 4vw;
9
+    row-gap: 2vw;
6
 
10
 
7
     & > view {
11
     & > view {
8
       flex: none;
12
       flex: none;
9
-      width: 160px;
10
-      height: 160px;
13
+      width: 28vw;
14
+      height: 28vw;
15
+      margin-right: 20px;
16
+      margin-bottom: 20px;
11
       position: relative;
17
       position: relative;
12
 
18
 
13
       image {
19
       image {
19
         width: 100%;
25
         width: 100%;
20
         height: 100%;
26
         height: 100%;
21
       }
27
       }
22
-
23
-      & + view {
24
-        margin-left: 20px;
25
-      }
26
     }
28
     }
27
 
29
 
28
     .uploader-add {
30
     .uploader-add {

+ 3
- 2
src/pages/apply/apply/index.jsx View File

7
 import { getDateStr } from '@/utils/date';
7
 import { getDateStr } from '@/utils/date';
8
 import { postTaIssueApply } from '@/services/taissueapply';
8
 import { postTaIssueApply } from '@/services/taissueapply';
9
 import { warn } from '@/utils/message';
9
 import { warn } from '@/utils/message';
10
+import { PROCESS_APPLY_DELAY } from '@/utils/biz';
10
 import Issue from '../components/Issue';
11
 import Issue from '../components/Issue';
11
 import useTitle from '../useTitle';
12
 import useTitle from '../useTitle';
12
 
13
 
38
 
39
 
39
   const onSubmit = () => {
40
   const onSubmit = () => {
40
     try {
41
     try {
41
-      if (applyType == 'delay') {
42
+      if (applyType == PROCESS_APPLY_DELAY) {
42
         warn(!formData.content, '请选择延期时间');
43
         warn(!formData.content, '请选择延期时间');
43
       }
44
       }
44
       warn(!formData.remark, '请填写申请说明');
45
       warn(!formData.remark, '请填写申请说明');
77
 
78
 
78
       <CellGroup style={{marginTop: '20px'}}>
79
       <CellGroup style={{marginTop: '20px'}}>
79
         {
80
         {
80
-          applyType == 'delay' && (
81
+          applyType == PROCESS_APPLY_DELAY && (
81
             <Cell
82
             <Cell
82
               isLink
83
               isLink
83
               title="延期时间"
84
               title="延期时间"

+ 2
- 1
src/pages/apply/detail/index.jsx View File

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 { getDtStr } from '@/utils/date';
8
+import { PROCESS_APPLY_DELAY } from '@/utils/biz';
8
 import Issue from '../components/Issue';
9
 import Issue from '../components/Issue';
9
 import useTitle from '../useTitle';
10
 import useTitle from '../useTitle';
10
 
11
 
35
      
36
      
36
       <CellGroup style={{marginTop: '20px'}}>
37
       <CellGroup style={{marginTop: '20px'}}>
37
         {
38
         {
38
-          applyInfo.applyType == 'delay' && (
39
+          applyInfo.applyType == PROCESS_APPLY_DELAY && (
39
             <Cell
40
             <Cell
40
               title="延期日期"
41
               title="延期日期"
41
               value={applyInfo.content}
42
               value={applyInfo.content}

+ 2
- 2
src/pages/apply/list/index.jsx View File

52
             request={getTaIssueApply}
52
             request={getTaIssueApply}
53
             params={{applyType, sourceType: 'inspector'}}
53
             params={{applyType, sourceType: 'inspector'}}
54
             renderItem={(item) => (
54
             renderItem={(item) => (
55
-              <Card key={item.issueId} applyInfo={item} stText={title} onClick={() => onClick(item)} />
55
+              <Card key={item.applyId} applyInfo={item} stText={title} onClick={() => onClick(item)} />
56
             )}
56
             )}
57
           />
57
           />
58
         </Tab>
58
         </Tab>
61
             request={getTaIssueApply}
61
             request={getTaIssueApply}
62
             params={{applyType, sourceType: 'feedback'}}
62
             params={{applyType, sourceType: 'feedback'}}
63
             renderItem={(item) => (
63
             renderItem={(item) => (
64
-              <Card key={item.issueId} applyInfo={item} stText={title} onClick={() => onClick(item)} />
64
+              <Card key={item.applyId} applyInfo={item} stText={title} onClick={() => onClick(item)} />
65
             )}
65
             )}
66
           />
66
           />
67
         </Tab>
67
         </Tab>

+ 39
- 10
src/pages/apply/verify/index.jsx View File

3
 import { View } from '@tarojs/components';
3
 import { View } from '@tarojs/components';
4
 import Page from '@/layouts/index';
4
 import Page from '@/layouts/index';
5
 import { Cell, CellGroup, Field, Button, Radio, RadioGroup } from '@antmjs/vantui';
5
 import { Cell, CellGroup, Field, Button, Radio, RadioGroup } from '@antmjs/vantui';
6
+import Uploader from '@/components/Uploader/index';
6
 import { putTaIssueApply, getTaIssueApplyById } from '@/services/taissueapply';
7
 import { putTaIssueApply, getTaIssueApplyById } from '@/services/taissueapply';
7
 import { warn } from '@/utils/message';
8
 import { warn } from '@/utils/message';
9
+import { APPLY_PASS, APPLY_REJECT, PROCESS_APPLY_DELAY } from '@/utils/biz';
8
 import Issue from '../components/Issue';
10
 import Issue from '../components/Issue';
9
 import useTitle from '../useTitle';
11
 import useTitle from '../useTitle';
12
+import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
10
 
13
 
11
 // const today = new Date();
14
 // const today = new Date();
12
 export default (props) => {
15
 export default (props) => {
16
 
19
 
17
   const [loading, setLoading] = React.useState(false);
20
   const [loading, setLoading] = React.useState(false);
18
   const [applyInfo, setApplyInfo] = React.useState({});
21
   const [applyInfo, setApplyInfo] = React.useState({});
22
+  const [orgIssue, setOrgIssue] = React.useState({});
19
   
23
   
20
   const [submitting, setSubmitting] = React.useState(false);
24
   const [submitting, setSubmitting] = React.useState(false);
21
   const [formData, setFormData] = React.useState({});
25
   const [formData, setFormData] = React.useState({});
56
       setLoading(true);
60
       setLoading(true);
57
       getTaIssueApplyById(id).then(res => {
61
       getTaIssueApplyById(id).then(res => {
58
         setApplyInfo(res);
62
         setApplyInfo(res);
63
+
64
+        getTaOrgIssueByIssueId(res.issueId, res.orgId).then(r => {
65
+          setOrgIssue(r);
66
+        });
67
+
59
         setLoading(false);
68
         setLoading(false);
60
       }).catch(() => {
69
       }).catch(() => {
61
         setLoading(false);
70
         setLoading(false);
67
     <Page loading={loading}>
76
     <Page loading={loading}>
68
       <Issue issueId={issueId} />
77
       <Issue issueId={issueId} />
69
      
78
      
70
-      <CellGroup style={{marginTop: '20px'}}>
71
-        {
72
-          applyInfo.applyType == 'delay' && (
79
+     {
80
+        applyInfo.applyType == PROCESS_APPLY_DELAY && (
81
+          <CellGroup style={{marginTop: '20px'}}>
73
             <Cell
82
             <Cell
74
               title="延期日期"
83
               title="延期日期"
75
               value={applyInfo.content}
84
               value={applyInfo.content}
76
             />
85
             />
77
-          )
78
-        }
79
-        <Cell title="申请说明" />
86
+            <Cell title="申请说明" />
87
+            <Field
88
+              readonly
89
+              type="textarea"
90
+              autosize={{ minHeight: '120px' }}
91
+              value={applyInfo.remark}
92
+            />
93
+          </CellGroup>
94
+        )
95
+     }
96
+     
97
+      <CellGroup style={{marginTop: '20px'}}>
98
+        <Cell title="整改结果" />
80
         <Field
99
         <Field
81
           readonly
100
           readonly
82
           type="textarea"
101
           type="textarea"
83
           autosize={{ minHeight: '120px' }}
102
           autosize={{ minHeight: '120px' }}
84
-          value={applyInfo.remark}
103
+          value={orgIssue.result}
104
+        />
105
+
106
+        <Cell title="整改照片" border={false} />
107
+        <Cell
108
+          renderTitle={
109
+            <Uploader
110
+              disabled
111
+              value={orgIssue.attachList}
112
+            />
113
+          }
85
         />
114
         />
86
       </CellGroup>
115
       </CellGroup>
87
      
116
      
94
             value={formData.verifyStatus}
123
             value={formData.verifyStatus}
95
             onChange={(e) => setFieldValue('verifyStatus', e.detail)}
124
             onChange={(e) => setFieldValue('verifyStatus', e.detail)}
96
           >
125
           >
97
-            <Radio name="pass" checkedColor="var(--main-bg-color)">通过</Radio>
98
-            <Radio name="reject" checkedColor="red">驳回</Radio>
126
+            <Radio name={APPLY_PASS} checkedColor="var(--main-bg-color)">通过</Radio>
127
+            <Radio name={APPLY_REJECT} checkedColor="red">驳回</Radio>
99
           </RadioGroup>
128
           </RadioGroup>
100
         </Cell>
129
         </Cell>
101
         <Cell title="审批说明" />
130
         <Cell title="审批说明" />
107
         />
136
         />
108
       </CellGroup>
137
       </CellGroup>
109
       <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
138
       <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
110
-        <Button block type="primary" loading={submitting} onClick={onSubmit}>提交审批</Button>
139
+        <Button block type="primary" loading={submitting} onClick={onSubmit}>审 批</Button>
111
       </View>
140
       </View>
112
     </Page>
141
     </Page>
113
   )
142
   )

+ 17
- 17
src/pages/org/issue/detail/components/Apply.jsx View File

5
 import DatePicker from '@/components/DatePicker';
5
 import DatePicker from '@/components/DatePicker';
6
 import { getDateStr } from '@/utils/date';
6
 import { getDateStr } from '@/utils/date';
7
 import { postTaIssueApply } from '@/services/taissueapply';
7
 import { postTaIssueApply } from '@/services/taissueapply';
8
+import { putTaOrgIssue } from '@/services/taorgissue';
8
 import { warn } from '@/utils/message';
9
 import { warn } from '@/utils/message';
9
 import {
10
 import {
10
   PROCESS_APPLY_DELAY,
11
   PROCESS_APPLY_DELAY,
20
 
21
 
21
   const [show, setShow] = React.useState(false);
22
   const [show, setShow] = React.useState(false);
22
   const [submitting, setSubmitting] = React.useState(false);
23
   const [submitting, setSubmitting] = React.useState(false);
23
-  const [formData, setFormData] = React.useState({});
24
   const [showDatePicker, setShowDatePicker] = React.useState(false);
24
   const [showDatePicker, setShowDatePicker] = React.useState(false);
25
 
25
 
26
+  // 申请表记录
27
+  const [formData, setFormData] = React.useState({});
28
+
26
   const setFieldValue = (key, value) => {
29
   const setFieldValue = (key, value) => {
27
     setFormData({
30
     setFormData({
28
       ...formData,
31
       ...formData,
53
   const onSubmit = () => {
56
   const onSubmit = () => {
54
     try {
57
     try {
55
       warn(!orgIssue || !orgIssue.issueId, '未找到问题单');
58
       warn(!orgIssue || !orgIssue.issueId, '未找到问题单');
59
+      warn(!orgIssue.attachList || !orgIssue.attachList.length, '请上传照片');
60
+      warn(!orgIssue.result, '请填写整改结果');
56
 
61
 
57
-      if (applyType == PROCESS_APPLY_VERIFY || applyType == PROCESS_APPLY_END) {
58
-        warn(!orgIssue.attachList || !orgIssue.attachList.length, '请上传照片');
59
-        warn(!orgIssue.result, '请填写整改结果');
60
-      }
61
-
62
-      if (applyType === PROCESS_APPLY_DELAY) {
63
-        warn(!formData.content, '请选择延期时间');
64
-      }
65
-
66
-      if (applyType == PROCESS_APPLY_DELAY || applyType == PROCESS_APPLY_REJECT) {
67
-        warn(!formData.remark, '请填写理由说明');
68
-      }
62
+      warn(applyType == PROCESS_APPLY_DELAY && !formData.content, '请设置延期时间');
69
     } catch (e) {
63
     } catch (e) {
70
       return ;
64
       return ;
71
     }
65
     }
76
       ...formData
70
       ...formData
77
     }
71
     }
78
 
72
 
73
+    // 先保存数据
79
     setSubmitting(true);
74
     setSubmitting(true);
80
-    postTaIssueApply(data).then(() => {
81
-      Taro.navigateBack({delta: 1});
82
-      setSubmitting(false);
75
+    putTaOrgIssue(orgIssue.orgIssueId, orgIssue).then(() => {
76
+      // 再调用申请接口
77
+      postTaIssueApply(data).then(() => {
78
+        Taro.navigateBack({delta: 1});
79
+        setSubmitting(false);
80
+      }).catch(() => {
81
+        setSubmitting(false);
82
+      })
83
     }).catch(() => {
83
     }).catch(() => {
84
       setSubmitting(false);
84
       setSubmitting(false);
85
     })
85
     })
98
       <Popup position="bottom" show={show} onClose={() => setShow(false)}>
98
       <Popup position="bottom" show={show} onClose={() => setShow(false)}>
99
         <CellGroup>
99
         <CellGroup>
100
           {
100
           {
101
-            applyType == 'delay' && (
101
+            applyType == PROCESS_APPLY_DELAY && (
102
               <Cell
102
               <Cell
103
                 isLink
103
                 isLink
104
                 title="延期时间"
104
                 title="延期时间"

+ 23
- 22
src/pages/org/issue/detail/index.jsx View File

6
 import Uploader from '@/components/Uploader/index';
6
 import Uploader from '@/components/Uploader/index';
7
 import { getTaIssueById } from '@/services/taissue';
7
 import { getTaIssueById } from '@/services/taissue';
8
 import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
8
 import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
9
-import { PROCESS_APPLY_END, PROCESS_START, PROCESS_END, PROCESS_APPLY_VERIFY, PROCESS_APPLY_DELAY, PROCESS_APPLY_REJECT } from '@/utils/biz';
10
-
9
+import {
10
+  getIssueStatus,
11
+  PROCESS_APPLY_END,
12
+  PROCESS_END,
13
+  PROCESS_APPLY_VERIFY,
14
+  PROCESS_APPLY_DELAY,
15
+  PROCESS_APPLY_REJECT,
16
+  PROCESS_ASSIGNED,
17
+  APPLY_READY,
18
+} from '@/utils/biz';
11
 import IssueInfo from '../../components/issue-info';
19
 import IssueInfo from '../../components/issue-info';
12
 import Apply from './components/Apply';
20
 import Apply from './components/Apply';
13
 
21
 
14
-const status = {
15
-  delay: '延期申请中',
16
-  reject: '驳回申请中',
17
-  end: '办结申请中',
18
-}
19
-
20
 export default (props) => {
22
 export default (props) => {
21
 
23
 
22
   const router = Taro.useRouter();
24
   const router = Taro.useRouter();
35
     if (!orgIssue.issueId) return [];
37
     if (!orgIssue.issueId) return [];
36
 
38
 
37
     return [
39
     return [
38
-      issue?.applyId,
39
-      status[issue.applyType],
40
-      orgIssue.processStatus == PROCESS_START,
41
-      orgIssue.processStatus != PROCESS_END && orgIssue.processStatus != PROCESS_APPLY_END ,
40
+      orgIssue?.processStatus == APPLY_READY || orgIssue?.processNode == PROCESS_END,
41
+      issue ? getIssueStatus(issue).label : '',
42
+      orgIssue.processNode == PROCESS_ASSIGNED,
43
+      orgIssue.processNode != PROCESS_END && orgIssue.processNode != PROCESS_APPLY_END ,
42
     ]
44
     ]
43
 
45
 
44
   }, [issue, orgIssue]);
46
   }, [issue, orgIssue]);
82
 
84
 
83
         <Cell
85
         <Cell
84
           renderTitle={
86
           renderTitle={
85
-            <Uploader disabled={readOnly} value={orgIssue.attachList} onChange={e => setFormData('attachList',e)} />
87
+            <Uploader
88
+              disabled={readOnly}
89
+              value={orgIssue.attachList}
90
+              onChange={e => setFormData('attachList',e)}
91
+            />
86
           }
92
           }
87
         />
93
         />
88
       </CellGroup>
94
       </CellGroup>
89
-
90
-      {
91
-        readOnly && (
92
-          <CellGroup style={{marginTop: '20px'}}>
93
-            <Cell title="状态" value={statusTxt} />
94
-          </CellGroup>
95
-        )
96
-      }
95
+      
96
+      <CellGroup style={{marginTop: '20px'}}>
97
+        <Cell title="状态" value={statusTxt} />
98
+      </CellGroup>
97
 
99
 
98
       {
100
       {
99
         !readOnly && (
101
         !readOnly && (
101
             <View>
103
             <View>
102
               {
104
               {
103
                 showApplyEnd &&
105
                 showApplyEnd &&
104
-                  // <Button block type="primary">保存修改</Button> :
105
                   <Apply block type="primary" applyType={PROCESS_APPLY_END} orgIssue={orgIssue}>申请办结</Apply>
106
                   <Apply block type="primary" applyType={PROCESS_APPLY_END} orgIssue={orgIssue}>申请办结</Apply>
106
               }
107
               }
107
             </View>
108
             </View>

+ 1
- 1
src/services/taorgissue.js View File

17
 /*
17
 /*
18
  * 通过ISSUE_ID查询单条数据
18
  * 通过ISSUE_ID查询单条数据
19
  */
19
  */
20
-export const getTaOrgIssueByIssueId = (issueId) => request(`/api/taIssue/${issueId}/orgIssue`);
20
+export const getTaOrgIssueByIssueId = (issueId, orgId) => request(`/api/taIssue/${issueId}/orgIssue?orgId=${orgId}`);
21
 
21
 
22
 /*
22
 /*
23
  * 更新数据
23
  * 更新数据

+ 8
- 4
src/utils/biz.js View File

30
 
30
 
31
 
31
 
32
 export function getIssueStatus(taIssue) {
32
 export function getIssueStatus(taIssue) {
33
-  console.log('------taIssue-----', taIssue)
34
   if (taIssue.processStatus === APPLY_REJECT) {
33
   if (taIssue.processStatus === APPLY_REJECT) {
35
     return {
34
     return {
36
       value: 4,
35
       value: 4,
71
       } else if (taIssue.processNode === PROCESS_APPLY_END) {
70
       } else if (taIssue.processNode === PROCESS_APPLY_END) {
72
         return {
71
         return {
73
           value: 1,
72
           value: 1,
74
-          label: '办结申请',
73
+          label: '消单申请',
75
         };
74
         };
75
+      } else {
76
+        // return {
77
+        //   value: 1,
78
+        //   label: '待处理',
79
+        // };
76
       }
80
       }
77
     } else if (taIssue.processStatus === APPLY_PASS) {
81
     } else if (taIssue.processStatus === APPLY_PASS) {
78
       if (taIssue.processNode === PROCESS_APPLY_REJECT) {
82
       if (taIssue.processNode === PROCESS_APPLY_REJECT) {
93
       } else if (taIssue.processNode === PROCESS_APPLY_END) {
97
       } else if (taIssue.processNode === PROCESS_APPLY_END) {
94
         return {
98
         return {
95
           value: 1,
99
           value: 1,
96
-          label: '办结申请通过',
100
+          label: '消单申请通过',
97
         };
101
         };
98
       }
102
       }
99
     } else {
103
     } else {
115
       } else if (taIssue.processNode === PROCESS_APPLY_END) {
119
       } else if (taIssue.processNode === PROCESS_APPLY_END) {
116
         return {
120
         return {
117
           value: 1,
121
           value: 1,
118
-          label: '办结申请驳回',
122
+          label: '消单申请驳回',
119
         };
123
         };
120
       }
124
       }
121
     }
125
     }