Yansen 2 jaren geleden
bovenliggende
commit
dcc04835a4

+ 1
- 1
src/app.config.js Bestand weergeven

@@ -9,7 +9,7 @@ export default defineAppConfig({
9 9
     'pages/org/issue/list/index',
10 10
     'pages/org/issue/detail/index',
11 11
     'pages/apply/list/index',
12
-    'pages/apply/apply/index',
12
+    // 'pages/apply/apply/index',
13 13
     'pages/apply/verify/index',
14 14
     'pages/apply/detail/index',
15 15
     'pages/message/list/index',

+ 9
- 7
src/components/Uploader/style.modules.less Bestand weergeven

@@ -1,13 +1,19 @@
1 1
 
2 2
 .uploader-wrapper {
3 3
   display: inline-block;
4
+
4 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 11
     & > view {
8 12
       flex: none;
9
-      width: 160px;
10
-      height: 160px;
13
+      width: 28vw;
14
+      height: 28vw;
15
+      margin-right: 20px;
16
+      margin-bottom: 20px;
11 17
       position: relative;
12 18
 
13 19
       image {
@@ -19,10 +25,6 @@
19 25
         width: 100%;
20 26
         height: 100%;
21 27
       }
22
-
23
-      & + view {
24
-        margin-left: 20px;
25
-      }
26 28
     }
27 29
 
28 30
     .uploader-add {

+ 3
- 2
src/pages/apply/apply/index.jsx Bestand weergeven

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

+ 2
- 1
src/pages/apply/detail/index.jsx Bestand weergeven

@@ -5,6 +5,7 @@ import Page from '@/layouts/index';
5 5
 import { Cell, CellGroup, Field, Radio, RadioGroup } from '@antmjs/vantui';
6 6
 import { getTaIssueApplyById } from '@/services/taissueapply';
7 7
 import { getDtStr } from '@/utils/date';
8
+import { PROCESS_APPLY_DELAY } from '@/utils/biz';
8 9
 import Issue from '../components/Issue';
9 10
 import useTitle from '../useTitle';
10 11
 
@@ -35,7 +36,7 @@ export default (props) => {
35 36
      
36 37
       <CellGroup style={{marginTop: '20px'}}>
37 38
         {
38
-          applyInfo.applyType == 'delay' && (
39
+          applyInfo.applyType == PROCESS_APPLY_DELAY && (
39 40
             <Cell
40 41
               title="延期日期"
41 42
               value={applyInfo.content}

+ 2
- 2
src/pages/apply/list/index.jsx Bestand weergeven

@@ -52,7 +52,7 @@ export default (props) => {
52 52
             request={getTaIssueApply}
53 53
             params={{applyType, sourceType: 'inspector'}}
54 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 58
         </Tab>
@@ -61,7 +61,7 @@ export default (props) => {
61 61
             request={getTaIssueApply}
62 62
             params={{applyType, sourceType: 'feedback'}}
63 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 67
         </Tab>

+ 39
- 10
src/pages/apply/verify/index.jsx Bestand weergeven

@@ -3,10 +3,13 @@ import Taro from '@tarojs/taro';
3 3
 import { View } from '@tarojs/components';
4 4
 import Page from '@/layouts/index';
5 5
 import { Cell, CellGroup, Field, Button, Radio, RadioGroup } from '@antmjs/vantui';
6
+import Uploader from '@/components/Uploader/index';
6 7
 import { putTaIssueApply, getTaIssueApplyById } from '@/services/taissueapply';
7 8
 import { warn } from '@/utils/message';
9
+import { APPLY_PASS, APPLY_REJECT, PROCESS_APPLY_DELAY } from '@/utils/biz';
8 10
 import Issue from '../components/Issue';
9 11
 import useTitle from '../useTitle';
12
+import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
10 13
 
11 14
 // const today = new Date();
12 15
 export default (props) => {
@@ -16,6 +19,7 @@ export default (props) => {
16 19
 
17 20
   const [loading, setLoading] = React.useState(false);
18 21
   const [applyInfo, setApplyInfo] = React.useState({});
22
+  const [orgIssue, setOrgIssue] = React.useState({});
19 23
   
20 24
   const [submitting, setSubmitting] = React.useState(false);
21 25
   const [formData, setFormData] = React.useState({});
@@ -56,6 +60,11 @@ export default (props) => {
56 60
       setLoading(true);
57 61
       getTaIssueApplyById(id).then(res => {
58 62
         setApplyInfo(res);
63
+
64
+        getTaOrgIssueByIssueId(res.issueId, res.orgId).then(r => {
65
+          setOrgIssue(r);
66
+        });
67
+
59 68
         setLoading(false);
60 69
       }).catch(() => {
61 70
         setLoading(false);
@@ -67,21 +76,41 @@ export default (props) => {
67 76
     <Page loading={loading}>
68 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 82
             <Cell
74 83
               title="延期日期"
75 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 99
         <Field
81 100
           readonly
82 101
           type="textarea"
83 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 115
       </CellGroup>
87 116
      
@@ -94,8 +123,8 @@ export default (props) => {
94 123
             value={formData.verifyStatus}
95 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 128
           </RadioGroup>
100 129
         </Cell>
101 130
         <Cell title="审批说明" />
@@ -107,7 +136,7 @@ export default (props) => {
107 136
         />
108 137
       </CellGroup>
109 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 140
       </View>
112 141
     </Page>
113 142
   )

+ 17
- 17
src/pages/org/issue/detail/components/Apply.jsx Bestand weergeven

@@ -5,6 +5,7 @@ import { Cell, CellGroup, Field, Button, Popup } from '@antmjs/vantui';
5 5
 import DatePicker from '@/components/DatePicker';
6 6
 import { getDateStr } from '@/utils/date';
7 7
 import { postTaIssueApply } from '@/services/taissueapply';
8
+import { putTaOrgIssue } from '@/services/taorgissue';
8 9
 import { warn } from '@/utils/message';
9 10
 import {
10 11
   PROCESS_APPLY_DELAY,
@@ -20,9 +21,11 @@ export default (props) => {
20 21
 
21 22
   const [show, setShow] = React.useState(false);
22 23
   const [submitting, setSubmitting] = React.useState(false);
23
-  const [formData, setFormData] = React.useState({});
24 24
   const [showDatePicker, setShowDatePicker] = React.useState(false);
25 25
 
26
+  // 申请表记录
27
+  const [formData, setFormData] = React.useState({});
28
+
26 29
   const setFieldValue = (key, value) => {
27 30
     setFormData({
28 31
       ...formData,
@@ -53,19 +56,10 @@ export default (props) => {
53 56
   const onSubmit = () => {
54 57
     try {
55 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 63
     } catch (e) {
70 64
       return ;
71 65
     }
@@ -76,10 +70,16 @@ export default (props) => {
76 70
       ...formData
77 71
     }
78 72
 
73
+    // 先保存数据
79 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 83
     }).catch(() => {
84 84
       setSubmitting(false);
85 85
     })
@@ -98,7 +98,7 @@ export default (props) => {
98 98
       <Popup position="bottom" show={show} onClose={() => setShow(false)}>
99 99
         <CellGroup>
100 100
           {
101
-            applyType == 'delay' && (
101
+            applyType == PROCESS_APPLY_DELAY && (
102 102
               <Cell
103 103
                 isLink
104 104
                 title="延期时间"

+ 23
- 22
src/pages/org/issue/detail/index.jsx Bestand weergeven

@@ -6,17 +6,19 @@ import Page from '@/layouts/index';
6 6
 import Uploader from '@/components/Uploader/index';
7 7
 import { getTaIssueById } from '@/services/taissue';
8 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 19
 import IssueInfo from '../../components/issue-info';
12 20
 import Apply from './components/Apply';
13 21
 
14
-const status = {
15
-  delay: '延期申请中',
16
-  reject: '驳回申请中',
17
-  end: '办结申请中',
18
-}
19
-
20 22
 export default (props) => {
21 23
 
22 24
   const router = Taro.useRouter();
@@ -35,10 +37,10 @@ export default (props) => {
35 37
     if (!orgIssue.issueId) return [];
36 38
 
37 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 46
   }, [issue, orgIssue]);
@@ -82,18 +84,18 @@ export default (props) => {
82 84
 
83 85
         <Cell
84 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 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 101
         !readOnly && (
@@ -101,7 +103,6 @@ export default (props) => {
101 103
             <View>
102 104
               {
103 105
                 showApplyEnd &&
104
-                  // <Button block type="primary">保存修改</Button> :
105 106
                   <Apply block type="primary" applyType={PROCESS_APPLY_END} orgIssue={orgIssue}>申请办结</Apply>
106 107
               }
107 108
             </View>

+ 1
- 1
src/services/taorgissue.js Bestand weergeven

@@ -17,7 +17,7 @@ export const getTaOrgIssueById = (id) => request(`/api/taOrgIssue/${id}`);
17 17
 /*
18 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 Bestand weergeven

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