From a0ec2242677dced1e6e098c114460da3d56be157 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Tue, 31 Mar 2020 05:48:24 +0800
Subject: [PATCH] 提交

---
 SunshineIns/src/page/QuestionDetail.jsx |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/SunshineIns/src/page/QuestionDetail.jsx b/SunshineIns/src/page/QuestionDetail.jsx
index 709e7e8..90c9703 100644
--- a/SunshineIns/src/page/QuestionDetail.jsx
+++ b/SunshineIns/src/page/QuestionDetail.jsx
@@ -2,8 +2,13 @@
 import { Input, Button, DatePicker, Divider, message, Popconfirm, Select, Badge, Spin, Breadcrumb } from 'antd';
 import Questionnair from '../page/Questionnair'
 import Fetch from '../fetch'
+import TableView from '../view/TableView';
 import HeadView from '../view/HeadView';
 
+import moment from 'moment';
+const divStyle = {
+  margin: '20px'
+}
 export default class QuestionDetail extends React.Component {
   constructor(props) {
     super(props);
@@ -11,8 +16,8 @@
       loading: false,
       data: [],
       initData: null,
-      btnLoading: false
-
+      btnLoading: false,
+      dateSource: []
     };
   }
 
@@ -26,11 +31,20 @@
     });
     Fetch.questionFindById(id).then(res => {
       console.log('res', res);
+      console.log('res.mps', res.submitMaps);
       this.setState({
         loading: false,
-        initData: res
+        initData: res,
+        dateSource: res.submitMaps || [],
       })
     })
+  }
+
+
+  showModal = (userId) => {
+    const { id } = this.props.match.params;
+    console.log(id)
+    this.props.history.push("/questionnaire/persondetail/" + id + '/' + userId);
   }
 
   submitQuestionTemp = (questionDtos, extraData) => {
@@ -69,7 +83,26 @@
 
   render() {
 
-    const { data, loading, resetKey, initData, btnLoading } = this.state;
+    const { data, loading, resetKey, initData, btnLoading, dateSource } = this.state;
+    console.log(dateSource)
+    const act2columns = [{
+      title: '提交人昵称',
+      dataIndex: 'userName',
+      key: 'userName'
+    },
+    {
+      title: '提交时间',
+      dataIndex: 'createTime',
+      key: 'createTime',
+      render: text => <span>{text || ''}</span>
+    }, {
+      title: '操作',
+      dataIndex: 'isHit',
+      key: 'isHit',
+      render: (text, record) => (
+        <label className='theme-color' onClick={() => this.showModal(record.userId)} style={{ cursor: 'pointer' }}>查看</label>
+      )
+    }];
     return (
       <div className="app-page">
         <HeadView history={this.props.history} />
@@ -115,6 +148,14 @@
               {initData && initData.questionDtos.map((item, index) => (
                 <Questionnair.Editor editor={item} acitveAnswer={true} key={item.questionId} index={index} />
               ))}
+
+              {
+                dateSource.length > 0 ?
+                  <div style={divStyle}>
+                    <Divider orientation="left" style={{ margin: '20px', width: '97%' }}>问卷提交记录</Divider>
+                    <TableView columns={act2columns} data={dateSource} pageSize='6' size='small' />
+                  </div> : null
+              }
             </React.Fragment>
         }
 

--
Gitblit v1.8.0