Commit 11c0bede authored by lvtz's avatar lvtz

Merge branch 'sj-dev-dev' of git.server:wangxuelai/wechatapp.shangjiadao.com into permission_lvtz

parents d1782d0b 1abd83d3
......@@ -14,7 +14,8 @@ import {
} from '../../../utilities/index.js';
import {
erpTeacherDetail,
erpTeacherEdit
erpTeacherEdit,
teacherrolesGet
} from '../../../service/business/teachermgt.js';
import regexp from '../../../constants/regexp.js';
var app = getApp();
......@@ -45,6 +46,11 @@ Page({
height: 300, // 画布高度
},
cropperSrc: '',
teacherrolesList: '',
selectTimeShow: false,
selectTimeId:'',
actroleName:'',
teacherDetail:''
},
/**
......@@ -68,6 +74,7 @@ Page({
title: '新增老师'
})
}
this.teacherrolesGet()
},
/**
......@@ -95,12 +102,15 @@ Page({
const {data, code} = res;
if (code == 200) {
this.setData({
teacherDetail: data,
selectTimeId: data.roles && data.roles.length>0 ? data.roles[0].id : '',
actroleName: data.roles && data.roles.length>0 ? data.roles[0].name : '',
params: {
avatar: data.avatar,
name: data.nickname,
mobile: data.mobile, //轻校账号
phone: data.phone, //联系方式
remark: data.remark
remark: data.remark,
},
})
}
......@@ -153,6 +163,40 @@ Page({
},
loadimage(){
},
teacherrolesGet(){
teacherrolesGet({
school_id: this.data.sid,
perPage: 99
}).then((res)=>{
const { code, data } = res;
if(code == 200){
this.setData({
teacherrolesList: data.list
})
}
})
},
selectTimeHandle(e){
const { item } = e.currentTarget.dataset;
this.setData({
selectTimeId : item.id,
actroleName: item.name,
selectTimeShow: false
})
},
showSelectTime(){
this.setData({
selectTimeShow: true
})
},
hideSelectTime(e) {
if (e.target.dataset.flag) {
this.setData({
selectTimeShow: false
})
}
},
surecropper () {
this.cropper = this.selectComponent("#image-cropper");
......@@ -297,6 +341,15 @@ Page({
})
return;
}
if (!this.data.selectTimeId) {
wx.showModal({
title: '提示',
content: '必须选择角色',
showCancel: false,
confirmColor: "#65B8F4"
})
return;
}
if (!regexp.mobile.test(params.phone)) {
wx.showModal({
title: '提示',
......@@ -320,6 +373,7 @@ Page({
erpTeacherEdit(Object.assign(params, {
id: this.data.id,
school_id: this.data.sid,
role_id: this.data.selectTimeId
})).then((res) => {
if (res.code == 200) {
wx.hideLoading();
......
......@@ -41,6 +41,13 @@
<!-- <image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> -->
</view>
</view>
<view class="form-item" bindtap="showSelectTime" wx:if="{{id==0 || (id>0 && teacherDetail && teacherDetail.type!=2)}}">
<view class="form-label">角色</view>
<view class="form-content">
<text class="form-text" >{{actroleName}}</text>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view>
</view>
<view class="form-item">
<view class="form-label">备用联系方式</view>
<view class="form-content">
......@@ -93,4 +100,13 @@
</view>
</view>
</view>
<expiredTip/>
\ No newline at end of file
<expiredTip/>
<view class="select-student-dailog" wx:if="{{selectTimeShow}}" bindtap="hideSelectTime" data-flag="{{1}}">
<view class="dailog-content dailog-class-content" >
<scroll-view class="student-list class-list" scroll-y="true">
<view class="class-item {{selectTimeId == item.id ? 'act-class' : ''}}" wx:for="{{teacherrolesList}}" wx:key="index" data-item="{{item}}" bindtap="selectTimeHandle">{{item.name}}</view>
</scroll-view>
<view class="line-16"></view>
<view class="cancle-btn" bindtap="hideSelectTime" data-flag="{{1}}">取消</view>
</view>
</view>
\ No newline at end of file
......@@ -25,4 +25,121 @@ page::after{
bottom: 0;
right: 0;
transform: scaleY(.5);
}
.form-text{
text-align: right;
width: 100%;
color: #8C8C8C;
}
.select-student-dailog{
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
background:rgba(0,0,0,.5);
z-index: 100;
}
.select-student-dailog .dailog-content{
width: 100%;
position: absolute;
left: 0;
bottom: 0;
background:rgba(255,255,255,1);
border-radius:20rpx 20rpx 0px 0px;
}
.select-student-dailog .dailog-content .search-box{
width:525rpx;
height:60rpx;
background:rgba(247,247,249,1);
border-radius:30rpx;
margin: 40rpx auto;
display: flex;
align-items: center;
}
.select-student-dailog .dailog-content .search-box .icon{
width:30rpx;
height:30rpx;
margin: 0 26rpx;
}
.select-student-dailog .dailog-content .search-box .ipt{
flex: 1;
}
.select-student-dailog .dailog-content .search-box .search-btn{
width:107rpx;
height:60rpx;
background:rgba(101,184,244,1);
border-radius:30rpx;
font-size:26rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(255,255,255,1);
line-height:60rpx;
text-align: center;
}
.select-student-dailog .dailog-content .student-list{
display: flex;
flex-wrap: wrap;
max-height: 475rpx;
min-height: 200rpx;
}
.select-student-dailog .dailog-content .student-list .student-item{
display: inline-block;
width: 25%;
text-align: center;
margin-bottom: 60rpx;
}
.select-student-dailog .dailog-content .student-list .student-item .avatar-box{
padding-bottom: 16rpx;
}
.select-student-dailog .dailog-content .student-list .student-item .avatar-box image{
width:107rpx;
height:107rpx;
border-radius:50%;
}
.select-student-dailog .dailog-content .student-list .student-item .name{
font-size:26rpx;
font-family:PingFang SC;
font-weight:bold;
color:rgba(0,0,0,1);
line-height:1;
padding-bottom: 20rpx;
}
.select-student-dailog .dailog-content .student-list .student-item .count{
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(137,138,136,1);
line-height:1;
}
.dailog-class-content .cancle-btn{
height: 106rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:bold;
color:rgba(0,0,0,1);
display: flex;
align-items: center;
justify-content: center;
}
.select-student-dailog .dailog-class-content .class-list .class-item{
height: 95rpx;
padding: 33rpx 66rpx;
font-size:28rpx;
font-family:PingFang SC;
font-weight:bold;
color:rgba(0,0,0,1);
border-bottom: 1px solid rgba(0,0,0,.05);
line-height: 1;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
text-align: center;
}
.select-student-dailog .dailog-class-content .class-list .class-item:last-of-type{
/* border: none; */
}
.select-student-dailog .dailog-class-content .class-list .act-class{
color:rgba(83,200,255,1);
}
\ No newline at end of file
......@@ -274,6 +274,7 @@ const apis = {
teachersDistribute: `${api}member/teachers/distribute`, // 班级权限
setPermission: `${api}member/permissions`,// 设置权限
bindschool: `${api}teacher/bind_school`,// 教师绑定学校
teacherroles: `${api}member/erp/teacher_roles`,// 角色列表
},
// 校区学生管理
studentmgt: {
......
......@@ -135,6 +135,15 @@ function bindschool(data) {
errorresolve: 2,
})
}
function teacherrolesGet(data) {
return wxRequest({
role: '2b',
data,
url: apis.business.teachermgt.teacherroles,
method: 'GET',
errorresolve: 1,
})
}
export {
erpTeacherList,
erpTeacherEdit,
......@@ -147,5 +156,6 @@ export {
teachersDistribute,
setPermission,
bindschool,
classTeachersDelete
classTeachersDelete,
teacherrolesGet
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment