瀏覽代碼

各模块缺陷占比

luolei 5 年之前
父節點
當前提交
ebef6a0aa5
共有 5 個文件被更改,包括 244 次插入14 次删除
  1. 80 0
      src/css/deptConsole.less
  2. 7 0
      src/html/deptConsole.html
  3. 6 0
      src/html/mukuaiControl.html
  4. 116 11
      src/js/deptConsole.js
  5. 35 3
      src/js/mukuaiControl.js

+ 80 - 0
src/css/deptConsole.less

@@ -3,6 +3,86 @@
 body.console {
   overflow: auto;
   background-color: @themeColor;
+  .ui-widget.ui-widget-content,
+  .ui-widget-header,.ui-datepicker thead,.ui-state-default, 
+  .ui-datepicker-month,.ui-datepicker-year,
+  .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
+    background-color: @themeColor;
+    font-family: 'Microsoft YaHei', arial, tahoma, sans-serif;
+    color: @fstColor;
+  }
+  .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next{
+    &:hover {
+      background-color: #142753;
+      border: 0 none;
+    }
+  }
+  .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span {
+    display: block;
+    position: absolute;
+    left: 50%;
+    margin-left: -8px;
+    top: 50%;
+    margin-top: -8px;
+}
+  .ui-state-active, .ui-widget-content .ui-state-active {
+    background-color: #00A0FE;
+  }
+  .ui-state-default:hover, .ui-widget-content .ui-state-default:hover, .ui-widget-header .ui-state-default:hover {
+    background-color: #142753;
+  }
+  .ui-state-hover .ui-icon {
+    background-image:"url(../images/add.png)";
+  }
+  .dataSelectDark .iconCalen {
+    top:10px;
+  }
+  .dataSelectDark input {
+    height: 28px;
+  }
+  .ui-widget-header .ui-icon {
+    background:url(../images/calendarkL.png) no-repeat;
+    background-size: 14px 14px;
+  }
+  .ui-datepicker-next .ui-icon.ui-icon-circle-triangle-e {
+    background:url(../images/calendarkR.png) no-repeat;
+    background-size: 14px 14px;
+  }
+  .ui-datepicker th span {
+    color: @fstColor;
+  }
+  .ui-datepicker-month,.ui-datepicker-year,
+  .ui-widget.ui-widget-content{
+    border-color: @themeBorderClr;
+  }
+  .ui-state-highlight, .ui-widget-content .ui-state-highlight {
+    background-color: #5B70A4 !important;
+  }
+
+  .sureDate {
+    cursor: pointer;
+    background-color: #00A1FF;
+    color: @fstColor;
+    border-left: 0 none;
+    border-radius: 4px;
+    overflow: hidden;
+    box-sizing: border-box;
+    height: 28px !important;
+    line-height: 28px !important;
+    box-sizing: border-box;
+    width: 48px;
+    margin: 3px 20px 0 10px;
+    text-align: center;
+    box-sizing: border-box;
+  }
+  .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year {
+    height: 28px;
+    line-height: 28px;
+    box-sizing: border-box;
+  }
+
+
+
   .chuyuanEmpty {
     border-bottom: 10px solid @activeBg;
     height: 162px;

+ 7 - 0
src/html/deptConsole.html

@@ -27,6 +27,13 @@
     <div class="dateDetail fr">
       
     </div>
+    <span class="dataSelectDark filterItem typeFilter clearfix">
+        <!-- <span class="fl">出院日期:</span> -->
+        <span class="datapickerBox fl"><input type="text" placeholder="请选择时间" id="datepicker" autocomplete="off" /><img class="iconCalen" src="../images/icon_calen_grey.png" /></span>
+        <span class="divide fl">-</span>
+        <span class="datapickerBox fl"><input type="text" placeholder="请选择时间" id="datepicker2"  autocomplete="off" /><img class="iconCalen" src="../images/icon_calen_grey.png" /></span>
+        <span class="sureDate">查询</span>
+    </span>
   </div>
   <div class="partTitleT"></div>
   <!--<div class="grayLine"></div>-->

+ 6 - 0
src/html/mukuaiControl.html

@@ -37,6 +37,12 @@
                         
                     </ul>
                 </span> -->
+                <span class="filterItem typeFilter clearfix dataSelectLight">
+                    <span class="fl">出院日期:</span>
+                    <span class="datapickerBox fl"><input type="text" placeholder="请选择时间" id="datepicker" autocomplete="off" /></span>
+                    <span  class="divide fl">-</span>
+                    <span class="datapickerBox fl"><input type="text" placeholder="请选择时间" id="datepicker2"  autocomplete="off" /></span>
+                </span>
                 <span class="filter">查询</span>
                 <span class="filterclear abnormalClear">重置</span>
             </div>

+ 116 - 11
src/js/deptConsole.js

@@ -7,8 +7,10 @@ require("../images/arrow_down.png")
 // import 'zrender/lib/svg/svg';
 const {api} = require('./api.js')
 const echarts = require('echarts');
+require('./../resource/jquery-ui/jquery-ui.min.js');
+require('./../resource/jquery-ui/jquery-ui.min.css');
 const {post,setCookie,delCookie,getCookie,focusMenuItem,picEmptyData } = require('../js/utils.js');
-let payMoney = [],dayLis = [],dateType = 2,curDept = '',curDeptId='',datafst=[],datasec=[],datatrd=[],datafour=[],hospital=getCookie("hospital");
+let payMoney = [],behosDateStart="",behosDateEnd="",dayLis = [],dateType = 2,curDept = '',curDeptId='',datafst=[],datasec=[],datatrd=[],datafour=[],hospital=getCookie("hospital");
 $(function(){
     if(!hasData('YH-KZT')&&!hasData('YH-KZTKS')){
         $("body").html('')
@@ -97,7 +99,7 @@ function dateChange(){
             backgroundColor:'#203463'
         })
         dateType = 1
-        getBarData(1)
+        dateConsole(1)
     })
     $(".monthYear .year").click(function(){
         $(this).css({
@@ -110,7 +112,7 @@ function dateChange(){
             backgroundColor:'#203463'
         })
         dateType = 2
-        getBarData(2)
+        dateConsole(2)
     })
 }
 //控制台数
@@ -208,7 +210,9 @@ function renderDeptLis(data){
 function getBarData(type){
     if(hasData('FUNC000054')){
         post(api.leaveHosCountByDept,{//出院人数统计
-            "type": type||1//1月2年
+            "type": type||1,//1月2年
+            "startDate":behosDateStart,
+            "endDate":behosDateEnd
         }).then((res)=>{
             let data = res.data;
             if(data.code == 0){
@@ -220,7 +224,9 @@ function getBarData(type){
     }
     if(hasData('FUNC000055')){
         post(api.mrCountByDept,{//质控病历统计
-            "type": type||1//1月2年
+            "type": type||1,//1月2年
+            "startDate":behosDateStart,
+            "endDate":behosDateEnd
         }).then((res)=>{
             let data = res.data
             if(data.code == 0){
@@ -232,7 +238,9 @@ function getBarData(type){
     }
     if(hasData('FUNC000056')){
         post(api.entryCountGroupByCaseAndDept,{//各模块缺陷占比排行
-            "type": type||1//1月2年
+            "type": type||1,//1月2年
+            "startDate":behosDateStart,
+            "endDate":behosDateEnd
         }).then((res)=>{
             let data = res.data;
             if(data.code == 0){
@@ -245,7 +253,9 @@ function getBarData(type){
     if(hasData('FUNC000057')){
         if(hospital=="台州市立"){
             post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
-                "type": type||1//1月2年
+                "type": type||1,//1月2年
+                "startDate":behosDateStart,
+                "endDate":behosDateEnd
             }).then((res)=>{
                 let data = res.data;
                 if(data.code == 0){
@@ -260,7 +270,9 @@ function getBarData(type){
             })
         }else{
             post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
-                "type": type||1//1月2年
+                "type": type||1,//1月2年
+                "startDate":behosDateStart,
+                "endDate":behosDateEnd
             }).then((res)=>{
                 let data = res.data;
                 if(data.code == 0){
@@ -281,7 +293,9 @@ function getHomePageLevelStatisticsByDept(type){
     if(hospital=="长兴医院"&&hasData("FUNC000076")){
         post(api.homePageLevelStatisticsByDept,{//病案首页
             "type": dateType||2,//1月2年
-            "deptName":curDept
+            "deptName":curDept,
+            "startDate":behosDateStart,
+            "endDate":behosDateEnd
         }).then((res)=>{
             let data = res.data;
             if(data.code == 0){
@@ -804,5 +818,96 @@ function getTimeDetail(){
     let str = `${d.getFullYear()}年${d.getMonth()+1}月${d.getDate()}日 / ${days[d.getDay()]} / ${hour>9?hour:'0'+hour}:${min>9?min:'0'+min}:${sec>9?sec:'0'+sec}`
     $(".dateDetail").html(str)
 }
-
-
+$(".sureDate").click(function(){
+    getStaticDate()
+    getBarData(dateType)
+})
+//日期联动
+function dateConsole(dateType){
+    let startDate = "", endDate=new Date()
+    let year = new Date().getFullYear()
+    let month = new Date().getMonth() + 1
+    if(dateType == '1'){
+        startDate = new Date(`${year}-${month}-01`)
+    }else if(dateType == '2'){
+        startDate = new Date(`${year}-01-01`)
+    } else {
+        startDate = "-1m"
+    }
+    $( "#datepicker" ).datepicker({
+        yearRange: "2015:"+year,
+        changeMonth: true,
+        changeYear: true,
+        dateFormat:"yy/mm/dd",
+    }).datepicker( "setDate", startDate);
+    $( "#datepicker2" ).datepicker({
+        yearRange: "2015:"+year,
+        changeMonth: true,
+        changeYear: true,
+        dateFormat:"yy/mm/dd"
+    }).datepicker( "setDate",endDate);
+    getStaticDate()
+    getBarData(dateType)
+}
+function getStaticDate(){
+    behosDateStart = $("#datepicker").val().trim()
+    behosDateEnd = $("#datepicker2").val().trim()
+    const start = new Date(behosDateStart).getTime()
+    const end = new Date(behosDateEnd).getTime()
+    if(start > end){
+        $.alerModal({"message":'开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+        return
+    }
+    if(behosDateStart){
+        behosDateStart = behosDateStart.replace(/\//g,'-') + ' 00:00:00'
+    }
+    if(behosDateEnd){
+        behosDateEnd = behosDateEnd.replace(/\//g,'-') + ' 23:59:59'
+    }
+}
+$(function() {
+    const  iconCalenBlue= require("./../images/darkDate.png")
+    const  iconCalenGrey= require("./../images/icon_calen_grey.png")
+    $.datepicker.regional['zh-CN'] = {
+    clearText: '清除',
+    clearStatus: '清除已选e799bee5baa6e59b9ee7ad9431333361303131日期',
+    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};
+    $.datepicker.setDefaults($.datepicker.regional['zh-CN']);
+    dateConsole(dateType)
+    $('.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()
+    })
+});

+ 35 - 3
src/js/mukuaiControl.js

@@ -3,7 +3,7 @@ require("../css/mukuai.less");
 require('./../resource/jquery-ui/jquery-ui.min.js');
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getCookie,getUrlArgObjectNew,emptyBox} = require('./utils.js')
+const {post,getCookie,getUrlArgObjectNew,emptyBox,setDatePicker,getPickerDate} = require('./utils.js')
 const switchIconOpen = require("./../images/btn_open.png")
 const switchIconClose = require("./../images/btn_close.png")
 const iconDown= require("./../images/arrow_down.png")
@@ -29,7 +29,6 @@ $(function(){
     if(name){
         $(".moduleItemInp").val(name)
     }
-    getTabData(1)//条目缺陷
     
     $(".partTitle a").click(function(){
         //初始菜单选中
@@ -38,6 +37,7 @@ $(function(){
     })
     $(".abnormalClear").click(function(){
         // window.location.reload()
+        setDatePicker($("#datepicker"),$("#datepicker2"),isReject||2)
         name=nameTemp = ""
         data_asc=[],
         data_desc=['percentStr']
@@ -55,6 +55,7 @@ $(function(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
+        setDatePicker($("#datepicker"),$("#datepicker2"),1)
     }else{
         $(".monthYear .year").css({
             backgroundColor:'#00A1FF',
@@ -63,7 +64,10 @@ $(function(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
+        setDatePicker($("#datepicker"),$("#datepicker2"),2)
     }
+    
+    getTabData(1)//条目缺陷
 })
 function focusMenuItem(code){
     const ele = $(parent.document).find(".menu .page[code="+code+"]");
@@ -140,6 +144,7 @@ function dateChange(){
         })
         isReject = 1
         isRejectTemp = 1
+        setDatePicker($("#datepicker"),$("#datepicker2"),1)
         getTabData(1)
     })
     $(".monthYear .year").click(function(){
@@ -152,6 +157,7 @@ function dateChange(){
         })
         isReject = 2
         isRejectTemp = 2
+        setDatePicker($("#datepicker"),$("#datepicker2"),2)
         getTabData(1)
     })
 }
@@ -173,6 +179,14 @@ $("th[code]").on("click",function(e){
 });
 //获取表格数据
 function getTabData(activePage){
+    const dateStatrt = getPickerDate($("#datepicker"),1)
+    const dateEnd = getPickerDate($("#datepicker2"),2)
+    const start = new Date(dateStatrt).getTime()
+    const end = new Date(dateEnd).getTime()
+    if(start > end){
+        $.alerModal({"message":'开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+        return
+    }
     const param = {
         current:activePage,
         type: isReject,
@@ -181,6 +195,8 @@ function getTabData(activePage){
         size: 15,
         asc:data_asc,     //升序
         desc: data_desc,       //降序
+        "startDate":dateStatrt,
+        "endDate":dateEnd
     }
     post(from == 1?api.entryCountGroupByCasePage:api.entryCountGroupByCaseAndDeptPage,param).then(res =>{
         if(res.data.code == '0'){
@@ -520,4 +536,20 @@ $(document).on("click", function(){
     $(".selectModuleType .arrow").attr("src",iconDown)
     $(".selectReject .arrow").attr("src",iconDown)
     $(".selectUsed .arrow").attr("src",iconDown)
-})
+})
+
+
+$(function() {
+    const  iconCalenBlue= require("./../images/darkDate.png")
+    const  iconCalenGrey= require("./../images/icon_calen_grey.png")
+    $('.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()
+    })
+});