瀏覽代碼

编辑页面添加

zhouna 3 年之前
父節點
當前提交
f2bbe25348
共有 5 個文件被更改,包括 533 次插入2 次删除
  1. 323 0
      src/css/editableDetail.less
  2. 35 0
      src/html/editableDetail.html
  3. 6 1
      src/js/api.js
  4. 167 0
      src/js/editableDetail.js
  5. 2 1
      src/js/utils.js

+ 323 - 0
src/css/editableDetail.less

@@ -0,0 +1,323 @@
+@import './reset.less';
+body{
+  overflow-y: auto;
+}
+.ellipsis{
+  overflow: hidden;
+  text-overflow:ellipsis;
+  white-space: nowrap;
+}
+#loading{
+  text-align: center;
+  height: 2000px;
+  margin-top: 30px;
+}
+.waring {
+  color: #FF4D4F;
+  margin-top: 18px;
+  height: 18px;
+}
+.tab-container{
+  background: @disColor;
+  /*height: 100%;*/
+  .content-box1{
+    margin: 0 30px;
+    padding-bottom: 30px;
+    background: #fff;
+    position: relative;
+    overflow-y: auto;
+    border-right: 10px #EFF1F6 solid;
+    border-left: 10px #EFF1F6 solid;
+    box-sizing: border-box;
+  }
+  .content-item{
+    /*display: none;
+    height: 100%;*/
+    .content-item-wrapper{
+      margin-bottom: 50px;
+    }
+
+    /**********危急值记录*************/
+    &.danger-record{
+      height:auto;
+      .title{
+        /*position: unset;*/
+      }
+    }
+    .title{
+      /*position: absolute;
+      top: 0;*/
+      width: 100%;
+      color: #333333;
+      font-size: 16px;
+      text-align: center;
+      font-weight: bold;
+      height: 44px;
+      line-height: 44px;
+      border-bottom:1px #E2E5EF solid;
+      text-indent: 20px;
+    }
+    .container{
+      /*margin-top: 45px;*/
+      padding: 20px 30px 0;
+      height: 100%;
+      /*overflow-y: auto;*/
+    }
+    .info-table{
+      margin: 0 0 15px;
+    }
+    table{
+      width: 100%;
+      border:1px @tableBorderColor solid;
+    }
+    .inline-table{
+      display: inline;
+      border: none;
+      td{
+        border: none;
+      }
+    }
+    .inner-table table{
+      border: none;
+      td{
+        border: none;
+        text-align: left;
+        vertical-align: text-bottom;
+        width: 41%;
+        &[rowspan]{
+          // font-weight: bold;
+          width: 100px;
+          padding-left: 0;
+        }
+        &.active{
+          background: @anchorBg;
+        }
+      }
+    }
+    .embed-table{
+      border:1px @tableBorderColor solid;
+      &>tbody>tr:first-child>td{
+        padding: 0;
+        border:none;
+        &>table td{
+          border:1px @tableBorderColor solid;
+          line-height: 20px;
+          padding: 7px 8px;
+          white-space: nowrap;
+        }
+      }
+      .table-tip{
+        text-align: left;
+      }
+    }
+    th{
+      table{
+        border:none;
+      }
+      border:1px @tableBorderColor solid;
+      background: @thBgColor;
+      line-height: 20px;
+      padding: 7px 8px;
+      white-space: nowrap;
+    }
+    td{
+      text-align: center;
+      border:1px @tableBorderColor solid;
+      padding:2px  8px;
+      height: 20px;
+      table,td{
+        border:none;
+      }
+    }
+    .info-item{
+      border-bottom: 1px @borderColor solid;
+      .text-left{
+        width: 100%;
+        text-align: right;
+      }
+      .cont{
+        display: inline-block;
+        min-width: 33%;
+        margin-bottom: 5px;
+        box-sizing: border-box;
+        // padding-left: 5px;
+        &.active{
+          background: @anchorBg;
+        }
+        & div[contenteditable="true"]{
+          border:1px solid #ccc;
+          width: 98%;
+          min-height: 46px;
+          padding: 2px 5px;
+          border-radius: 2px;
+          margin-top: 5px;
+        }
+        span{
+          line-height: 20px;
+          vertical-align: middle;
+        }
+        .text-indent{
+          text-indent: 28px;
+        }
+        .text-bold{
+          font-weight: bold;
+        }
+        .label{
+          display: inline-block;
+          /*min-width: 70px;*/
+          font-weight: bold;
+          overflow-x: hidden;
+        }
+        .revisitPlanTan{
+          border: none;
+          td{
+            border: none;
+          }
+        }
+      }
+      &.cont-2 .cont{
+        min-width: 48%;
+      }
+      &.cont-4 .cont{
+        min-width: 23%;
+      }
+      &.cont-5 .cont{
+        min-width: 19%;
+      }
+      &.no-border{
+        border-bottom: none;
+        margin-bottom: 0;
+      }
+      margin-bottom: 5px;
+      .info-title{
+        font-weight: bold;
+        margin-bottom: 10px;
+      }
+    }
+  }
+  .oper{
+    text-align: right;
+  }
+}
+.empty{
+  /*display: none;*/
+  margin-top: 120px;
+  text-align: center;
+  img{
+    width: 140px;
+  }
+  p{
+    margin-top: 15px;
+    font-size: 12px;
+    text-indent: 10px;
+    color: #aaa;
+  }
+}
+.empty2{
+  margin-top: 60px;
+  text-align: center;
+  height: 170px;
+  td{
+    width: 100%;
+  }
+  img{
+    width: 140px;
+  }
+  p{
+    // margin-top: 15px;
+    font-size: 12px;
+    text-indent: 10px;
+    color: #aaa;
+  }
+}
+/*******手术知情同意书*********/
+.surgery-book{
+  .book-item{
+    margin-bottom:15px;
+    :not(:first-child){
+      text-indent: 15px;
+    }
+    .intent{
+      text-indent: 30px;
+    }
+    .intent-1{
+      margin-left: 48px;
+      text-indent: 0;
+    }
+    &.clearfix{
+      p{
+        width: 100%;
+      }
+    }
+    .fr{
+      margin-top: 25px;
+      text-align: right;
+    }
+  }
+}
+
+/********术后首次病程记录及谈话记录*******/
+
+.textR{
+  text-align: right;
+}
+.textL{
+  text-align: left;
+}
+.textPreLine{
+  white-space: pre-line;
+}
+.textIndent30{
+  text-indent:30px
+}
+.textBold{
+  font-weight: bold;
+}
+.padL30{
+  padding-left: 30px;
+}
+.displayInlineBlock{
+  display: inline-block;
+}
+
+/********缺陷总览*********/
+.modal .modal-footer a.cancel{
+  display: none;
+  color: #FF4D4F;
+  border-color: #FF4D4F;
+  margin-right: 16px;
+}
+.checkTipsBox{
+  width:184px;
+  height:112px;
+}
+.page-anchor-hover:hover {
+  color: #00A1FF;
+}
+.checkImg{
+  width: 40px;
+  position: relative;
+  top: 20px;
+  left: 50%;
+  margin-left: -20px;
+}
+.checkTxt{
+  color: #fff;
+  top: 10px;
+  margin-top: 10px;
+  text-align: center;
+  position: relative;
+  width: 100%;
+  opacity: .5;
+}
+.liExtend{
+  position: absolute;
+  left: -3px;
+  width: 3px;
+  height: 100%;
+}
+
+#contentIframeIn,#pacsIframeIn,#assistIframeIn,#pacsDetailIframeIn,#contentNursing { //医嘱信息
+  width: 100%;
+  height: 100%;
+} 

+ 35 - 0
src/html/editableDetail.html

@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta http-equiv="X-UA-Compatible" content="ie=edge">
+    <!--<link rel="shortcut icon" href="../resource/favicon.ico" type="image/x-icon">-->
+    <title>质控评分</title>
+</head>
+<body>
+    <div class="main-part clearfix">
+        <div class="tab-container clearfix">
+            <p id="loading">加载中,请稍候 ...</p>
+            <div class="content-box1" id="contentInfo"></div>
+        </div>
+    </div>
+    <div id="mainBox"></div>
+    <div class="modal" id="delModal">
+        <div class="cover"></div>
+        <div class="modal-box">
+            <div class="modal-header clearfix">
+                <span class="title">提示</span>
+                <a class="close" href="javascript:void(0);">×</a>
+            </div>
+            <div class="modal-body">
+                <!--<p>确定要删除该评分记录吗?</p>-->
+            </div>
+            <div class="modal-footer">
+                <a class="close cancel" href="javascript:void(0);">取消</a>
+                <a class="confirm" href="javascript:void(0);">保存</a>
+            </div>
+        </div>
+    </div>
+</body>
+</html>

+ 6 - 1
src/js/api.js

@@ -190,7 +190,12 @@ const ywCheckApi = {
     recordCheck:'/qc/recCheck/recordCheck',//义乌病历核查
     getCheckType:'/qc/recCheck/getCheckType',//义乌病历核查
 };
+const editApi = {
+    getDataEdit:'/qc/dataEdit/getDataEdit',
+    saveDataEdit:'/qc/dataEdit/saveDataEdit'
+}
 module.exports = {
   api,
-  ywCheckApi
+  ywCheckApi,
+  editApi
 };

+ 167 - 0
src/js/editableDetail.js

@@ -0,0 +1,167 @@
+require("../css/editableDetail.less");
+const $ = require('jquery');
+require('jquery-templates');
+const {post,getUrlArgObject} = require('./utils.js');
+const {api,editApi} = require('./api.js');
+
+$(function(){
+//本页全局变量
+  const global_id=getUrlArgObject("id");
+  let global_activeTab=$(".sub-menu .page.active").attr("code");  //当前激活菜单项
+  let global_modules ={};   //模板数据缓存
+  getAllModules();
+  //window.document.title=(showCheckBtns?"质控核查-":"质控评分-")+getUrlArgObject("name");
+
+//获取病例明细
+function getRecordDetail(){
+  post(editApi.getDataEdit).then(function(res){
+    if(res.data.code==='0'){
+      const data = res.data.data;
+        console.log(2222,data)
+      const { wholeData,modeId } = data;
+      initContent(modeId,wholeData);
+    }
+  });
+}
+//显示病例模块明细
+function initContent(moduleId,data){
+  const obj = JSON.parse(data);
+  let info=[];
+  let hml='';
+  //formatSpecPage(obj["谈话告知书"],"谈话告知书");
+  //formatSpecPage(obj["知情同意书"],"知情同意书");
+  info=formatInfoData(obj);
+  if(global_modules[moduleId]){
+    hml=initModuleData(moduleId,obj);
+  }else{
+    info={};
+    hml=`<div class="empty">
+        <img src="${icon}" alt="空"/>
+        <p>暂无信息~</p>
+    </div>`;
+  }
+    $.tmpl(hml,info).appendTo("#contentInfo");
+  $(".content-item[code="+global_activeTab+"]").show();
+  //console.log(obj)
+}
+
+function formatInfoData(data){
+  let obj = {},name="";
+  for(let i in data){
+    if(i!=="mode_id"){
+      name=i.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g,"").replace(/^[0-9]+/,"a");    //过滤key中存在的特殊符号,模板会渲染不出来且不报错
+      obj[name]=data[i].replace(/\n/g,"<br/>")||"";
+    }else{
+      obj[i]=data[i].replace(/\n/g,"<br/>")||"";
+    }
+  }
+  return Object.assign({},obj);
+}
+
+//初始化模板
+  function initModuleData(mid,obj){
+    const n = obj.length;
+    const module=global_modules[mid].moduleDetail;
+    const key = global_modules[mid].modeName.replace(/[^\u4e00-\u9fa5|a-zA-Z0-9]+/g,'');
+    let hml = '<div class="content-item" code="'+key+'">' +
+      '<h2 class="title">'+global_modules[mid].modeName+'('+mid+')</h2>'+
+      (n>1?'<div class="container">':'<div class="container">');
+
+      
+      for(let i in module){
+        hml=hml+'<div class="info-item">';
+        for(let j=0;j<module[i].length;j++) {
+        const detal = module[i][j].questionDTO;
+        const {tagType} = detal;
+        switch (tagType) {
+          case 1:
+            hml = hml + simpleStructure(detal,obj);
+            break;
+          case 4:
+            hml = hml + combineStructure(detal);
+            break;
+          default:
+            break;
+        }
+      }
+      hml = hml+"</div>"
+    }
+    return hml+"</div></div>";
+  }
+
+
+  //基础类型结构生成
+  function simpleStructure(data,obj){
+    //console.log(data,obj,7878787)
+    const {name, val,monoLine,addLine,position,bold,retract,id} = data;
+    const noEdits = `'医师签名','时间','出院计划','修正诊断','治疗监测计划','姓名','家庭住址','出生日期','性别','工作单位','身份证号','民族','年龄','联系人(关系)','职业','婚姻状况','出生地','入院日期','记录日期','病史陈述者','电话','户口地址','目前使用的药物','成瘾药物','诊疗计划','需求评估','预期目标'`;
+    let nameStr = name.replace(":","").replace(":","");
+    const editable = noEdits.indexOf(nameStr)===-1;
+    console.log(nameStr)
+    const posClass = position===1?'text-left':'';
+    const boldClass = bold===1?'text-bold':'';
+    const retractClass = retract===1?'text-indent':'';
+    const valName = extractVars(val);
+    const valT = valName.replace(/[{{html |}}]/g,"")
+    const lineHml = ('<p class="'+posClass+' '+boldClass+' '+retractClass+'">${extractVars(val)}</p>');
+    const txtHml = (`<div contenteditable="${editable?true:false}" valName="`+valT+`" class="fl ${posClass} ${boldClass} ${retractClass}">${ extractVars(val)}</div>`);
+
+    let hml = addLine||monoLine?`<div class="cont clearfix ${posClass}" style="width: 100%;" id="anchor${id}">`:`<div class="cont" id="anchor${id}">`;
+    hml=hml+`<span class="label fl">${name}</span>`+ (addLine?lineHml:txtHml)+ `</div>`;
+    return hml;
+  }
+
+  //组合类型结构生成
+  function combineStructure(data){
+    const {name,questionMapping,id} = data;
+    let hml='<div class="inner-table"><table>';
+    const colNum = Math.ceil(questionMapping.length/2);
+    let tdVal='';
+    const regexp = /(【(.+?)】)/g;
+    for(let i=0;i<questionMapping.length;){
+      if(questionMapping[i+1]){
+        tdVal="<td id='anchor"+questionMapping[i].id+"'>"+questionMapping[i].name+extractVars(questionMapping[i].val)+"</td><td id='anchor"+questionMapping[i+1].id+"'>"+questionMapping[i+1].name+extractVars(questionMapping[i+1].val)+"</td>";
+      }else{
+        tdVal="<td id='anchor"+questionMapping[i].id+"'>"+questionMapping[i].name+extractVars(questionMapping[i].val)+"</td><td></td>";
+      }
+      if(i==0){
+        hml=hml+`<tr><td rowspan="${colNum}" id='anchor${id}'>${name}</td>${tdVal}`;
+      }else{
+        hml=hml+`<tr>${tdVal}`;
+      }
+      hml=hml+"</tr>";
+      i=((i+2)>questionMapping.length?i+1:i+2)
+    }
+    hml=hml+"</table></div>";
+    return hml;
+  }
+
+  //抽取变量
+  function extractVars(org){
+    const regexp = /(【(.+?)】)/g;
+    const arr = org.split(regexp);
+    let htl = '',val='';
+    for(let i=0;i<arr.length;i++){
+      val = arr[i].indexOf("【")!=-1?'':(arr[i-1]&&arr[i-1].indexOf("【")!=-1?"{{html "+arr[i]+"}}":arr[i]);
+      htl=htl+val;
+    }
+      console.log(11,org,arr,htl)
+    return htl;
+  }
+//获取所有模板
+  function getAllModules(){
+    const param={
+      hospitalId:getUrlArgObject("hid"),
+      modeId:''
+    };
+    post(api.getModuleById,param).then((res)=>{
+      if(res.data.code==='0') {
+        const data = res.data.data;
+        global_modules=data;
+        getRecordDetail();
+        $("#loading").hide();
+      }
+    });
+  }
+});
+

+ 2 - 1
src/js/utils.js

@@ -4,7 +4,7 @@ const axios = require('axios');
 var Utils = require('./rePromise');
 const {ywCheckApi} = require('./api.js')
 require('./scrollBar.js');
-const baseUrl = 'http://192.168.2.241:5858';
+const baseUrl = 'http://192.168.2.236:5858';
 //页面映射
 const pageMap = {
   'YH-KZT': 'console.html',
@@ -62,6 +62,7 @@ const pageMap = {
   'YH-ZKHC-FPHCRW':'allotCheckTask.html',  //义乌-分配核查任务
   'YH-ZKHC-HCRWLB':'checkTaskList.html',  //义乌-核查任务列表
   'YH-ZKK-YLZLKZZB_XQ': 'qualityControl.html',
+  'YH-SJBJ':'editableDetail.html'   //数据编辑
 };
 
 //导出时间天数