|
|
@ -20,108 +20,148 @@ |
|
|
|
|
|
|
|
<div class="w-full p-4 bg-gray-100"> |
|
|
|
<!-- 日常任务面板--> |
|
|
|
<!-- <div class="content p-3 h-46 bg-white rounded-lg"> |
|
|
|
<div class="content p-3 h-46 bg-white rounded-lg"> |
|
|
|
<div class="h-6 mb-2 bg-gray-100"></div> |
|
|
|
<div class="h-6 mb-2 bg-gray-100"></div> |
|
|
|
<div class="h-6 mb-2 bg-gray-100"></div> |
|
|
|
<div class="h-6 mb-2 bg-gray-100"></div> |
|
|
|
<div class="h-6 bg-gray-100"></div> |
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <div class="w-full h-8 bg-blue-500 text-white pl-4 flex items-center">2021年30周</div>--> |
|
|
|
<div class="task-bar h-96 w-full bg-gray-100 p-4"> |
|
|
|
<div class="flex mb-3"> |
|
|
|
<!-- <div class="flex flex-col items-center"> |
|
|
|
<!-- 序号--> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div class="rounded-full h-8 w-8 mb-1 bg-gray-100 border-2 border-blue-500"></div> |
|
|
|
<div class="w-8 flex-1 flex flex-col items-center"> |
|
|
|
<div class="w-0.5 flex-1 bg-gray-300"></div> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="flex-1" style="height: 30rem;"> |
|
|
|
<div class="rounded-lg bg-white p-3" style="height: 100%;"> |
|
|
|
<div class="flex-1"> |
|
|
|
<!-- 定期任务面板--> |
|
|
|
<div class="rounded-lg ml-4 bg-white p-3"> |
|
|
|
<!-- 示例插件1--> |
|
|
|
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="alert('hello')">测试组建1</button> |
|
|
|
<!-- 示例插件2 id=100--> |
|
|
|
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p100.show()">测试组建2</button> |
|
|
|
|
|
|
|
<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="p1449944565242142720" style="height:100%;width:100%;"> |
|
|
|
<div class="certificate-box px-2 py-1.5 flex justify-between w-full border border-gray-200 rounded-sm text-sm"> |
|
|
|
<p class="w-20 flex-shrink-0 text-gray-400">红头文件</p> |
|
|
|
<div class="certificate py-1 flex justify-end" style="max-width: 100px; max-height: 100px;"> |
|
|
|
<img style="max-width: 100%; max-height: 100%;" onclick="p1449944565242142720.bigImg()" src="http://test.tall.wiki/staticrec/plan.png" /> |
|
|
|
<div data-tname="考勤" data-pid="1458744703108521984" data-uid="1438701238123368448" data-rid="1458744707302825984" data-tid="tid444" data-did="did555" style="height:500px;width:100%"> |
|
|
|
<!-- 考勤插件 --> |
|
|
|
<div data-root="p1432643387798069248" style="height:100%;width:100%;"> |
|
|
|
<div class="pb-3 flex justify-between items-center border-b"> |
|
|
|
<div class="flex items-center border border-blue-500 rounded-sm"> |
|
|
|
<span class="px-2.5 h-6 leading-6 text-sm text-white bg-blue-500">打卡</span> |
|
|
|
<span class="px-2.5 h-6 leading-6 text-sm text-blue-500">请假</span> |
|
|
|
</div> |
|
|
|
<div onclick="p1432643387798069248.jumpDetails(this)"> |
|
|
|
<img style="width:15px" src="https://www.tall.wiki/staticrec/icon/right.svg" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="img-preview fixed z-10 inset-0 bg-black bg-opacity-60 p-4 flex justify-center items-center" style="display: none;"> |
|
|
|
<img id="img" src="http://test.tall.wiki/staticrec/plan.png" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="student-box mt-2.5 px-2 py-1.5 flex justify-between items-center w-full border border-gray-200 rounded-sm text-sm"> |
|
|
|
<p style="color: #999999;">报名人员</p> |
|
|
|
<button class="check-btn text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" onclick="p1449944565242142720.studentList()">查看</button> |
|
|
|
</div> |
|
|
|
<div class="mt-2 px-2"> |
|
|
|
<div class="flex items-center text-center h-10 border-b"> |
|
|
|
<div class="text-sm" style="width: 20%;">姓名</div> |
|
|
|
<div class="text-sm" style="width: 25%;">早打卡</div> |
|
|
|
<div class="text-sm" style="width: 25%;">晚打卡</div> |
|
|
|
<div class="text-sm" style="width: 30%;">审核人</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mt-2.5 py-1.5 w-full border border-gray-200 rounded-sm"> |
|
|
|
<div class="select-teacher px-2 flex justify-between items-center w-full text-sm"> |
|
|
|
<p class="text-gray-400 truncate w-20">导师委派</p> |
|
|
|
<div class="flex justify-end rounded-md startBtnBox" style="width: calc(100% - 5rem)" onclick="p1449944565242142720.show()"> |
|
|
|
<div class="startBtn mr-1 text-right" style="width: calc(100% - 15px);">请选择委派导师</div> |
|
|
|
<img class="direction-icon" style="width: 15px;" src="https://www.tall.wiki/staticrec/icon/down.svg" /> |
|
|
|
<div class="record-wrap"> |
|
|
|
<div class="flex items-center text-center h-10 border-b"> |
|
|
|
<div class="text-sm" style="width: 20%;">姓名</div> |
|
|
|
|
|
|
|
<div class="text-sm" style="width: 25%;"> |
|
|
|
<div class="flex-1"> |
|
|
|
<button class="morningClockBtn bg-blue-500 text-xs rounded py-1 text-white" style="width: 50px;">早打卡</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="text-sm" style="width: 25%;"> |
|
|
|
<div class="flex-1"> |
|
|
|
<button class="nightClockBtn bg-blue-500 text-xs rounded py-1 text-white" style="width: 50px;">晚打卡</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="text-sm" style="width: 30%;"> |
|
|
|
<div class="flex flex-nowrap border py-1 px-3 rounded-md" onclick="p1432643387798069248.show()"> |
|
|
|
<div class="startBtn mr-1">审核人</div> |
|
|
|
<img style="width:15px" src="https://www.tall.wiki/staticrec/icon/down.svg" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<ul class="teacher-list flex mt-2 px-2" style="display: none;"> |
|
|
|
|
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="selected-teacher mt-2.5 p-2 border border-gray-200 rounded-sm w-full text-sm" style="display: none;"> |
|
|
|
<p class="mb-1" style="color: #999999;">导师委派</p> |
|
|
|
<div class="flex justify-between rounded-md leading-7"> |
|
|
|
<div class="mr-1">导师</div> |
|
|
|
<div class="">未接受</div> |
|
|
|
</div> |
|
|
|
<div class="flex justify-between rounded-md leading-7"> |
|
|
|
<div class="mr-1">导师</div> |
|
|
|
<div class="text-green-500">已接受</div> |
|
|
|
</div> |
|
|
|
<div class="flex justify-between rounded-md leading-7"> |
|
|
|
<div class="mr-1">导师</div> |
|
|
|
<div class="text-yellow-500">已拒绝</div> |
|
|
|
<!-- 选择审核人 --> |
|
|
|
<div class="w-screen h-screen fixed z-20 statusChoose bg-black bg-opacity-50" style="display:none;top: 0;left: 0;"> |
|
|
|
<div class="flex flex-col absolute w-full bg-white" style="bottom: 0;"> |
|
|
|
<div class="flex flex-row justify-between px-5 py-4"> |
|
|
|
<span class="text-gray-400" onclick="p1432643387798069248.hide()">取消</span> |
|
|
|
<span class="font-bold">选择审核人</span> |
|
|
|
<span class="text-blue-500" onclick="p1432643387798069248.choose()">确定</span> |
|
|
|
</div> |
|
|
|
<div class="bg-gray-200" style="width:100%;height: 1px"></div> |
|
|
|
<ul class="flex flex-col text-center" style="height: 240px;overflow-y: auto;"></ul> |
|
|
|
</div> |
|
|
|
<div class="text-xs text-yellow-500 leading-5">拒绝原因:拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因拒绝原因</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mt-4 flex justify-center items-center w-full text-sm"> |
|
|
|
<button class="border border-blue-500 bg-blue-500 text-white rounded-sm" style="width: 45%; height: 34px;" onclick="p1449944565242142720.release()">发布</button> |
|
|
|
<!-- 打卡弹框 --> |
|
|
|
<div class="w-screen h-screen fixed z-10 clockInPopup bg-black bg-opacity-50" style="display: none; top: 0; left: 0;"> |
|
|
|
<div class="flex flex-col absolute bg-white rounded-lg" style="top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%;"> |
|
|
|
<div class="p-4"> |
|
|
|
<div class="h-14 flex justify-center items-center font-bold" style="font-size: 17px;">打卡</div> |
|
|
|
<div class="h-12 flex justify-between items-center text-sm" style="border-bottom: 1px solid rgba(0, 0, 0, .1); color: #595959;"> |
|
|
|
<div>打卡原因</div> |
|
|
|
<input class="text-right focus:outline-none" type="text" placeholder="请输入打卡原因" /> |
|
|
|
</div> |
|
|
|
<div class="h-12 flex justify-between items-center text-sm" style="border-bottom: 1px solid rgba(0, 0, 0, .1); color: #595959;"> |
|
|
|
<div>打卡时间</div> |
|
|
|
<div class="flex items-center"> |
|
|
|
<input class="clockIn text-right focus:outline-none" type="time" value="00:00" /> |
|
|
|
<img style="width:15px" src="https://www.tall.wiki/staticrec/icon/right.svg" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="h-12 flex justify-between items-center text-sm" style="border-bottom: 1px solid rgba(0, 0, 0, .1); color: #595959;" onclick="p1432643387798069248.show()"> |
|
|
|
<div>审核人</div> |
|
|
|
<div class="flex items-center"><span class="checker">周勇</span><img style="width:15px" src="https://www.tall.wiki/staticrec/icon/right.svg" /></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mt-4 flex" style="border-top: 1px solid rgba(0, 0, 0, .1);"> |
|
|
|
<div class="w-2/4 h-14 flex justify-center items-center" style="font-size: 17px; border-right: 1px solid rgba(0, 0, 0, .1);" onclick="p1432643387798069248.hidePopup()">取消</div> |
|
|
|
<div class="w-2/4 h-14 flex justify-center items-center text-blue-500" style="font-size: 17px;" onclick="p1432643387798069248.punch()">提交</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<script> |
|
|
|
document.querySelector('.img-preview').onclick = function(e){ |
|
|
|
e = window.event || e; |
|
|
|
let parentApp = document.getElementById('img'); |
|
|
|
if(!parentApp.contains(e.target)){ |
|
|
|
document.querySelector('.img-preview').style.display = 'none'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var p1449944565242142720 = { |
|
|
|
var p1432643387798069248 = { |
|
|
|
token: '', |
|
|
|
projectId: '', |
|
|
|
roleId: '', |
|
|
|
dom: '', |
|
|
|
lists: [], // 培训导师列表 |
|
|
|
planId: '', // 培训计划id |
|
|
|
isShow: 0, // 教师列表是否展开 0 不展开 1 展开 |
|
|
|
currentIndex: 0, // 当前点击的导师下标 |
|
|
|
selectedTeachers: [], // 被选中的导师数组 |
|
|
|
lists: [], |
|
|
|
recordList: [], // 打卡列表 |
|
|
|
recordTime: '', // 打卡列表时间 |
|
|
|
currentIndex: '', |
|
|
|
memberId: '', // 打卡人id |
|
|
|
checkerId: '', // 审核员id |
|
|
|
// checkerName: '', // 审核员 |
|
|
|
id: '', // 记录id |
|
|
|
today: '', // 今天日期 |
|
|
|
clockType: -1, // 打卡类型 0 早打卡 1 晚打卡 |
|
|
|
|
|
|
|
init() { |
|
|
|
this.dom = document.querySelector("div[data-root=p1449944565242142720]"); |
|
|
|
var domBox = this.dom.parentNode; |
|
|
|
this.dom = document.querySelector("div[data-root=p1432643387798069248]"); |
|
|
|
var domBox = this.dom.parentNode; |
|
|
|
var title = this.dom.querySelector('.title'); |
|
|
|
|
|
|
|
let currTime = new Date(); |
|
|
|
this.today = currTime.getFullYear() + '-' + (currTime.getMonth() + 1) + '-' + currTime.getDate(); |
|
|
|
|
|
|
|
// 获取父元素携带的参数 |
|
|
|
var userId = domBox.getAttribute("data-uid"); |
|
|
|
this.projectId = domBox.getAttribute("data-pid"); |
|
|
@ -133,7 +173,7 @@ |
|
|
|
// 获取token |
|
|
|
getTokenByUserId(userId){ |
|
|
|
var that = this |
|
|
|
fetch(`https://www.tall.wiki/gateway/tall/v1.0/users/userId?userId=${userId}`) |
|
|
|
fetch(`https://test.tall.wiki/gateway/tall3/v3.0/users/userId?userId=${userId}`) |
|
|
|
.then(function(response) { |
|
|
|
return response.json(); |
|
|
|
}) |
|
|
@ -141,276 +181,522 @@ |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
that.token = data.token; |
|
|
|
// 查询培训计划是否待审核 |
|
|
|
that.getTrainPlan() |
|
|
|
// 委派导师列表 |
|
|
|
that.getTeacherList() |
|
|
|
// 查询考勤信息 |
|
|
|
// that.getClockQuery() |
|
|
|
that.getQueryChecker() |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询委派的导师列表 |
|
|
|
getTeacherList() { |
|
|
|
var that = this; |
|
|
|
fetch(`https://test.tall.wiki/gateway/sports/teacher/getAppoint`, { |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token, |
|
|
|
'Content-Type': 'application/json; charset=utf-8' |
|
|
|
}), |
|
|
|
/** |
|
|
|
* 批量查询打卡信息 |
|
|
|
* @param {string} projectId 项目id |
|
|
|
* @param {Array} codeList |
|
|
|
*/ |
|
|
|
getClockQuery() { |
|
|
|
var that = this |
|
|
|
var timer = null; |
|
|
|
let d = new Date() |
|
|
|
let startTime = new Date(d).getTime() |
|
|
|
const params = JSON.stringify({ |
|
|
|
param: { projectId: that.projectId,roleId: that.roleId, memberIdList: [], startTime, endTime: startTime } |
|
|
|
}); |
|
|
|
var url = 'https://test.tall.wiki/gateway/defaultwbs/clock/query'; |
|
|
|
fetch(url, { |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify({ |
|
|
|
param: { projectId: that.projectId } |
|
|
|
mode: 'cors', |
|
|
|
body: params, |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token ,'Content-Type': 'application/json;charset=utf-8' |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(function(response) { |
|
|
|
}).then(function(response) { |
|
|
|
return response.json(); |
|
|
|
}) |
|
|
|
.then(function(res) { |
|
|
|
}).catch(function(error){ |
|
|
|
console.error('Error:', error) |
|
|
|
}).then(function(res){ |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
that.selectedTeachers = data; |
|
|
|
that.renderTeacherName(); |
|
|
|
if(data && data.length && data[0].recordList && data[0].recordList.length){ |
|
|
|
that.recordList = data[0].recordList; |
|
|
|
that.recordTime = data[0].dateTime; |
|
|
|
|
|
|
|
let html = ''; |
|
|
|
for (let i = 0; i < that.recordList.length; i++) { |
|
|
|
html += `<div class="record-item-${i} flex items-center text-center h-10 border-b"></div>`; |
|
|
|
} |
|
|
|
that.dom.querySelector('.record-wrap').innerHTML = html; |
|
|
|
|
|
|
|
for (let i = 0; i < that.recordList.length; i++) { |
|
|
|
// let record = that.recordList[i]; |
|
|
|
that.renderData(i); |
|
|
|
} |
|
|
|
|
|
|
|
that.memberId = data[0].recordList[0].memberId |
|
|
|
that.id = data[0].recordList[0].id |
|
|
|
|
|
|
|
// 审核人 |
|
|
|
if (data[0].recordList[0].lastCheckerId) { |
|
|
|
that.checkerId = data[0].recordList[0].lastCheckerId |
|
|
|
} else if(data[0].recordList[0].checkerId) { |
|
|
|
that.checkerId = data[0].recordList[0].checkerId |
|
|
|
} else{ |
|
|
|
that.checkerId = that.lists[0].memberId; |
|
|
|
} |
|
|
|
|
|
|
|
let checkerName = ''; |
|
|
|
if (data[0].recordList[0].lastCheckerName) { |
|
|
|
checkerName = data[0].recordList[0].lastCheckerName; |
|
|
|
} else if (data[0].recordList[0].checkerName) { |
|
|
|
checkerName = data[0].recordList[0].checkerName; |
|
|
|
} else { |
|
|
|
checkerName = that.lists[0].name; |
|
|
|
} |
|
|
|
that.dom.querySelector('.checker').innerHTML = checkerName; |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 选中导师名称 |
|
|
|
renderTeacherName() { |
|
|
|
let that = this; |
|
|
|
if (that.selectedTeachers.length > 0) { |
|
|
|
let names = []; |
|
|
|
for (let i = 0; i < that.selectedTeachers.length; i++) { |
|
|
|
names.push(that.selectedTeachers[i].name); |
|
|
|
} |
|
|
|
|
|
|
|
that.dom.querySelector('.startBtn').innerHTML = names; |
|
|
|
} else { |
|
|
|
that.dom.querySelector('.startBtn').innerHTML = "请选择委派导师"; |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询培训计划是否待审核 |
|
|
|
getTrainPlan(){ |
|
|
|
var that = this; |
|
|
|
// let trainPlan = that.dom.querySelector('.train-release'); |
|
|
|
// trainPlan.style.display = 'block'; |
|
|
|
|
|
|
|
fetch(`https://test.tall.wiki/gateway/sports/training/get`, { |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token, |
|
|
|
'Content-Type': 'application/json; charset=utf-8' |
|
|
|
}), |
|
|
|
/** |
|
|
|
* 查询项目成员列表 |
|
|
|
* @param {string} projectId 项目id |
|
|
|
* @param {Array} codeList |
|
|
|
*/ |
|
|
|
getQueryChecker() { |
|
|
|
var that = this |
|
|
|
var timer = null; |
|
|
|
let d = new Date() |
|
|
|
const params = JSON.stringify({ |
|
|
|
param: { projectId: that.projectId } |
|
|
|
}); |
|
|
|
var url = 'https://test.tall.wiki/gateway/defaultwbs/deliver/queryChecker'; |
|
|
|
fetch(url, { |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify({ |
|
|
|
param: {projectId: that.projectId} |
|
|
|
mode: 'cors', |
|
|
|
body: params, |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token ,'Content-Type': 'application/json;charset=utf-8' |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(function(response) { |
|
|
|
}).then(function(response) { |
|
|
|
return response.json(); |
|
|
|
}) |
|
|
|
.then(function(res) { |
|
|
|
}).catch(function(error){ |
|
|
|
console.error('Error:', error) |
|
|
|
}).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; |
|
|
|
if (data && data.checkStatus === 1) { |
|
|
|
// trainPlan.style.display = 'block'; |
|
|
|
} else { |
|
|
|
// trainPlan.style.display = 'none' |
|
|
|
for(var i = 0; i < data.length; i++){ |
|
|
|
data[i].choose = true |
|
|
|
that.lists.push(data[i]) |
|
|
|
} |
|
|
|
|
|
|
|
that.getClockQuery() |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 培训导师列表 |
|
|
|
* 打卡 |
|
|
|
* @param {string} checkerId 审核员id |
|
|
|
* @param {string} clockType 打卡类型 0-早,1-晚 |
|
|
|
* @param {string} dateTime 打卡日期 |
|
|
|
* @param {string} id 记录id(没有则不传) |
|
|
|
* @param {string} memberId 成员id |
|
|
|
*/ |
|
|
|
getAllTeacherList() { |
|
|
|
var that = this; |
|
|
|
fetch(`https://test.tall.wiki/gateway/sports/teacher/query`, { |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token, |
|
|
|
'Content-Type': 'application/json; charset=utf-8' |
|
|
|
}), |
|
|
|
punch(){ |
|
|
|
var that = this |
|
|
|
let { checkerId, id, memberId, clockType } = that |
|
|
|
let d = new Date() |
|
|
|
let dateTime = new Date(d).getTime() |
|
|
|
const params = JSON.stringify({ |
|
|
|
param: { checkerId, id, memberId, dateTime, clockType } |
|
|
|
}); |
|
|
|
var url = 'https://test.tall.wiki/gateway/defaultwbs/clock/punch'; |
|
|
|
fetch(url, { |
|
|
|
method: 'POST', |
|
|
|
body: JSON.stringify({ |
|
|
|
param: {} |
|
|
|
mode: 'cors', |
|
|
|
body: params, |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token ,'Content-Type': 'application/json;charset=utf-8' |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(function(response) { |
|
|
|
}).then(function(response) { |
|
|
|
return response.json(); |
|
|
|
}) |
|
|
|
.then(function(res) { |
|
|
|
}).catch(function(error) { |
|
|
|
console.error('Error:', error) |
|
|
|
}).then(function(res){ |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
that.lists = data; |
|
|
|
|
|
|
|
let html = ''; |
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
let flag = false, status = 0; |
|
|
|
for (let j = 0; i < that.selectedTeachers.length; j++) { |
|
|
|
if (data[i].id == that.selectedTeachers[j].id) { |
|
|
|
flag = true; |
|
|
|
status = that.selectedTeachers[j].status; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
html += `<li class="teacher-box w-1/4 h-6 text-xs flex items-center" onclick="p1449944565242142720.chooseItem(${i}, ${data[0].id})"> |
|
|
|
<input class="teacher-id mr-1" type="checkbox" ${flag && status !== 2 ? 'checked' : ''} ${status !== 0 ? 'disabled' : ''} value="${data[0].name}" /> |
|
|
|
<span class="teacher-name" style="height: 13px; line-height: 13px;">${data[0].name}</span> |
|
|
|
</li>`; |
|
|
|
} |
|
|
|
that.dom.querySelector('.teacher-list').innerHTML = html; |
|
|
|
that.hidePopup(); |
|
|
|
// 查询考勤信息 |
|
|
|
that.getClockQuery() |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示打卡弹框 |
|
|
|
showPopup(type){ |
|
|
|
var clockInPopup = this.dom.querySelector('.clockInPopup'); |
|
|
|
clockInPopup.style.display = 'block'; |
|
|
|
this.clockType = type; |
|
|
|
|
|
|
|
let time = this.format(new Date()); |
|
|
|
let clockIn = this.dom.querySelector('.clockIn'); |
|
|
|
clockIn.value = time; |
|
|
|
}, |
|
|
|
|
|
|
|
// 隐藏打卡弹框 |
|
|
|
hidePopup() { |
|
|
|
var clockInPopup = this.dom.querySelector('.clockInPopup'); |
|
|
|
clockInPopup.style.display = 'none'; |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示选择框 |
|
|
|
show(){ |
|
|
|
this.isShow = this.isShow === 0 ? 1 : 0; |
|
|
|
let teacherBox = this.dom.querySelector('.teacher-list'); |
|
|
|
if (this.isShow) { |
|
|
|
teacherBox.style.display = 'flex'; |
|
|
|
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="p1432643387798069248.chooseItem(${i})">` + this.lists[i].name + '</li>'; |
|
|
|
} |
|
|
|
var ul = this.dom.querySelector('ul'); |
|
|
|
ul.innerHTML = list |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择 |
|
|
|
chooseItem(index){ |
|
|
|
this.currentIndex = index; |
|
|
|
var lis = this.dom.querySelectorAll('li'); |
|
|
|
for (var i = 0; i < lis.length; i++){ |
|
|
|
var item = lis[i]; |
|
|
|
if(i === index){ |
|
|
|
item.classList.add('text-white'); |
|
|
|
item.style.backgroundColor = '#3b82f6'; |
|
|
|
}else{ |
|
|
|
item.classList.remove('text-white'); |
|
|
|
item.style.backgroundColor = '#fff'; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 确定 选择审核人 |
|
|
|
* @param { Array } codeAndAnswerList code和答案 |
|
|
|
* @param { String } projectId 项目ID |
|
|
|
* @param { Number } codeAndAnswerList 提交人类型(0平车 1人) |
|
|
|
*/ |
|
|
|
choose(){ |
|
|
|
const that = this; |
|
|
|
const { dom } = that; |
|
|
|
var startBtn = dom.querySelector('.startBtn'); |
|
|
|
startBtn.innerHTML = that.lists[that.currentIndex].name; |
|
|
|
that.dom.querySelector('.checker').innerHTML = that.lists[that.currentIndex].name; |
|
|
|
that.checkerId = that.lists[that.currentIndex].memberId; |
|
|
|
that.hide(); |
|
|
|
}, |
|
|
|
|
|
|
|
// 取消 |
|
|
|
hide(){ |
|
|
|
var statusChoose = this.dom.querySelector('.statusChoose'); |
|
|
|
statusChoose.style.display='none'; |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示操作面板 |
|
|
|
showAction(index, type) { |
|
|
|
for (let i = 0; i < this.recordList.length; i++) { |
|
|
|
this.renderData(i); |
|
|
|
} |
|
|
|
|
|
|
|
let action = ''; |
|
|
|
if (type === 'morning') { |
|
|
|
action = this.dom.querySelector('.morning-action-' + index); |
|
|
|
} else { |
|
|
|
teacherBox.style.display = 'none'; |
|
|
|
action = this.dom.querySelector('.night-action-' + index); |
|
|
|
} |
|
|
|
action.style.display = 'inline-block'; |
|
|
|
}, |
|
|
|
|
|
|
|
this.getAllTeacherList(); |
|
|
|
// 隐藏操作面板 |
|
|
|
hideAction(index, type) { |
|
|
|
let action = ''; |
|
|
|
if (type === 'morning') { |
|
|
|
action = this.dom.querySelector('.morning-action-' + index); |
|
|
|
} else { |
|
|
|
action = this.dom.querySelector('.night-action-' + index); |
|
|
|
} |
|
|
|
|
|
|
|
action.style.display = 'none'; |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择导师 |
|
|
|
chooseItem(index, id){ |
|
|
|
let flag = false, t_index = -1; |
|
|
|
let teacher_input = this.dom.querySelectorAll('.teacher-box')[index].getElementsByTagName('input')[0]; |
|
|
|
let name = teacher_input.value; |
|
|
|
|
|
|
|
// 被选中的导师id是否在委派导师列表中 |
|
|
|
if (this.selectedTeachers.length > 0) { |
|
|
|
for (let i = 0; i < this.selectedTeachers.length; i++) { |
|
|
|
if (id === this.selectedTeachers[i].id) { |
|
|
|
flag = true; |
|
|
|
t_index = i; |
|
|
|
} |
|
|
|
} |
|
|
|
// 确认、驳回 |
|
|
|
rejectStatus(index, type, timeType) { |
|
|
|
let record = this.recordList[index]; |
|
|
|
const param = { id: record.id, type: type, projectId: this.projectId }; |
|
|
|
if (timeType === 'morning') { |
|
|
|
param.morning = record.morning; |
|
|
|
} else { |
|
|
|
param.night = record.night; |
|
|
|
} |
|
|
|
this.handleClockAudit(param, index); |
|
|
|
}, |
|
|
|
|
|
|
|
if (teacher_input.checked) { |
|
|
|
if (!flag) { |
|
|
|
this.selectedTeachers.push({id: id, name: name}); |
|
|
|
} |
|
|
|
// 修改时间 |
|
|
|
changeTimeData(time, index, type) { |
|
|
|
let record = this.recordList[index]; |
|
|
|
let date = new Date(this.recordTime + ' ' + time); |
|
|
|
let dateTime = date.getTime(); |
|
|
|
|
|
|
|
const param = { id: record.id, type: 0, projectId: this.projectId }; |
|
|
|
if (type === 'morning') { |
|
|
|
param.morning = dateTime; |
|
|
|
} else { |
|
|
|
if (t_index > -1) { |
|
|
|
this.selectedTeachers.splice(t_index, 1); |
|
|
|
} |
|
|
|
param.night = dateTime; |
|
|
|
} |
|
|
|
|
|
|
|
this.renderTeacherName(); |
|
|
|
this.handleClockAudit(param, index); |
|
|
|
}, |
|
|
|
|
|
|
|
// 选中的数据渲染 |
|
|
|
renderData() { |
|
|
|
let d = this.selected; |
|
|
|
let lis = this.dom.querySelectorAll('.teacher-name'); |
|
|
|
for (let i = 0; i < lis.length; i++) { |
|
|
|
let item = lis[i]; |
|
|
|
item.classList.remove('text-white'); |
|
|
|
item.style.backgroundColor = '#fff'; |
|
|
|
let teacher_id = item.getAttribute('data-id'); |
|
|
|
for (let j = 0; j < d.length; j++) { |
|
|
|
if (teacher_id === d[j]) { |
|
|
|
item.classList.add('text-white'); |
|
|
|
item.style.backgroundColor = '#3b82f6'; |
|
|
|
/** |
|
|
|
* 审核打卡 |
|
|
|
* @param {string} id 打卡记录id |
|
|
|
* @param {string} morning 早打卡时间 |
|
|
|
* @param {string} night 晚打卡时间 |
|
|
|
* @param {string} projectId 项目id |
|
|
|
* @param {string} type 审批类型(0-修改,1-驳回,2-通过) |
|
|
|
*/ |
|
|
|
handleClockAudit(param, index) { |
|
|
|
var that = this |
|
|
|
|
|
|
|
const params = JSON.stringify({ |
|
|
|
param: param |
|
|
|
}); |
|
|
|
var url = 'https://test.tall.wiki/gateway/defaultwbs/clock/audit'; |
|
|
|
fetch(url, { |
|
|
|
method: 'POST', |
|
|
|
mode: 'cors', |
|
|
|
body: params, |
|
|
|
headers: new Headers({ |
|
|
|
'Authorization': 'Bearer ' + that.token ,'Content-Type': 'application/json;charset=utf-8' |
|
|
|
}) |
|
|
|
}).then(function(response) { |
|
|
|
return response.json(); |
|
|
|
}).catch(function(error){ |
|
|
|
console.error('Error:', error) |
|
|
|
}).then(function(res){ |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
|
// that.getClockQuery(); |
|
|
|
if (param.morning) { |
|
|
|
if (param.type === 0) { // 修改 |
|
|
|
that.recordList[index].morningStatus = 1; |
|
|
|
} else if (param.type === 1) { // 驳回 |
|
|
|
that.recordList[index].morningStatus = 2; |
|
|
|
} else if (param.type === 2) { // 审核 |
|
|
|
that.recordList[index].morningStatus = 3; |
|
|
|
} |
|
|
|
|
|
|
|
that.recordList[index].morning = param.morning; |
|
|
|
} else { |
|
|
|
if (param.type === 0) { // 修改 |
|
|
|
that.recordList[index].nightStatus = 1; |
|
|
|
} else if (param.type === 1) { // 驳回 |
|
|
|
that.recordList[index].nightStatus = 2; |
|
|
|
} else if (param.type === 2) { // 审核 |
|
|
|
that.recordList[index].nightStatus = 3; |
|
|
|
} |
|
|
|
|
|
|
|
that.recordList[index].night = param.night; |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('msg: ', msg); |
|
|
|
} |
|
|
|
that.renderData(index); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 修改时间 |
|
|
|
changePunchTime(index, type) { |
|
|
|
if (type === 'morning') { |
|
|
|
this.dom.querySelector('.morning-input-' + index).style.display = 'block'; |
|
|
|
this.dom.querySelector('.morning-time-' + index).style.display = 'none'; |
|
|
|
} else { |
|
|
|
this.dom.querySelector('.night-input-' + index).style.display = 'block'; |
|
|
|
this.dom.querySelector('.night-time-' + index).style.display = 'none'; |
|
|
|
} |
|
|
|
|
|
|
|
this.hideAction(index, type); |
|
|
|
}, |
|
|
|
|
|
|
|
// 发布 |
|
|
|
release() { |
|
|
|
// 数据渲染 |
|
|
|
renderData(index) { |
|
|
|
let that = this; |
|
|
|
let html = ''; |
|
|
|
let record = that.recordList[index]; |
|
|
|
let morning = Number(record.morning) ? that.format(Number(record.morning)) : ''; |
|
|
|
let night = Number(record.night) ? that.format(Number(record.night)) : ''; |
|
|
|
|
|
|
|
html += `<div class="text-sm" style="width: 20%;">${record.memberName}</div>`; |
|
|
|
|
|
|
|
html += `<div class="text-sm" style="width: 25%;">`; |
|
|
|
// 早打卡 |
|
|
|
html += `<div class="morning-punch-box-${index} relative inline-block max-w-full">`; |
|
|
|
|
|
|
|
if (!record.isMine && !record.isChecker) { |
|
|
|
if (record.morningStatus === 2) { |
|
|
|
html += `<div class="line-through">${morning}</div>`; |
|
|
|
} else { |
|
|
|
html += `<div class="">${morning ? morning : '未打卡'}</div>`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (that.selectedTeachers.length <= 0) { |
|
|
|
window.alert("请选择培训导师"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
if (record.isMine) { |
|
|
|
if (record.morningStatus === 1) { |
|
|
|
html += `<div class="relative font-bold inline-block">${morning} |
|
|
|
<span class="absolute inline-block rounded-full bg-red-500" style="top: 0; right: -10px; width: 6px; height: 6px;"></span> |
|
|
|
</div>`; |
|
|
|
} else if (record.morningStatus === 2) { |
|
|
|
html += `<div class="line-through font-bold">${morning}</div>`; |
|
|
|
} else if (record.morningStatus === 3) { |
|
|
|
html += `<div class="font-bold">${morning}</div>`; |
|
|
|
} else if (that.today !== that.recordTime) { |
|
|
|
html += `<div>未打卡</div>`; |
|
|
|
} else { |
|
|
|
html += `<button class="morningClockBtn m-auto py-1 rounded bg-blue-500 text-xs text-white" style="width: 50px;" onclick="p1432643387798069248.showPopup(0)">早打卡</button>`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let teacherList = that.dom.querySelector('.selected-teacher'); // 选择导师 |
|
|
|
let teacherSelect = that.dom.querySelector('.select-teacher'); // 已委派的导师 |
|
|
|
let releaseBtn = that.dom.querySelector('.release-btn'); // 发布按钮 |
|
|
|
teacherList.style.display = 'block'; |
|
|
|
teacherSelect.style.display = 'flex'; |
|
|
|
releaseBtn.style.display = 'none'; |
|
|
|
|
|
|
|
let studentBox = that.dom.querySelector('.student-box'); // 查看学员 |
|
|
|
studentBox.style.display = 'block'; |
|
|
|
|
|
|
|
// let ids = []; |
|
|
|
// for (let i = 0; i < that.selectedTeachers.length; i++) { |
|
|
|
// ids.push(that.selectedTeachers[i].id); |
|
|
|
// } |
|
|
|
|
|
|
|
// 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: that.planId, |
|
|
|
// teacherIds: ids |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// .then(function(response) { |
|
|
|
// return response.json(); |
|
|
|
// }) |
|
|
|
// .then(function(res) { |
|
|
|
// const { success, code, data, msg } = res; |
|
|
|
// if (success && code === 200) { |
|
|
|
// let teacherList = that.dom.querySelector('.selected-teacher'); // 选择导师 |
|
|
|
// let teacherSelect = that.dom.querySelector('.select-teacher'); // 已委派的导师 |
|
|
|
// let releaseBtn = that.dom.querySelector('.release-btn'); // 发布按钮 |
|
|
|
// teacherList.style.display = 'block'; |
|
|
|
// teacherSelect.style.display = 'flex'; |
|
|
|
// releaseBtn.style.display = 'none'; |
|
|
|
|
|
|
|
// let studentBox = that.dom.querySelector('.student-box'); // 查看学员 |
|
|
|
// studentBox.style.display = 'block'; |
|
|
|
// } else { |
|
|
|
// console.log('msg: ', msg); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
}, |
|
|
|
if (record.isChecker) { |
|
|
|
html += `<input class="morning-input-${index} border max-w-full focus:outline-none" style="display: none;" type="time" value="${morning}" onblur="p1432643387798069248.changeTimeData(this.value, ${index}, 'morning')" />`; |
|
|
|
|
|
|
|
if (record.morningStatus === 1) { |
|
|
|
html += `<div class="morning-time-${index} relative inline-block" onclick="p1432643387798069248.showAction(${index}, 'morning')">${morning} |
|
|
|
<span class="absolute inline-block rounded-full bg-red-500" style="top: 0; right: -10px; width: 6px; height: 6px;"></span> |
|
|
|
</div>`; |
|
|
|
} else if (record.morningStatus === 2) { |
|
|
|
html += `<div class="morning-time-${index} line-through" onclick="p1432643387798069248.showAction(${index}, 'morning')">${morning}</div>`; |
|
|
|
} else if (record.morningStatus === 3) { |
|
|
|
html += `<div class="morning-time-${index}" onclick="p1432643387798069248.showAction(${index}, 'morning')">${morning}</div>`; |
|
|
|
} else { |
|
|
|
html += `<div class="morning-time-${index}" onclick="p1432643387798069248.showAction(${index}, 'morning')">未打卡</div>`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 操作面板 |
|
|
|
html += `<div class="morning-action-${index} absolute bg-white shadow-lg" style="display: none; bottom: 30px; left: -74px; border-radius: 5px; width: 248px;"> |
|
|
|
<div class="relative flex justify-between" style="padding: 8px;"> |
|
|
|
<button class="text-white bg-green-500" style="width: 52px; height: 26px; border-radius: 5px;" onclick="p1432643387798069248.rejectStatus(${index}, 2, 'morning')">审核</button> |
|
|
|
<button class="text-white bg-red-500" style="width: 52px; height: 26px; border-radius: 5px;" onclick="p1432643387798069248.rejectStatus(${index}, 1, 'morning')">驳回</button> |
|
|
|
<button class="text-white bg-blue-500" style="width: 52px; height: 26px; border-radius: 5px;" onclick="p1432643387798069248.changePunchTime(${index}, 'morning')">修改</button> |
|
|
|
<button class="border" style="width: 52px; height: 26px; border-radius: 5px; border-color: #999; color: #595959;" onclick="p1432643387798069248.hideAction(${index}, 'morning')">取消</button> |
|
|
|
<div class="absolute w-0 h-0" style="left: 88px; top: 42px; font-size: 0; line-height: 0; border-width: 7px; border-color: #fff transparent transparent;"></div> |
|
|
|
</div> |
|
|
|
</div>`; |
|
|
|
|
|
|
|
html += `</div>`; |
|
|
|
html += `</div>`; |
|
|
|
|
|
|
|
html += `<div class="text-sm" style="width: 25%;">`; |
|
|
|
// 晚打卡 |
|
|
|
html += `<div class="night-punch-box relative max-w-full inline-block">`; |
|
|
|
|
|
|
|
if (!record.isMine && !record.isChecker) { |
|
|
|
if (record.nightStatus === 2) { |
|
|
|
html += `<div class="line-through">${night}</div>`; |
|
|
|
} else { |
|
|
|
html += `<div class="">${night ? night : '未打卡'}</div>`; |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (record.isMine) { |
|
|
|
if (record.nightStatus === 1) { |
|
|
|
html += `<div class="relative font-bold inline-block">${night} |
|
|
|
<span class="absolute inline-block rounded-full bg-red-500" style="top: 0; right: -10px; width: 6px; height: 6px;"></span> |
|
|
|
</div>`; |
|
|
|
} else if (record.nightStatus === 2) { |
|
|
|
html += `<div class="line-through font-bold">${night}</div>`; |
|
|
|
} else if (record.nightStatus === 3) { |
|
|
|
html += `<div class="font-bold">${night}</div>`; |
|
|
|
} else if (that.today !== that.recordTime) { |
|
|
|
html += `<div>未打卡</div>`; |
|
|
|
} else { |
|
|
|
html += `<button class="nightClockBtn m-auto py-1 rounded bg-blue-500 text-xs text-white" style="width: 50px;" onclick="p1432643387798069248.showPopup(1)">晚打卡</button>`; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 预览 |
|
|
|
bigImg() { |
|
|
|
document.querySelector('.img-preview').style.display = 'flex'; |
|
|
|
if (record.isChecker) { |
|
|
|
html += `<input class="night-input-${index} border max-w-full focus:outline-none" style="display: none;" type="time" value="${night}" onblur="p1432643387798069248.changeTimeData(this.value, ${index}, 'night')" />`; |
|
|
|
|
|
|
|
if (record.nightStatus === 1) { |
|
|
|
html += `<div class="night-time-${index} relative inline-block" onclick="p1432643387798069248.showAction(${index}, 'night')">${night} |
|
|
|
<span class="absolute inline-block rounded-full bg-red-500" style="top: 0; right: -10px; width: 6px; height: 6px;"></span> |
|
|
|
</div>`; |
|
|
|
} else if (record.nightStatus === 2) { |
|
|
|
html += `<div class="night-time-${index} line-through" onclick="p1432643387798069248.showAction(${index}, 'night')">${night}</div>`; |
|
|
|
} else if (record.nightStatus === 3) { |
|
|
|
html += `<div class="night-time-${index}" onclick="p1432643387798069248.showAction(${index}, 'night')">${night}</div>`; |
|
|
|
} else { |
|
|
|
html += `<div class="night-time-${index}" onclick="p1432643387798069248.showAction(${index}, 'night')">未打卡</div>`; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
html += `<div class="night-action-${index} absolute bg-white shadow-lg" style="display: none; bottom: 30px; right: -74px; border-radius: 5px; width: 248px;"> |
|
|
|
<div class="relative flex justify-between" style="padding: 8px;"> |
|
|
|
<button class="text-white bg-green-500" style="width: 52px; height: 26px; border-radius: 5px;" onclick="p1432643387798069248.rejectStatus(${index}, 2, 'night')">审核</button> |
|
|
|
<button class="text-white bg-red-500" style="width: 52px; height: 26px; border-radius: 5px;" onclick="p1432643387798069248.rejectStatus(${index}, 1, 'night')">驳回</button> |
|
|
|
<button class="text-white bg-blue-500" style="width: 52px; height: 26px; border-radius: 5px;" onclick="p1432643387798069248.changePunchTime(${index}, 'night')">修改</button> |
|
|
|
<button class="border" style="width: 52px; height: 26px; border-radius: 5px; border-color: #999; color: #595959;" onclick="p1432643387798069248.hideAction(${index}, 'night')">取消</button> |
|
|
|
<div class="absolute w-0 h-0" style="right: 88px; top: 42px; font-size: 0; line-height: 0; border-width: 7px; border-color: #fff transparent transparent;"></div> |
|
|
|
</div> |
|
|
|
</div>`; |
|
|
|
|
|
|
|
html += `</div>`; |
|
|
|
html += `</div>`; |
|
|
|
|
|
|
|
let checker = record.lastCheckerId ? record.lastCheckerName : record.checkerName ? record.checkerName : that.lists[0].name; |
|
|
|
html += `<div class="text-sm" style="width: 30%;">`; |
|
|
|
if (!record.isMine || record.isMine && record.morningStatus && record.nightStatus || that.today !== that.recordTime) { |
|
|
|
html += `<div class="mr-1">${record.checkerName ? record.checkerName : that.lists[0].name}</div>`; |
|
|
|
} else { |
|
|
|
html += `<div class="flex flex-nowrap border py-1 px-3 rounded-md" onclick="p1432643387798069248.show()">`; |
|
|
|
html += `<div class="startBtn mr-1">${checker}</div>`; |
|
|
|
html += `<img style="width:15px" src="https://www.tall.wiki/staticrec/icon/down.svg" />`; |
|
|
|
html += `</div>`; |
|
|
|
} |
|
|
|
html += `</div>`; |
|
|
|
|
|
|
|
that.dom.querySelector('.record-item-' + index).innerHTML = html; |
|
|
|
}, |
|
|
|
|
|
|
|
// 查看红头文件 |
|
|
|
checkFile() { |
|
|
|
const pId = this.dom.parentNode.getAttribute('data-pid'); |
|
|
|
const uId = this.dom.parentNode.getAttribute('data-uid'); |
|
|
|
const rId = this.dom.parentNode.getAttribute('data-rid'); |
|
|
|
location.href = `https://test.tall.wiki/ts/file?pid=${pId}&uid=${uId}&rid=${rId}` |
|
|
|
// 时间戳转时间格式 |
|
|
|
format(shijianchuo){ |
|
|
|
//shijianchuo是整数,否则要parseInt转换 |
|
|
|
var time = new Date(shijianchuo); |
|
|
|
// var y = time.getFullYear(); |
|
|
|
// var m = time.getMonth()+1; |
|
|
|
// var d = time.getDate(); |
|
|
|
var h = time.getHours(); |
|
|
|
var mm = time.getMinutes(); |
|
|
|
// var s = time.getSeconds(); |
|
|
|
return this.add0(h)+':' + this.add0(mm); |
|
|
|
}, |
|
|
|
|
|
|
|
add0(m){return m<10?'0'+m:m }, |
|
|
|
|
|
|
|
// 跳转详情 |
|
|
|
studentList() { |
|
|
|
jumpDetails(that) { |
|
|
|
const pId = this.dom.parentNode.getAttribute('data-pid'); |
|
|
|
const uId = this.dom.parentNode.getAttribute('data-uid'); |
|
|
|
const rId = this.dom.parentNode.getAttribute('data-rid'); |
|
|
|
location.href = `https://test.tall.wiki/ts/peopleList?pid=${pId}&uid=${uId}&rid=${rId}`; |
|
|
|
location.href = `https://test.tall.wiki/checkwork/?pid=${pId}&uid=${uId}&rid=${rId}`; |
|
|
|
} |
|
|
|
} |
|
|
|
p1449944565242142720.init() |
|
|
|
p1432643387798069248.init() |
|
|
|
</script> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|