|
@@ -2,7 +2,7 @@ const $ = require('jquery');
|
|
|
require("../css/creatCheckTask.less");
|
|
|
require('./modal.js');
|
|
|
const {api,ywCheckApi} = require('./api.js')
|
|
|
-const {post,getCookie,getUrlArgObjectNew,emptyBox,downloadExportedData,expJson,initScroll,listenScroll,exportTimeLimit} = require('./utils.js')
|
|
|
+const {post,getCookie,emptyBox,listenScroll} = require('./utils.js')
|
|
|
require('./../resource/jquery-ui/jquery-ui.min.js');
|
|
|
require('./../resource/jquery-ui/jquery-ui.min.css');
|
|
|
const iconCheck= require("./../images/icon_check.png")
|
|
@@ -16,11 +16,152 @@ const arrowLeft= require("./../images/arrow_left.png")
|
|
|
const arrowRight = require("./../images/arrow_right.png")
|
|
|
|
|
|
listenScroll()
|
|
|
-let tabList = [], global_level="",global_status="0", global_deptId="",
|
|
|
- data_desc=["leaveHospitalDate"],data_asc=[];
|
|
|
+let tabList = [], global_level="",global_status="0", global_deptId=[],global_deptName="",
|
|
|
+ data_desc=["leaveHospitalDate"],data_asc=[],global_taskList=[],global_delOrAdd=1;//1生成0取消
|
|
|
let global_activeTabCode = '1'; //激活的tab code
|
|
|
let isPlacefile = getCookie('isPlacefile')||1
|
|
|
|
|
|
+$(function() {
|
|
|
+ $('.datapickerBox').append(`<img class="iconCalen" src=${iconCalenGrey} />`)
|
|
|
+ $('.iconCalen').on("mouseenter", function(e){
|
|
|
+ $(this).attr("src", iconCalenBlue)
|
|
|
+ })
|
|
|
+ $('.iconCalen').on("mouseleave", function(e){
|
|
|
+ $(this).attr("src", iconCalenGrey)
|
|
|
+ })
|
|
|
+ $('.iconCalen').on("click", function(e){
|
|
|
+ $(this).parent().find("input").focus()
|
|
|
+ })
|
|
|
+
|
|
|
+ $(".menu .page", parent.document).removeClass("active")
|
|
|
+ $(parent.document).find(".menu .page[code=YH-ZKHC-SCRW]").addClass("active")
|
|
|
+
|
|
|
+ $(".filter").on("click", function(e){
|
|
|
+ getTabData(1)
|
|
|
+ })
|
|
|
+ $(".abnormalClear").on("click", function(e){
|
|
|
+ clearFilter();
|
|
|
+ getTabData(1)
|
|
|
+ })
|
|
|
+ //切换tab
|
|
|
+ $(".tabBox .tabs button").on("click",(e)=>{
|
|
|
+ const me = e.target;
|
|
|
+ global_activeTabCode = $(me).attr("data-code");
|
|
|
+ $(".tabBox .tabs button").removeClass("active");
|
|
|
+ $(me).addClass("active");
|
|
|
+ //更新列表并重置筛选条件
|
|
|
+ $(".abnormalClear").click();
|
|
|
+ });
|
|
|
+//选择生成状态
|
|
|
+ $('.selectStatus').on("click", function(e){
|
|
|
+ e.stopPropagation()
|
|
|
+ $(".statusList ").css("display", "none")
|
|
|
+ $(".selectStatus .arrow").attr("src",iconDown)
|
|
|
+ const showList = $(".statusList ").css("display")
|
|
|
+ if(showList == "none" ||!showList){
|
|
|
+ $(".statusList ").css("display","block")
|
|
|
+ $(".selectStatus .arrow").attr("src",iconUp)
|
|
|
+ }else{
|
|
|
+ $(".statusList ").css("display", "none")
|
|
|
+ $(".selectStatus .arrow").attr("src",iconDown)
|
|
|
+ }
|
|
|
+ })
|
|
|
+//选择病历等级
|
|
|
+ $('.selectLevel').on("click", function(e){
|
|
|
+ e.stopPropagation()
|
|
|
+ $(".deptList ").css("display", "none")
|
|
|
+ $(".selectDept .arrow").attr("src",iconDown)
|
|
|
+ const showList = $(".levelList ").css("display")
|
|
|
+ if(showList == "none" ||!showList){
|
|
|
+ $(".levelList ").css("display","block")
|
|
|
+ $(".selectLevel .arrow").attr("src",iconUp)
|
|
|
+ }else{
|
|
|
+ $(".levelList ").css("display", "none")
|
|
|
+ $(".selectLevel .arrow").attr("src",iconDown)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //科室选择
|
|
|
+ $('.selectDept').on("click", function(e){
|
|
|
+ e.stopPropagation();
|
|
|
+ $(".levelList ").css("display","none")
|
|
|
+ $(".selectLevel .arrow").attr("src",iconDown)
|
|
|
+ $(".deptList ").css("display","block")
|
|
|
+ })
|
|
|
+ $(".creatTask").click(function(){
|
|
|
+ $(".modal-container .modal-body p").text("确定要生成这些任务吗?");
|
|
|
+ $(".modal-container").show();
|
|
|
+ global_delOrAdd=1;
|
|
|
+ });
|
|
|
+ $(".modal-container .confirm").click(function(){
|
|
|
+ creatTask(global_delOrAdd)
|
|
|
+ });
|
|
|
+ $(".modal-container .cancel,.modal-container .close").click(function(){
|
|
|
+ global_taskList=[];
|
|
|
+ $(".modal-container").hide();
|
|
|
+ })
|
|
|
+//获取科室列表
|
|
|
+ getDeptList()
|
|
|
+ //出院日期初始化
|
|
|
+ $.datepicker.regional['zh-CN'] = {
|
|
|
+ clearText: '清除',
|
|
|
+ clearStatus: '清除已选日期',
|
|
|
+ closeText: '关闭',
|
|
|
+ closeStatus: '不改变当前选择',
|
|
|
+ prevText: '<上月',
|
|
|
+ prevStatus: '显示上月',
|
|
|
+ prevBigText: '<<',
|
|
|
+ prevBigStatus: '显示上一年',
|
|
|
+ nextText: '下月>',
|
|
|
+ nextStatus: '显示下月',
|
|
|
+ nextBigText: '>>',
|
|
|
+ nextBigStatus: '显示下一年',
|
|
|
+ currentText: '今天',
|
|
|
+ currentStatus: '显示本月',
|
|
|
+ monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
|
|
|
+ monthNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
|
|
|
+ yearNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
|
|
|
+ monthStatus: '选择月份',
|
|
|
+ yearStatus: '选择年份',
|
|
|
+ weekHeader: '周',
|
|
|
+ weekStatus: '年内周次',
|
|
|
+ dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
|
|
|
+ dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
|
|
|
+ dayNamesMin: ['日','一','二','三','四','五','六'],
|
|
|
+ dayStatus: '设置 DD 为一周起始',
|
|
|
+ dateStatus: '选择 m月 d日, DD',
|
|
|
+ dateFormat: 'yy-mm-dd',
|
|
|
+ firstDay: 1,
|
|
|
+ initStatus: '请选择日期',
|
|
|
+ isRTL: false};
|
|
|
+ const days = new Date().getDate()-1;
|
|
|
+ let startDate = "-"+days+"d",endDate=new Date();
|
|
|
+ $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
|
|
|
+ $( "#datepicker" ).datepicker({
|
|
|
+ changeMonth: true,
|
|
|
+ changeYear: true,
|
|
|
+ dateFormat:"yy-mm-dd",
|
|
|
+ }).datepicker( "setDate", startDate);
|
|
|
+ $( "#datepicker2" ).datepicker({
|
|
|
+ changeMonth: true,
|
|
|
+ changeYear: true,
|
|
|
+ dateFormat:"yy-mm-dd"
|
|
|
+ }).datepicker( "setDate",endDate);
|
|
|
+//获取列表数据
|
|
|
+ getTabData(1)
|
|
|
+ //状态选择
|
|
|
+ bindStatusSelect()
|
|
|
+ //等级选择
|
|
|
+ bindLeveldSelect()
|
|
|
+ //关闭下拉
|
|
|
+ $(document).on("click", function(){
|
|
|
+ $(".levelList ").css("display", "none")
|
|
|
+ $(".deptList ").css("display", "none")
|
|
|
+ $(".statusList ").css("display", "none")
|
|
|
+ $(".selectDept .arrow").attr("src",iconDown)
|
|
|
+ $(".selectLevel .arrow").attr("src",iconDown)
|
|
|
+ $(".selectStatus .arrow").attr("src",iconDown)
|
|
|
+ })
|
|
|
+});
|
|
|
//判断有无某一权限
|
|
|
function hasData(data){
|
|
|
let trdObj = JSON.parse(getCookie("trdObj"))
|
|
@@ -33,6 +174,36 @@ let isPlacefile = getCookie('isPlacefile')||1
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+function bindCancelTaskEvent(){
|
|
|
+ $(".taskCancel").unbind("click").click(function(){
|
|
|
+ global_delOrAdd=0;
|
|
|
+ global_taskList = [$(this).attr("code")];
|
|
|
+ $(".modal-container .modal-body p").text("确定要取消该任务吗?");
|
|
|
+ $(".modal-container").show();
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+//生成任务
|
|
|
+function creatTask(flag){
|
|
|
+ const param={
|
|
|
+ behospitalCodeList:global_taskList,
|
|
|
+ jobType:global_activeTabCode,
|
|
|
+ checkStatus:flag,
|
|
|
+ };
|
|
|
+ post(ywCheckApi.addCheck,param).then(res =>{
|
|
|
+ if(res.data.code == '0'){
|
|
|
+ $(".modal-container").hide();
|
|
|
+ toast("操作成功!");
|
|
|
+ getTabData(1)
|
|
|
+ }else{
|
|
|
+ toast(res.data.msg);
|
|
|
+ }
|
|
|
+ }).catch((e) =>{
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
function getTabData(activePage){
|
|
|
const filterData = getFilterData();
|
|
|
const param = {
|
|
@@ -41,14 +212,16 @@ function getTabData(activePage){
|
|
|
current:activePage,
|
|
|
hospitalId:'',
|
|
|
level:global_level,//病历等级
|
|
|
- department: global_deptId.trim(),
|
|
|
+ department: global_deptId,
|
|
|
asc:data_asc, //升序
|
|
|
desc:data_desc, //降序
|
|
|
size: 15,
|
|
|
- ...filterData
|
|
|
+ ...filterData,
|
|
|
+ startDate:filterData.startDate+" 00:00:00",
|
|
|
+ endDate:filterData.endDate+" 23:59:59",
|
|
|
}
|
|
|
$('.pagination').html("")
|
|
|
- $('.tbody').html(emptyBox('努力加载中...','',15))
|
|
|
+ $('.tbody').html(emptyBox('努力加载中...','',16))
|
|
|
return post(ywCheckApi.getTaskList,param).then(res =>{
|
|
|
if(res.data.code == '0'){
|
|
|
const data = res.data.data;
|
|
@@ -63,20 +236,22 @@ function getTabData(activePage){
|
|
|
$('.pagination').html("")
|
|
|
}
|
|
|
}else{
|
|
|
- $.alerModal({"message":res.data.msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
+ toast(res.data.msg);
|
|
|
}
|
|
|
}).catch((e) =>{
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-getTabData(1)
|
|
|
+function toast(msg){
|
|
|
+ $.alerModal({"message":msg,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
|
|
|
+}
|
|
|
|
|
|
function renderTab(data,hisId){
|
|
|
let str = ``,code="";
|
|
|
let hasSelectAll = true;
|
|
|
if(data.length===0){
|
|
|
- $('.tbody').html(emptyBox(null,15))
|
|
|
+ $('.tbody').html(emptyBox(null,16))
|
|
|
// initScroll("qcList","YX",1)
|
|
|
return;
|
|
|
}
|
|
@@ -86,12 +261,12 @@ function renderTab(data,hisId){
|
|
|
|
|
|
str += `
|
|
|
<tr data-index=${i}>
|
|
|
- <td class="operaItem taskCheck textCenter" code="${item.behospitalCode}"><img src="${iconUnCheck}" alt=""></td>`;
|
|
|
+ <td class="operaItem taskCheck textCenter"><img code="${item.behospitalCode}" src="${iconUnCheck}" alt=""></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>`
|
|
|
}
|
|
|
- str += `<td class="operaItem textCenter ${item.creatStatus=='0'?'taskCancel':'disable'}" code="${item.behospitalCode}">取消</td></tr>`
|
|
|
+ str += `<td class="operaItem textCenter ${item.creatStatus=='已生成'?'taskCancel':'disable'}" code="${item.behospitalCode}">取消</td></tr>`
|
|
|
}
|
|
|
|
|
|
if(data.length === 0){
|
|
@@ -105,6 +280,25 @@ function renderTab(data,hisId){
|
|
|
$('.scoreOpera').attr("data-selectall",false)
|
|
|
}
|
|
|
$('.tbody').html(str)
|
|
|
+ bindTaskCheckEvent();
|
|
|
+ bindCancelTaskEvent();
|
|
|
+}
|
|
|
+
|
|
|
+function bindTaskCheckEvent(){
|
|
|
+ $(".taskCheck img").unbind("click").click(function(){
|
|
|
+ const code = $(this).attr("code");
|
|
|
+ if($(this).is(".active")){
|
|
|
+ let str = global_taskList.join(",")+",";
|
|
|
+ str = str.replace(code+",","").replace(/^,|,$/,'');console.log(str)
|
|
|
+ global_taskList = str.split(",");
|
|
|
+ $(this).attr('src',iconUnCheck).removeClass("active");
|
|
|
+ }else{
|
|
|
+ global_taskList.push(code);
|
|
|
+ $(this).attr('src',iconCheck).addClass("active");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//列表获取筛选值
|
|
@@ -116,7 +310,6 @@ function getFilterData(){
|
|
|
return obj;
|
|
|
}
|
|
|
|
|
|
-bindStatusSelect()
|
|
|
//病历等级选择
|
|
|
function bindStatusSelect(){
|
|
|
$('.statusItem').on("click",function(){
|
|
@@ -128,7 +321,6 @@ function bindStatusSelect(){
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-bindLeveldSelect()
|
|
|
//病历等级选择
|
|
|
function bindLeveldSelect(){
|
|
|
$('.levelItem').on("click",function(){
|
|
@@ -165,13 +357,31 @@ function rendeDeptList(deptList){
|
|
|
}
|
|
|
//科室选择
|
|
|
function bindDeptSelect(){
|
|
|
- $('.deptItem').on("mousedown",function(){
|
|
|
- const deptItemName = $(this).attr("data-name")
|
|
|
- global_deptId = $(this).attr("data-id")
|
|
|
- $('.selectDept i').text(deptItemName)
|
|
|
- $('.selectDept').attr('title',deptItemName)
|
|
|
- $(".deptList").css("display", "none")
|
|
|
- $('.selectDept').removeClass('unSelect')
|
|
|
+ $('.deptItem').on("click",function(e){
|
|
|
+ e.stopPropagation();
|
|
|
+ const deptItemName = $(this).attr("data-name");
|
|
|
+ let str = global_deptId.join(",")+",";
|
|
|
+ const code=$(this).attr("data-id")
|
|
|
+ if(!code.trim()){
|
|
|
+ $(".deptItem").removeClass("active");
|
|
|
+ global_deptId = [];
|
|
|
+ global_deptName="";
|
|
|
+ $('.selectDept i').text('全部')
|
|
|
+ $('.selectDept').attr('title','全部')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if($(this).is(".active")){
|
|
|
+ global_deptName = global_deptName.replace(deptItemName+",",'');
|
|
|
+ str = str.replace(code+",","").replace(/^,|,$/,'');
|
|
|
+ global_deptId = str.split(",");
|
|
|
+ }else{
|
|
|
+ global_deptName = global_deptName+deptItemName+",";
|
|
|
+ global_deptId.push(code);
|
|
|
+ }
|
|
|
+ $(this).toggleClass("active");
|
|
|
+ const name = global_deptName.replace(/,$/,'');
|
|
|
+ $('.selectDept i').text(name)
|
|
|
+ $('.selectDept').attr('title',name)
|
|
|
})
|
|
|
}
|
|
|
function loading(){
|
|
@@ -213,121 +423,6 @@ function clearFilter(){
|
|
|
global_status='0'
|
|
|
$("th[code]").removeClass("asc desc")
|
|
|
}
|
|
|
-$(function() {
|
|
|
- $('.datapickerBox').append(`<img class="iconCalen" src=${iconCalenGrey} />`)
|
|
|
- $('.iconCalen').on("mouseenter", function(e){
|
|
|
- $(this).attr("src", iconCalenBlue)
|
|
|
- })
|
|
|
- $('.iconCalen').on("mouseleave", function(e){
|
|
|
- $(this).attr("src", iconCalenGrey)
|
|
|
- })
|
|
|
- $('.iconCalen').on("click", function(e){
|
|
|
- $(this).parent().find("input").focus()
|
|
|
- })
|
|
|
-
|
|
|
- $(".menu .page", parent.document).removeClass("active")
|
|
|
- $(parent.document).find(".menu .page[code=YH-ZKHC-SCRW]").addClass("active")
|
|
|
-
|
|
|
- $(".filter").on("click", function(e){
|
|
|
- getTabData(1)
|
|
|
- })
|
|
|
- $(".abnormalClear").on("click", function(e){
|
|
|
- clearFilter();
|
|
|
- getTabData(1)
|
|
|
- })
|
|
|
- //切换tab
|
|
|
- $(".tabBox .tabs button").on("click",(e)=>{
|
|
|
- const me = e.target;
|
|
|
- global_activeTabCode = $(me).attr("data-code");
|
|
|
- $(".tabBox .tabs button").removeClass("active");
|
|
|
- $(me).addClass("active");
|
|
|
- //更新列表并重置筛选条件
|
|
|
- $(".abnormalClear").click();
|
|
|
- });
|
|
|
-//选择生成状态
|
|
|
- $('.selectStatus').on("click", function(e){
|
|
|
- e.stopPropagation()
|
|
|
- $(".statusList ").css("display", "none")
|
|
|
- $(".selectStatus .arrow").attr("src",iconDown)
|
|
|
- const showList = $(".statusList ").css("display")
|
|
|
- if(showList == "none" ||!showList){
|
|
|
- $(".statusList ").css("display","block")
|
|
|
- $(".selectStatus .arrow").attr("src",iconUp)
|
|
|
- }else{
|
|
|
- $(".statusList ").css("display", "none")
|
|
|
- $(".selectStatus .arrow").attr("src",iconDown)
|
|
|
- }
|
|
|
- })
|
|
|
-//选择病历等级
|
|
|
- $('.selectLevel').on("click", function(e){
|
|
|
- e.stopPropagation()
|
|
|
- $(".deptList ").css("display", "none")
|
|
|
- $(".selectDept .arrow").attr("src",iconDown)
|
|
|
- const showList = $(".levelList ").css("display")
|
|
|
- if(showList == "none" ||!showList){
|
|
|
- $(".levelList ").css("display","block")
|
|
|
- $(".selectLevel .arrow").attr("src",iconUp)
|
|
|
- }else{
|
|
|
- $(".levelList ").css("display", "none")
|
|
|
- $(".selectLevel .arrow").attr("src",iconDown)
|
|
|
- }
|
|
|
- })
|
|
|
- //科室选择
|
|
|
- $('.selectDept').on("click", function(e){
|
|
|
- e.stopPropagation();
|
|
|
- $(".levelList ").css("display","none")
|
|
|
- $(".selectLevel .arrow").attr("src",iconDown)
|
|
|
- $(".deptList ").css("display","block")
|
|
|
- })
|
|
|
-//获取科室列表
|
|
|
- getDeptList()
|
|
|
- //出院日期初始化
|
|
|
-$.datepicker.regional['zh-CN'] = {
|
|
|
- clearText: '清除',
|
|
|
- clearStatus: '清除已选日期',
|
|
|
- closeText: '关闭',
|
|
|
- closeStatus: '不改变当前选择',
|
|
|
- prevText: '<上月',
|
|
|
- prevStatus: '显示上月',
|
|
|
- prevBigText: '<<',
|
|
|
- prevBigStatus: '显示上一年',
|
|
|
- nextText: '下月>',
|
|
|
- nextStatus: '显示下月',
|
|
|
- nextBigText: '>>',
|
|
|
- nextBigStatus: '显示下一年',
|
|
|
- currentText: '今天',
|
|
|
- currentStatus: '显示本月',
|
|
|
- monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
|
|
|
- monthNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
|
|
|
- yearNamesShort: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],
|
|
|
- monthStatus: '选择月份',
|
|
|
- yearStatus: '选择年份',
|
|
|
- weekHeader: '周',
|
|
|
- weekStatus: '年内周次',
|
|
|
- dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
|
|
|
- dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],
|
|
|
- dayNamesMin: ['日','一','二','三','四','五','六'],
|
|
|
- dayStatus: '设置 DD 为一周起始',
|
|
|
- dateStatus: '选择 m月 d日, DD',
|
|
|
- dateFormat: 'yy-mm-dd',
|
|
|
- firstDay: 1,
|
|
|
- initStatus: '请选择日期',
|
|
|
- isRTL: false};
|
|
|
- const days = new Date().getDate()-1;
|
|
|
- let startDate = "-"+days+"d",endDate=new Date();
|
|
|
- $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
|
|
|
- $( "#datepicker" ).datepicker({
|
|
|
- changeMonth: true,
|
|
|
- changeYear: true,
|
|
|
- dateFormat:"yy-mm-dd",
|
|
|
- }).datepicker( "setDate", startDate);
|
|
|
- $( "#datepicker2" ).datepicker({
|
|
|
- changeMonth: true,
|
|
|
- changeYear: true,
|
|
|
- dateFormat:"yy-mm-dd"
|
|
|
- }).datepicker( "setDate",endDate);
|
|
|
-
|
|
|
-});
|
|
|
|
|
|
//分页渲染
|
|
|
function renderPagination(totalPage,activePage,totalNum){
|
|
@@ -389,12 +484,3 @@ function renderPagination(totalPage,activePage,totalNum){
|
|
|
})
|
|
|
|
|
|
}
|
|
|
-
|
|
|
-$(document).on("click", function(){
|
|
|
- $(".levelList ").css("display", "none")
|
|
|
- $(".deptList ").css("display", "none")
|
|
|
- $(".statusList ").css("display", "none")
|
|
|
- $(".selectDept .arrow").attr("src",iconDown)
|
|
|
- $(".selectLevel .arrow").attr("src",iconDown)
|
|
|
- $(".selectStatus .arrow").attr("src",iconDown)
|
|
|
-})
|