index.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import './css/index.less';
  2. import './css/reset.css';
  3. import './css/popup.less';
  4. import './js/popup';
  5. import {post,config,getUrlArgObject} from './js/promise.js';
  6. import {bqtsFun,ybzlFun,cyywFun,knzdFun,jtFun,tjwzFun,tjtgFun,tjhyFun,tjfjFun} from './js/indexDom';
  7. // var msg= {
  8. // age: 28,
  9. // diag: "急性胰腺炎",
  10. // diseaseId: 280,
  11. // featureType: "1,4,5,6,7,8,22",
  12. // lis: [
  13. // {
  14. // detailName: "HGB*3/HCT",
  15. // maxValue: "",
  16. // minValue: "",
  17. // name: "血常规",
  18. // otherValue: "",
  19. // source: "0",
  20. // time: "2019-05-07 17:11",
  21. // uniqueName: "血常规-HGB*3/HCT",
  22. // units: "",
  23. // value: "4"
  24. // }
  25. // ],
  26. // other: "无高血压",
  27. // pacs: "腹部B超:无异常, 报告日期:2019-05-07",
  28. // sex: 1,
  29. // symptom: "恶心呕吐腰痛", //胸痛,背痛,恶心,呕吐 //恶心呕吐腰痛 //牙周袋形成
  30. // vital: "血压左上肢13/12mmHg",
  31. // }
  32. var msg = {
  33. age: getUrlArgObject('age'),
  34. diseaseId: 280,
  35. sex: getUrlArgObject('sex') == '男'?1:getUrlArgObject('sex') == '女'?2:3,
  36. symptom: getUrlArgObject('symptomJson'),
  37. vital: getUrlArgObject('vitalJson'),
  38. lis: JSON.parse(getUrlArgObject('lisJson')),
  39. pacs: getUrlArgObject('pacsJson'),
  40. diag: getUrlArgObject('diagJson'),
  41. featureType: "1,4,5,6,7,22",
  42. other: getUrlArgObject('otherJson')+getUrlArgObject('pastJson'),
  43. }//推送相关信息
  44. window.msg = msg
  45. window.pushMessage = {}
  46. let lisTmp = JSON.parse(getUrlArgObject('lisJson'))
  47. post(config.pushInner,msg).then((res)=>{
  48. var data = res.data
  49. if(data.code == 0){
  50. var result = data.data;
  51. if(result.medicalIndications && result.medicalIndications.length>0){//病情提示
  52. window.pushMessage = result.medicalIndications;//计算的需要的相关数据
  53. bqtsFun(result.medicalIndications)
  54. }
  55. if(result.treat){
  56. if(result.treat.commonTreatment && result.treat.commonTreatment.content){
  57. ybzlFun(result.treat.commonTreatment.content)//一般治疗
  58. $(".conditionHintZhiliaoNull").css("display","none")
  59. }
  60. if(result.treat.treatment && result.treat.treatment.length>0){
  61. cyywFun(result.treat.treatment)//常用药物
  62. }
  63. }
  64. if(result.dis){
  65. var proB = result.dis['可能诊断'] || []//可能
  66. var proY = result.dis['确诊'] || []//确诊
  67. var plusPro = proB.concat(proY)
  68. var proWaring = result.dis['警惕'] || []
  69. knzdFun(plusPro)
  70. jtFun(proWaring)
  71. if(plusPro.length > 0 || proWaring.length > 0){
  72. $(".conditionHintMay").css("display","none")
  73. }
  74. }
  75. if(result.symptom && result.symptom.length > 0){//推荐问诊症状
  76. $(".conditionHintWzNull").css("display","none")
  77. tjwzFun(result.symptom)
  78. }
  79. if(result.vital && result.vital.length > 0){//体格检查
  80. $(".conditionHintTgNull").css("display","none")
  81. tjtgFun(result.vital)
  82. }
  83. if(result.pacs.length > 0 && result.lab.length > 0){
  84. $(".conditionHintAssistLis").css({
  85. "border-top":"1px solid #D8D8D8",
  86. // "margin-top":"5px",
  87. // "padding-top":"5px"
  88. })
  89. }
  90. if(result.lab && result.lab.length > 0){//化验
  91. $(".conditionHintInspectNull").css("display","none")
  92. $(".conditionHintAssistNull").css("display","none")
  93. tjhyFun(result.lab)
  94. }
  95. if(result.pacs && result.pacs.length > 0){//辅检
  96. $(".conditionHintInspectNull").css("display","none")
  97. $(".conditionHintAssistNull").css("display","none")
  98. tjfjFun(result.pacs)
  99. }
  100. }
  101. })