|
@@ -18,7 +18,8 @@ const arrowLeft= require("./../images/arrow_left.png")
|
|
|
const arrowRight = require("./../images/arrow_right.png")
|
|
|
listenScroll()
|
|
|
let tabList = [], deptNameTemp="",data_desc=["leaveHospitalDate"],data_asc=[];
|
|
|
-let global_DeptCheckers = {},global_Checkers={4:[],5:[],6:[]},global_CheckerId='',global_DeptId='',global_activeTabCode='0';
|
|
|
+let global_DeptCheckers = {},global_Checkers={4:[],5:[],6:[]},global_CheckerId='',global_CheckerName='',global_DeptId='',
|
|
|
+ global_activeTabCode='0',global_TaskCodes=[];
|
|
|
let isPlacefile = getCookie('isPlacefile')||1
|
|
|
/*if(isPlacefile != 1){
|
|
|
data_desc=["behospital_date"]
|
|
@@ -41,7 +42,8 @@ $(parent.document).find(".menu .page[code=YH-ZKHC-FPRW]").addClass("active")
|
|
|
//高度适应
|
|
|
function setBoxHeight() {
|
|
|
const ht = window.innerHeight;
|
|
|
- $('.overAuto').height(ht - 200 + 'px');
|
|
|
+ $('.table-cont').height(ht - 319 + 'px');
|
|
|
+ $('.overAuto').height(ht - 174 + 'px');
|
|
|
}
|
|
|
setBoxHeight();
|
|
|
$(window).resize(function() {
|
|
@@ -66,7 +68,7 @@ function getTabData(activePage){
|
|
|
asc:data_asc, //升序
|
|
|
desc:data_desc, //降序
|
|
|
size: 15,
|
|
|
- jobType:$(".tabs .active").attr("data-code"), //0-科室任务 1-院级 2-质控科
|
|
|
+ jobType:global_activeTabCode, //0-科室任务 1-院级 2-质控科
|
|
|
...filterData,
|
|
|
deptList:deptList,
|
|
|
behosDateEnd:undefined,
|
|
@@ -82,7 +84,7 @@ function getTabData(activePage){
|
|
|
const totalNum = data.total;
|
|
|
renderTab(tabList)
|
|
|
renderPagination(totalPage,Number(activePage),totalNum)
|
|
|
- if(totalPage > 1){
|
|
|
+ if(totalPage > 0){
|
|
|
renderPagination(totalPage,Number(activePage),totalNum)
|
|
|
} else{
|
|
|
$('.pagination').html("")
|
|
@@ -103,11 +105,11 @@ $(".tabBox .tabs button").on("click",(e)=>{
|
|
|
$(me).addClass("active");
|
|
|
clearCheckerFilter();
|
|
|
clearFilter();
|
|
|
- //刷新质控员列表
|
|
|
- getCheckerList();
|
|
|
- //更新列表并重置筛选条件
|
|
|
- //$(".abnormalClear").click();
|
|
|
-
|
|
|
+ //刷新质控员、任务列表
|
|
|
+ //getCheckerList();
|
|
|
+ const data = global_Checkers[+global_activeTabCode+4];
|
|
|
+ rendeCheckerList(data||[]);
|
|
|
+ renderCheckerTable(data);
|
|
|
});
|
|
|
|
|
|
//任务筛选
|
|
@@ -130,6 +132,7 @@ function clearCheckerFilter(){
|
|
|
$(".checkerList").css("display", "none")
|
|
|
global_DeptId="";
|
|
|
global_CheckerId="";
|
|
|
+ global_CheckerName="";
|
|
|
}
|
|
|
|
|
|
function clearFilter(){
|
|
@@ -171,7 +174,7 @@ $(".abnormalClear").on("click", function(e){
|
|
|
clearFilter();
|
|
|
getTabData(1)
|
|
|
})
|
|
|
-
|
|
|
+//质控员列表渲染
|
|
|
function renderCheckerTable(data,noTasksUpdate){
|
|
|
let str = ``,code="";
|
|
|
if(!data||data.length===0){
|
|
@@ -179,6 +182,7 @@ function renderCheckerTable(data,noTasksUpdate){
|
|
|
// initScroll("qcList","YX",1)
|
|
|
return;
|
|
|
}
|
|
|
+ console.log(noTasksUpdate)
|
|
|
//获取任务列表数据
|
|
|
(!noTasksUpdate)&&getTabData(1);
|
|
|
|
|
@@ -188,12 +192,12 @@ function renderCheckerTable(data,noTasksUpdate){
|
|
|
|
|
|
str += `
|
|
|
<tr data-index=${i}>
|
|
|
- <td class="operaItem textCenter" code="${item.doctorId}" deptId="${item.deptId}"><i></i></td>
|
|
|
+ <td class="operaItem checkerRadio textCenter" code="${item.doctorId}" data-name="${item.doctorName}"><i></i></td>
|
|
|
`
|
|
|
for(let i=0;i<titles.length;i++){
|
|
|
code=$(titles[i]).attr('valCode');
|
|
|
if(code==="jobNum"){
|
|
|
- str += `<td class="textCenter"><a class="job-num" data-index=${i}>${ item[code]}<a></td>`
|
|
|
+ str += `<td class="textCenter"><a class="job-num" data-index=${i} data-id="${item.doctorId}" data-name="${item.doctorName}">${ item[code]}<a></td>`
|
|
|
}else{
|
|
|
str += `<td class="textCenter"><span data-index=${i}>${ item[code]}<span></td>`
|
|
|
}
|
|
@@ -201,21 +205,38 @@ function renderCheckerTable(data,noTasksUpdate){
|
|
|
str += "</tr>"
|
|
|
}
|
|
|
$('.checkerTable .tbody').html(str)
|
|
|
- selectCheckerTb()
|
|
|
+ selectCheckerTb();
|
|
|
+ bindTaskNumEvent();
|
|
|
}
|
|
|
-
|
|
|
+//选中质控员
|
|
|
function selectCheckerTb(){
|
|
|
- $(".operaItem").click(function(){
|
|
|
+ $(".checkerRadio").click(function(){
|
|
|
global_CheckerId=$(this).attr("code");
|
|
|
- $(".operaItem i").removeClass("active");
|
|
|
+ global_CheckerName=$(this).attr("data-name");
|
|
|
+ $(".checkerRadio i").removeClass("active");
|
|
|
$(this).find("i").addClass('active');
|
|
|
});
|
|
|
}
|
|
|
+//选中任务
|
|
|
+function selectTaskTb(){
|
|
|
+ $(".taskCheck").unbind("click").click(function(){
|
|
|
+ const id=$(this).attr("code");
|
|
|
+ const it =$(this).find("i");
|
|
|
+ const codes = global_TaskCodes.join(",")+",";
|
|
|
+ if(it.is(".active")){
|
|
|
+ global_TaskCodes = codes.replace(id+",","").split(",");
|
|
|
+ }else{
|
|
|
+ global_TaskCodes.push(id);
|
|
|
+ }
|
|
|
+ it.toggleClass('active');
|
|
|
|
|
|
+ });
|
|
|
+}
|
|
|
+//待分配任务列表渲染
|
|
|
function renderTab(data){
|
|
|
let str = ``,code=""
|
|
|
if(data.length===0){
|
|
|
- $('.patientTable .tbody').html(emptyBox(null,8))
|
|
|
+ $('.patientTable .tbody').html(emptyBox(null,7))
|
|
|
// initScroll("qcList","YX",1)
|
|
|
return;
|
|
|
}
|
|
@@ -225,7 +246,7 @@ function renderTab(data){
|
|
|
|
|
|
str += `
|
|
|
<tr data-index=${i}>
|
|
|
- <td class="operaItem textCenter" code="${item.id}"><i></i></td>`;
|
|
|
+ <td class="operaItem taskCheck textCenter" code="${item.behospitalCode}"><i></i></td>`;
|
|
|
for(let i=0;i<titles.length;i++){
|
|
|
code=$(titles[i]).attr('valCode');
|
|
|
str += `<td class="textCenter"><span data-index=${i}>${ item[code] || "-"}<span></td>`
|
|
@@ -234,8 +255,8 @@ function renderTab(data){
|
|
|
}
|
|
|
|
|
|
$('.patientTable .tbody').html(str)
|
|
|
+ selectTaskTb();
|
|
|
}
|
|
|
-
|
|
|
//选择病历等级
|
|
|
/*$('.selectLevel').on("click", function(e){
|
|
|
e.stopPropagation()
|
|
@@ -266,6 +287,20 @@ function bindLeveldSelect(){
|
|
|
$('.selectLevel').removeClass('unSelect')
|
|
|
})
|
|
|
}*/
|
|
|
+//任务数点击事件
|
|
|
+function bindTaskNumEvent(){
|
|
|
+ $(".job-num").unbind("click").click(function(){
|
|
|
+ global_CheckerId = $(this).attr("data-id");
|
|
|
+ global_CheckerName=$(this).attr("data-name");
|
|
|
+ $(".modal-container").show();
|
|
|
+ getTasksList();
|
|
|
+ })
|
|
|
+}
|
|
|
+//关闭弹窗事件
|
|
|
+$(".modal-container .close").click(function(){
|
|
|
+ $(".modal-container").hide();
|
|
|
+});
|
|
|
+
|
|
|
//科室选择
|
|
|
$('.selectDept').on("click", function(e){
|
|
|
e.stopPropagation()
|
|
@@ -308,6 +343,53 @@ function getCheckerList(){
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+//获取质控员任务列表
|
|
|
+function getTasksList(){
|
|
|
+ post(ywCheckApi.getTaskByUserId,{checkId:global_CheckerId}).then(res =>{
|
|
|
+ if(res.data.code == '0'){
|
|
|
+ const list = res.data.data||{};
|
|
|
+ renderTaskTable(list);
|
|
|
+ }else{rendeCheckerList([])}
|
|
|
+ }).catch((e) =>{
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//质控员任务列表渲染
|
|
|
+function renderTaskTable(data) {
|
|
|
+ let str = ``, code = "";
|
|
|
+ if (!data || data.length === 0) {
|
|
|
+ $('.taskTable .tbody').html(emptyBox(null, 7))
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const titles = $(".taskTable .tabTitle th[valCode]");console.log(data)
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ const item = data[i];
|
|
|
+ str += `<tr data-index=${i}>`;
|
|
|
+ for (let i = 0; i < titles.length; i++) {
|
|
|
+ code = $(titles[i]).attr('valCode');
|
|
|
+ str += `<td class="textCenter"><span data-index=${i}>${ item[code] || "-"}<span></td>`
|
|
|
+ }
|
|
|
+ str+=`<td class="operaItem textCenter"><a class="delete" code="${item.behospitalCode}">移除</a></td><tr>`
|
|
|
+ }
|
|
|
+ $('.taskTable .tbody').html(str);
|
|
|
+ bindDeleteEvent();
|
|
|
+}
|
|
|
+//移除任务事件
|
|
|
+function bindDeleteEvent(){
|
|
|
+ $(".taskTable .delete").unbind("click").click(function(e){
|
|
|
+ global_TaskCodes=[$(this).attr("code")];
|
|
|
+ $(".del-pop").insertAfter($(this)).show();
|
|
|
+ });
|
|
|
+ $(".del-pop .cancel").unbind("click").click(function(){
|
|
|
+ $(".del-pop").hide();
|
|
|
+ });
|
|
|
+ $(".del-pop .del-confirm").unbind("click").click(function(){
|
|
|
+ allotTask(1);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
//科室筛选质控员
|
|
|
function formatDeptChecker(list){
|
|
|
const k=+global_activeTabCode +4;
|
|
@@ -332,6 +414,7 @@ function rendeDeptList(list){
|
|
|
$(".deptList").html(str)
|
|
|
bindDeptSelect()
|
|
|
}
|
|
|
+
|
|
|
//质控员列表渲染
|
|
|
function rendeCheckerList(list){
|
|
|
if(list.length == 0){
|
|
@@ -446,8 +529,42 @@ $(function() {
|
|
|
dateFormat:"yy-mm-dd",
|
|
|
}).datepicker( "setDate",endDate);
|
|
|
|
|
|
+ //保存分配
|
|
|
+ $(".save-btn").click(function(){
|
|
|
+ allotTask(0);
|
|
|
+ })
|
|
|
});
|
|
|
+function allotTask(flag){
|
|
|
+ if(!global_CheckerId){
|
|
|
+ toast("请先选择质控员");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(global_TaskCodes.length===0){
|
|
|
+ toast("请选择至少一个任务");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const param = {
|
|
|
+ checkId:global_CheckerId,
|
|
|
+ checkName:global_CheckerName,
|
|
|
+ distributionType:flag,
|
|
|
+ behospitalCodes:global_TaskCodes,
|
|
|
+ }
|
|
|
+ post(ywCheckApi.allotTask,param).then(res =>{
|
|
|
+ if(res.data.code == '0'){
|
|
|
+ global_TaskCodes=[];
|
|
|
+ getCheckerList();
|
|
|
+ flag&&getTasksList(); //移除时更新已分配任务列表弹窗数据
|
|
|
+ }else{
|
|
|
+ toast(res.data.msg||'保存分配失败,请重试~');
|
|
|
+ }
|
|
|
+ }).catch((e) =>{
|
|
|
|
|
|
+ })
|
|
|
+}
|
|
|
+//气泡提示
|
|
|
+function toast(msg) {
|
|
|
+ $.alerModal({"message":msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
+}
|
|
|
//分页渲染
|
|
|
function renderPagination(totalPage,activePage,totalNum){
|
|
|
let str = `<span class="totalSum">共${totalPage}页/${totalNum}条数据</span><span class="prePage"><img class="arrowPage" src=${arrowLeft} /></span>`
|