Browse Source

更新代码

tall-check-work
song 4 years ago
parent
commit
e549f65eff
  1. 99
      index.html

99
index.html

@ -49,12 +49,12 @@
<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-root="p1432643387798069248" class="flex flex-row justify-space items-center" style="height:100%;width:100%;">
<div data-root="p1485171846022434817" class="flex flex-row justify-space items-center" style="height:100%;width:100%;">
<div class="title"></div>
<div class="flex flex-1 flex-row">
<!-- 早打卡 -->
<div class="flex-1">
<button class="morningClockBtn bg-blue-500 text-xs rounded-md py-1 px-3 text-white" onclick="p1432643387798069248.punch(0)">早打卡</button>
<button class="morningClockBtn bg-blue-500 text-xs rounded-md py-1 px-3 text-white border-none" onclick="p1485171846022434817.punch(0)">早打卡</button>
<div style="position: relative;float: left;">
<div class="morningClockText" style="display: none;font-weight: 700;"></div>
<span class="morningDot rounded-full bg-red-500" style="position: absolute;top: 0;right: -10px;width: 6px;height: 6px;display: none;"></span>
@ -64,7 +64,7 @@
</div>
<!-- 晚打卡 -->
<div class="flex-1">
<button class="nightClockBtn bg-blue-500 text-xs rounded-md py-1 px-3 text-white" onclick="p1432643387798069248.punch(1)">晚打卡</button>
<button class="nightClockBtn bg-blue-500 text-xs rounded-md py-1 px-3 text-white border-none" onclick="p1485171846022434817.punch(1)">晚打卡</button>
<div style="position: relative;float: left;">
<span class="nightClockText" style="display: none;font-weight: 700;"></span>
<span class="nightDot rounded-full bg-red-500" style="position: absolute;top: 0;right: -10px;width: 6px;height: 6px;display: none;"></span>
@ -73,31 +73,32 @@
<span class="nightClockAgree" style="color: #13acc4;font-weight: 700;display: none;"></span>
</div>
</div>
<div class="flex flex-nowrap border py-1 px-3 rounded-md startBtnBox" onclick="p1432643387798069248.show()">
<div class="flex flex-nowrap border py-1 px-3 rounded-md startBtnBox" onclick="p1485171846022434817.show()">
<div class="startBtn mr-1">审核人</div>
<img style="width:15px" src="https://www.tall.wiki/staticrec/icon/down.svg" />
</div>
<div class="startText mr-1" style="display: none;">审核人</div>
<div class="flex flex-nowrap ml-4" onclick="p1432643387798069248.jumpDetails(this)">
<div class="flex flex-nowrap ml-4" onclick="p1485171846022434817.jumpDetails(this)">
<img style="width:15px" src="https://www.tall.wiki/staticrec/icon/right.svg" />
</div>
<div class="w-screen h-screen fixed z-10 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="text-gray-400" onclick="p1485171846022434817.hide()">取消</span>
<span class="font-bold">选择审核人</span>
<span class="text-blue-500" onclick="p1432643387798069248.choose()">确定</span>
<span class="text-blue-500" onclick="p1485171846022434817.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>
</div>
</div>
<script>
var p1432643387798069248 = {
var p1485171846022434817 = {
token: '',
projectId: '',
roleId: '',
@ -110,36 +111,38 @@
id: '', // 记录id
init() {
this.dom = document.querySelector("div[data-root=p1432643387798069248]");
var domBox = this.dom.parentNode;
this.dom = document.querySelector("div[data-root=p1485171846022434817]");
var domBox = this.dom.parentNode;
var title = this.dom.querySelector('.title');
// 获取父元素携带的参数
var userId = domBox.getAttribute("data-uid");
this.projectId = domBox.getAttribute("data-pid");
this.roleId = domBox.getAttribute("data-rid");
this.token = domBox.getAttribute("data-token");
this.getClockQuery();
// 初始化的时候 获取token
this.getTokenByUserId(userId);
// this.getTokenByUserId(userId);
},
// 获取token
getTokenByUserId(userId){
var that = this
fetch(`https://www.tall.wiki/gateway/tall/v1.0/users/userId?userId=${userId}`)
.then(function(response) {
return response.json();
})
.then(function(res) {
const { success, code, data, msg } = res;
if (success && code === 200) {
that.token = data.token;
// 查询考勤信息
that.getClockQuery()
} else {
console.log('msg: ', msg);
}
});
},
// getTokenByUserId(userId){
// var that = this
// fetch(`https://www.tall.wiki/gateway/tall3/v3.0/users/userId?userId=${userId}`)
// .then(function(response) {
// return response.json();
// })
// .then(function(res) {
// const { success, code, data, msg } = res;
// if (success && code === 200) {
// that.token = data.token;
// // 查询考勤信息
// } else {
// console.log('msg: ', msg);
// }
// });
// },
/**
* 批量查询打卡信息
@ -149,15 +152,21 @@
getClockQuery() {
var that = this
var timer = null;
let startTime = new Date(new Date().toLocaleDateString()).getTime();
let endTime = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000;
// 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 }
// });
let startTime = new Date(new Date().toLocaleDateString()).getTime();
let endTime = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000;
const params = JSON.stringify({
param: { projectId: that.projectId,roleId: that.roleId, memberIdList: [], startTime, endTime }
});
var url = 'https://www.tall.wiki/gateway/defaultwbs/clock/query';
var url = 'http://101.201.226.163:7320/v1.0/clock/query';
fetch(url, {
method: 'POST',
mode: 'cors',
mode: 'cors',
body: params,
headers: new Headers({
'Authorization': 'Bearer ' + that.token ,'Content-Type': 'application/json;charset=utf-8'
@ -214,10 +223,10 @@
const params = JSON.stringify({
param: { projectId: that.projectId }
});
var url = 'https://www.tall.wiki/gateway/defaultwbs/deliver/queryChecker';
var url = 'http://101.201.226.163:7320/v1.0/deliver/queryChecker';
fetch(url, {
method: 'POST',
mode: 'cors',
mode: 'cors',
body: params,
headers: new Headers({
'Authorization': 'Bearer ' + that.token ,'Content-Type': 'application/json;charset=utf-8'
@ -260,10 +269,10 @@
const params = JSON.stringify({
param: { checkerId, id, memberId, dateTime, clockType }
});
var url = 'https://www.tall.wiki/gateway/defaultwbs/clock/punch';
var url = 'http://101.201.226.163:7320/v1.0/clock/punch';
fetch(url, {
method: 'POST',
mode: 'cors',
mode: 'cors',
body: params,
headers: new Headers({
'Authorization': 'Bearer ' + that.token ,'Content-Type': 'application/json;charset=utf-8'
@ -290,7 +299,7 @@
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>';
list += `<li class="py-3" onclick="p1485171846022434817.chooseItem(${i})">` + this.lists[i].name + '</li>';
}
var ul = this.dom.querySelector('ul');
ul.innerHTML = list
@ -433,15 +442,15 @@
add0(m){return m<10?'0'+m:m },
// 跳转详情
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://www.tall.wiki/checkwork/?pid=${pId}&uid=${uId}&rid=${rId}`;
}
// // 跳转详情
// 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://www.tall.wiki/checkwork/?pid=${pId}&uid=${uId}&rid=${rId}`;
// }
}
p1432643387798069248.init()
p1485171846022434817.init()
</script>
</div>
</div>

Loading…
Cancel
Save