From a52d2b801ac2aa6148ae78a5306a13a354abf7d2 Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Fri, 13 Sep 2024 18:32:39 +0800
Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh
---
gz-customerSystem/src/views/register/eventFlow/component/BackModel.jsx | 147 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 144 insertions(+), 3 deletions(-)
diff --git a/gz-customerSystem/src/views/register/eventFlow/component/BackModel.jsx b/gz-customerSystem/src/views/register/eventFlow/component/BackModel.jsx
index e59235e..5eae568 100644
--- a/gz-customerSystem/src/views/register/eventFlow/component/BackModel.jsx
+++ b/gz-customerSystem/src/views/register/eventFlow/component/BackModel.jsx
@@ -1,12 +1,153 @@
-import React from 'react'
-import { Form, Input, Button, Radio, Select, Modal, Cascader, Upload, Message } from '@arco-design/web-react';
+import React, { useEffect, useRef, useState } from 'react'
+import { Row, Col } from 'antd';
+import { Form, Input, Button, Radio } from '@arco-design/web-react';
+import ArcoUpload from '@/components/ArcoUpload';
+import { Scrollbars } from "react-custom-scrollbars";
+import * as $$ from '@/utils/utility';
+import { useNavigate } from 'react-router-dom';
+
+const RadioGroup = Radio.Group;
+const FormItem = Form.Item;
+const TextArea = Input.TextArea;
+const appUrl = $$.appUrl;
+
+function getId() {
+ return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' });
+}
+
+function delFile(id) {
+ return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } });
+}
+
+function returnApply(data) {
+ return $$.ax.request({ url: `caseTask/returnApply`, type: 'post', service: 'mediate', data });
+}
export default function BackModel(props) {
- const handleSubmit = () => {
+ const navigate = useNavigate();
+ const formRef = useRef();
+ const [id, setId] = useState();
+ const options = [
+ {
+ label: '不属于本部门的职能范围',
+ value: 1
+ },
+ {
+ label: '超出本部门管辖范围',
+ value: 2
+ },
+ {
+ label: '重复上报',
+ value: 3
+ },
+ {
+ label: '无法与当事人取得联系',
+ value: 4
+ },
+ {
+ label: '其他',
+ value: 5
+ },
+ ]
+ useEffect(() => {
+ getAppId()
+ }, [])
+
+ //获取id
+ const getAppId = async () => {
+ const res = await getId()
+ if (res.type) {
+ setId(res.data)
+ }
}
+
+ const handleSubmit = () => {
+ if (formRef.current) {
+ formRef.current.validate(undefined, (errors, values) => {
+ if (!errors) {
+ handleReturn({
+ id,
+ caseId: props.caseId,
+ caseTaskId: props.caseTaskId,
+ returnContent: values.returnContent
+ })
+ }
+ })
+ }
+ }
+
+ //删除文件
+ const handleDelFile = async (id) => {
+ const res = await delFile(id)
+ if (res.type) {
+ $$.infoSuccess({ content: '删除成功!' });
+ }
+ }
+
+ //回退请求
+ const handleReturn = async (data) => {
+ const res = await returnApply(data)
+ if (res.type) {
+ $$.infoSuccess({ content: '提交申请成功!' });
+ props.onCancel()
+ navigate('/mediate/visit/visitWorkBench')
+ }
+ }
+
return (
<div>
+ <Scrollbars style={{ height: '550px' }} autoHide>
+ <Form
+ ref={formRef}
+ layout='vertical'
+ requiredSymbol={false}
+ initialValues={{
+ }}//默认值
+ scrollToFirstError
+ >
+ <Row>
+ <Col span={24}>
+ <FormItem
+ label={(<div style={{ display: 'flex' }}>回退理由<div className="must">必填</div></div>)}
+ field='backType'
+ rules={[{ required: true, message: '请选择回退理由' }]}
+ >
+ <RadioGroup
+ direction='vertical'
+ options={options}
+ onChange={(value) => {
+ const obj = options.find(item => item.value === value)
+ formRef.current.setFieldValue('returnContent', obj.label)
+ }}
+ />
+ </FormItem>
+ </Col>
+ <Col span={24}>
+ <FormItem
+ label=' '
+ field='returnContent'
+ rules={[{ required: true, message: '回退理由不能为空' }]}
+ >
+ <TextArea
+ autoSize={{ minRows: 4, maxRows: 8 }}
+ placeholder='请填写回退的具体理由'
+ />
+ </FormItem>
+ </Col>
+ <Col span={24} className="doubleFile">
+ <ArcoUpload
+ params={{
+ action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.caseId}&ownerId=${id}&ownerType=22_00018-510`,
+ }}
+ field='file'
+ label='附件材料'
+ handleDelFile={handleDelFile}
+ />
+ </Col>
+ </Row>
+ </Form>
+ </Scrollbars>
<div className='dialogFooter'>
<Button
type="primary"
--
Gitblit v1.8.0