cdssHorizontal.js 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499
  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. const $ = require("jquery");
  10. require('./util.js');
  11. require('./../css/reset.css');
  12. require('./../css/cdssHorizontal.less');
  13. require('./../css/popup.css');
  14. require('../css/staticSearch.less')
  15. require('./../js/staticSearch.js');//静态知识搜索
  16. require('./../images/empty2.png').replace(/^undefined/g, '')
  17. require('./../images/dn.png').replace(/^undefined/g, '')
  18. require('./../images/loading.gif').replace(/^undefined/g, '')
  19. let emptyImg = require('./../images/empty3.png').replace(/^undefined/g, '')
  20. require('./../images/new2.png').replace(/^undefined/g, '')
  21. require('./../images/dots.png').replace(/^undefined/g, '')
  22. require('./../images/dot.png').replace(/^undefined/g, '')
  23. const { post, config, getUrlArgObject, openNewWin, titleConfigH, throttle, } = require('./promise.js');
  24. let infoImg = require('./../images/icon_info.png').replace(/^undefined/g, '')
  25. let infoImgOn = require('./../images/icon_info_on.png').replace(/^undefined/g, '')
  26. let iconArrowUp = require('./../images/icon_arrow_up.png').replace(/^undefined/g, '')
  27. let iconArrowDown = require('./../images/icon_arrow_down.png').replace(/^undefined/g, '')
  28. let showImg = require('./../images/show2.png').replace(/^undefined/g, '')
  29. let collapseImg = require('./../images/collapse2.png').replace(/^undefined/g, '')
  30. let go = require('./../images/g1.png').replace(/^undefined/g, '')
  31. let treatDisName, treatUniqueName
  32. let maydiagnoseList = [], hasdiagnoseList = []
  33. let maydiagnoseType = false, hasdiagnoseType = false, rightList = [];
  34. let generalTreatInfo
  35. const { renderFollowUp } = require('./followUp.js');
  36. const { getTcmMr } = require('./tcmiss.js');
  37. let moduleConfig = {
  38. auxiliary: "recommendWrap",
  39. qc: "qcWrap",
  40. medical: "medicalKonwledgeWrap",
  41. followup: 'followUpWrap',
  42. tcmiss: 'tcmWarp',
  43. }
  44. let allInterface = 0
  45. let hasCompleteTnterface = 0
  46. let moduleNum = 0
  47. let mrId = getUrlArgObject('mrId')
  48. let pushMrId = getUrlArgObject('pushMrId')
  49. const tipsMode = getUrlArgObject('tipsMode') || 1
  50. let planCode = getUrlArgObject('planCode') || 'all'
  51. let hospitalIdUrl = getUrlArgObject('hospitalId') || ''
  52. let msg;
  53. let tipsMsg;
  54. let caseWriteStandradList;
  55. function getMRInfo() {
  56. return post(config.getMr2, { mrId: mrId })
  57. }
  58. function getConf() {
  59. var msg = window.msg
  60. return post(config.getPushSet, { hospitalId: hospitalIdUrl || msg.hospitalId || 1, planCode: planCode })
  61. }
  62. function getPushInfo() {
  63. return post(config.pushInner, Object.assign({}, msg, {
  64. featureType: '1,4,5,6,7,8,9,10,12,13',
  65. hospitalId: hospitalIdUrl || msg.hospitalId,
  66. ruleType: config.ruleTypeMap['22']
  67. }))
  68. }
  69. function pushByDisease(name, i) {
  70. return post(config.pushByDisease, Object.assign({}, msg, {
  71. featureType: '1,4,5,6,7,8,9,10,12,13',
  72. hospitalId: hospitalIdUrl || msg.hospitalId,
  73. ruleType: config.ruleTypeMap['22'],
  74. diseaseName: {
  75. name: name,
  76. uniqueName: name
  77. }
  78. }))
  79. }
  80. function getPusgWarning() {
  81. const indPush = pushMrId ? config.indicationPushCache : config.indicationPush;
  82. return post(indPush, Object.assign({}, msg, { ruleType: '1,2,3,4', mrId: pushMrId || mrId }))
  83. }
  84. function getWriteStandardPush() {
  85. return post(config.caseWritingPrompt, Object.assign({}, msg, { hospitalId: 2 || msg.hospitalId }))
  86. }
  87. if (mrId) {
  88. Promise.all([getConf(), getMRInfo()]).then(([res1, res2]) => {
  89. const data = res1.data.data && res1.data.data[0]
  90. msg = res2.data.data || {}
  91. if (!(msg && msg.diseaseName && msg.diseaseName.name)) {
  92. msg.diseaseName = null
  93. }
  94. window.msg = msg
  95. renderPage(data)
  96. })
  97. } else {
  98. getConf().then(res => {
  99. if (res.data.code == '0') {
  100. // const configArr = res.data.data.pushSetList || []
  101. // getPageInfo(configArr)
  102. const data = res.data.data && res.data.data[0]
  103. renderPage(data)
  104. }
  105. })
  106. }
  107. function renderPage(pageSet) {
  108. if (!pageSet || !pageSet.sysSetInfo) {
  109. return
  110. }
  111. renderTab(pageSet.sysSetInfo)
  112. const iframeHei = $(".bodyWrap").height()
  113. const tabHei = $(".tabList").height()
  114. $(".contentWrapper").css("height", iframeHei - tabHei - 10 - 20 - 30 + 'px')
  115. const hasAuxiliary = hasTab("辅助信息", pageSet.sysSetInfo)
  116. const hasMedical = hasTab("医学知识", pageSet.sysSetInfo)
  117. const hasFollowUp = hasTab("随访计划", pageSet.sysSetInfo)
  118. const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo)
  119. //所有模块都未开启配置,显示功能未开启(无tab)
  120. if (hasAuxiliary.status === 0 && hasMedical.status === 0 && hasFollowUp.status === 0 && hasTcm.status === 0) {
  121. const nullTxt = `<div class="empty-box" style="left: -20px;display: block;">
  122. <img class="emptyImg" src="../images/icon_admin.png" alt="空">
  123. <p class="emptyTxt">功能未开启</p>
  124. </div>`
  125. $(".recommendWrap").html(nullTxt).show();
  126. return;
  127. }
  128. if (hasTcm) {
  129. getTcmMr(mrId, hasTcm);
  130. }
  131. if (hasFollowUp) {
  132. renderFollowUp(msg, 1)
  133. }
  134. const planDetail = hasAuxiliary.planDetails;
  135. const configs = planDetail.filter((it) => it.status !== 0) || [];
  136. if (!configs[0]) { //没有开启辅助信息各项配置
  137. $('.empty-box,.leftWrapper').hide();
  138. $('.recommendWrap .empty-right').show();
  139. return;
  140. }
  141. //有数据再设置宽度
  142. //setWidth()
  143. if (hasAuxiliary) {
  144. renderModuleWrapper(hasAuxiliary.planDetails)
  145. let needPush = isNeedPush(hasAuxiliary.planDetails)
  146. let needPushWarning = isNeedPushWarning(hasAuxiliary.planDetails)
  147. let needWriteStandardPush = isNeedwriteStandardPush(hasAuxiliary.planDetails)
  148. if (needPush || needPushWarning) {
  149. renderPushData()
  150. allInterface++
  151. }
  152. if (needPushWarning) {
  153. renderPushWarning()
  154. allInterface++
  155. }
  156. if (needWriteStandardPush) {
  157. renderCaseWrite()
  158. allInterface++
  159. }
  160. }
  161. }
  162. function renderTab(tabList) {
  163. if (!tabList) {
  164. return
  165. }
  166. let tabStr = ''
  167. let TabNum = 0
  168. for (let i = 0; i < tabList.length; i++) {
  169. if (tabList[i].status == '1') {
  170. TabNum++
  171. tabStr += `<div class="tab" data-name="${tabList[i].code}" ><span class="tabName">${tabList[i].name}</span></div>`
  172. }
  173. if (tabList[i].code == 'maydiagnose') {
  174. maydiagnoseList = moduleList[i].planDetails
  175. } else if (tabList[i].code == 'hasdiagnose') {
  176. hasdiagnoseList = tabList[i].planDetails
  177. }
  178. }
  179. $(".tabList").append(tabStr)
  180. $(".tabList .tab").eq(0).addClass("activeTab")
  181. $(".tabList .tab").eq(0).addClass("activeTab")
  182. // $(".tabList .tab").css("height", 1 / TabNum * 100 + '%')
  183. let showModuleName = $(".tabList .tab").eq(0).attr("data-name")
  184. getModuleShow(moduleConfig[showModuleName])
  185. bindTabClick()
  186. //setTabNameTop()
  187. }
  188. function hasTab(tabName, tabList) {
  189. for (let i = 0; i < tabList.length; i++) {
  190. if (tabList[i].name == tabName) {
  191. return tabList[i]
  192. }
  193. }
  194. return false
  195. }
  196. function renderModuleWrapper(moduleList) {
  197. if (!moduleList) {
  198. return
  199. }
  200. console.log(445, 663);
  201. let moduleStr = '', treatStr = ""
  202. for (let i = 0; i < moduleList.length; i++) {
  203. if (moduleList[i].code == 'general' || moduleList[i].code == 'medicine' || moduleList[i].code == 'operation') {
  204. rightList.push(moduleList[i].status)
  205. }
  206. if (moduleList[i].status != '0') {
  207. if (moduleList[i].code == 'general' || moduleList[i].code == 'medicine' || moduleList[i].code == 'operation') {
  208. treatStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  209. rightList.push(moduleList[i].status)
  210. } else if (moduleList[i].code == 'nurse') {
  211. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  212. } else if (moduleList[i].code == 'critical') {
  213. moduleStr += `<div class="moduleItem warning" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  214. // moduleStr += `<div class="moduleItem tips" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  215. } else if (moduleList[i].code == 'maydiagnose') {
  216. maydiagnoseList = moduleList[i].planDetails
  217. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  218. let arr = []
  219. for (let j = 0; j < moduleList[i].planDetails.length; j++) {
  220. let item = moduleList[i].planDetails[j]
  221. arr.push(item.status)
  222. }
  223. if (arr.indexOf(1) == -1) {
  224. maydiagnoseType = true
  225. }
  226. } else if (moduleList[i].code == 'hasdiagnose') {
  227. hasdiagnoseList = moduleList[i].planDetails
  228. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  229. let arr = []
  230. for (let j = 0; j < moduleList[i].planDetails.length; j++) {
  231. let item = moduleList[i].planDetails[j]
  232. arr.push(item.status)
  233. }
  234. if (arr.indexOf(1) == -1) {
  235. hasdiagnoseType = true
  236. }
  237. } else {
  238. moduleStr += `<div class="moduleItem ${moduleList[i].code}" data-num="${moduleList[i].number}" style="display:none"><span class="moduleItemTitBox"></span></div>`
  239. }
  240. }
  241. }
  242. $(".recommendWrap .leftBox").append(moduleStr)
  243. $(".recommendWrap .rightBox").append(treatStr)
  244. /*if($(".moduleItem:visible").length===0){
  245. $(".empty-null").show();
  246. }*/
  247. }
  248. function isNeedPush(list) {
  249. let pushCode = ['critical', "diag", "lis", "pacs", "symptom", "vital", "treat", "medicines", 'evaluation', 'general', 'medicine', 'operation', 'nurse', 'maydiagnose', 'hasdiagnose']
  250. for (let i = 0; i < list.length; i++) {
  251. if (pushCode.indexOf(list[i].code) > -1) {
  252. if (list[i].status == "1") {
  253. return true
  254. }
  255. }
  256. }
  257. return false
  258. }
  259. function isNeedPushWarning(list) {
  260. let pushCode = ["crivalue", "rationali", "highrisk", "otherremind", "nurse"]
  261. for (let i = 0; i < list.length; i++) {
  262. if (pushCode.indexOf(list[i].code.trim()) > -1) {
  263. if (list[i].status == "1") {
  264. return true
  265. }
  266. }
  267. }
  268. return false
  269. }
  270. function isNeedwriteStandardPush(list) {
  271. let pushCode = ["casewriting"]
  272. for (let i = 0; i < list.length; i++) {
  273. if (pushCode.indexOf(list[i].code) > -1) {
  274. if (list[i].status == "1") {
  275. return true
  276. }
  277. }
  278. }
  279. return false
  280. }
  281. function bindTabClick() {
  282. $(".tabList .tab").on("click", function () {
  283. $(".activeTab").removeClass("activeTab")
  284. $(this).addClass("activeTab")
  285. const moduleName = $(this).attr("data-name")
  286. getModuleShow(moduleConfig[moduleName])
  287. })
  288. }
  289. function getModuleShow(moduleClassName) {
  290. if ($(`.${moduleClassName}`).css("display") == "none") {
  291. $(".moduleWrapper").css("display", "none")
  292. $(`.${moduleClassName}`).css("display", "block")
  293. //empty();
  294. }
  295. }
  296. function setTabNameTop() {
  297. const tabNameList = $(".tabList .tab .tabName")
  298. for (let i = 0; i < tabNameList.length; i++) {
  299. let tabNameHei = $(".tabList .tab .tabName").eq(i).height()
  300. // $(".tabList .tab .tabName").eq(i).css("marginTop", -tabNameHei / 2 + "px")
  301. }
  302. }
  303. function renderCaseWrite() {
  304. getWriteStandardPush().then(res => {
  305. hasCompleteTnterface++
  306. if (res.data.code == '0') {
  307. const caseWriteList = res.data.data || {}
  308. let caseWritePush = Object.keys(caseWriteList) || []
  309. renderwriteStandardPage(caseWritePush)
  310. if ($(".moduleItem.casewriting")) {
  311. let casewritingHei = $(".moduleItem.casewriting")[0].scrollHeight
  312. if (casewritingHei > 63) {
  313. $(".casewriting").append(`<span class="showMoreCaseWrite">更多</span>`)
  314. caseWriteStandradList = caseWritePush
  315. showMoreCaseWrite()
  316. }
  317. }
  318. }
  319. }).catch(() => {
  320. $(".loading").hide()
  321. })
  322. }
  323. function renderPushData() {
  324. $(".loading").show()
  325. return getPushInfo().then(res => {
  326. hasCompleteTnterface++
  327. if (res.data.code == "0") {
  328. const result = res.data.data
  329. let diagPush = result.dis || {}
  330. let lisPush = result.lis || []
  331. let scalePush = result.scale || []
  332. let pacsPush = result.pacs || []
  333. let symptomPush = result.symptom || []
  334. let checkupPush = result.vital || []
  335. let medicinesPush = result.medicines || []
  336. let operationsPush = result.operations || []
  337. let nursePush = result.nurse || []
  338. let treatPush = result.treat && result.treat[0] || {}
  339. treatDisName = treatPush && treatPush["name"]
  340. treatUniqueName = treatPush && treatPush["uniqueName"]
  341. let generaTreatPush = treatPush && treatPush["generaTreat"]
  342. generalTreatInfo = generaTreatPush
  343. // let lisPush =[{name:"血常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null},{name:"尿常规",hisNameList:null}]
  344. // let pacsPush = [{name:"胸部x射线",hisNameList:null},{name:"心电图",hisNameList:null}]
  345. // let checkupPush = [{name:"神志表情",hisNameList:null},{name:"面部表情",hisNameList:null}]
  346. let lisNum = $(".moduleItem.lis").attr("data-num") || 5
  347. let scaleNum = $(".moduleItem.evaluation").attr("data-num") || 5
  348. let pacsNum = $(".moduleItem.pacs").attr("data-num") || 5
  349. let checkupNum = $(".moduleItem.vital").attr("data-num") || 5
  350. let symptomNum = $(".moduleItem.symptom").attr("data-num") || 5
  351. let medicinesNum = $(".moduleItem.medicine").attr("data-num") || 5
  352. let operationsNum = $(".moduleItem.operation").attr("data-num") || 5
  353. let nurseNum = $(".moduleItem.nurse").attr("data-num") || 5
  354. let diagList = result.clickPosDis || [] //可能诊断
  355. let AffList = result.clickAffDis || [] //已诊断疾病
  356. renderLis(lisPush, lisNum)
  357. renderScale(scalePush, scaleNum)
  358. renderPacs(pacsPush, pacsNum)
  359. renderCheckup(checkupPush, checkupNum)
  360. renderSymptomPush(symptomPush, symptomNum)
  361. renderDiag(diagPush)
  362. renderDiagList(diagList)
  363. renderAffListList(AffList)
  364. let onShow = false
  365. if (rightList.indexOf(1) >= 0) {
  366. onShow = true
  367. }
  368. if ((medicinesPush.length > 0 || operationsPush.length > 0 || generaTreatPush) && onShow) {
  369. let str = `<img class="treatIcon" src = ${titleConfigH["treat"].icon} /><span>${titleConfigH["treat"].name}</span>`
  370. $(".rightBoxTitle").append(str)
  371. // renderDisName()
  372. $(".empty-box").hide();
  373. $(".rightWrapper").css("display", "block")
  374. if ($(".leftBox .moduleItem:visible").length === 0) { //左侧没有数据,右侧有数据时,右侧往左移
  375. $(".leftWrapper").css({ "width": '0', 'padding': '0' });
  376. $(".rightWrapper").css("width", '100%');
  377. }
  378. } else if ($(".leftWrapper .moduleItem:visible").length !== 0) {
  379. $(".empty-box").hide();
  380. $(".leftWrapper").css({
  381. borderRight: "0px",
  382. width: "100%"
  383. })
  384. }
  385. if ($(".moduleItem.general,.moduleItem.medicine,.moduleItem.operation,.moduleItem.nurse").length === 0 && $(".leftWrapper .moduleItem:visible").length !== 0) {
  386. $(".rightWrapper").css("display", "none")
  387. $(".empty-box").hide();
  388. $(".leftWrapper").css({
  389. borderRight: "0px",
  390. width: "100%"
  391. })
  392. }
  393. rendergeneraTreatPush(generaTreatPush)
  394. renderMedicinesPush(medicinesPush, medicinesNum)
  395. renderOperationPush(operationsPush, operationsNum)
  396. // renderNurse(nursePush, nurseNum)
  397. bindOpenInfo()
  398. bindSlide()
  399. moreInfo()
  400. empty()
  401. }
  402. }).catch(() => {
  403. $(".loading").hide()
  404. })
  405. }
  406. function renderpushByMayDisease(name, i, inx,e) {
  407. return pushByDisease(name, i).then(res => {
  408. // $(".loading").hide();
  409. hasCompleteTnterface++
  410. if (res.data.code == "0") {
  411. const result = res.data.data
  412. let symptomPush = result.symptom || []
  413. let vitalPush = result.vital || []
  414. let lisPush = result.lis || []
  415. let pacsPush = result.pacs || []
  416. let scalePush = result.scale || []
  417. let disPush = result.dis['鉴别诊断'] || []
  418. let treatPush = result.treat || []
  419. let medicinesPush = result.medicines || []
  420. let operationsPush = result.operations || []
  421. let nursePush = result.nurse || []
  422. let isShow = false
  423. for (let i = 0; i < treatPush.length; i++) {
  424. const it = treatPush[i];
  425. if (it.generaTreat) {
  426. isShow = true
  427. }
  428. }
  429. if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0 && !isShow) {
  430. $.toast('toast3', '', 3000, '.maydiagnose', i);
  431. $(".maydiagnose .item").css("display", "none")
  432. $(e.target).parents('.pushItemBox').addClass('disable');
  433. $(e.target).parents('.pushItemBox').removeClass('active');
  434. } else if (maydiagnoseType) {
  435. $.toast('toast3', '', 3000, '.maydiagnose', i);
  436. $(".maydiagnose .item").css("display", "none")
  437. } else {
  438. renderMaySymptomPush(symptomPush, inx)
  439. renderMayVitalPush(vitalPush, inx)
  440. renderMayLisPush(lisPush, inx)
  441. renderMayPacsPush(pacsPush, inx)
  442. renderMayScalePush(scalePush, inx)
  443. renderMayDisPush(disPush, inx)
  444. renderMayPush(treatPush, medicinesPush, operationsPush, nursePush, inx)
  445. bindOpenInfo()
  446. moreInfo()
  447. bindSlide();
  448. if ($(".maydiagnose .item").children('div').length == 0) {
  449. $.toast('toast3', '', 3000, '.maydiagnose', i);
  450. $(".maydiagnose .item").css("display", "none")
  451. $(".maydiagnose .item").css("display", "none")
  452. }
  453. }
  454. }
  455. empty(); //判断是否显示空状态
  456. })
  457. }
  458. function renderpushByHasDisease(name, i, inx,e) {
  459. return pushByDisease(name, i).then(res => {
  460. // $(".loading").hide();
  461. hasCompleteTnterface++
  462. if (res.data.code == "0") {
  463. const result = res.data.data
  464. let symptomPush = result.symptom || []
  465. let vitalPush = result.vital || []
  466. let lisPush = result.lis || []
  467. let pacsPush = result.pacs || []
  468. let scalePush = result.scale || []
  469. let disPush = result.dis['鉴别诊断'] || []
  470. let treatPush = result.treat || []
  471. let medicinesPush = result.medicines || []
  472. let operationsPush = result.operations || []
  473. let nursePush = result.nurse || []
  474. let isShow = false
  475. for (let i = 0; i < treatPush.length; i++) {
  476. const it = treatPush[i];
  477. if (it.generaTreat) {
  478. isShow = true
  479. }
  480. }
  481. if (symptomPush.length == 0 && vitalPush.length == 0 && lisPush.length == 0 && pacsPush.length == 0 && scalePush.length == 0 && disPush.length == 0 && medicinesPush.length == 0 && operationsPush.length == 0 && nursePush.length == 0 && !isShow) {
  482. $.toast('toast3', '', 3000, '.hasdiagnose', i);
  483. $(".hasdiagnose .item").css("display", "none")
  484. $(e.target).parents('.pushItemBox').addClass('disable');
  485. $(e.target).parents('.pushItemBox').removeClass('active');
  486. } else if (hasdiagnoseType) {
  487. $.toast('toast4', '', 3000, '.hasdiagnose', i);
  488. $(".hasdiagnose .item").css("display", "none")
  489. } else {
  490. renderHasSymptomPush(symptomPush, inx)
  491. renderHasVitalPush(vitalPush, inx)
  492. renderHasLisPush(lisPush, inx)
  493. renderHasPacsPush(pacsPush, inx)
  494. renderHasScalePush(scalePush, inx)
  495. renderHasDisPush(disPush, inx)
  496. renderHasPush(treatPush, medicinesPush, operationsPush, nursePush, inx)
  497. bindOpenInfo()
  498. moreInfo()
  499. bindSlide();
  500. if ($(".hasdiagnose .item").children('div').length == 0) {
  501. $.toast('toast3', '', 3000, '.hasdiagnose', i);
  502. $(".hasdiagnose .item").css("display", "none")
  503. $(".hasdiagnose .item").css("display", "none")
  504. }
  505. }
  506. }
  507. empty(); //判断是否显示空状态
  508. })
  509. }
  510. function empty() { //显示空状态
  511. setTimeout(function () {
  512. if ((!$(".rightWrapper .rightBoxTitle").html()) && $(".leftWrapper .moduleItem:visible").length !== 0) {
  513. $(".leftWrapper").css({
  514. borderRight: "0px",
  515. width: "100%"
  516. })
  517. }
  518. if ($(".tabList .tab:first-child").is(".activeTab") && $(".empty-right:visible").length === 0 && $(".moduleItem:visible").length === 0) {
  519. $(".empty-box,.leftWrapper").hide();
  520. $(".empty-null").show();
  521. }
  522. }, 500);
  523. }
  524. function renderDiagList(list) {
  525. if (list.length === 0) {
  526. return
  527. }
  528. $('.moduleItem.maydiagnose .moduleItemTitBox').append(titleStr("maydiagnosePush"))
  529. let str = ``
  530. let { shortStr, longStr } = renderItemWrapper(list, 99, '', 1)
  531. let boxStr = `<div class="moduleBox">
  532. ${str}
  533. ${shortStr}
  534. </div>`
  535. $(".moduleItem.maydiagnose").append(boxStr)
  536. $(".moduleItem.maydiagnose").append("<div class='item' data-index='1'></div>")
  537. $(".moduleItem.maydiagnose.moduleItemTitBox").append(renderLongStr(name, longStr, "left"))
  538. $('.moduleItem.maydiagnose').css("display", "block")
  539. $('.maydiagnose .pushItemBox').on("click", function (e) {
  540. e.preventDefault()
  541. const name = $(this).attr('data-name');
  542. const i = $(this).attr('data-index');
  543. if ($(this).hasClass('disable')) {
  544. $.toast('toast3', '', 3000, '.maydiagnose', i);
  545. $(".maydiagnose .item").css("display", "none")
  546. $(this).siblings().removeClass('active');
  547. return
  548. }
  549. if ($(this).hasClass('active')) {
  550. $(this).removeClass('active');
  551. } else {
  552. $(this).addClass('active').siblings().removeClass('active');
  553. }
  554. const index = $(this).parent().parent().next().attr('data-i')
  555. const showList = $(".maydiagnose .item").css("display")
  556. if (showList == "none" || index != i) {
  557. // $(".loading").show();
  558. $(".maydiagnose .item").html('')
  559. $(".maydiagnose .item").css("display", "none")
  560. $(this).parent().parent().next().css("display", "block")
  561. $(this).parent().parent().next().attr('data-i', i)
  562. renderpushByMayDisease(name, i, 1,e)
  563. } else {
  564. $(".maydiagnose .item").css("display", "none")
  565. }
  566. });
  567. }
  568. function renderAffListList(list) {
  569. if (list.length === 0) {
  570. return
  571. }
  572. $('.moduleItem.hasdiagnose .moduleItemTitBox').append(titleStr("hasdiagnosePush"))
  573. let str = ``
  574. let { shortStr, longStr } = renderItemWrapper(list, 99, '', 1)
  575. let boxStr = `<div class="moduleBox">
  576. ${str}
  577. ${shortStr}
  578. </div>`
  579. $(".moduleItem.hasdiagnose").append(boxStr)
  580. $(".moduleItem.hasdiagnose").append("<div class='item' data-index='2'></div>")
  581. $(".moduleItem.hasdiagnose.moduleItemTitBox").append(renderLongStr(name, longStr, "left"))
  582. $('.moduleItem.hasdiagnose').css("display", "block")
  583. $('.hasdiagnose .pushItemBox').on("click", function (e) {
  584. e.preventDefault()
  585. const name = $(this).attr('data-name');
  586. const i = $(this).attr('data-index');
  587. if ($(this).hasClass('disable')) {
  588. $.toast('toast3', '', 3000, '.hasdiagnose', i);
  589. $(".hasdiagnose .item").css("display", "none")
  590. $(this).siblings().removeClass('active');
  591. return
  592. }
  593. if ($(this).hasClass('active')) {
  594. $(this).removeClass('active');
  595. } else {
  596. $(this).addClass('active').siblings().removeClass('active');
  597. }
  598. const index = $(this).parent().parent().next().attr('data-i')
  599. const showList = $(".hasdiagnose .item").css("display")
  600. if (showList == "none" || index != i) {
  601. // $(".loading").show();
  602. $(".hasdiagnose .item").html('')
  603. $(".hasdiagnose .item").css("display", "none")
  604. $(this).parent().parent().next().css("display", "block")
  605. $(this).parent().parent().next().attr('data-i', i)
  606. renderpushByHasDisease(name, i, 2,e)
  607. } else {
  608. $(".hasdiagnose .item").css("display", "none")
  609. }
  610. });
  611. }
  612. function renderMayVitalPush(list, inx) {
  613. let num, state
  614. for (let i = 0; i < maydiagnoseList.length; i++) {
  615. const item = maydiagnoseList[i];
  616. if (item.code == 'mayvital') {
  617. num = item.number
  618. state = item.status
  619. }
  620. }
  621. if (list.length > 0 && state != 0) {
  622. moduleNum++
  623. let { shortStr, longStr } = renderItemWrapper(list, num, '体征')
  624. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='mayvital'></div>")
  625. $(".moduleItem .item[data-index=" + inx + "] .mayvital").append(shortStr)
  626. $(".moduleItem .item[data-index=" + inx + "] .mayvital").append(renderLongStr(titleConfigH["mayvitalPush"].name, longStr, titleConfigH["mayvitalPush"].location))
  627. $(".moduleItem .item[data-index=" + inx + "] .mayvital").css("display", "block")
  628. }
  629. }
  630. function renderHasVitalPush(list, inx) {
  631. let num, state
  632. for (let i = 0; i < hasdiagnoseList.length; i++) {
  633. const item = hasdiagnoseList[i];
  634. if (item.code == 'hasvital') {
  635. num = item.number
  636. state = item.status
  637. }
  638. }
  639. if (list.length > 0 && state != 0) {
  640. moduleNum++
  641. let { shortStr, longStr } = renderItemWrapper(list, num, '体征')
  642. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='hasvital'></div>")
  643. $(".moduleItem .item[data-index=" + inx + "] .hasvital").append(shortStr)
  644. $(".moduleItem .item[data-index=" + inx + "] .hasvital").append(renderLongStr(titleConfigH["mayvitalPush"].name, longStr, titleConfigH["mayvitalPush"].location))
  645. $(".moduleItem .item[data-index=" + inx + "] .hasvital").css("display", "block")
  646. }
  647. }
  648. function renderMaySymptomPush(list, inx) {
  649. let num, state
  650. for (let i = 0; i < maydiagnoseList.length; i++) {
  651. const item = maydiagnoseList[i];
  652. if (item.code == 'maysymptom') {
  653. num = item.number
  654. state = item.status
  655. }
  656. }
  657. if (list.length > 0 && state != 0) {
  658. let { shortStr, longStr } = renderItemWrapper(list, num, '症状')
  659. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='maysymptom'></div>")
  660. $(".moduleItem .item[data-index=" + inx + "] .maysymptom").append(shortStr)
  661. $(".moduleItem .item[data-index=" + inx + "] .maysymptom").append(renderLongStr(titleConfigH["symptomPush2"].name, longStr, titleConfigH["symptomPush2"].location))
  662. $(".moduleItem .item[data-index=" + inx + "] .maysymptom").css("display", "block")
  663. }
  664. }
  665. function renderHasSymptomPush(list, inx) {
  666. let num, state
  667. for (let i = 0; i < hasdiagnoseList.length; i++) {
  668. const item = hasdiagnoseList[i];
  669. if (item.code == 'hassymptom') {
  670. num = item.number
  671. state = item.status
  672. }
  673. }
  674. if (list.length > 0 && state != 0) {
  675. moduleNum++
  676. let { shortStr, longStr } = renderItemWrapper(list, num, '症状')
  677. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='hassymptom'></div>")
  678. $(".moduleItem .item[data-index=" + inx + "] .hassymptom").append(shortStr)
  679. $(".moduleItem .item[data-index=" + inx + "] .hassymptom").append(renderLongStr(titleConfigH["symptomPush2"].name, longStr, titleConfigH["symptomPush2"].location))
  680. $(".moduleItem .item[data-index=" + inx + "] .hassymptom").css("display", "block")
  681. }
  682. }
  683. function renderMayLisPush(list, inx) {
  684. let num, state
  685. for (let i = 0; i < maydiagnoseList.length; i++) {
  686. const item = maydiagnoseList[i];
  687. if (item.code == 'maylis') {
  688. num = item.number
  689. state = item.status
  690. }
  691. }
  692. if (list.length > 0 && state != 0) {
  693. moduleNum++
  694. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检验')
  695. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='maylis'></div>")
  696. $(".moduleItem .item[data-index=" + inx + "] .maylis").append(shortStr)
  697. $(".moduleItem .item[data-index=" + inx + "] .maylis").append(renderLongStr(titleConfigH["lisPush"].name, longStr, titleConfigH["lisPush"].location))
  698. $(".moduleItem .item[data-index=" + inx + "] .maylis").css("display", "block")
  699. }
  700. }
  701. function renderHasLisPush(list, inx) {
  702. let num, state
  703. for (let i = 0; i < hasdiagnoseList.length; i++) {
  704. const item = hasdiagnoseList[i];
  705. if (item.code == 'haslis') {
  706. num = item.number
  707. state = item.status
  708. }
  709. }
  710. if (list.length > 0 && state != 0) {
  711. moduleNum++
  712. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检验')
  713. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='haslis'></div>")
  714. $(".moduleItem .item[data-index=" + inx + "] .haslis").append(shortStr)
  715. $(".moduleItem .item[data-index=" + inx + "] .haslis").append(renderLongStr(titleConfigH["lisPush"].name, longStr, titleConfigH["lisPush"].location))
  716. $(".moduleItem .item[data-index=" + inx + "] .haslis").css("display", "block")
  717. }
  718. }
  719. function renderMayPacsPush(list, inx) {
  720. let num, state
  721. for (let i = 0; i < maydiagnoseList.length; i++) {
  722. const item = maydiagnoseList[i];
  723. if (item.code == 'maypacs') {
  724. num = item.number
  725. state = item.status
  726. }
  727. }
  728. if (list.length > 0 && state != 0) {
  729. moduleNum++
  730. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检查')
  731. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='maypacs'></div>")
  732. $(".moduleItem .item[data-index=" + inx + "] .maypacs").append(shortStr)
  733. $(".moduleItem .item[data-index=" + inx + "] .maypacs").append(renderLongStr(titleConfigH["pacsPush"].name, longStr, titleConfigH["pacsPush"].location))
  734. $(".moduleItem .item[data-index=" + inx + "] .maypacs").css("display", "block")
  735. }
  736. }
  737. function renderHasPacsPush(list, inx) {
  738. let num, state
  739. for (let i = 0; i < hasdiagnoseList.length; i++) {
  740. const item = hasdiagnoseList[i];
  741. if (item.code == 'haspacs') {
  742. num = item.number
  743. state = item.status
  744. }
  745. }
  746. if (list.length > 0 && state != 0) {
  747. moduleNum++
  748. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐检查')
  749. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='haspacs'></div>")
  750. $(".moduleItem .item[data-index=" + inx + "] .haspacs").append(shortStr)
  751. $(".moduleItem .item[data-index=" + inx + "] .haspacs").append(renderLongStr(titleConfigH["pacsPush"].name, longStr, titleConfigH["pacsPush"].location))
  752. $(".moduleItem .item[data-index=" + inx + "] .haspacs").css("display", "block")
  753. }
  754. }
  755. function renderMayScalePush(list, inx) {
  756. let num, state
  757. for (let i = 0; i < maydiagnoseList.length; i++) {
  758. const item = maydiagnoseList[i];
  759. if (item.code == 'mayevaluation') {
  760. num = item.number
  761. state = item.status
  762. }
  763. }
  764. if (list.length > 0 && state != 0) {
  765. moduleNum++
  766. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐量表')
  767. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='mayevaluation'></div>")
  768. $(".moduleItem .item[data-index=" + inx + "] .mayevaluation").append(shortStr)
  769. $(".moduleItem .item[data-index=" + inx + "] .mayevaluation").append(renderLongStr(titleConfigH["scalePush"].name, longStr, titleConfigH["scalePush"].location))
  770. $(".moduleItem .item[data-index=" + inx + "] .mayevaluation").css("display", "block")
  771. }
  772. }
  773. function renderHasScalePush(list, inx) {
  774. let num, state
  775. for (let i = 0; i < hasdiagnoseList.length; i++) {
  776. const item = hasdiagnoseList[i];
  777. if (item.code == 'hasevaluation') {
  778. num = item.number
  779. state = item.status
  780. }
  781. }
  782. if (list.length > 0 && state != 0) {
  783. moduleNum++
  784. let { shortStr, longStr } = renderItemWrapper(list, num, '推荐量表')
  785. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='hasevaluation'></div>")
  786. $(".moduleItem .item[data-index=" + inx + "] .hasevaluation").append(shortStr)
  787. $(".moduleItem .item[data-index=" + inx + "] .hasevaluation").append(renderLongStr(titleConfigH["scalePush"].name, longStr, titleConfigH["scalePush"].location))
  788. $(".moduleItem .item[data-index=" + inx + "] .hasevaluation").css("display", "block")
  789. }
  790. }
  791. function renderMayDisPush(list, inx) {
  792. let num, state
  793. for (let i = 0; i < maydiagnoseList.length; i++) {
  794. const item = maydiagnoseList[i];
  795. if (item.code == 'mayantidias') {
  796. num = item.number
  797. state = item.status
  798. }
  799. }
  800. if (list.length > 0 && state != 0) {
  801. moduleNum++
  802. let { shortStr, longStr } = renderItemWrapper(list, num, '鉴别诊断')
  803. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='mayantidias'></div>")
  804. $(".moduleItem .item[data-index=" + inx + "] .mayantidias").append(shortStr)
  805. $(".moduleItem .item[data-index=" + inx + "] .mayantidias").append(renderLongStr(titleConfigH["diasPush"].name, longStr, titleConfigH["diasPush"].location))
  806. $(".moduleItem .item[data-index=" + inx + "] .mayantidias").css("display", "block")
  807. }
  808. }
  809. function renderHasDisPush(list, inx) {
  810. let num, state
  811. for (let i = 0; i < hasdiagnoseList.length; i++) {
  812. const item = hasdiagnoseList[i];
  813. if (item.code == 'hasantidias') {
  814. num = item.number
  815. state = item.status
  816. }
  817. }
  818. if (list.length > 0 && state != 0) {
  819. moduleNum++
  820. let { shortStr, longStr } = renderItemWrapper(list, num, '鉴别诊断')
  821. $(".moduleItem .item[data-index=" + inx + "]").append("<div class='hasantidias'></div>")
  822. $(".moduleItem .item[data-index=" + inx + "] .hasantidias").append(shortStr)
  823. $(".moduleItem .item[data-index=" + inx + "] .hasantidias").append(renderLongStr(titleConfigH["diasPush"].name, longStr, titleConfigH["diasPush"].location))
  824. $(".moduleItem .item[data-index=" + inx + "] .hasantidias").css("display", "block")
  825. }
  826. }
  827. function renderMayPush(treatPush, medicinesPush, operationsPush, nursePush, inx) {
  828. let generalstate, medicinestate, operationstate, nursestate, isShow = false
  829. for (let i = 0; i < maydiagnoseList.length; i++) {
  830. const item = maydiagnoseList[i];
  831. if (item.code == 'maygeneral') {
  832. generalstate = item.status
  833. } else if (item.code == 'maymedicine') {
  834. medicinestate = item.status
  835. } else if (item.code == 'mayoperation') {
  836. operationstate = item.status
  837. } else if (item.code == 'maynurse') {
  838. nursestate = item.status
  839. }
  840. }
  841. for (let i = 0; i < treatPush.length; i++) {
  842. const it = treatPush[i];
  843. if (it.generaTreat) {
  844. isShow = true
  845. }
  846. }
  847. if ((treatPush.length > 0 && isShow && generalstate != 0) || (medicinesPush.length > 0 && medicinestate != 0) || (operationsPush.length > 0 && operationstate != 0) || (nursePush.length > 0 && nursestate != 0)) {
  848. $(".maydiagnose .item[data-index=" + inx + "]").append("<div class='centerBox'></div>")
  849. let str = `<ul>
  850. ${treatPush.length > 0 && isShow && generalstate != 0 ? `<li class="general" data-index="0">一般治疗</li>` : ''}
  851. ${medicinesPush.length > 0 && medicinestate != 0 ? `<li class="medicine" data-index="1">推荐用药</li>` : ''}
  852. ${operationsPush.length > 0 && operationstate != 0 ? `<li class="operation" data-index="2">推荐手术/操作</li>` : ''}
  853. ${nursePush.length > 0 && nursestate != 0 ? `<li class="nurse" data-index="3">推荐护理</li>` : ''}
  854. </ul>
  855. <div class="centerBoxItem">
  856. ${treatPush.length > 0 && isShow && generalstate != 0 ? `<div class="checkBox generalItem maygeneral" data-index="0"></div>` : ''}
  857. ${medicinesPush.length > 0 && medicinestate != 0 ? `<div class="checkBox medicineItem maymedicine" data-index="1"></div>` : ''}
  858. ${operationsPush.length > 0 && operationstate != 0 ? `<div class="checkBox operationItem mayoperation" data-index="2"></div>` : ''}
  859. ${nursePush.length > 0 && nursestate != 0 ? `<div class="checkBox nurseItem maynurse" data-index="3"></div>` : ''}
  860. </div>`
  861. $(".maydiagnose .item[data-index=" + inx + "] .centerBox").append(str)
  862. }
  863. if ($(".maydiagnose .centerBox ul li").length == 0) {
  864. $(".maydiagnose .centerBox").hide()
  865. } else {
  866. $(".maydiagnose .centerBox").show()
  867. }
  868. renderMayTreatPush(treatPush, inx)
  869. renderMayMedicinesPush(medicinesPush, inx)
  870. renderMayOperationsPush(operationsPush, inx)
  871. renderMayNursePush(nursePush, inx)
  872. $(".maydiagnose .item[data-index=" + inx + "] .centerBox ul li").click(function () {
  873. var i = $(this).attr('data-index');
  874. if ($(this).hasClass('actives')) {
  875. $(this).removeClass('actives');
  876. $(".maydiagnose .item[data-index=" + inx + "] .checkBox[data-index=" + i + "]").removeClass('onshow');
  877. } else {
  878. $(this).addClass('actives').siblings().removeClass('actives');
  879. $(".maydiagnose .item[data-index=" + inx + "] .checkBox[data-index=" + i + "]").addClass('onshow').siblings().removeClass('onshow');
  880. }
  881. });
  882. }
  883. function renderHasPush(treatPush, medicinesPush, operationsPush, nursePush, inx) {
  884. let generalstate, medicinestate, operationstate, nursestate, isShow = false
  885. for (let i = 0; i < hasdiagnoseList.length; i++) {
  886. const item = hasdiagnoseList[i];
  887. if (item.code == 'hasgeneral') {
  888. generalstate = item.status
  889. } else if (item.code == 'hasmedicine') {
  890. medicinestate = item.status
  891. } else if (item.code == 'hasoperation') {
  892. operationstate = item.status
  893. } else if (item.code == 'hasnurse') {
  894. nursestate = item.status
  895. }
  896. }
  897. for (let i = 0; i < treatPush.length; i++) {
  898. const it = treatPush[i];
  899. if (it.generaTreat) {
  900. isShow = true
  901. }
  902. }
  903. if ((treatPush.length > 0 && isShow && generalstate != 0) || (medicinesPush.length > 0 && medicinestate != 0) || (operationsPush.length > 0 && operationstate != 0) || (nursePush.length > 0 && nursestate != 0)) {
  904. $(".hasdiagnose .item[data-index=" + inx + "]").append("<div class='centerBox'></div>")
  905. let str = `<ul>
  906. ${treatPush.length > 0 && isShow && generalstate != 0 ? `<li class="general" data-index="0">一般治疗</li>` : ''}
  907. ${medicinesPush.length > 0 && medicinestate != 0 ? `<li class="medicine" data-index="1">推荐用药</li>` : ''}
  908. ${operationsPush.length > 0 && operationstate != 0 ? `<li class="operation" data-index="2">推荐手术/操作</li>` : ''}
  909. ${nursePush.length > 0 && nursestate != 0 ? `<li class="nurse" data-index="3">推荐护理</li>` : ''}
  910. </ul>
  911. <div class="centerBoxItem">
  912. ${treatPush.length > 0 && isShow && generalstate != 0 ? `<div class="checkBox generalItem hasgeneral" data-index="0"></div>` : ''}
  913. ${medicinesPush.length > 0 && medicinestate != 0 ? `<div class="checkBox medicineItem hasmedicine" data-index="1"></div>` : ''}
  914. ${operationsPush.length > 0 && operationstate != 0 ? `<div class="checkBox operationItem hasoperation" data-index="2"></div>` : ''}
  915. ${nursePush.length > 0 && nursestate != 0 ? `<div class="checkBox nurseItem hasnurse" data-index="3"></div>` : ''}
  916. </div>`
  917. $(".hasdiagnose .item[data-index=" + inx + "] .centerBox").append(str)
  918. }
  919. if ($(".hasdiagnose .centerBox ul li").length == 0) {
  920. $(".hasdiagnose .centerBox").hide()
  921. } else {
  922. $(".hasdiagnose .centerBox").show()
  923. }
  924. renderHasTreatPush(treatPush, inx)
  925. renderHasMedicinesPush(medicinesPush, inx)
  926. renderHasOperationsPush(operationsPush, inx)
  927. renderHasNursePush(nursePush, inx)
  928. $(".hasdiagnose .item[data-index=" + inx + "] .centerBox ul li").click(function () {
  929. var i = $(this).attr('data-index');
  930. if ($(this).hasClass('actives')) {
  931. $(this).removeClass('actives');
  932. $(".hasdiagnose .item[data-index=" + inx + "] .checkBox[data-index=" + i + "]").removeClass('onshow');
  933. } else {
  934. $(this).addClass('actives').siblings().removeClass('actives');
  935. $(".hasdiagnose .item[data-index=" + inx + "] .checkBox[data-index=" + i + "]").addClass('onshow').siblings().removeClass('onshow');
  936. }
  937. });
  938. }
  939. function renderMayTreatPush(list, inx) {
  940. let num, state
  941. for (let i = 0; i < maydiagnoseList.length; i++) {
  942. const item = maydiagnoseList[i];
  943. if (item.code == 'maygeneral') {
  944. num = item.number
  945. state = item.status
  946. }
  947. }
  948. if (list.length > 0 && state != 0) {
  949. let str = ''
  950. for (let i = 0; i < list.length; i++) {
  951. const item = list[i];
  952. str = `${item.generaTreat || ''}`
  953. }
  954. $(".moduleItem .item[data-index=" + inx + "] .maygeneral").append(str)
  955. }
  956. }
  957. function renderHasTreatPush(list, inx) {
  958. let num, state
  959. for (let i = 0; i < hasdiagnoseList.length; i++) {
  960. const item = hasdiagnoseList[i];
  961. if (item.code == 'hasgeneral') {
  962. num = item.number
  963. state = item.status
  964. }
  965. }
  966. let str = ''
  967. if (list.length > 0 && state != 0) {
  968. for (let i = 0; i < list.length; i++) {
  969. const item = list[i];
  970. str = `${item.generaTreat || ''}`
  971. }
  972. $(".moduleItem .item[data-index=" + inx + "] .hasgeneral").append(str)
  973. }
  974. }
  975. function renderMayMedicinesPush(list, inx) {
  976. if (list.length > 0) {
  977. moduleNum++
  978. let { shortStr, longStr } = renderItemWrapper(list, 10)
  979. $(".moduleItem .item[data-index=" + inx + "] .maymedicine").append(shortStr)
  980. $(".moduleItem .item[data-index=" + inx + "] .maymedicine").append(renderLongStr(titleConfigH["drugPush"].name, longStr, titleConfigH["drugPush"].location))
  981. }
  982. }
  983. function renderHasMedicinesPush(list, inx) {
  984. if (list.length > 0) {
  985. moduleNum++
  986. let { shortStr, longStr } = renderItemWrapper(list, 10)
  987. $(".moduleItem .item[data-index=" + inx + "] .hasmedicine").append(shortStr)
  988. $(".moduleItem .item[data-index=" + inx + "] .hasmedicine").append(renderLongStr(titleConfigH["drugPush"].name, longStr, titleConfigH["drugPush"].location))
  989. }
  990. }
  991. function renderMayOperationsPush(list, inx) {
  992. console.log(list, 112);
  993. if (list.length > 0) {
  994. moduleNum++
  995. let { shortStr, longStr } = renderItemWrapper(list, 10)
  996. $(".moduleItem .item[data-index=" + inx + "] .mayoperation").append(shortStr)
  997. $(".moduleItem .item[data-index=" + inx + "] .mayoperation").append(renderLongStr(titleConfigH["operationPush"].name, longStr, titleConfigH["operationPush"].location))
  998. }
  999. }
  1000. function renderHasOperationsPush(list, inx) {
  1001. if (list.length > 0) {
  1002. moduleNum++
  1003. let { shortStr, longStr } = renderItemWrapper(list, 10)
  1004. $(".moduleItem .item[data-index=" + inx + "] .hasoperation").append(shortStr)
  1005. $(".moduleItem .item[data-index=" + inx + "] .hasoperation").append(renderLongStr(titleConfigH["operationPush"].name, longStr, titleConfigH["operationPush"].location))
  1006. }
  1007. }
  1008. function renderMayNursePush(list, inx) {
  1009. if (list.length > 0) {
  1010. moduleNum++
  1011. let { shortStr, longStr } = renderItemWrapper(list, 10)
  1012. $(".moduleItem .item[data-index=" + inx + "] .maynurse").append(shortStr)
  1013. $(".moduleItem .item[data-index=" + inx + "] .maynurse").append(renderLongStr(titleConfigH["nursePush"].name, longStr, titleConfigH["nursePush"].location))
  1014. }
  1015. }
  1016. function renderHasNursePush(list, inx) {
  1017. if (list.length > 0) {
  1018. moduleNum++
  1019. let { shortStr, longStr } = renderItemWrapper(list, 10)
  1020. $(".moduleItem .item[data-index=" + inx + "] .hasnurse").append(shortStr)
  1021. $(".moduleItem .item[data-index=" + inx + "] .hasnurse").append(renderLongStr(titleConfigH["nursePush"].name, longStr, titleConfigH["nursePush"].location))
  1022. }
  1023. }
  1024. function renderLis(list, showNum) {
  1025. if (list.length > 0 && $(".moduleItem.lis").length > 0) {
  1026. moduleNum++
  1027. $('.moduleItem.lis .moduleItemTitBox').append(titleStr("lisPush"))
  1028. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1029. $('.moduleItem.lis').append(shortStr)
  1030. $('.moduleItem.lis').append(renderLongStr(titleConfigH["lisPush"].name, longStr, titleConfigH["lisPush"].location))
  1031. $('.moduleItem.lis').css("display", "block")
  1032. }
  1033. }
  1034. function renderScale(list, showNum) {
  1035. if (list.length > 0 && $(".moduleItem.evaluation").length > 0) {
  1036. moduleNum++
  1037. $('.moduleItem.evaluation .moduleItemTitBox').append(titleStr("scalePush"))
  1038. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1039. $('.moduleItem.evaluation').append(shortStr)
  1040. $('.moduleItem.evaluation').append(renderLongStr(titleConfigH["scalePush"].name, longStr, titleConfigH["scalePush"].location))
  1041. $('.moduleItem.evaluation').css("display", "block")
  1042. // $('.moduleItem.evaluation').children(".shortBox").children(".pushItemBox").children(".pushItemName").addClass("evaluationtitle")
  1043. // $('.moduleItem.evaluation').children(".longStrBox").children(".longBox").children(".pushItemBox").children(".pushItemName").addClass("evaluationtitle")
  1044. }
  1045. }
  1046. function renderNurse(list, showNum) {
  1047. if (list.length > 0 && $(".moduleItem.nurse").length > 0) {
  1048. moduleNum++
  1049. $('.moduleItem.nurse .moduleItemTitBox').append(titleStr("nursePush"))
  1050. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1051. $(".moduleItem.nurse").append(shortStr)
  1052. $(".moduleItem.nurse").append(renderLongStr(titleConfigH["nursePush"].name, longStr, titleConfigH["nursePush"].location))
  1053. $(".moduleItem.nurse").css("display", "block")
  1054. }
  1055. }
  1056. function renderPacs(list, showNum) {
  1057. if (list.length > 0 && $(".moduleItem.pacs").length > 0) {
  1058. moduleNum++
  1059. $('.moduleItem.pacs .moduleItemTitBox').append(titleStr("pacsPush"))
  1060. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1061. $(".moduleItem.pacs").append(shortStr)
  1062. $(".moduleItem.pacs").append(renderLongStr(titleConfigH["pacsPush"].name, longStr, titleConfigH["pacsPush"].location))
  1063. $('.moduleItem.pacs').css("display", "block")
  1064. }
  1065. }
  1066. function renderSymptomPush(list, showNum) {
  1067. if (list.length > 0 && $(".moduleItem.symptom").length > 0) {
  1068. moduleNum++
  1069. $('.moduleItem.symptom .moduleItemTitBox').append(titleStr("symptomPush"))
  1070. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1071. $(".moduleItem.symptom").append(shortStr)
  1072. $(".moduleItem.symptom").append(renderLongStr(titleConfigH["symptomPush"].name, longStr, titleConfigH["symptomPush"].location))
  1073. $('.moduleItem.symptom').css("display", "block")
  1074. }
  1075. }
  1076. function renderMedicinesPush(list, showNum) {
  1077. if (list.length > 0 && $(".moduleItem.medicine").length > 0) {
  1078. moduleNum++
  1079. $('.moduleItem.medicine .moduleItemTitBox').append(titleStr("drugPush"))
  1080. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1081. $(".moduleItem.medicine").append(shortStr)
  1082. $(".moduleItem.medicine").append(renderLongStr(titleConfigH["drugPush"].name, longStr, titleConfigH["drugPush"].location))
  1083. $(".moduleItem.medicine").css("display", "block")
  1084. }
  1085. }
  1086. function renderOperationPush(list, showNum) {
  1087. if (list.length > 0 && $(".moduleItem.operation").length > 0) {
  1088. moduleNum++
  1089. $('.moduleItem.operation .moduleItemTitBox').append(titleStr("operationPush"))
  1090. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1091. $(".moduleItem.operation").append(shortStr)
  1092. $(".moduleItem.operation").append(renderLongStr(titleConfigH["operationPush"].name, longStr, titleConfigH["operationPush"].location))
  1093. $(".moduleItem.operation").css("display", "block")
  1094. }
  1095. }
  1096. function renderDisName() {
  1097. $(".disName").append(`${treatDisName || ''}`)
  1098. }
  1099. function rendergeneraTreatPush(list) {
  1100. if (list && list.length > 0 && $(".moduleItem.general").length > 0) {
  1101. moduleNum++
  1102. $('.moduleItem.general .moduleItemTitBox').append(titleStr("generaTreatPush"))
  1103. let str = `<div class="generalTreatInfo clearfix isOverFlow">${list}</div>`
  1104. $(".moduleItem.general").append(str)
  1105. setTimeout(function () {
  1106. let generaTreatHei = $(".moduleItem .generalTreatInfo")[0].scrollHeight
  1107. if (generaTreatHei > 60) {
  1108. $(".moduleItem .generalTreatInfo").append(`<span class="showMoreGeneralTreat">更多</span>`)
  1109. bindGeneralSlide()
  1110. }
  1111. })
  1112. console.log($(".generalTreatInfo").text())
  1113. $(".moduleItem.general").css("display", "block")
  1114. }
  1115. }
  1116. function renderCheckup(list, showNum) {
  1117. if (list.length > 0 && $(".moduleItem.vital").length > 0) {
  1118. moduleNum++
  1119. $(".moduleItem.vital .moduleItemTitBox").append(titleStr("checkupPush"))
  1120. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1121. $(".moduleItem.vital").append(shortStr)
  1122. $(".moduleItem.vital").append(renderLongStr(titleConfigH["checkupPush"].name, longStr, titleConfigH["checkupPush"].location))
  1123. $('.moduleItem.vital').css("display", "block")
  1124. }
  1125. }
  1126. function renderDiag(diagPush) {
  1127. let possibleDiagPush = diagPush["可能诊断"] || []
  1128. let firstDiagPush = diagPush["既往诊断"] || []
  1129. let identifyDiagPush = diagPush["鉴别诊断"] || []
  1130. let warningDiagPush = diagPush["警惕"] || []
  1131. let number = $('.moduleItem.diag').attr("data-num") || 5
  1132. let warnNumber = $('.moduleItem.warning').attr("data-num") || 5
  1133. $('.moduleItem.diag .moduleItemTitBox').append(titleStr("diagPush"))
  1134. renderDiagItem(possibleDiagPush, "可能诊断", number)
  1135. renderDiagItem(firstDiagPush, "既往诊断", number)
  1136. renderDiagItem(identifyDiagPush, "鉴别诊断", number)
  1137. renderWarningDiag(warningDiagPush, "警惕", 1000)
  1138. moreInfo()
  1139. }
  1140. function renderDiagItem(list, name, number) {
  1141. if (list.length === 0) {
  1142. return
  1143. }
  1144. let titleStr = `<span class="moduleBoxName">${name}</span>`
  1145. let { shortStr, longStr } = renderItemWrapper(list, number)
  1146. let boxStr = `<div class="moduleBox">
  1147. ${titleStr}
  1148. ${shortStr}
  1149. </div>`
  1150. $(".diag").append(boxStr)
  1151. $(".diag").append(renderLongStr(name, longStr, "left"))
  1152. $('.moduleItem.diag').css("display", "block")
  1153. }
  1154. function renderWarningDiag(list, name, showNum) {
  1155. if (list.length > 0 && $(".moduleItem.warning").length > 0) {
  1156. moduleNum++
  1157. $('.moduleItem.warning .moduleItemTitBox').append(titleStr("vigilancePush"))
  1158. let { shortStr, longStr } = renderItemWrapper(list, showNum)
  1159. $('.moduleItem.warning').append(shortStr)
  1160. $('.moduleItem.warning').css("display", "block")
  1161. }
  1162. }
  1163. function renderwriteStandardPage(list) {
  1164. if (list.length > 0 && $(".moduleItem.casewriting").length > 0) {
  1165. moduleNum++
  1166. $(".moduleItem.casewriting .moduleItemTitBox").append(titleStr("casewritingPush"))
  1167. let str = ``
  1168. for (let i = 0; i < list.length; i++) {
  1169. str += `<p>${list[i]}</p>`
  1170. }
  1171. $(".moduleItem.casewriting").append(str)
  1172. $('.moduleItem.casewriting').css("display", "block")
  1173. }
  1174. empty()
  1175. }
  1176. function renderPushWarning() {
  1177. return getPusgWarning().then(res => {
  1178. hasCompleteTnterface++
  1179. if (res.data.code == '0') {
  1180. const result = res.data.data;
  1181. let billMsgList = result.billMsgList || [] //开单合理性提醒
  1182. let highRiskList = result.highRiskList || [] //高危药品、手术
  1183. let criticalValList = result.criticalValList || [] //危急值提醒
  1184. let noteList = result.noteList || [] //检查内容注意事项
  1185. let dubugStr = result.dubugStr || [] //注意调试信息
  1186. let otherList = result.otherList || [] //其他提醒
  1187. let nurseList = result.nurseList || [] //推荐护理
  1188. localStorage.setItem('nurseList', JSON.stringify(nurseList))
  1189. renderBillingPush(billMsgList, '开单合理性', 'rationali')
  1190. renderBillingPush(highRiskList, '高风险提示', 'highrisk')
  1191. renderBillingPush(criticalValList, '危急值提醒', 'crivalue')
  1192. renderBillingPush(noteList, '检查注意事项')
  1193. renderBillingPush(otherList, '其他提醒', 'otherremind')
  1194. renderBillingNursePush(nurseList, '推荐护理', 'nurse')
  1195. const codes = ($(".rationali.tips").length ? 'rationali,' : "") + ($(".highrisk.tips").length ? 'highrisk,' : "") + ($(".crivalue.tips").length ? 'crivalue,' : "") + ($(".otherremind.tips").length ? 'otherremind' : "");
  1196. $(".moduleItem.tips").wrapAll("<div class='tips-cont' codes=" + codes + "></div>");
  1197. $('.tips-cont').append(titleStr('warning'))
  1198. moreInfo()
  1199. const hasTipsNum = $(".moduleItem.tips").length;
  1200. if (hasTipsNum) {
  1201. let tipNum = $(".tips-cont .billingPushItem").length;
  1202. if (tipNum > 3) {
  1203. $(".tips-cont").append(`<span class="showMoreNewPage">更多</span>`)
  1204. tipsMsg = result
  1205. showMoreNewPage()
  1206. }
  1207. }
  1208. // renderBillingPush(dubugStr,'注意调试信息')
  1209. }
  1210. if (hasCompleteTnterface === allInterface) {
  1211. $('.loading').css("display", "none")
  1212. /*if (moduleNum === 0) {//console.log(999)
  1213. empty()
  1214. }*/
  1215. }
  1216. empty()
  1217. }).catch(() => {
  1218. $(".loading").hide()
  1219. })
  1220. }
  1221. function renderBillingPush(list, name, code) {
  1222. if (list.length === 0) {
  1223. return
  1224. }
  1225. let str = ``
  1226. for (let i = 0; i < list.length; i++) {
  1227. str += `<div class="billingPushItem">${list[i].msg}</div>`
  1228. }
  1229. let titleStr = `<span class="moduleBoxName">${name}</span>`
  1230. let boxStr = `<div class="moduleBox">
  1231. ${titleStr}
  1232. ${str}
  1233. </div>`
  1234. $("." + code).append(boxStr)
  1235. $('.moduleItem.' + code).addClass("tips").attr("code", code).css("display", "block")
  1236. }
  1237. function renderNursePush(list) {
  1238. let str = ``
  1239. for (let i = 0; i < list.length; i++) {
  1240. const item = list[i];
  1241. str += `<span class="nurseDetail" data-name="${item}">${item}<img class="nurseImg" src="${go}"></span>`
  1242. }
  1243. return str
  1244. }
  1245. function renderBillingNursePush(list) {
  1246. if (list.length > 0 && $(".moduleItem.nurse").length > 0) {
  1247. moduleNum++
  1248. $('.moduleItem.nurse .moduleItemTitBox').append(titleStr("nursePush"))
  1249. let str = ``
  1250. for (let i = 0; i < list.length; i++) {
  1251. str += `<div class="billingPushItem">${list[i].msg}${renderNursePush(list[i].staticList)}</div>`
  1252. }
  1253. let boxStr = `<div class="moduleBox">
  1254. ${str}
  1255. </div>`
  1256. $(".moduleItem.nurse").append(boxStr)
  1257. $(".moduleItem.nurse").css("display", "block")
  1258. let tipNum = $(".nurse .moduleBox").height();
  1259. console.log(tipNum);
  1260. if (tipNum > 63) {
  1261. $(".nurse").append(`<span class="showMoreNewPage">更多</span>`)
  1262. showMoreNewNurse()
  1263. }
  1264. $('.nurseDetail').off("click").click(function () {
  1265. const name = $(this).attr('data-name')
  1266. const type = 9
  1267. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&page=1&mrId=${encodeURIComponent(mrId)}&gauge=gauge`)
  1268. })
  1269. }
  1270. }
  1271. function showMoreNewNurse() {
  1272. $(".showMoreNewPage").on("click", function () {
  1273. openNewWin(`nurseAlert.html?mrId=${mrId}&hospitalId=${hospitalIdUrl}`);
  1274. })
  1275. }
  1276. function renderLongStr(name, longStr, location) {
  1277. if (!longStr) {
  1278. return
  1279. }
  1280. let str = `
  1281. <div class="longStrBox" data-location="${location}">
  1282. <span class="longStrBoxTitle">${name}:</span>
  1283. ${longStr}
  1284. </div>
  1285. `
  1286. return str
  1287. }
  1288. function renderItemWrapper(list, showNum, name, type) {
  1289. let showNum1 = showNum || 5
  1290. let shortStr = '', longStr = ''
  1291. for (let i = 0; i < list.length; i++) {
  1292. if (i <= showNum1 - 1) {
  1293. shortStr += type == 1 || type == 2 ? renderPushItem2(list[i], i) : renderPushItem(list[i], i)
  1294. }
  1295. longStr += type || type == 2 ? renderPushItem2(list[i], i) : renderPushItem(list[i], i)
  1296. }
  1297. if (showNum1 >= list.length) {
  1298. return {
  1299. shortStr: `<div class="shortBox"><span>${name ? name + ':' : ''}</span>${shortStr}</div>`,
  1300. longStr: ''
  1301. }
  1302. } else {
  1303. shortStr += `<span class="showMore"> <img class="iconArrowImg" src="${showImg}"></span>`
  1304. longStr += `<span class="showLess"><img class="iconArrowImg" src="${collapseImg}"></span>`
  1305. return {
  1306. shortStr: `<div class="shortBox clearfix"><span>${name ? name + ':' : ''}</span>${shortStr}</div>`,
  1307. longStr: `<div class="longBox clearfix"<span></span>${longStr}</div>`
  1308. }
  1309. }
  1310. }
  1311. function renderPushItem(item, i) {
  1312. str = `<span class="pushItemBox" data-name="${item.name}" data-type="${item.type}" data-index="${i}">`
  1313. str += `${item.hasScale == "0" ? `<span class="pushItemName">${item.type == 8 ? ('【' + item.name + '】') : item.name}</span>` : item.hasScale == "1" ? `<span class="pushItemName evaluationtitle">${item.type == 8 ? ('【' + item.name + '】') : item.name}</span>` : `<span class="pushItemName">${item.type == 8 ? ('【' + item.name + '】') : item.name}</span>`}`
  1314. str += `${item.hasInfo == "1" ? `<img class="infoImg" src="${infoImg}">` : ""}`
  1315. str += '</span >'
  1316. return str
  1317. }
  1318. function renderPushItem2(item, i) {
  1319. str = `<span class="pushItemBox" data-name="${item.name}" data-type="${item.type}" data-index="${i}">`
  1320. str += `${item.hasScale == "0" ? `<span class="pushItemName" style="word-break:break-all" title="${item.name}">${item.type == 8 ? ('【' + item.name + '】') : item.name}</span>` : item.hasScale == "1" ? `<span class="pushItemName evaluationtitle" title="${item.name}">${item.type == 8 ? ('【' + item.name + '】') : item.name}</span>` : `<span class="pushItemName" title="${item.name}">${item.type == 8 ? ('【' + item.name + '】') : item.name}</span>`}`
  1321. str += `${item.hasInfo == "1" ? `<img class="infoImg" src="${infoImg}">` : ""}`
  1322. str += '</span >'
  1323. return str
  1324. }
  1325. function bindOpenInfo() {
  1326. $(".infoImg").on("mouseenter", function () {
  1327. $(this).attr("src", infoImgOn)
  1328. }).on("mouseleave", function () {
  1329. $(this).attr("src", infoImg)
  1330. })
  1331. }
  1332. function titleStr(type) {
  1333. let titleStr = ''
  1334. titleStr += `<div class="moduleTitle"><img class="titleIcon" src=${titleConfigH[type].icon}>${titleConfigH[type].name}:</div>`
  1335. return titleStr
  1336. }
  1337. function bindSlide() {
  1338. $(".showMore").off("click").on("click", function () {
  1339. const longBox = $(this).parent().next().length ? $(this).parent().next() : $(this).parent().parent().next();
  1340. $(".longStrBox").css("display", "none")
  1341. longBox.css("display", "block")
  1342. let location = longBox.attr("data-location")
  1343. let scrollTop = getLongTop(location)
  1344. const n = Number(scrollTop) - 2 > -1 ? Number(scrollTop) - 2 : 0;
  1345. longBox.css("top", n + "px")
  1346. })
  1347. $(".showLess").off("click").on("click", function () {
  1348. $(this).parent().parent().css("display", "none")
  1349. })
  1350. addScrollEvent()
  1351. }
  1352. function showMoreNewPage() {
  1353. const codes = $(".tips-cont").attr("codes");
  1354. $(".showMoreNewPage").on("click", function () {
  1355. // openNewWin(`smartAlert.html?billMsgList=${encodeURIComponent(billMsgList)}&highRiskList=${encodeURIComponent(highRiskList)}&criticalValList=${encodeURIComponent(criticalValList)}&noteList=${encodeURIComponent(noteList)}`)
  1356. openNewWin(`smartAlert.html?mrId=${mrId}&hospitalId=${hospitalIdUrl}&codes=` + codes);
  1357. })
  1358. }
  1359. function showMoreCaseWrite() {
  1360. $(".showMoreCaseWrite").on("click", function () {
  1361. // openNewWin(`smartAlert.html?billMsgList=${encodeURIComponent(billMsgList)}&highRiskList=${encodeURIComponent(highRiskList)}&criticalValList=${encodeURIComponent(criticalValList)}&noteList=${encodeURIComponent(noteList)}`)
  1362. openNewWin(`caseWriteStandard.html?caseWriteStandradList=${encodeURIComponent(JSON.stringify(caseWriteStandradList))}`)
  1363. })
  1364. }
  1365. function bindGeneralSlide() {
  1366. $(".showMoreGeneralTreat").on("click", function () {
  1367. openNewWin(`generalTreat.html?disName=${treatDisName}&name=${treatUniqueName}`)
  1368. })
  1369. }
  1370. /*function setWidth() {
  1371. let winWidth = $(".bodyWrap").css("width")
  1372. $(".contentBox").css("width", winWidth)
  1373. }*/
  1374. //医学知识搜索
  1375. searchMedical()
  1376. function searchMedical() {
  1377. $(".medicalKonwledgeWrap .search").on("click", function () {
  1378. openNewWin(`homeStatic.html?mrId=${mrId}&hospitalId=${hospitalIdUrl}&planCode=${planCode}`)
  1379. })
  1380. }
  1381. function moreInfo() {
  1382. $('.infoImg').off("click").click(function () {
  1383. const name = $(this).parent().attr('data-name')
  1384. const type = $(this).parent().attr('data-type')
  1385. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}`)
  1386. })
  1387. $('.evaluationtitle').off("click").click(function () {
  1388. const name = $(this).parent().attr('data-name')
  1389. const type = $(this).parent().attr('data-type')
  1390. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}&page=1&gauge=gauge`)
  1391. })
  1392. }
  1393. function pushItemName() {
  1394. $('.pushItemName').off("click").click(function () {
  1395. console.log(11)
  1396. const name = $(this).parent().attr('data-name')
  1397. const type = $(this).parent().attr('data-type')
  1398. console.log(name)
  1399. openNewWin(`staticInfo.html?type=${encodeURIComponent(type)}&position=0&name=${encodeURIComponent(name)}`)
  1400. })
  1401. }
  1402. function getVersion() {
  1403. return post(config.getVersion, 'confArr').then((res) => {
  1404. const data = res.data.data;
  1405. const ver = localStorage.getItem('versionTime');
  1406. const time = data.refreshTime;
  1407. if (!ver || (ver !== time + "=new")) { //判断版本是否更新
  1408. $(".versionWrapper").append('<span class="versionNew"></span>');
  1409. localStorage.setItem('versionTime', time + "=new"); //保存版本更新时间
  1410. } else {
  1411. $(".versionNew").remove();
  1412. }
  1413. })
  1414. }
  1415. function getLongTop(type) {
  1416. let scrollTop = 0
  1417. if (type === "left") {
  1418. scrollTop = $(".leftWrapper").scrollTop() || 0
  1419. } else if (type === "right") {
  1420. scrollTop = $(".rightWrapper").scrollTop() || 0
  1421. }
  1422. return scrollTop
  1423. }
  1424. function addScrollEvent() {
  1425. $(`.leftWrapper`).off("scroll").scroll(throttle(function () {
  1426. if ($(".leftWrapper .longStrBox:visible").length) {
  1427. const n = Number(getLongTop("left")) - 10 > -1 ? (Number(getLongTop("left")) - 10) : 0;
  1428. $(".leftWrapper .longStrBox:visible").css("top", Number(getLongTop("left")) - 2 + "px")
  1429. }
  1430. }, 100));
  1431. $(`.rightWrapper`).off("scroll").scroll(throttle(function () {
  1432. if ($(".rightWrapper .longStrBox:visible").css("display") === "block") {
  1433. const n = Number(getLongTop("right")) > -1 ? (Number(getLongTop("right"))) : 0;
  1434. $(".rightWrapper .longStrBox:visible").css("top", n + "px")
  1435. }
  1436. }, 100));
  1437. }
  1438. $(function () {//隐藏logo
  1439. if (getUrlArgObject("hideLg")) {
  1440. $(".versionTop .logoTxt").hide();
  1441. }
  1442. getVersion()
  1443. $(".versionTop").on("click", function () {
  1444. openNewWin("disclaimer.html")
  1445. });
  1446. $(".versionBottom").on("click", function () {
  1447. const ver = localStorage.getItem('versionTime');
  1448. $(".versionBottom").removeClass('new-icon');
  1449. localStorage.setItem('versionTime', ver.replace("=new", ""));
  1450. openNewWin("version.html");
  1451. });
  1452. })
  1453. // function empty(){
  1454. // $(".responsibility").css("display","none")
  1455. // $('.recommendWrap .empty').css("display","block")
  1456. // }