Browse Source

病案首页和各科室缺陷相关页面添加时间控件

luolei 5 years ago
parent
commit
cf8d49b53c

+ 37 - 19
src/css/common.less

@@ -1,21 +1,4 @@
 @import './reset.less';
-// .partDetailControl {
-//     .monthYear {
-//       border: 0 none;
-//       border-radius: 0;
-//       .mon {
-//         border: 1px solid #777;
-//         float: left;
-//         border-radius: 4px 0 0 4px;
-//         box-sizing: border-box;
-//         border-right: 0;
-//         color: #777;
-//       }
-//       .year {
-//         border-radius: 0 4px 4px 0;
-//       }
-//     }
-//   }
 .ellipsis{
     overflow: hidden;
     text-overflow:ellipsis;
@@ -58,6 +41,29 @@ th[code]{
     }
 }
 
+.dataSelectLight {
+    .partDetailControl .filterItem input {
+        width: 120px;
+        height: 40px;
+        border-radius: 4px;
+        border: 1px solid #E2E5EF;
+        outline: none;
+        margin-right: 10px;
+        padding: 0 10px;
+        box-sizing: border-box;
+    }
+    .partDetailControl .filterItem span {
+        display: inline-block;
+        line-height: 40px;
+        position: relative;
+    }
+    .iconCalen{
+        position: absolute;
+        width: 15px;
+        top: 10px !important;
+        right: 20px;
+    }
+}
 .dataSelectDark {
     // position: relative;
     // display: inline-block;
@@ -95,7 +101,9 @@ th[code]{
         color: #fff;
     }
 }
-
+.managerContainer .filter,.filterclear.abnormalClear {
+    margin-bottom: 20px;
+}
 .ui-datepicker-calendar {
     border: 0 none;
     min-width: 0;
@@ -122,6 +130,12 @@ th[code]{
     }
 }
 
+.iconCalen{
+    position: absolute;
+    width: 15px;
+    top: 10px;
+    right: 10px;
+}
 .ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year {
     color: #333;
     font-weight: normal;
@@ -151,7 +165,11 @@ input::-webkit-outer-spin-button,
 input::-webkit-inner-spin-button {
     -webkit-appearance: none;
 }
-
+.datapickerBox input {
+    height: 34px !important;
+    line-height: 34px !important;
+    box-sizing: border-box;
+}
 input[type="number"] {
     -moz-appearance: textfield;
 }

+ 1 - 15
src/css/partDetailControl.less

@@ -212,21 +212,7 @@
     .divide{
         margin: 0 10px;
     }
-    .datapickerBox{
-        position: relative;
-        display: inline-block;
-        width: 120px;
-        height: 40px;
-        input{
-            position: absolute;
-        }
-    }
-    .iconCalen{
-        position: absolute;
-        width: 15px;
-        top: 12px;
-        right: 10px;
-    }
+
     .textCenter{
         text-align: center;
     }

+ 1 - 1
src/css/qcList.less

@@ -251,7 +251,7 @@ table{
 .iconCalen{
     position: absolute;
     width: 15px;
-    top: 8px;
+    top: 10px;
     right: 10px;
 }
 .textCenter{

+ 2 - 2
src/css/quexianDetailControl.less

@@ -89,7 +89,7 @@
         letter-spacing: 1px;
     }
     .main-body{
-        margin: 20px 40px;
+        // margin: 20px 40px;
         padding-bottom: 0px !important;
     }
     table{
@@ -253,7 +253,7 @@
     
     
     .pagination{
-        margin: 35px 0 0 0  ;
+        margin: 35px 0 20px 0  ;
         text-align: right;
     }
     .totalSum{

+ 6 - 0
src/html/deptScoreDetailControl.html

@@ -37,6 +37,12 @@
                         <li class="deptItem ellipsis" title="外科系统" data-id="外科" data-name="外科系统">外科系统</li>
                     </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>

+ 1 - 1
src/html/partDetailControl.html

@@ -36,7 +36,7 @@
                         <li class="deptItem ellipsis" title="不合格" data-id="不合格" data-name="不合格">不合格</li>
                     </ul>
                 </span> -->
-                <span class="filterItem typeFilter clearfix" style="margin-top: 3px;">
+                <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>

+ 6 - 0
src/html/quexianDetailControl.html

@@ -45,6 +45,12 @@
                         <li class="deptItem ellipsis" title="丙级病历" data-id="丙" data-name="丙级病历">丙级病历</li>
                     </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>

+ 7 - 1
src/html/quexianDetailControlHome.html

@@ -41,6 +41,12 @@
                         <input class="moduleItemInp" type="text" placeholder="请输入缺陷名称">
                     </span>
                 </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>
@@ -52,7 +58,7 @@
                     <th class="moduleItemName textCenter">数量</th>
                     <th class="moduleScore" style="width: 80px;">缺陷占比</th>
                 </thead>
-                <tbody>
+                <tbody class="tbodys">
     
                 </tbody>
             </table>

+ 1 - 1
src/js/console.js

@@ -146,7 +146,7 @@ function getDetails(){
         //     $(parent.document).find("#contentIframe").attr("src","./partDetailControl.html?from=1&dateType="+dateType)
         // }
         focusMenuItem("YH-ZKK-BASYHGLZB_XQ");
-        $(parent.document).find("#contentIframe").attr("src","./partDetailControl.html?from=1&dateType="+dateType)
+        $(parent.document).find("#contentIframe").attr("src","./partDetailControl.html?from=1&dateType="+dateType+"&lineType="+lineType)
     })
     $(".paymoney.pubEchart .title").click(function(){
         // if($(this).text().indexOf("花费")!==-1){

+ 32 - 61
src/js/deptScoreDetailControl.js

@@ -2,13 +2,11 @@ const $ = require('jquery');
 require("../css/deptScoreDetailControl.less");
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getCookie,getUrlArgObjectNew,focusMenuItem,emptyBox} = require('./utils.js')
+const {post,getCookie,getUrlArgObjectNew,focusMenuItem,emptyBox,setDatePicker,getPickerDate} = 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")
 const iconUnCheck = require("./../images/icon_unchecked.png")
-const  iconCalenBlue= require("./../images/icon_calen_blue.png")
-const  iconCalenGrey= require("./../images/icon_calen_grey.png")
 const iconDown= require("./../images/arrow_down.png")
 const iconUp = require("./../images/arrow_up.png")
 const loadingImg = require("./../images/loading.gif")
@@ -27,7 +25,7 @@ let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",beho
     $(".deptListWrap").css("display","inline-block")
     $(".deptListWrap .selectDept").html(deptType?(deptType+'系统'):"全部").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
     deptId = deptIdTemp = deptType
-}else{
+  }else{
     $(".deptListWrap").css("display","none")
   }
   if(statisticsType == 1){
@@ -38,6 +36,7 @@ let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",beho
           color:'#00A1FF',
           backgroundColor:'#fff'
       })
+      setDatePicker($("#datepicker"),$("#datepicker2"),1)
   }else{
       $(".monthYear .year").css({
           backgroundColor:'#00A1FF',
@@ -46,9 +45,11 @@ let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",beho
           color:'#00A1FF',
           backgroundColor:'#fff'
       })
+      setDatePicker($("#datepicker"),$("#datepicker2"),2)
   }
 $(".abnormalClear").click(function(){
     // window.location.reload()
+    setDatePicker($("#datepicker"),$("#datepicker2"),statisticsType||2)
     behospitalCode=behospitalCodeTemp = ""
     deptId =deptIdTemp= ""
     $(".selectDept").attr({'title':"全部",'data-id':''}).html("全部").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
@@ -61,16 +62,7 @@ $(".partTitle a").click(function(){
     $(".menu .page",parent.document).removeClass("active").eq(0).addClass("active");
     $(".container",parent.document).addClass("console-cont");
 })
-$('.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()
-})
+
 $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5')
 dateChange()
 //所有数据切换日期筛选
@@ -86,6 +78,7 @@ function dateChange(){
         $(".dayDetail .deptListWrap").css("display","block")
         $(".dayDetail .dayFilter").css("display","none")
         statisticsType = 1
+        setDatePicker($("#datepicker"),$("#datepicker2"),1)
         getTabData(1)
     })
     $(".monthYear .year").click(function(){
@@ -99,6 +92,7 @@ function dateChange(){
         $(".dayDetail .deptListWrap").css("display","none")
         $(".dayDetail .dayFilter").css("display","block")
         statisticsType = 2
+        setDatePicker($("#datepicker"),$("#datepicker2"),2)
         getTabData(1)
     })
 }
@@ -116,12 +110,22 @@ function dateChange(){
     return false;
 }
 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 = {
         "asc": "",
         "desc": "",
         "name": behospitalCode||"",
         "deptClass": deptId||'',
         "type": statisticsType||2, //1-本月,2-本年
+        "startDate":dateStatrt,
+        "endDate":dateEnd
     }
     let url = ''
 
@@ -488,51 +492,6 @@ $(".doctorNumInp").on("input", function(e){
   const val = $(this).val().trim();
     doctorNumTemp = val
 })
-$(function() {
-    $.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']);
-
-    $( "#datepicker" ).datepicker({
-        changeMonth: true,
-        changeYear: true,
-        dateFormat:"yy/mm/dd"
-    });
-    $( "#datepicker2" ).datepicker({
-        changeMonth: true,
-        changeYear: true,
-        dateFormat:"yy/mm/dd"
-    });
-});
 
 //分页渲染
 function renderPagination(totalPage,activePage,totalNum){
@@ -602,5 +561,17 @@ $(document).on("click", function(){
     
 })
 
-$((function($){
-})($));
+$(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()
+    })
+});

+ 35 - 63
src/js/partDetailControl.js

@@ -2,20 +2,16 @@ const $ = require('jquery');
 require("../css/partDetailControl.less");
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getCookie,getUrlArgObjectNew,emptyBox,setTitleTxt,setDatePicker,
-    getPickerDate} = require('./utils.js')
+const {post,getCookie,getUrlArgObjectNew,emptyBox,setTitleTxt,setDatePicker,getPickerDate} = 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")
 const iconUnCheck = require("./../images/icon_unchecked.png")
-const  iconCalenBlue= require("./../images/icon_calen_blue.png")
-const  iconCalenGrey= require("./../images/icon_calen_grey.png")
 const iconDown= require("./../images/arrow_down.png")
 const iconUp = require("./../images/arrow_up.png")
 const loadingImg = require("./../images/loading.gif")
 const arrowLeft= require("./../images/arrow_left.png")
 const arrowRight = require("./../images/arrow_right.png")
-setDatePicker($("#datepicker"),$("#datepicker2"),2)
 $(".selectLevel").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
 $(".selectDept").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
 let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",behosDateEnd="", scoreSum = 0,statisticsType=2,
@@ -24,6 +20,11 @@ let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",beho
   let srcUrl = $("#contentIframe",parent.document).attr("src")
   statisticsType = getUrlArgObjectNew("dateType",srcUrl)||""
   from = getUrlArgObjectNew("from",srcUrl)||""
+  lineType = getUrlArgObjectNew("lineType",srcUrl)||""
+  data_desc = (lineType == "合格率")?"firstLevelPercent":(lineType=="完整率"?"emptyPercent":"errorPercent")
+  if(lineType){
+        $("th[code="+data_desc+"]").addClass("desc");
+  }
   //setTitleTxt('',from)         //导航栏面包屑
   if(statisticsType == 1){
       $(".monthYear .mon").css({
@@ -33,6 +34,7 @@ let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",beho
           color:'#00A1FF',
           backgroundColor:'#fff'
       })
+      setDatePicker($("#datepicker"),$("#datepicker2"),1)
   }else{
       $(".monthYear .year").css({
           backgroundColor:'#00A1FF',
@@ -41,10 +43,12 @@ let tabList = [], name = "", behospitalCode="", behosDateStart="", level="",beho
           color:'#00A1FF',
           backgroundColor:'#fff'
       })
+      setDatePicker($("#datepicker"),$("#datepicker2"),2)
   }
 $(".abnormalClear").click(function(){
     data_desc=""
     data_asc=""
+    setDatePicker($("#datepicker"),$("#datepicker2"),statisticsType||2)
     $(".patientNumInp").val("")
     behospitalCode =behospitalCodeTemp= ""
     getTabData(1)
@@ -54,16 +58,7 @@ $(".partTitle a").click(function(){
     $(".menu .page",parent.document).removeClass("active").eq(0).addClass("active");
     $(".container",parent.document).addClass("console-cont");
 })
-$('.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()
-})
+
 $('.recordScoreBtn').css("opacity",hasData('FUNC000017')?'1':'0.5')
 dateChange()
 //所有数据切换日期筛选
@@ -110,12 +105,22 @@ function dateChange(){
     return false;
 }
 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 = {
         "level": deptId||"",
         "name": behospitalCode||"",
         "asc":data_asc,     //升序
         "desc":data_desc,       //降序
         "type": statisticsType||2, //1-本月,2-本年
+        "startDate":dateStatrt,
+        "endDate":dateEnd
     }
     post(api.homePageLevelStatistics,param).then(res =>{
         if(res.data.code == '0'){
@@ -163,7 +168,6 @@ function renderTab(data,hisId,activePage){
             </tr>
         `
     }
-    // console.log(str)
     $('tbody').html(str?str:emptyBox())
     bindScoreDetail(hisId)
     $(".goHomeDetail").click(function(){
@@ -450,51 +454,6 @@ $(".doctorNumInp").on("input", function(e){
   const val = $(this).val().trim();
     doctorNumTemp = val
 })
-$(function() {
-    $.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']);
-
-    $( "#datepicker" ).datepicker({
-        changeMonth: true,
-        changeYear: true,
-        dateFormat:"yy/mm/dd"
-    });
-    $( "#datepicker2" ).datepicker({
-        changeMonth: true,
-        changeYear: true,
-        dateFormat:"yy/mm/dd"
-    });
-});
 
 //分页渲染
 function renderPagination(totalPage,activePage,totalNum){
@@ -563,5 +522,18 @@ $(document).on("click", function(){
     $(".selectDept .arrow").attr("src",iconDown)
 })
 
-$((function($){
-})($));
+
+$(function() {
+    const  iconCalenBlue= require("./../images/icon_calen_blue.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()
+    })
+});

+ 34 - 8
src/js/quexianDetailControl.js

@@ -3,7 +3,7 @@ require("../css/quexianDetailControl.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")
@@ -11,7 +11,6 @@ const iconUp = require("./../images/arrow_up.png")
 const arrowLeft= require("./../images/arrow_left.png")
 const arrowRight = require("./../images/arrow_right.png")
 
-
 let casesId="", name="", isReject ="2",deptName="",data_asc=[],data_desc=["casesName"], isUsed ="",casesIdTemp="",casesIds="", nameTemp="", isRejectTemp ="2", isUsedTemp ="",from="",deptIdTemp="",deptItemId="",deptId=""
 $(".selectModuleType").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
 $(".selectReject").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
@@ -34,6 +33,7 @@ $(function(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
+        setDatePicker($("#datepicker"),$("#datepicker2"),1)
     }else{
         $(".monthYear .year").css({
             backgroundColor:'#00A1FF',
@@ -42,6 +42,7 @@ $(function(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
+        setDatePicker($("#datepicker"),$("#datepicker2"),2)
     }
     $(".selectDepts").html(deptName)
     // if(from == 1){
@@ -61,6 +62,7 @@ $(function(){
     getTabData(1)//条目缺陷
     
     $(".abnormalClear").click(function(){
+        setDatePicker($("#datepicker"),$("#datepicker2"),isReject||2)
         name =nameTemp= ""
         deptId = deptIdTemp = ""
         $(".selectDept").html("全部").attr("data-id","").append(`<img class="arrow" src=${iconDown} alt="下拉">`)
@@ -144,6 +146,14 @@ $("th[code]").on("click",function(e){
     // console.log(code)
 });
 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,
@@ -155,7 +165,9 @@ function getTabData(activePage){
         globalType:1,
         ascs:data_asc,
         descs:data_desc,
-        size: 15
+        size: 15,
+        "startDate":dateStatrt,
+        "endDate":dateEnd
     }
     post(api.entryCountGroupByEntryPage,param).then(res =>{
         if(res.data.code == '0'){
@@ -183,8 +195,8 @@ function dateChange(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
-        isReject = 1
-        isRejectTemp = 1
+        isReject = isRejectTemp = 1
+        setDatePicker($("#datepicker"),$("#datepicker2"),1)
         getTabData(1)
     })
     $(".monthYear .year").click(function(){
@@ -195,8 +207,8 @@ function dateChange(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
-        isReject = 2
-        isRejectTemp = 2
+        isReject = isRejectTemp = 2
+        setDatePicker($("#datepicker"),$("#datepicker2"),2)
         getTabData(1)
     })
 }
@@ -530,4 +542,18 @@ $(document).on("click", function(){
     $(".selectReject .arrow").attr("src",iconDown)
     $(".selectUsed .arrow").attr("src",iconDown)
     $(".deptList").css("display", "none")
-})
+})
+$(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()
+    })
+});

+ 34 - 5
src/js/quexianDetailControlHome.js

@@ -3,7 +3,7 @@ require("../css/quexianDetailControlHome.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")
@@ -36,6 +36,7 @@ $(function(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
+        setDatePicker($("#datepicker"),$("#datepicker2"),1)
     }else{
         $(".monthYear .year").css({
             backgroundColor:'#00A1FF',
@@ -44,6 +45,7 @@ $(function(){
             color:'#00A1FF',
             backgroundColor:'#fff'
         })
+        setDatePicker($("#datepicker"),$("#datepicker2"),2)
     }
     if(from == 1){
         $(".partTitle .titlePic ").html(`<a class="consoleD" href="console.html">控制台 / </a><a class="consoleP" href="partDetailControl.html">病案首页合格率占比 / </a>缺陷详情`)
@@ -62,6 +64,7 @@ $(function(){
     
     $(".abnormalClear").click(function(){
         name = ""
+        setDatePicker($("#datepicker"),$("#datepicker2"),isReject||2)
         $(".patientNumInp").val("")
         getTabData(1)
     })
@@ -142,6 +145,14 @@ $("th[code]").on("click",function(e){
     // console.log(code)
 });
 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,
@@ -154,7 +165,9 @@ function getTabData(activePage){
         globalType:1,
         ascs:data_asc,
         descs:data_desc,
-        size: 15
+        size: 15,
+        "startDate":dateStatrt,
+        "endDate":dateEnd
     }
     post(api.entryCountGroupByEntryPage,param).then(res =>{
         if(res.data.code == '0'){
@@ -164,7 +177,7 @@ function getTabData(activePage){
             renderTab(data,activePage)
             if(totalPage > 1){
                 renderPagination(totalPage,Number(activePage),totalNum)
-            } else{
+            }else{
                 $('.pagination').html("")
             }
         }else{}
@@ -184,6 +197,7 @@ function dateChange(){
         })
         isReject = 1
         isRejectTemp = 1
+        setDatePicker($("#datepicker"),$("#datepicker2"),1)
         getTabData(1)
     })
     $(".monthYear .year").click(function(){
@@ -196,6 +210,7 @@ function dateChange(){
         })
         isReject = 2
         isRejectTemp = 2
+        setDatePicker($("#datepicker"),$("#datepicker2"),2)
         getTabData(1)
     })
 }
@@ -283,7 +298,7 @@ function renderTab(data,activePage){
             </tr>
         `
     }
-    $('tbody').html(str?str:emptyBox())
+    $('tbody.tbodys').html(str?str:emptyBox())
     bindEdit(data,activePage)
 }
 
@@ -527,4 +542,18 @@ $(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()
+    })
+});

+ 4 - 4
src/js/utils.js

@@ -343,9 +343,9 @@ function setDatePicker(picker1,picker2,mode,startDateDefault,endDateDefault){
         startDate = startDateDefault || new Date()
         endDate = endDateDefault || new Date()
     }
-    console.log('endDate',endDate)
     if(picker1){
       picker1.datepicker({
+        yearRange: "2015:"+year,
         changeMonth: true,
         changeYear: true,
         dateFormat:"yy/mm/dd",
@@ -353,6 +353,7 @@ function setDatePicker(picker1,picker2,mode,startDateDefault,endDateDefault){
     }
     if(picker2){
       picker2.datepicker({
+        yearRange: "2015:"+year,
         changeMonth: true,
         changeYear: true,
         dateFormat:"yy/mm/dd"
@@ -366,12 +367,11 @@ function getPickerDate(picker,mode){
   if(!picker){
     return
   }
-  const date = picker.val().trim()
-
+  let date = picker.val().trim()
   if(mode == 1){
     return date.replace(/\//g,'-') + ' 00:00:00'
   }else if(mode == 2){
-    return data.replace(/\//g,'-') + ' 23:59:59'
+    return date.replace(/\//g,'-') + ' 23:59:59'
   }
 }
 module.exports = {