zhouna 5 年之前
父节点
当前提交
11e671bd5d
共有 2 个文件被更改,包括 13 次插入3 次删除
  1. 9 0
      src/api/utils.js
  2. 4 3
      src/components/qualityControl/StandardRecord.vue

+ 9 - 0
src/api/utils.js

@@ -114,6 +114,15 @@ export default {
       }
     }
   },
+  tranformDate(time,str,flag='-'){
+    if(!time){
+      return time;
+    }
+    const year=time.getFullYear();
+    const month = time.getMonth()+1;
+    const day = time.getDate();
+    return year+flag+(month>9?month:'0'+month)+flag+(day>9?day:'0'+day)+str;
+  },
   //获取两个时间间隔天数
   getTimeRangeDay(timeArr) {
     if(!timeArr||timeArr.length==0){

+ 4 - 3
src/components/qualityControl/StandardRecord.vue

@@ -214,8 +214,8 @@
             background: 'rgba(0, 0, 0, 0.7)'
         });
         api.getStdList(param).then((res) => {
+          loading.close();
           if(res.data.code==="0"){
-            loading.close();
             let list = res.data.data.records;
             this.list = list;
             this.total = res.data.data.total;
@@ -284,6 +284,7 @@
           this.clearFilter();
         };
         const {hospitalId,behospitalCode, deptId, name,date1,date2} = this.filter;
+        const {tranformDate} = utils;
         const param = {
           current: this.inCurrentPage||this.currentPage,
           size: this.pageSize,
@@ -291,8 +292,8 @@
           deptId,
           name,
           behospitalCode,
-          leaveHosDateEnd:date2,
-          leaveHosDateStart: date1
+          leaveHosDateEnd:tranformDate(date2,' 23:59:59'),
+          leaveHosDateStart: tranformDate(date1," 00:00:00")
         };
         return param;
       },