123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036 |
- //@ sourceURL=clinic.js
- //判断病人列表是否在加载中,防止重复加载
- var msg_list_loading = false;
- //挂号卡片列表页面下标
- var pageIndex = 0;
- var nthTabs=null;
- $(function () {
- // nthTabs = $("#ypListTables").nthTabs();
- //
- // nthTabs.addTab({
- // id:'a',
- // title:'孙悟空',
- // content:'看我七十二变',
- // }).addTab({
- // /*换个姿势*/
- // id:'b',
- // title:'猪八戒-关不掉',
- // content:'高老庄娶媳妇',
- // active:true,
- // allowClose:false,
- // }).addTab({
- // id:'c',
- // title:'沙和尚',
- // content:'请叫我大叔',
- // }).addTab({
- // id:'d',
- // title:'唐僧',
- // content:'光头一个',
- // }).addTab({
- // id:'e',
- // title:'武松',
- // content:'打虎猛汉',
- // }).addTab({
- // id:'f',
- // title:'潘金莲',
- // content:'求爱爱',
- // }).addTab({
- // id:'g',
- // title:'来个标题长一点的的的来个标题长一点的的的',
- // content:'你赢了',
- // }).addTab({
- // id:'h',
- // title:'支持连贯操作',
- // content:'没错就是这么爽',
- // }).addTab({
- // id:'i',
- // title:'欢迎提意见',
- // content:'一定一定',
- // }).addTab({
- // id:'j',
- // title:'熬夜写的啊',
- // content:'码农苦逼~',
- // }).setActTab("#c");
- initGenderSelect();
- initResponceTypeSelect();
- $('#editUserBirthDayGroup').datetimepicker({
- format: 'yyyy-mm-dd',
- language: 'zh-CN',
- minView: "month",
- });
- initDaterangepickerWithId('reportrange', "right");
- formatCheck();
- //数据校验
- init_validator();
- //时间区间
- initMzWorkTime();
- //初始频次下拉选
- initOrderFrequencys();
- //初始用药方式下拉选
- initSupplyTypes();
- /**
- * 清空
- */
- $("#clearRegistration").on("click", function (t) {
- $("#cardNo").val(null);
- $("#cardNo").attr("title", null);
- $("#userName").val(null);
- $("#age").val(null);
- $("#gender").selectpicker('val', 1);
- $("#gender").selectpicker('refresh');
- $("#birthDay").val(null);
- $("#birthDay").attr("title", null);
- $("#phoneNum").val(null);
- $("#phoneNum").attr("title", null);
- $("#patientsNature").selectpicker('val', '01');//默认选中
- $('#patientsNature').selectpicker('refresh');
- $("#idCard").val(null);
- $("#idCard").attr("title", null);
- $("#address").val(null);
- $("#patientId").val(null);
- $("#editUser").hide();
- //默认光标在卡号输入框
- $("#cardNo").focus();
- initMzWorkTime();
- readonlyOrNot(false);
- });
- //加载候诊患者列表
- loadUnClinicTableList();
- //加载接诊中患者列表
- loadInClinicTableList();
- //加载已接诊患者列表
- loadClinicTableList();
- //每隔一分钟秒读加载候诊患者列表
- setInterval(function () {
- //加载候诊患者列表
- loadUnClinicTableList();
- }, 60000);
- //初始化快速接诊病人姓名栏事件
- initUserList();
- //初始化主诉弹出层
- initRecommendList();
- //卡号输入改变事件
- cardNoChange();
- /**
- * 患者信息修改
- */
- $("#saveEditUser").on("click", function (t) {
- modifyPatient();
- });
- /**
- * 挂号列表中的科室和医生列表初始化
- */
- initListSelect();
- //折叠按钮初始化
- $(".collapse-link").on("click", function () {
- var a = $(this).closest(".x_panel")
- , b = $(this).find("i")
- , c = a.find(".x_content");
- a.attr("style") ? c.slideToggle(200, function () {
- a.removeAttr("style").css("background", "#EBEBE4");
- }) : (c.slideToggle(200),
- a.css("height", "auto").css("background", "#EBEBE4")),
- b.toggleClass("fa-chevron-up fa-chevron-down")
- });
- /**
- * 接诊
- */
- $("#saveapidAccepts1").on("click", function (t) {
- var saveapidAccepts1 = $("#patientIdDb").val();
- clinicalReception(saveapidAccepts1);
- clearRapidAcceptsModal();
- $("#rapidAcceptsModal").modal("hide");
- });
- /**
- * 实例化智能问诊弹窗
- */
- // $("[data-toggle='popover']").popover();
- $("#box-arrow-left").popover({
- html: 'true',
- content: '<div id="smartAssistPopoverContent"></div>'
- });
- //初始化药品分组下拉选
- initGroupOrder();
- // 初始化用药天数下拉选
- initDayNum();
- /**
- * 给药方式设置最高的下拉选高度
- */
- $("#supplyType").on('shown.bs.select', function (e) {
- $("#supplyType").siblings('.dropdown-menu').css("max-height", "360px");
- $('#supplyType').parent().find("input").keydown(function () {
- $("#supplyType").siblings.css("max-height", "360px");
- })
- });
- /**
- * 用药频率设置最高的下拉选高度
- */
- $("#orderFrequency").on('shown.bs.select', function (e) {
- $("#orderFrequency").siblings('.dropdown-menu').css("max-height", "360px");
- $('#orderFrequency').parent().find("input").keydown(function () {
- $("#orderFrequency").siblings('.dropdown-menu').css("max-height", "360px");
- })
- });
- });
- /**
- * 初始化用药天数下拉选
- */
- function initDayNum() {
- 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>';
- $('#dayNum').html(html);
- $('#dayNum').selectpicker('refresh');
- }
- /**
- * 初始化药品分组下拉选
- */
- function initGroupOrder() {
- var html = '<option value="1">1</option>';
- $('#groupId').html(html);
- $('#groupId').selectpicker('refresh');
- $("#groupId").selectpicker('val', 1);
- $('#groupId').selectpicker('refresh');
- }
- /**
- * 追加分组
- */
- function appendGroupOrder() {
- var last = parseInt($("#groupId > option:last").val());
- last++;
- var html = '<option value="' + last + '">' + last + '</option>';
- $('#groupId').append(html);
- $('#groupId').selectpicker('refresh');
- }
- /**
- * 关闭只能问诊弹框
- */
- function closePopover() {
- //$(".popover").popover('hide');
- $("#box-arrow-left").click();
- }
- /**
- * 加载只能问诊弹框内容
- */
- function contentMethod() {
- setTimeout(function () {
- $(".popover div.arrow").css("display", "none");
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (popoverId == undefined) {
- return;
- }
- var left = $("#" + popoverId).css("left");
- left = left.replace("px", "");
- left = parseInt(left);
- left = left + 55;
- $("#" + popoverId).css("height", "100%").css("top", "0px").css("left", left + "px").css("border-radius", "0px").css("z-index", "11");
- $("#" + popoverId + " .popover-content").css("height", "100%");
- $("#smartAssistPopoverContent").css("height", "100%");
- var html = ' <div style="height: 34%;padding-left: 15px;width: 100%;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' <span id="patientHisData"></span>就医轨迹' +
- ' </button>' +
- ' <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true" onclick="closePopover()">×</span>' +
- ' </button>' +
- ' <div style="height: calc(100% - 39px);border: 1px solid #DDDDDD;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="patientHisDataForm">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 33%;padding-left: 15px;">' +
- ' <button type="button" style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px;"' +
- ' class="btn btn-primary">' +
- ' <span id="recommendType"></span>推荐' +
- ' </button>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;text-align: -webkit-center;position: relative;" id="recommendForm">' +
- ' <img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">' +
- ' </form>' +
- ' </div>' +
- ' </div>' +
- ' <div style="height: 33%;padding-left: 15px;">' +
- ' <button type="button"' +
- ' style="cursor: default;margin-bottom: 0px;margin-right: 0px;margin-top: 5px; font-size: 12px;"' +
- ' class="btn btn-primary">' +
- ' 医疗范本' +
- ' </button>' +
- ' <div style="height: calc(100% - 44px);border: 1px solid #DDDDDD;overflow-y: auto;margin-top: 5px;width: 100%;">' +
- ' <form class="form-horizontal form-label-left mz-fixed-form" novalidate autocomplete="off"' +
- ' style="height: 100%;overflow-y: auto;width: 100%;">' +
- ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
- ' <div title="急性上呼吸道感染"' +
- ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
- ' 急性上呼吸道感染' +
- ' </div>' +
- ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
- ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
- ' style="cursor: pointer; color: #2e69eb;"' +
- ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
- ' </div>' +
- ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
- ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
- ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
- ' </div>' +
- ' </div>' +
- ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
- ' <div title="急性上呼吸道感染"' +
- ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
- ' 急性上呼吸道感染' +
- ' </div>' +
- ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
- ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
- ' style="cursor: pointer; color: #2e69eb;"' +
- ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
- ' </div>' +
- ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
- ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
- ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
- ' </div>' +
- ' </div>' +
- ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
- ' <div title="急性上呼吸道感染"' +
- ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
- ' 急性上呼吸道感染' +
- ' </div>' +
- ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
- ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
- ' style="cursor: pointer; color: #2e69eb;"' +
- ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
- ' </div>' +
- ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
- ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
- ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
- ' </div>' +
- ' </div>' +
- ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
- ' <div title="急性上呼吸道感染"' +
- ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
- ' 急性上呼吸道感染' +
- ' </div>' +
- ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
- ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
- ' style="cursor: pointer; color: #2e69eb;"' +
- ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
- ' </div>' +
- ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
- ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
- ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
- ' </div>' +
- ' </div>' +
- ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
- ' <div title="急性上呼吸道感染"' +
- ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
- ' 急性上呼吸道感染' +
- ' </div>' +
- ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
- ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
- ' style="cursor: pointer; color: #2e69eb;"' +
- ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
- ' </div>' +
- ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
- ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
- ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
- ' </div>' +
- ' </div>' +
- ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">' +
- ' <div title="急性上呼吸道感染"' +
- ' style="margin-left: 10px!important;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: 100px;">' +
- ' 急性上呼吸道感染' +
- ' </div>' +
- ' <div style="float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 160px);"' +
- ' title="肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多">诊断:<a' +
- ' style="cursor: pointer; color: #2e69eb;"' +
- ' onclick="medicalModelModal(1)">肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多肺嗜酸性粒细胞增多</a>' +
- ' </div>' +
- ' <div style="float: left;width: 36px;cursor: pointer;" onclick="medicalModelModal(1)"><img' +
- ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"' +
- ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>' +
- ' </div>' +
- ' </div>' +
- ' </form>' +
- ' </div>' +
- ' </div>';
- $("#smartAssistPopoverContent").html(html);
- fitPatientHisData();
- fitSymptomData();
- fitEmrHpiData();
- fitEmrPsData();
- fitDiagnoseData();
- }, 100);
- // setTimeout(function () {
- // $("#patientHisDataForm").html("aadsasfasdfasdfasdfasdfsdfasdfasdfasdfdfafda");
- // },1000);
- }
- /**
- * 设置患者的就诊轨迹
- */
- function fitPatientHisData() {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var emptyHtml = '<img src="/thmz/images/locus.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- if ($("#patientId").val() == null || $("#patientId").val() == "") {
- $("#patientHisDataForm").html(emptyHtml);
- return;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "patientId": $("#patientId").val(),
- "clinicStatuses": [5, 6],
- "pageSize": 10000,
- "offset": 0,
- "beginDate": "2012-02-01 00:00:00",
- "endDate": format(new Date(), "yyyy-MM-dd HH:mm:ss")
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var icdText = data[i].icdText;
- if (icdText == null) {
- // continue;
- icdText = "空白诊断";
- }
- icdText = icdText.trim();
- html += ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">';
- html += ' <div style="float: left;width: 172px;">';
- html += ' <img src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/stopwatch.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' <span style="width: 120px;margin-right: 20px!important;">' + format(data[i].opDay, "yyyy-MM-dd HH:mm") + '</span>';
- html += ' </div>';
- html += ' <div style="text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 172px);"';
- html += ' title="' + icdText + '">诊断:<a style="cursor: pointer; color: #2e69eb;"';
- html += ' onclick="visitingDetailModal(1)">' + icdText + '</a>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#patientHisData").text($("#patientName").text() + "的");
- if ($("#patientId").val() == null || $("#patientId").val() == "") {
- $("#patientHisDataForm").html(emptyHtml);
- } else {
- $("#patientHisDataForm").html(html);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 设置主诉推荐
- */
- function fitSymptomData() {
- fitRecommendData(12);
- }
- /**
- * 设置现病史推荐
- */
- function fitEmrHpiData() {
- fitRecommendData(5);
- }
- /**
- * 设置既往史推荐
- */
- function fitEmrPsData() {
- fitRecommendData(6);
- }
- /**
- * 设置诊断推荐
- */
- function fitDiagnoseData() {
- fitRecommendData(13);
- }
- /**
- * 设置推荐通用方法
- */
- function fitRecommendData(paramsType) {
- var popoverId = $("#box-arrow-left").attr("aria-describedby");
- if (!$("#" + popoverId).hasClass("in")) {
- return;
- }
- var inputId = "symptom";
- var text = "主诉";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史";
- } else if (paramsType == 13) {
- inputId = "diagnose";
- text = "诊断";
- }
- //光标不在现病史上
- if (document.activeElement.id != inputId) {
- return;
- }
- $("#recommendType").html(text);
- var emptyHtml = '<img src="/thmz/images/no-recommend.png" style="height: 120px;position: absolute;top: 50%;transform: translateY(-50%);margin-left: -30px;">';
- $.ajax({
- type: "GET",
- url: '/thmz/getTCommonParamsByParamsType?paramsType=' + paramsType + '&commonParams=&pageSize=10',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- var html = '';
- var data = res.data;
- if (data == null || data.length == 0) {
- html += emptyHtml;
- } else {
- for (var i = 0; i < data.length; i++) {
- var paramsContent = data[i].paramsContent;
- html += ' <div class="item form-group thmz_alert" style="padding: 10px 0;width: 100%;">';
- html += ' <div style="margin-left: 10px;float: left;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;width: calc(100% - 60px);" title="' + paramsContent + '">';
- html += paramsContent;
- html += ' </div>';
- html += ' <div style="float: left;width: 36px;cursor: pointer;"';
- html += ' onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ')">';
- html += ' <img';
- html += ' src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
- html += ' style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
- html += ' </div>';
- html += ' </div>';
- }
- }
- $("#recommendForm").html(html);
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空快速接诊弹窗
- */
- function clearRapidAcceptsModal() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- }
- /**
- * 清空接诊台用户信息
- */
- function clearUser() {
- $("#patientName").html("");
- $("#patientAge").html("");
- $("#patientGender").html("");
- $("#patientId").val(null);
- $("#patientPhone").html("");
- $("#patientPhoneLabel").hide();
- $("#patientResponseType").html("");
- $("#first").parent().addClass("checked");
- $("#not").parent().removeClass("checked");
- $("#patientHisData").text("");
- }
- /**
- * 卡号输入改变事件
- */
- function cardNoChange() {
- if (window.ActiveXObject || "ActiveXObject" in window) {
- $("#rapidAcceptsUserCardNo").on('input propertychange', function () {
- queryUserInfoByCardNo();
- });
- } else {
- $("#rapidAcceptsUserCardNo").on('input οninput', function () {
- queryUserInfoByCardNo();
- });
- }
- }
- /**
- * 刷新就诊列表
- */
- function refreshClinic() {
- loadInClinicTableList();
- loadClinicTableList();
- }
- /**
- * 加载接诊中患者列表
- */
- function loadInClinicTableList() {
- //loadCommonClinicTableList("tb_table_in_clinic","/thmz/getInClinicWithPage");
- loadCommonClinicTableList("tb_table_in_clinic", queryParamsInClinic);
- }
- /**
- * 加载已接诊患者列表
- */
- function loadClinicTableList() {
- //loadCommonClinicTableList("tb_table_clinic","/thmz/getClinicWithPage");
- loadCommonClinicTableList("tb_table_clinic", queryParamsClinic);
- }
- /**
- * 加载患者列表通用方法
- * @param id
- * @param queryParams
- */
- function loadCommonClinicTableList(id, queryParams) {
- $('#' + id).bootstrapTable('refresh');
- $('#' + id).bootstrapTable({
- url: "/thmz/getClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParams, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'patientName',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return value + "/" + row.gender + "/" + row.age + "岁";
- }
- }, {
- field: 'opDay',
- title: '接诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.clinicStatus == 5) {
- return '<a title="修改" style="cursor: pointer"></a>修改 <a title="详情">详情</a>';
- } else {
- return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\')" style="cursor: pointer">接诊</a> <a title="详情">详情</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- if (id == "tb_table_clinic") {
- $("#ClinicNum").html(data.total);
- } else {
- $("#inClinicNum").html(data.total);
- }
- }
- });
- }
- /**
- * 得到查询的参数
- * @param params
- * @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}}
- */
- function queryParamsInClinic(params) {
- var rePortRangeArr = getRePortRangeArr();
- var temp = {
- beginDate: rePortRangeArr[0],
- endDate: rePortRangeArr[1],
- commonParams: $("#userName").val(),
- clinicStatuses: [4],
- pageSize: params.limit,
- offset: params.offset
- };
- return temp;
- };
- /**
- * 得到查询的参数
- * @param params
- * @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}}
- */
- function queryParamsClinic(params) {
- var rePortRangeArr = getRePortRangeArr();
- var temp = {
- beginDate: rePortRangeArr[0],
- endDate: rePortRangeArr[1],
- commonParams: $("#userName").val(),
- clinicStatuses: [5, 6, 7],
- pageSize: params.limit,
- offset: params.offset
- };
- return temp;
- };
- /**
- * 加载待诊患者列表方法
- */
- function loadUnClinicTableList() {
- $('#tb_table_un_clinic').bootstrapTable('refresh');
- $('#tb_table_un_clinic').bootstrapTable({
- url: "/thmz/getUnClinicWithPage", //请求后台的URL(*)
- method: 'post', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: true, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: queryParamsUnClinic, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'name',
- title: '姓名/性别/年龄',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return value + "/" + row.gender + "/" + row.age + "岁";
- }
- }, {
- field: 'visitDate',
- title: '分诊时间',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- return format(value, "MM/dd HH:mm");
- }
- }
- , {
- title: '操作',
- align: "center",
- valign: 'middle',
- // sortable: true,
- formatter: function (value, row, index) {
- if (row.statusFlag == 0) {
- return '<a title="接诊">接诊</a>';
- } else {
- return '<a title="通知" onclick="editUserModal(\'' + row.patientId + '\')">通知</a> <a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\')" style="cursor: pointer">接诊</a>';
- }
- }
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- new PNotify({
- title: '错误提示',
- text: ress.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.total,//总页数
- "rows": ress.data //数据
- };
- },
- onLoadSuccess: function (data) {
- $(".pagination-detail").css("display", "none");
- $("#unClinicNum").html(data.total);
- }
- });
- }
- /**
- * 得到查询的参数
- * @param params
- * @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}}
- */
- function queryParamsUnClinic(params) {
- var temp = {
- pageSize: params.limit,
- pageIndex: params.offset / params.limit, //页码
- };
- return temp;
- };
- /**
- * 接诊方法
- * @param patientId
- */
- function clinicalReception(patientId) {
- var existPatientId = $("#patientId").val();
- if (existPatientId != null && existPatientId != "" && existPatientId != patientId) {
- $("#messageModal").modal();
- $("#messageContent").html("当前有病人正在接诊,是否切换?");
- $("#messageButton").on("click", function (t) {
- $("#messageModal").modal("hide");
- clearWorkSpace();
- realClinicalReception(patientId)
- });
- } else {
- realClinicalReception(patientId)
- }
- }
- /**
- * 真实的接诊方法
- * @param patientId
- */
- function realClinicalReception(patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- $("#patientName").html(res.data.name);
- $("#patientAge").html(res.data.age);
- $("#patientGender").html(res.data.gender);
- $("#patientId").val(patientId);
- if (res.data.phoneNo != null && res.data.phoneNo != '') {
- $("#patientPhone").html(res.data.phoneNo);
- $("#patientPhoneLabel").show();
- } else {
- $("#patientPhoneLabel").hide();
- }
- $("#patientResponseType").html(res.data.responseTypeName);
- if (res.data.times == 1) {
- $("#first").parent().addClass("checked");
- $("#not").parent().removeClass("checked");
- } else {
- $("#not").parent().addClass("checked");
- $("#first").parent().removeClass("checked");
- }
- $("#patientHisData").text(res.data.name);
- fitPatientHisData();
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 清空工作台
- */
- function clearWorkSpace() {
- //TODO
- clearUser();
- }
- /**
- * 就诊详情
- * @param id
- */
- function visitingDetailModal(id) {
- $("#visitingDetailModal").modal();
- }
- /**
- * 医疗范文
- * @param id
- */
- function medicalModelModal(id) {
- $("#medicalModelModal").modal();
- }
- /**
- * 底层填充推荐方法
- * @param paramsType
- * @param appeal
- * @param inputId
- */
- function extracted(paramsType, appeal, inputId) {
- if (paramsType == 13) {
- var contentArr = appeal.split(",");
- if (contentArr != null && contentArr.length > 0) {
- for (var i = 0; i < contentArr.length; i++) {
- var content = contentArr[i].replace(")", "").replace("(", "-");
- var diagnoseArr = content.split("-");
- if (diagnoseArr == null || diagnoseArr.length == 0) {
- continue;
- }
- fitDiagnoseValue(diagnoseArr[0], diagnoseArr[1]);
- }
- }
- } else {
- $("#" + inputId).val(appeal);
- }
- }
- /**
- * 填充推荐
- * @param appeal
- * @param paramsType
- */
- function fitAppeal(appeal, paramsType) {
- var inputId = "symptom";
- var text = "主诉项已经录入,是否覆盖?";
- if (paramsType == 5) {
- inputId = "emrHpi";
- text = "现病史项已经录入,是否覆盖?";
- } else if (paramsType == 6) {
- inputId = "emrPs";
- text = "既往史项已经录入,是否覆盖?";
- } else if (paramsType == 13) {
- inputId = "diagnoseValue";
- text = "诊断项已经录入,是否覆盖?";
- }
- var symptom = $("#" + inputId).val();
- if (paramsType == 13 && (symptom == ",," || symptom == ",")) {
- symptom = null;
- }
- if (symptom != null && symptom != "") {
- $("#messageModal").modal();
- $("#messageContent").html(text);
- $("#messageButton").on("click", function (t) {
- $("#messageModal").modal("hide");
- if (paramsType == 13) {
- $("#" + inputId).val(null);
- $("#diagnoseTags").html(null);
- }
- extracted(paramsType, appeal, inputId);
- });
- } else {
- extracted(paramsType, appeal, inputId);
- }
- }
- /**
- * 初始化性别下拉选
- */
- function initGenderSelect() {
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- var gender = '<option value="1">男</option><option value="2">女</option><option value="0">未知</option>';
- $('#rapidAcceptsUserGender').html(gender);
- $('#rapidAcceptsUserGender').selectpicker('refresh');
- $('#editUserGender').html(gender);
- $('#editUserGender').selectpicker('refresh');
- }
- /**
- * 初始化病人身份类别下拉选
- */
- function initResponceTypeSelect() {
- $(".selectpicker").selectpicker({
- dropuAuto: false
- });
- $.ajax({
- type: "GET",
- url: '/thmz/getMzResponceType',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- res.data.forEach(function (item, index) {
- var html = '<option value="' + item.code + '">' + item.name + '</option>';
- $('#patientsNature').append(html);
- $('#editUserPatientsNature').append(html);
- });
- $('#patientsNature').selectpicker('refresh');
- $('#editUserPatientsNature').selectpicker('refresh');
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: false,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 初始科室下拉选
- * @param ampm 时间段区间
- */
- function initDeptPlus() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/getUnitCodeByRequestDay?ampm=' + $("#ampm").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#deptNo').empty();
- $('#deptNo').html(html);
- $('#deptNo').selectpicker('refresh');
- $('#chargeType').empty();
- $('#chargeType').selectpicker('refresh');
- emptyInput();
- }
- });
- }
- /**
- * 初始医生下拉选
- * @param ampm 时间段区间
- */
- function initEmployee() {
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/getDoctorCodeByRequestDay?unitCode=' + $('#deptNo').val() + "&m=" + $("#ampm").val() + "&chargeType=" + $("#chargeType").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- var flag = false;
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.employee.employeeCode + '" data-chargeType="' + comment.chargeType + '" data-checkFee="' + comment.checkFee + '" data-mzyRequestId="' + comment.mzyRequestId + '">' + comment.employee.employeeName + '</option>';
- if (comment.employeeCode == -1) {
- flag = true;
- }
- });
- $('#doctor').empty();
- $('#doctor').html(html);
- $('#doctor').selectpicker('refresh');
- validator.checkAll($("#regi_form"));
- if (flag) {
- //如果有无需选择医生的选项,默认选择
- $('#doctor').selectpicker('val', -1);
- $('#doctor').selectpicker('refresh');
- fitFee();
- }
- }
- });
- }
- /**
- * 初始门诊时间区间下拉选
- */
- function initMzWorkTime() {
- $.ajax({
- type: "GET",
- url: '/thmz/getMzWorkTime',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- var ampm = null;
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- if (ampm == null || (ampm != "a" && ampm != "p")) {
- var startTime = paseToFullTime(comment.startTime);
- var endTime = paseToFullTime(comment.endTime);
- if (range(startTime, endTime)) {
- ampm = comment.code;
- }
- }
- });
- $('#ampm').empty(); //清空resText里面的所有内容
- $('#ampm').html(html);
- $('#ampm').selectpicker('refresh');
- $("#ampm").selectpicker('val', ampm);
- $('#ampm').selectpicker('refresh');
- initDeptPlus();
- }
- });
- }
- /**
- * 初始门诊号别下拉选
- */
- function initChargeType() {
- $.ajax({
- type: "GET",
- url: '/thmz/getChargeTypeByRequestDay?unitCode=' + $('#deptNo').val() + "&m=" + $("#ampm").val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#chargeType').empty(); //清空resText里面的所有内容
- $('#chargeType').html(html);
- $('#chargeType').selectpicker('refresh');
- validator.checkAll($("#regi_form"));
- emptyInput();
- }
- });
- }
- /**
- * 设置挂号费等费用
- */
- function fitFee() {
- var chargeType = $('#doctor').find("option:selected").attr('data-chargeType');
- var checkFee = $('#doctor').find("option:selected").attr('data-checkFee');
- $("#checkFee").val(checkFee);
- $("#amountMoney").text(checkFee);
- $("#amountMoneyConfirm").text(checkFee);
- $("#realMoney").val(checkFee);
- $("#cash").val(checkFee);
- $("#changeAmount").val(0);
- $.ajax({
- type: "GET",
- url: '/thmz/getMzChargeTypeByCode?code=' + chargeType,
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $("#registrationFee").val(res.data.reqFee);
- $("#hospitalFee").val(res.data.clinicFee);
- checkFee = parseFloat(checkFee) + parseFloat(res.data.reqFee) + parseFloat(res.data.clinicFee);
- $("#amountMoney").text(checkFee);
- $("#amountMoneyConfirm").text(checkFee);
- $("#realMoney").val(checkFee);
- $("#cash").val(checkFee);
- }
- });
- }
- /**
- * 初始频次下拉选
- */
- function initOrderFrequencys() {
- $.ajax({
- type: "GET",
- url: '/thmz/getOrderFrequencys',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '" desc="' + comment.times + '">' + comment.name + '(' + comment.code + ')' + '</option>';
- });
- $('#orderFrequency').empty();
- $('#orderFrequency').html(html);
- $('#orderFrequency').selectpicker('refresh');
- }
- });
- }
- /**
- * 初始用药方式下拉选
- */
- function initSupplyTypes() {
- $.ajax({
- type: "GET",
- url: '/thmz/getSupplyTypes',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#supplyType').empty();
- $('#supplyType').html(html);
- $('#supplyType').selectpicker('refresh');
- }
- });
- }
- /**
- * 日期值改变修改年龄字段
- * @param ev
- */
- function changeDate(ev) {
- }
- /**
- * 列表类型按钮切换事件
- * @param object
- */
- function titleButtonChange(object) {
- $("#regi_List_btn_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- loadRegistrationList(true);
- }
- /**
- * 表格类型切换事件 卡片展示或者列表形式
- */
- function listTypeChange(object) {
- //var indexNum = 0;
- $("#regi_List_type").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- // if (object == element) {
- // indexNum = index;
- // }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- loadRegistrationList(true);
- }
- /**
- * 保存当前药品到右边处方区域 西药
- */
- function saveWesternMedicine() {
- $("#xyTab").append('<li><a href="#test" role="tab" data-toggle="pill">test</a></li>');
- $("#xyTabContent").append('<div class="tab-pane fade" id="test">规则内容面板sdfdfasdfasdfd</div>');
- //组号
- var groupId = $("#groupId").val();
- //药品名称
- var westernMedicineNamme = $("#western_medicine_namme").val();
- //当前药品编码
- var currentCode = $("#current_code").val();
- //当前药品规格
- var currentSerial = $("#current_serial").val();
- //用法编码
- var supplyType = $("#supplyType").val();
- //用法描述
- var supplyTypeText = $('#supplyType option:selected').text();
- //药品默认单次使用剂量
- var drugWinDb = $("#drugWinDb").val();
- //处方实际单次使用剂量
- var drugWin = $("#drugWin").val();
- //剂量单位
- var drugWinUnit = $("#drugWinUnit").val();
- //天数
- var dayNum = $("#dayNum").val();
- //频次编码
- var orderFrequency = $("#orderFrequency").val();
- //频次描述
- var orderFrequencyText = $('#orderFrequency option:selected').text();
- //总量
- var gross = $("#gross").val();
- //包装单位
- var packUnit = $("#packUnit").val();
- //医嘱
- var medicalAdvice = $("#medicalAdvice").val();
- var html = '<div class="form-group">';
- html += groupId + '. ';
- html += westernMedicineNamme + ' ';
- html += drugWinDb + drugWinUnit + ' ';
- html += drugWin + drugWinUnit + ' 共';
- html += gross + packUnit + '<br/> ';
- html += '用法:' + supplyTypeText + ' ';
- html += '频次:' + orderFrequencyText + ' ';
- html += dayNum + '天 ';
- if (medicalAdvice != null && medicalAdvice != '') {
- html += '医嘱:' + medicalAdvice;
- }
- html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
- html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 30px;font-size: 20px;"></i>';
- html += '</div>';
- $("div.rb_item_0").each(function () {
- if ($(this).css("display") === "block") {
- $(this).find("div:eq(1)").append(html);
- }
- });
- var groupIdLast = $("#groupId option:last-child").text();
- if (groupId === groupIdLast) {
- appendGroupOrder();
- }
- // clearWesternMedicine();
- }
- /**
- * 清空西药
- */
- function clearWesternMedicine() {
- //药品名称
- $("#western_medicine_namme").val(null);
- //当前药品编码
- $("#current_code").val(null);
- //当前药品规格
- $("#current_serial").val(null);
- //用法编码
- $("#supplyType").selectpicker('val', null);
- $('#supplyType').selectpicker('refresh');
- //药品默认单次使用剂量
- $("#drugWinDb").val(null);
- //处方实际单次使用剂量
- $("#drugWin").val(null);
- //剂量单位
- $("#drugWinUnit").selectpicker('val', null);
- $('#drugWinUnit').selectpicker('refresh');
- //天数
- $("#dayNum").selectpicker('val', null);
- $('#dayNum').selectpicker('refresh');
- //频次编码
- $("#orderFrequency").selectpicker('val', null);
- $('#orderFrequency').selectpicker('refresh');
- //总量
- $("#gross").val(null);
- //包装单位
- $("#packUnit").selectpicker('val', null);
- $('#packUnit').selectpicker('refresh');
- //单价
- $("#packRetprice").val(null);
- //金额
- $("#totalRetprice").val(null);
- //医嘱
- $("#medicalAdvice").val(null);
- }
- /**
- * 打开编辑用户信息窗口
- * @param data
- */
- function editUserModal() {
- $("#editUserModal").modal();
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?patientId=' + $("#patientId").val(),
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //延时调用,因为当前弹框还没有加载出来,校验规则无法获取光标与模拟光标丢失事件,延时可以等弹框加载出来后模拟事件
- setTimeout(function () {
- fillPlusPatinet(res.data);
- }, 400);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 收费明细类型按钮切换事件
- * @param object
- * @param objectIndex
- */
- function billItemButtonChange(object, objectIndex) {
- $("#bill_item_group").find("button").each(function (index, element) {
- if ($(element).hasClass("btn-primary")) {
- $(element).removeClass("btn-primary").addClass("btn-default");
- }
- if (index == objectIndex) {
- } else {
- }
- });
- $(object).removeClass("btn-default").addClass("btn-primary");
- // initChargeDetailTable();
- //默认光标在卡号输入框
- // $("#cardNo").focus();
- }
- /**
- * 打开智能辅助医生系统窗口
- * @param data
- */
- function smartAssistModal() {
- //点击模态框外不关闭模态框
- $("#smartAssistModal").modal({
- backdrop: "false"
- });
- //$(".modal-backdrop").remove();
- }
- /**
- * 打开退费信息窗口
- * @param data
- */
- function backNoModal(data) {
- $("#backNoModal").modal();
- }
- /**
- * 打开打印窗口
- * @param data
- */
- function printOrPreviewModal(data) {
- $("#printOrPreviewModal").modal();
- }
- /**
- * 打开打印内容窗口
- * @param data
- */
- function printModal(data) {
- $("#printOrPreviewModal").modal("hide");
- $("#printModal").modal();
- }
- /**
- * 打开快速接诊窗口
- * @param data
- */
- function rapidAcceptsModal() {
- $("#rapidAcceptsModal").modal();
- //延迟触发 默认光标在卡号输入框
- setTimeout('$("#rapidAcceptsUserCardNo").focus();', 500);
- }
- /**
- * checkBox样式
- */
- function formatCheck() {
- if ($("input.flat")[0]) {
- $(document).ready(function () {
- $('input.flat').iCheck({
- checkboxClass: 'icheckbox_flat-blue',
- radioClass: 'iradio_flat-blue'
- });
- });
- }
- }
- /**
- * 卡号有变化后查询病人信息
- */
- function queryUserInfoByCardNo() {
- //当反写的id不存在,说明不是查询后的改变事件,触发查询
- var rapidAcceptsUserCardNo = $("#rapidAcceptsUserCardNo").val();
- var index = rapidAcceptsUserCardNo.indexOf("-");
- if (($("#patientIdDb").val() == null || $("#patientIdDb").val() == "") && ((index > 0 && index == rapidAcceptsUserCardNo.length - 2) || rapidAcceptsUserCardNo.length == 8)) {
- $("#cardNo").attr("title", rapidAcceptsUserCardNo);
- $.ajax({
- type: "GET",
- url: '/thmz/getByIcCardNo?icCardNo=' + rapidAcceptsUserCardNo,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- $("#rapidAcceptsUserName").val(res.data.name);
- $("#rapidAcceptsUserCode").val(res.data.patientId);
- $("#patientIdDb").val(res.data.patientId);
- $("#rapidAcceptsUserCardNo").val(res.data.icCardNo);
- $("#rapidAcceptsUserGender").selectpicker('val', res.data.sex);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(res.data.phoneNo);
- $("#rapidAcceptsUserIdCard").val(res.data.socialNo);
- $("#rapidAcceptsUserIdCard").attr("title", res.data.socialNo);
- $("#rapidAcceptsUserPhoneNum").attr("title", res.data.phoneNo);
- } else {
- errorMesageSimaple("病人信息不存在!");
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- }
- /**
- * 清空快速接诊查询框
- */
- function clearRapidAccepts() {
- $("#rapidAcceptsUserName").val(null);
- $("#rapidAcceptsUserCode").val(null);
- $("#patientIdDb").val(null);
- $("#rapidAcceptsUserCardNo").val(null);
- $("#rapidAcceptsUserGender").selectpicker('val', 0);
- $("#rapidAcceptsUserGender").selectpicker('refresh');
- $("#rapidAcceptsUserPhoneNum").val(null);
- $("#rapidAcceptsUserIdCard").val(null);
- $("#rapidAcceptsUserIdCard").attr("title", null);
- $("#rapidAcceptsUserPhoneNum").attr("title", null);
- $("#rapidAcceptsUserCardNo").focus();
- }
- /**
- * 校验收款金额
- */
- function checkFee() {
- var cash = parseFloat($("#cash").val());
- var realMoney = parseFloat($("#realMoney").val());
- realMoney = realMoney.toFixed(2);
- $("#realMoney").val(realMoney)
- if (cash < realMoney) {
- new PNotify({
- title: '错误提示',
- text: "收款金额不能少于实收金额!",
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- } else if (cash > realMoney) {
- if ($("#payType").val() == 1) {
- var changeAmount = cash - realMoney;
- $("#changeAmount").val(changeAmount.toFixed(2));
- } else {
- new PNotify({
- title: '错误提示',
- text: "非现金收款金额不能大于实收金额!",
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- //计算和设置折扣比例
- var amountMoneyConfirm = parseFloat($("#amountMoneyConfirm").text());
- var discount = realMoney / amountMoneyConfirm * 100;
- $("#discount").text(discount.toFixed(2))
- }
- /**
- * 根据病人姓名输入框内容动态加载病人列表
- */
- function initUserList() {
- //var width=$("#userName").css("width");
- var settings = {
- trigger: 'click',
- content: '',
- width: 170,
- multi: true,
- closeable: false,
- style: '',
- delay: 300,
- padding: true,
- height: 300
- };
- var webuiPopover = $('#rapidAcceptsUserName').webuiPopover('destroy').webuiPopover(settings);
- //用户姓名选中事件
- $("#rapidAcceptsUserName").on("click", function (t) {
- if ($(webuiPopover).css("display") == "block") {
- refeshPatinetList(true);
- }
- });
- }
- /**
- * 刷新候诊病人列表
- */
- function refeshPatinetList(flag) {
- //如果是重新加载病人列表,需要重置下标
- if (flag) {
- //重置下标
- pageIndex = 0;
- msg_list_loading = true;
- }
- var userName = $('#rapidAcceptsUserName').val();
- if (!(userName == null || userName == "" || isChinese(userName))) {
- return;
- }
- $.ajax({
- type: "POST",
- url: '/thmz/getUnClinicWithPage',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"name": userName, "pageIndex": pageIndex}),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- $("#webuiPopover0").css("display", "block");
- $("#webuiPopover0 .webui-popover-content").css("max-height", "300px").css("height", "auto");
- var html = '<div class="list-group">';
- for (var i = 0; i < res.data.length; i++) {
- var mzPatientMi = res.data[i];
- html += '<a href="#" class="list-group-item list-group-item-action" onclick="fillUnClinicPatinet(\'' + mzPatientMi.patientId + '\')">';
- if (mzPatientMi.gender == "男") {
- html += '<img src="/thmz/images/boy.png"/>'
- } else if (mzPatientMi.gender == "女") {
- html += '<img src="/thmz/images/girl.png"/>'
- } else if (mzPatientMi.gender == "未知" || mzPatientMi.gender == null) {
- html += '<img src="/thmz/images/girl_or_boy.png"/>'
- }
- html += '<div>' + mzPatientMi.name + ' ' + mzPatientMi.gender + ' ';
- if (mzPatientMi.age != null && mzPatientMi.age != "") {
- html += mzPatientMi.age + '岁';
- } else {
- html += '**岁';
- }
- if (mzPatientMi.phoneNo != null && mzPatientMi.phoneNo != "") {
- html += '<span>' + mzPatientMi.phoneNo + '</span>';
- }
- html += '</div></a>';
- }
- html += '</div>';
- if (flag) {
- $("#webuiPopover0 div.webui-popover-content").html("");
- }
- $("#webuiPopover0 div.webui-popover-content").append(html);
- $("#webuiPopover0 div.arrow").css("left", "23px");
- refeshPatinetListScrollEvent();
- } else {
- $("#webuiPopover0").css("display", "none");
- }
- }
- //查询完成,设置加载完成
- msg_list_loading = false;
- }
- });
- }
- /**
- * 病人下拉列表滚动条滚动到底部时继续加载新纪录
- */
- function refeshPatinetListScrollEvent() {
- $('.webui-popover-content').scroll(function (event) {
- var top = $(this).scrollTop();
- var height = $(this).height();
- var scrollHeight = $(this).get(0).scrollHeight;
- if (scrollHeight <= top + height) {
- if (!msg_list_loading) {
- msg_list_loading = true;
- pageIndex = pageIndex + 1;
- refeshPatinetList(false);
- }
- }
- });
- }
- /**
- * 按照病人id查询病人信息
- * @param patientId
- */
- function fillUnClinicPatinet(patientId) {
- $("#rapidAcceptsUserCardNo").val(patientId);
- $("#webuiPopover0").css("display", "none");
- queryUserInfoByCardNo();
- }
- /**
- * 加载主诉,体格检查,诊断窗口
- */
- function initRecommendList() {
- var width = $("#symptom").parent().css("width");
- var settings = {
- placement: 'bottom-right',//值: auto,top,right,bottom,left,top-right,top-left,bottom-right,bottom-left 要显示的位置
- trigger: 'click', //值:click,hover 触发方式
- content: '',//内容,内容可以是函数
- width: width,
- //arrow:false,//是否显示箭头
- multi: true,//在页面允许其他弹出层
- closeable: true,//显示关闭按钮
- style: '', //值:'',inverse
- delay: 300,//延迟时间, 悬浮属性才执行
- padding: true,//内容填充
- height: 320,
- //offsetTop:10,
- cache: true,//如果缓存设置为false,则popover将销毁并重新创建
- };
- //主诉弹窗
- var symptomWebuiPopover = $('#symptom').webuiPopover('destroy').webuiPopover(settings);
- //体格检查弹窗
- settings.height = 260;
- $('#weight').webuiPopover('destroy').webuiPopover(settings);
- //诊断弹窗
- settings.height = 320;
- var diagnoseWebuiPopover = $('#diagnose').webuiPopover('destroy').webuiPopover(settings);
- //西药弹窗
- settings.width = 980;
- settings.closeable = false;
- settings.content = '<div id="westernMedicinePopoverContent"><table id="tb_table_western_medicine"></table></div>';
- var westernMedicineWebuiPopover = $('#western_medicine_namme').webuiPopover('destroy').webuiPopover(settings);
- //主诉选中事件
- $("#symptom").on("click", function (t) {
- if ($(symptomWebuiPopover).css("display") == "block") {
- $("#webuiPopover1 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">主诉</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='contentHtml'>";
- html += "</div>";
- html += '<div style="height: 60px; line-height: 60px; font-size: 14px;">' +
- '<div style="float: left">' +
- '<span style="margin-left: 20px;">内容:</span> ' +
- '</div>' +
- '<div style="float: left;">' +
- '<select class="form-control selectpicker show-tick" id="paramsType" dropupAuto="true">' +
- '<option label="常用症状" value="0">常用症状</option>' +
- '<option label="常用时间" value="1">常用时间</option>' +
- '<option label="常用标点" value="2">常用标点</option>' +
- '<option label="常用词" value="3">常用词</option>' +
- '</select> ' +
- '</div>' +
- '<div style="width: 200px;float: left;margin-left: 10px;">' +
- '<input id="paramsNameInput" class="form-control" type="text" style="position: relative;top: 13px;height: 34px;">' +
- '</div>' +
- '<div style="float: left;margin-left: 10px;">' +
- ' <button type="button" class="btn" onclick="saveParams();"' +
- ' style="height: 30px;line-height: 15px;border-color: #2e69eb!important;color: #2e69eb;background-color: white;">' +
- ' <svg class="bi" width="1em" height="1em" fill="currentColor" style="vertical-align: -.15em;margin-right: 10px!important;color: #2e69eb;">' +
- ' <use xlink:href="/thmz/css/bootstrap/bootstrap-icons-1.5.0/bootstrap-icons.svg#plus-circle"></use>' +
- ' </svg>' +
- '新增' +
- ' </button>' +
- ' </div>' +
- '</div>';
- $("#webuiPopover1 div.webui-popover-content").html(html);
- $('#paramsType').selectpicker('refresh');
- $("#paramsType").parent().css("width", "140px").css("height", "34px");
- $("#webuiPopover1").css("z-index", "10");
- if ($("#webuiPopover1").hasClass("in")) {
- loadSymptom();
- }
- }
- //加载智能接诊模块的主诉推荐
- fitSymptomData();
- });
- //体格检查各输入框选中事件
- $("#weight,#temperature,#sphygmus,#breathe,#pressure_high,#pressure_floor").on("click", function (t) {
- if ($("#webuiPopover2").css("display") == "block") {
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() == "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- //loadSymptom();
- } else {
- $('#weight').webuiPopover('show');
- $("#webuiPopover2").css("left", $("#webuiPopover1").css("left"));
- if ($("#healthCheckupContentHtml").html() == null || $("#healthCheckupContentHtml").html() != "") {
- $("#webuiPopover2 div.arrow").css("left", "23px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">体格检查</span>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='healthCheckupContentHtml'>";
- html += "</div>";
- $("#webuiPopover2 div.webui-popover-content").html(html);
- $("#webuiPopover2").css("z-index", "10");
- if ($("#webuiPopover2").hasClass("in")) {
- loadHealthCheckup();
- }
- }
- }
- return false;
- });
- //诊断选中事件
- $("#diagnose").on("click", function (t) {
- if ($(diagnoseWebuiPopover).css("display") == "block") {
- $("#webuiPopover3 div.arrow").css("left", "23px");
- $("#webuiPopover3 a.close").css("margin-top", "15px");
- var html = '<span style="font-size: 18px;margin-left: 20px!important;color: #2e69eb!important;line-height: 50px;">诊断</span>';
- html += '<div class="form-group has-feedback" style="float: right;width: 300px;margin-right: 20px;margin-top: 10px;">' +
- ' <input type="text" class="form-control has-feedback-left" ' +
- ' placeholder="搜索" style="padding-left: 10px;" oninput="loadDiagnose(this.value)" id="paramsDiagnose">' +
- ' <span class="fa fa-search form-control-feedback right" aria-hidden="true" style="right: 0px;"></span>' +
- ' </div>';
- html += "<div style='width: 100%;height:210px;overflow-y: auto;padding: 0px 20px;' id='diagnoseContentHtml'>";
- html += "</div>";
- $("#webuiPopover3 div.webui-popover-content").html(html);
- $("#webuiPopover3").css("z-index", "10");
- //$("#paramsDiagnose").on('input propertychange', loadDiagnose($("#paramsDiagnose").val()));
- loadDiagnose("");
- }
- //加载智能接诊模块的诊断推荐推荐
- fitDiagnoseData();
- });
- //现病史选中事件
- $("#emrHpi").on("click", function (t) {
- //加载智能接诊模块的现病史推荐推荐
- fitEmrHpiData();
- });
- //既往史选中事件
- $("#emrPs").on("click", function (t) {
- //加载智能接诊模块的既往史推荐推荐
- fitEmrPsData();
- });
- //西药选中事件
- $("#western_medicine_namme").on("click", function (t) {
- if ($(westernMedicineWebuiPopover).css("display") == "block") {
- $("#westernMedicinePopoverContent").parent().parent().prev().css("left", "23px");
- loadYpList();
- }
- });
- }
- /**
- * 新增通用参数
- */
- function saveParams() {
- $.ajax({
- type: "POST",
- url: '/thmz/saveTCommonParams',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "paramsType": $("#paramsType").val(),
- "paramsName": $("#paramsNameInput").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- successMesage(res);
- loadSymptom();
- $("#paramsNameInput").val(null);
- // $("#paramsType").selectpicker('val', 0);
- // $("#paramsType").selectpicker('refresh');
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 加载主诉参数列表
- */
- function loadSymptom() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadSymptom',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.featureList != null && res.featureList.length > 0) {
- html += '<div id="feature">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用症状:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.featureList.length; i++) {
- 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;">';
- html += res.featureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.timeList != null && res.timeList.length > 0) {
- html += '<div id="time">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用时间:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.timeList.length; i++) {
- 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;">';
- html += res.timeList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.characterList != null && res.characterList.length > 0) {
- html += '<div id="character">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用标点:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.characterList.length; i++) {
- 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;">';
- html += res.characterList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.wordsList != null && res.wordsList.length > 0) {
- html += '<div id="words">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">常用词:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.wordsList.length; i++) {
- 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;">';
- html += res.wordsList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#contentHtml").html(html);
- }
- });
- }
- /**
- * 加载体格检查参数列表
- */
- function loadHealthCheckup() {
- $.ajax({
- type: "GET",
- url: '/thmz/loadHealthCheckup',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.weightList != null && res.weightList.length > 0) {
- html += '<div id="weightDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体重:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.weightList.length; i++) {
- 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;">';
- html += res.weightList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.temperatureList != null && res.temperatureList.length > 0) {
- html += '<div id="temperatureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">体温:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.temperatureList.length; i++) {
- 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;">';
- html += res.temperatureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.sphygmusList != null && res.sphygmusList.length > 0) {
- html += '<div id="sphygmusDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">脉搏:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.sphygmusList.length; i++) {
- 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;">';
- html += res.sphygmusList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.breatheList != null && res.breatheList.length > 0) {
- html += '<div id="breatheDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.breatheList.length; i++) {
- 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;">';
- html += res.breatheList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- if (res.pressureList != null && res.pressureList.length > 0) {
- html += '<div id="pressureDiv">';
- html += '<div style="width: 80px; line-height: 25px; float: left;font-size: 16px;">呼吸:</div>';
- html += '<div style="width: calc(100% - 80px); float: left;">';
- for (var i = 0; i < res.pressureList.length; i++) {
- 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;">';
- html += res.pressureList[i].paramsName;
- html += '</span></button>';
- }
- html += '</div><div style="clear:both"></div></div>';
- }
- } else {
- errorMesage(res);
- }
- $("#healthCheckupContentHtml").html(html);
- }
- });
- }
- /**
- * 加载诊断参数列表
- * @param value
- */
- function loadDiagnose(value) {
- if (!$("#webuiPopover3").hasClass("in")) {
- return;
- }
- $.ajax({
- type: "GET",
- url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + value + '&pageSize=100',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- async: false,
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- if (res.code == 0) {
- if (res.data != null && res.data.length > 0) {
- html += '<div>';
- for (var i = 0; i < res.data.length; i++) {
- 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;">';
- html += res.data[i].paramsName;
- html += '<small> (' + res.data[i].paramsCode + ')</small>';
- html += '</span></button>';
- }
- html += '</div>';
- }
- } else {
- errorMesage(res);
- }
- $("#diagnoseContentHtml").html(html);
- }
- });
- }
- /**
- * 填充诊断
- * @param value
- * @param code
- */
- function fitDiagnoseValue(value, code) {
- var html = '';
- var childrenNum = $("#diagnoseTags").children().length;
- if (childrenNum == 3) {
- errorMesageSimaple("最多填写三个诊断!");
- return;
- }
- if (childrenNum == 0) {
- html += '<span class="el-tag--mainDiagnosis" ';
- } else {
- html += '<span class="el-tag--secondaryDiagnosis" ';
- }
- 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>';
- $("#diagnoseTags").append(html);
- var diagnoseValue = $("#diagnoseValue").val();
- if (diagnoseValue == null || diagnoseValue == "") {
- diagnoseValue = code;
- } else {
- diagnoseValue += "," + code;
- }
- $("#diagnoseValue").val(diagnoseValue);
- }
- /**
- * 移除诊断
- * @param code
- */
- function removeDiagnoseValue(code) {
- var childrenIndex = 0;
- var children = $("#diagnoseTags").children();
- for (var i = 0; i < children.length; i++) {
- if ($(children[i]).attr("id") == code) {
- childrenIndex = i;
- break;
- }
- }
- $($("#diagnoseTags").children("span")[childrenIndex]).remove();
- if (childrenIndex == 0) {
- $($("#diagnoseTags").children("span")[childrenIndex]).removeClass("el-tag--secondaryDiagnosis").addClass("el-tag--mainDiagnosis");
- }
- var diagnoseValue = $("#diagnoseValue").val();
- $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
- }
- /**
- * 点击通用参数属性值时设置值到对应的区域
- * @param value
- * @param id
- */
- function fitValue(value, id) {
- //当选择的是血压时
- if (id == "pressure_") {
- var arr = value.split("/");
- $("#pressure_high").val(arr[0]);
- $("#pressure_floor").val(arr[1]);
- //当选的是体重,体温,脉搏和呼吸时
- } else if (id == "weight" || id == "temperature" || id == "sphygmus" || id == "breathe") {
- $("#" + id).val(value);
- } else {
- //主诉拼写时
- var valueExist = $("#" + id).val();
- if (valueExist != null && valueExist != "") {
- value = valueExist + value;
- }
- $("#" + id).val(value);
- }
- }
- /**
- * 加载药品列表数列表
- * @param value
- */
- function loadYpList() {
- if (!$("#westernMedicinePopoverContent").parent().parent().parent().hasClass("in")) {
- return;
- }
- $('#tb_table_western_medicine').bootstrapTable('refresh');
- $('#tb_table_western_medicine').bootstrapTable({
- url: '/thmz/getYpListByCommonParams', //请求后台的URL(*)
- method: 'GET', //请求方式(*)
- toolbar: '#toolbar', //工具按钮用哪个容器
- striped: true, //是否显示行间隔色
- cache: true, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
- pagination: false, //是否显示分页(*)
- sortable: true, //是否启用排序
- sortOrder: "asc", //排序方式
- queryParams: function (params) {
- var temp = {
- groupNo: 71,
- commonParams: $("#western_medicine_namme").val()
- };
- return temp;
- }, //传递参数(*)
- sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
- pageNumber: 1, //初始化加载第一页,默认第一页
- pageSize: 5, //每页的记录行数(*)
- pageList: [5, 10, 25, 50, 100], //可供选择的每页的行数(*)
- search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
- strictSearch: true,
- showColumns: false, //是否显示所有的列
- showRefresh: false, //是否显示刷新按钮
- minimumCountColumns: 2, //最少允许的列数
- clickToSelect: true, //是否启用点击选中行
- uniqueId: "ID", //每一行的唯一标识,一般为主键列
- showToggle: false, //是否显示详细视图和列表视图的切换按钮
- cardView: false, //是否显示详细视图
- detailView: false,
- //rowStyle:rowStyle,//通过自定义函数设置行样式
- ajaxOptions: {
- headers: {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + localStorage.getItem("token")
- }
- },
- columns: [
- {
- field: 'code',
- title: '编码',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'name',
- title: '药品名称',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- , {
- field: 'specification',
- title: '规格',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'manufactory',
- title: '生产厂家',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'miniUnitName',
- title: '单位',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'chargeAmount',
- title: '零售价',
- align: "center",
- valign: 'middle',
- // sortable: true
- formatter: function (value, row, index) {
- if (value == null) {
- return '0.0元';
- }
- return value.toFixed(2) + "元";
- }
- }, {
- field: 'drugWinDesc',
- title: '剂量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }, {
- field: 'stockAmountVirtual',
- title: '库存数量',
- align: "center",
- valign: 'middle',
- // sortable: true
- }
- ],
- responseHandler: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var ress = eval(res);
- if (ress.code == -1) {
- errorMesage(res);
- return {
- "total": 0,//总页数
- "rows": {} //数据
- };
- }
- return {
- "total": ress.data.length,//总页数
- "rows": ress.data //数据
- };
- },
- onClickRow: function (row, $element) {
- $('#western_medicine_namme').webuiPopover('hide');
- checkYpInfo(row.code, row.serial);
- }
- });
- }
- /**
- * 按照药品的编码 和药品拆零规格查询药品信息
- * @param code
- * @param serial
- */
- function checkYpInfo(code, serial) {
- $.ajax({
- type: "GET",
- url: '/thmz/getYpZdDictByCodeAndSerial?code=' + code + "&serial=" + serial,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- //每个处方不能超过5个药品
- $("div.rb_item_0").each(function () {
- if ($(this).css("display") === "block") {
- var stepId = $(this).attr("id");
- var childrens = $(this).find("div:eq(1)").children().length;
- if (childrens === 5) {
- $("#messageModal").modal();
- $("#messageContent").html("单张处方最多只能开具5个药品,是否需要新增处方?");
- $("#messageButton").on("click", function (t) {
- $("#messageModal").modal("hide");
- refreshWizard("wizard0", "wizard_steps-0", stepId, "rb_item_0");
- fitWesternMedicine(res);
- });
- } else {
- fitWesternMedicine(res);
- }
- }
- });
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 添加处方分页
- * @param wizardId
- * @param wizardStepId
- * @param stepId
- * @param rbItemClass
- */
- function refreshWizard(wizardId, wizardStepId, stepId, rbItemClass) {
- var index = parseInt(stepId.split("-")[1]);
- index++;
- var newStepId = "step-" + index;
- var wizardStepHtml = '<li><a href="#' + newStepId + '"><span class="step_no" style="width: 20px;height: 20px;line-height: 20px;">' + index + '</span><span class="step_descr">';
- wizardStepHtml += '<small>处方' + numToChineseNum(index) + '</small></span></a></li>';
- var wizardHtml = '<div id="' + newStepId + '" class="rb_item ' + rbItemClass + '">';
- wizardHtml += ' <form class="form-horizontal form-label-left">';
- wizardHtml += ' <div class="form-group">';
- wizardHtml += ' <img src="/thmz/images/prescription.png">';
- wizardHtml += ' </div>';
- wizardHtml += ' <div style="height: 200px;" class="wizard_content">';
- wizardHtml += ' </div>';
- wizardHtml += ' </form>';
- wizardHtml += ' </div>';
- $("#" + wizardStepId).append(wizardStepHtml);
- $("#" + wizardId).append(wizardHtml);
- initSmartWizard(wizardId);
- }
- /**
- * 填充西药选中的内容
- */
- function fitWesternMedicine(res) {
- $("#western_medicine_namme").val(res.data.name);
- $("#western_medicine_namme").blur();
- var drugWinHtml = '';
- var index = null;
- if (res.data.weight != null) {
- $("#drugWin").val(res.data.weight);
- $("#drugWinDb").val(res.data.weight);
- drugWinHtml = '<option value="' + res.data.weighUnitDesc + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
- index = res.data.weighUnitDesc;
- }
- if (res.data.volum != null) {
- if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
- $("#drugWin").val(res.data.volum);
- $("#drugWinDb").val(res.data.volum);
- }
- drugWinHtml += '<option value="' + res.data.volUnitDesc + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
- if (index == null) {
- index = res.data.volUnitDesc;
- }
- }
- $('#drugWinUnit').html(drugWinHtml);
- $('#drugWinUnit').selectpicker('refresh');
- $("#drugWinUnit").selectpicker('val', index);
- $('#drugWinUnit').selectpicker('refresh');
- if (res.data.packUnitDesc != null && res.data.packUnitDesc != "") {
- var html = '<option value="' + res.data.packUnitDesc + '" >' + res.data.packUnitDesc + '</option>';
- $('#packUnit').html(html);
- $('#packUnit').selectpicker('refresh');
- $("#packUnit").selectpicker('val', res.data.packUnitDesc);
- $('#packUnit').selectpicker('refresh');
- }
- if (res.data.supplyType != null) {
- $("#supplyType").selectpicker('val', res.data.supplyType);
- $('#supplyType').selectpicker('refresh');
- }
- if (res.data.frequency != null) {
- $("#orderFrequency").selectpicker('val', res.data.frequency);
- $('#orderFrequency').selectpicker('refresh');
- }
- $("#packRetprice").val(res.data.packRetprice);
- $("#packSize").val(res.data.packSize);
- $("#current_code").val(res.data.code);
- $("#current_serial").val(res.data.serial);
- }
- /**
- * 剂量单位改变事件
- */
- function drugWinUnitChange() {
- var desc = $('#drugWinUnit').find("option:selected").attr('desc');
- $("#drugWin").val(desc);
- $("#drugWinDb").val(desc);
- calculate();
- }
- /**
- * 根据选择的内容计算总的用药量
- */
- function calculate() {
- //最小规格剂量
- var drugWinDb = $("#drugWinDb").val();
- //天数
- var dayNum = $("#dayNum").val();
- //当前使用的最小剂量
- var drugWin = $("#drugWin").val();
- //频率
- var times = $('#orderFrequency').find("option:selected").attr('desc');
- //包装规格数量
- var packSize = $("#packSize").val();
- //单价
- var packRetprice = $("#packRetprice").val();
- if (drugWinDb == null || drugWinDb === "") {
- return;
- }
- if (dayNum == null || dayNum === "") {
- return;
- }
- if (drugWin == null || drugWin === "") {
- return;
- }
- if (times == null || times === "") {
- return;
- }
- if (packSize == null || packSize === "") {
- return;
- }
- //拆零总量
- var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
- //整包装的数量
- var totalNum = Division(scatteredTotalNum, Multiply(packSize, drugWinDb));
- $("#gross").val(totalNum);
- $("#totalRetprice").val(Multiply(totalNum, packRetprice));
- }
- function getByPatientId(patientId) {
- $.ajax({
- type: "GET",
- url: '/thmz/getByPatientId?patientId=' + patientId,
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- if (res.data != null) {
- $("#cardNo").val(res.data.icCardNo);
- $("#cardNo").attr("title", res.data.icCardNo);
- $("#cardNo").blur();
- $("#userName").val(res.data.name);
- $("#userName").blur();
- $("#userNameReadOnly").val(res.data.name);
- $("#age").val(res.data.age);
- $("#age").blur();
- $("#gender").selectpicker('val', res.data.sex);
- $("#gender").selectpicker('refresh');
- $("#gender").blur();
- $("#birthDayReadonly").val(res.data.birthDayStr);
- $("#birthDayReadonly").attr("title", res.data.birthDayStr);
- $("#birthDayReadonly").blur();
- $("#birthDay").val(res.data.birthDayStr);
- $("#birthDay").blur();
- $("#phoneNum").val(res.data.phoneNo);
- $("#phoneNum").attr("title", res.data.phoneNo);
- $("#phoneNum").blur();
- $("#patientsNature").selectpicker('val', res.data.responseType);//默认选中
- $('#patientsNature').selectpicker('refresh');
- $("#patientsNature").blur();
- $("#idCard").val(res.data.socialNo);
- $("#idCard").attr("title", res.data.socialNo);
- $("#idCard").blur();
- $("#address").val(res.data.address);
- $("#address").blur();
- $("#patientId").val(res.data.patientId);
- if (res.data.name != null && res.data.name != "") {
- $("#editUser").show();
- }
- readonlyOrNot(true);
- }
- } else {
- errorMesage(res);
- }
- }
- });
- }
- /**
- * 将病人信息填入患者信息修改form
- * @param patinet
- */
- function fillPlusPatinet(patinet) {
- if (patinet != null) {
- $("#editUserCode").val(patinet.patientId);
- $("#editUserName").val(patinet.name);
- $("#editUserName").blur();
- $("#editUserAge").val(patinet.age);
- $("#editUserAge").blur();
- $("#editUserGender").selectpicker('val', patinet.sex);
- $("#editUserGender").selectpicker('refresh');
- $("#editUserGender").blur();
- $("#editUserBirthDay").val(patinet.birthDayStr);
- $("#editUserBirthDay").blur();
- $("#editUserCardNo").val(patinet.icCardNo);
- $("#editUserCardNo").attr("title", patinet.icCardNo);
- $("#editUserCardNo").blur();
- $("#editUserPhoneNum").val(patinet.phoneNo);
- $("#editUserPhoneNum").attr("title", patinet.phoneNo);
- $("#editUserPhoneNum").blur();
- $("#editUserPatientsNature").selectpicker('val', patinet.responseType);//默认选中
- $('#editUserPatientsNature').selectpicker('refresh');
- $("#editUserPatientsNature").blur();
- $("#editUserIdCard").val(patinet.socialNo);
- $("#editUserIdCard").attr("title", patinet.socialNo);
- $("#editUserIdCard").blur();
- $("#editUserAddress").val(patinet.address);
- $("#editUserAddress").blur();
- $("#editUserContact").val(patinet.relName);
- $("#editUserContactPhone").val(patinet.contractName);
- }
- }
- /**
- * 关闭当前这个付款方式
- */
- function closeThisParent(obj) {
- $(obj).parent().parent().remove();
- }
- /**
- * 科室与时间区间下拉选改变时清空输入框内容
- */
- function emptyInput() {
- $('#doctor').empty();
- $('#doctor').selectpicker('refresh');
- $("#registrationFee").val(0.00);
- $("#hospitalFee").val(0.00);
- $("#checkFee").val(0.00);
- $("#amountMoney").text(0.00);
- $("#amountMoneyConfirm").text(0.00);
- $("#realMoney").val(0.00);
- }
- /**
- * 给某些域增加title或者清除title
- * @param obj
- */
- function clearTextOrTitle(obj) {
- if ($(obj).val() == null || $(obj).val().length == 0) {
- $(obj).attr("title", null);
- } else {
- $(obj).attr("title", $(obj).val());
- if ($(obj).attr("id") == "birthDay") {
- $(obj).blur()
- }
- }
- }
- /**
- * 当按照卡号查询时,病人信息输入框不可编辑,当清空输入框时可编辑
- * @param flag
- */
- function readonlyOrNot(flag) {
- if (flag) {
- $("#cardNo").attr("readonly", "readonly");
- $("#userName").attr("readonly", "readonly");
- $("#age").attr("readonly", "readonly");
- $("#gender").attr("disabled", "disabled");
- $("#phoneNum").attr("readonly", "readonly");
- $("#patientsNature").attr("disabled", "disabled");
- $("#idCard").attr("readonly", "readonly");
- $("#address").attr("readonly", "readonly");
- $("#birthDayReadonly").removeClass("hide").addClass("in");
- $("#birthDayGroup").removeClass("in").addClass("hide");
- $("#userName").removeClass("in").addClass("hide");
- $("#userNameReadOnly").removeClass("hide").addClass("in");
- $("#webuiPopover0").css("display", "none");
- } else {
- $("#cardNo").removeAttr("readonly");
- $("#userName").removeAttr("readonly");
- $("#age").removeAttr("readonly");
- $("#gender").removeAttr("disabled");
- $("#gender").next().removeClass("disabled");
- $("#phoneNum").removeAttr("readonly");
- $("#patientsNature").removeAttr("disabled");
- $("#patientsNature").next().removeClass("disabled");
- $("#idCard").removeAttr("readonly");
- $("#address").removeAttr("readonly");
- $("#birthDayReadonly").removeClass("in").addClass("hide");
- $("#birthDayGroup").removeClass("hide").addClass("in");
- $("#userName").removeClass("hide").addClass("in");
- $("#userNameReadOnly").removeClass("in").addClass("hide");
- //$("#webuiPopover0").css("display", "block");
- }
- }
- /**
- * 保存窗口号
- */
- function saveWindows() {
- $.ajax({
- type: "POST",
- url: '/thmz/saveWindows',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({"windowsNo": $("#windowsNum").val()}),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- $('#editWindowsModal').modal('hide');
- if (res.code == 0) {
- new PNotify({
- title: '操作提示',
- text: res.message,
- type: 'success',
- hide: true,
- styling: 'bootstrap3'
- });
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 保存病人信息
- */
- function savePatient() {
- $.ajax({
- type: "POST",
- url: '/thmz/savePatient',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "name": $("#userName").val(),
- "age": $("#age").val(),
- "sex": $("#gender").val(),
- "birthDay": $("#birthDay").val(),
- "icCardNo": $("#cardNo").val(),
- "phoneNo": $("#phoneNum").val(),
- "responseType": $("#patientsNature").val(),
- "socialNo": $("#idCard").val(),
- "address": $("#address").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $("#patientId").val(res.data.patientId);
- saveMzyReqrec();
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 修改病人信息
- */
- function modifyPatient() {
- $.ajax({
- type: "POST",
- url: '/thmz/modifyPatient',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "name": $("#editUserName").val(),
- "age": $("#editUserAge").val(),
- "sex": $("#editUserGender").val(),
- "birthDay": $("#editUserBirthDay").val(),
- "icCardNo": $("#editUserCardNo").val(),
- "phoneNo": $("#editUserPhoneNum").val(),
- "responseType": $("#editUserPatientsNature").val(),
- "socialNo": $("#editUserIdCard").val(),
- "address": $("#editUserAddress").val(),
- "patientId": $("#editUserCode").val(),
- "relName": $("#editUserContact").val(),
- "contractName": $("#editUserContactPhone").val()
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- $('#editUserModal').modal('hide');
- realClinicalReception($("#patientId").val());
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 保存挂号信息
- */
- function saveMzyReqrec() {
- var mzyRequestId = $('#doctor').find("option:selected").attr('data-mzyRequestId');
- $.ajax({
- type: "POST",
- url: '/thmz/saveMzyReqrec',
- contentType: "application/json;charset=UTF-8",
- dataType: "json",
- data: JSON.stringify({
- "mzyReqrec": {
- "patientId": $("#patientId").val(),
- "ampm": $("#ampm").val(),
- "unitCode": $("#deptNo").val(),
- "chargeType": $("#chargeType").val()
- }, "responceType": $("#patientsNature").val(), "mzyRequestId": mzyRequestId
- }),
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- if (res.code == 0) {
- new PNotify({
- title: '操作提示',
- text: res.message,
- type: 'success',
- hide: true,
- styling: 'bootstrap3'
- });
- $('#confirmFeeModal').modal('hide');
- loadTableCount();
- loadRegistrationList(true);
- } else {
- new PNotify({
- title: '错误提示',
- text: res.message,
- type: 'error',
- hide: true,
- styling: 'bootstrap3'
- });
- }
- }
- });
- }
- /**
- * 挂号列表中的科室和医生列表初始化
- */
- function initListSelect() {
- initListDeptSelect();
- initListDoctorSelect();
- }
- /**
- * 挂号列表中的科室列表
- */
- function initListDeptSelect() {
- //科室列表
- $.ajax({
- type: "GET",
- url: '/thmz/allMzUnitCode',
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (data) {
- if (data == '401' || data == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(data.data, function (commentIndex, comment) {
- html += '<option value="' + comment.code + '">' + comment.name + '</option>';
- });
- $('#deptNoParam').empty();
- $('#deptNoParam').html(html);
- $('#deptNoParam').selectpicker('refresh');
- }
- });
- }
- /**
- * 挂号列表中的医生列表初始化
- */
- function initListDoctorSelect() {
- //医生列表
- $.ajax({
- type: "GET",
- url: '/thmz/listEmployeeByDepts?depts=' + $('#deptNoParam').val(),
- dataType: "json",
- headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
- success: function (res) {
- if (res == '401' || res == 401) {
- window.location.href = '/thmz/login/view'
- return;
- }
- var html = '';
- $.each(res.data, function (commentIndex, comment) {
- html += '<option value="' + comment.employeeCode + '">' + comment.employeeName + '</option>';
- });
- $('#doctorParam').empty();
- $('#doctorParam').html(html);
- // $("#doctorParam").selectpicker({
- // size: 10
- // });
- $('#doctorParam').selectpicker('destroy').selectpicker('refresh');
- }
- });
- }
- /**
- * 加载挂号列表
- * @param flag 是否清空挂号卡片列表区域
- */
- function loadRegistrationList(flag) {
- if (flag) {
- pageIndex = 0;
- $("#card_regi_list").empty();
- $("div.page").removeClass("in").addClass("hide");
- }
- var regiListType = getIndex("regi_List_type");
- if (regiListType == 0) {
- loadCardList();
- } else if (regiListType == 1) {
- loadTableList();
- }
- }
- /**
- * 获取按钮组选择的下标
- * @param id
- * @returns {number}
- */
- function getIndex(id) {
- var index = 0;
- var item = $("#" + id).find("button");
- for (var i = 0; i <= item.length; i++) {
- if ($(item[i]).hasClass("btn-primary")) {
- index = i;
- break;
- }
- }
- return index;
- }
- /**
- * 获取时间选择器的时间数组
- * @returns {string[]}
- */
- function getRePortRangeArr() {
- var rePortRange = $('#reportrange span').html();
- var rePortRangeArr = rePortRange.split(" - ");
- rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
- rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
- return rePortRangeArr;
- }
- /**
- * 清空搜索参数
- */
- function clearParams() {
- $("#deptNoParam").selectpicker('val', null);
- $("#deptNoParam").selectpicker('refresh');
- $("#doctorParam").selectpicker('val', null);
- $("#deptNoParam").selectpicker('refresh');
- $("#userNameParam").val(null);
- $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
- }
|