Your Name 2 vuotta sitten
vanhempi
commit
aa40cabe65

+ 38
- 0
src/pages/org/components/issue-info/index.jsx Näytä tiedosto

@@ -0,0 +1,38 @@
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
+const getDtStr = dt => !dt ? '' : dt.replace('T', ' ').substring(0, 16)
8
+export default (props) => {
9
+  const { issue } = props;
10
+  return (
11
+    <>
12
+      <CellGroup>
13
+        <Cell title="上报时间" value={getDtStr(issue?.createDate)} />
14
+        <Cell title="办结时间" value={issue?.expireDate} />
15
+        <Cell title="交办次数" value={issue?.processNum || 1} />
16
+      </CellGroup>
17
+      <CellGroup style={{marginTop: '20px'}}>
18
+        <Cell title="抽检位置" value={issue?.locName} />
19
+        <Cell title="定 位 点" value={issue?.addr} />
20
+        <Cell title="问题详情" />        
21
+        <Field
22
+          readonly
23
+          type="textarea"
24
+          autosize={{ minHeight: '120px' }}
25
+          value={issue?.content}
26
+        /> 
27
+        <Cell
28
+          renderTitle={
29
+            <Uploader
30
+              disabled
31
+              value={issue?.attachList}
32
+            />
33
+          }
34
+        />
35
+      </CellGroup>
36
+    </>
37
+  )
38
+}

+ 85
- 0
src/pages/org/issue/detail/components/ExpireApply.jsx Näytä tiedosto

@@ -0,0 +1,85 @@
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 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 } = props;
14
+
15
+  const [loading, setLoading] = React.useState(false);
16
+  const [formData, setFormData] = React.useState({});
17
+  const [showDatePicker, setShowDatePicker] = React.useState(false);
18
+
19
+  const setFieldValue = (key, value) => {
20
+    setFormData({
21
+      ...formData,
22
+      [key]: value,
23
+    })
24
+  }
25
+  
26
+  const onDateChange = (dt) => {
27
+    const date = getDateStr(dt);
28
+    setFieldValue('content', date);
29
+    setShowDatePicker(false);
30
+  }
31
+
32
+  const onSubmit = () => {
33
+    try {
34
+      warn(!formData.content, '请选择延期时间');
35
+      warn(!formData.remark, '请填写延期理由');
36
+    } catch (e) {
37
+      return ;
38
+    }
39
+
40
+    const data = {
41
+      issueId: orgIssue.issueId,
42
+      applyType: 'delay',
43
+      ...formData
44
+    }
45
+
46
+    setLoading(true);
47
+    postTaIssueApply(data).then(() => {
48
+      Taro.navigateBack({delta: 1});
49
+      setLoading(false);
50
+    }).catch(() => {
51
+      setLoading(false);
52
+    })
53
+  }
54
+  
55
+  return (
56
+    <>
57
+      <DatePicker
58
+        type="date"
59
+        minDate={today}
60
+        show={showDatePicker}
61
+        value={formData.content}
62
+        onCancel={() => setShowDatePicker(false)}
63
+        onChange={onDateChange}
64
+      />
65
+      <CellGroup style={{marginTop: '20px'}}>
66
+        <Cell
67
+          isLink
68
+          title="延期时间"
69
+          value={formData.content}
70
+          onClick={() => setShowDatePicker(true)}
71
+        />
72
+        <Cell title="延期理由" />
73
+        <Field
74
+          type="textarea"
75
+          autosize={{ minHeight: '120px' }}
76
+          value={formData.remark}
77
+          onChange={e => setFieldValue('remark', e.detail)}
78
+        />
79
+      </CellGroup>
80
+      <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
81
+        <Button block type="primary" onClick={onSubmit}>申请延期</Button>
82
+      </View>
83
+    </>
84
+  )
85
+}

+ 32
- 0
src/pages/org/issue/detail/components/IssueEnd.jsx Näytä tiedosto

@@ -0,0 +1,32 @@
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
+}

+ 40
- 0
src/pages/org/issue/detail/components/Verify.jsx Näytä tiedosto

@@ -0,0 +1,40 @@
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
+}

+ 15
- 52
src/pages/org/issue/detail/index.jsx Näytä tiedosto

@@ -7,12 +7,15 @@ import Uploader from '@/components/Uploader/index';
7 7
 import { getTaIssueById } from '@/services/taissue';
8 8
 import { getTaOrgIssueByIssueId } from '@/services/taorgissue';
9 9
 
10
-const getDtStr = dt => !dt ? '' : dt.replace('T', ' ').substring(0, 16)
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 14
 
12 15
 export default (props) => {
13 16
 
14 17
   const router = Taro.useRouter();
15
-  const { id } = router.params;
18
+  const { id, act } = router.params;
16 19
 
17 20
   const [loading, setLoading] = React.useState(false);
18 21
   const [issue, setIssue] = React.useState();
@@ -41,56 +44,16 @@ export default (props) => {
41 44
   
42 45
   return (
43 46
     <Page loading={loading}>
44
-      <CellGroup>
45
-        <Cell title="上报时间" value={getDtStr(issue?.createDate)} />
46
-        <Cell title="办结时间" value={issue?.expireDate} /> 
47
-      </CellGroup>
48
-      <CellGroup style={{marginTop: '20px'}}>
49
-        <Cell title="抽检位置" value={issue?.locName} />
50
-        <Cell title="定 位 点" value={issue?.addr} />
51
-        <Cell title="问题详情" />        
52
-        <Field
53
-          readonly
54
-          type="textarea"
55
-          autosize={{ minHeight: '120px' }}
56
-          value={issue?.content}
57
-        /> 
58
-        <Cell
59
-          renderTitle={
60
-            <Uploader
61
-              disabled
62
-              value={issue?.attachList}
63
-            />
64
-          }
65
-        />
66
-      </CellGroup>
67
-      <CellGroup style={{marginTop: '20px'}}>
68
-        <Cell title="整改结果" />        
69
-        <Field
70
-          readonly
71
-          type="textarea"
72
-          autosize={{ minHeight: '120px' }}
73
-          value={orgIssue?.result}
74
-          onChange={e => setFormData('result', e.detail)}
75
-        />
76
-        <Cell
77
-          renderTitle={
78
-            <Uploader
79
-              disabled
80
-              value={orgIssue?.attachList}
81
-              onChange={e => setFormData('attachList', e)}
82
-            />
83
-          }
84
-        />
85
-      </CellGroup>
86
-      <View style={{marginTop: '20px', padding: 'var(--main-space)'}}>
87
-        <View>
88
-          <Button block type="primary">通过审核</Button>
89
-        </View>
90
-        <View style={{marginTop: '20px'}}>
91
-          <Button block type="default">重新整改</Button>
92
-        </View>
93
-      </View>
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
+      }
94 57
     </Page>
95 58
   )
96 59
 }

+ 29
- 0
src/services/taissueapply.js Näytä tiedosto

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