|
|
@ -44,7 +44,7 @@ |
|
|
|
|
|
|
|
<div data-tname="考勤" data-pid="1452228106302791680" data-uid="1217647686598135808" data-rid="rid333" data-tid="tid444" data-did="did555" style="height:50px;width:100%"> |
|
|
|
<div data-root="p1452841234849865728" style="height:100%;width:100%;"> |
|
|
|
<div class="apply-box flex justify-between items-center"> |
|
|
|
<div class="apply-box flex justify-between items-center" style="display: none;"> |
|
|
|
<div class="apply-title text-sm">申请结业</div> |
|
|
|
<button class="status-1 bg-blue-500 px-2.5 h-6 rounded text-white text-sm" style="display: none;" onclick="p1452841234849865728.applyGraduation()">申请</button> |
|
|
|
<span class="status-2 text-sm" style="display: none;">待审核</span> |
|
|
@ -71,6 +71,7 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<script> |
|
|
|
let applyBox = document.querySelector('.apply-box'); // 申请结业标题 |
|
|
|
let applyTitle = document.querySelector('.apply-title'); // 申请结业标题 |
|
|
|
let status1 = document.querySelector('.status-1'); // 申请 |
|
|
|
let status2 = document.querySelector('.status-2'); // 待审核 |
|
|
@ -122,6 +123,8 @@ |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
that.token = data.token; |
|
|
|
// 查询当前培训计划 |
|
|
|
that.getTrainPlan(); |
|
|
|
// 查询证书颁发状况(是否审核、是否发证) |
|
|
|
that.getCertificateStatus(); |
|
|
|
} else { |
|
|
@ -130,6 +133,38 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询当前培训计划 |
|
|
|
*/ |
|
|
|
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) { |
|
|
|
let date = new Date(); |
|
|
|
let time = date.getTime(); |
|
|
|
if (data && time > data.startTime) { |
|
|
|
applyBox.style.display = 'flex'; |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询证书颁发状况(是否审核、是否发证) |
|
|
|
getCertificateStatus(){ |
|
|
|
var that = this; |
|
|
|