|
|
@ -70,6 +70,7 @@ |
|
|
|
const p1419895788024373248 = { |
|
|
|
token: '', |
|
|
|
dom: '', |
|
|
|
projectId: '', |
|
|
|
|
|
|
|
init() { |
|
|
|
this.dom = document.querySelector("div[data-root=p1419895788024373248]"); |
|
|
@ -77,9 +78,9 @@ |
|
|
|
var title = this.dom.querySelector('.title'); |
|
|
|
title.innerHTML = domBox.getAttribute('data-tname') |
|
|
|
|
|
|
|
console.log('初始化'); |
|
|
|
// 获取父元素携带的参数 |
|
|
|
var userId = domBox.getAttribute("data-uid"); |
|
|
|
this.projectId = domBox.getAttribute("data-pid"); |
|
|
|
// 初始化的时候 获取token |
|
|
|
this.getTokenByUserId(userId); |
|
|
|
}, |
|
|
@ -104,15 +105,20 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询到场人员信息 |
|
|
|
* 查询类型的所有下级和完成情况 |
|
|
|
* @param {string} projectId 项目id |
|
|
|
* @param {string} code |
|
|
|
*/ |
|
|
|
getFirstAidRecord() { |
|
|
|
var that = this |
|
|
|
const params = JSON.stringify({ |
|
|
|
param: {} |
|
|
|
param: { |
|
|
|
code: 'YJJL', |
|
|
|
projectId: that.projectId, |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
fetch('/getDate', { |
|
|
|
fetch('http://www.tall.wiki/gateway/qcp/v3.0/patient/subordinate', { |
|
|
|
method: 'POST', |
|
|
|
body: params, |
|
|
|
headers: new Headers({ |
|
|
@ -122,6 +128,13 @@ |
|
|
|
return response.json(); |
|
|
|
}).catch(function(error){ |
|
|
|
console.error('Error:', error) |
|
|
|
// TODO: 测试数据 |
|
|
|
const aa = { |
|
|
|
completeNum: 8, |
|
|
|
totalNum: 8, |
|
|
|
} |
|
|
|
that.setDate(aa) |
|
|
|
// TODO |
|
|
|
}).then(function(res){ |
|
|
|
const { success, code, data, msg } = res; |
|
|
|
if (success && code === 200) { |
|
|
@ -139,27 +152,35 @@ |
|
|
|
var unCompleteBtn = dom.querySelector('.unCompleteBtn'); |
|
|
|
var completeBtn = dom.querySelector('.completeBtn'); |
|
|
|
var btn = unCompleteBtn.querySelector('button'); |
|
|
|
if(res.status === 0){ |
|
|
|
|
|
|
|
if(res.totalNum - res.completeNum === res.totalNum){ |
|
|
|
startBtn.style.display='block'; |
|
|
|
unCompleteBtn.style.display='none'; |
|
|
|
completeBtn.style.display='none'; |
|
|
|
}else if(res.status === 1){ |
|
|
|
return |
|
|
|
} |
|
|
|
if(res.totalNum > res.completeNum){ |
|
|
|
btn.innerHTML = res.unComplete + "项未填" |
|
|
|
startBtn.style.display='none'; |
|
|
|
unCompleteBtn.style.display='block'; |
|
|
|
completeBtn.style.display='none'; |
|
|
|
}else{ |
|
|
|
return |
|
|
|
} |
|
|
|
if(res.totalNum = res.completeNum){ |
|
|
|
startBtn.style.display='none'; |
|
|
|
unCompleteBtn.style.display='none'; |
|
|
|
completeBtn.style.display='block'; |
|
|
|
return |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 跳转详情 |
|
|
|
jumpDetails(that) { |
|
|
|
console.log(that.parentNode.getAttribute('data-tname')) |
|
|
|
console.log(that.parentNode.getAttribute('data-pid')) |
|
|
|
location.href = 'https://www.baidu.com' |
|
|
|
const pId = that.parentNode.parentNode.getAttribute('data-pid'); |
|
|
|
const rId = that.parentNode.parentNode.getAttribute('data-rid'); |
|
|
|
const uId = that.parentNode.parentNode.getAttribute('data-uid'); |
|
|
|
const tId = that.parentNode.parentNode.getAttribute('data-tid'); |
|
|
|
location.href = `https://www.tall.wiki/qc/medicalSkill?projectId=${pId}&roleId=${rId}&userId=${uId}&id=${tId}`; |
|
|
|
} |
|
|
|
} |
|
|
|
p1419895788024373248.init() |
|
|
|