cdssPlan.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. if(!Promise){
  2. var Promise = require("bluebird");
  3. // Configure
  4. Promise.config({
  5. longStackTraces: true,
  6. warnings: true // note, run node with --trace-warnings to see full stack traces for warnings
  7. })
  8. }
  9. require('./../css/reset.css');
  10. require('./../css/cdssPlan.less');
  11. require('./../css/popup.css');
  12. require('./../css/followUpV.less');
  13. require('../css/staticSearch.less')
  14. require('./../js/staticSearch.js') //静态知识搜索
  15. require('./../images/empty.png').replace(/^undefined/g, '')
  16. require('./../images/empty2.png').replace(/^undefined/g, '')
  17. require('./../images/empty3.png').replace(/^undefined/g, '')
  18. require('./../images/loading.gif').replace(/^undefined/g, '')
  19. require('./../images/right.png').replace(/^undefined/g, '')
  20. require('./../images/new.png').replace(/^undefined/g, '')
  21. const $ = require("jquery");
  22. const { post,config,getUrlArgObject,openNewWin,titleConfig } = require('./promise.js');
  23. const { renderFollowUp } = require('./followUp.js');
  24. //静态知识类型: 1:诊断 2.药品 3.化验套餐 4.化验明细 5.辅检 6.手术和操作
  25. let mrId = getUrlArgObject('mrId')
  26. let msg;
  27. function getMRInfo() {
  28. return post(config.getMr2,{mrId:mrId})
  29. }
  30. // $('.loading').css("display","block")
  31. $('.empty').css("display","none")
  32. if(mrId){
  33. getMRInfo().then(res =>{
  34. if(res.data.code == '0'){
  35. msg = res.data.data ||{}
  36. window.msg = msg
  37. renderFollowUp(msg)
  38. setTimeout(()=>{
  39. adjustWidth();
  40. },200)
  41. }
  42. }).catch(function (err) {
  43. console.log(err);
  44. })
  45. } else{
  46. }
  47. let disName=""
  48. function handleShow(){
  49. const newinConf = {
  50. width: '600', //窗口的文档显示区的宽度。以像素计。
  51. height: '826', //窗口文档显示区的高度。以像素计。
  52. left: '0', //窗口的 x 坐标。以像素计。
  53. top: '0', //窗口的 y 坐标。以像素计。
  54. openMode: "_blank" //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
  55. }
  56. const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top} scrollbars=yes`
  57. window.open('./emergency.html?disName='+disName, newinConf.openMode, newWindowLocation)
  58. }
  59. $(document).on('click',".allDis .allName",function(){
  60. handleShow()
  61. })
  62. $(document).on('click',".singleDis",function(){
  63. $(this).next().css("display","block")
  64. $(this).css("display","none")
  65. })
  66. $(document).on('click',".allDis .right,.allDis .secDis",function(){
  67. $(".allDis").css("display","none")
  68. $(".singleDis").css("display","block")
  69. })
  70. function adjustWidth(){
  71. const iframeWh = $(".bodyWrap").width();console.log(11,iframeWh)
  72. $(".operaNameWrap").css("width",iframeWh-168+'px')
  73. }
  74. $(function(){
  75. $.fn.extend({
  76. "preventScroll":function(){
  77. $(this).each(function(){
  78. var _this = this;
  79. if(navigator.userAgent.indexOf('Firefox') >= 0){ //firefox
  80. _this.addEventListener('DOMMouseScroll',function(e){
  81. _this.scrollTop += e.detail > 0 ? 60 : -60;
  82. e.preventDefault();
  83. },false);
  84. }else{
  85. _this.onmousewheel = function(e){
  86. e = e || window.event;
  87. _this.scrollTop += e.wheelDelta > 0 ? -60 : 60;
  88. return false;
  89. };
  90. }
  91. })
  92. }
  93. });
  94. $(window).on('resize', function(){
  95. adjustWidth()
  96. })
  97. });