|
|
@ -42,28 +42,37 @@ |
|
|
|
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="alert('hello')">测试组建1</button> |
|
|
|
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p100.show()">测试组建2</button> |
|
|
|
|
|
|
|
<div data-tname="考勤" data-pid="1433332016270811136" data-uid="1217647686598135808" data-rid="rid333" data-tid="tid444" data-did="did555" style="height:50px;width:100%"> |
|
|
|
<div data-tname="考勤" data-pid="1451447721818071040" data-uid="1217647686598135808" data-rid="rid333" data-tid="tid444" data-did="did555" style="height:50px;width:100%"> |
|
|
|
<div data-root="p1449996929974149120" style="height:100%;width:100%;"> |
|
|
|
<div class="student-box" style="display: none;"> |
|
|
|
<div class="title"></div> |
|
|
|
<div class="flex justify-between"> |
|
|
|
<div class="text-sm">培训报名</div> |
|
|
|
<div class="flex items-center"> |
|
|
|
<button id="registrationSuccess" class="nightClockBtn text-xs rounded-md py-1 px-3" style="display: none;">报名成功</button> |
|
|
|
<button id="applyBtn" class="nightClockBtn bg-blue-500 text-xs rounded-md py-1 px-3 text-white" onclick="p1449996929974149120.apply()">报名</button> |
|
|
|
<button class="not-pay text-xs text-center text-white bg-blue-500 rounded-full w-10 h-5" style="display: none;" onclick="p1449996929974149120.toPay()">去缴费</button> |
|
|
|
<button id="applyBtn" class="nightClockBtn px-2.5 h-6 bg-blue-500 text-sm rounded text-white" onclick="p1449996929974149120.apply()">报名</button> |
|
|
|
<button class="not-pay px-2.5 h-6 bg-blue-500 text-sm rounded text-white" style="display: none;" onclick="p1449996929974149120.toPay()">去缴费</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="border-2 w-full mt-2.5 flex justify-between p-2 text-sm"> |
|
|
|
<p style="color: #999999;">山西跳协**培训红头文件</p> |
|
|
|
<div class="mt-2.5 px-2 flex justify-between items-center w-full h-8 border border-gray-200 rounded-sm text-sm"> |
|
|
|
<p class="file-name text-gray-400 truncate" style="width: calc(100vw - 9rem)"></p> |
|
|
|
<button class="text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" onclick="p1449996929974149120.lookFile()">查看</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="person-info border-2 w-full mt-2.5 flex justify-between p-2 text-sm" id="pxxz" style="display: none;"> |
|
|
|
<span style="color: #999999;">报名信息</span> |
|
|
|
<div class="person-info mt-2.5 px-2 flex justify-between items-center w-full h-8 border border-gray-200 rounded-sm text-sm" id="pxxz" style="display: none;"> |
|
|
|
<span class="text-gray-400">报名信息</span> |
|
|
|
<button class="text-xs text-blue-500 border border-blue-500 rounded-full w-10 h-5" onclick="p1449996929974149120.apply()">查看</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="student-load"> |
|
|
|
<div class="title"></div> |
|
|
|
<div class="flex justify-between"> |
|
|
|
<div class="text-sm">培训报名</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<script> |
|
|
@ -72,12 +81,8 @@ |
|
|
|
projectId: '', |
|
|
|
roleId: '', |
|
|
|
dom: '', |
|
|
|
lists: [], |
|
|
|
currentIndex: '', |
|
|
|
memberId: '', // 打卡人id |
|
|
|
checkerId: '', // 审核员id |
|
|
|
checkerName: '', // 审核员 |
|
|
|
id: '', // 记录id |
|
|
|
planId: '', // 培训计划ID |
|
|
|
playerId: '', // 报名学员ID |
|
|
|
|
|
|
|
init() { |
|
|
|
this.dom = document.querySelector("div[data-root=p1449996929974149120]"); |
|
|
@ -103,6 +108,10 @@ |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
that.token = data.token; |
|
|
|
// 查看培训计划 |
|
|
|
that.getTrainPlan(); |
|
|
|
// 查询委派导师 |
|
|
|
that.getAppointStatus(); |
|
|
|
// 获取报名信息 |
|
|
|
that.getPersonInfo(); |
|
|
|
} else { |
|
|
@ -111,6 +120,68 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询当前培训计划 |
|
|
|
*/ |
|
|
|
getTrainPlan(){ |
|
|
|
var that = this; |
|
|
|
fetch(`https://test.tall.wiki/gateway/sports/training/get`, { |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token, |
|
|
|
'Content-Type': 'application/json; charset=utf-8' |
|
|
|
}), |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify({ |
|
|
|
param: {projectId: that.projectId} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(function(response) { |
|
|
|
return response.json(); |
|
|
|
}) |
|
|
|
.then(function(res) { |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
that.planId = data.id; |
|
|
|
that.dom.querySelector('.file-name').innerHTML = data.name; |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询委派信息 |
|
|
|
getAppointStatus() { |
|
|
|
var that = this; |
|
|
|
|
|
|
|
// that.dom.querySelector('.student-box').style.display = 'block'; |
|
|
|
// that.dom.querySelector('.student-load').style.display = 'none'; |
|
|
|
|
|
|
|
fetch(`https://test.tall.wiki/gateway/sports/teacher/getAppoint`, { |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token, |
|
|
|
'Content-Type': 'application/json; charset=utf-8' |
|
|
|
}), |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify({ |
|
|
|
param: { projectId: that.projectId } |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(function(response) { |
|
|
|
return response.json(); |
|
|
|
}) |
|
|
|
.then(function(res) { |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
if (!data) { |
|
|
|
that.dom.querySelector('.student-box').style.display = 'block'; |
|
|
|
that.dom.querySelector('.student-load').style.display = 'none'; |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取报名信息 |
|
|
|
getPersonInfo() { |
|
|
|
var that = this; |
|
|
@ -123,6 +194,7 @@ |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify({ |
|
|
|
param: { |
|
|
|
playerId: that.playerId, |
|
|
|
projectId: that.projectId |
|
|
|
} |
|
|
|
}) |
|
|
@ -133,7 +205,6 @@ |
|
|
|
.then(function(res) { |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
console.log(data); |
|
|
|
if (data) { |
|
|
|
var personInfo = that.dom.querySelector('.person-info'); |
|
|
|
personInfo.style.display = 'flex'; |
|
|
|