Эх сурвалжийг харах

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

RaoMeng 6 жил өмнө
parent
commit
c083211d67

+ 16 - 8
frontend/wechat-web/src/configs/api.config.js

@@ -63,9 +63,9 @@ export const API = {
 
 
     //创建投票单
-    voteCreate: _baseURL + '/vote/voteCreate',//投票创建
-    voteList: _baseURL + "/vote/voteList",//家长端
-    voteListTeacher: _baseURL + "/vote/voteListForTeacher",//教师端
+    voteCreate: _baseURL + '/wxSchool/vote/voteCreate',//投票创建
+    voteList: _baseURL + "/wxSchool/vote/voteListParent",//家长端
+    voteListTeacher: _baseURL + "/wxSchool/vote/voteListForTeacher",//教师端
     voteDetail: _baseURL + "/vote/voteDetail",//投票详情
     voteAction: _baseURL + "/vote/voteAction",//投票
     //发布作业
@@ -87,13 +87,13 @@ export const API = {
     getScoreByStuId: _baseURL + '/score/getScoreByStuId',
 
     //OA单据创建
-    oaCreate: _baseURL + '/oaApprove/oaCreate',
+    oaCreate: _baseURL + '/wxSchool/oaApprove/oaCreate',
     //审批列表
-    oaApproveList: _baseURL + '/oaApprove/oaList',
+    oaApproveList: _baseURL + '/wxSchool/oaApprove/oaList',
     //审批操作
-    doapprove: _baseURL + '/oaApprove/approve',
+    doapprove: _baseURL + '/wxSchool/oaApprove/approve',
     //审批单详情
-    oaDetails: _baseURL + '/oaApprove/oaDetails',
+    oaDetails: _baseURL + '/wxSchool/oaApprove/oaDetails',
 
     //获取分值条件
     getCurr: _baseURL + '/score/getCurr',
@@ -113,7 +113,15 @@ export const API = {
     //会议签到
     MEETING_SIGN: _baseURL + '/wxSchool/meeting/meetingSign',
     //删除会议
-    deleteMeeting: _baseURL + '/wxSchool/meeting/deleteMeeting',
+    deleteMeeting:_baseURL + '/wxSchool/meeting/deleteMeeting',
+    //通过验证码修改手机号
+    updatePhone: _baseURL + '/wxSchool/user/updatePhone',
+    //成绩通知
+    getScoreByStu: _baseURL + '/wxSchool/stuScore/getScoreByStu',
+    //获取家长和老师所有对象
+    getClazzByTeacherId:_baseURL + '/wxSchool/user/getClazzByTeacherId',
+    //学生端  学生所在班级的课表  按星期的每天分map
+    curriculumListByTeacherId:_baseURL + '/wxSchool/clazzCurriculum/curriculumListByTeacherId',
 
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////

+ 66 - 73
frontend/wechat-web/src/modules/hiPages/approvel-detail/ApprovelDetail.js

@@ -18,7 +18,7 @@ import {Toast} from 'antd-mobile';
 import {connect} from 'react-redux';
 import ImagesViewer from '../../../components/imagesVIewer/index';
 
- class ApprovelDetail extends Component{
+class ApprovelDetail extends Component{
     constructor(){
         super();
         this.state = {
@@ -49,42 +49,42 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
             handleStatus:null //审批操作1:同意,2:不同意
         }
     }
-     render(){
-         const {pictureList} = this.state
-         let pictureItems = []
-         let pictureUrls = []
-         for (let i = 0; i < pictureList.length; i++) {
-             const pictureUrl = pictureList[i]
-             pictureUrls.push(pictureUrl)
-             if (!isObjEmpty(pictureUrl)) {
-                 pictureItems.push(
-                     i > 20 ?
-                         <LazyLoad throttle={200} height={300} once overflow>
-                             <CSSTransition
-                                 timeout={2000}
-                                 classNames='fade'
-                                 appear={true}
-                                 key={i}>
-                                 <div className='pictureItem'>
-                                     <img src={pictureUrl}  onClick={this.handlePreview.bind(this, pictureUrl, i)}/>
-                                 </div>
-                             </CSSTransition>
-                         </LazyLoad> :
-                         <div className='pictureItem'>
-                             <img src={pictureUrl}  onClick={this.handlePreview.bind(this, pictureUrl, i)}/>
-                         </div>
-                 )
-             }
-         }
+    render(){
+        const {pictureList} = this.state
+        let pictureItems = []
+        let pictureUrls = []
+        for (let i = 0; i < pictureList.length; i++) {
+            const pictureUrl = pictureList[i]
+            pictureUrls.push(pictureUrl)
+            if (!isObjEmpty(pictureUrl)) {
+                pictureItems.push(
+                    i > 20 ?
+                        <LazyLoad throttle={200} height={300} once overflow>
+                            <CSSTransition
+                                timeout={2000}
+                                classNames='fade'
+                                appear={true}
+                                key={i}>
+                                <div className='pictureItem'>
+                                    <img src={pictureUrl}  onClick={this.handlePreview.bind(this, pictureUrl, i)}/>
+                                </div>
+                            </CSSTransition>
+                        </LazyLoad> :
+                        <div className='pictureItem'>
+                            <img src={pictureUrl}  onClick={this.handlePreview.bind(this, pictureUrl, i)}/>
+                        </div>
+                )
+            }
+        }
         return(
             <div ref={node => this.node = node}>
-               <div className="headerDiv">
-                   <img className="headerImg" src={hi1_img} alt=""/>
-                   <div style={{marginTop:10}}>
-                       <div style={{color:"#000000",fontSize:15}}>{this.state.docModel.proposer.value}</div>
-                       <div style={{color:"#666666",fontSize:12,marginTop:10}}>{this.state.docModel.oaApprove.creatDate}</div>
-                   </div>
-               </div>
+                <div className="headerDiv">
+                    <img className="headerImg" src={hi1_img} alt=""/>
+                    <div style={{marginTop:10}}>
+                        <div style={{color:"#000000",fontSize:15}}>{this.state.docModel.proposer.value}</div>
+                        <div style={{color:"#666666",fontSize:12,marginTop:10}}>{this.state.docModel.oaApprove.creatDate}</div>
+                    </div>
+                </div>
                 <div className="comhline_sty"></div>
 
                 <div style={{marginTop:10}}>
@@ -114,13 +114,13 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
                     ></ItemApprovel>
                 </div>
                 {this.state.showButton ?  <div style={{display:'flex',flexDirection:'row',marginBottom:20}} >
-                        <div style={{width:'50%',textAlign:'center'}}>
-                            <Button  type="primary" className="agree_sty" onClick={this.handleStatusClick.bind(this,1)}>同意</Button>
-                        </div>
-                        <div style={{width:'50%',textAlign:'center'}}>
-                            <Button className="disagree_sty" onClick={this.handleStatusClick.bind(this,2)}>不同意</Button>
-                        </div>
-                    </div> : ''}
+                    <div style={{width:'50%',textAlign:'center'}}>
+                        <Button  type="primary" className="agree_sty" onClick={this.handleStatusClick.bind(this,1)}>同意</Button>
+                    </div>
+                    <div style={{width:'50%',textAlign:'center'}}>
+                        <Button className="disagree_sty" onClick={this.handleStatusClick.bind(this,2)}>不同意</Button>
+                    </div>
+                </div> : ''}
                 <Modal
                     title={this.state.AMTitle}
                     visible={this.state.AMvisible}
@@ -128,9 +128,9 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
                     onOk={this.doApprovel.bind(this,1)}
                     cancelText={'取消'}
                     onCancel={this.doApprovel.bind(this,0)}>
-                   <div onChange={this.handelValueCom}>
-                       <textarea autoFocus="autoFocus" ref='approveOpinion' className="form-control" rows="5" placeholder="填写意见说明(非必填)" ></textarea>
-                   </div>
+                    <div onChange={this.handelValueCom}>
+                        <textarea autoFocus="autoFocus" ref='approveOpinion' className="form-control" rows="5" placeholder="填写意见说明(非必填)" ></textarea>
+                    </div>
                 </Modal>
                 {this.state.previewVisible ?
                     <ImagesViewer onClose={this.handleCancel} urls={pictureUrls}
@@ -139,21 +139,21 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
             </div>
         )
     }
-     handleCancel = () => this.setState({previewVisible: false})
-     handlePreview = (url, index) => {
-         this.setState({
-             previewImage: url,
-             previewVisible: true,
-             previewIndex: index
-         });
-     }
+    handleCancel = () => this.setState({previewVisible: false})
+    handlePreview = (url, index) => {
+        this.setState({
+            previewImage: url,
+            previewVisible: true,
+            previewIndex: index
+        });
+    }
     handleStatusClick = (status)=>{
-         var statusTitle = null
-         if(status == 1){
-             statusTitle = '同意'
-         }else if(status == 2){
-             statusTitle = '不同意'
-         }
+        var statusTitle = null
+        if(status == 1){
+            statusTitle = '同意'
+        }else if(status == 2){
+            statusTitle = '不同意'
+        }
         // console.log('您点击了',statusTitle)
         this.setState({
             AMvisible:true,
@@ -168,12 +168,14 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
         if(order == 0){
             return
         }
-        fetchPost(API.doapprove,{
-            userId:this.props.userInfo.userId,
+        let params = {
+            teacherId:this.props.userInfo.userId,
             approveId:this.state.approveId,
             status:this.state.handleStatus,
             approveOpinion:this.state.approveOpinion
-        },{}).then((response)=>{
+        }
+        console.log("params",params)
+        fetchPost(API.doapprove,params,{}).then((response)=>{
             if(response.success && response.data){
                 Toast.show(response.data,1)
                 this.setState({
@@ -200,15 +202,7 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
     componentWillMount() {
         document.title = '审批详情';
     }
-    componentWillReceiveProps(newProps) {
-    }
-    shouldComponentUpdate(newProps, newState) {
-        return true;
-    }
-    componentWillUpdate(nextProps, nextState) {
-    }
-    componentDidUpdate(prevProps, prevState) {
-    }
+
     componentWillUnmount() {
         Toast.hide()
         clearTimeout(this.backTask)
@@ -216,7 +210,6 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
     componentDidMount() {
         this.node.scrollIntoView();
         this.setState({
-           // pictureList: this.state.pictureList.concat(pictures, pictures),
             approveId:this.props.match.params.approveId,
             isMyApply:this.props.match.params.isMyApply
         },function () {
@@ -251,7 +244,7 @@ import ImagesViewer from '../../../components/imagesVIewer/index';
                             docModel: response.data,
                             pictureList:pictureList
                         },function () {
-                             console.log('pictureList',this.state.pictureList)
+                            console.log('pictureList',this.state.pictureList)
                         })
                         // console.log('showbutton',showbutton)
                         // console.log('approveStatus',approveStatus)

+ 2 - 1
frontend/wechat-web/src/modules/hiPages/approvel/Approvel.css

@@ -1,5 +1,6 @@
 .item-Style{
-    margin: 10px;background-color: #FFFFFF;height: 76px;border-radius: 6px;display: flex;flex-direction: row;
+    margin: 0px 10px;background-color: #FFFFFF;height: 76px;border-radius: 6px;display: flex;flex-direction: row;width: auto;
+    width: 53vh;
 }
 .img_sty{
     height:45px;width: 45px;margin: 15px 10px;

+ 23 - 24
frontend/wechat-web/src/modules/hiPages/approvel/Approvel.js

@@ -18,6 +18,7 @@ import {Toast} from 'antd-mobile';
 import {connect} from 'react-redux';
 import RefreshLayout from "../../../components/RefreshLayout";
 import {Skeleton, List} from 'antd';
+import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
 
 
 let mySwiper;
@@ -35,8 +36,8 @@ class Approvel extends Component {
             approvelList: [],
             isMyApplyRefreshing: false,
             isMyApproveRefreshing: false,
-            isMyapplyding: true,
-            isMyapproveding: true,
+            isMyapplydload: true,
+            isMyapprovedload: true,
             height: document.documentElement.clientHeight,
         }
     }
@@ -62,7 +63,6 @@ class Approvel extends Component {
                 }
             }
         })
-
         this.getMyApplyData();
         this.getMyApproveData();
     }
@@ -78,7 +78,7 @@ class Approvel extends Component {
                     <List dataSource={this.state.applyList}
                           renderItem={applyListBean => (
                               <List.Item>
-                                  <ApprovelItem itemdata={applyListBean} type={1}/>
+                                  <ApprovelItem itemdata={applyListBean} isMyApply={true}/>
                               </List.Item>
                           )}/>
                 </Skeleton>
@@ -89,11 +89,11 @@ class Approvel extends Component {
                 refreshing={this.state.isMyApproveRefreshing}
                 onRefresh={this.getMyApproveData}
                 height={this.state.height}>
-                <Skeleton loading={this.state.isMyapproveding} active paragraph={{rows: 3}}>
+                <Skeleton loading={this.state.isMyapprovedload} active paragraph={{rows: 3}}>
                     <List dataSource={this.state.approvelList}
                           renderItem={approvelListBean => (
                               <List.Item>
-                                  <ApprovelItem itemdata={approvelListBean} type={2}/>
+                                  <ApprovelItem itemdata={approvelListBean}isMyApply={false}/>
                               </List.Item>
                           )}/>
                 </Skeleton>
@@ -118,11 +118,9 @@ class Approvel extends Component {
                      }}>
                     <div className="swiper-wrapper">
                         <div className="swiper-slide">
-                            {/*{this.state.applyList.map((itemdata,index) => <ApprovelItem isMyApply={true} type={1} index={index} itemata = {itemdata} clickApplyItem ={this.clickApplyItem} ></ApprovelItem>)}*/}
                             {isMyapplyItems}
                         </div>
                         <div className="swiper-slide">
-                            {/*{this.state.approvelList.map((itemdata,index) => <ApprovelItem isMyApply={false}  type={2} index={index} itemata = {itemdata} clickApprovelItem ={this.clickApprovelItem} ></ApprovelItem>)}*/}
                             {isMyapproveItems}
                         </div>
                     </div>
@@ -140,8 +138,9 @@ class Approvel extends Component {
         } catch (e) {
 
         }
+
         fetchGet(API.oaApproveList, {
-            userId: this.props.userInfo.userId,
+            teacherId: this.props.userInfo.userId,
             pageIndex: myApplypageIndex,
             pageSize: mPageSize
         }, {}).then((response) => {
@@ -149,18 +148,17 @@ class Approvel extends Component {
                 if (myApplypageIndex == 1) {
                     this.setState({
                         applyList: response.data.proposes,
-                        // approvelList:response.data.approves
                     })
-                } else {
+                } else if(response.data.proposes.length > 0){
                     this.setState({
                         applyList: this.state.applyList.push(response.data.proposes),
-                        // approvelList:this.state.approvelList.push(response.data.approves)
                     })
                 }
+                console.log("applyList",this.state.applyList)
             }
             this.setState({
                 isMyApplyRefreshing: false,
-                isMyApproveRefreshing: false,
+                isMyapplydload: false,
             })
         }).catch((error) => {
             if (typeof error === 'string') {
@@ -168,10 +166,10 @@ class Approvel extends Component {
             } else {
                 Toast.fail('请求异常', 2)
             }
-        })
-        this.setState({
-            isMyApplyRefreshing: false,
-            isMyApproveRefreshing: false,
+            this.setState({
+                isMyApplyRefreshing: false,
+                isMyapplydload: false,
+            })
         })
     }
 
@@ -184,29 +182,30 @@ class Approvel extends Component {
         } catch (e) {
 
         }
+        // Toast.loading("获取数据中...", 0)
+        // Toast.hide()
         fetchGet(API.oaApproveList, {
-            userId: this.props.userInfo.userId,
+            teacherId: this.props.userInfo.userId,
             pageIndex: myApprovepageIndex,
             pageSize: mPageSize
         }, {}).then((response) => {
             if (response.success && response.data) {
                 if (myApprovepageIndex == 1) {
                     this.setState({
-                        // applyList:response.data.proposes,
                         approvelList: response.data.approves
                     })
-                } else {
+                } else if(response.data.approves.length > 0){
                     this.setState({
-                        // applyList:this.state.applyList.push(response.data.proposes),
                         approvelList: this.state.approvelList.push(response.data.approves)
                     })
                 }
-
+                console.log("approvelList",this.state.approvelList)
             }
             this.setState({
-                isMyApplyRefreshing: false,
                 isMyApproveRefreshing: false,
+                isMyapprovedload: false,
             })
+
         }).catch((error) => {
             if (typeof error === 'string') {
                 Toast.fail(error, 2)
@@ -214,8 +213,8 @@ class Approvel extends Component {
                 Toast.fail('请求异常', 2)
             }
             this.setState({
-                isMyApplyRefreshing: false,
                 isMyApproveRefreshing: false,
+                isMyapprovedload: false,
             })
         })
     }

+ 26 - 13
frontend/wechat-web/src/modules/hiPages/approvel/ApprovelItem.js

@@ -1,7 +1,7 @@
 /**
-*   Created by FANGlh on 2018/11/26 12:41.
-*   Desc:
-*/
+ *   Created by FANGlh on 2018/11/26 12:41.
+ *   Desc:
+ */
 
 import React,{Component} from 'react';
 import './Approvel.css';
@@ -10,32 +10,45 @@ import icon_res from '../../../style/imgs/res_img.png';
 import icon_trip from '../../../style/imgs/trip_img.png';
 import icon_leave from '../../../style/imgs/leave_img.png';
 import {Link} from 'react-router-dom';
+import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
+
 
 export default class ApprovelItem extends Component{
     constructor(props){
         super(props);
         this.state={
-            // imgheader:this.props.itemata.approveType == 1 ? icon_trip : (this.props.itemata.approveType == 2 ? icon_res : icon_out),
-            isMyApply:props.isMyApply,
-            // status:this.props.itemata.approveStatus == 1 ? "待审批" :"已审批"
+            itemdata:this.props.itemdata,
+            isMyApply:this.props.isMyApply,
+            approveId:this.props.itemdata.approveId
         }
     }
+    componentDidMount(){
+        this.setState({
+            itemdata:this.props.itemdata,
+            isMyApply:this.props.isMyApply,
+            approveId:this.props.itemdata.approveId
+        },function () {
+            console.log('itemdata',this.state.itemdata)
+        })
+
+    }
     render(){
 
+        const {itemdata,isMyApply,approveId} = this.state
         return(
-            <Link to={"/approvel-detail/" + this.props.itemata.approveId +"/"+this.props.isMyApply}>
-                <div className="item-Style" onClick={this.ItemClick.bind(this,this.state.isMyApply,this.props.itemata)}>
+            <Link to={"/approvel-detail/" + approveId +"/"+isMyApply}>
+                <div className="item-Style" onClick={this.ItemClick.bind(this,isMyApply,itemdata)}>
                     <div style={{width:76,height:'100%'}}>
-                        <img src={this.props.itemata.approveType == 1 ? icon_trip : (this.props.itemata.approveType == 2 ? icon_res : icon_leave)} className={this.state.isMyApply==true?'img_sty':"img_circle"}/>
+                        <img src={itemdata.approveType == 1 ? icon_trip : (itemdata.approveType == 2 ? icon_res : icon_leave)} className={isMyApply==true?'img_sty':"img_circle"}/>
                     </div>
                     <div style={{width:'65%'}}>
                         <div style={{color:"#333333",fontSize:15,marginTop:10}}>
-                            {this.props.itemata.approveType == 1 ? '出差申请' :  (this.props.itemata.approveType == 2 ? '用品申请' : '请假申请' )}
+                            {itemdata.approveType == 1 ? '出差申请' :  (itemdata.approveType == 2 ? '用品申请' : '请假申请' )}
                         </div>
-                        <div style={{color:"#666666",fontSize:12,marginTop:15}}>{this.props.itemata.creatDate}</div>
+                        <div style={{color:"#666666",fontSize:12,marginTop:15}}>{this.props.itemdata.creatDate}</div>
                     </div>
-                    <div className={this.props.itemata.approveStatus==1?'doing':'done'} style={{textAlign:'left',marginTop:10,fontSize:12}}>
-                        {this.props.itemata.approveStatus == 1 ? "待审批" :"已审批"}
+                    <div className={itemdata.approveStatus==1?'doing':'done'} style={{textAlign:'left',marginTop:10,fontSize:12}}>
+                        {itemdata.approveStatus == 1 ? "待审批" :"已审批"}
                     </div>
                 </div>
             </Link>

+ 9 - 2
frontend/wechat-web/src/modules/hiPages/class-schedule/ClassSchedule.css

@@ -12,6 +12,13 @@
 }
 .sch_teacher_sty{font-size: 12px;color: #666666;padding: 5px;}
 .header_days_sty{display: flex;flex-direction: row;}
-.each_day_default{width: 20%;height: 40px;color: #CECECE;font-size: 15px;text-align: center;margin-top:15px;padding: 0px 20px;}
-.isday_click{border-radius:100%;color:#FFFFFF;background-color: #4197FC;}
+.each_day_default{width: 20%;height: 36px;color: #CECECE;font-size: 15px;
+    text-align: center;margin-top:15px;margin:10px 20px 10px 20px;
+    background-color: #333333; border-radius:100%;line-height: 36px;
+}
+.isday_click{
+    width: 20%;height: 36px;
+    border-radius:100%;color:#FFFFFF;background-color: #4197FC;
+    text-align: center;margin-top:15px;margin:10px 20px 10px 20px;line-height: 36px;
+}
 

+ 30 - 29
frontend/wechat-web/src/modules/hiPages/class-schedule/ClassSchedule.js

@@ -1,6 +1,6 @@
 /**
-*   Created by FANGlh on 2018/11/12 15:34.
-*/
+ *   Created by FANGlh on 2018/11/12 15:34.
+ */
 
 import React,{Component} from 'react';
 import  './ClassSchedule.css';
@@ -14,17 +14,17 @@ import hi0_img from '../../../style/imgs/ic_head1.png';
 
 function HSItem(props) {
     return(
-            <div style={{marginTop:0,marginLeft:10}}>
-                <img src={line_img} alt="" style={{width:2,height:25,marginLeft:12}}/>
-                <div className="sch_hang_sty">
-                    <div className="green_point"></div>
-                    <div className="sch_time_sty">{moment(props.itemdata.curStartTime).format('HH:mm')}–{moment(props.itemdata.curEndTime).format('HH:mm')}</div>
-                    <div className="sch_class_sty">{props.itemdata.curName}</div>
-                    <img className="teach_img" src={props.itemdata.userPhoto==""||props.itemdata.userPhoto==null ? hi0_img : props.itemdata.userPhoto}alt=""/>
-                    <div className="sch_teacher_sty">{props.itemdata.userName}</div>
-                </div>
-                {/*<img src={line_img} alt="" style={{width:2,height:15,marginLeft:12}}/>*/}
+        <div style={{marginTop:0,marginLeft:10}}>
+            <img src={line_img} alt="" style={{width:2,height:25,marginLeft:12}}/>
+            <div className="sch_hang_sty">
+                <div className="green_point"></div>
+                <div className="sch_time_sty">{moment(props.itemdata.curStartTime).format('HH:mm')}–{moment(props.itemdata.curEndTime).format('HH:mm')}</div>
+                <div className="sch_class_sty">{props.itemdata.curName}</div>
+                <img className="teach_img" src={props.itemdata.userPhoto==""||props.itemdata.userPhoto==null ? hi0_img : props.itemdata.userPhoto}alt=""/>
+                <div className="sch_teacher_sty">{props.itemdata.userName}</div>
             </div>
+            {/*<img src={line_img} alt="" style={{width:2,height:15,marginLeft:12}}/>*/}
+        </div>
     )
 }
 class ClassSchedule extends Component{
@@ -51,11 +51,11 @@ class ClassSchedule extends Component{
         return(
             <div>
                 <div className="header_days_sty">
-                    <div onClick={this.selectDayClick.bind(this,1)} className="each_day_default" ><div className={this.state.CurDay == 1 ? "isday_click" : ''}>一</div></div>
-                    <div onClick={this.selectDayClick.bind(this,2)} className="each_day_default"><div className={this.state.CurDay == 2 ? "isday_click" : ''}>二</div></div>
-                    <div onClick={this.selectDayClick.bind(this,3)} className="each_day_default"><div className={this.state.CurDay == 3 ? "isday_click" : ''}>三</div></div>
-                    <div onClick={this.selectDayClick.bind(this,4)} className="each_day_default"><div className={this.state.CurDay == 4 ? "isday_click" : ''}>四</div></div>
-                    <div onClick={this.selectDayClick.bind(this,5)} className="each_day_default"><div className={this.state.CurDay == 5 ? "isday_click" : ''}>五</div></div>
+                    <div onClick={this.selectDayClick.bind(this,1)}  className={this.state.CurDay == 1 ? "isday_click" : 'each_day_default'} >一</div>
+                    <div onClick={this.selectDayClick.bind(this,2)}  className={this.state.CurDay == 2 ? "isday_click" : 'each_day_default'}>二</div>
+                    <div onClick={this.selectDayClick.bind(this,3)}  className={this.state.CurDay == 3 ? "isday_click" : 'each_day_default'}>三</div>
+                    <div onClick={this.selectDayClick.bind(this,4)}  className={this.state.CurDay == 4 ? "isday_click" : 'each_day_default'}>四</div>
+                    <div onClick={this.selectDayClick.bind(this,5)}  className={this.state.CurDay == 5 ? "isday_click" : 'each_day_default'}>五</div>
                 </div>
                 <div className="comhline_sty"></div>
                 {/*<div style={{fontSize:14,color:"#333333",margin:20}}>11月12日,<span style={{fontSize:12}}>2018年</span></div>*/}
@@ -70,13 +70,13 @@ class ClassSchedule extends Component{
 
                 <div className="comhline_sty"></div>
 
-              {/*<div className="scheedule_sty1">*/}
-                    {/*<div style={{color:"#333333",fontSize:14,marginBottom:10,marginTop:10}}>下午</div>*/}
-                    {/*<div className="comhline_sty1" style={{marginBottom:10}}></div>*/}
-                  {/*<div>*/}
-                      {/*{this.state.Class_SchData.map((itemata,index) => <HSItem key ={index} itemata = {itemata} handelSItem={this.handelSItem}></HSItem>)}*/}
-                  {/*</div>*/}
-              {/*</div>*/}
+                {/*<div className="scheedule_sty1">*/}
+                {/*<div style={{color:"#333333",fontSize:14,marginBottom:10,marginTop:10}}>下午</div>*/}
+                {/*<div className="comhline_sty1" style={{marginBottom:10}}></div>*/}
+                {/*<div>*/}
+                {/*{this.state.Class_SchData.map((itemata,index) => <HSItem key ={index} itemata = {itemata} handelSItem={this.handelSItem}></HSItem>)}*/}
+                {/*</div>*/}
+                {/*</div>*/}
             </div>
         )
     }
@@ -88,18 +88,18 @@ class ClassSchedule extends Component{
             Cdata = this.state.classData.monday
         }else if(value == 2){
             Cdata = this.state.classData.tuesday
-        }else if(value ==3){
+        }else if(value == 3){
             Cdata = this.state.classData.wednesday
-        }else if(value ==4){
+        }else if(value == 4){
             Cdata = this.state.classData.thursday
-        }else if(value == 5){
+        }else if(value ==  5){
             Cdata = this.state.classData.friday
         }
         this.setState({
             CurDay:value,
             curDayData:Cdata
         },function (){
-          console.log("curDayData",this.state.curDayData)
+            console.log("curDayData",this.state.curDayData)
         })
     }
 
@@ -108,7 +108,8 @@ class ClassSchedule extends Component{
     }
     componentDidMount() {
         fetchGet(API.curriculumListByStuId,{
-            stuId:this.props.userInfo.stuId,
+            // stuId:this.props.userInfo.stuId,
+            stuId:10003,
             curStatus:1
         },{}).then((response)=>{
             if(response.success && response.data){

+ 81 - 27
frontend/wechat-web/src/modules/hiPages/field-trip/FieldTrip.js

@@ -14,8 +14,8 @@ import moment from 'moment';
 import {connect} from 'react-redux';
 import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
 import TargetSelect from '../../../components/TargetSelect';
-import {getOrganization} from "../../../utils/api.request";
-import {ORGANIZATION_TEACHER} from "../../../utils/api.constants";
+// import {getOrganization} from "../../../utils/api.request";
+// import {ORGANIZATION_TEACHER} from "../../../utils/api.constants";
 
 const nowTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
 const Option = Select.Option;
@@ -65,14 +65,15 @@ class FieldTrip extends Component {
 
     componentDidMount() {
         this.node.scrollIntoView();
-        getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
+        /*getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
             .then(organization => {
                 this.setState({
                     targetData: organization.teachers,
                 })
             }).catch(error => {
 
-        })
+        })*/
+        this.getOrganization()
     }
 
     render() {
@@ -160,20 +161,20 @@ class FieldTrip extends Component {
                 {/*</div>*/}
                 <div className="comhline_sty"></div>
 
-                    <UploadEnclosure
-                        action={API.UPLOAD_FILE}
-                        fileList={this.state.fileList}
-                        count={9}
-                        multiple={true}
-                        beforeUpload={this.beforeUpload.bind(this)}
-                        handleChange={this.handleChange.bind(this)}
-                    />
+                <UploadEnclosure
+                    action={API.UPLOAD_FILE}
+                    fileList={this.state.fileList}
+                    count={9}
+                    multiple={true}
+                    beforeUpload={this.beforeUpload.bind(this)}
+                    handleChange={this.handleChange.bind(this)}
+                />
 
 
                 {/*<center>*/}
-                    <Button className='commonButton' type='primary' style={{margin: '35px'}}
-                            onClick={this.doSaveClick}>提交</Button>
-                    {/*<button type="button" className="btn btn-primary comBtn_sty" onClick={this.doSaveClick}>提交</button>*/}
+                <Button className='commonButton' type='primary' style={{margin: '35px'}}
+                        onClick={this.doSaveClick}>提交</Button>
+                {/*<button type="button" className="btn btn-primary comBtn_sty" onClick={this.doSaveClick}>提交</button>*/}
                 {/*</center>*/}
 
             </div>
@@ -182,14 +183,15 @@ class FieldTrip extends Component {
 
     onTargetFocus = (e) => {
         if (isObjEmpty(this.state.targetData)) {
-            getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
-                .then(organization => {
-                    this.setState({
-                        targetData: organization.teachers,
-                    })
-                }).catch(error => {
-
-            })
+            // getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
+            //     .then(organization => {
+            //         this.setState({
+            //             targetData: organization.teachers,
+            //         })
+            //     }).catch(error => {
+            //
+            // })
+            this.getOrganization()
         }
     }
 
@@ -204,15 +206,15 @@ class FieldTrip extends Component {
     doSaveClick = () => {
         console.log('state', this.state)
         // console.log('startValue',this.state.startValue)
-        if (this.state.tripType == null || this.state.tripType.trim().length == 0) {
+        if (this.state.tripType == null || this.state.tripType.length == 0) {
             Toast.fail('请选择出差类型')
             return
         }
-        if (this.state.startValue == null || this.state.startValue.trim().length == 0) {
+        if (this.state.startValue == null ) {
             Toast.fail('请选择开始时间')
             return
         }
-        if (this.state.endValue == null || this.state.endValue.trim().length == 0) {
+        if (this.state.endValue == null) {
             Toast.fail('请选择结束时间')
             return
         }
@@ -244,10 +246,11 @@ class FieldTrip extends Component {
 
         var params = {
             appType: this.state.tripType[0],
-            approveName: this.state.tripType[0] == 1 ? "外出申请":"出差申请",
+            approveTitle: this.state.tripType[0] == 1 ? "外出申请":"出差申请",
             approveDetails: this.state.tripsReason,
             approveType: 1,
             proposer: this.props.userInfo.userId,
+            approveStatus:1,
             approver: this.state.votePerson[0],
             startDate: moment(this.state.startValue).format('YYYY-MM-DD HH:mm:ss'),
             endDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
@@ -277,6 +280,57 @@ class FieldTrip extends Component {
                 }
             })
     }
+    getOrganization = () => {
+        Toast.loading('', 0)
+
+        fetchGet(API.getAllTeacher, {
+            // schoolId: this.props.userInfo.schoolId,
+            schoolId:1
+        }).then(response => {
+            Toast.hide()
+            const {targetData} = this.state
+            targetData.length = 0
+            if (response && response.data) {
+                // const schoolArray = response.data.schools
+                const teacherArray = response.data
+
+                if (!isObjEmpty(teacherArray)) {
+                    const teacherData = []
+                    teacherArray.forEach((teacherObj, index) => {
+                        if (teacherObj) {
+                            teacherData.push({
+                                title: getStrValue(teacherObj, 'teacherName'),
+                                userId: getIntValue(teacherObj, 'teacherId'),
+                                userPhone: getStrValue(teacherObj, 'userPhone'),
+                                value: getStrValue(teacherObj, 'teacherName') + `-1-${index}`,
+                                key: `1-${index}`,
+                            })
+                        }
+                    })
+
+                    targetData.push({
+                        title: `全体老师`,
+                        value: `1`,
+                        key: `1`,
+                        children: teacherData,
+                    })
+                }
+            }
+
+            console.log('targetData', targetData)
+            this.setState({
+                targetData,
+            })
+        }).catch(error => {
+            Toast.hide()
+
+            if (typeof error === 'string') {
+                Toast.fail(error, 2)
+            } else {
+                Toast.fail('请求异常', 2)
+            }
+        })
+    }
     setStartDate = (value) => {
         this.setthisTime(value, null)
     }

+ 97 - 44
frontend/wechat-web/src/modules/hiPages/res_apply/ResApply.js

@@ -1,6 +1,6 @@
 /**
-*   Created by FANGlh on 2018/11/9 17:39.
-*/
+ *   Created by FANGlh on 2018/11/9 17:39.
+ */
 
 import React,{Component} from 'react';
 import './ResApply.css';
@@ -13,8 +13,8 @@ import {API,_baseURL} from '../../../configs/api.config';
 import {connect} from 'react-redux';
 import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
 import TargetSelect from '../../../components/TargetSelect';
-import {getOrganization} from "../../../utils/api.request";
-import {ORGANIZATION_TEACHER} from "../../../utils/api.constants";
+// import {getOrganization} from "../../../utils/api.request";
+// import {ORGANIZATION_TEACHER} from "../../../utils/api.constants";
 import UploadEnclosure from '../../../components/UploadEnclosure';
 
 const Option = Select.Option;
@@ -33,11 +33,11 @@ class ResApply extends Component{
             receivingSays:null, //领取说明
             Receiver:null, //接收人
             selectContentArray: [
-                    {
-                        artName:null,
-                        artCount:null
-                    }
-                ],
+                {
+                    artName:null,
+                    artCount:null
+                }
+            ],
 
             previewVisible: false,
             previewImage: '',
@@ -86,9 +86,9 @@ class ResApply extends Component{
             <div className='common-column-layout' onChange={this.handelValueCom} style={{fontFamily:"PingFangSC-Regular",letterSpacing:2.5}}>
                 <div className="comhline_sty"></div>
                 <div className="item_sty">
-                   <div className="left_title">物品用途</div>
-                   <input ref='resUser' className="text-right right_input" type="text" placeholder="请输入"  autoFocus="autoFocus" value={this.state.resUser}/>
-               </div>
+                    <div className="left_title">物品用途</div>
+                    <input ref='resUser' className="text-right right_input" type="text" placeholder="请输入"  autoFocus="autoFocus" value={this.state.resUser}/>
+                </div>
 
                 <div >
                     {this.state.selectContentArray.map((itemata,index) => <UserItem index ={index} itemata = {itemata} handelRItem={this.handelRItem} removeSItem={this.removeSItem}></UserItem>)}
@@ -100,26 +100,26 @@ class ResApply extends Component{
 
 
                 {/*<div className="common-column-layout">*/}
-                    {/*<Picker*/}
-                        {/*data={this.state.receiverPerson} title='接收人' extra='请选择'*/}
-                        {/*value={this.state.Receiver}*/}
-                        {/*onChange={this.handleSelectChange}*/}
-                        {/*onOk={this.handleSelectChange} cols={1}>*/}
-                        {/*<List.Item arrow="horizontal" >接收人</List.Item>*/}
-                    {/*</Picker>*/}
+                {/*<Picker*/}
+                {/*data={this.state.receiverPerson} title='接收人' extra='请选择'*/}
+                {/*value={this.state.Receiver}*/}
+                {/*onChange={this.handleSelectChange}*/}
+                {/*onOk={this.handleSelectChange} cols={1}>*/}
+                {/*<List.Item arrow="horizontal" >接收人</List.Item>*/}
+                {/*</Picker>*/}
                 {/*</div>*/}
                 {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
                     : <TargetSelect {...defaultTargetProps}/>}
                 <div className="comhline_sty"></div>
 
-                    <UploadEnclosure
-                        action={API.UPLOAD_FILE}
-                        fileList={this.state.fileList}
-                        count={9}
-                        multiple={true}
-                        beforeUpload={this.beforeUpload.bind(this)}
-                        handleChange={this.handleChange.bind(this)}
-                    />
+                <UploadEnclosure
+                    action={API.UPLOAD_FILE}
+                    fileList={this.state.fileList}
+                    count={9}
+                    multiple={true}
+                    beforeUpload={this.beforeUpload.bind(this)}
+                    handleChange={this.handleChange.bind(this)}
+                />
 
                 <Button className='commonButton' type='primary' style={{margin: '35px'}}
                         onClick={this.doSaveClick}>提交</Button>
@@ -143,15 +143,67 @@ class ResApply extends Component{
     }
     onTargetFocus = (e) => {
         if (isObjEmpty(this.state.targetData)) {
-            getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
-                .then(organization => {
-                    this.setState({
-                        targetData: organization.teachers,
+            // getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
+            //     .then(organization => {
+            //         this.setState({
+            //             targetData: organization.teachers,
+            //         })
+            //     }).catch(error => {
+            //
+            // })
+            this.getOrganization()
+        }
+    }
+    getOrganization = () => {
+        Toast.loading('', 0)
+
+        fetchGet(API.getAllTeacher, {
+            // schoolId: this.props.userInfo.schoolId,
+            schoolId:1
+        }).then(response => {
+            Toast.hide()
+            const {targetData} = this.state
+            targetData.length = 0
+            if (response && response.data) {
+                // const schoolArray = response.data.schools
+                const teacherArray = response.data
+
+                if (!isObjEmpty(teacherArray)) {
+                    const teacherData = []
+                    teacherArray.forEach((teacherObj, index) => {
+                        if (teacherObj) {
+                            teacherData.push({
+                                title: getStrValue(teacherObj, 'teacherName'),
+                                userId: getIntValue(teacherObj, 'teacherId'),
+                                userPhone: getStrValue(teacherObj, 'userPhone'),
+                                value: getStrValue(teacherObj, 'teacherName') + `-1-${index}`,
+                                key: `1-${index}`,
+                            })
+                        }
                     })
-                }).catch(error => {
 
+                    targetData.push({
+                        title: `全体老师`,
+                        value: `1`,
+                        key: `1`,
+                        children: teacherData,
+                    })
+                }
+            }
+
+            console.log('targetData', targetData)
+            this.setState({
+                targetData,
             })
-        }
+        }).catch(error => {
+            Toast.hide()
+
+            if (typeof error === 'string') {
+                Toast.fail(error, 2)
+            } else {
+                Toast.fail('请求异常', 2)
+            }
+        })
     }
     componentWillUnmount() {
         Toast.hide()
@@ -200,19 +252,19 @@ class ResApply extends Component{
             }
         }
         var params = {
-            approveName: this.state.resUser,
+            approveTitle: this.state.resUser,
             approveDetails:this.state.receivingSays,
             approveType: 2,
             appType:1,
             proposer: this.props.userInfo.userId,
+            approveStatus:1,
             approver: this.state.votePerson[0],
             approveFiles:approveFiles,
-            articles:this.state.selectContentArray
+            oaArticlesDOS:this.state.selectContentArray
         }
         console.log('param',{
             oaString:params
         })
-        return
         fetchPost(API.oaCreate,{
             oaString:JSON.stringify(params)
         },{})
@@ -280,14 +332,15 @@ class ResApply extends Component{
     }
     handleCancel = () => this.setState({ previewVisible: false })
     componentDidMount() {
-        getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
-            .then(organization => {
-                this.setState({
-                    targetData: organization.teachers,
-                })
-            }).catch(error => {
-
-        })
+        // getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
+        //     .then(organization => {
+        //         this.setState({
+        //             targetData: organization.teachers,
+        //         })
+        //     }).catch(error => {
+        //
+        // })
+        this.getOrganization()
     }
 }
 let mapStateToProps = (state) => ({

+ 82 - 73
frontend/wechat-web/src/modules/hiPages/scorenotification/ScoreNotification.js

@@ -1,62 +1,120 @@
 /**
-*   Created by FANGlh on 2019/1/16 17:32.
-*   Desc: 成绩通知
-*/
+ *   Created by FANGlh on 2019/1/16 17:32.
+ *   Desc: 成绩通知
+ */
 
 import React,{Component} from 'react';
 import '../score-inquiry/ScoreInquiry.css';
-import { Select  } from 'antd';
 import ScoreData from '../score-inquiry/ScoreData';
 import {fetchPost,fetchGet,fetchGetNoSession} from '../../../utils/fetchRequest';
 import {API} from '../../../configs/api.config';
-import {Toast,Picker,List} from 'antd-mobile';
+import {Toast,Picker} from 'antd-mobile';
 import {connect} from 'react-redux';
+import RefreshLayout from "../../../components/RefreshLayout";
+import {Button,Icon,Input,List,Skeleton} from 'antd';
+import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
 
+let pageIndex = 0
+let pageSize = 10
 
 class ScoreNotification extends Component{
     constructor(){
         super();
         this.state = {
+            stuId:null,
             selectClass:null,
             selectTime:null,
             ScoreDataList:[
 
             ],
             scoreNames:[],
-            scoreTypes:[]
+            scoreTypes:[],
+            isRefreshing: false,
+            isLoading: true,
         }
     }
+
+    componentWillMount() {
+        document.title = '成绩通知'
+    }
+    componentDidMount() {
+        let stuId
+        if (this.props.match.params.stuId == null){
+            stuId = this.props.userInfo.stuId
+        }else {
+            stuId = this.props.match.params.stuId
+        }
+        this.setState({
+            stuId:stuId
+        },function () {
+            this.getScoreData()
+            console.log("stuId",stuId)
+        })
+    }
     render(){
         return(
             <div className="this_contaior" >
-                    <div style={{width:'100%',height:10,backgroundColor:'#F2F2F2'}}></div>
-                    <div>
-                        {this.state.ScoreDataList.map((itemdata,index) => <ScoreData key={index} itemdata = {itemdata}></ScoreData>)}
-                    </div>
+                <div style={{width:'100%',height:10,backgroundColor:'#F2F2F2'}}></div>
+                <RefreshLayout
+                    refreshing={this.state.isRefreshing}
+                    // ref={el => {
+                    //     this.container = el
+                    // }}
+                    onRefresh={this.getScoreData}>
+                    <Skeleton loading={this.state.isLoading} active paragraph={{rows: 3}}>
+                        <List dataSource={this.state.ScoreDataList}
+                              renderItem={itemdata =>(
+                                  <List.Item   id="row_background"  >
+                                      <ScoreData  itemdata = {itemdata}></ScoreData>
+                                  </List.Item>
+                              )}/>
+                    </Skeleton>
+                </RefreshLayout>
+
             </div>
         )
     }
-    getScoreData =(selectClas,selectTime)=>{
+    getScoreData =()=>{
+        if(this.state.stuId == null || this.state.stuId.trim().length == 0){
+            return
+        }
+        try {
+            this.setState({
+                isRefreshing: true
+            })
+        } catch (e) {
+        }
+        pageIndex++
         let params = {
-            // stuId:this.props.userInfo.stuId,
-            stuId:10003,
-            scoreType:selectTime,
-            // scoreName:selectClas 语文
-            scoreName:'语文',
+            stuId:this.state.stuId,
+            pageIndex: pageIndex,
+            pageSize: pageSize
         }
-        fetchGet(API.getScoreByStuId,params,{})
+        console.log('params',params)
+        fetchPost(API.getScoreByStu,params,{})
             .then((response)=>{
                 console.log('response',response)
                 if(response.success && response.data[0].schoolAverage !=  "NaN"){
-                    this.setState({
-                        ScoreDataList:response.data
-                    })
+                    if (pageIndex == 1){
+                        this.setState({
+                            ScoreDataList:response.data
+                        })
+                    }else {
+                        this.setState({
+                            ScoreDataList:this.state.ScoreDataList.push(response.data)
+                        })
+                    }
+
                 }else {
                     Toast.fail('暂无数据', 2)
                     this.setState({
                         ScoreDataList:[]
                     })
                 }
+                this.setState({
+                    isRefreshing: false,
+                    isLoading: false
+                })
             }).catch((error) =>{
             console.log('error',error)
             this.setState({
@@ -67,62 +125,13 @@ class ScoreNotification extends Component{
             } else {
                 Toast.fail('请求异常', 2)
             }
+            this.setState({
+                isRefreshing: false,
+                isLoading: false
+            })
         })
     }
 
-    componentWillMount() {
-        document.title = '成绩通知'
-    }
-    componentDidMount() {
-        let params = {
-            stuId:this.props.userInfo.stuId
-        }
-        fetchGet(API.getCurr,params,{})
-            .then((response)=>{
-                console.log('response',response)
-                if(response.success ){
-                    this.setState({
-                        scoreNames:response.data.scoreNames,
-                        scoreTypes:response.data.scoreTypes
-                    })
-                    return
-                    const scoreNames = []
-                    const scoreTypes = []
-                    if(response.data.scoreNames){
-                        response.data.scoreNames.forEach((value,index) =>{
-                            const item = {}
-                            item.value = response.data.scoreNames[index]
-                            item.label = response.data.scoreNames[index]
-                            scoreNames.push(item)
-                        })
-                    }
-                    if(response.data.scoreTypes){
-                        response.data.scoreTypes.forEach((value,index) =>{
-                            const item = {}
-                            item.value = response.data.scoreTypes[index]
-                            item.label = response.data.scoreTypes[index]
-                            scoreTypes.push(item)
-                        })
-                    }
-                    console.log('scoreNames',scoreNames)
-                    console.log('scoreTypes',scoreTypes)
-                    this.setState({
-                        scoreNames:scoreNames,
-                        scoreTypes:scoreTypes
-                    })
-                }
-            })
-            .catch((error) =>{
-                console.log('error',error)
-                if (typeof error === 'string') {
-                    Toast.fail(error, 2)
-                } else {
-                    Toast.fail('请求异常', 2)
-                }
-            })
-
-        this.getScoreData(null,null)
-    }
 }
 
 let mapStateToProps = (state) => ({

+ 174 - 279
frontend/wechat-web/src/modules/hiPages/send-vote/SendVote.js

@@ -1,59 +1,61 @@
 /**
- *   Created by FANGlh on 2018/11/8 14:57.
- *   *   创建投票
+ *   Created by FANGlh on 2018/11/6 15:47.
  */
 
 import React, {Component} from 'react';
-import './SendVote.css';
-import {Select, Switch, Upload, Icon, Modal, TreeSelect, Button, Input} from 'antd';
 import nextArrowimg from '../../../style/imgs/next_arrow.png';
-import moment from 'moment'
+import './SendVote.css';
 import 'antd/dist/antd.css';
-import SelectItem from './SelectItem';
-import {Toast, Picker, List, DatePicker} from 'antd-mobile';
-import TargetSelect from '../../../components/TargetSelect';
+import {Select, TreeSelect, Icon, Button} from 'antd';
+import moment from 'moment';
+import add_newimg from '../../../style/imgs/add_new.png';
 import {fetchPost, fetchGet, fetchGetNoSession} from '../../../utils/fetchRequest';
-import {_baseURL, API} from '../../../configs/api.config';
+import {API} from '../../../configs/api.config';
+import {Toast, Picker, List, DatePicker} from 'antd-mobile';
 import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
-import UploadEnclosure from '../../../components/UploadEnclosure';
+import TargetSelect from '../../../components/TargetSelect';
 import {connect} from 'react-redux';
 import {clearListState} from "../../../redux/actions/listState";
 
 const Option = Select.Option;
-const {TextArea} = Input;
 
-class SendVote extends Component {
+class SendMeet extends Component {
     componentWillMount() {
-        document.title = '发起投票'
+        document.title = '发起会议'
     }
 
     componentDidMount() {
         this.getOrganization()
     }
 
+    componentWillUnmount() {
+        Toast.hide()
+        clearTimeout(this.backTask)
+    }
+
     getOrganization = () => {
         Toast.loading('', 0)
 
-        fetchGet(API.USER_GETOBJECT, {
-            userId: this.props.userInfo.userId,
-            stuId: this.props.userInfo.userId
+        fetchGet(API.getAllTeacher, {
+            // schoolId: this.props.userInfo.schoolId,
+            schoolId:1
         }).then(response => {
             Toast.hide()
             const {targetData} = this.state
             targetData.length = 0
             if (response && response.data) {
-                const schoolArray = response.data.schools
-                const teacherArray = response.data.teachers
+                // const schoolArray = response.data.schools
+                const teacherArray = response.data
 
                 if (!isObjEmpty(teacherArray)) {
                     const teacherData = []
                     teacherArray.forEach((teacherObj, index) => {
                         if (teacherObj) {
                             teacherData.push({
-                                title: getStrValue(teacherObj, 'userName'),
-                                userId: getIntValue(teacherObj, 'userId'),
+                                title: getStrValue(teacherObj, 'teacherName'),
+                                userId: getIntValue(teacherObj, 'teacherId'),
                                 userPhone: getStrValue(teacherObj, 'userPhone'),
-                                value: getStrValue(teacherObj, 'userName') + `-1-${index}`,
+                                value: getStrValue(teacherObj, 'teacherName') + `-1-${index}`,
                                 key: `1-${index}`,
                             })
                         }
@@ -66,43 +68,6 @@ class SendVote extends Component {
                         children: teacherData,
                     })
                 }
-
-                if (!isObjEmpty(schoolArray)) {
-                    const classData = []
-
-                    schoolArray.forEach((schoolObj, sIndex) => {
-                        if (schoolObj) {
-                            const parentArray = schoolObj.parents
-
-                            const parentData = []
-                            if (!isObjEmpty(parentArray)) {
-                                parentArray.forEach((parentObj, pIndex) => {
-                                    parentData.push({
-                                        title: getStrValue(parentObj, 'userName'),
-                                        userId: getIntValue(parentObj, 'userId'),
-                                        userPhone: getStrValue(parentObj, 'userPhone'),
-                                        value: getStrValue(parentObj, 'userName') + `-0-${sIndex}-${pIndex}`,
-                                        key: `0-${sIndex}-${pIndex}`,
-                                    })
-                                })
-
-                                classData.push({
-                                    title: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName'),
-                                    value: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName') + `-0-${sIndex}`,
-                                    key: `0-${sIndex}`,
-                                    children: parentData,
-                                })
-                            }
-                        }
-                    })
-
-                    targetData.push({
-                        title: `全体家长`,
-                        value: `0`,
-                        key: `0`,
-                        children: classData,
-                    })
-                }
             }
 
             console.log('targetData', targetData)
@@ -120,45 +85,45 @@ class SendVote extends Component {
         })
     }
 
-    constructor(props) {
-        super(props);
+    constructor() {
+        super();
         this.state = {
-            voteTitle: null,
-            endValue: null,
-            voteType: null,
-            nonameVote: false,
-            voteOptionss: [null, null],
             targetList: [],
             targetCount: 0,
             targetData: [],
-            previewVisible: false,
-            previewImage: '',
-            fileList: [],
-            votePerson: [],
-            voteMembers: 18,
-            typeVote: [{
-                label: '单选',
-                value: '1'
+            startValue: null,
+            endValue: null,
+            endOpen: false,
+            titleValue: null,
+            contentValue: null,
+            earlyTime: null,
+            meetPerson: [],
+            meetAddress: null,
+            noticeType: [{
+                label: '创建即提醒',
+                value: '0'
             }, {
-                label: '多选',
-                value: '2'
+                label: '会前5分钟',
+                value: 5
+            }, {
+                label: '会前15分钟',
+                value: 15
+            }, {
+                label: '会前25分钟',
+                value: 25
+            }, {
+                label: '会前35分钟',
+                value: 35
             }]
-        }
+        };
+
     }
 
     render() {
-
-        //添加附件按钮
-        const uploadButton = (
-            <div>
-                <Icon type="plus"/>
-                <div className="ant-upload-text">Upload</div>
-            </div>
-        );
         const targetProps = {
             targetData: this.state.targetData,
             targetValues: this.state.targetList,
-            title: '发布对象',
+            title: '与会人',
             targetCount: this.state.targetCount,
             onTargetChange: this.onTargetChange.bind(this),
             onTargetFocus: this.onTargetFocus.bind(this)
@@ -167,44 +132,29 @@ class SendVote extends Component {
         const defaultTargetProps = {
             targetData: [],
             targetValues: this.state.targetList,
-            title: '发布对象',
+            title: '与会人',
             targetCount: this.state.targetCount,
             onTargetChange: this.onTargetChange.bind(this),
             onTargetFocus: this.onTargetFocus.bind(this)
         }
         return (
-
-            <div onChange={this.handelValueCom} className='common-column-layout'>
-                {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
-                    : <TargetSelect {...defaultTargetProps}/>}
+            <div onChange={this.handelValueCom} style={{fontFamily: "PingFangSC-Regular", letterSpacing: 2.5}} className='common-column-layout'>
+                {/*<p>{new Date().getTime()}</p>*/}
+                <textarea autoFocus="autoFocus" ref='meetTitle' className="form-control textarea_sty" rows="2"
+                          placeholder="请填写会议主题…"></textarea>
+                <textarea ref='meetAddress' className="form-control textarea_sty" rows="3"
+                          placeholder="请填写会议地址…"></textarea>
                 <div className="comhline_sty"></div>
-                <textarea autoFocus="autoFocus" ref='voteTitle' className="form-control textarea_sty"
-                          rows="2" placeholder="请填写投票主题…" style={{resize: 'none'}}></textarea>
-                <div className="comhline_sty"></div>
-
-                <div>
-                    {this.state.voteOptionss.map((itemata, index) => <SelectItem index={index} itemata={itemata}
-                                                                                 handelSItem={this.handelSItem}
-                                                                                 removeSItem={this.removeSItem}></SelectItem>)}
-                    <div onClick={this.addSelectItem} className="text-center"
-                         style={{color: "#0CE11D", fontSize: 12, margin: 10,}}>+ <span
-                        style={{borderBottom: "1px #0CE11D solid"}}>添加选项</span></div>
-                </div>
-
-                <div className="comhline_sty"></div>
-                <div className="common-column-layout">
-                    <Picker
-                        data={this.state.typeVote} title='投票类型' extra='请选择'
-                        value={this.state.voteType}
-                        onChange={this.handleSelectChange}
-                        onOk={this.handleSelectChange} cols={1}>
-                        <List.Item arrow="horizontal">投票类型</List.Item>
-                    </Picker>
-                    {/*<Select defaultValue="请选择" style={{ width:100 }} onChange={this.handleSelectChange}>*/}
-                    {/*<Option value="1">单选</Option>*/}
-                    {/*<Option value="2">多选</Option>*/}
-                    {/*</Select>*/}
-                    {/*<img src={nextArrowimg} className="nextarr_sty"/>*/}
+                <div className="common-column-layout" style={{fontSize: 15}}>
+                    <DatePicker
+                        value={this.state.startValue}
+                        locale={{
+                            okText: '确定',
+                            dismissText: '取消'
+                        }}
+                        onChange={date => this.setState({startValue: date})}>
+                        <List.Item arrow="horizontal">会议开始时间</List.Item>
+                    </DatePicker>
                     <div className="comhline_sty1"></div>
                     <DatePicker
                         value={this.state.endValue}
@@ -213,230 +163,175 @@ class SendVote extends Component {
                             dismissText: '取消'
                         }}
                         onChange={date => this.setState({endValue: date})}>
-                        <List.Item arrow="horizontal">结束时间</List.Item>
+                        <List.Item arrow="horizontal">会议结束时间</List.Item>
                     </DatePicker>
+                    <div className="comhline_sty1"></div>
+                    <Picker
+                        data={this.state.noticeType} title='提醒时间' extra='请选择'
+                        value={this.state.earlyTime}
+                        onChange={this.handleSelectChange}
+                        onOk={this.handleSelectChange} cols={1}>
+                        <List.Item arrow="horizontal">提醒时间</List.Item>
+                    </Picker>
                 </div>
 
                 <div className="comhline_sty1"></div>
+                {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
+                    : <TargetSelect {...defaultTargetProps}/>}
+                {/*<center><Button type="button" className="btn btn-primary comBtn_sty"*/}
+                {/*onClick={this.doSaveClick}>创建</Button></center>*/}
 
-                <div className="item_sty">
-                    <div style={{width: 150, fontSize: 15, color: "#333333"}}>匿名投票:</div>
-                    <div className="text-right" style={{width: "100%",}}>
-                        <Switch checkedChildren="开" unCheckedChildren="关" defaultunchecked="false"
-                                onChange={this.switchStatues}/>
-                    </div>
-                </div>
-                <div className="comhline_sty1"></div>
-
-                    <UploadEnclosure
-                        action={API.UPLOAD_FILE}
-                        fileList={this.state.fileList}
-                        count={9}
-                        multiple={true}
-                        beforeUpload={this.beforeUpload.bind(this)}
-                        handleChange={this.handleChange.bind(this)}
-                    />
                 <Button className='commonButton' type='primary' style={{margin: '35px'}}
-                        onClick={this.doSendVote}>提交</Button>
-                {/*<center><Button type="button" className="btn btn-primary comBtn_sty"*/}
-                                {/*onClick={this.doSendVote}>提交</Button></center>*/}
+                        onClick={this.doSaveClick}>创建</Button>
             </div>
         )
     }
 
-    onTargetFocus = (e) => {
-        if (isObjEmpty(this.state.targetData)) {
-            this.getOrganization()
-        }
-    }
-
-    onTargetChange = (value, label, checkNodes, count) => {
-        this.checkNodes = checkNodes
-        this.setState({
-            targetList: value,
-            targetCount: count
-        });
-    }
-    //发布提交
-    doSendVote = (event) => {
-        if (!isObjEmpty(this.checkNodes)) {
-            this.checkNodes.forEach((node, index) => {
-                this.state.votePerson.push(node.userId)
-            })
-        }
+    doSaveClick = (event) => {
         console.log('state', this.state)
-        if (this.state.votePerson.trim().length == 0) {
-            Toast.fail('请选择投票对象...')
+        if (this.state.titleValue == null || this.state.titleValue.trim().length == 0) {
+            Toast.fail('请填写会议主题...')
             return
         }
-        if (this.state.voteTitle.trim().length == 0 || this.state.voteTitle == null) {
-            Toast.fail('请填写投票主题...', 1)
+        if (this.state.meetAddress == null || this.state.meetAddress.trim().length == 0) {
+            Toast.fail('请填写会议地址...')
             return
         }
-        for(let i=0;i<this.state.voteOptionss.length;i++){
-            if(this.state.voteOptionss[i] == null ||  this.state.voteOptionss[i].trim().length == 0 ){
-                Toast.fail('存在选项内容为空...')
-                return
-            }
+        if (this.state.startValue == null ) {
+            Toast.fail('请选择开始时间...')
+            return
         }
-        // console.log("已走出for循环")
-        // if (this.state.voteOptionss.length < 2) {
-        //     Toast.show('请输入选项内容...')
-        //     return
-        // }
-        if (this.state.voteType == null || this.state.voteType.trim().length == 0) {
-            Toast.fail('请选择投票类型...')
+        if (this.state.endValue == null ) {
+            Toast.fail('请选择结束时间...')
             return
         }
-        if (this.state.endValue == null || this.state.endValue.trim().length == 0) {
-            Toast.fail('请选择正确结束时间...')
+        if (this.state.earlyTime == null ){
+            Toast.fail('请选择提醒时间...')
             return
         }
-
+        if (this.state.targetList.length == 0) {
+            Toast.fail('请选择与会人...')
+            return
+        }
+        const userList = []
+        if (!isObjEmpty(this.checkNodes)) {
+            this.checkNodes.forEach((node, index) => {
+                userList.push(node.userId)
+            })
+        }
         var nowT = new Date().getTime()
+        var startT = new Date(this.state.startValue).getTime()
         var endT = new Date(this.state.endValue).getTime()
-        if (nowT > endT) {
-            Toast.fail('当前时间不可大于结束时间', 1)
+
+        console.log('startT', startT)
+        if (nowT > startT) {
+            Toast.show('开始时间不可小于当前时间', 1)
             return
         }
-
-        var options = []
-        for (let i = 0; i < this.state.voteOptionss.length; i++) {
-            const item = {
-                optionName: this.state.voteOptionss[i],
-                optionStatus: 1
-            }
-            options[i] = item
+        if (startT > endT) {
+            Toast.show('结束时间不可小于开始时间', 1)
+            return
         }
-
-
-        const approveFiles = []
-        if (this.state.fileList) {
-            this.state.fileList.forEach((value, index) => {
-                approveFiles.push(value.picUrl)
+        if (!isObjEmpty(this.checkNodes)) {
+            this.checkNodes.forEach((node, index) => {
+                this.state.meetPerson.push(node.userId)
             })
         }
-        var params = {
-            creator: this.props.userInfo.userId,
-            voteStatus: 1,
-            voteRemarks: "这是一个调查",
-            voteName: this.state.voteTitle,
-            voteFile: approveFiles,
-            voter: JSON.stringify(this.state.votePerson),
-            voteEndDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
-            voteType:1,
-            topics: [
-                {
-                    topicName: this.state.voteTitle,
-                    topicStatus: 1,
-                    options: options,
-                    topicType: this.state.voteType[0],
-                }
-            ]
+        var noticeT = startT - this.state.earlyTime * 1000 * 60
+        console.log('noticeT', noticeT)
+        console.log('noticeT', new Date(noticeT))
+
+        let params = {
+            // meetingCreator: this.props.userInfo.userId,
+            meetingCreator:this.props.userInfo.userId,
+            meetingStatus: 1,
+            meetingName: this.state.titleValue,
+            meetingAddress: this.state.meetAddress,
+            startDate: moment(this.state.startValue).format('YYYY-MM-DD HH:mm:ss'),
+            endDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
+            reminderDate: moment(new Date(noticeT)).format('YYYY-MM-DD HH:mm:ss'),
+            meetingNotifier: JSON.stringify(userList),
+            meetingRemarks: "会议备注",
+            meetingFiles:"[]",
+            meetingDetails: "一定要参加",
         }
-        console.log('params', {
-            voteString: params
-        })
-        fetchPost(API.voteCreate, {
-            voteString: JSON.stringify(params)
+
+        console.log('params', params)
+
+        Toast.loading("会议创建中...", 0)
+        fetchPost(API.createMeeting, {
+            jsonMeeting:JSON.stringify(params)
         }, {})
             .then((response) => {
+                Toast.hide()
+                console.log('response', response)
                 if (response.success) {
-                    Toast.success('发布成功', 1)
                     clearListState()()
+                    Toast.show('创建成功', 1)
+
                     this.backTask = setTimeout(() => {
                         this.props.history.goBack()
                     }, 1000)
                 }
             })
             .catch((error) => {
+                Toast.hide()
+                console.log('error', error)
                 console.log('error', error)
                 if (typeof error === 'string') {
                     Toast.fail(error, 2)
                 } else {
-                    Toast.fail('请求异常', 2)
+                    if (typeof error === 'string') {
+                        Toast.fail(error, 2)
+                    } else {
+                        Toast.fail('请求异常', 2)
+                    }
                 }
             })
     }
-
-    componentWillUnmount() {
-        Toast.hide()
-        clearTimeout(this.backTask)
-    }
-
-    removeSItem = (index) => {
-        if (this.state.voteOptionss.length == 2) {
-            return
+    onTargetFocus = (e) => {
+        if (isObjEmpty(this.state.targetData)) {
+            this.getOrganization()
         }
-        let voteOptionss = this.state.voteOptionss
-        voteOptionss.splice(index, 1)
-        this.setState({
-            voteOptionss
-        })
-    }
-    handelSItem = (itemdata, index) => {
-        console.log('index', index)
-        console.log('itemdata', itemdata)
-        let voteOptionss = this.state.voteOptionss
-        voteOptionss[index] = itemdata
-        this.setState({
-            voteOptionss
-        })
     }
 
-    addSelectItem = (event) => {
-        let voteOptionss = [...this.state.voteOptionss, null];
+    onTargetChange = (value, label, checkNodes, count) => {
+        this.checkNodes = checkNodes
         this.setState({
-            voteOptionss
-        })
+            targetList: value,
+            targetCount: count
+        });
     }
-    addAnnex = (event) => {
-        console.log('addAnnex')
+    selectPersononChange = (value) => {
+        console.log('selectPersononChange ', value);
+        this.setState({meetPerson: value});
+    }
+    disabledStartDate = (startValue) => {
+        const endValue = this.state.endValue;
+        if (!startValue || !endValue) {
+            return false;
+        }
+        return startValue.valueOf() > endValue.valueOf();
     }
 
     handleSelectChange = (value) => {
-        console.log('voteType', value)
+        console.log(`selected ${value}`);
         this.setState({
-            voteType: value
+            earlyTime: value
         })
     }
+
     handelValueCom = (event) => {
         //获取用户名的值
-        let voteTitle = this.refs.voteTitle.value;
+        let meetTitle = this.refs.meetTitle.value;
         //获得内容的值
-        this.setState({
-            voteTitle: voteTitle,
-        })
-    }
+        let meetAddress = this.refs.meetAddress.value;
 
-    switchStatues = (value) => {
-        console.log('isOpend?', value)
         this.setState({
-            nonameVote: value
+            titleValue: meetTitle,
+            meetAddress: meetAddress
         })
     }
-    handleCancel = () => this.setState({previewVisible: false})
-
-    handlePreview = (file) => {
-        this.setState({
-            previewImage: file.url || file.thumbUrl,
-            previewVisible: true,
-        });
-    }
-    beforeUpload = (file, fileList) => {
-
-    }
-    handleChange = fileList => {
-        if (fileList) {
-            fileList.forEach((value, index) => {
-                value.url = value.response ? (_baseURL + value.response.data) : value.url
-                value.picUrl = value.response ? value.response.data : value.picUrl
-            })
-
-            this.setState({fileList})
-        }
-    }
-
 }
 
 let mapStateToProps = (state) => ({
@@ -445,4 +340,4 @@ let mapStateToProps = (state) => ({
 
 let mapDispatchToProps = (dispatch) => ({})
 
-export default connect(mapStateToProps, mapDispatchToProps)(SendVote)
+export default connect(mapStateToProps, mapDispatchToProps)(SendMeet)

+ 85 - 30
frontend/wechat-web/src/modules/leave/LeaveAddCPage.js

@@ -16,21 +16,22 @@ import moment from 'moment'
 import {connect} from 'react-redux';
 import TargetSelect from '../../components/TargetSelect';
 import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
-import {getOrganization} from "../../utils/api.request";
-import {ORGANIZATION_TEACHER} from "../../utils/api.constants";
+// import {getOrganization} from "../../utils/api.request";
+// import {ORGANIZATION_TEACHER} from "../../utils/api.constants";
 
 
 class LeaveAddCPage extends Component {
     componentDidMount() {
         this.node.scrollIntoView();
-        getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
+        /*getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
             .then(organization => {
                 this.setState({
                     targetData: organization.teachers,
                 })
             }).catch(error => {
 
-        })
+        })*/
+        this.getOrganization()
     }
 
     constructor(props) {
@@ -87,7 +88,7 @@ class LeaveAddCPage extends Component {
             multiple: false,
         }
         return (
-            <div ref={node => this.node = node} style={{fontFamily:"PingFangSC-Regular",letterSpacing:2.5}}>
+            <div className="common-column-layout" ref={node => this.node = node} style={{fontFamily:"PingFangSC-Regular",letterSpacing:2.5}}>
                 <Picker
                     data={this.state.typeLeave} title='请假类型' extra='请选择'
                     value={this.state.leaveType}
@@ -121,29 +122,31 @@ class LeaveAddCPage extends Component {
                 <div className="comhline_sty"></div>
                 <div onChange={this.handelValueCom}>
                     <textarea  ref='leaveReason' className="form-control textarea_sty" rows="4"
-                              placeholder="请填写请假内容"></textarea>
+                               placeholder="请填写请假内容"></textarea>
                 </div>
                 <div className="comhline_sty"></div>
                 {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
                     : <TargetSelect {...defaultTargetProps}/>}
 
-                   <UploadEnclosure
-                       action={API.UPLOAD_FILE}
-                       fileList={this.state.fileList}
-                       count={9}
-                       multiple={true}
-                       beforeUpload={this.beforeUpload.bind(this)}
-                       handleChange={this.handleChange.bind(this)}
-                   />
-
-                <div className="flex_center margin_top_20">
-                    <center><Button type="button" className="btn btn-primary comBtn_sty"
-                                    onClick={this.onSubmitClick}>提交</Button></center>
-                </div>
+                <UploadEnclosure
+                    action={API.UPLOAD_FILE}
+                    fileList={this.state.fileList}
+                    count={9}
+                    multiple={true}
+                    beforeUpload={this.beforeUpload.bind(this)}
+                    handleChange={this.handleChange.bind(this)}
+                />
+
+                {/*<div className="flex_center margin_top_20">*/}
+                {/*<center><Button type="button" className="btn btn-primary comBtn_sty"*/}
+                {/*onClick={this.onSubmitClick}>提交</Button></center>*/}
+                {/*</div>*/}
+                <Button className='commonButton' type='primary' style={{margin: '35px'}}
+                        onClick={this.onSubmitClick}>提交</Button>
                 {/*<div*/}
-                    {/*onClick={this.clickLeaveList.bind(this)}*/}
-                    {/*className="leave-history flex_center text_underline">*/}
-                    {/*请假记录*/}
+                {/*onClick={this.clickLeaveList.bind(this)}*/}
+                {/*className="leave-history flex_center text_underline">*/}
+                {/*请假记录*/}
                 {/*</div>*/}
             </div>
         )
@@ -192,10 +195,11 @@ class LeaveAddCPage extends Component {
         }
         const params = {
             approveType:4,
-            approveName: this.state.leaveName,
+            approveTitle: this.state.leaveName,
             appType: this.state.leaveType[0],
             approveDetails: this.state.leaveReason,
             proposer: this.props.userInfo.userId,
+            approveStatus:1,
             approver: JSON.stringify(this.state.votePerson[0]),
             approveFiles: approveFiles,
             startDate: moment(this.state.startValue).format('YYYY-MM-DD HH:mm:ss'),
@@ -224,7 +228,57 @@ class LeaveAddCPage extends Component {
             }
         })
     }
+    getOrganization = () => {
+        Toast.loading('', 0)
+
+        fetchGet(API.getAllTeacher, {
+            // schoolId: this.props.userInfo.schoolId,
+            schoolId:1
+        }).then(response => {
+            Toast.hide()
+            const {targetData} = this.state
+            targetData.length = 0
+            if (response && response.data) {
+                // const schoolArray = response.data.schools
+                const teacherArray = response.data
+
+                if (!isObjEmpty(teacherArray)) {
+                    const teacherData = []
+                    teacherArray.forEach((teacherObj, index) => {
+                        if (teacherObj) {
+                            teacherData.push({
+                                title: getStrValue(teacherObj, 'teacherName'),
+                                userId: getIntValue(teacherObj, 'teacherId'),
+                                userPhone: getStrValue(teacherObj, 'userPhone'),
+                                value: getStrValue(teacherObj, 'teacherName') + `-1-${index}`,
+                                key: `1-${index}`,
+                            })
+                        }
+                    })
+
+                    targetData.push({
+                        title: `全体老师`,
+                        value: `1`,
+                        key: `1`,
+                        children: teacherData,
+                    })
+                }
+            }
 
+            console.log('targetData', targetData)
+            this.setState({
+                targetData,
+            })
+        }).catch(error => {
+            Toast.hide()
+
+            if (typeof error === 'string') {
+                Toast.fail(error, 2)
+            } else {
+                Toast.fail('请求异常', 2)
+            }
+        })
+    }
     beforeUpload = (file, fileList) => {
 
     }
@@ -235,14 +289,15 @@ class LeaveAddCPage extends Component {
 
     onTargetFocus = (e) => {
         if (isObjEmpty(this.state.targetData)) {
-            getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
-                .then(organization => {
-                    this.setState({
-                        targetData: organization.teachers,
-                    })
-                }).catch(error => {
+            /* getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.userId, false)
+                 .then(organization => {
+                     this.setState({
+                         targetData: organization.teachers,
+                     })
+                 }).catch(error => {
 
-            })
+             })*/
+            this.getOrganization()
         }
     }