From 58ae2ba21efcd85df331cf996a94038a77302b51 Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Wed, 27 May 2020 17:07:48 +0800
Subject: [PATCH] 修改报错问题

---
 SunshineIns/src/page/ExamineEdit.jsx |   87 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 77 insertions(+), 10 deletions(-)

diff --git a/SunshineIns/src/page/ExamineEdit.jsx b/SunshineIns/src/page/ExamineEdit.jsx
index 63d228e..7a12266 100644
--- a/SunshineIns/src/page/ExamineEdit.jsx
+++ b/SunshineIns/src/page/ExamineEdit.jsx
@@ -6,6 +6,7 @@
 import HeadView from '../view/HeadView';
 import BusDetailView from '../view/BusDetailView';
 import TableView from '../view/TableView';
+import LineView from "../view/LineView";
 import ImageBoxView from '../view/ImageBoxView'
 // 引入编辑器以及编辑器样式
 import Fetch from '../fetch';
@@ -49,7 +50,8 @@
             status: '',
             loading: false,
             opinion: '',
-            modalLoading:false,
+            modalLoading: false,
+            disabled: false,
         };
     }
 
@@ -68,8 +70,9 @@
                     savedate: {
                         ...res,
                     },
+                    disabled: res.status == 1 ? false : true,
                     loading: false,
-                    fileList: res.list ? res.list.map((item, index) => ({ uid: uid, id: item.uid, name: item.name, status: 'done', url: domain + `/api/v1/attachment/download/${item.uid}?online=false` })) : []
+                    fileList: res.list ? res.list.map((item, index) => ({ uid: item.uid, id: item.uid, name: item.name, status: 'done', url: domain + `/api/v1/attachment/download/${item.uid}?online=false` })) : []
                 });
 
             })
@@ -105,7 +108,7 @@
     }
 
     cancle = () => {
-        this.props.history.push("/entry/applyFor");
+        this.props.history.push("/entry/examine");
     }
     handlePreview = (file) => {
         this.setState({
@@ -232,8 +235,10 @@
 
     handleCancel = () => this.setState({ previewVisible: false })
     render() {
-        const { savedate, opinion, fileList, loading } = this.state;
+        const { savedate, opinion, fileList, loading, disabled } = this.state;
         console.log('list', fileList)
+        console.log('disabled', disabled)
+        console.log('savedate', savedate)
         const props = {
             action: domain + `api/v1/attachment/materials?associateTypeId=1019&entityId=` + savedate.id,
             onChange: ({ file, fileList }) => {
@@ -262,7 +267,7 @@
                 <Spin spinning={loading}>
                     <HeadView history={this.props.history} />
                     <Breadcrumb style={{ padding: '20px' }}>
-                        <Breadcrumb.Item><a href="index.html#/entry/applyFor">检察院审核</a></Breadcrumb.Item>
+                        <Breadcrumb.Item><a href="index.html#/entry/examine">检察院审核</a></Breadcrumb.Item>
                         <Breadcrumb.Item>检察院审核详情</Breadcrumb.Item>
                     </Breadcrumb>
                     <BusDetailView type='检察院审核' >
@@ -304,14 +309,76 @@
                             <Row type="flex" align='middle' justify="space-around">
                                 <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>审批意见</span></Col>
                                 <Col span={18} push={0} >
-                                    <TextArea rows={4} placeholder="请输入审批意见" style={{ width: '92%' }} value={opinion || ""} onChange={this.saveInputChange} name='opinion' /></Col>
+                                    <TextArea disabled={disabled} rows={4} placeholder="请输入审批意见" style={{ width: '92%' }} value={opinion || ""} onChange={this.saveInputChange} name='opinion' /></Col>
                             </Row>
                         </div>
-                        <div style={{ display: 'flex', justifyContent: 'center' }}>
-                            <Button style={{ marginRight: '15px', width: '150px' }} type="primary" onClick={this.showModal}>提交</Button>
-                            <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button>
-                        </div>
 
+                        {
+                            savedate.approveLogs ?
+                                <LineView title="审核记录" style="15vh">
+                                    {
+                                        savedate.approveLogs.length == 1 ?
+                                            <table>
+                                                <tbody>
+                                                    <tr>
+                                                        <td className="table-vaule1">检察院审核人</td>
+                                                        <td className="table-vaule2">{savedate.approveLogs[0].approverName}</td>
+                                                        <td className="table-vaule3">检察院审核时间</td>
+                                                        <td className="table-vaule4">{moment(savedate.approveLogs[0].createTime).format('YYYY/MM/DD HH:mm:ss')}</td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td className="table-vaule1">检察院回复内容</td>
+                                                        <td className="table-vaule2">{savedate.approveLogs[0].opinion}</td>
+                                                    </tr>
+                                                </tbody>
+                                            </table>
+                                            : savedate.approveLogs.length == 2 ?
+                                                <React.Fragment>
+                                                    <table>
+                                                        <tbody>
+                                                            <tr>
+                                                                <td className="table-vaule1">检察院审核人</td>
+                                                                <td className="table-vaule2">{savedate.approveLogs[0].approverName}</td>
+                                                                <td className="table-vaule3">检察院审核时间</td>
+                                                                <td className="table-vaule4">{moment(savedate.approveLogs[0].createTime).format('YYYY/MM/DD HH:mm:ss')}</td>
+                                                            </tr>
+                                                            <tr>
+                                                                <td className="table-vaule1">检察院回复内容</td>
+                                                                <td className="table-vaule2">{savedate.approveLogs[0].opinion}</td>
+                                                            </tr>
+                                                        </tbody>
+                                                    </table><table>
+                                                        <tbody>
+                                                            <tr>
+                                                                <td className="table-vaule1">公安审核人</td>
+                                                                <td className="table-vaule2">{savedate.approveLogs[1].approverName}</td>
+                                                                <td className="table-vaule3">公安审核时间</td>
+                                                                <td className="table-vaule4">{moment(savedate.approveLogs[1].createTime).format('YYYY/MM/DD HH:mm:ss')}</td>
+                                                            </tr>
+                                                            <tr>
+                                                                <td className="table-vaule1">公安回复内容</td>
+                                                                <td className="table-vaule2">{savedate.approveLogs[1].opinion}</td>
+                                                            </tr>
+                                                        </tbody>
+                                                    </table>
+                                                </React.Fragment> : ''
+                                    }
+                                </LineView>
+                                : ''
+                        }
+
+                        {
+
+                            savedate.status == 1 ?
+                                <div style={{ display: 'flex', justifyContent: 'center' }}>
+                                    <Button style={{ marginRight: '15px', width: '150px' }} type="primary" onClick={this.showModal}>提交</Button>
+                                    <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button>
+                                </div>
+                                :
+                                <div style={{ display: 'flex', justifyContent: 'center' }}>
+                                    <Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button>
+                                </div>
+                        }
                     </BusDetailView>
 
                     <Modal

--
Gitblit v1.8.0