Explorar el Código

Merge remote-tracking branch 'origin/messagePass220412' into test

zhouna hace 3 años
padre
commit
c262953e70
Se han modificado 3 ficheros con 66 adiciones y 25 borrados
  1. 3 0
      src/js/api.js
  2. 13 2
      src/js/appealUserPage.js
  3. 50 23
      src/js/qcScore.js

+ 3 - 0
src/js/api.js

@@ -244,6 +244,9 @@ const api = {
   getNewsCount:'/medNewsNotice/getNewsCount', //消息数量
   getNewsDropDownBox:'/medNewsNotice/getNewsDropDownBox', //消息通知-获取通知类型、阅读状态下拉框内容
   getNewsNoticeInfoById:'/medNewsNotice/getNewsNoticeInfoById',//消息通知详情
+
+  supplementData:'/qc/supplement/supplementData',//刷新
+  
 }
 const ywCheckApi = {
   addMedCheckInfo: '/qc/medCheckInfo/addMedCheckInfo',   //核查

+ 13 - 2
src/js/appealUserPage.js

@@ -46,8 +46,8 @@ $(function () {
     showModal('2');
   });
   $("body").on("click", ".refreshBtn", function () {
-    $("#contentInfo").html('')
-    getRecordDetailUpdate2();
+    
+    supplementData()
   });
   function showAppealDetailEvent() {
     //申诉状态点击事件
@@ -237,6 +237,17 @@ $(function () {
       }
     });
   }
+  function supplementData() {
+    post(api.supplementData, { 'behospitalCode': global_id,'behospitalNum':1 }).then(function (res) {
+      if (res.data.code === '0') {
+        $("#contentInfo").html('')
+        getRecordDetailUpdate2()
+      }else{
+        $.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
+      }
+    });
+  }
+
   function changePay() {
     $(document).on('click', ".titleSpecial span", function () {
       let type = $(this).attr("data-type")

+ 50 - 23
src/js/qcScore.js

@@ -5,6 +5,7 @@ require('./modal.js');
 const { post, getUrlArgObject, setBoxHeight, getCookie, getLocal, initScroll } = require('./utils.js');
 const { api, ywCheckApi } = require('./api.js');
 let checkOk = require('./../images/checkOk.png')
+const loadingImg = require("./../images/loading.gif")
 const adLogo = require("../images/adlogo.png")
 if (localStorage.getItem('toLogin') === '1') {
   window.location.href = '../login.html';
@@ -45,12 +46,7 @@ $(function () {
     });
   }
   $("body").on("click", ".refreshBtn", function () {
-    // $(".flaw-box").html('')
-    // $(".patient-info").html('')
-    // $("#subMenu").html('')
-    $("#contentInfo").html('')
-    // console.log(global_activeTab);
-    getRecordDetailUpdate2()
+    supplementData()
   });
   function showAppealDetailEvent() {
     //申诉状态点击事件
@@ -232,26 +228,57 @@ $(function () {
       }
     });
   }
-  function getRecordDetailUpdate2() {
-    post(api.getRecordDetail, { 'behospitalCode': global_id }).then(function (res) {
-      if (res.data.code === '0') {
-        const data = res.data.data;
-        const { beHospital, result, msg, checkStatus, drgs } = data;
-        // global_check = checkStatus
-        // const info=Object.assign(beHospital,result);
-        // initMenu(JSON.parse(result.menuData));
-        // $(".subMenu >li:first-child.page,.menu-mini>ul>li:first-child.page").addClass("active");
-        // global_activeTab=$(".sub-menu .page.active").attr("code");
-        // initPatientInfo(info);
-        initContent(result.pageData,1);
-        initScoreItem(msg);
-        global_flawData = msg;
-        global_flawDataPay = drgs;
-        // setBoxHeight();
-        // changePay()
+  //补录数据,接口来自技术服务部
+  function supplementData() {
+    //重新拉数据接口
+    post(api.supplementData, { 'behospitalCode': global_id,'behospitalNum':'' }).then(function (res) {
+      const {code,data}=res.data;
+      if (code === '0') {
+        if(data==='0'){ //0表示数据已更新,-1表示数据未更新
+          //数据更新后先评分(评分成功后)再重新获取详情即刷新页面
+		  recordScore();
+        }else{
+		  $.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
+		}
+      }else{
+        $.alerModal({ "message": '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, win: 'default', fatherWrapper: $("#mainBox", parent.document) });
       }
     });
   }
+
+  function loading() {
+	const str = `
+    <div class="loadingBox">
+            <div class="mask"></div>
+            <img class="loadingImg" src=${loadingImg}  alt="loading" />
+        </div>
+    `
+	$("body", parent.document).append(str)
+  }
+  function hideLoading() {
+	$(".loadingBox", parent.document).remove()
+  }
+//评分
+  function recordScore() {
+	const param = {
+	  behospitalCode: global_id
+	};
+	loading();
+	post(api.recordScore, param).then(res => {
+	  if (res.data.code === '0') {
+		  hideLoading();
+		  //评分成功,刷新病历详情页面
+          window.parent.location.reload()
+	  } else {
+		hideLoading()
+        $.alerModal({ "message": res.data.msg || '刷新失败,请重试~', type: "tip", time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
+	  }
+	}).catch(() => {
+	  hideLoading()
+		$.alerModal({ "message": '刷新失败,请重试~', type: "tip", win: 'default', time: '1000', isFather: true, fatherWrapper: $("#mainBox", parent.document) });
+	})
+  }
+
   function changePay() {
     $(document).on('click', ".titleSpecial span", function () {
       let type = $(this).attr("data-type")