forked from gzzfw/frontEnd/gzDyh

xusd
2024-09-08 5424fb6cc7c907ec12025e96bb41146b28e5582c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
/*
 * @Author: dminyi 1301963064@qq.com
 * @Date: 2024-09-02 14:49:13
 * @LastEditors: dminyi 1301963064@qq.com
 * @LastEditTime: 2024-09-03 14:44:14
 * @FilePath: \gzDyh\gz-customerSystem\src\views\register\handleFeedback\component\CaseResult.jsx
 * @Description: 结案申请
 */
import React, { useState } from 'react';
import { Modal, Form, Select, Upload, Input } from '@arco-design/web-react';
import { Col, Space, Button, Tooltip, Radio } from 'antd';
import DocumentScanner from '../../matterDetail/FileUpLoad'
import { scan } from '@/assets/images/icon'
import { tip, question1 } from '@/assets/images'
import { NoHandleReason } from '../../visit/component/levelDetail'
 
const FormItem = Form.Item;
 
 
const CaseResult = ({ visible = false, handleOnCancel }) => {
 
 
 
  const [selectedTab, setSelectedTab] = useState('1'); // 默认选中第一个 tab
  const [scanFile, setScanFile] = useState(false);
  const [selectedTab1, setSelectedTab1] = useState('1'); // 默认选中第一个 tab
  const [fileTip, setFileTip] = useState('0');
  const [value, setValue] = useState(1)
  const [noHandleReason, setNoHandleReason] = useState(false);
  const [radioValue, setRadioValue] = useState(1)
 
 
  const tabs = [
    { index: '1', label: '化解成功' },
    { index: '2', label: '化解不成功' },
  ];
 
  const tabs1 = [
    { index: '1', label: '公共模板1:化解成功结案意见范本' },
    { index: '2', label: '个人模板1:化解成功结案意见范本(完整版)' }
  ]
 
  const agreement = [
    { value: 1, label: '口头协议' },
    { value: 2, label: '书面协议' }
  ]
 
 
  const handleTabChange = (newTabIndex) => {
    setSelectedTab(newTabIndex);
  };
 
  const handleTabChange1 = (newTabIndex) => {
    setSelectedTab1(newTabIndex);
  };
 
  const handleConfirm = () => {
    // 处理确认逻辑
    setScanFile(false);
  };
 
  const handleCancel = () => {
    // 处理取消逻辑
    setScanFile(false);
  };
 
  const onChange = (e) => {
    console.log('radio checked', e.target.value);
    setRadioValue(e.target.value);
  };
 
 
  return (
    <>
      <Modal visible={visible} onCancel={handleOnCancel} title='申请结案' centered footer={null} style={{ overflow: 'auto' }}>
        <div className='caseResult-title'>化解结果</div>
        <div className='caseResult-tabs'>
          {tabs.map((tab) => (
            <div
              key={tab.index}
              style={{
                color: selectedTab === tab.index ? 'rgba(26,111,184,1)' : 'rgba(0,0,0,0.45)',
                padding: '5px 16px',
                border: `1px solid ${selectedTab === tab.index ? 'rgba(26,111,184,1)' : 'rgba(229,230,235,1)'}`,
                borderRadius: '2px',
                cursor: 'pointer',
              }}
              onClick={() => handleTabChange(tab.index)}
            >
              {tab.label}
            </div>
          ))}
        </div>
        {selectedTab === '1' &&
          <Form
            layout='vertical'
            scrollToFirstError={true}
            requiredSymbol={false}
            initialValues={{
              caseLevel: 1,
            }} //默认值
          >
            <Col span={8}>
              <FormItem
                label={<div style={{ display: 'flex' }}>
                  达成的协议类型
                </div>
                }
                field='caseLevel'
 
              >
                <Select options={agreement} onChange={(v) => { setValue(v); console.log(typeof v, 'vvv') }}>
                </Select>
              </FormItem>
            </Col>
            {value === 1 &&
              <>
                <Col span={24}>
                  <FormItem
                    label={
                      <>
                        <div style={{ display: 'flex' }}>
                          协议要点
                          <div className="must" style={{ marginLeft: '4px' }}>必填</div>
                          <img src={scan} alt="" style={{ marginRight: '-2px', marginLeft: '8px' }} />
                          <div style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={() => setScanFile(true)}>识别材料</div>
                        </div>
                        <div className='caseResult-tips'>
                          <img src={tip} alt='' style={{ width: '16px', marginRight: '8px' }} />
                          <span>协议要点应尽量简洁,当事人大厅来访或小程序线上反映问题时,可在小程序中查看到填写的协议要点内容</span>
                        </div>
                      </>
                    }
                    field='caseDes'
                    rules={[{ message: '请填写事项概况', required: true }]}
                  >
                    <div className='caseResult-textarea'>公共模板1:调解成功口头协议</div>
                    <Input.TextArea
                      rows={5}
                      maxLength={{ length: 200, errorOnly: true }}
                      showWordLimit
                      wrapperStyle={{ width: '100%' }}
                      value='根据纠纷化解人员的协调,当事人双方同意如下调解协议:
                                  [简要说明协议第一条]
                                  [简要说明协议第二条]
                                  [……]
                                  本口头调解协议由纠纷化解人员记录,并已告知双方当事人。双方当事人确认无误。'
                    />
                  </FormItem>
                </Col>
                <Col span={24}>
                  <FormItem
                    label={
                      <>
                        <div style={{ display: 'flex' }}>
                          结案意见
                          <div className="must" style={{ marginLeft: '4px' }}>必填</div>
                        </div>
                      </>
                    }
                    field='caseDes'
                    rules={[{ message: '请填写事项概况', required: true }]}
                  >
                    <div className='tabs1' >
                      {tabs1.map((tab) => (
                        <div
                          key={tab.index}
                          style={{
                            color: selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(0,0,0,0.45)',
                            border: `1px solid ${selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(229,230,235,1)'}`,
                            borderRadius: '2px',
                            cursor: 'pointer',
                            padding: '0px 8px',
                          }}
                          onClick={() => handleTabChange1(tab.index)}
                        >
                          {tab.label}
                        </div>
                      ))}
                    </div>
 
                    <Input.TextArea
                      rows={5}
                      wrapperStyle={{ width: '100%' }}
                      value='鉴于以上协议内容已经双方确认,并认为该协议内容公平合理,能够妥善解决双方的纠纷。建议双方当事人按照协议内容执行,以实现纠纷的最终解决。'
                    />
                  </FormItem>
                </Col>
 
              </>
 
            }
            {value === 2 &&
              <>
                <Col span={24}>
                  <FormItem
                    label={
                      <>
                        <div style={{ display: 'flex' }}>
                          协议文书
                          <div className="must" style={{ marginLeft: '4px' }}>必填</div>
                        </div>
                        <div className='caseResult-tips'>
                          <img src={tip} alt='' style={{ width: '16px', marginRight: '8px' }} />
                          <span>如通过人民调解工作成功化解纠纷事项,建议上传签字盖章后的人民调解协议书</span>
                        </div>
                      </>
                    }
                    field='caseDes'
                    rules={[{ message: '请填写事项概况', required: true }]}
                  >
                    <Upload
                      drag
                      multiple
                      accept='image/*'
                      action='/'
                      height={158}
                      onDrop={(e) => {
                      }}
                      onChange={(v) => {
                        setFileTip((prevLength) => {
                          if (v.length > 0) {
                            console.log(v, 'vvvvvvv');
                            return v.length;
                          }
                          return v.length;
                        });
                      }}
                      tip='支持png、 jpg、excel、word、pdf等格式的文件上传,每次上传大小不超过10M'
                    />
 
 
                  </FormItem>
                </Col>
                <Col span={24}>
                  <FormItem
                    label={
                      <>
                        <div style={{ display: 'flex' }}>
                          协议要点
                          <div className="must" style={{ marginLeft: '4px' }}>必填</div>
                          <img src={scan} alt="" style={{ marginRight: '-2px', marginLeft: '8px' }} />
                          <div style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={() => setScanFile(true)}>识别材料</div>
                        </div>
                        <div className='caseResult-tips'>
                          <img src={tip} alt='' style={{ width: '16px', marginRight: '8px' }} />
                          <span>协议要点应尽量简洁,当事人大厅来访或小程序线上反映问题时,可在小程序中查看到填写的协议要点内容</span>
                        </div>
                      </>
                    }
                    field='caseDes'
                    rules={[{ message: '请填写事项概况', required: true }]}
                  >
                    <div className='caseResult-textarea'>公共模板1:调解成功口头协议</div>
                    <Input.TextArea
                      rows={5}
                      maxLength={{ length: 200, errorOnly: true }}
                      showWordLimit
                      wrapperStyle={{ width: '100%' }}
                      value='根据纠纷化解人员的协调,当事人双方同意如下调解协议:
                                  [简要说明协议第一条]
                                  [简要说明协议第二条]
                                  [……]
                                  本口头调解协议由纠纷化解人员记录,并已告知双方当事人。双方当事人确认无误。'
                    />
                  </FormItem>
                </Col>
                <Col span={24}>
                  <FormItem
                    label={
                      <>
                        <div style={{ display: 'flex' }}>
                          结案意见
                          <div className="must" style={{ marginLeft: '4px' }}>必填</div>
                        </div>
                      </>
                    }
                    field='caseDes'
                    rules={[{ message: '请填写事项概况', required: true }]}
                  >
                    <div className='tabs1' >
                      {tabs1.map((tab) => (
                        <div
                          key={tab.index}
                          style={{
                            color: selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(0,0,0,0.45)',
                            border: `1px solid ${selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(229,230,235,1)'}`,
                            borderRadius: '2px',
                            cursor: 'pointer',
                            padding: '0px 8px',
                          }}
                          onClick={() => handleTabChange1(tab.index)}
                        >
                          {tab.label}
                        </div>
                      ))}
                    </div>
 
                    <Input.TextArea
                      rows={5}
                      wrapperStyle={{ width: '100%' }}
                      value='鉴于以上协议内容已经双方确认,并认为该协议内容公平合理,能够妥善解决双方的纠纷。建议双方当事人按照协议内容执行,以实现纠纷的最终解决。'
                    />
                  </FormItem>
                </Col>
 
              </>
 
            }
            <Space style={{ marginBottom: '16px' }}>
              <Button type='primary'>提交</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }}>保存</Button>
            </Space>
          </Form>
        }
        {selectedTab === '2' &&
          <Form
            layout='vertical'
            requiredSymbol={false}
            scrollToFirstError={true}
            initialValues={{
              caseLevel: 3,
            }}//默认值
          >
            <Col span={24}>
              <FormItem
                label={<div style={{ display: 'flex' }}>
                  无法化解理由
                  <Tooltip onClick={() => setNoHandleReason(!noHandleReason)}>
                    <img src={question1} alt="" style={{ width: '13px', height: '13px', margin: '4px 4px 0px 4px' }} />
                  </Tooltip>
                  <div className="must" style={{ marginLeft: '4px' }}>必填</div>
                </div>
                }
                field='caseDes'
                rules={[{ message: '请填写事项概况', required: true }]}
              >
                <table border="1" align="center" cellpadding="8" className="table">
                  <tr>
                    <th bgcolor="#F7F8FA" className="table-title" width="120">调解过程中提供的解决方案</th>
                    <td>
                      <Input.TextArea
                        showWordLimit
                        rows={3}
                        placeholder='请完整描述事项概况,应具备5要素:发生时间+发生地点+人物情况+事项起因+事项经过'
                        wrapperStyle={{ width: '100%' }}
                      />
                    </td>
                  </tr>
                  <tr>
                    <th bgcolor="#F7F8FA" className="table-title">调解过程中的主要分歧点</th>
                    <td>
                      <Input.TextArea
                        showWordLimit
                        rows={3}
                        placeholder='请完整描述事项概况,应具备5要素:发生时间+发生地点+人物情况+事项起因+事项经过'
                        wrapperStyle={{ width: '100%' }}
                      />
                    </td>
                  </tr>
                  <tr>
                    <th bgcolor="#F7F8FA" className="table-title">最终难以调和的原因</th>
                    <td>
                      <Input.TextArea
                        showWordLimit
                        rows={3}
                        placeholder='请完整描述事项概况,应具备5要素:发生时间+发生地点+人物情况+事项起因+事项经过'
                        wrapperStyle={{ width: '100%' }}
                      />
                    </td>
                  </tr>
                </table>
              </FormItem>
            </Col>
            <Col span={24}>
              <FormItem
                label={
                  <>
                    <div style={{ display: 'flex' }}>
                      结案意见
                      <div className="must" style={{ marginLeft: '4px' }}>必填</div>
                    </div>
                  </>
                }
                field='caseDes'
                rules={[{ message: '请填写事项概况', required: true }]}
              >
                <div className='caseResult-textarea'>公共模板1:化解不成功结案意见范本</div>
                <Input.TextArea
                  rows={5}
                  wrapperStyle={{ width: '100%' }}
                  value='鉴于以上协议内容已经双方确认,并认为该协议内容公平合理,能够妥善解决双方的纠纷。建议双方当事人按照协议内容执行,以实现纠纷的最终解决。'
                />
              </FormItem>
            </Col>
            <Col span={24}>
              <FormItem
                label='是否转诉讼案件'
                field='caseDes'
              >
                <Radio.Group onChange={onChange} value={radioValue}>
                  <Space direction="vertical">
                    <Radio value={1}>否</Radio>
                    <Radio value={2}>是</Radio>
                  </Space>
                </Radio.Group>
              </FormItem>
            </Col>
            <Col span={24}>
              <FormItem
                label='是否转诉诉讼案号讼案件'
                field='caseDes'
              >
                <Input style={{ width: 350 }} placeholder='请输入法院立案号' />
              </FormItem>
            </Col>
            <Space style={{ marginBottom: '16px' }}>
              <Button type='primary'>提交</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }}>保存</Button>
            </Space>
          </Form>
        }
      </Modal>
      <DocumentScanner
        visible={scanFile}
        onConfirm={handleConfirm}
        onCancel={handleCancel}
      />
      <NoHandleReason
        visible={noHandleReason}
        onClose={() => setNoHandleReason(false)}
      />
    </>
  )
}
 
export default CaseResult;