Browse Source

工资条

tall-salary
xuesinan 3 years ago
parent
commit
3388a6763b
  1. 78
      index.html

78
index.html

@ -48,18 +48,19 @@
<button class="bg-blue-500 py-2 px-5 rounded text-white" onclick="p100.show()">测试组建2</button>
<div data-tname="工资条"
data-pid="1473556016628244480"
data-uid="1217647686598135808"
data-rid="1473556018582790144"
data-token="eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NTM2MTQwOTksInN1YiI6IjE0ODE0NTg3NDEyOTU3MTQzMDQiLCJhdXRoSWQiOiIxNDgxNDU4NzQxNTMwNTk1MzI4IiwiZXhwIjoxNjUzNjIxMjk5fQ.kM15-gERv5j5qWBeWEG0kDxLWMJesHInnwFQnUaKcGg"
data-url="http://101.201.226.163:7320/v1.0"
data-type="1"
data-tid="tid444"
data-did="did555"
style="height:50px;width:100%">
data-pid="1473556016628244480"
data-uid="1217647686598135808"
data-rid="1473556018582790144"
data-token="eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NTM2MTQwOTksInN1YiI6IjE0ODE0NTg3NDEyOTU3MTQzMDQiLCJhdXRoSWQiOiIxNDgxNDU4NzQxNTMwNTk1MzI4IiwiZXhwIjoxNjUzNjIxMjk5fQ.kM15-gERv5j5qWBeWEG0kDxLWMJesHInnwFQnUaKcGg"
data-url="http://101.201.226.163:7320/v1.0"
data-tTime="1660492800000"
data-type="1"
data-tid="tid444"
data-did="did555"
style="height:50px;width:100%">
<div data-root="p1541239500222763008" class="w-full h-full flex justify-between items-center">
<div class="title" style="font-size: 14px;"></div>
<button class="bg-blue-500 text-xs rounded py-1 px-3 text-white border-none" onclick="p1541239500222763008.jumpDetails(this)">早打卡</button>
<button class="bg-blue-500 text-xs rounded py-1 px-3 text-white border-none" onclick="p1541239500222763008.jumpDetails(this)">查看</button>
</div>
</div>
@ -69,35 +70,48 @@
init() {
this.dom = document.querySelector("div[data-root=p1541239500222763008]");
if (this.dom) {
var title = this.dom.querySelector('.title');
var title = this.dom.querySelector('.title');
var myDate = new Date();
var tMonth = myDate.getMonth();
title.innerHTML = tMonth === 0 ? '12月份工资表' : tMonth + '月份工资表';
}
const currTime = this.dom.parentNode.getAttribute('data-tTime'); // 任务时间
let tMonth = '';
if (currTime) {
tMonth = this.format(currTime);
} else {
var myDate = new Date();
tMonth = myDate.getMonth();
}
title.innerHTML = tMonth === 0 ? '12月份工资表' : tMonth + '月份工资表';
},
// 时间戳转时间格式
format(shijianchuo){
//shijianchuo是整数,否则要parseInt转换
var time = new Date(+shijianchuo);
var m = time.getMonth();
return m;
},
jumpDetails(that) {
const pId = this.dom.parentNode.getAttribute('data-pid');
const uId = this.dom.parentNode.getAttribute('data-uid');
const token = this.dom.parentNode.getAttribute('data-token');
const rId = this.dom.parentNode.getAttribute('data-rid');
const url = this.dom.parentNode.getAttribute('data-url');
const type = this.dom.parentNode.getAttribute('data-type') ? 1 : 0;
const pId = this.dom.parentNode.getAttribute('data-pid');
const uId = this.dom.parentNode.getAttribute('data-uid');
const token = this.dom.parentNode.getAttribute('data-token');
const rId = this.dom.parentNode.getAttribute('data-rid');
const url = this.dom.parentNode.getAttribute('data-url');
const type = this.dom.parentNode.getAttribute('data-type') ? 1 : 0;
const param = `http://101.201.226.163/tallsalary/?pid=${pId}&uid=${uId}&rid=${rId}&token=${token}&url=${url}`;
if (type === 1) {
sessionStorage.setItem('targetUrl', param);
} else {
location.href = param;
}
const param = `http://101.201.226.163/tallsalary/?pid=${pId}&uid=${uId}&rid=${rId}&token=${token}&url=${url}`;
if (type === 1) {
sessionStorage.setItem('targetUrl', param);
} else {
location.href = param;
}
// var pId = that.parentNode.parentNode.getAttribute('data-pid');
// var rId = that.parentNode.parentNode.getAttribute('data-rid');
// var uId = that.parentNode.parentNode.getAttribute('data-uid');
// location.href = `http://101.201.226.163/checkwork/salary/?pid=${pId}&uid=${uId}&rid=${rId}`;
// var pId = that.parentNode.parentNode.getAttribute('data-pid');
// var rId = that.parentNode.parentNode.getAttribute('data-rid');
// var uId = that.parentNode.parentNode.getAttribute('data-uid');
// location.href = `http://101.201.226.163/checkwork/salary/?pid=${pId}&uid=${uId}&rid=${rId}`;
}
}
p1541239500222763008.init()

Loading…
Cancel
Save