Browse Source

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

guq 7 years ago
parent
commit
7effb6613d

+ 28 - 17
frontend/wechat-web/src/configs/api.config.js

@@ -55,32 +55,21 @@ export const API = {
 
 
     //根据学号取课程表
-    curriculumListByStuId: _baseURL + '/curriculum/curriculumListByStuId',
-    //查询学生出入校记录
-    RecordOutgoingList: _baseURL + '/recordOutgoing/RecordOutgoingList',
+    curriculumListByStuId: _baseURL + '/wxSchool/clazzCurriculum/curriculumListByStuId',
+
     //分页显示会议 /分页显示作业 /分页显示通知
     notifyMessage: _baseURL + '/notify/getMeetingList',
 
 
-    //创建投票单
-    voteCreate: _baseURL + '/wxSchool/vote/voteCreate',//投票创建
-    voteList: _baseURL + "/wxSchool/vote/voteListParent",//家长端
-    voteListTeacher: _baseURL + "/wxSchool/vote/voteListForTeacher",//教师端
-    voteDetail: _baseURL + "/vote/voteDetail",//投票详情
-    voteAction: _baseURL + "/vote/voteAction",//投票
+
     //发布作业
     homeWorkAdd: _baseURL + "/notify/issueNotification",
     homeWorkList: _baseURL + "/notify/getMeetingList",
     homeWorkDetail: _baseURL + "/notify/taskDetail",
-    //留言功能
-    messageCreate: _baseURL + "/leaveMessage/messageCreate",
+
     messageList: _baseURL + "/leaveMessage/getMessageListByNotifyId",
-    //学生请假
-    leaveCreate: _baseURL + "/leave/leaveCreate",
-    leaveListParent: _baseURL + "/leave/leaveListByStuId",
-    leaveListTeacher: _baseURL + "/leave/leaveListByUserId",
-    //学生请假单详情
-    leaveDetail: _baseURL + "/leave/lvDetail",
+
+
     //发布通知公告/发布作业/创建会议
     issueNotification: _baseURL + '/notify/issueNotification',
     //成绩查询
@@ -124,6 +113,28 @@ export const API = {
     curriculumListByTeacherId:_baseURL + '/wxSchool/clazzCurriculum/curriculumListByTeacherId',
     //创建校长信箱
     PRINCIPAL_MAILBOX:_baseURL + '/wxSchool/principalMailbox/mailboxString',
+    //学生请假
+    leaveCreate: _baseURL + "/wxSchool/oaLeave/leaveCreate",
+    //家长端请假单列表
+    leaveListParent: _baseURL + "/wxSchool/oaLeave/leaveListByStu",
+    //教师端请假列表
+    leaveListTeacher: _baseURL + "/wxSchool/oaLeave/leaveListByTeacher",
+    //学生请假单详情
+    leaveDetail: _baseURL + "/wxSchool/oaLeave/lvDetail",
+    //请假单回复
+    leaveReply: _baseURL + "/wxSchool/oaLeave/lvReply",
+    //查询学生出入校记录
+    RecordOutgoingList: _baseURL + '/wxSchool/outInRecord/getOutgoingList',
+    //创建投票单
+    voteCreate: _baseURL + '/wxSchool/vote/voteCreate',//投票创建
+    voteList: _baseURL + "/wxSchool/vote/voteListParent",//家长端
+    voteListTeacher: _baseURL + "/wxSchool/vote/voteListForTeacher",//教师端
+    voteDetailParent: _baseURL + "/wxSchool/vote/voteDetailParent",//家长投票单详情
+    voteDetailTeacher: _baseURL + "/wxSchool/vote/voteDetailTeacher",//教师端投票单详情
+
+    voteAction: _baseURL + "/wxSchool/vote/voteActionParent",//投票
+
+
 
     ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //获取用户是否绑定

+ 9 - 6
frontend/wechat-web/src/modules/hiPages/LeaveDetail/LeaveDetail.js

@@ -158,12 +158,15 @@ class LeaveDetail extends Component{
             return;
         }
         Toast.loading('回复中...', 0)
-        fetchPost(API.messageCreate,{
-            messName:'这是回复',
-            messContent:this.state.messageContent,
-            userId: this.props.userInfo.userId,
-            lvId:this.state.itemdetail.lvId,
-        }).then((response)=>{
+        const params = {
+            leaveReplyString:{
+                replyTitle:'请假单回复',
+                replyContent:this.state.messageContent,
+                teacherId: this.props.userInfo.user.userFunId,
+                lvId:this.state.itemdetail.lvId,
+            }
+        }
+        fetchPost(API.leaveReply,params).then((response)=>{
             console.log("response:"+JSON.stringify(response));
             if(response.success){
                 Toast.hide()

+ 1 - 1
frontend/wechat-web/src/modules/hiPages/access-notice/AccessNotice.js

@@ -32,7 +32,7 @@ class AccessNotice extends Component{
             stuId = this.props.userInfo.user.student.stuId
         }
         this.setState({
-            studentName:this.props.userInfo.user.student.stuName,
+            studentName:this.props.userInfo.user.student.stuId,
         })
         fetchPost(API.RecordOutgoingList,{
             stuId:stuId,

+ 62 - 28
frontend/wechat-web/src/modules/leave/LeaveAddPage.js

@@ -5,7 +5,7 @@
 
 import React,{Component} from 'react';
 import './LeaveAddPage.css';
-import {getOrganization} from "../../utils/api.request";
+// import {getOrganization} from "../../utils/api.request";
 import {connect} from 'react-redux';
 import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
 import {ORGANIZATION_TEACHER} from "../../utils/api.constants";
@@ -35,7 +35,7 @@ class LeaveAddPage extends Component{
     }
     componentDidMount() {
         this.node.scrollIntoView();
-        getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.stuId, false)
+        /*getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.stuId, false)
             .then(organization => {
                 this.setState({
                     targetData: organization.teachers,
@@ -47,7 +47,8 @@ class LeaveAddPage extends Component{
             } else {
                 Toast.fail('请求异常', 2)
             }
-        })
+        })*/
+        this.getOrganization()
     }
      render(){
          const targetProps = {
@@ -76,7 +77,7 @@ class LeaveAddPage extends Component{
                     <img class="img-circle" id="margin_top_bottom_15"
                          src={"http://img5.imgtn.bdimg.com/it/u=1494163297,265276102&fm=26&gp=0.jpg"} width={60}
                          height={60}/>
-                    <span class="span_17 text_bold " id="row_margin">{this.props.userInfo.stuName}的请假条</span>
+                    <span class="span_17 text_bold " id="row_margin">{this.props.userInfo.user.student.stuName}的请假条</span>
                 </div>
                 <div className="comhline_sty"></div>
 
@@ -164,14 +165,19 @@ class LeaveAddPage extends Component{
                 approveFiles.push(value.picUrl)
             })
         }
+
+
         const params = {
-            lvProposer:this.props.userInfo.stuId,
-            lvName:this.props.userInfo.stuName+"的请假条",
-            lvNotifier:JSON.stringify(this.state.votePerson),
-            lvFiles:approveFiles,
+            lvTitle: "学生请假",
             lvDetails:this.state.leaveReason,
+            lvType: 1,
+            lvProposer:this.props.userInfo.user.student.stuId,
+            lvStatus:1,
             startDate: moment(this.state.startDate).format('YYYY-MM-DD HH:mm:ss'),
             endDate: moment(this.state.endDate).format('YYYY-MM-DD HH:mm:ss'),
+            lvRemarks: "备注",
+            lvNotifier:JSON.stringify(this.state.votePerson),
+            lvFiles:approveFiles,
         }
         console.log('param', params)
         fetchPost(API.leaveCreate, {
@@ -195,17 +201,57 @@ class LeaveAddPage extends Component{
             }
         })
     }
-
-    onTargetFocus = (e) => {
-        if (isObjEmpty(this.state.targetData)) {
-            getOrganization(ORGANIZATION_TEACHER, this.props.userInfo.stuId, false)
-                .then(organization => {
-                    this.setState({
-                        targetData: organization.teachers,
+    getOrganization = () => {
+        Toast.loading('', 0)
+        fetchGet(API.getAllTeacher, {
+            schoolId: this.props.userInfo.user.schoolId,
+        }).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)
+            }
+        })
+    }
+    onTargetFocus = (e) => {
+        if (isObjEmpty(this.state.targetData)) {
+            this.getOrganization()
         }
     }
     onTargetChange = (value, label, checkNodes, count) => {
@@ -236,18 +282,6 @@ class LeaveAddPage extends Component{
         })
     }
 
-
-
-
-
-
-
-
-
-
-
-
-
 }
 
 let mapStateToProps = (state) => ({

+ 6 - 5
frontend/wechat-web/src/modules/leave/LeaveListPage.js

@@ -17,6 +17,7 @@ import {connect} from 'react-redux'
 import LeaveItem from './LeaveItem';
 import RefreshLayout from "../../components/RefreshLayout";
 
+let LEAVE_LIST_URL = ''
 /**
  * Created by Arison on 11:22.
  */
@@ -91,9 +92,9 @@ class LeaveListPage extends React.Component{
             hasMoreData:true,
         })
         if (this.state.role === "teacher") {
-            console.log("getLeaveListData()",this.props.userInfo.userId);
+            console.log("getLeaveListData()",this.props.userInfo.user.userFunId);
             fetchGet(API.leaveListTeacher, {
-                userId: this.props.userInfo.userId,
+                userId: this.props.userInfo.user.userFunId,
                 pageIndex: this.state.pageIndex,
                 pageSize: this.state.pageSize
             }).then((response) => {
@@ -131,7 +132,7 @@ class LeaveListPage extends React.Component{
         }
         if (this.state.role === "parent") {
             fetchGet(API.leaveListParent, {
-                stuId: this.props.userInfo.stuId,
+                stuId: this.props.userInfo.user.student.stuId,
                 pageIndex: this.state.pageIndex,
                 pageSize: this.state.pageSize
             }).then((response) => {
@@ -173,7 +174,7 @@ class LeaveListPage extends React.Component{
             this.state.pageIndex++;
             if (this.state.role === "teacher") {
                 fetchGet(API.leaveListTeacher, {
-                    userId: this.props.userInfo.userId,
+                    userId: this.props.userInfo.user.userFunId,
                     pageIndex: this.state.pageIndex,
                     pageSize: this.state.pageSize
                 }).then((response) => {
@@ -212,7 +213,7 @@ class LeaveListPage extends React.Component{
             }
             if (this.state.role === "parent") {
                 fetchGet(API.leaveListParent, {
-                    stuId: this.props.userInfo.stuId,
+                    stuId: this.props.userInfo.user.student.stuId,
                     pageIndex: this.state.pageIndex,
                     pageSize: this.state.pageSize
                 }).then((response) => {

+ 2 - 2
frontend/wechat-web/src/modules/vote/VoteDetailPage.js

@@ -48,9 +48,9 @@ class VoteDetailPage extends React.Component {
 
     getVoteDetail() {
         Toast.loading("", 0)
-        fetchGet(API.voteDetail, {
+        fetchGet(API.voteDetailParent, {
             voteId: this.state.id,
-            userId: this.props.userInfo.userId
+            teacherId: this.props.userInfo.user.userFunId,
         }).then((response) => {
             Toast.hide();
             if (response.data) {

+ 1 - 1
frontend/wechat-web/src/modules/vote/VoteListParent.jsx

@@ -92,7 +92,7 @@ class VoteListParent extends Component {
         }
 
         fetchGet(API.voteList, {
-            userId: this.props.userInfo.userId,
+            userId: this.props.userInfo.user.userFunId,
             pageIndex: mPageIndex,
             pageSize: mPageSize,
             voteType: '1',

+ 2 - 2
frontend/wechat-web/src/modules/vote/VoteListTeacher.jsx

@@ -162,7 +162,7 @@ class VoteListTeacher extends Component {
         }
 
         fetchGet(API.voteListTeacher, {
-            userId: this.props.userInfo.userId,
+            userId: this.props.userInfo.user.userFunId,
             voteType: '1',
             pageIndex: mReleaseIndex,
             pageSize: mPageSize
@@ -232,7 +232,7 @@ class VoteListTeacher extends Component {
         }
 
         fetchGet(API.voteListTeacher, {
-            userId: this.props.userInfo.userId,
+            userId: this.props.userInfo.user.userFunId,
             voteType: '1',
             pageIndex: mReceiveIndex,
             pageSize: mPageSize