Browse Source

审核培训计划

ts-red-header-file-review
xuesinan 4 years ago
parent
commit
1eff70ffae
  1. 165
      index.html

165
index.html

@ -44,36 +44,68 @@
<div data-tname="考勤" data-pid="1433332016270811136" data-uid="1217647686598135808" data-rid="rid333" data-tid="tid444" data-did="did555" style="height:5.375rem;width:100%">
<div data-root="p1449944565028233216" style="height:100%;width:100%;">
<div class="title"></div>
<div class="flex justify-between">
<div class="text-sm">培训计划审核</div>
<div class="text-sm">
<button class="text-xs text-blue-400 border rounded w-10 h-5" onclick="p1449944565028233216.showReject()">驳回</button>
<button class="text-xs text-white bg-blue-500 border rounded w-10 h-5">通过</button>
<div class="train-plan-check">
<div class="title"></div>
<div class="flex justify-between">
<div class="text-sm">培训计划审核</div>
<div class="text-sm">
<button class="text-xs text-blue-400 border rounded w-10 h-5" onclick="p1449944565028233216.showReject()">驳回</button>
<button class="text-xs text-white bg-blue-500 border rounded w-10 h-5">通过</button>
</div>
</div>
</div>
<div class="border-2 w-full mt-2.5 flex justify-between p-2 text-sm">
<p style="color: #999999;">山西跳协**培训红头文件</p>
<div>
<button class="text-xs border rounded-full w-10 h-5">查看</button>
<div class="border-2 w-full mt-2.5 flex justify-between p-2 text-sm">
<p style="color: #999999;">山西跳协**培训红头文件</p>
<div>
<button class="text-xs border rounded-full w-10 h-5">查看</button>
</div>
</div>
</div>
<div class="pl-7 pr-7 pt fixed z-10 statusChoose bg-black bg-opacity-50" style="display: none; top: 0; bottom: 0; left: 0; right: 0; padding-top: calc((100vh - 250px) / 2);">
<div class="bg-white">
<div style="height: 13rem;overflow-y: auto;">
<p class="mt-8 text-center">驳回原因</p>
<div class="pl-6 pr-6">
<div class="mt-8 border-b pt-2 pb-2">
<input type="text" class="border-none outline-none" style="width: 100%;" placeholder="请输入驳回原因">
<div class="pl-7 pr-7 pt fixed z-10 statusChoose bg-black bg-opacity-50" style="display: none; top: 0; bottom: 0; left: 0; right: 0; padding-top: calc((100vh - 250px) / 2);">
<div class="bg-white">
<div style="height: 13rem;overflow-y: auto;">
<p class="mt-8 text-center">驳回原因</p>
<div class="pl-6 pr-6">
<div class="mt-8 border-b pt-2 pb-2">
<input type="text" class="border-none outline-none reason" style="width: 100%;" placeholder="请输入驳回原因">
</div>
</div>
<div class="border-t btn mt-6 flex justify-between">
<div class="flex-1 text-center border-r h-full" style="line-height: 3.375rem;" onclick="p1449944565028233216.hide()">取消</div>
<div class="flex-1 text-center h-full" style="line-height: 3.375rem;" onclick="p1449944565028233216.submit()">提交</div>
</div>
</div>
<div class="border-t btn mt-6 flex justify-between">
<div class="flex-1 text-center border-r h-full" style="line-height: 3.375rem;" onclick="p1449944565028233216.hide()">取消</div>
<div class="flex-1 text-center h-full" style="line-height: 3.375rem;" onclick="p1449944565028233216.submit()">提交</div>
</div>
</div>
</div>
</div>
<div class="train-plan-reject" style="display: none;">
<div class="title"></div>
<div class="flex justify-between">
<div class="text-sm">培训计划审核</div>
<div class="text-sm">
<span class="text-yellow-400 reject-text">已驳回</span>
<span class="text-yellow-400 pass-text">已通过</span>
</div>
</div>
<div class="border-2 w-full mt-2.5 flex justify-between p-2 text-sm">
<p style="color: #999999;">山西跳协**培训红头文件</p>
<div>
<button class="text-xs border rounded-full w-10 h-5">查看</button>
</div>
</div>
<div class="border-2 w-full mt-2.5 flex justify-between p-2 text-sm reason-box">
<p style="color: #999999;">驳回原因</p></p>
<div>
这里是驳回原因这里是驳回原因这里是驳回原因这里是驳回原因
</div>
</div>
</div>
<div class="train-plan-hide" style="display: none;">
<div class="title"></div>
<div class="flex justify-between">
<div class="text-sm">培训计划审核</div>
</div>
</div>
</div>
</div>
@ -115,29 +147,96 @@
if (success && code === 200) {
that.token = data.token;
// 查询考勤信息
that.getClockQuery()
that.getTrainPlan()
} else {
console.log('msg: ', msg);
}
});
},
// 获取当前审核状态
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({
projectId: that.projectId
})
})
.then(function(response) {
return response.json();
})
.then(function(res) {
const { success, code, data, msg } = res;
if (success && code === 200) {
var trainPlanCheck = that.dom.querySelector('.train-plan-check');
var trainPlanHide = that.dom.querySelector('.train-plan-hide');
var trainPlanReject = that.dom.querySelector('.train-plan-reject');
if (data && data.checkStatus === 0) {
trainPlanHide.style.display = 'none'
trainPlanCheck.style.display = 'block'
trainPlanReject.style.display = 'none'
} else if (data && data.checkStatus === 1 || data && data.checkStatus === 2) {
trainPlanHide.style.display = 'none'
trainPlanCheck.style.display = 'none'
trainPlanReject.style.display = 'block'
var trainPlanStatusReject = that.dom.querySelector('.reject-text');
var trainPlanStatusPass = that.dom.querySelector('.pass-text');
if (data.checkStatus === 1) {
trainPlanStatusReject.style.display = 'none';
trainPlanStatusPass.style.display = 'block';
} else {
trainPlanStatusReject.style.display = 'block';
trainPlanStatusPass.style.display = 'none';
}
} else {
trainPlanHide.style.display = 'block'
trainPlanCheck.style.display = 'none'
trainPlanReject.style.display = 'none'
}
} else {
console.log('msg: ', msg);
}
});
},
// 驳回弹框
showReject(){
var statusChoose = document.querySelector('.statusChoose');
var statusChoose = this.dom.querySelector('.statusChoose');
statusChoose.style.display='block';
var list = ''
for (let i=0;i < this.lists.length; i++) {
list += `<li class="py-3" onclick="p1449944565028233216.chooseItem(${i})">` + this.lists[i].name + '</li>';
}
var ul = this.dom.querySelector('ul');
ul.innerHTML = list
},
// 提交
submit(){
var statusChoose = this.dom.querySelector('.statusChoose');
statusChoose.style.display='none';
var that = this
fetch(`https://test.tall.wiki/gateway/sports/training/audit`, {
headers: new Headers({
'Authorization': 'Bearer ' + that.token,
'Content-Type': 'application/json; charset=utf-8'
}),
method: 'POST',
body: JSON.stringify({
id: id,
type: 2,
remark: that.dom.querySelector(".reason").value
})
})
.then(function(response) {
return response.json();
})
.then(function(res) {
const { success, code, data, msg } = res;
if (success && code === 200) {
that.hide();
} else {
console.log('msg: ', msg);
}
});
},
// 取消

Loading…
Cancel
Save