check.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. if(!Promise){
  2. var Promise = require("bluebird");
  3. Promise.config({
  4. longStackTraces: true,
  5. warnings: true
  6. })
  7. }
  8. const $ = require("jquery");
  9. const { post,config,getUrlArgObject } = require('./promise.js');
  10. let mrId = getUrlArgObject('mrId')
  11. let hospitalIdUrl = getUrlArgObject('hospitalId') || ''
  12. let msg;
  13. function getMRInfo() {
  14. return post(config.getMr2,{mrId:mrId})
  15. }
  16. $('.empty').css("display","none")
  17. if(mrId){
  18. getMRInfo().then(res =>{
  19. if(res.data.code == '0'){
  20. msg = res.data.data ||{}
  21. window.msg = msg
  22. renderPushData()
  23. }
  24. }).catch(function (err) {
  25. console.log(err);
  26. })
  27. } else{
  28. }
  29. let disName=""
  30. function handleShow(){
  31. const newinConf = {
  32. width: '600', //窗口的文档显示区的宽度。以像素计。
  33. height: '826', //窗口文档显示区的高度。以像素计。
  34. left: '0', //窗口的 x 坐标。以像素计。
  35. top: '0', //窗口的 y 坐标。以像素计。
  36. openMode: "_blank" //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
  37. }
  38. const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top} scrollbars=yes`
  39. window.open('./emergency.html?disName='+disName, newinConf.openMode, newWindowLocation)
  40. }
  41. $(document).on('click',".allDis .allName",function(){
  42. handleShow()
  43. })
  44. $(document).on('click',".singleDis",function(){
  45. $(this).next().css("display","block")
  46. $(this).css("display","none")
  47. })
  48. $(document).on('click',".allDis .right,.allDis .secDis",function(){
  49. $(".allDis").css("display","none")
  50. $(".singleDis").css("display","block")
  51. })
  52. function renderPushData(){
  53. return getPushInfo().then(res =>{
  54. if(res.data.code == "0"){
  55. const result = res.data.data.debug['数据']
  56. let allData = {}
  57. allData.chiefLabel = result.chiefLabel //主诉
  58. allData.presentLabel = result.presentLabel //现病史
  59. allData.pastLabel = result.pastLabel //既往史
  60. allData.personalLabel = result.personalLabel //个人史
  61. allData.familyLabel = result.familyLabel //家族史
  62. allData.maritalLabel = result.maritalLabel //婚育史
  63. allData.menstrualLabel = result.menstrualLabel //月经史
  64. allData.vitalLabel = result.vitalLabel //体格
  65. console.log(allData)
  66. }
  67. })
  68. }
  69. function getPushInfo() {
  70. return post(config.pushInner,Object.assign({},msg,{featureType: '1,4,5,6,7,8,9,10',hospitalId:hospitalIdUrl||msg.hospitalId,ruleType:config.ruleTypeMap['22']}))
  71. }