Ver código fonte

添加导出时间判断

luolei 4 anos atrás
pai
commit
33f910c2ec
3 arquivos alterados com 79 adições e 7 exclusões
  1. 29 0
      src/css/index.less
  2. 17 1
      src/js/modal.js
  3. 33 6
      src/js/qcList.js

+ 29 - 0
src/css/index.less

@@ -800,6 +800,9 @@
       width: 300px;
       height: 330px;
     }
+    .closePort {
+      height: 180px;
+    }
     .cloInfoTitleTxt{
       display: inline-block;
       height: 40px;
@@ -887,12 +890,38 @@
       color: #fff;
       margin-left: 20px;
     }
+    .savePort {
+      margin-left: 30px;
+    }
+    .canclePort {
+      left: 100px;
+    }
+    .selectDateTip {
+      position: relative;
+      left: -30px;
+      top: -15px;
+    }
+    .selectDate {
+      padding-left: 15px;
+      margin: 8px 0;
+      cursor: pointer;
+      input {
+        cursor: pointer;
+        margin-right: 10px;
+      }
+      label {
+        cursor: pointer;
+      }
+    }
     .defaultColSet{
       position: relative;
       left: 50px;
       cursor: pointer;
     }
   }
+  .cloInfoPort {
+    height: auto;
+  }
   .mask {
     position: fixed;
     width: 100%;

+ 17 - 1
src/js/modal.js

@@ -37,6 +37,21 @@ const jQuery = require('jquery');
                 </div>
             </div>
         `
+        var radioExp = `<div class='colSetBox'> 
+            <div class='mask'></div>
+            <div class='cloInfobox cloInfoPort'>
+                <div class='cloInfoTitle'><span class='cloInfoTitleTxt'>导出提示</span> <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></div>
+                <div class='cloInfo closePort'>
+                    <p class="selectDateTip">请选择一种导出的报表样式:</p>
+                    <p class="selectDate"><input checked="true" type="radio" name="date" id="date1" data-select="1"><label for="date1">含缺陷明细项,最多只能导出7天</label></p>
+                    <p class="selectDate"><input type="radio" name="date" id="date2" data-select="2"><label for="date2">不含缺陷明细项,最多只能导出90天</label></p>
+                </div>
+                <div class='btnBox'>
+                    <span class='cancalColSet canclePort'>取消</span> 
+                    <span class='saveColSet savePort'>确定</span>
+                </div>
+            </div>
+        </div>`
         // var tip = `
         //     <div class="modaltip">${ops.message}</div>
         // `
@@ -59,11 +74,12 @@ const jQuery = require('jquery');
         `
         var box = $("<div/>",{
             "class":"divModal",
-            "html":ops.type == 'tip'?tip:ops.type == 'loading'?loading:html
+            "html":ops.type == 'tip'?tip:ops.type == 'loading'?loading:ops.type == 'radio'?radioExp:html
         }).css({
             left:$(".modaltip").width()/2+'px',
             top:$(".modaltip").height()/2+'px'
         })
+        console.log(ops)
         if(ops.isFather){
             //console.log('bbbbbbb')
            ops.fatherWrapper.append(box)

+ 33 - 6
src/js/qcList.js

@@ -1137,8 +1137,11 @@ $(document).on("click", function(){
     $(".fpSelectCheck .arrow").attr("src",iconDown)
     $(".qcSelectCheck .arrow").attr("src",iconDown)
 })
-$((function($){
 
+
+        
+let radioCheck = 1;
+$((function($){
     $('.export').click(function(){
         const behosDateStartTime = new Date(behosDateStart).getTime()
         const behosDateEndTime = new Date(behosDateEnd).getTime()
@@ -1146,14 +1149,11 @@ $((function($){
             $.alerModal({"message":'开始时间不能大于结束时间~',type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
             return
         }
-        if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > exportTimeLimit.normalTime){
-            $.alerModal({"message":`最多只能导出${exportTimeLimit.normalTime}天`,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
-            return
-        }
         const param = {
             "behospitalCode": behospitalCode,
             "deptName": deptName=="全部"?"":deptName||"",
             "deptId": deptId.trim(),
+            "radioCheck":radioCheck||1, //1:7天2:90天
             "doctorCode":doctorNum,
             "doctorName": doctorName,
             "asc":data_asc,     //升序
@@ -1175,8 +1175,35 @@ $((function($){
             "mrTimeStart": fpCheckDateStart.replace(/\//g,'-'), //首页核查起始时间
             "mrTimeEnd": fpCheckDateEnd.replace(/\//g,'-'), //首页核查截止时间
         }
+        $.alerModal({type:"radio",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+        closeRadio()
+        radioSelect()
+        bindSaveColPort(param)
+    })
+})($));
+function closeRadio(){
+    $(".colSetBox .iconClose,.colSetBox .cancalColSet", parent.document ).off("click").on("click",function(){
+        $(".divModal",parent.document).html("")
+    })
+}
+function radioSelect(){
+    $(".selectDate", parent.document).click(function(){
+        $(this).find("input").prop("checked",true)
+        $(this).siblings().find("input").prop("checked",false)
+    })
+}
+function bindSaveColPort(param){
+    $(".savePort", parent.document ).off("click").on("click", function(){
+        radioCheck = $(".selectDate input[type='radio']:checked", parent.document).attr("data-select")
+        let time = radioCheck==2?exportTimeLimit.defectTime:exportTimeLimit.normalTime
+        if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > time){
+            $.alerModal({"message":`最多只能导出${time}天`,type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+            return
+        }
+        param.radioCheck = radioCheck||1
         expJson(api.exportQcList,param).then(res =>{
+            $(".divModal",parent.document).html("")
             downloadExportedData(res.data, behosDateStart.slice(0,10).replace(/-/g,"")+"-"+behosDateEnd.slice(0,10).replace(/-/g,"")+"抽查住院病历质量情况.xls")
         })
     })
-})($));
+}