Your Name 2 年前
父节点
当前提交
6654015fa5

+ 2
- 0
src/app.config.js 查看文件

@@ -8,6 +8,8 @@ export default defineAppConfig({
8 8
     'pages/issue/edit/index',
9 9
     'pages/org/issue/list/index',
10 10
     'pages/org/issue/detail/index',
11
+    'pages/apply/apply/index',
12
+    'pages/apply/verify/index',
11 13
     'pages/index3/index',
12 14
     'pages/index4/index',
13 15
     'pages/index5/index',

+ 4
- 4
src/components/IssueCard/index.jsx 查看文件

@@ -16,7 +16,7 @@ const colors = [
16 16
 
17 17
 export default (props) => {
18 18
 
19
-  const { detail, onClick } = props;
19
+  const { detail, onClick, color, stText } = props;
20 20
 
21 21
   const [
22 22
     content,
@@ -31,10 +31,10 @@ export default (props) => {
31 31
     return [
32 32
       (detail.content || '').replace('\r\n', '<br>').replace('\n', '<br>'),
33 33
       dayjs(detail.createDate).format('YYYY-MM-DD HH:mm'),
34
-      colors[bizStatus],
35
-      statusText,
34
+      colors[color ?? bizStatus],
35
+      stText || statusText,
36 36
     ];
37
-  }, [detail]);
37
+  }, [detail, color, stText]);
38 38
   
39 39
   return (
40 40
     <View className={style['issue-card-wrapper']} onClick={onClick}>

+ 2
- 1
src/layouts/index.jsx 查看文件

@@ -2,7 +2,7 @@ import React from 'react';
2 2
 import Taro from '@tarojs/taro';
3 3
 import { View, Image } from '@tarojs/components';
4 4
 import { useModel } from '@/store';
5
-import { Loading } from '@antmjs/vantui';
5
+import { Loading, Notify } from '@antmjs/vantui';
6 6
 import NavLoading from '@/components/NavLoading';
7 7
 import Auth from '@/components/Auth';
8 8
 import TabBar from './TabBar';
@@ -28,6 +28,7 @@ export default (props) => {
28 28
 
29 29
   return (
30 30
     <View className={laySty['page-wrapper']}>
31
+      <Notify id="vanNotify" />
31 32
       <NavLoading loading={loading} />
32 33
       <View className={conatinerClass} style={style}>
33 34
         {

+ 4
- 0
src/pages/apply/apply/index.config.js 查看文件

@@ -0,0 +1,4 @@
1
+// eslint-disable-next-line no-undef
2
+export default definePageConfig({
3
+  navigationBarTitleText: '问题单申请'
4
+})

src/pages/org/issue/detail/components/ExpireApply.jsx → src/pages/apply/apply/index.jsx 查看文件

@@ -1,18 +1,41 @@
1 1
 import React from 'react';
2 2
 import Taro from '@tarojs/taro';
3 3
 import { View } from '@tarojs/components';
4
+import Page from '@/layouts/index';
4 5
 import { Cell, CellGroup, Field, Button } from '@antmjs/vantui';
5 6
 import DatePicker from '@/components/DatePicker';
6 7
 import { getDateStr } from '@/utils/date';
7 8
 import { postTaIssueApply } from '@/services/taissueapply';
8 9
 import { warn } from '@/utils/message';
10
+import Issue from '../components/Issue';
9 11
 
10 12
 const today = new Date();
11 13
 export default (props) => {
12 14
 
13
-  const { orgIssue } = props;
15
+  const router = Taro.useRouter();
16
+  const { issueId, applyType } = router.params;
14 17
 
15 18
   const [loading, setLoading] = React.useState(false);
19
+
20
+  React.useMemo(() => {
21
+    switch (applyType) {
22
+      case 'delay':
23
+        Taro.setNavigationBarTitle('申请延期');
24
+        break;
25
+      case 'reject':
26
+        Taro.setNavigationBarTitle('申请驳回');
27
+        break;
28
+      case 'verify':
29
+        Taro.setNavigationBarTitle('申请审核');
30
+        break;
31
+      case 'end':
32
+        Taro.setNavigationBarTitle('申请办结');
33
+        break;
34
+    }
35
+  }, [applyType]);
36
+
37
+  
38
+  const [submitting, setSubmitting] = React.useState(false);
16 39
   const [formData, setFormData] = React.useState({});
17 40
   const [showDatePicker, setShowDatePicker] = React.useState(false);
18 41
 
@@ -31,29 +54,34 @@ export default (props) => {
31 54
 
32 55
   const onSubmit = () => {
33 56
     try {
34
-      warn(!formData.content, '请选择延期时间');
35
-      warn(!formData.remark, '请填写延期理由');
57
+      if (applyType == 'delay') {
58
+        warn(!formData.content, '请选择延期时间');
59
+      }
60
+      warn(!formData.remark, '请填写申请说明');
36 61
     } catch (e) {
37 62
       return ;
38 63
     }
39 64
 
40 65
     const data = {
41
-      issueId: orgIssue.issueId,
42
-      applyType: 'delay',
66
+      issueId,
67
+      applyType,
43 68
       ...formData
44 69
     }
45 70
 
46
-    setLoading(true);
71
+    setSubmitting(true);
47 72
     postTaIssueApply(data).then(() => {
48 73
       Taro.navigateBack({delta: 1});
49
-      setLoading(false);
74
+      setSubmitting(false);
50 75
     }).catch(() => {
51
-      setLoading(false);
76
+      setSubmitting(false);
52 77
     })
53 78
   }
54 79
   
80
+  
55 81
   return (
56
-    <>
82
+    <Page loading={loading}>
83
+      <Issue issueId={issueId} onLoading={setLoading} />
84
+      
57 85
       <DatePicker
58 86
         type="date"
59 87
         minDate={today}
@@ -62,14 +90,19 @@ export default (props) => {
62 90
         onCancel={() => setShowDatePicker(false)}
63 91
         onChange={onDateChange}
64 92
       />
93
+
65 94
       <CellGroup style={{marginTop: '20px'}}>
66
-        <Cell
67
-          isLink
68
-          title="延期时间"
69
-          value={formData.content}
70
-          onClick={() => setShowDatePicker(true)}
71
-        />
72
-        <Cell title="延期理由" />
95
+        {
96
+          applyType == 'delay' && (
97
+            <Cell
98
+              isLink
99
+              title="延期时间"
100
+              value={formData.content}
101
+              onClick={() => setShowDatePicker(true)}
102
+            />
103
+          )
104
+        }
105
+        <Cell title="申请说明" />
73 106
         <Field
74 107
           type="textarea"
75 108
           autosize={{ minHeight: '120px' }}
@@ -78,8 +111,8 @@ export default (props) => {
78 111
         />
79 112
       </CellGroup>
80 113
       <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
81
-        <Button block type="primary" onClick={onSubmit}>申请延期</Button>
114
+        <Button block type="primary" loading={submitting} onClick={onSubmit}>提交申请</Button>
82 115
       </View>
83
-    </>
116
+    </Page>
84 117
   )
85 118
 }

+ 60
- 0
src/pages/apply/components/Issue.jsx 查看文件

@@ -0,0 +1,60 @@
1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components';
4
+import { Cell, CellGroup, Field, Button } from '@antmjs/vantui';
5
+import Uploader from '@/components/Uploader/index';
6
+import { getTaIssueById } from '@/services/taissue';
7
+
8
+const getDtStr = dt => !dt ? '' : dt.replace('T', ' ').substring(0, 16)
9
+export default (props) => {
10
+  const { issueId, onLoading } = props;
11
+
12
+  const [issue, setIssue] = React.useState({});
13
+
14
+  const setLoading = (val) => {
15
+    if (onLoading) {
16
+      onLoading(val);
17
+    }
18
+  }
19
+
20
+  React.useEffect(() => {
21
+    if (issueId) {
22
+      setLoading(true);
23
+      getTaIssueById(issueId).then((res) => {
24
+        setIssue(res);
25
+        setLoading(false);
26
+      }).catch(() => {
27
+        setLoading(false);
28
+      });
29
+    }
30
+  }, [issueId]);
31
+
32
+  return (
33
+    <>
34
+      <CellGroup>
35
+        <Cell title="上报时间" value={getDtStr(issue?.createDate)} />
36
+        <Cell title="办结时间" value={issue?.expireDate} />
37
+        <Cell title="交办次数" value={issue?.processNum || 1} />
38
+      </CellGroup>
39
+      <CellGroup style={{marginTop: '20px'}}>
40
+        <Cell title="抽检位置" value={issue?.locName} />
41
+        <Cell title="定 位 点" value={issue?.addr} />
42
+        <Cell title="问题详情" />        
43
+        <Field
44
+          readonly
45
+          type="textarea"
46
+          autosize={{ minHeight: '120px' }}
47
+          value={issue?.content}
48
+        /> 
49
+        <Cell
50
+          renderTitle={
51
+            <Uploader
52
+              disabled
53
+              value={issue?.attachList}
54
+            />
55
+          }
56
+        />
57
+      </CellGroup>
58
+    </>
59
+  )
60
+}

+ 4
- 0
src/pages/apply/detail/index.config.js 查看文件

@@ -0,0 +1,4 @@
1
+// eslint-disable-next-line no-undef
2
+export default definePageConfig({
3
+  navigationBarTitleText: '审批详情'
4
+})

+ 92
- 0
src/pages/apply/detail/index.jsx 查看文件

@@ -0,0 +1,92 @@
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 { Cell, CellGroup, Field, Radio, RadioGroup } from '@antmjs/vantui';
6
+import { getTaIssueApplyById } from '@/services/taissueapply';
7
+import Issue from '../components/Issue';
8
+
9
+// const today = new Date();
10
+export default (props) => {
11
+
12
+  const router = Taro.useRouter();
13
+  const { id, applyType, issueId } = router.params;
14
+
15
+  const [loading, setLoading] = React.useState(false);
16
+  const [applyInfo, setApplyInfo] = React.useState({});
17
+
18
+  React.useMemo(() => {
19
+    switch (applyType) {
20
+      case 'delay':
21
+        Taro.setNavigationBarTitle('延期申请');
22
+        break;
23
+      case 'reject':
24
+        Taro.setNavigationBarTitle('驳回申请');
25
+        break;
26
+      case 'verify':
27
+        Taro.setNavigationBarTitle('审核申请');
28
+        break;
29
+      case 'end':
30
+        Taro.setNavigationBarTitle('办结申请');
31
+        break;
32
+    }
33
+  }, [applyType]);
34
+  
35
+  React.useEffect(() => {
36
+    if (id) {
37
+      setLoading(true);
38
+      getTaIssueApplyById(id).then(res => {
39
+        setApplyInfo(res);
40
+        setLoading(false);
41
+      }).catch(() => {
42
+        setLoading(false);
43
+      });
44
+    }
45
+  }, [id]);
46
+  
47
+  return (
48
+    <Page loading={loading}>
49
+      <Issue issueId={issueId} />
50
+     
51
+      <CellGroup style={{marginTop: '20px'}}>
52
+        {
53
+          applyInfo.applyType == 'delay' && (
54
+            <Cell
55
+              title="延期日期"
56
+              value={applyInfo.content}
57
+            />
58
+          )
59
+        }
60
+        <Cell title="申请说明" />
61
+        <Field
62
+          readonly
63
+          type="textarea"
64
+          autosize={{ minHeight: '120px' }}
65
+          value={applyInfo.remark}
66
+        />
67
+      </CellGroup>
68
+     
69
+      <CellGroup style={{marginTop: '20px'}}>
70
+        <Cell
71
+          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>
82
+        <Cell title="审批说明" />
83
+        <Field
84
+          readonly
85
+          type="textarea"
86
+          autosize={{ minHeight: '120px' }}
87
+          value={applyInfo.verifyDesc}
88
+        />
89
+      </CellGroup>
90
+    </Page>
91
+  )
92
+}

+ 4
- 0
src/pages/apply/verify/index.config.js 查看文件

@@ -0,0 +1,4 @@
1
+// eslint-disable-next-line no-undef
2
+export default definePageConfig({
3
+  navigationBarTitleText: '问题单审批'
4
+})

+ 129
- 0
src/pages/apply/verify/index.jsx 查看文件

@@ -0,0 +1,129 @@
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 { Cell, CellGroup, Field, Button, Radio, RadioGroup } from '@antmjs/vantui';
6
+import { putTaIssueApply, getTaIssueApplyById } from '@/services/taissueapply';
7
+import { warn } from '@/utils/message';
8
+import Issue from '../components/Issue';
9
+
10
+// const today = new Date();
11
+export default (props) => {
12
+
13
+  const router = Taro.useRouter();
14
+  const { id, applyType, issueId } = router.params;
15
+
16
+  const [loading, setLoading] = React.useState(false);
17
+  const [applyInfo, setApplyInfo] = React.useState({});
18
+
19
+  React.useMemo(() => {
20
+    switch (applyType) {
21
+      case 'delay':
22
+        Taro.setNavigationBarTitle('延期审批');
23
+        break;
24
+      case 'reject':
25
+        Taro.setNavigationBarTitle('驳回审批');
26
+        break;
27
+      case 'verify':
28
+        Taro.setNavigationBarTitle('审核审批');
29
+        break;
30
+      case 'end':
31
+        Taro.setNavigationBarTitle('办结审批');
32
+        break;
33
+    }
34
+  }, [applyType]);
35
+
36
+  
37
+  const [submitting, setSubmitting] = React.useState(false);
38
+  const [formData, setFormData] = React.useState({});
39
+
40
+  const setFieldValue = (key, value) => {
41
+    setFormData({
42
+      ...formData,
43
+      [key]: value,
44
+    })
45
+  }
46
+  
47
+  const onSubmit = () => {
48
+    try {
49
+      warn(!formData.verifyStatus, '请选择审批结果');
50
+      warn(!formData.verifyDesc, '请填写审批说明');
51
+    } catch (e) {
52
+      return ;
53
+    }
54
+
55
+    const data = {
56
+      ...applyInfo,
57
+      ...formData
58
+    }
59
+
60
+    setSubmitting(true);
61
+    putTaIssueApply(data.applyId, data).then(() => {
62
+      Taro.navigateBack({delta: 1});
63
+      setSubmitting(false);
64
+    }).catch(() => {
65
+      setSubmitting(false);
66
+    })
67
+  }
68
+  
69
+  React.useEffect(() => {
70
+    if (id) {
71
+      setLoading(true);
72
+      getTaIssueApplyById(id).then(res => {
73
+        setApplyInfo(res);
74
+        setLoading(false);
75
+      }).catch(() => {
76
+        setLoading(false);
77
+      });
78
+    }
79
+  }, [id]);
80
+  
81
+  return (
82
+    <Page loading={loading}>
83
+      <Issue issueId={issueId} />
84
+     
85
+      <CellGroup style={{marginTop: '20px'}}>
86
+        {
87
+          applyInfo.applyType == 'delay' && (
88
+            <Cell
89
+              title="延期日期"
90
+              value={applyInfo.content}
91
+            />
92
+          )
93
+        }
94
+        <Cell title="申请说明" />
95
+        <Field
96
+          readonly
97
+          type="textarea"
98
+          autosize={{ minHeight: '120px' }}
99
+          value={applyInfo.remark}
100
+        />
101
+      </CellGroup>
102
+     
103
+      <CellGroup style={{marginTop: '20px'}}>
104
+        <Cell
105
+          title="审批结果"
106
+        >
107
+          <RadioGroup
108
+            direction="horizontal"
109
+            value={formData.verifyStatus}
110
+            onChange={(e) => setFieldValue('verifyStatus', e.detail)}
111
+          >
112
+            <Radio name="pass" checkedColor="var(--main-bg-color)">通过</Radio>
113
+            <Radio name="reject" checkedColor="red">驳回</Radio>
114
+          </RadioGroup>
115
+        </Cell>
116
+        <Cell title="审批说明" />
117
+        <Field
118
+          type="textarea"
119
+          autosize={{ minHeight: '120px' }}
120
+          value={formData.verifyDesc}
121
+          onChange={(e) => setFieldValue('verifyDesc', e.detail)}
122
+        />
123
+      </CellGroup>
124
+      <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
125
+        <Button block type="primary" loading={submitting} onClick={onSubmit}>提交审批</Button>
126
+      </View>
127
+    </Page>
128
+  )
129
+}

+ 114
- 0
src/pages/org/issue/detail/components/Apply.jsx 查看文件

@@ -0,0 +1,114 @@
1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components';
4
+import { Cell, CellGroup, Field, Button, Popup } from '@antmjs/vantui';
5
+import DatePicker from '@/components/DatePicker';
6
+import { getDateStr } from '@/utils/date';
7
+import { postTaIssueApply } from '@/services/taissueapply';
8
+import { warn } from '@/utils/message';
9
+
10
+const today = new Date();
11
+export default (props) => {
12
+
13
+  const { orgIssue, applyType, ...leftProps } = props;
14
+
15
+  const [show, setShow] = React.useState(false);
16
+  const [submitting, setSubmitting] = React.useState(false);
17
+  const [formData, setFormData] = React.useState({});
18
+  const [showDatePicker, setShowDatePicker] = React.useState(false);
19
+
20
+  const setFieldValue = (key, value) => {
21
+    setFormData({
22
+      ...formData,
23
+      [key]: value,
24
+    })
25
+  }
26
+
27
+  const onDateClick = () => {
28
+    setShow(false);
29
+    setShowDatePicker(true);
30
+  }
31
+  
32
+  const onDateChange = (dt) => {
33
+    const date = getDateStr(dt);
34
+    setFieldValue('content', date);
35
+    setShowDatePicker(false);
36
+    setShow(true);
37
+  }
38
+
39
+  const onClick = () => {
40
+    if (applyType == 'org-verify' || applyType == 'end') {
41
+      onSubmit();
42
+    } else {
43
+      setShow(true);
44
+    }
45
+  }
46
+
47
+  const onSubmit = () => {
48
+    try {
49
+      warn(!orgIssue || !orgIssue.issueId, '未找打问题单');
50
+      if (applyType === 'delay') {
51
+        warn(!formData.content, '请选择延期时间');
52
+      }
53
+
54
+      if (applyType == 'delay' || applyType == 'reject') {
55
+        warn(!formData.remark, '请填写理由说明');
56
+      }
57
+    } catch (e) {
58
+      return ;
59
+    }
60
+
61
+    const data = {
62
+      applyType,
63
+      issueId: orgIssue.issueId,
64
+      ...formData
65
+    }
66
+
67
+    setSubmitting(true);
68
+    postTaIssueApply(data).then(() => {
69
+      Taro.navigateBack({delta: 1});
70
+      setSubmitting(false);
71
+    }).catch(() => {
72
+      setSubmitting(false);
73
+    })
74
+  }
75
+  
76
+  return (
77
+    <>
78
+      <DatePicker
79
+        type="date"
80
+        minDate={today}
81
+        show={showDatePicker}
82
+        value={formData.content}
83
+        onCancel={() => setShowDatePicker(false)}
84
+        onChange={onDateChange}
85
+      />
86
+      <Popup position="bottom" show={show} onClose={() => setShow(false)}>
87
+        <CellGroup>
88
+          {
89
+            applyType == 'delay' && (
90
+              <Cell
91
+                isLink
92
+                title="延期时间"
93
+                value={formData.content}
94
+                onClick={onDateClick}
95
+              />
96
+            )
97
+          }
98
+          <Cell title="理由说明" />
99
+          <Field
100
+            type="textarea"
101
+            autosize={{ minHeight: '120px' }}
102
+            value={formData.remark}
103
+            onChange={e => setFieldValue('remark', e.detail)}
104
+          />
105
+          <View style={{display: 'flex'}}>
106
+            <Button block plain type="default" onClick={() => setShow(false)}>取消</Button>
107
+            <Button block plain type="primary" loading={submitting} onClick={onSubmit}>确定</Button>
108
+          </View>
109
+        </CellGroup>
110
+      </Popup>
111
+      <Button {...leftProps} onClick={onClick}>{props.children}</Button>
112
+    </>
113
+  )
114
+}

+ 0
- 32
src/pages/org/issue/detail/components/IssueEnd.jsx 查看文件

@@ -1,32 +0,0 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View } from '@tarojs/components';
4
-import { Cell, CellGroup, Field, Button } from '@antmjs/vantui';
5
-import Uploader from '@/components/Uploader/index';
6
-
7
-export default (props) => {
8
-
9
-  const { orgIssue } = props;
10
-  
11
-  return (
12
-    <>
13
-      <CellGroup style={{marginTop: '20px'}}>
14
-        <Cell title="整改结果" />        
15
-        <Field
16
-          readonly
17
-          type="textarea"
18
-          autosize={{ minHeight: '120px' }}
19
-          value={orgIssue?.result}
20
-        />
21
-        <Cell
22
-          renderTitle={
23
-            <Uploader
24
-              disabled
25
-              value={orgIssue?.attachList}
26
-            />
27
-          }
28
-        />
29
-      </CellGroup>
30
-    </>
31
-  )
32
-}

+ 34
- 0
src/pages/org/issue/detail/components/Update.jsx 查看文件

@@ -0,0 +1,34 @@
1
+import React from 'react';
2
+import Taro from '@tarojs/taro';
3
+import { View } from '@tarojs/components';
4
+import { Button } from '@antmjs/vantui';
5
+import { putTaOrgIssue } from '@/services/taorgissue';
6
+import { warn } from '@/utils/message';
7
+
8
+export default (props) => {
9
+  const { orgIssue } = props;
10
+  
11
+  const [submitting, setSubmitting] = React.useState(false);
12
+  
13
+  const onSubmit = () => {
14
+    try {
15
+      warn(!orgIssue || !orgIssue.issueId, '未找打问题单');
16
+      warn(!orgIssue.result, '请填写整改结果');
17
+      warn(!orgIssue.attachList || !orgIssue.attachList, '请上传照片或视频');
18
+    } catch (e) {
19
+      return ;
20
+    }
21
+
22
+    setSubmitting(true);
23
+    putTaOrgIssue(orgIssue.orgIssueId, orgIssue).then(() => {
24
+      Taro.navigateBack({delta: 1});
25
+      setSubmitting(false);
26
+    }).catch(() => {
27
+      setSubmitting(false);
28
+    })
29
+  }
30
+
31
+  return (
32
+    <Button block type="primary" loading={submitting} onClick={onSubmit}>保存修改</Button>
33
+  )
34
+}

+ 0
- 40
src/pages/org/issue/detail/components/Verify.jsx 查看文件

@@ -1,40 +0,0 @@
1
-import React from 'react';
2
-import Taro from '@tarojs/taro';
3
-import { View } from '@tarojs/components';
4
-import { Cell, CellGroup, Field, Button } from '@antmjs/vantui';
5
-import Uploader from '@/components/Uploader/index';
6
-
7
-export default (props) => {
8
-
9
-  const { orgIssue } = props;
10
-  
11
-  return (
12
-    <>
13
-      <CellGroup style={{marginTop: '20px'}}>
14
-        <Cell title="整改结果" />        
15
-        <Field
16
-          readonly
17
-          type="textarea"
18
-          autosize={{ minHeight: '120px' }}
19
-          value={orgIssue?.result}
20
-        />
21
-        <Cell
22
-          renderTitle={
23
-            <Uploader
24
-              disabled
25
-              value={orgIssue?.attachList}
26
-            />
27
-          }
28
-        />
29
-      </CellGroup>
30
-      <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
31
-        <View>
32
-          <Button block type="primary">通过审核</Button>
33
-        </View>
34
-        <View style={{marginTop: '20px'}}>
35
-          <Button block type="default">重新整改</Button>
36
-        </View>
37
-      </View>
38
-    </>
39
-  )
40
-}

+ 55
- 13
src/pages/org/issue/detail/index.jsx 查看文件

@@ -8,9 +8,7 @@ import { getTaIssueById } from '@/services/taissue';
8 8
 import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
9 9
 
10 10
 import IssueInfo from '../../components/issue-info';
11
-import Verify from './components/Verify';
12
-import ExpireApply from './components/ExpireApply';
13
-import IssueEnd from './components/IssueEnd';
11
+import Apply from './components/Apply';
14 12
 
15 13
 export default (props) => {
16 14
 
@@ -19,7 +17,9 @@ export default (props) => {
19 17
 
20 18
   const [loading, setLoading] = React.useState(false);
21 19
   const [issue, setIssue] = React.useState();
22
-  const [orgIssue, setOrgIssue] = React.useState();
20
+  const [orgIssue, setOrgIssue] = React.useState({});
21
+
22
+  const showEditBtn = React.useMemo(() => !orgIssue.result, [orgIssue.issueId]);
23 23
 
24 24
   const setFormData = (key, value) => {
25 25
     setOrgIssue({
@@ -45,15 +45,57 @@ export default (props) => {
45 45
   return (
46 46
     <Page loading={loading}>
47 47
       <IssueInfo issue={issue} />
48
-      {
49
-        act == 'verify' && <Verify orgIssue={orgIssue} />
50
-      }
51
-      {
52
-        act == 'delay' && <ExpireApply orgIssue={orgIssue} />
53
-      }
54
-      {
55
-        act == 'end' && <IssueEnd orgIssue={orgIssue} />
56
-      }
48
+      <CellGroup style={{marginTop: '20px'}}>
49
+        <Cell title="整改结果" />
50
+        <Field
51
+          type="textarea"
52
+          autosize={{ minHeight: '120px' }}
53
+          value={orgIssue.result}
54
+          onChange={e => setFormData('result', e.detail)}
55
+        />
56
+      </CellGroup>
57
+      <CellGroup style={{marginTop: '20px'}}>        
58
+        <Cell title="拍照或视频" border={false} />
59
+
60
+        <Cell
61
+          renderTitle={
62
+            <Uploader value={orgIssue.attachList} onChange={e => setFormData('attachList',e)} />
63
+          }
64
+        />
65
+      </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>
78
+            </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>
57 99
     </Page>
58 100
   )
59 101
 }