Ver código fonte

质控评分科室添加导入

zhangxc 5 anos atrás
pai
commit
269ce144d6
6 arquivos alterados com 106 adições e 57 exclusões
  1. 1 0
      package.json
  2. 14 1
      src/css/qcListDept.less
  3. 1 1
      src/html/qcListDept.html
  4. 3 4
      src/js/qcList.js
  5. 21 1
      src/js/qcListDept.js
  6. 66 50
      src/js/utils.js

+ 1 - 0
package.json

@@ -4,6 +4,7 @@
   "description": "",
   "main": "index.js",
   "dependencies": {
+    "axios": "^0.19.2",
     "bluebird": "^3.5.5",
     "echarts": "^4.7.0",
     "es3ify-loader": "^0.2.0",

+ 14 - 1
src/css/qcListDept.less

@@ -167,7 +167,7 @@ table{
     width: 160px;
 }
 
-.filter,.reset{
+.filter,.reset,.export{
     display: inline-block;
     width:60px;
     height:32px;
@@ -182,6 +182,19 @@ table{
     float: left;
     margin: 0 0px 22px 0;
 }
+.export{
+    height:34px;
+    
+    background: #fff;
+    border-radius: 4px;
+    color: #777;
+    border: 1px solid #777;
+    box-sizing: border-box;
+    cursor: pointer;
+    margin-left: 10px;
+    float: left;
+    top: 0px;
+}
 .arrow{
     position: absolute;
     width: 10px;

+ 1 - 1
src/html/qcListDept.html

@@ -56,7 +56,7 @@
                     </ul>
                 </span>
                 <span class="filter">查询</span>
-                <!-- <span class="reset">重置</span> -->
+                <span class="export">导出</span>
                 <span class="filterclear abnormalClear filterclearT">重置</span>
             </div>
             <div>

+ 3 - 4
src/js/qcList.js

@@ -606,6 +606,7 @@ $((function($){
     $('.export').click(function(){
         if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > 7){
             $.alerModal({"message":"最多只能导出7天",type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+            return
         }
         const param = {
             "behospitalCode": behospitalCode,
@@ -618,10 +619,8 @@ $((function($){
             "name": name
         }
         expJson(api.exportQcList,param).then(res =>{
-            downloadExportedData(res.data)
-            
-        }).catch((e) =>{
-            $.alerModal({"message":"导出失败",type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+            downloadExportedData(res.data, behosDateStart.slice(0,10).replace(/-/g,"")+"-"+behosDateEnd.slice(0,10).replace(/-/g,"")+"抽查住院病历质量情况.xls")
         })
+      
     })
 })($));

+ 21 - 1
src/js/qcListDept.js

@@ -2,7 +2,7 @@ const $ = require('jquery');
 require("../css/qcListDept.less");
 require('./modal.js');
 const {api} = require('./api.js')
-const {post,getCookie,getUrlArgObjectNew,emptyBox} = require('./utils.js')
+const {post,getCookie,getUrlArgObjectNew,emptyBox,downloadExportedData,expJson} = 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")
@@ -605,4 +605,24 @@ $(document).on("click", function(){
 })
 
 $((function($){
+    $('.export').click(function(){
+        if((new Date(behosDateEnd) - new Date(behosDateStart))/24/60/60/1000 > 7){
+            $.alerModal({"message":"最多只能导出7天",type:"tip",time:'1000',isFather: true, fatherWrapper: $("#mainBox", parent.document)});
+            return
+        }
+        const param = {
+            "behospitalCode": behospitalCode,
+            "deptId": deptId,
+            "doctorCode":doctorNum,
+            "doctorName": doctorName,
+            "leaveHosDateEnd": behosDateEnd,
+            "leaveHosDateStart": behosDateStart,
+            "level": level,
+            "name": name
+        }
+        expJson(api.exportQcList,param).then(res =>{
+            downloadExportedData(res.data, behosDateStart.slice(0,10).replace(/-/g,"")+"-"+behosDateEnd.slice(0,10).replace(/-/g,"")+"抽查住院病历质量情况.xls")
+        })
+      
+    })
 })($));

Diferenças do arquivo suprimidas por serem muito extensas
+ 66 - 50
src/js/utils.js