@@ -109,7 +122,9 @@
if (success && code === 200) {
that.token = data.token;
// 查询培训计划是否待审核
- that.getTrainCheck()
+ that.getTrainPlan()
+ // 委派导师列表
+ that.getTeacherList()
} else {
console.log('msg: ', msg);
}
@@ -136,6 +151,7 @@
const { success, code, data, msg } = res;
if (success && code === 200) {
var trainPlan = that.dom.querySelector('.train-check');
+ // trainPlan.style.display = 'block'
if (data && data.checkStatus === 1) {
trainPlan.style.display = 'block'
} else {
@@ -173,6 +189,38 @@
});
},
+ // 发布
+ release() {
+ var that = this;
+ fetch(`https://test.tall.wiki/gateway/sports/teacher/appoint`, {
+ headers: new Headers({
+ 'Authorization': 'Bearer ' + that.token,
+ 'Content-Type': 'application/json; charset=utf-8'
+ }),
+ method: 'POST',
+ body: JSON.stringify({
+ planId: '',
+ teacherIds: []
+ })
+ })
+ .then(function(response) {
+ return response.json();
+ })
+ .then(function(res) {
+ const { success, code, data, msg } = res;
+ if (success && code === 200) {
+ var teacherList = that.dom.querySelector('.selected-teacher');
+ var teacherSelect = that.dom.querySelector('.select-teacher');
+ var releaseBtn = that.dom.querySelector('.release-btn');
+ teacherSelect.style.display = 'none';
+ teacherList.style.display = 'block';
+ releaseBtn.style.display = 'none';
+ } else {
+ console.log('msg: ', msg);
+ }
+ });
+ },
+
// 显示选择框
show(){
var statusChoose = this.dom.querySelector('.statusChoose');
@@ -208,12 +256,12 @@
* @param { Number } codeAndAnswerList 提交人类型(0平车 1人)
*/
choose(){
- // const that = this;
+ const that = this;
// const { dom } = that;
- // var startBtn = document.querySelector('.startBtn');
- // startBtn.innerHTML = that.lists[that.currentIndex].name;
+ var startBtn = document.querySelector('.startBtn');
+ startBtn.innerHTML = that.lists[that.currentIndex].name;
// that.checkerId = that.lists[that.currentIndex].memberId
- that.hide()
+ that.hide();
},
// 取消