Browse Source

分页,滚动条,病案首页缺陷发送bug修复

xtf 10 months ago
parent
commit
c0982f8746
5 changed files with 136 additions and 89 deletions
  1. 1 1
      src/css/qcScore.less
  2. 5 1
      src/html/qcScore.html
  3. 119 81
      src/js/qcScore.js
  4. 9 5
      src/js/uncorrectedCasesStatisticsAdm.js
  5. 2 1
      webpack.config.js

+ 1 - 1
src/css/qcScore.less

@@ -321,7 +321,7 @@
     height: 100%;
     background: #fff;
     position: relative;
-    overflow-y: auto;
+    // overflow-y: auto;
     border-right: 10px #EFF1F6 solid;
     border-left: 10px #EFF1F6 solid;
     box-sizing: border-box;

+ 5 - 1
src/html/qcScore.html

@@ -170,8 +170,12 @@
                 <div class="oper fr">
                     <a class="edit-flaw blue" code="${id}" href="javascript:void(0);" style="margin-right: 18px;">修改</a>
                     <a class="del-flaw red" code="${id}" href="javascript:void(0);" style="margin-right: 18px;">删除</a>
-                    <a class="send-flaw blue" code="${id}" href="javascript:void(0);">发送</a>
+                    {{if isSend=== 1}}
+                     <a class="send-flaw blue" code="${id}"  href="javascript:void(0);">发送</a>
+                     {{/if}}
+                     {{if isSend=== 2}}
                     <a class="ysend-flaw blue" code="${id}" href="javascript:void(0);">已发送</a>
+                    {{/if}}
                 </div>
                 {{else}}
                 <div class="oper fr">

+ 119 - 81
src/js/qcScore.js

@@ -15,7 +15,8 @@ const {
   ywCheckApi
 } = require('./api.js');
 let checkOk = require('./../images/checkOk.png')
-const adLogo = require("../images/adlogo.png")
+const adLogo = require("../images/adlogo.png");
+const { resolveShowConfigPath } = require("@babel/core/lib/config/files/index.js");
 if (localStorage.getItem('toLogin') === '1') {
   window.location.href = '../login.html';
 }
@@ -201,70 +202,90 @@ $(function () {
   }
   //发送入院记录
   function sendRuleWarn(msg, i) {
-    $(".send-flaw:eq(" + i + ")").css({
-      "display": "none"
-    });
-    $(".ysend-flaw:eq(" + i + ")").css({
-      "display": "inline"
-    });
-    $(".ysend-flaw:eq(" + i + ")").off('click');
+
+
     post(api.sendRuleWarn, {
-      'behospitalCode': global_id,
-      'msg': msg
+      "behospitalCode": global_id,
+      "msg": msg.msg
     }).then(function (res) {
-      if (res.data.code !== '0') {
-        console.error('发送警告失败,代码:', res.data.code);
-        $(".send-flaw:eq(" + i + ")").css({
-          "display": "inline"
-        });
-        $(".ysend-flaw:eq(" + i + ")").css({
-          "display": "none"
-        });
+      if (res.data.code === '0' && res.data.data === true) {
+        $(".send-flaw:eq(" + i + ")").text("已发送");
+        // $(".ysend-flaw:eq(" + i + ")").css({
+        //   "display": "inline"
+        // });
+        // $(".ysend-flaw:eq(" + i + ")").off('click');
+        $("#delModal").hide();
       }
-    }).catch(function (error) {
-      console.error('发送警告失败:', error);
-      $(".send-flaw:eq(" + i + ")").css({
-        "display": "inline"
-      });
-      $(".ysend-flaw:eq(" + i + ")").css({
-        "display": "none"
-      });
-    });
+
+    }).catch(err => {
+      console.error('发送警告失败:', err);
+    })
+
+
+    // $(".send-flaw:eq(" + i + ")").css({
+    //   "display": "none"
+    // });
+    // $(".ysend-flaw:eq(" + i + ")").css({
+    //   "display": "inline"
+    // });
+    // $(".ysend-flaw:eq(" + i + ")").off('click');
+    // post(api.sendRuleWarn, {
+    //   'behospitalCode': global_id,
+    //   'msg': msg
+    // }).then(function (res) {
+    //   if (res.data.code !== '0') {
+    //     console.error('发送警告失败,代码:', res.data.code);
+    //     $(".send-flaw:eq(" + i + ")").css({
+    //       "display": "inline"
+    //     });
+    //     $(".ysend-flaw:eq(" + i + ")").css({
+    //       "display": "none"
+    //     });
+    //   }
+    // }).catch(function (error) {
+    //   console.error('发送警告失败:', error);
+    //   $(".send-flaw:eq(" + i + ")").css({
+    //     "display": "inline"
+    //   });
+    //   $(".ysend-flaw:eq(" + i + ")").css({
+    //     "display": "none"
+    //   });
+    // });
   }
   //已发送持久化
-  function saveStatus() {
-    post(api.getRecordDetail, {
-      'behospitalCode': global_id
-    }).then(function (res) {
-      const data = res.data.data;
-      const { msg } = data;
-      console.log("11111", msg);
-      for (const key in msg) {
-        if (msg.hasOwnProperty(key)) {
-          const records = msg[key];
-  
-          records.forEach(function (record, i) {
-            const isSend = record.isSend; 
-            console.log(`isSend: ${isSend}, index: ${i}`);
-  
-            if (isSend === 2) {
-              $(".send-flaw:eq(" + i + ")").css("display", "none");
-              $(".ysend-flaw:eq(" + i + ")").css("display", "inline");
-              $(".ysend-flaw:eq(" + i + ")").off('click');
-            } else {
-              console.error('状态为发送:', res.data.code);
-            }
-          });
-        }
-      }
-    }).catch(function (error) {
-      console.error('状态为发送:', error);
-    });
-  }
-  window.onload = function() {
-    saveStatus(); // 页面加载完成后调用
-};
- 
+  // function saveStatus() {
+  //   post(api.getRecordDetail, {
+  //     'behospitalCode': global_id
+  //   }).then(function (res) {
+  //     const data = res.data.data;
+  //     const { msg } = data;
+  //     console.log("11111", msg);
+  //     for (const key in msg) {
+  //       if (msg.hasOwnProperty(key)) {
+  //         const records = msg[key];
+
+  //         records.forEach(function (record, i) {
+  //           const isSend = record.isSend;
+  //           console.log(`isSend: ${isSend}, index: ${i}`);
+
+  //           if (isSend === 2) {
+  //             $(".send-flaw:eq(" + i + ")").css("display", "none");
+  //             $(".ysend-flaw:eq(" + i + ")").css("display", "inline");
+  //             $(".ysend-flaw:eq(" + i + ")").off('click');
+  //           } else {
+  //             console.error('状态为发送:', res.data.code);
+  //           }
+  //         });
+  //       }
+  //     }
+  //   }).catch(function (error) {
+  //     console.log('状态为发送:', error);
+  //   });
+  // }
+  // window.onload = function () {
+  //   saveStatus(); // 页面加载完成后调用
+  // };
+
   //获取病例明细
   function getRecordDetail() {
     post(api.getRecordDetail, {
@@ -295,6 +316,7 @@ $(function () {
         initList(msg);
         initScoreItem(msg);
         global_flawData = msg;
+        // console.log("global_flawData", global_flawData);
         global_flawDataPay = drgs;
         setBoxHeight();
         changePay()
@@ -510,19 +532,21 @@ $(function () {
     }
     showFlawList();
     $(".flaw-item .oper a").unbind("click").click(function (e) {
-      // const i = $(".flaw-item[code=" + global_activeTab + "]").index($(this).parents(".flaw-item"));
-      // const code = $(this).attr("code");
-      // const isEdit = $(this).is(".edit-flaw");
-      // const isSend = $(this).is(".send-flaw");
-      const flawItem = $(this).closest(".flaw-item");
-      const i = flawItem.index();
-      // const code = flawItem.attr("code");
+      const i = $(".flaw-item[code=" + global_activeTab + "]").index($(this).parents(".flaw-item"));
       const code = $(this).attr("code");
       const isEdit = $(this).is(".edit-flaw");
       const isSend = $(this).is(".send-flaw");
-      console.log("global_activeTab:", global_activeTab);
-      console.log("code:", code);
-      console.log("i:", i);
+
+
+      // const flawItem = $(this).closest(".flaw-item");
+      // const i = flawItem.index();
+      // // const code = flawItem.attr("code");
+      // const code = $(this).attr("code");
+      // const isEdit = $(this).is(".edit-flaw");
+      // const isSend = $(this).is(".send-flaw");
+      // console.log("global_activeTab:", global_activeTab);
+      // console.log("code:", code);
+      // console.log("i:", i);
 
       if (isEdit && hasAu) {
         showModal('0', code, i); //编辑
@@ -530,9 +554,10 @@ $(function () {
         if ($(this).is(".recover-flaw")) {
           showModal('3', code, i); //恢复
         } else if (isSend) {
-          const msg = $(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text();
-          console.log($(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text());
-          sendRuleWarn(msg.replace(/\s/g, ""), i)
+          // const msg = $(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text();
+          // console.log($(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text());
+          // sendRuleWarn(msg.replace(/\s/g, ""), i)
+          showModal('4', code, i); //发送
         }
         else {
           showModal('1', code, i); //删除
@@ -548,9 +573,9 @@ $(function () {
     $(".send-flaw").css({
       "display": hasSend ? "inline" : "none"
     });
-    $(".ysend-flaw").css({
-      "display": "none"
-    });
+    // $(".ysend-flaw").css({
+    //   "display": "none"
+    // });
     $(".add-flaw").css({
       "display": hasAu3 && global_check_show ? "inline" : "none"
     });
@@ -717,10 +742,10 @@ $(function () {
     //事件解绑
     $("#delModal .confirm").off("click");
     const flawsList = formatFlawKeys(global_flawData);
-    console.log(flawsList);
+    // console.log(flawsList);
 
     const info = flawsList[global_activeTab] && flawsList[global_activeTab][i];
-    console.log(info, flag);
+    // console.log("@@@@", info);
 
 
     if (flag === '0') { //修改
@@ -874,6 +899,19 @@ $(function () {
         delScore(code, info);
       });
     }
+    else if (flag === '4') {
+      $("#delModal .title").text("发送提示");
+      $("#delModal .modal-body").html('<p>确定要发送吗?</p>');
+      $("#delModal .confirm").text("确定").unbind("click").click(function () {
+
+        sendRuleWarn(info, i)
+
+      });
+      $("#delModal .cancel").show().text("取消").unbind("click").click(function () {
+        $("#delModal").hide();
+      });
+
+    }
   }
   //缺陷列表key值去掉特殊符号
   function formatFlawKeys(data) {
@@ -1064,8 +1102,8 @@ $(function () {
     const posClass = position === 1 ? 'text-left' : '';
     const boldClass = bold === 1 ? 'text-bold' : '';
     const retractClass = retract === 1 ? 'text-indent' : '';
-    const lineHml = ('<p class="' + posClass + ' ' + boldClass + ' ' + retractClass + '" contenteditable="false">'+ extractVars(val) + '</p>');
-    const txtHml = ('<p style="display: inline;vertical-align: middle;" class="' + posClass + ' ' + boldClass + ' ' + retractClass +'" contenteditable="false">' + extractVars(val) + '</p>');
+    const lineHml = ('<p class="' + posClass + ' ' + boldClass + ' ' + retractClass + '" contenteditable="false">' + extractVars(val) + '</p>');
+    const txtHml = ('<p style="display: inline;vertical-align: middle;" class="' + posClass + ' ' + boldClass + ' ' + retractClass + '" contenteditable="false">' + extractVars(val) + '</p>');
 
     let hml = addLine || monoLine ? `<div class="cont ${posClass}" style="width: 100%;" id="anchor${id}">` : `<div class="cont" id="anchor${id}">`;
     hml = hml + `<span class="label">${name}</span>` + (addLine ? lineHml : txtHml) + `</div>`;
@@ -1177,5 +1215,5 @@ $(function () {
       }
     });
   }
-  
+
 });

+ 9 - 5
src/js/uncorrectedCasesStatisticsAdm.js

@@ -88,7 +88,7 @@ function getTabData(activePage) {
     return
   }
   const param = {
-    "current": 1,
+    "current":activePage ,
     // size: 15,
     // "deptName": deptName == "全部" ? "" : deptName || "",
     // "name": deptName == "全部" ? "" : deptName || "",
@@ -122,7 +122,9 @@ function getTabData(activePage) {
       // // if (isfirstRenderTitle === false) { renderTabTitle(data) }  //首次渲染渲染Table表头
       // // globaltableData = data;
       // //  rende renderPaginationrTab(data, data.hospitalId, activePage);
-      let totalNum = globaltableData.data.records.length;
+      let totalNum =parseInt(globaltableData.data.total);
+      console.log(totalNum);
+      
       let totalPage = Math.ceil(totalNum / 15);  // 假设每页15条
       if (totalPage > 0) {
         renderPagination(totalPage, activePage, totalNum);
@@ -167,6 +169,7 @@ function formatTableData(data) {
 function renderTab(data, hisId, activePage) {
   let formatColumns = formatTableData(data.columns)
   data = data.data.records;
+console.log(data);
 
 
   // console.log("renderTab", data);
@@ -184,10 +187,11 @@ function renderTab(data, hisId, activePage) {
 
     // 获取当前页的数据 (根据 activePage 计算要显示的起始位置和结束位置)
     const startIndex = (activePage - 1) * pageSize;
-    const endIndex = activePage * pageSize;
 
-    // 获取当前页的数据,注意 slice 方法用于数组切片
-    const currentPageData = data.slice(startIndex, endIndex);
+    // 获取当前页的数据
+    const currentPageData = data;
+    console.log("当前页数据", currentPageData);
+    
 
     let str = ``;
 

+ 2 - 1
webpack.config.js

@@ -9,7 +9,8 @@ const webpack = require('webpack');
 const glob = require('glob');
 // const proxyHost = "http://192.168.2.236:5858";
 // const proxyHost = "http://192.168.3.184:5859";
-const proxyHost = "http://172.16.8.64:5858"; //正式
+// const proxyHost = "http://172.16.8.64:5858"; //正式
+const proxyHost = "http://172.16.8.12:5859";
 // const proxyHost = "http://www.diagbot.net:5858/"; //测试
 // const proxyHost = "http://192.168.4.222:5858";
 // const proxyHost = "http://192.168.3.117:5858";//铁钢