From 86df8c2c269721e5ac76b41e740fb0647eda1f27 Mon Sep 17 00:00:00 2001
From: liuwh <964324856@qq.com>
Date: Tue, 10 Sep 2024 16:59:49 +0800
Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master

---
 gz-customerSystem/src/views/register/eventFlow/component/EscalationModel.jsx |   68 ++++++++++++++++++++++++++++++---
 1 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/gz-customerSystem/src/views/register/eventFlow/component/EscalationModel.jsx b/gz-customerSystem/src/views/register/eventFlow/component/EscalationModel.jsx
index 6ccf1a5..9db6691 100644
--- a/gz-customerSystem/src/views/register/eventFlow/component/EscalationModel.jsx
+++ b/gz-customerSystem/src/views/register/eventFlow/component/EscalationModel.jsx
@@ -1,27 +1,81 @@
-import React, { useRef } from 'react'
+import React, { useEffect, useRef, useState } from 'react'
 import { Row, Col } from 'antd';
 import { Form, Input, Button } from '@arco-design/web-react';
 import ArcoUpload from '@/components/ArcoUpload';
 import { Scrollbars } from "react-custom-scrollbars";
 import { escalation } from '@/assets/images/icon';
+import * as $$ from '@/utils/utility';
 
 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 appearApply(data) {
+  return $$.ax.request({ url: `caseTask/appearApply`, type: 'post', service: 'mediate', data });
+}
 
 export default function BackModel(props) {
   const formRef = useRef();
+  const [id, setId] = useState()
+
+  useEffect(() => {
+    getAppId()
+  }, [])
+
+  //获取id
+  const getAppId = async () => {
+    const res = await getId()
+    if (res.type) {
+      setId(res.data)
+    }
+  }
 
   const handleSubmit = () => {
     formRef.current.validate(undefined, (errors, values) => {
-      console.log(errors, values);
+      if (formRef.current) {
+        formRef.current.validate(undefined, (errors, values) => {
+          if (!errors) {
+            handleEscala({
+              id,
+              caseId: props.caseId,
+              returnContent: values.returnContent
+            })
+          }
+        })
+      }
     })
   }
 
   const handleTemplate = (type) => {
     if(type === 1) {
-      formRef.current.setFieldValue('trueName', '经初步核查,该事项较为复杂,且涉及多个相关部门的协调配合,为确保能够高效、妥善地解决当事人的问题,特此请求上级给予指导和支持。')
+      formRef.current.setFieldValue('returnContent', '经初步核查,该事项较为复杂,且涉及多个相关部门的协调配合,为确保能够高效、妥善地解决当事人的问题,特此请求上级给予指导和支持。')
     } else {
-      formRef.current.setFieldValue('trueName', '')
+      formRef.current.setFieldValue('returnContent', '')
+    }
+  }
+
+  //上报请求
+  const handleEscala = async (data) => {
+    const res = await appearApply(data)
+    if (res.type) {
+      $$.infoSuccess({ content: '提交申请成功!' });
+      props.onCancel()
+    }
+  }
+
+  //删除文件
+  const handleDelFile = async (id) => {
+    const res = await delFile(id)
+    if (res.type) {
+      $$.infoSuccess({ content: '删除成功!' });
     }
   }
 
@@ -54,10 +108,9 @@
               </div>
               <FormItem
                 label={(<div style={{ display: 'flex' }}>上报意见<div className="must">必填</div></div>)}
-                field='trueName'
+                field='returnContent'
                 rules={[{ required: true, message: '请选择回退理由' }]}
               >
-
                 <TextArea
                   autoSize={{ minRows: 4, maxRows: 8 }}
                   placeholder='请填写回退的具体理由'
@@ -68,10 +121,11 @@
             <Col span={24} className="doubleFile">
               <ArcoUpload
                 params={{
-                  action: ``,
+                  action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${props.caseId}&ownerId=${id}&ownerType=22_00018-512`,
                 }}
                 field='file'
                 label='附件材料'
+                handleDelFile={handleDelFile}
               />
             </Col>
           </Row>

--
Gitblit v1.8.0