clinic.js 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036
  1. //@ sourceURL=clinic.js
  2. //判断病人列表是否在加载中,防止重复加载
  3. var msg_list_loading = false;
  4. //挂号卡片列表页面下标
  5. var pageIndex = 0;
  6. var nthTabs=null;
  7. $(function () {
  8. // nthTabs = $("#ypListTables").nthTabs();
  9. //
  10. // nthTabs.addTab({
  11. // id:'a',
  12. // title:'孙悟空',
  13. // content:'看我七十二变',
  14. // }).addTab({
  15. // /*换个姿势*/
  16. // id:'b',
  17. // title:'猪八戒-关不掉',
  18. // content:'高老庄娶媳妇',
  19. // active:true,
  20. // allowClose:false,
  21. // }).addTab({
  22. // id:'c',
  23. // title:'沙和尚',
  24. // content:'请叫我大叔',
  25. // }).addTab({
  26. // id:'d',
  27. // title:'唐僧',
  28. // content:'光头一个',
  29. // }).addTab({
  30. // id:'e',
  31. // title:'武松',
  32. // content:'打虎猛汉',
  33. // }).addTab({
  34. // id:'f',
  35. // title:'潘金莲',
  36. // content:'求爱爱',
  37. // }).addTab({
  38. // id:'g',
  39. // title:'来个标题长一点的的的来个标题长一点的的的',
  40. // content:'你赢了',
  41. // }).addTab({
  42. // id:'h',
  43. // title:'支持连贯操作',
  44. // content:'没错就是这么爽',
  45. // }).addTab({
  46. // id:'i',
  47. // title:'欢迎提意见',
  48. // content:'一定一定',
  49. // }).addTab({
  50. // id:'j',
  51. // title:'熬夜写的啊',
  52. // content:'码农苦逼~',
  53. // }).setActTab("#c");
  54. initGenderSelect();
  55. initResponceTypeSelect();
  56. $('#editUserBirthDayGroup').datetimepicker({
  57. format: 'yyyy-mm-dd',
  58. language: 'zh-CN',
  59. minView: "month",
  60. });
  61. initDaterangepickerWithId('reportrange', "right");
  62. formatCheck();
  63. //数据校验
  64. init_validator();
  65. //时间区间
  66. initMzWorkTime();
  67. //初始频次下拉选
  68. initOrderFrequencys();
  69. //初始用药方式下拉选
  70. initSupplyTypes();
  71. /**
  72. * 清空
  73. */
  74. $("#clearRegistration").on("click", function (t) {
  75. $("#cardNo").val(null);
  76. $("#cardNo").attr("title", null);
  77. $("#userName").val(null);
  78. $("#age").val(null);
  79. $("#gender").selectpicker('val', 1);
  80. $("#gender").selectpicker('refresh');
  81. $("#birthDay").val(null);
  82. $("#birthDay").attr("title", null);
  83. $("#phoneNum").val(null);
  84. $("#phoneNum").attr("title", null);
  85. $("#patientsNature").selectpicker('val', '01');//默认选中
  86. $('#patientsNature').selectpicker('refresh');
  87. $("#idCard").val(null);
  88. $("#idCard").attr("title", null);
  89. $("#address").val(null);
  90. $("#patientId").val(null);
  91. $("#editUser").hide();
  92. //默认光标在卡号输入框
  93. $("#cardNo").focus();
  94. initMzWorkTime();
  95. readonlyOrNot(false);
  96. });
  97. //加载候诊患者列表
  98. loadUnClinicTableList();
  99. //加载接诊中患者列表
  100. loadInClinicTableList();
  101. //加载已接诊患者列表
  102. loadClinicTableList();
  103. //每隔一分钟秒读加载候诊患者列表
  104. setInterval(function () {
  105. //加载候诊患者列表
  106. loadUnClinicTableList();
  107. }, 60000);
  108. //初始化快速接诊病人姓名栏事件
  109. initUserList();
  110. //初始化主诉弹出层
  111. initRecommendList();
  112. //卡号输入改变事件
  113. cardNoChange();
  114. /**
  115. * 患者信息修改
  116. */
  117. $("#saveEditUser").on("click", function (t) {
  118. modifyPatient();
  119. });
  120. /**
  121. * 挂号列表中的科室和医生列表初始化
  122. */
  123. initListSelect();
  124. //折叠按钮初始化
  125. $(".collapse-link").on("click", function () {
  126. var a = $(this).closest(".x_panel")
  127. , b = $(this).find("i")
  128. , c = a.find(".x_content");
  129. a.attr("style") ? c.slideToggle(200, function () {
  130. a.removeAttr("style").css("background", "#EBEBE4");
  131. }) : (c.slideToggle(200),
  132. a.css("height", "auto").css("background", "#EBEBE4")),
  133. b.toggleClass("fa-chevron-up fa-chevron-down")
  134. });
  135. /**
  136. * 接诊
  137. */
  138. $("#saveapidAccepts1").on("click", function (t) {
  139. var saveapidAccepts1 = $("#patientIdDb").val();
  140. clinicalReception(saveapidAccepts1);
  141. clearRapidAcceptsModal();
  142. $("#rapidAcceptsModal").modal("hide");
  143. });
  144. /**
  145. * 实例化智能问诊弹窗
  146. */
  147. // $("[data-toggle='popover']").popover();
  148. $("#box-arrow-left").popover({
  149. html: 'true',
  150. content: '<div id="smartAssistPopoverContent"></div>'
  151. });
  152. //初始化药品分组下拉选
  153. initGroupOrder();
  154. // 初始化用药天数下拉选
  155. initDayNum();
  156. /**
  157. * 给药方式设置最高的下拉选高度
  158. */
  159. $("#supplyType").on('shown.bs.select', function (e) {
  160. $("#supplyType").siblings('.dropdown-menu').css("max-height", "360px");
  161. $('#supplyType').parent().find("input").keydown(function () {
  162. $("#supplyType").siblings.css("max-height", "360px");
  163. })
  164. });
  165. /**
  166. * 用药频率设置最高的下拉选高度
  167. */
  168. $("#orderFrequency").on('shown.bs.select', function (e) {
  169. $("#orderFrequency").siblings('.dropdown-menu').css("max-height", "360px");
  170. $('#orderFrequency').parent().find("input").keydown(function () {
  171. $("#orderFrequency").siblings('.dropdown-menu').css("max-height", "360px");
  172. })
  173. });
  174. });
  175. /**
  176. * 初始化用药天数下拉选
  177. */
  178. function initDayNum() {
  179. var html = '<option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option>';
  180. $('#dayNum').html(html);
  181. $('#dayNum').selectpicker('refresh');
  182. }
  183. /**
  184. * 初始化药品分组下拉选
  185. */
  186. function initGroupOrder() {
  187. var html = '<option value="1">1</option>';
  188. $('#groupId').html(html);
  189. $('#groupId').selectpicker('refresh');
  190. $("#groupId").selectpicker('val', 1);
  191. $('#groupId').selectpicker('refresh');
  192. }
  193. /**
  194. * 追加分组
  195. */
  196. function appendGroupOrder() {
  197. var last = parseInt($("#groupId > option:last").val());
  198. last++;
  199. var html = '<option value="' + last + '">' + last + '</option>';
  200. $('#groupId').append(html);
  201. $('#groupId').selectpicker('refresh');
  202. }
  203. /**
  204. * 关闭只能问诊弹框
  205. */
  206. function closePopover() {
  207. //$(".popover").popover('hide');
  208. $("#box-arrow-left").click();
  209. }
  210. /**
  211. * 加载只能问诊弹框内容
  212. */
  213. function contentMethod() {
  214. setTimeout(function () {
  215. $(".popover div.arrow").css("display", "none");
  216. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  217. if (popoverId == undefined) {
  218. return;
  219. }
  220. var left = $("#" + popoverId).css("left");
  221. left = left.replace("px", "");
  222. left = parseInt(left);
  223. left = left + 55;
  224. $("#" + popoverId).css("height", "100%").css("top", "0px").css("left", left + "px").css("border-radius", "0px").css("z-index", "11");
  225. $("#" + popoverId + " .popover-content").css("height", "100%");
  226. $("#smartAssistPopoverContent").css("height", "100%");
  227. var html = ' <div style="height: 34%;padding-left: 15px;width: 100%;">' +
  228. ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px; font-size: 12px;"' +
  229. ' class="btn btn-primary">' +
  230. ' <span id="patientHisData"></span>就医轨迹' +
  231. ' </button>' +
  232. ' <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" onclick="closePopover()">×</span>' +
  233. ' </button>' +
  234. ' <div style="height: calc(100% - 39px);border: 1px solid #DDDDDD;margin-top: 5px;width: 100%;">' +
  235. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  236. ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="patientHisDataForm">' +
  237. ' </form>' +
  238. ' </div>' +
  239. ' </div>' +
  240. ' <div style="height: 33%;padding-left: 15px;">' +
  241. ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px;"' +
  242. ' class="btn btn-primary">' +
  243. ' <span id="recommendType"></span>推荐' +
  244. ' </button>' +
  245. ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
  246. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  247. ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="recommendForm">' +
  248. ' <img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">' +
  249. ' </form>' +
  250. ' </div>' +
  251. ' </div>' +
  252. ' <div style="height: 33%;padding-left: 15px;">' +
  253. ' <button type="button"' +
  254. ' style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px; font-size: 12px;"' +
  255. ' class="btn btn-primary">' +
  256. ' 医疗范本' +
  257. ' </button>' +
  258. ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
  259. ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
  260. ' style="height: 100%;overflow-y: auto;width: 100%;">' +
  261. ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
  262. ' <div title="急性上呼吸道感染"' +
  263. ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
  264. ' 急性上呼吸道感染' +
  265. ' </div>' +
  266. ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
  267. ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
  268. ' style="cursor: pointer; color: #2e69eb;"' +
  269. ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
  270. ' </div>' +
  271. ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
  272. ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
  273. ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
  274. ' </div>' +
  275. ' </div>' +
  276. ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
  277. ' <div title="急性上呼吸道感染"' +
  278. ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
  279. ' 急性上呼吸道感染' +
  280. ' </div>' +
  281. ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
  282. ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
  283. ' style="cursor: pointer; color: #2e69eb;"' +
  284. ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
  285. ' </div>' +
  286. ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
  287. ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
  288. ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
  289. ' </div>' +
  290. ' </div>' +
  291. ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
  292. ' <div title="急性上呼吸道感染"' +
  293. ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
  294. ' 急性上呼吸道感染' +
  295. ' </div>' +
  296. ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
  297. ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
  298. ' style="cursor: pointer; color: #2e69eb;"' +
  299. ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
  300. ' </div>' +
  301. ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
  302. ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
  303. ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
  304. ' </div>' +
  305. ' </div>' +
  306. ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
  307. ' <div title="急性上呼吸道感染"' +
  308. ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
  309. ' 急性上呼吸道感染' +
  310. ' </div>' +
  311. ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
  312. ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
  313. ' style="cursor: pointer; color: #2e69eb;"' +
  314. ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
  315. ' </div>' +
  316. ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
  317. ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
  318. ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
  319. ' </div>' +
  320. ' </div>' +
  321. ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
  322. ' <div title="急性上呼吸道感染"' +
  323. ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
  324. ' 急性上呼吸道感染' +
  325. ' </div>' +
  326. ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
  327. ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
  328. ' style="cursor: pointer; color: #2e69eb;"' +
  329. ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
  330. ' </div>' +
  331. ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
  332. ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
  333. ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
  334. ' </div>' +
  335. ' </div>' +
  336. ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
  337. ' <div title="急性上呼吸道感染"' +
  338. ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
  339. ' 急性上呼吸道感染' +
  340. ' </div>' +
  341. ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
  342. ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
  343. ' style="cursor: pointer; color: #2e69eb;"' +
  344. ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
  345. ' </div>' +
  346. ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
  347. ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
  348. ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
  349. ' </div>' +
  350. ' </div>' +
  351. ' </form>' +
  352. ' </div>' +
  353. ' </div>';
  354. $("#smartAssistPopoverContent").html(html);
  355. fitPatientHisData();
  356. fitSymptomData();
  357. fitEmrHpiData();
  358. fitEmrPsData();
  359. fitDiagnoseData();
  360. }, 100);
  361. // setTimeout(function () {
  362. // $("#patientHisDataForm").html("aadsasfasdfasdfasdfasdfsdfasdfasdfasdfdfafda");
  363. // },1000);
  364. }
  365. /**
  366. * 设置患者的就诊轨迹
  367. */
  368. function fitPatientHisData() {
  369. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  370. if (!$("#" + popoverId).hasClass("in")) {
  371. return;
  372. }
  373. var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
  374. if ($("#patientId").val() == null || $("#patientId").val() == "") {
  375. $("#patientHisDataForm").html(emptyHtml);
  376. return;
  377. }
  378. $.ajax({
  379. type: "POST",
  380. url: '/thmz/getClinicWithPage',
  381. contentType: "application/json;charset=UTF-8",
  382. dataType: "json",
  383. data: JSON.stringify({
  384. "patientId": $("#patientId").val(),
  385. "clinicStatuses": [5, 6],
  386. "pageSize": 10000,
  387. "offset": 0,
  388. "beginDate": "2012-02-01 00:00:00",
  389. "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss")
  390. }),
  391. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  392. success: function (res) {
  393. if (res == '401' || res == 401) {
  394. window.location.href = '/thmz/login/view'
  395. return;
  396. }
  397. if (res.code == 0) {
  398. var html = '';
  399. var data = res.data;
  400. if (data == null || data.length == 0) {
  401. html += emptyHtml;
  402. } else {
  403. for (var i = 0; i < data.length; i++) {
  404. var icdText = data[i].icdText;
  405. if (icdText == null) {
  406. // continue;
  407. icdText = "空白诊断";
  408. }
  409. icdText = icdText.trim();
  410. html += ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">';
  411. html += ' <div style="float: left;width: 172px;">';
  412. html += ' <img src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/stopwatch.svg"';
  413. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  414. html += ' <span style="width: 120px;margin-right: 20px!important;">' + format(data[i].opDay, "yyyy-MM-dd HH:mm") + '</span>';
  415. html += ' </div>';
  416. html += ' <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
  417. html += ' title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
  418. html += ' onclick="visitingDetailModal(1)">' + icdText + '</a>';
  419. html += ' </div>';
  420. html += ' </div>';
  421. }
  422. }
  423. $("#patientHisData").text($("#patientName").text() + "的");
  424. if ($("#patientId").val() == null || $("#patientId").val() == "") {
  425. $("#patientHisDataForm").html(emptyHtml);
  426. } else {
  427. $("#patientHisDataForm").html(html);
  428. }
  429. } else {
  430. errorMesage(res);
  431. }
  432. }
  433. });
  434. }
  435. /**
  436. * 设置主诉推荐
  437. */
  438. function fitSymptomData() {
  439. fitRecommendData(12);
  440. }
  441. /**
  442. * 设置现病史推荐
  443. */
  444. function fitEmrHpiData() {
  445. fitRecommendData(5);
  446. }
  447. /**
  448. * 设置既往史推荐
  449. */
  450. function fitEmrPsData() {
  451. fitRecommendData(6);
  452. }
  453. /**
  454. * 设置诊断推荐
  455. */
  456. function fitDiagnoseData() {
  457. fitRecommendData(13);
  458. }
  459. /**
  460. * 设置推荐通用方法
  461. */
  462. function fitRecommendData(paramsType) {
  463. var popoverId = $("#box-arrow-left").attr("aria-describedby");
  464. if (!$("#" + popoverId).hasClass("in")) {
  465. return;
  466. }
  467. var inputId = "symptom";
  468. var text = "主诉";
  469. if (paramsType == 5) {
  470. inputId = "emrHpi";
  471. text = "现病史";
  472. } else if (paramsType == 6) {
  473. inputId = "emrPs";
  474. text = "既往史";
  475. } else if (paramsType == 13) {
  476. inputId = "diagnose";
  477. text = "诊断";
  478. }
  479. //光标不在现病史上
  480. if (document.activeElement.id != inputId) {
  481. return;
  482. }
  483. $("#recommendType").html(text);
  484. var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
  485. $.ajax({
  486. type: "GET",
  487. url: '/thmz/getTCommonParamsByParamsType?paramsType=' + paramsType + '&commonParams=&pageSize=10',
  488. contentType: "application/json;charset=UTF-8",
  489. dataType: "json",
  490. async: false,
  491. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  492. success: function (res) {
  493. if (res == '401' || res == 401) {
  494. window.location.href = '/thmz/login/view'
  495. return;
  496. }
  497. if (res.code == 0) {
  498. var html = '';
  499. var data = res.data;
  500. if (data == null || data.length == 0) {
  501. html += emptyHtml;
  502. } else {
  503. for (var i = 0; i < data.length; i++) {
  504. var paramsContent = data[i].paramsContent;
  505. html += ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">';
  506. html += ' <div style="margin-left: 10px;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 60px);" title="' + paramsContent + '">';
  507. html += paramsContent;
  508. html += ' </div>';
  509. html += ' <div style="float: left;width: 36px;cursor: pointer;"';
  510. html += ' onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ')">';
  511. html += ' <img';
  512. html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
  513. html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
  514. html += ' </div>';
  515. html += ' </div>';
  516. }
  517. }
  518. $("#recommendForm").html(html);
  519. } else {
  520. errorMesage(res);
  521. }
  522. }
  523. });
  524. }
  525. /**
  526. * 清空快速接诊弹窗
  527. */
  528. function clearRapidAcceptsModal() {
  529. $("#rapidAcceptsUserName").val(null);
  530. $("#rapidAcceptsUserCode").val(null);
  531. $("#patientIdDb").val(null);
  532. $("#rapidAcceptsUserCardNo").val(null);
  533. $("#rapidAcceptsUserGender").selectpicker('val', 0);
  534. $("#rapidAcceptsUserGender").selectpicker('refresh');
  535. $("#rapidAcceptsUserPhoneNum").val(null);
  536. $("#rapidAcceptsUserIdCard").val(null);
  537. $("#rapidAcceptsUserIdCard").attr("title", null);
  538. $("#rapidAcceptsUserPhoneNum").attr("title", null);
  539. }
  540. /**
  541. * 清空接诊台用户信息
  542. */
  543. function clearUser() {
  544. $("#patientName").html("");
  545. $("#patientAge").html("");
  546. $("#patientGender").html("");
  547. $("#patientId").val(null);
  548. $("#patientPhone").html("");
  549. $("#patientPhoneLabel").hide();
  550. $("#patientResponseType").html("");
  551. $("#first").parent().addClass("checked");
  552. $("#not").parent().removeClass("checked");
  553. $("#patientHisData").text("");
  554. }
  555. /**
  556. * 卡号输入改变事件
  557. */
  558. function cardNoChange() {
  559. if (window.ActiveXObject || "ActiveXObject" in window) {
  560. $("#rapidAcceptsUserCardNo").on('input propertychange', function () {
  561. queryUserInfoByCardNo();
  562. });
  563. } else {
  564. $("#rapidAcceptsUserCardNo").on('input οninput', function () {
  565. queryUserInfoByCardNo();
  566. });
  567. }
  568. }
  569. /**
  570. * 刷新就诊列表
  571. */
  572. function refreshClinic() {
  573. loadInClinicTableList();
  574. loadClinicTableList();
  575. }
  576. /**
  577. * 加载接诊中患者列表
  578. */
  579. function loadInClinicTableList() {
  580. //loadCommonClinicTableList("tb_table_in_clinic","/thmz/getInClinicWithPage");
  581. loadCommonClinicTableList("tb_table_in_clinic", queryParamsInClinic);
  582. }
  583. /**
  584. * 加载已接诊患者列表
  585. */
  586. function loadClinicTableList() {
  587. //loadCommonClinicTableList("tb_table_clinic","/thmz/getClinicWithPage");
  588. loadCommonClinicTableList("tb_table_clinic", queryParamsClinic);
  589. }
  590. /**
  591. * 加载患者列表通用方法
  592. * @param id
  593. * @param queryParams
  594. */
  595. function loadCommonClinicTableList(id, queryParams) {
  596. $('#' + id).bootstrapTable('refresh');
  597. $('#' + id).bootstrapTable({
  598. url: "/thmz/getClinicWithPage", //请求后台的URL(*)
  599. method: 'post', //请求方式(*)
  600. toolbar: '#toolbar', //工具按钮用哪个容器
  601. striped: true, //是否显示行间隔色
  602. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  603. pagination: true, //是否显示分页(*)
  604. sortable: true, //是否启用排序
  605. sortOrder: "asc", //排序方式
  606. queryParams: queryParams, //传递参数(*)
  607. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  608. pageNumber: 1, //初始化加载第一页,默认第一页
  609. pageSize: 5, //每页的记录行数(*)
  610. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  611. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  612. strictSearch: true,
  613. showColumns: false, //是否显示所有的列
  614. showRefresh: false, //是否显示刷新按钮
  615. minimumCountColumns: 2, //最少允许的列数
  616. clickToSelect: true, //是否启用点击选中行
  617. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  618. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  619. cardView: false, //是否显示详细视图
  620. detailView: false,
  621. //rowStyle:rowStyle,//通过自定义函数设置行样式
  622. ajaxOptions: {
  623. headers: {
  624. 'Accept': 'application/json',
  625. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  626. }
  627. },
  628. columns: [
  629. {
  630. field: 'patientName',
  631. title: '姓名/性别/年龄',
  632. align: "center",
  633. valign: 'middle',
  634. // sortable: true
  635. formatter: function (value, row, index) {
  636. return value + "/" + row.gender + "/" + row.age + "岁";
  637. }
  638. }, {
  639. field: 'opDay',
  640. title: '接诊时间',
  641. align: "center",
  642. valign: 'middle',
  643. // sortable: true
  644. formatter: function (value, row, index) {
  645. return format(value, "MM/dd HH:mm");
  646. }
  647. }
  648. , {
  649. title: '操作',
  650. align: "center",
  651. valign: 'middle',
  652. // sortable: true,
  653. formatter: function (value, row, index) {
  654. if (row.clinicStatus == 5) {
  655. return '<a title="修改" style="cursor: pointer"></a>修改&nbsp;<a title="详情">详情</a>';
  656. } else {
  657. return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\')" style="cursor: pointer">接诊</a>&nbsp;<a title="详情">详情</a>';
  658. }
  659. }
  660. }
  661. ],
  662. responseHandler: function (res) {
  663. if (res == '401' || res == 401) {
  664. window.location.href = '/thmz/login/view'
  665. return;
  666. }
  667. var ress = eval(res);
  668. if (ress.code == -1) {
  669. new PNotify({
  670. title: '错误提示',
  671. text: ress.message,
  672. type: 'error',
  673. hide: false,
  674. styling: 'bootstrap3'
  675. });
  676. return {
  677. "total": 0,//总页数
  678. "rows": {} //数据
  679. };
  680. }
  681. return {
  682. "total": ress.total,//总页数
  683. "rows": ress.data //数据
  684. };
  685. },
  686. onLoadSuccess: function (data) {
  687. $(".pagination-detail").css("display", "none");
  688. if (id == "tb_table_clinic") {
  689. $("#ClinicNum").html(data.total);
  690. } else {
  691. $("#inClinicNum").html(data.total);
  692. }
  693. }
  694. });
  695. }
  696. /**
  697. * 得到查询的参数
  698. * @param params
  699. * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
  700. */
  701. function queryParamsInClinic(params) {
  702. var rePortRangeArr = getRePortRangeArr();
  703. var temp = {
  704. beginDate: rePortRangeArr[0],
  705. endDate: rePortRangeArr[1],
  706. commonParams: $("#userName").val(),
  707. clinicStatuses: [4],
  708. pageSize: params.limit,
  709. offset: params.offset
  710. };
  711. return temp;
  712. };
  713. /**
  714. * 得到查询的参数
  715. * @param params
  716. * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
  717. */
  718. function queryParamsClinic(params) {
  719. var rePortRangeArr = getRePortRangeArr();
  720. var temp = {
  721. beginDate: rePortRangeArr[0],
  722. endDate: rePortRangeArr[1],
  723. commonParams: $("#userName").val(),
  724. clinicStatuses: [5, 6, 7],
  725. pageSize: params.limit,
  726. offset: params.offset
  727. };
  728. return temp;
  729. };
  730. /**
  731. * 加载待诊患者列表方法
  732. */
  733. function loadUnClinicTableList() {
  734. $('#tb_table_un_clinic').bootstrapTable('refresh');
  735. $('#tb_table_un_clinic').bootstrapTable({
  736. url: "/thmz/getUnClinicWithPage", //请求后台的URL(*)
  737. method: 'post', //请求方式(*)
  738. toolbar: '#toolbar', //工具按钮用哪个容器
  739. striped: true, //是否显示行间隔色
  740. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  741. pagination: true, //是否显示分页(*)
  742. sortable: true, //是否启用排序
  743. sortOrder: "asc", //排序方式
  744. queryParams: queryParamsUnClinic, //传递参数(*)
  745. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  746. pageNumber: 1, //初始化加载第一页,默认第一页
  747. pageSize: 5, //每页的记录行数(*)
  748. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  749. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  750. strictSearch: true,
  751. showColumns: false, //是否显示所有的列
  752. showRefresh: false, //是否显示刷新按钮
  753. minimumCountColumns: 2, //最少允许的列数
  754. clickToSelect: true, //是否启用点击选中行
  755. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  756. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  757. cardView: false, //是否显示详细视图
  758. detailView: false,
  759. //rowStyle:rowStyle,//通过自定义函数设置行样式
  760. ajaxOptions: {
  761. headers: {
  762. 'Accept': 'application/json',
  763. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  764. }
  765. },
  766. columns: [
  767. {
  768. field: 'name',
  769. title: '姓名/性别/年龄',
  770. align: "center",
  771. valign: 'middle',
  772. // sortable: true
  773. formatter: function (value, row, index) {
  774. return value + "/" + row.gender + "/" + row.age + "岁";
  775. }
  776. }, {
  777. field: 'visitDate',
  778. title: '分诊时间',
  779. align: "center",
  780. valign: 'middle',
  781. // sortable: true
  782. formatter: function (value, row, index) {
  783. return format(value, "MM/dd HH:mm");
  784. }
  785. }
  786. , {
  787. title: '操作',
  788. align: "center",
  789. valign: 'middle',
  790. // sortable: true,
  791. formatter: function (value, row, index) {
  792. if (row.statusFlag == 0) {
  793. return '<a title="接诊">接诊</a>';
  794. } else {
  795. return '<a title="通知" onclick="editUserModal(\'' + row.patientId + '\')">通知</a>&nbsp;<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\')" style="cursor: pointer">接诊</a>';
  796. }
  797. }
  798. }
  799. ],
  800. responseHandler: function (res) {
  801. if (res == '401' || res == 401) {
  802. window.location.href = '/thmz/login/view'
  803. return;
  804. }
  805. var ress = eval(res);
  806. if (ress.code == -1) {
  807. new PNotify({
  808. title: '错误提示',
  809. text: ress.message,
  810. type: 'error',
  811. hide: false,
  812. styling: 'bootstrap3'
  813. });
  814. return {
  815. "total": 0,//总页数
  816. "rows": {} //数据
  817. };
  818. }
  819. return {
  820. "total": ress.total,//总页数
  821. "rows": ress.data //数据
  822. };
  823. },
  824. onLoadSuccess: function (data) {
  825. $(".pagination-detail").css("display", "none");
  826. $("#unClinicNum").html(data.total);
  827. }
  828. });
  829. }
  830. /**
  831. * 得到查询的参数
  832. * @param params
  833. * @returns {{mzyReqrec: {unitCode: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
  834. */
  835. function queryParamsUnClinic(params) {
  836. var temp = {
  837. pageSize: params.limit,
  838. pageIndex: params.offset / params.limit, //页码
  839. };
  840. return temp;
  841. };
  842. /**
  843. * 接诊方法
  844. * @param patientId
  845. */
  846. function clinicalReception(patientId) {
  847. var existPatientId = $("#patientId").val();
  848. if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
  849. $("#messageModal").modal();
  850. $("#messageContent").html("当前有病人正在接诊,是否切换?");
  851. $("#messageButton").on("click", function (t) {
  852. $("#messageModal").modal("hide");
  853. clearWorkSpace();
  854. realClinicalReception(patientId)
  855. });
  856. } else {
  857. realClinicalReception(patientId)
  858. }
  859. }
  860. /**
  861. * 真实的接诊方法
  862. * @param patientId
  863. */
  864. function realClinicalReception(patientId) {
  865. $.ajax({
  866. type: "GET",
  867. url: '/thmz/getByPatientId?patientId=' + patientId,
  868. contentType: "application/json;charset=UTF-8",
  869. dataType: "json",
  870. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  871. success: function (res) {
  872. if (res == '401' || res == 401) {
  873. window.location.href = '/thmz/login/view'
  874. return;
  875. }
  876. if (res.code == 0) {
  877. if (res.data != null) {
  878. $("#patientName").html(res.data.name);
  879. $("#patientAge").html(res.data.age);
  880. $("#patientGender").html(res.data.gender);
  881. $("#patientId").val(patientId);
  882. if (res.data.phoneNo != null && res.data.phoneNo != '') {
  883. $("#patientPhone").html(res.data.phoneNo);
  884. $("#patientPhoneLabel").show();
  885. } else {
  886. $("#patientPhoneLabel").hide();
  887. }
  888. $("#patientResponseType").html(res.data.responseTypeName);
  889. if (res.data.times == 1) {
  890. $("#first").parent().addClass("checked");
  891. $("#not").parent().removeClass("checked");
  892. } else {
  893. $("#not").parent().addClass("checked");
  894. $("#first").parent().removeClass("checked");
  895. }
  896. $("#patientHisData").text(res.data.name);
  897. fitPatientHisData();
  898. }
  899. } else {
  900. errorMesage(res);
  901. }
  902. }
  903. });
  904. }
  905. /**
  906. * 清空工作台
  907. */
  908. function clearWorkSpace() {
  909. //TODO
  910. clearUser();
  911. }
  912. /**
  913. * 就诊详情
  914. * @param id
  915. */
  916. function visitingDetailModal(id) {
  917. $("#visitingDetailModal").modal();
  918. }
  919. /**
  920. * 医疗范文
  921. * @param id
  922. */
  923. function medicalModelModal(id) {
  924. $("#medicalModelModal").modal();
  925. }
  926. /**
  927. * 底层填充推荐方法
  928. * @param paramsType
  929. * @param appeal
  930. * @param inputId
  931. */
  932. function extracted(paramsType, appeal, inputId) {
  933. if (paramsType == 13) {
  934. var contentArr = appeal.split(",");
  935. if (contentArr != null && contentArr.length > 0) {
  936. for (var i = 0; i < contentArr.length; i++) {
  937. var content = contentArr[i].replace(")", "").replace("(", "-");
  938. var diagnoseArr = content.split("-");
  939. if (diagnoseArr == null || diagnoseArr.length == 0) {
  940. continue;
  941. }
  942. fitDiagnoseValue(diagnoseArr[0], diagnoseArr[1]);
  943. }
  944. }
  945. } else {
  946. $("#" + inputId).val(appeal);
  947. }
  948. }
  949. /**
  950. * 填充推荐
  951. * @param appeal
  952. * @param paramsType
  953. */
  954. function fitAppeal(appeal, paramsType) {
  955. var inputId = "symptom";
  956. var text = "主诉项已经录入,是否覆盖?";
  957. if (paramsType == 5) {
  958. inputId = "emrHpi";
  959. text = "现病史项已经录入,是否覆盖?";
  960. } else if (paramsType == 6) {
  961. inputId = "emrPs";
  962. text = "既往史项已经录入,是否覆盖?";
  963. } else if (paramsType == 13) {
  964. inputId = "diagnoseValue";
  965. text = "诊断项已经录入,是否覆盖?";
  966. }
  967. var symptom = $("#" + inputId).val();
  968. if (paramsType == 13 && (symptom == ",," || symptom == ",")) {
  969. symptom = null;
  970. }
  971. if (symptom != null && symptom != "") {
  972. $("#messageModal").modal();
  973. $("#messageContent").html(text);
  974. $("#messageButton").on("click", function (t) {
  975. $("#messageModal").modal("hide");
  976. if (paramsType == 13) {
  977. $("#" + inputId).val(null);
  978. $("#diagnoseTags").html(null);
  979. }
  980. extracted(paramsType, appeal, inputId);
  981. });
  982. } else {
  983. extracted(paramsType, appeal, inputId);
  984. }
  985. }
  986. /**
  987. * 初始化性别下拉选
  988. */
  989. function initGenderSelect() {
  990. $(".selectpicker").selectpicker({
  991. dropuAuto: false
  992. });
  993. var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
  994. $('#rapidAcceptsUserGender').html(gender);
  995. $('#rapidAcceptsUserGender').selectpicker('refresh');
  996. $('#editUserGender').html(gender);
  997. $('#editUserGender').selectpicker('refresh');
  998. }
  999. /**
  1000. * 初始化病人身份类别下拉选
  1001. */
  1002. function initResponceTypeSelect() {
  1003. $(".selectpicker").selectpicker({
  1004. dropuAuto: false
  1005. });
  1006. $.ajax({
  1007. type: "GET",
  1008. url: '/thmz/getMzResponceType',
  1009. contentType: "application/json;charset=UTF-8",
  1010. dataType: "json",
  1011. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1012. success: function (res) {
  1013. if (res == '401' || res == 401) {
  1014. window.location.href = '/thmz/login/view'
  1015. return;
  1016. }
  1017. if (res.code == 0) {
  1018. res.data.forEach(function (item, index) {
  1019. var html = '<option value="' + item.code + '">' + item.name + '</option>';
  1020. $('#patientsNature').append(html);
  1021. $('#editUserPatientsNature').append(html);
  1022. });
  1023. $('#patientsNature').selectpicker('refresh');
  1024. $('#editUserPatientsNature').selectpicker('refresh');
  1025. } else {
  1026. new PNotify({
  1027. title: '错误提示',
  1028. text: res.message,
  1029. type: 'error',
  1030. hide: false,
  1031. styling: 'bootstrap3'
  1032. });
  1033. }
  1034. }
  1035. });
  1036. }
  1037. /**
  1038. * 初始科室下拉选
  1039. * @param ampm 时间段区间
  1040. */
  1041. function initDeptPlus() {
  1042. //科室列表
  1043. $.ajax({
  1044. type: "GET",
  1045. url: '/thmz/getUnitCodeByRequestDay?ampm=' + $("#ampm").val(),
  1046. dataType: "json",
  1047. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1048. success: function (data) {
  1049. if (data == '401' || data == 401) {
  1050. window.location.href = '/thmz/login/view'
  1051. return;
  1052. }
  1053. var html = '';
  1054. $.each(data.data, function (commentIndex, comment) {
  1055. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  1056. });
  1057. $('#deptNo').empty();
  1058. $('#deptNo').html(html);
  1059. $('#deptNo').selectpicker('refresh');
  1060. $('#chargeType').empty();
  1061. $('#chargeType').selectpicker('refresh');
  1062. emptyInput();
  1063. }
  1064. });
  1065. }
  1066. /**
  1067. * 初始医生下拉选
  1068. * @param ampm 时间段区间
  1069. */
  1070. function initEmployee() {
  1071. //医生列表
  1072. $.ajax({
  1073. type: "GET",
  1074. url: '/thmz/getDoctorCodeByRequestDay?unitCode=' + $('#deptNo').val() + "&ampm=" + $("#ampm").val() + "&chargeType=" + $("#chargeType").val(),
  1075. dataType: "json",
  1076. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1077. success: function (res) {
  1078. if (res == '401' || res == 401) {
  1079. window.location.href = '/thmz/login/view'
  1080. return;
  1081. }
  1082. var html = '';
  1083. var flag = false;
  1084. $.each(res.data, function (commentIndex, comment) {
  1085. html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + comment.employee.employeeName + '</option>';
  1086. if (comment.employeeCode == -1) {
  1087. flag = true;
  1088. }
  1089. });
  1090. $('#doctor').empty();
  1091. $('#doctor').html(html);
  1092. $('#doctor').selectpicker('refresh');
  1093. validator.checkAll($("#regi_form"));
  1094. if (flag) {
  1095. //如果有无需选择医生的选项,默认选择
  1096. $('#doctor').selectpicker('val', -1);
  1097. $('#doctor').selectpicker('refresh');
  1098. fitFee();
  1099. }
  1100. }
  1101. });
  1102. }
  1103. /**
  1104. * 初始门诊时间区间下拉选
  1105. */
  1106. function initMzWorkTime() {
  1107. $.ajax({
  1108. type: "GET",
  1109. url: '/thmz/getMzWorkTime',
  1110. dataType: "json",
  1111. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1112. success: function (res) {
  1113. if (res == '401' || res == 401) {
  1114. window.location.href = '/thmz/login/view'
  1115. return;
  1116. }
  1117. var html = '';
  1118. var ampm = null;
  1119. $.each(res.data, function (commentIndex, comment) {
  1120. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  1121. if (ampm == null || (ampm != "a" && ampm != "p")) {
  1122. var startTime = paseToFullTime(comment.startTime);
  1123. var endTime = paseToFullTime(comment.endTime);
  1124. if (range(startTime, endTime)) {
  1125. ampm = comment.code;
  1126. }
  1127. }
  1128. });
  1129. $('#ampm').empty(); //清空resText里面的所有内容
  1130. $('#ampm').html(html);
  1131. $('#ampm').selectpicker('refresh');
  1132. $("#ampm").selectpicker('val', ampm);
  1133. $('#ampm').selectpicker('refresh');
  1134. initDeptPlus();
  1135. }
  1136. });
  1137. }
  1138. /**
  1139. * 初始门诊号别下拉选
  1140. */
  1141. function initChargeType() {
  1142. $.ajax({
  1143. type: "GET",
  1144. url: '/thmz/getChargeTypeByRequestDay?unitCode=' + $('#deptNo').val() + "&ampm=" + $("#ampm").val(),
  1145. dataType: "json",
  1146. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1147. success: function (res) {
  1148. if (res == '401' || res == 401) {
  1149. window.location.href = '/thmz/login/view'
  1150. return;
  1151. }
  1152. var html = '';
  1153. $.each(res.data, function (commentIndex, comment) {
  1154. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  1155. });
  1156. $('#chargeType').empty(); //清空resText里面的所有内容
  1157. $('#chargeType').html(html);
  1158. $('#chargeType').selectpicker('refresh');
  1159. validator.checkAll($("#regi_form"));
  1160. emptyInput();
  1161. }
  1162. });
  1163. }
  1164. /**
  1165. * 设置挂号费等费用
  1166. */
  1167. function fitFee() {
  1168. var chargeType = $('#doctor').find("option:selected").attr('data-chargeType');
  1169. var checkFee = $('#doctor').find("option:selected").attr('data-checkFee');
  1170. $("#checkFee").val(checkFee);
  1171. $("#amountMoney").text(checkFee);
  1172. $("#amountMoneyConfirm").text(checkFee);
  1173. $("#realMoney").val(checkFee);
  1174. $("#cash").val(checkFee);
  1175. $("#changeAmount").val(0);
  1176. $.ajax({
  1177. type: "GET",
  1178. url: '/thmz/getMzChargeTypeByCode?code=' + chargeType,
  1179. dataType: "json",
  1180. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1181. success: function (res) {
  1182. if (res == '401' || res == 401) {
  1183. window.location.href = '/thmz/login/view'
  1184. return;
  1185. }
  1186. $("#registrationFee").val(res.data.reqFee);
  1187. $("#hospitalFee").val(res.data.clinicFee);
  1188. checkFee = parseFloat(checkFee) + parseFloat(res.data.reqFee) + parseFloat(res.data.clinicFee);
  1189. $("#amountMoney").text(checkFee);
  1190. $("#amountMoneyConfirm").text(checkFee);
  1191. $("#realMoney").val(checkFee);
  1192. $("#cash").val(checkFee);
  1193. }
  1194. });
  1195. }
  1196. /**
  1197. * 初始频次下拉选
  1198. */
  1199. function initOrderFrequencys() {
  1200. $.ajax({
  1201. type: "GET",
  1202. url: '/thmz/getOrderFrequencys',
  1203. dataType: "json",
  1204. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1205. success: function (res) {
  1206. if (res == '401' || res == 401) {
  1207. window.location.href = '/thmz/login/view'
  1208. return;
  1209. }
  1210. var html = '';
  1211. $.each(res.data, function (commentIndex, comment) {
  1212. html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
  1213. });
  1214. $('#orderFrequency').empty();
  1215. $('#orderFrequency').html(html);
  1216. $('#orderFrequency').selectpicker('refresh');
  1217. }
  1218. });
  1219. }
  1220. /**
  1221. * 初始用药方式下拉选
  1222. */
  1223. function initSupplyTypes() {
  1224. $.ajax({
  1225. type: "GET",
  1226. url: '/thmz/getSupplyTypes',
  1227. dataType: "json",
  1228. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1229. success: function (res) {
  1230. if (res == '401' || res == 401) {
  1231. window.location.href = '/thmz/login/view'
  1232. return;
  1233. }
  1234. var html = '';
  1235. $.each(res.data, function (commentIndex, comment) {
  1236. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  1237. });
  1238. $('#supplyType').empty();
  1239. $('#supplyType').html(html);
  1240. $('#supplyType').selectpicker('refresh');
  1241. }
  1242. });
  1243. }
  1244. /**
  1245. * 日期值改变修改年龄字段
  1246. * @param ev
  1247. */
  1248. function changeDate(ev) {
  1249. }
  1250. /**
  1251. * 列表类型按钮切换事件
  1252. * @param object
  1253. */
  1254. function titleButtonChange(object) {
  1255. $("#regi_List_btn_group").find("button").each(function (index, element) {
  1256. if ($(element).hasClass("btn-primary")) {
  1257. $(element).removeClass("btn-primary").addClass("btn-default");
  1258. }
  1259. });
  1260. $(object).removeClass("btn-default").addClass("btn-primary");
  1261. loadRegistrationList(true);
  1262. }
  1263. /**
  1264. * 表格类型切换事件 卡片展示或者列表形式
  1265. */
  1266. function listTypeChange(object) {
  1267. //var indexNum = 0;
  1268. $("#regi_List_type").find("button").each(function (index, element) {
  1269. if ($(element).hasClass("btn-primary")) {
  1270. $(element).removeClass("btn-primary").addClass("btn-default");
  1271. }
  1272. // if (object == element) {
  1273. // indexNum = index;
  1274. // }
  1275. });
  1276. $(object).removeClass("btn-default").addClass("btn-primary");
  1277. loadRegistrationList(true);
  1278. }
  1279. /**
  1280. * 保存当前药品到右边处方区域 西药
  1281. */
  1282. function saveWesternMedicine() {
  1283. $("#xyTab").append('<li><a href="#test" role="tab" data-toggle="pill">test</a></li>');
  1284. $("#xyTabContent").append('<div class="tab-pane fade" id="test">规则内容面板sdfdfasdfasdfd</div>');
  1285. //组号
  1286. var groupId = $("#groupId").val();
  1287. //药品名称
  1288. var westernMedicineNamme = $("#western_medicine_namme").val();
  1289. //当前药品编码
  1290. var currentCode = $("#current_code").val();
  1291. //当前药品规格
  1292. var currentSerial = $("#current_serial").val();
  1293. //用法编码
  1294. var supplyType = $("#supplyType").val();
  1295. //用法描述
  1296. var supplyTypeText = $('#supplyType option:selected').text();
  1297. //药品默认单次使用剂量
  1298. var drugWinDb = $("#drugWinDb").val();
  1299. //处方实际单次使用剂量
  1300. var drugWin = $("#drugWin").val();
  1301. //剂量单位
  1302. var drugWinUnit = $("#drugWinUnit").val();
  1303. //天数
  1304. var dayNum = $("#dayNum").val();
  1305. //频次编码
  1306. var orderFrequency = $("#orderFrequency").val();
  1307. //频次描述
  1308. var orderFrequencyText = $('#orderFrequency option:selected').text();
  1309. //总量
  1310. var gross = $("#gross").val();
  1311. //包装单位
  1312. var packUnit = $("#packUnit").val();
  1313. //医嘱
  1314. var medicalAdvice = $("#medicalAdvice").val();
  1315. var html = '<div class="form-group">';
  1316. html += groupId + '.&nbsp;&nbsp;';
  1317. html += westernMedicineNamme + ' ';
  1318. html += drugWinDb + drugWinUnit + ' ';
  1319. html += drugWin + drugWinUnit + ' 共';
  1320. html += gross + packUnit + '<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
  1321. html += '用法:' + supplyTypeText + ' ';
  1322. html += '频次:' + orderFrequencyText + ' ';
  1323. html += dayNum + '天 ';
  1324. if (medicalAdvice != null && medicalAdvice != '') {
  1325. html += '医嘱:' + medicalAdvice;
  1326. }
  1327. html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
  1328. html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
  1329. html += '</div>';
  1330. $("div.rb_item_0").each(function () {
  1331. if ($(this).css("display") === "block") {
  1332. $(this).find("div:eq(1)").append(html);
  1333. }
  1334. });
  1335. var groupIdLast = $("#groupId option:last-child").text();
  1336. if (groupId === groupIdLast) {
  1337. appendGroupOrder();
  1338. }
  1339. // clearWesternMedicine();
  1340. }
  1341. /**
  1342. * 清空西药
  1343. */
  1344. function clearWesternMedicine() {
  1345. //药品名称
  1346. $("#western_medicine_namme").val(null);
  1347. //当前药品编码
  1348. $("#current_code").val(null);
  1349. //当前药品规格
  1350. $("#current_serial").val(null);
  1351. //用法编码
  1352. $("#supplyType").selectpicker('val', null);
  1353. $('#supplyType').selectpicker('refresh');
  1354. //药品默认单次使用剂量
  1355. $("#drugWinDb").val(null);
  1356. //处方实际单次使用剂量
  1357. $("#drugWin").val(null);
  1358. //剂量单位
  1359. $("#drugWinUnit").selectpicker('val', null);
  1360. $('#drugWinUnit').selectpicker('refresh');
  1361. //天数
  1362. $("#dayNum").selectpicker('val', null);
  1363. $('#dayNum').selectpicker('refresh');
  1364. //频次编码
  1365. $("#orderFrequency").selectpicker('val', null);
  1366. $('#orderFrequency').selectpicker('refresh');
  1367. //总量
  1368. $("#gross").val(null);
  1369. //包装单位
  1370. $("#packUnit").selectpicker('val', null);
  1371. $('#packUnit').selectpicker('refresh');
  1372. //单价
  1373. $("#packRetprice").val(null);
  1374. //金额
  1375. $("#totalRetprice").val(null);
  1376. //医嘱
  1377. $("#medicalAdvice").val(null);
  1378. }
  1379. /**
  1380. * 打开编辑用户信息窗口
  1381. * @param data
  1382. */
  1383. function editUserModal() {
  1384. $("#editUserModal").modal();
  1385. $.ajax({
  1386. type: "GET",
  1387. url: '/thmz/getByPatientId?patientId=' + $("#patientId").val(),
  1388. contentType: "application/json;charset=UTF-8",
  1389. dataType: "json",
  1390. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1391. success: function (res) {
  1392. if (res == '401' || res == 401) {
  1393. window.location.href = '/thmz/login/view'
  1394. return;
  1395. }
  1396. if (res.code == 0) {
  1397. if (res.data != null) {
  1398. //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
  1399. setTimeout(function () {
  1400. fillPlusPatinet(res.data);
  1401. }, 400);
  1402. }
  1403. } else {
  1404. errorMesage(res);
  1405. }
  1406. }
  1407. });
  1408. }
  1409. /**
  1410. * 收费明细类型按钮切换事件
  1411. * @param object
  1412. * @param objectIndex
  1413. */
  1414. function billItemButtonChange(object, objectIndex) {
  1415. $("#bill_item_group").find("button").each(function (index, element) {
  1416. if ($(element).hasClass("btn-primary")) {
  1417. $(element).removeClass("btn-primary").addClass("btn-default");
  1418. }
  1419. if (index == objectIndex) {
  1420. } else {
  1421. }
  1422. });
  1423. $(object).removeClass("btn-default").addClass("btn-primary");
  1424. // initChargeDetailTable();
  1425. //默认光标在卡号输入框
  1426. // $("#cardNo").focus();
  1427. }
  1428. /**
  1429. * 打开智能辅助医生系统窗口
  1430. * @param data
  1431. */
  1432. function smartAssistModal() {
  1433. //点击模态框外不关闭模态框
  1434. $("#smartAssistModal").modal({
  1435. backdrop: "false"
  1436. });
  1437. //$(".modal-backdrop").remove();
  1438. }
  1439. /**
  1440. * 打开退费信息窗口
  1441. * @param data
  1442. */
  1443. function backNoModal(data) {
  1444. $("#backNoModal").modal();
  1445. }
  1446. /**
  1447. * 打开打印窗口
  1448. * @param data
  1449. */
  1450. function printOrPreviewModal(data) {
  1451. $("#printOrPreviewModal").modal();
  1452. }
  1453. /**
  1454. * 打开打印内容窗口
  1455. * @param data
  1456. */
  1457. function printModal(data) {
  1458. $("#printOrPreviewModal").modal("hide");
  1459. $("#printModal").modal();
  1460. }
  1461. /**
  1462. * 打开快速接诊窗口
  1463. * @param data
  1464. */
  1465. function rapidAcceptsModal() {
  1466. $("#rapidAcceptsModal").modal();
  1467. //延迟触发 默认光标在卡号输入框
  1468. setTimeout('$("#rapidAcceptsUserCardNo").focus();', 500);
  1469. }
  1470. /**
  1471. * checkBox样式
  1472. */
  1473. function formatCheck() {
  1474. if ($("input.flat")[0]) {
  1475. $(document).ready(function () {
  1476. $('input.flat').iCheck({
  1477. checkboxClass: 'icheckbox_flat-blue',
  1478. radioClass: 'iradio_flat-blue'
  1479. });
  1480. });
  1481. }
  1482. }
  1483. /**
  1484. * 卡号有变化后查询病人信息
  1485. */
  1486. function queryUserInfoByCardNo() {
  1487. //当反写的id不存在,说明不是查询后的改变事件,触发查询
  1488. var rapidAcceptsUserCardNo = $("#rapidAcceptsUserCardNo").val();
  1489. var index = rapidAcceptsUserCardNo.indexOf("-");
  1490. if (($("#patientIdDb").val() == null || $("#patientIdDb").val() == "") && ((index > 0 && index == rapidAcceptsUserCardNo.length - 2) || rapidAcceptsUserCardNo.length == 8)) {
  1491. $("#cardNo").attr("title", rapidAcceptsUserCardNo);
  1492. $.ajax({
  1493. type: "GET",
  1494. url: '/thmz/getByIcCardNo?icCardNo=' + rapidAcceptsUserCardNo,
  1495. contentType: "application/json;charset=UTF-8",
  1496. dataType: "json",
  1497. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1498. success: function (res) {
  1499. if (res == '401' || res == 401) {
  1500. window.location.href = '/thmz/login/view'
  1501. return;
  1502. }
  1503. if (res.code == 0) {
  1504. if (res.data != null) {
  1505. $("#rapidAcceptsUserName").val(res.data.name);
  1506. $("#rapidAcceptsUserCode").val(res.data.patientId);
  1507. $("#patientIdDb").val(res.data.patientId);
  1508. $("#rapidAcceptsUserCardNo").val(res.data.icCardNo);
  1509. $("#rapidAcceptsUserGender").selectpicker('val', res.data.sex);
  1510. $("#rapidAcceptsUserGender").selectpicker('refresh');
  1511. $("#rapidAcceptsUserPhoneNum").val(res.data.phoneNo);
  1512. $("#rapidAcceptsUserIdCard").val(res.data.socialNo);
  1513. $("#rapidAcceptsUserIdCard").attr("title", res.data.socialNo);
  1514. $("#rapidAcceptsUserPhoneNum").attr("title", res.data.phoneNo);
  1515. } else {
  1516. errorMesageSimaple("病人信息不存在!");
  1517. }
  1518. } else {
  1519. errorMesage(res);
  1520. }
  1521. }
  1522. });
  1523. }
  1524. }
  1525. /**
  1526. * 清空快速接诊查询框
  1527. */
  1528. function clearRapidAccepts() {
  1529. $("#rapidAcceptsUserName").val(null);
  1530. $("#rapidAcceptsUserCode").val(null);
  1531. $("#patientIdDb").val(null);
  1532. $("#rapidAcceptsUserCardNo").val(null);
  1533. $("#rapidAcceptsUserGender").selectpicker('val', 0);
  1534. $("#rapidAcceptsUserGender").selectpicker('refresh');
  1535. $("#rapidAcceptsUserPhoneNum").val(null);
  1536. $("#rapidAcceptsUserIdCard").val(null);
  1537. $("#rapidAcceptsUserIdCard").attr("title", null);
  1538. $("#rapidAcceptsUserPhoneNum").attr("title", null);
  1539. $("#rapidAcceptsUserCardNo").focus();
  1540. }
  1541. /**
  1542. * 校验收款金额
  1543. */
  1544. function checkFee() {
  1545. var cash = parseFloat($("#cash").val());
  1546. var realMoney = parseFloat($("#realMoney").val());
  1547. realMoney = realMoney.toFixed(2);
  1548. $("#realMoney").val(realMoney)
  1549. if (cash < realMoney) {
  1550. new PNotify({
  1551. title: '错误提示',
  1552. text: "收款金额不能少于实收金额!",
  1553. type: 'error',
  1554. hide: true,
  1555. styling: 'bootstrap3'
  1556. });
  1557. } else if (cash > realMoney) {
  1558. if ($("#payType").val() == 1) {
  1559. var changeAmount = cash - realMoney;
  1560. $("#changeAmount").val(changeAmount.toFixed(2));
  1561. } else {
  1562. new PNotify({
  1563. title: '错误提示',
  1564. text: "非现金收款金额不能大于实收金额!",
  1565. type: 'error',
  1566. hide: true,
  1567. styling: 'bootstrap3'
  1568. });
  1569. }
  1570. }
  1571. //计算和设置折扣比例
  1572. var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text());
  1573. var discount = realMoney / amountMoneyConfirm * 100;
  1574. $("#discount").text(discount.toFixed(2))
  1575. }
  1576. /**
  1577. * 根据病人姓名输入框内容动态加载病人列表
  1578. */
  1579. function initUserList() {
  1580. //var width=$("#userName").css("width");
  1581. var settings = {
  1582. trigger: 'click',
  1583. content: '',
  1584. width: 170,
  1585. multi: true,
  1586. closeable: false,
  1587. style: '',
  1588. delay: 300,
  1589. padding: true,
  1590. height: 300
  1591. };
  1592. var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
  1593. //用户姓名选中事件
  1594. $("#rapidAcceptsUserName").on("click", function (t) {
  1595. if ($(webuiPopover).css("display") == "block") {
  1596. refeshPatinetList(true);
  1597. }
  1598. });
  1599. }
  1600. /**
  1601. * 刷新候诊病人列表
  1602. */
  1603. function refeshPatinetList(flag) {
  1604. //如果是重新加载病人列表,需要重置下标
  1605. if (flag) {
  1606. //重置下标
  1607. pageIndex = 0;
  1608. msg_list_loading = true;
  1609. }
  1610. var userName = $('#rapidAcceptsUserName').val();
  1611. if (!(userName == null || userName == "" || isChinese(userName))) {
  1612. return;
  1613. }
  1614. $.ajax({
  1615. type: "POST",
  1616. url: '/thmz/getUnClinicWithPage',
  1617. contentType: "application/json;charset=UTF-8",
  1618. dataType: "json",
  1619. data: JSON.stringify({"name": userName, "pageIndex": pageIndex}),
  1620. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1621. success: function (res) {
  1622. if (res == '401' || res == 401) {
  1623. window.location.href = '/thmz/login/view'
  1624. return;
  1625. }
  1626. if (res.code == 0) {
  1627. if (res.data != null && res.data.length > 0) {
  1628. $("#webuiPopover0").css("display", "block");
  1629. $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
  1630. var html = '<div class="list-group">';
  1631. for (var i = 0; i < res.data.length; i++) {
  1632. var mzPatientMi = res.data[i];
  1633. html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillUnClinicPatinet(\'' + mzPatientMi.patientId + '\')">';
  1634. if (mzPatientMi.gender == "男") {
  1635. html += '<img src="/thmz/images/boy.png"/>'
  1636. } else if (mzPatientMi.gender == "女") {
  1637. html += '<img src="/thmz/images/girl.png"/>'
  1638. } else if (mzPatientMi.gender == "未知" || mzPatientMi.gender == null) {
  1639. html += '<img src="/thmz/images/girl_or_boy.png"/>'
  1640. }
  1641. html += '<div>' + mzPatientMi.name + '&nbsp;' + mzPatientMi.gender + '&nbsp;';
  1642. if (mzPatientMi.age != null && mzPatientMi.age != "") {
  1643. html += mzPatientMi.age + '岁';
  1644. } else {
  1645. html += '**岁';
  1646. }
  1647. if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
  1648. html += '<span>' + mzPatientMi.phoneNo + '</span>';
  1649. }
  1650. html += '</div></a>';
  1651. }
  1652. html += '</div>';
  1653. if (flag) {
  1654. $("#webuiPopover0 div.webui-popover-content").html("");
  1655. }
  1656. $("#webuiPopover0 div.webui-popover-content").append(html);
  1657. $("#webuiPopover0 div.arrow").css("left", "23px");
  1658. refeshPatinetListScrollEvent();
  1659. } else {
  1660. $("#webuiPopover0").css("display", "none");
  1661. }
  1662. }
  1663. //查询完成,设置加载完成
  1664. msg_list_loading = false;
  1665. }
  1666. });
  1667. }
  1668. /**
  1669. * 病人下拉列表滚动条滚动到底部时继续加载新纪录
  1670. */
  1671. function refeshPatinetListScrollEvent() {
  1672. $('.webui-popover-content').scroll(function (event) {
  1673. var top = $(this).scrollTop();
  1674. var height = $(this).height();
  1675. var scrollHeight = $(this).get(0).scrollHeight;
  1676. if (scrollHeight <= top + height) {
  1677. if (!msg_list_loading) {
  1678. msg_list_loading = true;
  1679. pageIndex = pageIndex + 1;
  1680. refeshPatinetList(false);
  1681. }
  1682. }
  1683. });
  1684. }
  1685. /**
  1686. * 按照病人id查询病人信息
  1687. * @param patientId
  1688. */
  1689. function fillUnClinicPatinet(patientId) {
  1690. $("#rapidAcceptsUserCardNo").val(patientId);
  1691. $("#webuiPopover0").css("display", "none");
  1692. queryUserInfoByCardNo();
  1693. }
  1694. /**
  1695. * 加载主诉,体格检查,诊断窗口
  1696. */
  1697. function initRecommendList() {
  1698. var width = $("#symptom").parent().css("width");
  1699. var settings = {
  1700. placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
  1701. trigger: 'click', //值:click,hover 触发方式
  1702. content: '',//内容,内容可以是函数
  1703. width: width,
  1704. //arrow:false,//是否显示箭头
  1705. multi: true,//在页面允许其他弹出层
  1706. closeable: true,//显示关闭按钮
  1707. style: '', //值:'',inverse
  1708. delay: 300,//延迟时间, 悬浮属性才执行
  1709. padding: true,//内容填充
  1710. height: 320,
  1711. //offsetTop:10,
  1712. cache: true,//如果缓存设置为false,则popover将销毁并重新创建
  1713. };
  1714. //主诉弹窗
  1715. var symptomWebuiPopover = $('#symptom').webuiPopover('destroy').webuiPopover(settings);
  1716. //体格检查弹窗
  1717. settings.height = 260;
  1718. $('#weight').webuiPopover('destroy').webuiPopover(settings);
  1719. //诊断弹窗
  1720. settings.height = 320;
  1721. var diagnoseWebuiPopover = $('#diagnose').webuiPopover('destroy').webuiPopover(settings);
  1722. //西药弹窗
  1723. settings.width = 980;
  1724. settings.closeable = false;
  1725. settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
  1726. var westernMedicineWebuiPopover = $('#western_medicine_namme').webuiPopover('destroy').webuiPopover(settings);
  1727. //主诉选中事件
  1728. $("#symptom").on("click", function (t) {
  1729. if ($(symptomWebuiPopover).css("display") == "block") {
  1730. $("#webuiPopover1 div.arrow").css("left", "23px");
  1731. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">主诉</span>';
  1732. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='contentHtml'>";
  1733. html += "</div>";
  1734. html += '<div style="height: 60px; line-height: 60px; font-size: 14px;">' +
  1735. '<div style="float: left">' +
  1736. '<span style="margin-left: 20px;">内容:</span> ' +
  1737. '</div>' +
  1738. '<div style="float: left;">' +
  1739. '<select class="form-control selectpicker show-tick" id="paramsType" dropupAuto="true">' +
  1740. '<option label="常用症状" value="0">常用症状</option>' +
  1741. '<option label="常用时间" value="1">常用时间</option>' +
  1742. '<option label="常用标点" value="2">常用标点</option>' +
  1743. '<option label="常用词" value="3">常用词</option>' +
  1744. '</select> ' +
  1745. '</div>' +
  1746. '<div style="width: 200px;float: left;margin-left: 10px;">' +
  1747. '<input id="paramsNameInput" class="form-control" type="text" style="position: relative;top: 13px;height: 34px;">' +
  1748. '</div>' +
  1749. '<div style="float: left;margin-left: 10px;">' +
  1750. ' <button type="button" class="btn" onclick="saveParams();"' +
  1751. ' style="height: 30px;line-height: 15px;border-color: #2e69eb!important;color: #2e69eb;background-color: white;">' +
  1752. ' <svg class="bi" width="1em" height="1em" fill="currentColor" style="vertical-align: -.15em;margin-right: 10px!important;color: #2e69eb;">' +
  1753. ' <use xlink:href="/thmz/css/bootstrap/bootstrap-icons-1.5.0/bootstrap-icons.svg#plus-circle"></use>' +
  1754. ' </svg>' +
  1755. '新增' +
  1756. ' </button>' +
  1757. ' </div>' +
  1758. '</div>';
  1759. $("#webuiPopover1 div.webui-popover-content").html(html);
  1760. $('#paramsType').selectpicker('refresh');
  1761. $("#paramsType").parent().css("width", "140px").css("height", "34px");
  1762. $("#webuiPopover1").css("z-index", "10");
  1763. if ($("#webuiPopover1").hasClass("in")) {
  1764. loadSymptom();
  1765. }
  1766. }
  1767. //加载智能接诊模块的主诉推荐
  1768. fitSymptomData();
  1769. });
  1770. //体格检查各输入框选中事件
  1771. $("#weight,#temperature,#sphygmus,#breathe,#pressure_high,#pressure_floor").on("click", function (t) {
  1772. if ($("#webuiPopover2").css("display") == "block") {
  1773. $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
  1774. if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() == "") {
  1775. $("#webuiPopover2 div.arrow").css("left", "23px");
  1776. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
  1777. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
  1778. html += "</div>";
  1779. $("#webuiPopover2 div.webui-popover-content").html(html);
  1780. $("#webuiPopover2").css("z-index", "10");
  1781. if ($("#webuiPopover2").hasClass("in")) {
  1782. loadHealthCheckup();
  1783. }
  1784. }
  1785. //loadSymptom();
  1786. } else {
  1787. $('#weight').webuiPopover('show');
  1788. $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
  1789. if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() != "") {
  1790. $("#webuiPopover2 div.arrow").css("left", "23px");
  1791. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
  1792. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
  1793. html += "</div>";
  1794. $("#webuiPopover2 div.webui-popover-content").html(html);
  1795. $("#webuiPopover2").css("z-index", "10");
  1796. if ($("#webuiPopover2").hasClass("in")) {
  1797. loadHealthCheckup();
  1798. }
  1799. }
  1800. }
  1801. return false;
  1802. });
  1803. //诊断选中事件
  1804. $("#diagnose").on("click", function (t) {
  1805. if ($(diagnoseWebuiPopover).css("display") == "block") {
  1806. $("#webuiPopover3 div.arrow").css("left", "23px");
  1807. $("#webuiPopover3 a.close").css("margin-top", "15px");
  1808. var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
  1809. html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
  1810. ' <input type="text" class="form-control has-feedback-left" ' +
  1811. ' placeholder="搜索" style="padding-left: 10px;" oninput="loadDiagnose(this.value)" id="paramsDiagnose">' +
  1812. ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
  1813. ' </div>';
  1814. html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='diagnoseContentHtml'>";
  1815. html += "</div>";
  1816. $("#webuiPopover3 div.webui-popover-content").html(html);
  1817. $("#webuiPopover3").css("z-index", "10");
  1818. //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
  1819. loadDiagnose("");
  1820. }
  1821. //加载智能接诊模块的诊断推荐推荐
  1822. fitDiagnoseData();
  1823. });
  1824. //现病史选中事件
  1825. $("#emrHpi").on("click", function (t) {
  1826. //加载智能接诊模块的现病史推荐推荐
  1827. fitEmrHpiData();
  1828. });
  1829. //既往史选中事件
  1830. $("#emrPs").on("click", function (t) {
  1831. //加载智能接诊模块的既往史推荐推荐
  1832. fitEmrPsData();
  1833. });
  1834. //西药选中事件
  1835. $("#western_medicine_namme").on("click", function (t) {
  1836. if ($(westernMedicineWebuiPopover).css("display") == "block") {
  1837. $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
  1838. loadYpList();
  1839. }
  1840. });
  1841. }
  1842. /**
  1843. * 新增通用参数
  1844. */
  1845. function saveParams() {
  1846. $.ajax({
  1847. type: "POST",
  1848. url: '/thmz/saveTCommonParams',
  1849. contentType: "application/json;charset=UTF-8",
  1850. dataType: "json",
  1851. data: JSON.stringify({
  1852. "paramsType": $("#paramsType").val(),
  1853. "paramsName": $("#paramsNameInput").val()
  1854. }),
  1855. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1856. success: function (res) {
  1857. if (res == '401' || res == 401) {
  1858. window.location.href = '/thmz/login/view'
  1859. return;
  1860. }
  1861. if (res.code == 0) {
  1862. successMesage(res);
  1863. loadSymptom();
  1864. $("#paramsNameInput").val(null);
  1865. // $("#paramsType").selectpicker('val', 0);
  1866. // $("#paramsType").selectpicker('refresh');
  1867. } else {
  1868. errorMesage(res);
  1869. }
  1870. }
  1871. });
  1872. }
  1873. /**
  1874. * 加载主诉参数列表
  1875. */
  1876. function loadSymptom() {
  1877. $.ajax({
  1878. type: "GET",
  1879. url: '/thmz/loadSymptom',
  1880. contentType: "application/json;charset=UTF-8",
  1881. dataType: "json",
  1882. async: false,
  1883. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1884. success: function (res) {
  1885. if (res == '401' || res == 401) {
  1886. window.location.href = '/thmz/login/view'
  1887. return;
  1888. }
  1889. var html = '';
  1890. if (res.code == 0) {
  1891. if (res.featureList != null && res.featureList.length > 0) {
  1892. html += '<div id="feature">';
  1893. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用症状:</div>';
  1894. html += '<div style="width: calc(100% - 80px); float: left;">';
  1895. for (var i = 0; i < res.featureList.length; i++) {
  1896. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.featureList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
  1897. html += res.featureList[i].paramsName;
  1898. html += '</span></button>';
  1899. }
  1900. html += '</div><div style="clear:both"></div></div>';
  1901. }
  1902. if (res.timeList != null && res.timeList.length > 0) {
  1903. html += '<div id="time">';
  1904. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用时间:</div>';
  1905. html += '<div style="width: calc(100% - 80px); float: left;">';
  1906. for (var i = 0; i < res.timeList.length; i++) {
  1907. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.timeList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
  1908. html += res.timeList[i].paramsName;
  1909. html += '</span></button>';
  1910. }
  1911. html += '</div><div style="clear:both"></div></div>';
  1912. }
  1913. if (res.characterList != null && res.characterList.length > 0) {
  1914. html += '<div id="character">';
  1915. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用标点:</div>';
  1916. html += '<div style="width: calc(100% - 80px); float: left;">';
  1917. for (var i = 0; i < res.characterList.length; i++) {
  1918. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.characterList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
  1919. html += res.characterList[i].paramsName;
  1920. html += '</span></button>';
  1921. }
  1922. html += '</div><div style="clear:both"></div></div>';
  1923. }
  1924. if (res.wordsList != null && res.wordsList.length > 0) {
  1925. html += '<div id="words">';
  1926. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用词:</div>';
  1927. html += '<div style="width: calc(100% - 80px); float: left;">';
  1928. for (var i = 0; i < res.wordsList.length; i++) {
  1929. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.wordsList[i].paramsName + '\',\'symptom\')"><span style="padding: 0px 5px;">';
  1930. html += res.wordsList[i].paramsName;
  1931. html += '</span></button>';
  1932. }
  1933. html += '</div><div style="clear:both"></div></div>';
  1934. }
  1935. } else {
  1936. errorMesage(res);
  1937. }
  1938. $("#contentHtml").html(html);
  1939. }
  1940. });
  1941. }
  1942. /**
  1943. * 加载体格检查参数列表
  1944. */
  1945. function loadHealthCheckup() {
  1946. $.ajax({
  1947. type: "GET",
  1948. url: '/thmz/loadHealthCheckup',
  1949. contentType: "application/json;charset=UTF-8",
  1950. dataType: "json",
  1951. async: false,
  1952. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  1953. success: function (res) {
  1954. if (res == '401' || res == 401) {
  1955. window.location.href = '/thmz/login/view'
  1956. return;
  1957. }
  1958. var html = '';
  1959. if (res.code == 0) {
  1960. if (res.weightList != null && res.weightList.length > 0) {
  1961. html += '<div id="weightDiv">';
  1962. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体重:</div>';
  1963. html += '<div style="width: calc(100% - 80px); float: left;">';
  1964. for (var i = 0; i < res.weightList.length; i++) {
  1965. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.weightList[i].paramsName + '\',\'weight\')"><span style="padding: 0px 5px;">';
  1966. html += res.weightList[i].paramsName;
  1967. html += '</span></button>';
  1968. }
  1969. html += '</div><div style="clear:both"></div></div>';
  1970. }
  1971. if (res.temperatureList != null && res.temperatureList.length > 0) {
  1972. html += '<div id="temperatureDiv">';
  1973. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体温:</div>';
  1974. html += '<div style="width: calc(100% - 80px); float: left;">';
  1975. for (var i = 0; i < res.temperatureList.length; i++) {
  1976. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.temperatureList[i].paramsName + '\',\'temperature\')"><span style="padding: 0px 5px;">';
  1977. html += res.temperatureList[i].paramsName;
  1978. html += '</span></button>';
  1979. }
  1980. html += '</div><div style="clear:both"></div></div>';
  1981. }
  1982. if (res.sphygmusList != null && res.sphygmusList.length > 0) {
  1983. html += '<div id="sphygmusDiv">';
  1984. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">脉搏:</div>';
  1985. html += '<div style="width: calc(100% - 80px); float: left;">';
  1986. for (var i = 0; i < res.sphygmusList.length; i++) {
  1987. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.sphygmusList[i].paramsName + '\',\'sphygmus\')"><span style="padding: 0px 5px;">';
  1988. html += res.sphygmusList[i].paramsName;
  1989. html += '</span></button>';
  1990. }
  1991. html += '</div><div style="clear:both"></div></div>';
  1992. }
  1993. if (res.breatheList != null && res.breatheList.length > 0) {
  1994. html += '<div id="breatheDiv">';
  1995. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
  1996. html += '<div style="width: calc(100% - 80px); float: left;">';
  1997. for (var i = 0; i < res.breatheList.length; i++) {
  1998. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.breatheList[i].paramsName + '\',\'breathe\')"><span style="padding: 0px 5px;">';
  1999. html += res.breatheList[i].paramsName;
  2000. html += '</span></button>';
  2001. }
  2002. html += '</div><div style="clear:both"></div></div>';
  2003. }
  2004. if (res.pressureList != null && res.pressureList.length > 0) {
  2005. html += '<div id="pressureDiv">';
  2006. html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
  2007. html += '<div style="width: calc(100% - 80px); float: left;">';
  2008. for (var i = 0; i < res.pressureList.length; i++) {
  2009. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitValue(\'' + res.pressureList[i].paramsName + '\',\'pressure_\')"><span style="padding: 0px 5px;">';
  2010. html += res.pressureList[i].paramsName;
  2011. html += '</span></button>';
  2012. }
  2013. html += '</div><div style="clear:both"></div></div>';
  2014. }
  2015. } else {
  2016. errorMesage(res);
  2017. }
  2018. $("#healthCheckupContentHtml").html(html);
  2019. }
  2020. });
  2021. }
  2022. /**
  2023. * 加载诊断参数列表
  2024. * @param value
  2025. */
  2026. function loadDiagnose(value) {
  2027. if (!$("#webuiPopover3").hasClass("in")) {
  2028. return;
  2029. }
  2030. $.ajax({
  2031. type: "GET",
  2032. url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + value + '&pageSize=100',
  2033. contentType: "application/json;charset=UTF-8",
  2034. dataType: "json",
  2035. async: false,
  2036. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2037. success: function (res) {
  2038. if (res == '401' || res == 401) {
  2039. window.location.href = '/thmz/login/view'
  2040. return;
  2041. }
  2042. var html = '';
  2043. if (res.code == 0) {
  2044. if (res.data != null && res.data.length > 0) {
  2045. html += '<div>';
  2046. for (var i = 0; i < res.data.length; i++) {
  2047. html += '<button type="button" class="button_color" style="background-color: rgb(255, 255, 255);border: none;" onclick="fitDiagnoseValue(\'' + res.data[i].paramsName + '\',\'' + res.data[i].paramsCode + '\')"><span style="padding: 0px 5px;font-size: 20px;">';
  2048. html += res.data[i].paramsName;
  2049. html += '<small>&nbsp;&nbsp;(' + res.data[i].paramsCode + ')</small>';
  2050. html += '</span></button>';
  2051. }
  2052. html += '</div>';
  2053. }
  2054. } else {
  2055. errorMesage(res);
  2056. }
  2057. $("#diagnoseContentHtml").html(html);
  2058. }
  2059. });
  2060. }
  2061. /**
  2062. * 填充诊断
  2063. * @param value
  2064. * @param code
  2065. */
  2066. function fitDiagnoseValue(value, code) {
  2067. var html = '';
  2068. var childrenNum = $("#diagnoseTags").children().length;
  2069. if (childrenNum == 3) {
  2070. errorMesageSimaple("最多填写三个诊断!");
  2071. return;
  2072. }
  2073. if (childrenNum == 0) {
  2074. html += '<span class="el-tag--mainDiagnosis" ';
  2075. } else {
  2076. html += '<span class="el-tag--secondaryDiagnosis" ';
  2077. }
  2078. html += ' title="' + value + '(' + code + ')" id="' + code + '"><span class="el-select__tags-text">' + value + '</span><i class="fa fa-remove .el-icon-close" style="margin-left: 10px;height: 16px;width: 16px;cursor: pointer;" onclick="removeDiagnoseValue(\'' + code + '\')"></i><span style="clear: both"></span></span>';
  2079. $("#diagnoseTags").append(html);
  2080. var diagnoseValue = $("#diagnoseValue").val();
  2081. if (diagnoseValue == null || diagnoseValue == "") {
  2082. diagnoseValue = code;
  2083. } else {
  2084. diagnoseValue += "," + code;
  2085. }
  2086. $("#diagnoseValue").val(diagnoseValue);
  2087. }
  2088. /**
  2089. * 移除诊断
  2090. * @param code
  2091. */
  2092. function removeDiagnoseValue(code) {
  2093. var childrenIndex = 0;
  2094. var children = $("#diagnoseTags").children();
  2095. for (var i = 0; i < children.length; i++) {
  2096. if ($(children[i]).attr("id") == code) {
  2097. childrenIndex = i;
  2098. break;
  2099. }
  2100. }
  2101. $($("#diagnoseTags").children("span")[childrenIndex]).remove();
  2102. if (childrenIndex == 0) {
  2103. $($("#diagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
  2104. }
  2105. var diagnoseValue = $("#diagnoseValue").val();
  2106. $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
  2107. }
  2108. /**
  2109. * 点击通用参数属性值时设置值到对应的区域
  2110. * @param value
  2111. * @param id
  2112. */
  2113. function fitValue(value, id) {
  2114. //当选择的是血压时
  2115. if (id == "pressure_") {
  2116. var arr = value.split("/");
  2117. $("#pressure_high").val(arr[0]);
  2118. $("#pressure_floor").val(arr[1]);
  2119. //当选的是体重,体温,脉搏和呼吸时
  2120. } else if (id == "weight" || id == "temperature" || id == "sphygmus" || id == "breathe") {
  2121. $("#" + id).val(value);
  2122. } else {
  2123. //主诉拼写时
  2124. var valueExist = $("#" + id).val();
  2125. if (valueExist != null && valueExist != "") {
  2126. value = valueExist + value;
  2127. }
  2128. $("#" + id).val(value);
  2129. }
  2130. }
  2131. /**
  2132. * 加载药品列表数列表
  2133. * @param value
  2134. */
  2135. function loadYpList() {
  2136. if (!$("#westernMedicinePopoverContent").parent().parent().parent().hasClass("in")) {
  2137. return;
  2138. }
  2139. $('#tb_table_western_medicine').bootstrapTable('refresh');
  2140. $('#tb_table_western_medicine').bootstrapTable({
  2141. url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
  2142. method: 'GET', //请求方式(*)
  2143. toolbar: '#toolbar', //工具按钮用哪个容器
  2144. striped: true, //是否显示行间隔色
  2145. cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  2146. pagination: false, //是否显示分页(*)
  2147. sortable: true, //是否启用排序
  2148. sortOrder: "asc", //排序方式
  2149. queryParams: function (params) {
  2150. var temp = {
  2151. groupNo: 71,
  2152. commonParams: $("#western_medicine_namme").val()
  2153. };
  2154. return temp;
  2155. }, //传递参数(*)
  2156. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  2157. pageNumber: 1, //初始化加载第一页,默认第一页
  2158. pageSize: 5, //每页的记录行数(*)
  2159. pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
  2160. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  2161. strictSearch: true,
  2162. showColumns: false, //是否显示所有的列
  2163. showRefresh: false, //是否显示刷新按钮
  2164. minimumCountColumns: 2, //最少允许的列数
  2165. clickToSelect: true, //是否启用点击选中行
  2166. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  2167. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  2168. cardView: false, //是否显示详细视图
  2169. detailView: false,
  2170. //rowStyle:rowStyle,//通过自定义函数设置行样式
  2171. ajaxOptions: {
  2172. headers: {
  2173. 'Accept': 'application/json',
  2174. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  2175. }
  2176. },
  2177. columns: [
  2178. {
  2179. field: 'code',
  2180. title: '编码',
  2181. align: "center",
  2182. valign: 'middle',
  2183. // sortable: true
  2184. }, {
  2185. field: 'name',
  2186. title: '药品名称',
  2187. align: "center",
  2188. valign: 'middle',
  2189. // sortable: true
  2190. }
  2191. , {
  2192. field: 'specification',
  2193. title: '规格',
  2194. align: "center",
  2195. valign: 'middle',
  2196. // sortable: true
  2197. }, {
  2198. field: 'manufactory',
  2199. title: '生产厂家',
  2200. align: "center",
  2201. valign: 'middle',
  2202. // sortable: true
  2203. }, {
  2204. field: 'miniUnitName',
  2205. title: '单位',
  2206. align: "center",
  2207. valign: 'middle',
  2208. // sortable: true
  2209. }, {
  2210. field: 'chargeAmount',
  2211. title: '零售价',
  2212. align: "center",
  2213. valign: 'middle',
  2214. // sortable: true
  2215. formatter: function (value, row, index) {
  2216. if (value == null) {
  2217. return '0.0元';
  2218. }
  2219. return value.toFixed(2) + "元";
  2220. }
  2221. }, {
  2222. field: 'drugWinDesc',
  2223. title: '剂量',
  2224. align: "center",
  2225. valign: 'middle',
  2226. // sortable: true
  2227. }, {
  2228. field: 'stockAmountVirtual',
  2229. title: '库存数量',
  2230. align: "center",
  2231. valign: 'middle',
  2232. // sortable: true
  2233. }
  2234. ],
  2235. responseHandler: function (res) {
  2236. if (res == '401' || res == 401) {
  2237. window.location.href = '/thmz/login/view'
  2238. return;
  2239. }
  2240. var ress = eval(res);
  2241. if (ress.code == -1) {
  2242. errorMesage(res);
  2243. return {
  2244. "total": 0,//总页数
  2245. "rows": {} //数据
  2246. };
  2247. }
  2248. return {
  2249. "total": ress.data.length,//总页数
  2250. "rows": ress.data //数据
  2251. };
  2252. },
  2253. onClickRow: function (row, $element) {
  2254. $('#western_medicine_namme').webuiPopover('hide');
  2255. checkYpInfo(row.code, row.serial);
  2256. }
  2257. });
  2258. }
  2259. /**
  2260. * 按照药品的编码 和药品拆零规格查询药品信息
  2261. * @param code
  2262. * @param serial
  2263. */
  2264. function checkYpInfo(code, serial) {
  2265. $.ajax({
  2266. type: "GET",
  2267. url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
  2268. contentType: "application/json;charset=UTF-8",
  2269. dataType: "json",
  2270. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2271. success: function (res) {
  2272. if (res == '401' || res == 401) {
  2273. window.location.href = '/thmz/login/view'
  2274. return;
  2275. }
  2276. if (res.code == 0) {
  2277. if (res.data != null) {
  2278. //每个处方不能超过5个药品
  2279. $("div.rb_item_0").each(function () {
  2280. if ($(this).css("display") === "block") {
  2281. var stepId = $(this).attr("id");
  2282. var childrens = $(this).find("div:eq(1)").children().length;
  2283. if (childrens === 5) {
  2284. $("#messageModal").modal();
  2285. $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
  2286. $("#messageButton").on("click", function (t) {
  2287. $("#messageModal").modal("hide");
  2288. refreshWizard("wizard0", "wizard_steps-0", stepId, "rb_item_0");
  2289. fitWesternMedicine(res);
  2290. });
  2291. } else {
  2292. fitWesternMedicine(res);
  2293. }
  2294. }
  2295. });
  2296. }
  2297. } else {
  2298. errorMesage(res);
  2299. }
  2300. }
  2301. });
  2302. }
  2303. /**
  2304. * 添加处方分页
  2305. * @param wizardId
  2306. * @param wizardStepId
  2307. * @param stepId
  2308. * @param rbItemClass
  2309. */
  2310. function refreshWizard(wizardId, wizardStepId, stepId, rbItemClass) {
  2311. var index = parseInt(stepId.split("-")[1]);
  2312. index++;
  2313. var newStepId = "step-" + index;
  2314. var wizardStepHtml = '<li><a href="#' + newStepId + '"><span class="step_no" style="width: 20px;height: 20px;line-height: 20px;">' + index + '</span><span class="step_descr">';
  2315. wizardStepHtml += '<small>处方' + numToChineseNum(index) + '</small></span></a></li>';
  2316. var wizardHtml = '<div id="' + newStepId + '" class="rb_item ' + rbItemClass + '">';
  2317. wizardHtml += ' <form class="form-horizontal form-label-left">';
  2318. wizardHtml += ' <div class="form-group">';
  2319. wizardHtml += ' <img src="/thmz/images/prescription.png">';
  2320. wizardHtml += ' </div>';
  2321. wizardHtml += ' <div style="height: 200px;" class="wizard_content">';
  2322. wizardHtml += ' </div>';
  2323. wizardHtml += ' </form>';
  2324. wizardHtml += ' </div>';
  2325. $("#" + wizardStepId).append(wizardStepHtml);
  2326. $("#" + wizardId).append(wizardHtml);
  2327. initSmartWizard(wizardId);
  2328. }
  2329. /**
  2330. * 填充西药选中的内容
  2331. */
  2332. function fitWesternMedicine(res) {
  2333. $("#western_medicine_namme").val(res.data.name);
  2334. $("#western_medicine_namme").blur();
  2335. var drugWinHtml = '';
  2336. var index = null;
  2337. if (res.data.weight != null) {
  2338. $("#drugWin").val(res.data.weight);
  2339. $("#drugWinDb").val(res.data.weight);
  2340. drugWinHtml = '<option value="' + res.data.weighUnitDesc + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
  2341. index = res.data.weighUnitDesc;
  2342. }
  2343. if (res.data.volum != null) {
  2344. if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
  2345. $("#drugWin").val(res.data.volum);
  2346. $("#drugWinDb").val(res.data.volum);
  2347. }
  2348. drugWinHtml += '<option value="' + res.data.volUnitDesc + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
  2349. if (index == null) {
  2350. index = res.data.volUnitDesc;
  2351. }
  2352. }
  2353. $('#drugWinUnit').html(drugWinHtml);
  2354. $('#drugWinUnit').selectpicker('refresh');
  2355. $("#drugWinUnit").selectpicker('val', index);
  2356. $('#drugWinUnit').selectpicker('refresh');
  2357. if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
  2358. var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
  2359. $('#packUnit').html(html);
  2360. $('#packUnit').selectpicker('refresh');
  2361. $("#packUnit").selectpicker('val', res.data.packUnitDesc);
  2362. $('#packUnit').selectpicker('refresh');
  2363. }
  2364. if (res.data.supplyType != null) {
  2365. $("#supplyType").selectpicker('val', res.data.supplyType);
  2366. $('#supplyType').selectpicker('refresh');
  2367. }
  2368. if (res.data.frequency != null) {
  2369. $("#orderFrequency").selectpicker('val', res.data.frequency);
  2370. $('#orderFrequency').selectpicker('refresh');
  2371. }
  2372. $("#packRetprice").val(res.data.packRetprice);
  2373. $("#packSize").val(res.data.packSize);
  2374. $("#current_code").val(res.data.code);
  2375. $("#current_serial").val(res.data.serial);
  2376. }
  2377. /**
  2378. * 剂量单位改变事件
  2379. */
  2380. function drugWinUnitChange() {
  2381. var desc = $('#drugWinUnit').find("option:selected").attr('desc');
  2382. $("#drugWin").val(desc);
  2383. $("#drugWinDb").val(desc);
  2384. calculate();
  2385. }
  2386. /**
  2387. * 根据选择的内容计算总的用药量
  2388. */
  2389. function calculate() {
  2390. //最小规格剂量
  2391. var drugWinDb = $("#drugWinDb").val();
  2392. //天数
  2393. var dayNum = $("#dayNum").val();
  2394. //当前使用的最小剂量
  2395. var drugWin = $("#drugWin").val();
  2396. //频率
  2397. var times = $('#orderFrequency').find("option:selected").attr('desc');
  2398. //包装规格数量
  2399. var packSize = $("#packSize").val();
  2400. //单价
  2401. var packRetprice = $("#packRetprice").val();
  2402. if (drugWinDb == null || drugWinDb === "") {
  2403. return;
  2404. }
  2405. if (dayNum == null || dayNum === "") {
  2406. return;
  2407. }
  2408. if (drugWin == null || drugWin === "") {
  2409. return;
  2410. }
  2411. if (times == null || times === "") {
  2412. return;
  2413. }
  2414. if (packSize == null || packSize === "") {
  2415. return;
  2416. }
  2417. //拆零总量
  2418. var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
  2419. //整包装的数量
  2420. var totalNum = Division(scatteredTotalNum, Multiply(packSize, drugWinDb));
  2421. $("#gross").val(totalNum);
  2422. $("#totalRetprice").val(Multiply(totalNum, packRetprice));
  2423. }
  2424. function getByPatientId(patientId) {
  2425. $.ajax({
  2426. type: "GET",
  2427. url: '/thmz/getByPatientId?patientId=' + patientId,
  2428. contentType: "application/json;charset=UTF-8",
  2429. dataType: "json",
  2430. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2431. success: function (res) {
  2432. if (res == '401' || res == 401) {
  2433. window.location.href = '/thmz/login/view'
  2434. return;
  2435. }
  2436. if (res.code == 0) {
  2437. if (res.data != null) {
  2438. $("#cardNo").val(res.data.icCardNo);
  2439. $("#cardNo").attr("title", res.data.icCardNo);
  2440. $("#cardNo").blur();
  2441. $("#userName").val(res.data.name);
  2442. $("#userName").blur();
  2443. $("#userNameReadOnly").val(res.data.name);
  2444. $("#age").val(res.data.age);
  2445. $("#age").blur();
  2446. $("#gender").selectpicker('val', res.data.sex);
  2447. $("#gender").selectpicker('refresh');
  2448. $("#gender").blur();
  2449. $("#birthDayReadonly").val(res.data.birthDayStr);
  2450. $("#birthDayReadonly").attr("title", res.data.birthDayStr);
  2451. $("#birthDayReadonly").blur();
  2452. $("#birthDay").val(res.data.birthDayStr);
  2453. $("#birthDay").blur();
  2454. $("#phoneNum").val(res.data.phoneNo);
  2455. $("#phoneNum").attr("title", res.data.phoneNo);
  2456. $("#phoneNum").blur();
  2457. $("#patientsNature").selectpicker('val', res.data.responseType);//默认选中
  2458. $('#patientsNature').selectpicker('refresh');
  2459. $("#patientsNature").blur();
  2460. $("#idCard").val(res.data.socialNo);
  2461. $("#idCard").attr("title", res.data.socialNo);
  2462. $("#idCard").blur();
  2463. $("#address").val(res.data.address);
  2464. $("#address").blur();
  2465. $("#patientId").val(res.data.patientId);
  2466. if (res.data.name != null && res.data.name != "") {
  2467. $("#editUser").show();
  2468. }
  2469. readonlyOrNot(true);
  2470. }
  2471. } else {
  2472. errorMesage(res);
  2473. }
  2474. }
  2475. });
  2476. }
  2477. /**
  2478. * 将病人信息填入患者信息修改form
  2479. * @param patinet
  2480. */
  2481. function fillPlusPatinet(patinet) {
  2482. if (patinet != null) {
  2483. $("#editUserCode").val(patinet.patientId);
  2484. $("#editUserName").val(patinet.name);
  2485. $("#editUserName").blur();
  2486. $("#editUserAge").val(patinet.age);
  2487. $("#editUserAge").blur();
  2488. $("#editUserGender").selectpicker('val', patinet.sex);
  2489. $("#editUserGender").selectpicker('refresh');
  2490. $("#editUserGender").blur();
  2491. $("#editUserBirthDay").val(patinet.birthDayStr);
  2492. $("#editUserBirthDay").blur();
  2493. $("#editUserCardNo").val(patinet.icCardNo);
  2494. $("#editUserCardNo").attr("title", patinet.icCardNo);
  2495. $("#editUserCardNo").blur();
  2496. $("#editUserPhoneNum").val(patinet.phoneNo);
  2497. $("#editUserPhoneNum").attr("title", patinet.phoneNo);
  2498. $("#editUserPhoneNum").blur();
  2499. $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
  2500. $('#editUserPatientsNature').selectpicker('refresh');
  2501. $("#editUserPatientsNature").blur();
  2502. $("#editUserIdCard").val(patinet.socialNo);
  2503. $("#editUserIdCard").attr("title", patinet.socialNo);
  2504. $("#editUserIdCard").blur();
  2505. $("#editUserAddress").val(patinet.address);
  2506. $("#editUserAddress").blur();
  2507. $("#editUserContact").val(patinet.relName);
  2508. $("#editUserContactPhone").val(patinet.contractName);
  2509. }
  2510. }
  2511. /**
  2512. * 关闭当前这个付款方式
  2513. */
  2514. function closeThisParent(obj) {
  2515. $(obj).parent().parent().remove();
  2516. }
  2517. /**
  2518. * 科室与时间区间下拉选改变时清空输入框内容
  2519. */
  2520. function emptyInput() {
  2521. $('#doctor').empty();
  2522. $('#doctor').selectpicker('refresh');
  2523. $("#registrationFee").val(0.00);
  2524. $("#hospitalFee").val(0.00);
  2525. $("#checkFee").val(0.00);
  2526. $("#amountMoney").text(0.00);
  2527. $("#amountMoneyConfirm").text(0.00);
  2528. $("#realMoney").val(0.00);
  2529. }
  2530. /**
  2531. * 给某些域增加title或者清除title
  2532. * @param obj
  2533. */
  2534. function clearTextOrTitle(obj) {
  2535. if ($(obj).val() == null || $(obj).val().length == 0) {
  2536. $(obj).attr("title", null);
  2537. } else {
  2538. $(obj).attr("title", $(obj).val());
  2539. if ($(obj).attr("id") == "birthDay") {
  2540. $(obj).blur()
  2541. }
  2542. }
  2543. }
  2544. /**
  2545. * 当按照卡号查询时,病人信息输入框不可编辑,当清空输入框时可编辑
  2546. * @param flag
  2547. */
  2548. function readonlyOrNot(flag) {
  2549. if (flag) {
  2550. $("#cardNo").attr("readonly", "readonly");
  2551. $("#userName").attr("readonly", "readonly");
  2552. $("#age").attr("readonly", "readonly");
  2553. $("#gender").attr("disabled", "disabled");
  2554. $("#phoneNum").attr("readonly", "readonly");
  2555. $("#patientsNature").attr("disabled", "disabled");
  2556. $("#idCard").attr("readonly", "readonly");
  2557. $("#address").attr("readonly", "readonly");
  2558. $("#birthDayReadonly").removeClass("hide").addClass("in");
  2559. $("#birthDayGroup").removeClass("in").addClass("hide");
  2560. $("#userName").removeClass("in").addClass("hide");
  2561. $("#userNameReadOnly").removeClass("hide").addClass("in");
  2562. $("#webuiPopover0").css("display", "none");
  2563. } else {
  2564. $("#cardNo").removeAttr("readonly");
  2565. $("#userName").removeAttr("readonly");
  2566. $("#age").removeAttr("readonly");
  2567. $("#gender").removeAttr("disabled");
  2568. $("#gender").next().removeClass("disabled");
  2569. $("#phoneNum").removeAttr("readonly");
  2570. $("#patientsNature").removeAttr("disabled");
  2571. $("#patientsNature").next().removeClass("disabled");
  2572. $("#idCard").removeAttr("readonly");
  2573. $("#address").removeAttr("readonly");
  2574. $("#birthDayReadonly").removeClass("in").addClass("hide");
  2575. $("#birthDayGroup").removeClass("hide").addClass("in");
  2576. $("#userName").removeClass("hide").addClass("in");
  2577. $("#userNameReadOnly").removeClass("in").addClass("hide");
  2578. //$("#webuiPopover0").css("display", "block");
  2579. }
  2580. }
  2581. /**
  2582. * 保存窗口号
  2583. */
  2584. function saveWindows() {
  2585. $.ajax({
  2586. type: "POST",
  2587. url: '/thmz/saveWindows',
  2588. contentType: "application/json;charset=UTF-8",
  2589. dataType: "json",
  2590. data: JSON.stringify({"windowsNo": $("#windowsNum").val()}),
  2591. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2592. success: function (res) {
  2593. if (res == '401' || res == 401) {
  2594. window.location.href = '/thmz/login/view'
  2595. return;
  2596. }
  2597. $('#editWindowsModal').modal('hide');
  2598. if (res.code == 0) {
  2599. new PNotify({
  2600. title: '操作提示',
  2601. text: res.message,
  2602. type: 'success',
  2603. hide: true,
  2604. styling: 'bootstrap3'
  2605. });
  2606. } else {
  2607. new PNotify({
  2608. title: '错误提示',
  2609. text: res.message,
  2610. type: 'error',
  2611. hide: true,
  2612. styling: 'bootstrap3'
  2613. });
  2614. }
  2615. }
  2616. });
  2617. }
  2618. /**
  2619. * 保存病人信息
  2620. */
  2621. function savePatient() {
  2622. $.ajax({
  2623. type: "POST",
  2624. url: '/thmz/savePatient',
  2625. contentType: "application/json;charset=UTF-8",
  2626. dataType: "json",
  2627. data: JSON.stringify({
  2628. "name": $("#userName").val(),
  2629. "age": $("#age").val(),
  2630. "sex": $("#gender").val(),
  2631. "birthDay": $("#birthDay").val(),
  2632. "icCardNo": $("#cardNo").val(),
  2633. "phoneNo": $("#phoneNum").val(),
  2634. "responseType": $("#patientsNature").val(),
  2635. "socialNo": $("#idCard").val(),
  2636. "address": $("#address").val()
  2637. }),
  2638. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2639. success: function (res) {
  2640. if (res == '401' || res == 401) {
  2641. window.location.href = '/thmz/login/view'
  2642. return;
  2643. }
  2644. if (res.code == 0) {
  2645. $("#patientId").val(res.data.patientId);
  2646. saveMzyReqrec();
  2647. } else {
  2648. new PNotify({
  2649. title: '错误提示',
  2650. text: res.message,
  2651. type: 'error',
  2652. hide: true,
  2653. styling: 'bootstrap3'
  2654. });
  2655. }
  2656. }
  2657. });
  2658. }
  2659. /**
  2660. * 修改病人信息
  2661. */
  2662. function modifyPatient() {
  2663. $.ajax({
  2664. type: "POST",
  2665. url: '/thmz/modifyPatient',
  2666. contentType: "application/json;charset=UTF-8",
  2667. dataType: "json",
  2668. data: JSON.stringify({
  2669. "name": $("#editUserName").val(),
  2670. "age": $("#editUserAge").val(),
  2671. "sex": $("#editUserGender").val(),
  2672. "birthDay": $("#editUserBirthDay").val(),
  2673. "icCardNo": $("#editUserCardNo").val(),
  2674. "phoneNo": $("#editUserPhoneNum").val(),
  2675. "responseType": $("#editUserPatientsNature").val(),
  2676. "socialNo": $("#editUserIdCard").val(),
  2677. "address": $("#editUserAddress").val(),
  2678. "patientId": $("#editUserCode").val(),
  2679. "relName": $("#editUserContact").val(),
  2680. "contractName": $("#editUserContactPhone").val()
  2681. }),
  2682. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2683. success: function (res) {
  2684. if (res == '401' || res == 401) {
  2685. window.location.href = '/thmz/login/view'
  2686. return;
  2687. }
  2688. if (res.code == 0) {
  2689. $('#editUserModal').modal('hide');
  2690. realClinicalReception($("#patientId").val());
  2691. } else {
  2692. new PNotify({
  2693. title: '错误提示',
  2694. text: res.message,
  2695. type: 'error',
  2696. hide: true,
  2697. styling: 'bootstrap3'
  2698. });
  2699. }
  2700. }
  2701. });
  2702. }
  2703. /**
  2704. * 保存挂号信息
  2705. */
  2706. function saveMzyReqrec() {
  2707. var mzyRequestId = $('#doctor').find("option:selected").attr('data-mzyRequestId');
  2708. $.ajax({
  2709. type: "POST",
  2710. url: '/thmz/saveMzyReqrec',
  2711. contentType: "application/json;charset=UTF-8",
  2712. dataType: "json",
  2713. data: JSON.stringify({
  2714. "mzyReqrec": {
  2715. "patientId": $("#patientId").val(),
  2716. "ampm": $("#ampm").val(),
  2717. "unitCode": $("#deptNo").val(),
  2718. "chargeType": $("#chargeType").val()
  2719. }, "responceType": $("#patientsNature").val(), "mzyRequestId": mzyRequestId
  2720. }),
  2721. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2722. success: function (res) {
  2723. if (res == '401' || res == 401) {
  2724. window.location.href = '/thmz/login/view'
  2725. return;
  2726. }
  2727. if (res.code == 0) {
  2728. new PNotify({
  2729. title: '操作提示',
  2730. text: res.message,
  2731. type: 'success',
  2732. hide: true,
  2733. styling: 'bootstrap3'
  2734. });
  2735. $('#confirmFeeModal').modal('hide');
  2736. loadTableCount();
  2737. loadRegistrationList(true);
  2738. } else {
  2739. new PNotify({
  2740. title: '错误提示',
  2741. text: res.message,
  2742. type: 'error',
  2743. hide: true,
  2744. styling: 'bootstrap3'
  2745. });
  2746. }
  2747. }
  2748. });
  2749. }
  2750. /**
  2751. * 挂号列表中的科室和医生列表初始化
  2752. */
  2753. function initListSelect() {
  2754. initListDeptSelect();
  2755. initListDoctorSelect();
  2756. }
  2757. /**
  2758. * 挂号列表中的科室列表
  2759. */
  2760. function initListDeptSelect() {
  2761. //科室列表
  2762. $.ajax({
  2763. type: "GET",
  2764. url: '/thmz/allMzUnitCode',
  2765. dataType: "json",
  2766. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2767. success: function (data) {
  2768. if (data == '401' || data == 401) {
  2769. window.location.href = '/thmz/login/view'
  2770. return;
  2771. }
  2772. var html = '';
  2773. $.each(data.data, function (commentIndex, comment) {
  2774. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  2775. });
  2776. $('#deptNoParam').empty();
  2777. $('#deptNoParam').html(html);
  2778. $('#deptNoParam').selectpicker('refresh');
  2779. }
  2780. });
  2781. }
  2782. /**
  2783. * 挂号列表中的医生列表初始化
  2784. */
  2785. function initListDoctorSelect() {
  2786. //医生列表
  2787. $.ajax({
  2788. type: "GET",
  2789. url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNoParam').val(),
  2790. dataType: "json",
  2791. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  2792. success: function (res) {
  2793. if (res == '401' || res == 401) {
  2794. window.location.href = '/thmz/login/view'
  2795. return;
  2796. }
  2797. var html = '';
  2798. $.each(res.data, function (commentIndex, comment) {
  2799. html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
  2800. });
  2801. $('#doctorParam').empty();
  2802. $('#doctorParam').html(html);
  2803. // $("#doctorParam").selectpicker({
  2804. // size: 10
  2805. // });
  2806. $('#doctorParam').selectpicker('destroy').selectpicker('refresh');
  2807. }
  2808. });
  2809. }
  2810. /**
  2811. * 加载挂号列表
  2812. * @param flag 是否清空挂号卡片列表区域
  2813. */
  2814. function loadRegistrationList(flag) {
  2815. if (flag) {
  2816. pageIndex = 0;
  2817. $("#card_regi_list").empty();
  2818. $("div.page").removeClass("in").addClass("hide");
  2819. }
  2820. var regiListType = getIndex("regi_List_type");
  2821. if (regiListType == 0) {
  2822. loadCardList();
  2823. } else if (regiListType == 1) {
  2824. loadTableList();
  2825. }
  2826. }
  2827. /**
  2828. * 获取按钮组选择的下标
  2829. * @param id
  2830. * @returns {number}
  2831. */
  2832. function getIndex(id) {
  2833. var index = 0;
  2834. var item = $("#" + id).find("button");
  2835. for (var i = 0; i <= item.length; i++) {
  2836. if ($(item[i]).hasClass("btn-primary")) {
  2837. index = i;
  2838. break;
  2839. }
  2840. }
  2841. return index;
  2842. }
  2843. /**
  2844. * 获取时间选择器的时间数组
  2845. * @returns {string[]}
  2846. */
  2847. function getRePortRangeArr() {
  2848. var rePortRange = $('#reportrange span').html();
  2849. var rePortRangeArr = rePortRange.split(" - ");
  2850. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  2851. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  2852. return rePortRangeArr;
  2853. }
  2854. /**
  2855. * 清空搜索参数
  2856. */
  2857. function clearParams() {
  2858. $("#deptNoParam").selectpicker('val', null);
  2859. $("#deptNoParam").selectpicker('refresh');
  2860. $("#doctorParam").selectpicker('val', null);
  2861. $("#deptNoParam").selectpicker('refresh');
  2862. $("#userNameParam").val(null);
  2863. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  2864. }