Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

outpatientChargesManagement.vue 198KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061
  1. <template>
  2. <div class="main-contain outpatientChargesManagement" v-loading="newLoading"
  3. element-loading-text="拼命加载中"
  4. element-loading-spinner="el-icon-loading"
  5. element-loading-background="rgba(0, 0, 0, 0.8)">
  6. <div class="position">
  7. <bread-crumb :crumbs='crumbs'></bread-crumb>
  8. </div>
  9. <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
  10. <div class="mainLeft">
  11. <el-date-picker
  12. v-model="record_date"
  13. prefix-icon="el-icon-date"
  14. @change="changeTimeTwo"
  15. :editable="false"
  16. style="width: 100%;"
  17. type="date"
  18. placeholder="选择开始时间"
  19. align="right"
  20. format="yyyy-MM-dd"
  21. value-format="yyyy-MM-dd">
  22. </el-date-picker>
  23. <div class="mainCell" style="margin-top:10px;">
  24. <el-radio-group v-model="radio" @change="changeRadio">
  25. <el-radio :label=1>未收费<span
  26. style="color: red;margin-bottom:10px;display: inline-block;">{{ cal_one }}</span>人
  27. </el-radio>
  28. <el-radio :label=2>已收费<span
  29. style="color: red;margin-bottom:10px;display: inline-block;">{{ cal_two }}</span>人
  30. </el-radio>
  31. </el-radio-group>
  32. </div>
  33. <div class="mainCell" style="margin-bottom:10px;">
  34. <el-input size="small" @keyup.enter.native='searchAction' v-model.trim="search_input"
  35. class="filter-item"/>
  36. <el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"
  37. @click="searchAction">
  38. 搜索
  39. </el-button>
  40. </div>
  41. <div>
  42. <el-table :data="patientTableData" :height="tableHeight" border style="width: 100%;"
  43. :row-style="{ color: '#303133' }"
  44. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  45. highlight-current-row ref="tab"
  46. @current-change="handleCurrentChange">
  47. <el-table-column align="center" prop="name" label="姓名" wdith='89'>
  48. <template slot-scope="scope">{{ scope.row.name }}</template>
  49. </el-table-column>
  50. <el-table-column align="center" prop="name" label="就诊号" width="110">
  51. <template slot-scope="scope">{{ scope.row.number ? scope.row.number : '' }}
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. </div>
  56. </div>
  57. <div class="mainRight">
  58. <div class="mainCell fixedCell" style="margin-bottom:10px;">
  59. <div>
  60. <el-button v-loading="loadingone" size="small"
  61. @click="open(6)"
  62. type="primary">挂号
  63. </el-button>
  64. <el-button v-loading="loadingone" size="small"
  65. @click="open(20)"
  66. type="primary">查询备案信息
  67. </el-button>
  68. <el-button size="small" @click="open(5)" type="primary"
  69. v-if="this.radio == 2 && this.hisPatientInfo.id > 0 && this.order.id > 0 && this.order.order_status == 2">
  70. 退费
  71. </el-button>
  72. <el-button v-if="this.radio == 2 && this.order.order_status == 2" size="small"
  73. @click="open(9)" type="primary"
  74. >结算单
  75. </el-button>
  76. <el-button v-if="this.radio == 2 && this.order.order_status == 2" size="small"
  77. @click="open(30)" type="primary"
  78. >打印发票
  79. </el-button>
  80. <el-button
  81. size="small" @click="open(10)" type="primary"
  82. >退号
  83. </el-button>
  84. </div>
  85. </div>
  86. <div class="mainCenter" v-loading="loading">
  87. <el-tabs class="settlementTabs" v-model="activeName" @tab-click="handleClick">
  88. <el-tab-pane label="日结" name="first">
  89. <div style="display:flex;height:100%;">
  90. <div class="centerLeft">
  91. <div>
  92. <div class="tabsBox" v-for="items,index in big_prescriptions" :key="index">
  93. <div style="height: calc(100% - 60px);">
  94. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  95. @tab-click="tabclickEvent">
  96. <!--<el-radio-group v-model="med_radio">-->
  97. <el-tab-pane
  98. v-for="(item, index) in items.prescriptions"
  99. :key="index"
  100. :label="item.name"
  101. :name="item.name"
  102. >
  103. <el-button
  104. su v-if="radio == 1"
  105. size="small"
  106. @click="openDialog(item)"
  107. type="primary"
  108. >修改医疗类型
  109. </el-button>
  110. <div style="margin-bottom:10px;float: right">
  111. <div>
  112. <el-button
  113. v-if="(hisPatientInfo.balance_accounts_type != 2 && hisPatientInfo.id > 0 && items.prescriptions[0].order.id == 0)"
  114. size="small"
  115. @click="open(8,items.med_type,items.prescriptions[0].order,items.prescriptions)"
  116. type="primary"
  117. >预结算
  118. </el-button>
  119. <el-button
  120. v-if="items.curPrescriptions.order.order_status == 1 && hisPatientInfo.balance_accounts_type != 2"
  121. size="small"
  122. @click="open(11,items.med_type,items.prescriptions[0].order,items.prescriptions)"
  123. type="primary"
  124. >撤销明细
  125. </el-button>
  126. <!--<div>{{ items.curPrescriptions.order.order_status}}</div>-->
  127. <!--<div>{{ items.prescriptions[0].order.order_status}}</div>-->
  128. <el-button v-loading="loadingtwo"
  129. v-if="(hisPatientInfo.id > 0 && items.curPrescriptions.order.id == 0) || items.curPrescriptions.order.order_status == 1 || items.curPrescriptions.order.order_status == 3"
  130. size="small"
  131. @click="open(4,items.med_type,items.curPrescriptions.order,items.prescriptions)"
  132. type="primary">收费
  133. </el-button>
  134. </div>
  135. </div>
  136. </el-tab-pane>
  137. <prescription-table ref="prescription_tables"
  138. :prescription="items.curPrescriptions"
  139. :manufacturers="manufacturers"></prescription-table>
  140. <!--</el-radio-group>-->
  141. </el-tabs>
  142. </div>
  143. <div class="costBox">
  144. <span>当前处方总费用:<span style="color:red;">{{ items.total }}元</span></span>
  145. <span>医疗费总额:<span style="color:red;">{{
  146. items.curPrescriptions.order.medfee_sumamt ? items.curPrescriptions.order.medfee_sumamt.toFixed(2) : getTotalFour(items.prescriptions) ? getTotalFour(items.prescriptions) : ''
  147. }}元</span></span>
  148. <span>基金支付总额:<span
  149. style="color:red;">{{
  150. items.curPrescriptions.order.fund_pay_sumamt ? items.curPrescriptions.order.fund_pay_sumamt.toFixed(2) : ''
  151. }}元</span></span>
  152. <span>基本医疗保险统筹基金支出:<span
  153. style="color:red;">{{
  154. items.curPrescriptions.order.hifp_pay ? items.curPrescriptions.order.hifp_pay.toFixed(2) : ''
  155. }}元</span></span>
  156. <span>医疗救助基金支出:<span
  157. style="color:red;">{{
  158. items.curPrescriptions.order.maf_pay ? items.curPrescriptions.order.maf_pay.toFixed(2) : ''
  159. }}元</span></span>
  160. <!-- <span>基金支付金额:<span-->
  161. <!-- style="color:red;">{{-->
  162. <!-- items.curPrescriptions.order.hifp_pay ? items.curPrescriptions.order.hifp_pay.toFixed(2) : ''-->
  163. <!-- }}元</span></span>-->
  164. <span>个人账户支付金额:<span
  165. style="color:red;">{{
  166. items.curPrescriptions.order.acct_pay ? items.curPrescriptions.order.acct_pay.toFixed(2) : ''
  167. }}元</span></span>
  168. <span v-if="hisPatientInfo.balance_accounts_type != 2">个人支付金额:<span
  169. style="color:red;">{{
  170. items.curPrescriptions.order.psn_cash_pay ? items.curPrescriptions.order.psn_cash_pay.toFixed(2) : ''
  171. }}元</span></span>
  172. <span v-if="hisPatientInfo.balance_accounts_type == 2">个人支付金额:<span
  173. style="color:red;">{{
  174. items.curPrescriptions.order.medfee_sumamt.toFixed(2)
  175. }}元</span></span>
  176. <span>个人账户金额:<span
  177. style="color:red;">{{
  178. items.curPrescriptions.order.balc ? items.curPrescriptions.order.balc.toFixed(2) : ''
  179. }}元</span></span>
  180. <span v-if="items.curPrescriptions.order_status == 1">待结算</span>
  181. <span v-if="items.curPrescriptions.order_status == 2">已结算</span>
  182. <span v-if="items.curPrescriptions.order_status == 3">已退费</span>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <div class="centerRight">
  188. <p class="centerRightTitle" style="padding-top: 10px;">就诊信息</p>
  189. <div>
  190. <el-form :model="form" :rules="rules" ref="formValue" label-width="100px">
  191. <el-form-item label="大病类别:" prop="sick_type" :validate-event="is_Name">
  192. <el-select style="margin-right:5px;width:100px;"
  193. v-model="form.sick_type" placeholder="">
  194. <el-option
  195. v-for="(item,index) in sick"
  196. :key="index"
  197. :label="item.class_name"
  198. :value="item.id">
  199. </el-option>
  200. </el-select>
  201. </el-form-item>
  202. <el-form-item label="诊断:" prop="diagnosis" :validate-event="is_Name">
  203. <el-select style="margin-right:5px;width:100px;"
  204. v-model="form.diagnosis" multiple placeholder="">
  205. <el-option
  206. v-for="(item,index) in diagnoses"
  207. :key="index"
  208. :label="item.class_name"
  209. :value="item.id">
  210. </el-option>
  211. </el-select>
  212. </el-form-item>
  213. <el-form-item label="诊断时间:" prop="diagnosis_time">
  214. <el-date-picker
  215. v-model="form.diagnosis_time"
  216. prefix-icon="el-icon-date"
  217. :editable="false"
  218. style="width: 100%;"
  219. type="datetime"
  220. placeholder="选择开始时间"
  221. align="right"
  222. format="yyyy-MM-dd HH:mm:ss"
  223. value-format="yyyy-MM-dd HH:mm:ss">
  224. </el-date-picker>
  225. </el-form-item>
  226. </el-form>
  227. </div>
  228. <p class="centerRightTitle">人员信息</p>
  229. <div style="display:flex;justify-content: space-between;line-height:30px;">
  230. <span style="font-size:14px;">人员编码:{{ patientInfo.dialysis_no }}</span>
  231. <span style="font-size:14px;">日期:{{ record_date }}</span>
  232. </div>
  233. <ul class="basicUl">
  234. <li style="width:50%;">姓名:{{ patientInfo.name }}</li>
  235. <li style="width:50%;">性别:{{ patientInfo.gender == 1 ? '男' : '女' }}</li>
  236. <li style="width:50%;">年龄:{{ patientInfo.age }}</li>
  237. <li style="width:50%;">电话:{{ patientInfo.phone }}</li>
  238. </ul>
  239. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  240. <div style="display:flex;justify-content: space-between;line-height:30px;">
  241. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number }}</span>
  242. </div>
  243. <ul class="basicUl">
  244. <li style="width:50%;">医生:{{ info.doctor }}</li>
  245. <li style="width:50%;">科室:{{ info.departments }}</li>
  246. <!--<li style="width:100%;">总费用:{{ getTotal() }}</li>-->
  247. <li style="width:100%;">判断结果:{{ info.diagnosis }}</li>
  248. <li style="width:100%;">是否有传染病:</li>
  249. <li style="width:100%;">血压:</li>
  250. </ul>
  251. </div>
  252. </div>
  253. </el-tab-pane>
  254. <el-tab-pane label="月结" name="second">
  255. <div style="display:flex;height:100%;">
  256. <div class="centerLeft">
  257. <div class="RP">
  258. Rp
  259. <el-date-picker
  260. v-model="other_start_time"
  261. prefix-icon="el-icon-date"
  262. @change="changeTime"
  263. :editable="false"
  264. style="width: 150px;"
  265. type="date"
  266. placeholder="选择开始时间"
  267. align="right"
  268. format="yyyy-MM-dd"
  269. value-format="yyyy-MM-dd">
  270. </el-date-picker>
  271. <span class>-</span>
  272. <el-date-picker
  273. v-model="other_end_time"
  274. prefix-icon="el-icon-date"
  275. @change="changeEndTime"
  276. :editable="false"
  277. style="width: 150px;"
  278. type="date"
  279. placeholder="选择结束时间"
  280. align="right"
  281. format="yyyy-MM-dd"
  282. value-format="yyyy-MM-dd">
  283. </el-date-picker>
  284. </div>
  285. <div>
  286. <div class="tabsBox" v-for="(items, index) in big_month_prescriptions">
  287. <div style="height: calc(100% - 60px);">
  288. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  289. @tab-click="tabclickEventTwo">
  290. <el-tab-pane
  291. v-for="(item, index) in items.month_prescriptions"
  292. :key="index"
  293. :label="item.name"
  294. :name="item.name">
  295. </el-tab-pane>
  296. <el-button
  297. v-if="radio == 1"
  298. size="small"
  299. @click="openMonthDialog(items)"
  300. type="primary"
  301. >修改医疗类型
  302. </el-button>
  303. <div style="margin-bottom:10px;float: right">
  304. <div>
  305. <el-button
  306. v-if="(hisPatientInfo.balance_accounts_type != 2 && hisPatientInfo.id > 0 && items.curMonthPrescriptions.order.id == 0)"
  307. size="small"
  308. @click="open(8,items.med_type,items.curMonthPrescriptions.order,items.month_prescriptions)"
  309. type="primary"
  310. >预结算
  311. </el-button>
  312. <el-button
  313. v-if="items.curMonthPrescriptions.order.order_status == 1"
  314. size="small"
  315. @click="open(11,items.med_type,items.curMonthPrescriptions.order,items.month_prescriptions)"
  316. type="primary"
  317. >撤销明细
  318. </el-button>
  319. <el-button
  320. v-if="(hisPatientInfo.id > 0 && items.curMonthPrescriptions.order.id == 0) || items.curMonthPrescriptions.order.order_status == 1 || items.curMonthPrescriptions.order.order_status == 3"
  321. size="small"
  322. @click="open(4,items.med_type,items.curMonthPrescriptions.order,items.month_prescriptions)"
  323. type="primary">收费
  324. </el-button>
  325. </div>
  326. </div>
  327. <charge-month-prescription-table
  328. :prescription="items.curMonthPrescriptions"></charge-month-prescription-table>
  329. </el-tabs>
  330. </div>
  331. <div class="costBox">
  332. <span>当前处方总费用:<span
  333. style="color:red;">{{ items.month_total }}元</span></span>
  334. <span>医疗费总额:<span style="color:red;">{{
  335. items.curMonthPrescriptions.order.medfee_sumamt ? items.curMonthPrescriptions.order.medfee_sumamt.toFixed(2) : getTotalFour(items.month_prescriptions) ? getTotalFour(items.month_prescriptions) : ''
  336. }}元</span></span>
  337. <span>基金支付总额:<span
  338. style="color:red;">{{
  339. items.curMonthPrescriptions.order.fund_pay_sumamt ? items.curMonthPrescriptions.order.fund_pay_sumamt.toFixed(2) : ''
  340. }}元</span></span>
  341. <span>基本医疗保险统筹基金支出:<span
  342. style="color:red;">{{
  343. items.curMonthPrescriptions.order.hifp_pay ? items.curMonthPrescriptions.order.hifp_pay.toFixed(2) : ''
  344. }}元</span></span>
  345. <span>医疗救助基金支出:<span
  346. style="color:red;">{{
  347. items.curMonthPrescriptions.order.maf_pay ? items.curMonthPrescriptions.order.maf_pay.toFixed(2) : ''
  348. }}元</span></span>
  349. <span>个人账户支付金额:<span
  350. style="color:red;">{{
  351. items.curMonthPrescriptions.order.acct_pay ? items.curMonthPrescriptions.order.acct_pay.toFixed(2) : ''
  352. }}元</span></span>
  353. <!--<span>个人支付金额:<span style="color:red;">{{ items.curMonthPrescriptions.order.psn_cash_pay?items.curMonthPrescriptions.order.psn_cash_pay:''}}元</span></span>-->
  354. <span v-if="hisPatientInfo.balance_accounts_type != 2">个人支付金额:<span
  355. style="color:red;">{{
  356. items.curMonthPrescriptions.order.psn_cash_pay ? items.curMonthPrescriptions.order.psn_cash_pay.toFixed(2) : ''
  357. }}元</span></span>
  358. <span v-if="hisPatientInfo.balance_accounts_type == 2">个人支付金额:<span
  359. style="color:red;">{{ items.curMonthPrescriptions.order.medfee_sumamt.toFixed(2) }}元</span></span>
  360. <span>个人账户金额:<span
  361. style="color:red;">{{
  362. items.curMonthPrescriptions.order.account_price ? items.curMonthPrescriptions.order.account_price.toFixed(2) : ''
  363. }}元</span></span>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. <div class="centerRight">
  369. <p class="centerRightTitle" style="padding-top: 10px;">
  370. 就诊信息</p>
  371. <div>
  372. <el-form :model="form" :rules="rules" ref="formValue" label-width="100px">
  373. <el-form-item label="大病类别:" prop="sick_type" :validate-event="is_Name">
  374. <el-select style="margin-right:5px;width:100px;"
  375. v-model="form.sick_type" placeholder="">
  376. <el-option
  377. v-for="(item,index) in sick"
  378. :key="index"
  379. :label="item.class_name"
  380. :value="item.id">
  381. </el-option>
  382. </el-select>
  383. </el-form-item>
  384. <el-form-item label="诊断:" prop="diagnosis" :validate-event="is_Name">
  385. <el-select style="margin-right:5px;width:100px;"
  386. v-model="form.diagnosis" multiple placeholder="">
  387. <el-option
  388. v-for="(item,index) in diagnoses"
  389. :key="index"
  390. :label="item.class_name"
  391. :value="item.id">
  392. </el-option>
  393. </el-select>
  394. </el-form-item>
  395. <el-form-item label="诊断时间:" prop="diagnosis_time">
  396. <el-date-picker
  397. v-model="form.diagnosis_time"
  398. prefix-icon="el-icon-date"
  399. :editable="false"
  400. style="width: 100%;"
  401. type="datetime"
  402. placeholder="选择开始时间"
  403. align="right"
  404. format="yyyy-MM-dd HH:mm:ss"
  405. value-format="yyyy-MM-dd HH:mm:ss">
  406. </el-date-picker>
  407. </el-form-item>
  408. </el-form>
  409. </div>
  410. <p class="centerRightTitle">人员信息</p>
  411. <div style="display:flex;justify-content: space-between;line-height:30px;">
  412. <span style="font-size:14px;">人员编码:{{ patientInfo.dialysis_no }}</span>
  413. <span style="font-size:14px;">日期:{{ record_date }}</span>
  414. </div>
  415. <ul class="basicUl">
  416. <li style="width:50%;">姓名:{{ patientInfo.name }}</li>
  417. <li style="width:50%;">性别:{{ patientInfo.gender == 1 ? '男' : '女' }}</li>
  418. <li style="width:50%;">年龄:{{ patientInfo.age }}</li>
  419. <li style="width:50%;">电话:{{ patientInfo.phone }}</li>
  420. <li style="width:100%;">过敏史及其他病史:{{ info.sick_history }}</li>
  421. </ul>
  422. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  423. <div style="display:flex;justify-content: space-between;line-height:30px;">
  424. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number }}</span>
  425. </div>
  426. <ul class="basicUl">
  427. <li style="width:50%;">医生:{{ info.doctor }}</li>
  428. <li style="width:50%;">科室:{{ getDepartment(info.departments) }}</li>
  429. <!--<li style="width:100%;" v-if="activeName == 'first'">总费用:{{ getTotal() }}</li>-->
  430. <!--<li style="width:100%;" v-if="activeName == 'second'">总费用:{{ getTotalTwo() }}-->
  431. <!--</li>-->
  432. <li style="width:100%;">判断结果:{{ GetDiagnosisName(info.diagnosis) }}</li>
  433. <!--<li style="width:100%;">是否有传染病:</li>-->
  434. <!--<li style="width:100%;">血压:</li>-->
  435. </ul>
  436. </div>
  437. </div>
  438. </el-tab-pane>
  439. <el-tab-pane label="其他月结" name="third">
  440. <div style="display:flex;height:100%;">
  441. <div class="centerLeft">
  442. <div class="RP">
  443. Rp
  444. <el-date-picker
  445. v-model="other_start_time_two"
  446. prefix-icon="el-icon-date"
  447. @change="changeTimeThree"
  448. :editable="false"
  449. style="width: 150px;"
  450. type="date"
  451. placeholder="选择开始时间"
  452. align="right"
  453. format="yyyy-MM-dd"
  454. value-format="yyyy-MM-dd">
  455. </el-date-picker>
  456. <span class>-</span>
  457. <el-date-picker
  458. v-model="other_end_time_two"
  459. prefix-icon="el-icon-date"
  460. @change="changeEndTimeThree"
  461. :editable="false"
  462. style="width: 150px;"
  463. type="date"
  464. placeholder="选择结束时间"
  465. align="right"
  466. format="yyyy-MM-dd"
  467. value-format="yyyy-MM-dd">
  468. </el-date-picker>
  469. </div>
  470. <div>
  471. <div class="tabsBox" v-for="(items,index) in big_prescriptions_two" :key="index">
  472. <div style="height: calc(100% - 60px);">
  473. <el-tabs class="preTabs" v-model="editableTabsValue" type="border-card"
  474. @tab-click="tabclickEventThree">
  475. <!--<el-radio-group v-model="med_radio">-->
  476. <el-tab-pane
  477. v-for="(item, index) in items.prescriptions"
  478. :key="index"
  479. :label="item.name"
  480. :name="item.name"
  481. >
  482. <el-button
  483. v-if="radio == 1"
  484. size="small"
  485. @click="openMonthDialogTwo(item)"
  486. type="primary"
  487. >修改医疗类型
  488. </el-button>
  489. <!-- <div style="margin-bottom:10px;float: right">-->
  490. <!-- <div>-->
  491. <!-- <el-button-->
  492. <!-- v-if="(hisPatientInfo.id > 0 && items.prescriptions[0].order.id == 0)"-->
  493. <!-- size="small"-->
  494. <!-- @click="open(8,items.med_type,items.prescriptions[0].order,items.prescriptions)"-->
  495. <!-- type="primary"-->
  496. <!-- >预结算-->
  497. <!-- </el-button>-->
  498. <!-- <el-button-->
  499. <!-- v-if="items.curPrescriptions.order.order_status == 1 && hisPatientInfo.balance_accounts_type != 2"-->
  500. <!-- size="small"-->
  501. <!-- @click="open(11,items.med_type,items.prescriptions[0].order,items.prescriptions)"-->
  502. <!-- type="primary"-->
  503. <!-- >撤销明细-->
  504. <!-- </el-button>-->
  505. <!-- <el-button v-loading="loadingtwo"-->
  506. <!-- v-if="(hisPatientInfo.id > 0 && items.curPrescriptions.order.id == 0) || items.curPrescriptions.order.order_status == 1 || items.curPrescriptions.order.order_status == 3"-->
  507. <!-- size="small"-->
  508. <!-- @click="open(4,items.med_type,items.curPrescriptions.order,items.prescriptions)"-->
  509. <!-- type="primary">收费-->
  510. <!-- </el-button>-->
  511. <!-- </div>-->
  512. <!-- </div>-->
  513. </el-tab-pane>
  514. <prescription-table ref="prescription_tables"
  515. :prescription="items.curPrescriptions"
  516. :manufacturers="manufacturers"></prescription-table>
  517. <!--</el-radio-group>-->
  518. </el-tabs>
  519. </div>
  520. <div class="costBox">
  521. <span>当前处方总费用:<span style="color:red;">{{ items.total }}元</span></span>
  522. <span>医疗费总额:<span style="color:red;">{{
  523. items.curPrescriptions.order.medfee_sumamt ? items.curPrescriptions.order.medfee_sumamt.toFixed(2) : getTotalFour(items.prescriptions) ? getTotalFour(items.prescriptions) : ''
  524. }}元</span></span>
  525. <span>基金支付总额:<span
  526. style="color:red;">{{
  527. items.curPrescriptions.order.fund_pay_sumamt ? items.curPrescriptions.order.fund_pay_sumamt.toFixed(2) : ''
  528. }}元</span></span>
  529. <span>基本医疗保险统筹基金支出:<span
  530. style="color:red;">{{
  531. items.curPrescriptions.order.hifp_pay ? items.curPrescriptions.order.hifp_pay.toFixed(2) : ''
  532. }}元</span></span>
  533. <span>医疗救助基金支出:<span
  534. style="color:red;">{{
  535. items.curPrescriptions.order.maf_pay ? items.curPrescriptions.order.maf_pay.toFixed(2) : ''
  536. }}元</span></span>
  537. <!-- <span>基金支付金额:<span-->
  538. <!-- style="color:red;">{{-->
  539. <!-- items.curPrescriptions.order.hifp_pay ? items.curPrescriptions.order.hifp_pay.toFixed(2) : ''-->
  540. <!-- }}元</span></span>-->
  541. <span>个人账户支付金额:<span
  542. style="color:red;">{{
  543. items.curPrescriptions.order.acct_pay ? items.curPrescriptions.order.acct_pay.toFixed(2) : ''
  544. }}元</span></span>
  545. <span v-if="hisPatientInfo.balance_accounts_type != 2">个人支付金额:<span
  546. style="color:red;">{{
  547. items.curPrescriptions.order.psn_cash_pay ? items.curPrescriptions.order.psn_cash_pay.toFixed(2) : ''
  548. }}元</span></span>
  549. <span v-if="hisPatientInfo.balance_accounts_type == 2">个人支付金额:<span
  550. style="color:red;">{{
  551. items.curPrescriptions.order.medfee_sumamt.toFixed(2)
  552. }}元</span></span>
  553. <span>个人账户金额:<span
  554. style="color:red;">{{
  555. items.curPrescriptions.order.balc ? items.curPrescriptions.order.balc.toFixed(2) : ''
  556. }}元</span></span>
  557. <span v-if="items.curPrescriptions.order_status == 1">待结算</span>
  558. <span v-if="items.curPrescriptions.order_status == 2">已结算</span>
  559. <span v-if="items.curPrescriptions.order_status == 3">已退费</span>
  560. </div>
  561. </div>
  562. </div>
  563. </div>
  564. <div class="centerRight">
  565. <p class="centerRightTitle" style="padding-top: 10px;">就诊信息</p>
  566. <div>
  567. <el-form :model="form" :rules="rules" ref="formValue" label-width="100px">
  568. <el-form-item label="大病类别:" prop="sick_type" :validate-event="is_Name">
  569. <el-select style="margin-right:5px;width:100px;"
  570. v-model="form.sick_type" placeholder="">
  571. <el-option
  572. v-for="(item,index) in sick"
  573. :key="index"
  574. :label="item.class_name"
  575. :value="item.id">
  576. </el-option>
  577. </el-select>
  578. </el-form-item>
  579. <el-form-item label="诊断:" prop="diagnosis" :validate-event="is_Name">
  580. <el-select style="margin-right:5px;width:100px;"
  581. v-model="form.diagnosis" multiple placeholder="">
  582. <el-option
  583. v-for="(item,index) in diagnoses"
  584. :key="index"
  585. :label="item.class_name"
  586. :value="item.id">
  587. </el-option>
  588. </el-select>
  589. </el-form-item>
  590. <el-form-item label="诊断时间:" prop="diagnosis_time">
  591. <el-date-picker
  592. v-model="form.diagnosis_time"
  593. prefix-icon="el-icon-date"
  594. :editable="false"
  595. style="width: 100%;"
  596. type="datetime"
  597. placeholder="选择开始时间"
  598. align="right"
  599. format="yyyy-MM-dd HH:mm:ss"
  600. value-format="yyyy-MM-dd HH:mm:ss">
  601. </el-date-picker>
  602. </el-form-item>
  603. </el-form>
  604. </div>
  605. <p class="centerRightTitle">人员信息</p>
  606. <div style="display:flex;justify-content: space-between;line-height:30px;">
  607. <span style="font-size:14px;">人员编码:{{ patientInfo.dialysis_no }}</span>
  608. <span style="font-size:14px;">日期:{{ record_date }}</span>
  609. </div>
  610. <ul class="basicUl">
  611. <li style="width:50%;">姓名:{{ patientInfo.name }}</li>
  612. <li style="width:50%;">性别:{{ patientInfo.gender == 1 ? '男' : '女' }}</li>
  613. <li style="width:50%;">年龄:{{ patientInfo.age }}</li>
  614. <li style="width:50%;">电话:{{ patientInfo.phone }}</li>
  615. </ul>
  616. <p class="centerRightTitle" style="padding-top: 10px;">诊断信息</p>
  617. <div style="display:flex;justify-content: space-between;line-height:30px;">
  618. <span style="font-size:14px;">门诊编号:{{ hisPatientInfo.number }}</span>
  619. </div>
  620. <ul class="basicUl">
  621. <li style="width:50%;">医生:{{ info.doctor }}</li>
  622. <li style="width:50%;">科室:{{ info.departments }}</li>
  623. <!--<li style="width:100%;">总费用:{{ getTotal() }}</li>-->
  624. <li style="width:100%;">判断结果:{{ info.diagnosis }}</li>
  625. <li style="width:100%;">是否有传染病:</li>
  626. <li style="width:100%;">血压:</li>
  627. </ul>
  628. </div>
  629. </div>
  630. </el-tab-pane>
  631. </el-tabs>
  632. </div>
  633. </div>
  634. </div>
  635. <el-dialog
  636. title="提示"
  637. :visible.sync="dialogVisible"
  638. width="30%"
  639. >
  640. <span>是否修改医疗类型</span>
  641. <el-select v-if="this.$store.getters.xt_user.org_id == 10188 || this.$store.getters.xt_user.org_id == 10217" style="width:50%;" v-model="temp_med_type"
  642. placeholder="医疗类型" @change="changevalue">
  643. <el-option
  644. v-for="(item,index) in registerThree"
  645. :key="index"
  646. :label="item.label"
  647. :value="item.value">
  648. </el-option>
  649. </el-select>
  650. <el-select v-if="this.$store.getters.xt_user.org_id != 10188 && this.$store.getters.xt_user.org_id != 10217" style="width:50%;" v-model="temp_med_type"
  651. placeholder="医疗类型" @change="changevalue">
  652. <el-option
  653. v-for="(item,index) in register"
  654. :key="index"
  655. :label="item.label"
  656. :value="item.value">
  657. </el-option>
  658. </el-select>
  659. <span slot="footer" class="dialog-footer">
  660. <el-button @click="dialogVisible = false">取 消</el-button>
  661. <el-button type="primary" @click="comfirmChangeMedType">确 定</el-button>
  662. </span>
  663. </el-dialog>
  664. <additionalCharges ref='additionalCharges' @click="addCharges"
  665. :addtions_charge="addtions_charge"></additionalCharges>
  666. <register-dialog ref='register' :doctors="doctors" :departments="department" :sick="sick" :diagnoses="diagnoses"
  667. v-on:confirm="confirm" v-on:cancel="cancel"></register-dialog>
  668. <register-dialog9504 ref='register9504' :doctors="doctors" :departments="department" :sick="sick"
  669. :diagnoses="diagnoses"
  670. v-on:confirm="registerConfirm" v-on:cancel="registerCancel"></register-dialog9504>
  671. <charge-dialog ref='charge' v-on:confirm="chargeConfirm" v-on:cancel="chargeCancel"></charge-dialog>
  672. <el-dialog
  673. class="centerDialog"
  674. width="900px"
  675. title="打印"
  676. :visible.sync="treatVisible">
  677. <treatPrint :paramsObj='paramsObj'></treatPrint>
  678. </el-dialog>
  679. <el-dialog
  680. class="centerDialog"
  681. width="1200px"
  682. title="打印"
  683. :visible.sync="statementVisible">
  684. <statementPrint ref="print" :paramsObj='orderObj'></statementPrint>
  685. </el-dialog>
  686. <el-dialog
  687. class="centerDialog"
  688. width="1200px"
  689. title="打印"
  690. :visible.sync="newStatementVisible">
  691. <new-statement-print-two :params-obj="newOrderObj"></new-statement-print-two>
  692. <!--<newStatementPrint ref="print" :paramsObj='newOrderObj'></newStatementPrint>-->
  693. </el-dialog>
  694. <el-dialog title="输入密码" :visible.sync="pwdFormVisible">
  695. <el-form :model="form">
  696. <el-form-item label="密码" :label-width="20">
  697. <el-input v-model="pwd" show-password="false"></el-input>
  698. </el-form-item>
  699. </el-form>
  700. <div slot="footer" class="dialog-footer">
  701. <el-button @click="pwdFormVisible = false">取 消</el-button>
  702. <el-button type="primary" @click="comfirmPWDialog">确 定</el-button>
  703. </div>
  704. </el-dialog>
  705. <el-dialog
  706. class="centerDialog"
  707. width="1200px"
  708. title="打印"
  709. :visible.sync="invoiceVisible">
  710. <invoice-print ref="print" :invoiceParams='invoiceParams'></invoice-print>
  711. </el-dialog>
  712. </div>
  713. </template>
  714. <script>
  715. import axios from 'axios'
  716. import invoicePrint from './invoicePrint'
  717. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  718. import noCharge from './components/noCharge'
  719. import charged from './components/charged'
  720. import medicalInsuranceRefund from './components/medicalInsuranceRefund'
  721. import prescriptionTable from './components/prescriptionTable'
  722. import additionalCharges from './components/additionalCharges'
  723. import { fetchAllAdminUsers } from '@/api/doctor'
  724. import {
  725. changeMedType,
  726. getChargeHisPatientInfo,
  727. getChargeHisPatientList,
  728. getDayOrMonthHisPrescription,
  729. getInitData,
  730. getMonthCharge,
  731. preSettle,
  732. Refund,
  733. refundNumber,
  734. register,
  735. upload,
  736. } from '@/api/his/his'
  737. import RegisterDialog from './components/registerDialog'
  738. import treatPrint from './treatPrint'
  739. import statementPrint from './statementPrint'
  740. import ChargeDialog from './components/chargeDialog'
  741. import MonthPrescriptionTable from './components/monthPrescriptionTable'
  742. import ChargeMonthPrescriptionTable from './components/chargeMonthPrescriptionTable'
  743. import NewStatementPrintTwo from './newStatementPrintTwo'
  744. import RegisterDialog9504 from './components/registerDialog9504'
  745. import cryptoJs from 'crypto-js'
  746. const moment = require('moment')
  747. export default {
  748. components: {
  749. RegisterDialog9504,
  750. NewStatementPrintTwo,
  751. ChargeMonthPrescriptionTable,
  752. MonthPrescriptionTable,
  753. ChargeDialog,
  754. RegisterDialog,
  755. BreadCrumb,
  756. noCharge,
  757. charged,
  758. medicalInsuranceRefund,
  759. prescriptionTable,
  760. additionalCharges,
  761. treatPrint,
  762. statementPrint,
  763. invoicePrint
  764. },
  765. data() {
  766. return {
  767. invoiceVisible:false,
  768. invoiceParams:null,
  769. temp_med_type: '',
  770. dialogVisible: false,
  771. pwdFormVisible: false,
  772. pwd: '000000',
  773. form: {
  774. p_type: '',
  775. sick_type: '',
  776. diagnosis: [],
  777. medical_care: '',
  778. diagnosis_time: ''
  779. },
  780. current_med_type: '',
  781. rules: {
  782. sick_type: [{ required: true, message: '大病类别不能为空', trigger: 'change' }],
  783. diagnosis: [{ required: true, message: '诊断不能为空', trigger: 'change' }]
  784. },
  785. // medical_care: [
  786. // { value: 11, label: '普通门诊' },
  787. // { value: 12, label: '家庭通道' },
  788. // { value: 13, label: '门诊大病' },
  789. // { value: 14, label: '重疾特药' },
  790. // { value: 15, label: '门诊慢病' },
  791. // { value: 16, label: '门诊特检' },
  792. // { value: 17, label: '健康体检' },
  793. // { value: 18, label: '预防接种' },
  794. // { value: 19, label: '门诊输血' },
  795. // { value: 91, label: '新冠肺炎门诊' },
  796. // { value: 1111, label: '精一' },
  797. // { value: 1112, label: '精二' }
  798. // ],
  799. //
  800. // medical_care_two: [
  801. // { value: '11', label: '普通门诊' },
  802. // { value: '12', label: '家庭通道' },
  803. // { value: '13', label: '门诊大病' },
  804. // { value: '14', label: '重疾特药' },
  805. // { value: '15', label: '门诊慢病' },
  806. // { value: '16', label: '门诊特检' },
  807. // { value: '17', label: '健康体检' },
  808. // { value: '18', label: '预防接种' },
  809. // { value: '19', label: '门诊输血' },
  810. // { value: '91', label: '新冠肺炎门诊' },
  811. // ],
  812. register: [
  813. { value: 11, label: '普通门诊' },
  814. { value: 14, label: '门诊特殊病' },
  815. { value: '9922', label: '家庭通道' },
  816. { value: '1111', label: '精一' },
  817. { value: '1112', label: '精二' },
  818. { value: '1112', label: '精二' }
  819. ],
  820. registerThree: [
  821. { value: 11, label: '普通门诊' },
  822. { value: 14, label: '门诊特殊病' },
  823. { value: '9922', label: '家庭通道' },
  824. { value: '1111', label: '精一' },
  825. { value: '1112', label: '精二' },
  826. { value: '9933', label: '门诊特殊病(9933)' },
  827. { value: '990602', label: '门诊特殊病(990602)' },
  828. { value: '1402', label: '门诊特殊病(1402)' }
  829. ],
  830. register_two: [
  831. { value: '11', label: '普通门诊' },
  832. { value: '14', label: '门诊特殊病' },
  833. { value: '9922', label: '家庭通道' },
  834. { value: '9933', label: '门诊特殊病(9933)' },
  835. { value: '990602', label: '门诊特殊病(990602)' },
  836. { value: '1402', label: '门诊特殊病(1402)' }
  837. ],
  838. loading: false,
  839. dise_loading: false,
  840. org_id: this.$store.getters.xt_user.org_id,
  841. sick_history: '',
  842. p_type: '',
  843. sick_type: '',
  844. diagnosis: '',
  845. month_check: '',
  846. month_p_type: '',
  847. month_sick_type: '',
  848. month_diagnosis: '',
  849. key: '',
  850. other_start_time: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  851. other_end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  852. other_start_time_two: moment(new Date()).subtract(30, 'days').format('YYYY-MM-DD'),
  853. other_end_time_two: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  854. adminUserOptions:[],
  855. curMonthPrescriptions: null,
  856. newCurMonthPrescriptions: null,
  857. big_month_prescriptions: [],
  858. month_total: 0,
  859. crumbs: [
  860. { path: false, name: '门诊收费' },
  861. { path: false, name: '门诊收费管理' }
  862. ],
  863. current_index: 0,
  864. cal_one: '',
  865. cal_two: '',
  866. cal_three: '',
  867. tableHeight: '',
  868. fullHeight: document.documentElement.clientHeight,
  869. activeName: 'first',
  870. info: {},
  871. curPrescriptions: {},
  872. prescriptions: [],
  873. big_prescriptions: [],
  874. big_prescriptions_two: [],
  875. check: 11,
  876. month_prescriptions: [],
  877. med_radio: '',
  878. record_date: '',
  879. tableData: [],
  880. editableTabsValue: '处方1',
  881. loadingone: false,
  882. editableTabs: [{
  883. title: '处方1',
  884. name: '1'
  885. }],
  886. tabIndex: 1,
  887. hisPatientInfo: {},
  888. loadingtwo: false,
  889. patientTableData: [{}],
  890. patientInfo: { id: 0 },
  891. doctor: {},
  892. total: 0,
  893. state: '未收费',
  894. radio: 1,
  895. radioStatus: 1,
  896. search_input: '',
  897. start_time: moment().locale('zh-cn').format('YYYY-MM-DD'),
  898. patient_id: 0,
  899. prescription_id: 0,
  900. all_table_data: [],
  901. hisPatientDatas: [],
  902. order: {},
  903. currentOrder: {},
  904. addtions_charge: [],
  905. treatVisible: false,
  906. orderObj: {},
  907. paramsObj: {},
  908. newOrderObj: {},
  909. statementVisible: false,
  910. newStatementVisible: false,
  911. sick: [],
  912. diagnoses: [],
  913. manufacturers: [],
  914. department: [],
  915. all_patient: [],
  916. temp_prescriptions: null,
  917. temp_month_prescriptions: null,
  918. temp_ids: '',
  919. other_prescriptions: [],
  920. newLoading: false
  921. }
  922. },
  923. created() {
  924. this.fetchAllAdminUsers()
  925. const tableHeight = document.body.clientHeight - 290
  926. this.tableHeight = tableHeight
  927. var nowDate = new Date()
  928. var nowYear = nowDate.getFullYear()
  929. var nowMonth = nowDate.getMonth() + 1
  930. var nowDay = nowDate.getDate()
  931. var nowHours = nowDate.getHours()
  932. var nowMinutes = nowDate.getMinutes()
  933. var nowSeconds = nowDate.getSeconds()
  934. this.record_date =
  935. nowYear +
  936. '-' +
  937. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  938. '-' +
  939. (nowDay < 10 ? '0' + nowDay : nowDay)
  940. this.form.diagnosis_time = nowYear +
  941. '-' +
  942. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  943. '-' +
  944. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) +
  945. ':' +
  946. (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes) + ':' + (nowSeconds < 10 ? '0' + nowSeconds : nowSeconds)
  947. this.getInitData()
  948. //获取患者信息
  949. this.getPatientList()
  950. },
  951. methods: {
  952. fetchAllAdminUsers() {
  953. fetchAllAdminUsers().then(response => {
  954. if (response.data.state == 1) {
  955. this.adminUserOptions = response.data.data.users
  956. }
  957. })
  958. },
  959. changeTimeTwo() {
  960. this.getPatientList()
  961. var nowDate = new Date()
  962. var nowHours = nowDate.getHours()
  963. var nowMinutes = nowDate.getMinutes()
  964. var nowSeconds = nowDate.getSeconds()
  965. this.form.diagnosis_time = this.record_date + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes) + ':' + (nowSeconds < 10 ? '0' + nowSeconds : nowSeconds)
  966. },
  967. comfirmPWDialog() {
  968. var that = this
  969. axios.get('http://127.0.0.1:9532/api/pwd/check', {
  970. params: {
  971. 'card_pwd': this.pwd,
  972. 'his_patient_id': this.hisPatientInfo.id,
  973. 'admin_user_id': this.$store.getters.xt_user.user.id
  974. }
  975. })
  976. .then(function(response) {
  977. if (response.data.state == 0) {
  978. that.$message.error(response.data.msg)
  979. return false
  980. } else {
  981. if (response.data.data.failed_code == -10) {
  982. this.pwd = ''
  983. that.$confirm(response.data.data.msg, '医保错误信息', {
  984. confirmButtonText: '确 定',
  985. type: 'warning'
  986. }).then(() => {
  987. }).catch(() => {
  988. })
  989. } else {
  990. that.pwdFormVisible = false
  991. if (that.activeName == 'first') {
  992. that.$refs.charge.show(that.getTotalFour(that.other_prescriptions), that.currentOrder)
  993. } else {
  994. that.$refs.charge.show(that.getTotalFour(that.other_prescriptions), that.currentOrder)
  995. }
  996. }
  997. }
  998. })
  999. .catch(function(error) {
  1000. })
  1001. },
  1002. openDialog(item) {
  1003. this.dialogVisible = true
  1004. this.temp_prescriptions = item
  1005. },
  1006. openMonthDialog(item) {
  1007. this.dialogVisible = true
  1008. console.log(item)
  1009. this.temp_month_prescriptions = item
  1010. console.log(this.temp_month_prescriptions)
  1011. },
  1012. openMonthDialogTwo(item) {
  1013. this.dialogVisible = true
  1014. this.temp_prescriptions = item
  1015. },
  1016. comfirmChangeMedType() {
  1017. let params = {
  1018. med_type: this.temp_med_type.toString()
  1019. }
  1020. if (this.activeName == 'first') {
  1021. params['ids'] = this.temp_prescriptions.id.toString()
  1022. params['settle_type'] = 1
  1023. } else if (this.activeName == 'second') {
  1024. params['ids'] = this.temp_month_prescriptions.curMonthPrescriptions.prescriptions_ids
  1025. params['settle_type'] = 2
  1026. params['start_time'] = this.other_start_time
  1027. params['end_time'] = this.other_end_time
  1028. params['old_med_type'] = this.temp_month_prescriptions.med_type
  1029. } else if (this.activeName == 'third') {
  1030. params['ids'] = this.temp_prescriptions.id.toString()
  1031. params['settle_type'] = 1
  1032. }
  1033. changeMedType(params).then(response => {
  1034. if (response.data.state == 1) {
  1035. if (this.activeName == 'first') {
  1036. this.changeRadioAndPatient(1)
  1037. } else if (this.activeName == 'second') {
  1038. const params = {
  1039. 'record_date': this.record_date,
  1040. 'patient_id': this.patientInfo.id,
  1041. 'his_patient_id': this.hisPatientInfo.id,
  1042. 'start_time': this.other_start_time,
  1043. 'end_time': this.other_end_time,
  1044. 'type': this.radio,
  1045. 'p_type': 2,
  1046. 'order_id': this.order.id
  1047. }
  1048. getDayOrMonthHisPrescription(params).then(response => {
  1049. if (response.data.state == 1) {
  1050. this.loading = false
  1051. this.month_prescriptions = []
  1052. this.setMonthPrescription(response.data.data.day_prescription)
  1053. this.curMonthPrescriptions = this.month_prescriptions[0]
  1054. } else {
  1055. this.$message.error(response.data.msg)
  1056. }
  1057. })
  1058. } else if (this.activeName == 'third') {
  1059. const params = {
  1060. 'record_date': this.record_date,
  1061. 'patient_id': this.patientInfo.id,
  1062. 'his_patient_id': this.hisPatientInfo.id,
  1063. 'start_time': this.other_start_time_two,
  1064. 'end_time': this.other_end_time_two,
  1065. 'type': this.radio,
  1066. 'p_type': 2,
  1067. 'order_id': this.order.id
  1068. }
  1069. getDayOrMonthHisPrescription(params).then(response => {
  1070. if (response.data.state == 1) {
  1071. this.loading = false
  1072. this.big_prescriptions_two = []
  1073. this.setMonthPrescriptionTwo(response.data.data.day_prescription)
  1074. this.newCurMonthPrescriptions = this.big_prescriptions_two[0]
  1075. } else {
  1076. this.$message.error(response.data.msg)
  1077. }
  1078. })
  1079. }
  1080. this.dialogVisible = false
  1081. } else {
  1082. this.$message.error(response.data.msg)
  1083. }
  1084. })
  1085. },
  1086. changevalue(val) {
  1087. this.$forceUpdate()
  1088. }, GetDiagnosisName(ids) {
  1089. },
  1090. query() {
  1091. if (this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990) {
  1092. var that = this
  1093. axios.get('http://127.0.0.1:9532/api/org/info', {
  1094. params: {}
  1095. })
  1096. .then(function(response) {
  1097. if (response.data.state == 0) {
  1098. that.$message.error(response.data.msg)
  1099. return false
  1100. } else {
  1101. }
  1102. })
  1103. .catch(function(error) {
  1104. })
  1105. }
  1106. },
  1107. getDepartment(department_id) {
  1108. for (let i = 0; i < this.department.length; i++) {
  1109. if (this.department[i].id == department_id) {
  1110. return this.department[i].name
  1111. }
  1112. }
  1113. },
  1114. querySearch2(queryString, cb) {
  1115. var restaurants = this.other_sick
  1116. restaurants.map(item => {
  1117. item.value = item.name
  1118. })
  1119. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  1120. // 调用 callback 返回建议列表的数据
  1121. cb(results)
  1122. },
  1123. changeTime(val) {
  1124. const params = {
  1125. 'record_date': this.record_date,
  1126. 'patient_id': this.patientInfo.id,
  1127. 'his_patient_id': this.hisPatientInfo.id,
  1128. 'start_time': val,
  1129. 'end_time': this.other_end_time,
  1130. 'type': this.radio,
  1131. 'p_type': 2,
  1132. 'order_id': this.order.id
  1133. }
  1134. getMonthCharge(params).then(response => {
  1135. if (response.data.state == 1) {
  1136. this.loading = false
  1137. this.month_prescriptions = []
  1138. this.setMonthPrescription(response.data.data.month_prescriptions)
  1139. this.curMonthPrescriptions = this.month_prescriptions[0]
  1140. } else {
  1141. this.$message.error(response.data.msg)
  1142. }
  1143. })
  1144. },
  1145. changeEndTime(val) {
  1146. const params = {
  1147. 'record_date': this.record_date,
  1148. 'patient_id': this.patientInfo.id,
  1149. 'his_patient_id': this.hisPatientInfo.id,
  1150. 'start_time': this.other_start_time,
  1151. 'end_time': val,
  1152. 'type': this.radio,
  1153. 'p_type': 2,
  1154. 'order_id': this.order.id
  1155. }
  1156. getMonthCharge(params).then(response => {
  1157. if (response.data.state == 1) {
  1158. this.loading = false
  1159. this.month_prescriptions = []
  1160. this.setMonthPrescription(response.data.data.month_prescriptions)
  1161. this.curMonthPrescriptions = this.month_prescriptions[0]
  1162. } else {
  1163. this.$message.error(response.data.msg)
  1164. }
  1165. })
  1166. },
  1167. changeTimeThree(val) {
  1168. let params = {
  1169. patient_id: this.patientInfo.id,
  1170. start_time: val,
  1171. end_time: this.other_end_time_two,
  1172. p_type: 2,
  1173. type: this.radio
  1174. }
  1175. getDayOrMonthHisPrescription(params).then(response => {
  1176. if (response.data.state == 1) {
  1177. this.big_prescriptions_two = []
  1178. this.setMonthPrescriptionTwo(response.data.data.day_prescription)
  1179. this.newCurMonthPrescriptions = this.big_prescriptions_two[0]
  1180. } else {
  1181. this.$message.error(response.data.msg)
  1182. }
  1183. })
  1184. },
  1185. changeEndTimeThree(val) {
  1186. let params = {
  1187. patient_id: this.patientInfo.id,
  1188. start_time: this.other_start_time_two,
  1189. end_time: val,
  1190. p_type: 2
  1191. }
  1192. getDayOrMonthHisPrescription(params).then(response => {
  1193. if (response.data.state == 1) {
  1194. this.big_prescriptions_two = []
  1195. this.setMonthPrescriptionTwo(response.data.data.day_prescription)
  1196. this.newCurMonthPrescriptions = this.big_prescriptions_two[0]
  1197. } else {
  1198. this.$message.error(response.data.msg)
  1199. }
  1200. })
  1201. },
  1202. chargeConfirm(form) {
  1203. this.newLoading = true
  1204. form['id'] = this.patientInfo.id
  1205. form['his_patient_id'] = this.hisPatientInfo.id
  1206. form['record_time'] = this.record_date
  1207. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  1208. form['order_id'] = this.currentOrder.id
  1209. form['org_id'] = this.$store.getters.xt_user.org_id
  1210. form['begin_time'] = this.form.diagnosis_time
  1211. form['p_type'] = this.current_med_type
  1212. form['diagnosis'] = this.form.diagnosis.join(',')
  1213. form['sick_type'] = this.form.sick_type
  1214. form['ids'] = this.temp_ids
  1215. if (this.activeName == 'first') {
  1216. form['settle_accounts_type'] = 1
  1217. } else if (this.activeName == 'second') {
  1218. form['start_time'] = this.other_start_time
  1219. form['end_time'] = this.other_end_time
  1220. form['settle_accounts_type'] = 2
  1221. } else {
  1222. form['start_time'] = this.other_start_time_two
  1223. form['end_time'] = this.other_end_time_two
  1224. form['settle_accounts_type'] = 2
  1225. }
  1226. if (this.hisPatientInfo.balance_accounts_type == 2) {
  1227. upload(form).then(response => {
  1228. if (response.data.state == 0) {
  1229. this.$message.error(response.data.msg)
  1230. this.loadingtwo = false
  1231. this.newLoading = false
  1232. this.$refs.charge.hide()
  1233. return false
  1234. } else {
  1235. this.$refs.charge.hide()
  1236. this.radio = 2
  1237. this.changeRadioAndPatient(2)
  1238. this.loadingtwo = false
  1239. this.state = '已收费'
  1240. this.$message({ message: '收费成功', type: 'success' })
  1241. this.$refs.charge.hide()
  1242. this.loadingtwo = false
  1243. this.newLoading = false
  1244. }
  1245. })
  1246. } else {
  1247. var that = this
  1248. axios.get('http://127.0.0.1:9532/api/upload/get', {
  1249. params: form,
  1250. headers: {
  1251. 'Permission': 5
  1252. }
  1253. })
  1254. .then(function(response) {
  1255. if (response.data.state == 0) {
  1256. that.$message.error(response.data.msg)
  1257. that.loadingtwo = false
  1258. that.$refs.charge.hide()
  1259. return false
  1260. } else {
  1261. if (response.data.data.failed_code == -10) {
  1262. that.$confirm(response.data.data.msg, '医保错误信息', {
  1263. confirmButtonText: '确 定',
  1264. type: 'warning'
  1265. }).then(() => {
  1266. that.newLoading = false
  1267. }).catch(() => {
  1268. that.newLoading = false
  1269. })
  1270. } else {
  1271. that.changeRadioAndPatient(2)
  1272. that.radio = 2
  1273. that.$refs.charge.hide()
  1274. that.loadingtwo = false
  1275. that.state = '已收费'
  1276. that.$message({ message: '收费成功', type: 'success', duration: 5000 })
  1277. that.loadingtwo = false
  1278. that.cal_one = this.cal_one - 1
  1279. that.cal_two = this.cal_two + 1
  1280. that.patientTableData.splice(this.current_index, 1)
  1281. that.newLoading = false
  1282. }
  1283. }
  1284. })
  1285. .catch(function(error) {
  1286. that.newLoading = false
  1287. })
  1288. }
  1289. },
  1290. chargeCancel() {
  1291. this.$refs.charge.hide()
  1292. },
  1293. registerCancel() {
  1294. this.$refs.register9504.hide()
  1295. },
  1296. registerConfirm(forms) {
  1297. forms['record_time'] = this.record_date
  1298. forms['admin_user_id'] = this.$store.getters.xt_user.user.id
  1299. forms['org_id'] = this.$store.getters.xt_user.org_id
  1300. this.loadingone = true
  1301. var that = this
  1302. if (forms.settlement_value == 2) {
  1303. register(forms).then(response => {
  1304. if (response.data.state == 0) {
  1305. this.$message.error(response.data.msg)
  1306. this.loadingone = false
  1307. // this.$refs.register.hide()
  1308. return false
  1309. } else {
  1310. // this.getPatientList()
  1311. this.changeRadio(1)
  1312. this.$message({ message: '挂号成功', type: 'success', duration: 5000 })
  1313. this.$refs.register9504.hide()
  1314. this.loadingone = false
  1315. }
  1316. })
  1317. } else {
  1318. if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10138 || this.$store.getters.xt_user.org_id == 10088) {
  1319. axios.get('http://127.0.0.1:9532/api/register/get', {
  1320. params: forms,
  1321. headers: {
  1322. 'Permission': 5
  1323. }
  1324. })
  1325. .then(function(response) {
  1326. if (response.data.state == 0) {
  1327. that.$message.error(response.data.msg)
  1328. that.loadingone = false
  1329. that.$refs.register9504.hide()
  1330. return false
  1331. } else {
  1332. that.loadingone = false
  1333. if (response.data.data.failed_code == -10) {
  1334. that.$confirm(response.data.data.msg, '医保错误信息', {
  1335. confirmButtonText: '确 定',
  1336. type: 'warning'
  1337. }).then(() => {
  1338. }).catch(() => {
  1339. })
  1340. } else {
  1341. that.changeRadio(1)
  1342. that.$refs.register9504.hide()
  1343. that.$message({ message: '挂号成功', type: 'success' })
  1344. }
  1345. }
  1346. })
  1347. .catch(function(error) {
  1348. })
  1349. }
  1350. }
  1351. },
  1352. confirm(forms) {
  1353. var time = Math.round(new Date().getTime() / 1000).toString()
  1354. var param = '_api_access_key=' + '1781ce9fb73a478289326c16ba8bf2c4' + '&_api_name=' + 'hssServives' + '&_api_timestamp=' + time + '&_api_version=' + '1.0.0'
  1355. var signature = cryptoJs.enc.Base64.stringify(cryptoJs.HmacSHA1(param, '+b5DPOGjc08DAAMJ8FP31pwwNHKo='))
  1356. console.log(Math.round(new Date().getTime() / 1000).toString())
  1357. forms['record_time'] = this.record_date
  1358. forms['admin_user_id'] = this.$store.getters.xt_user.user.id
  1359. forms['org_id'] = this.$store.getters.xt_user.org_id
  1360. forms['key'] = signature
  1361. forms['time_stamp'] = time
  1362. this.loadingone = true
  1363. var that = this
  1364. if (forms.settlement_value == 2) {
  1365. register(forms).then(response => {
  1366. if (response.data.state == 0) {
  1367. this.$message.error(response.data.msg)
  1368. this.loadingone = false
  1369. // this.$refs.register.hide()
  1370. return false
  1371. } else {
  1372. // this.getPatientList()
  1373. this.changeRadioAndPatient(1)
  1374. this.$message({ message: '挂号成功', type: 'success', duration: 5000 })
  1375. this.$refs.register.hide()
  1376. this.loadingone = false
  1377. }
  1378. })
  1379. } else {
  1380. var that = this
  1381. axios.get('http://127.0.0.1:9532/api/register/get', {
  1382. params: forms,
  1383. headers: {
  1384. 'Permission': 5
  1385. }
  1386. })
  1387. .then(function(response) {
  1388. if (response.data.state == 0) {
  1389. that.$message.error(response.data.msg)
  1390. that.loadingone = false
  1391. that.$refs.register.hide()
  1392. return false
  1393. } else {
  1394. if (response.data.data.failed_code == -10) {
  1395. // that.$message.error(response.data.data.msg);
  1396. that.$confirm(response.data.data.msg, '医保错误信息', {
  1397. confirmButtonText: '确 定',
  1398. type: 'warning'
  1399. }).then(() => {
  1400. }).catch(() => {
  1401. })
  1402. } else {
  1403. that.changeRadioAndPatient(1)
  1404. that.$message({ message: '挂号成功', type: 'success', duration: 5000 })
  1405. that.$refs.register.hide()
  1406. that.loadingone = false
  1407. }
  1408. }
  1409. })
  1410. .catch(function(error) {
  1411. })
  1412. }
  1413. },
  1414. cancel() {
  1415. this.$refs.register.hide()
  1416. },
  1417. addCharges() {
  1418. this.$refs.additionalCharges.show()
  1419. },
  1420. changeDate(val) {
  1421. if (this.patientInfo.id == 0) {
  1422. this.$message.error('请先选择患者')
  1423. return
  1424. }
  1425. let params = {
  1426. 'record_date': val,
  1427. 'patient_id': this.patientInfo.id,
  1428. 'type': this.radio,
  1429. 'p_type': 2,
  1430. 'his_patient_id': this.hisPatientInfo.id
  1431. }
  1432. getChargeHisPatientInfo(params).then(response => {
  1433. if (response.data.state == 0) {
  1434. this.$message.error(response.data.msg)
  1435. return false
  1436. } else {
  1437. this.prescriptions = []
  1438. this.month_prescriptions = []
  1439. this.curPrescriptions = {}
  1440. this.month_prescriptions = {}
  1441. this.patientInfo = response.data.data.xt_info
  1442. this.hisPatientInfo = response.data.data.his_info
  1443. this.info = response.data.data.info
  1444. this.order = response.data.data.order
  1445. this.addtions_charge = response.data.data.addtions_charge
  1446. // this.setMonthPrescription(response.data.data.month_prescriptions)
  1447. for (let i = 0; i < response.data.data.prescription.length; i++) {
  1448. var prescription = response.data.data.prescription[i]
  1449. let tempAdvice = []
  1450. let tempProject = []
  1451. for (let b = 0; b < prescription.advices.length; b++) {
  1452. let spec = prescription.advices[b].drug.dose + prescription.advices[b].drug.dose_unit + '*' + prescription.advices[b].drug.min_number + prescription.advices[b].drug.min_unit + '/' + prescription.advices[b].drug.max_unit
  1453. let obj = {
  1454. advice_id: prescription.advices[b].id,
  1455. drug_name: prescription.advices[b].advice_name,
  1456. single_dose: prescription.advices[b].single_dose,
  1457. delivery_way: prescription.advices[b].delivery_way,
  1458. execution_frequency: prescription.advices[b].execution_frequency,
  1459. retail_price: prescription.advices[b].price,
  1460. remark: prescription.advices[b].remark,
  1461. day: prescription.advices[b].day,
  1462. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  1463. single_dose_unit: prescription.advices[b].single_dose_unit,
  1464. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  1465. medical_insurance_number: prescription.advices[b].med_list_codg,
  1466. code: prescription.advices[b].drug.medical_insurance_number,
  1467. spec: spec,
  1468. det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
  1469. name_id: prescription.advices[b].drug.manufacturer,
  1470. fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
  1471. overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
  1472. preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
  1473. inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt,
  1474. execution_state: prescription.advices[b].execution_state
  1475. }
  1476. tempAdvice.push(obj)
  1477. }
  1478. for (let b = 0; b < prescription.project.length; b++) {
  1479. let obj = {
  1480. id: prescription.project[b].id,
  1481. project_id: prescription.project[b].project.id,
  1482. // project_name: prescription.project[b].project.project_name,
  1483. // statistical_classification: prescription.project[b].project.statistical_classification,
  1484. single_dose: prescription.project[b].single_dose,
  1485. delivery_way: prescription.project[b].delivery_way,
  1486. execution_frequency: prescription.project[b].execution_frequency,
  1487. number_days: prescription.project[b].day,
  1488. total: prescription.project[b].count.toString(),
  1489. price: prescription.project[b].price,
  1490. remark: prescription.project[b].remark,
  1491. // medical_code: prescription.project[b].project.medical_code,
  1492. unit: prescription.project[b].unit,
  1493. type: prescription.project[b].type,
  1494. det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt,
  1495. fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
  1496. overlmt_amt: prescription.project[b].order_info.overlmt_amt,
  1497. preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
  1498. inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt,
  1499. execution_state: prescription.project[b].execution_state
  1500. }
  1501. if (prescription.project[b].type == 2) {
  1502. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  1503. obj['medical_code'] = prescription.project[b].project.medical_code
  1504. obj['project_name'] = prescription.project[b].project.project_name
  1505. obj['spec'] = ''
  1506. obj['name_id'] = 0
  1507. } else if (prescription.project[b].type == 3) {
  1508. obj['statistical_classification'] = ''
  1509. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  1510. obj['project_name'] = prescription.project[b].good_info.good_name
  1511. obj['spec'] = prescription.project[b].good_info.specification_name
  1512. obj['name_id'] = prescription.project[b].good_info.manufacturer
  1513. }
  1514. tempProject.push(obj)
  1515. }
  1516. let index = i + 1
  1517. let obj = {
  1518. id: prescription.id,
  1519. name: '处方' + index,
  1520. advices: tempAdvice,
  1521. project: tempProject,
  1522. type: prescription.type,
  1523. order_status: prescription.order_status
  1524. }
  1525. this.prescriptions.push(obj)
  1526. }
  1527. this.curPrescriptions = this.prescriptions[0]
  1528. this.total = 0
  1529. this.total = this.getTotalOne()
  1530. this.month_total = 0
  1531. this.month_total = this.getMonthTotalOne()
  1532. }
  1533. })
  1534. },
  1535. getInitData() {
  1536. getInitData().then(response => {
  1537. if (response.data.state == 0) {
  1538. this.$message.error(response.data.msg)
  1539. return false
  1540. } else {
  1541. this.doctors = response.data.data.doctors
  1542. this.department = response.data.data.department
  1543. this.sick = response.data.data.sick
  1544. this.diagnoses = response.data.data.diagnose
  1545. this.manufacturers = response.data.data.manufacturers
  1546. console.log('生产厂家')
  1547. console.log(this.manufacturers)
  1548. }
  1549. })
  1550. },
  1551. getDayPatientList() {
  1552. let params = {
  1553. 'record_date': this.record_date
  1554. }
  1555. getChargeHisPatientList(params).then(response => {
  1556. if (response.data.state == 0) {
  1557. this.$message.error(response.data.msg)
  1558. return false
  1559. } else {
  1560. this.patientTableData = []
  1561. this.all_table_data = []
  1562. this.hisPatientDatas = []
  1563. let one_count = 0
  1564. let two_count = 0
  1565. let three_count = 0
  1566. for (let i = 0; i < response.data.data.list.length; i++) {
  1567. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  1568. if (response.data.data.list[i].prescription.length > 0) {
  1569. let obj = {
  1570. id: response.data.data.list[i].id,
  1571. name: response.data.data.list[i].name,
  1572. number: '',
  1573. order_status: 0,
  1574. order_number: '',
  1575. his_patient_id: 0,
  1576. prescription: response.data.data.list[i].prescription
  1577. }
  1578. this.all_table_data.push(obj)
  1579. }
  1580. } else { //挂号
  1581. if (response.data.data.list[i].his_patient.length == 1) {
  1582. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  1583. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  1584. let obj = {
  1585. id: response.data.data.list[i].id,
  1586. name: response.data.data.list[i].name,
  1587. number: response.data.data.list[i].his_patient[0].number,
  1588. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  1589. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1590. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  1591. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  1592. prescription: response.data.data.list[i].prescription
  1593. }
  1594. this.all_table_data.push(obj)
  1595. }
  1596. } else {
  1597. let obj = {
  1598. id: response.data.data.list[i].id,
  1599. name: response.data.data.list[i].name,
  1600. number: response.data.data.list[i].his_patient[0].number,
  1601. order_status: 0,
  1602. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1603. order_number: '',
  1604. order_id: 0,
  1605. prescription: response.data.data.list[i].prescription
  1606. }
  1607. this.all_table_data.push(obj)
  1608. }
  1609. }
  1610. if (response.data.data.list[i].his_patient.length > 1) {
  1611. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  1612. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  1613. let obj = {
  1614. id: response.data.data.list[i].id,
  1615. name: response.data.data.list[i].name,
  1616. number: response.data.data.list[i].his_patient[b].number,
  1617. order_status: 0,
  1618. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1619. order_number: '',
  1620. order_id: 0,
  1621. prescription: response.data.data.list[i].prescription
  1622. }
  1623. this.all_table_data.push(obj)
  1624. } else {
  1625. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  1626. let obj = {
  1627. id: response.data.data.list[i].id,
  1628. name: response.data.data.list[i].name,
  1629. number: response.data.data.list[i].his_patient[b].number,
  1630. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  1631. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1632. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  1633. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  1634. prescription: response.data.data.list[i].prescription
  1635. }
  1636. this.all_table_data.push(obj)
  1637. }
  1638. }
  1639. }
  1640. }
  1641. }
  1642. }
  1643. for (let i = 0; i < this.all_table_data.length; i++) {
  1644. if (this.all_table_data[i].his_patient_id > 0) {
  1645. this.hisPatientDatas.push(this.all_table_data[i])
  1646. }
  1647. }
  1648. let unChargePatient = []
  1649. for (let i = 0; i < this.all_table_data.length; i++) {
  1650. let isHasUnCharge = false
  1651. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1652. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1653. isHasUnCharge = true
  1654. } else {
  1655. if (this.all_table_data[i].his_patient_id > 0) {
  1656. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1657. isHasUnCharge = true
  1658. }
  1659. }
  1660. }
  1661. }
  1662. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1663. isHasUnCharge = true
  1664. }
  1665. if (isHasUnCharge) {
  1666. unChargePatient.push(this.all_table_data[i])
  1667. }
  1668. }
  1669. unChargePatient = this.unique_four(unChargePatient)
  1670. one_count = one_count + unChargePatient.length
  1671. let ChargePatient = []
  1672. for (let i = 0; i < this.all_table_data.length; i++) {
  1673. if (this.all_table_data[i].order_status == 2) {
  1674. ChargePatient.push(this.all_table_data[i])
  1675. }
  1676. }
  1677. two_count = two_count + ChargePatient.length
  1678. if (this.radio == 1) {
  1679. this.all_table_data = this.unique_four(this.all_table_data)
  1680. }
  1681. console.log(this.all_table_data)
  1682. switch (this.radio) {
  1683. case 1:
  1684. this.patientTableData = []
  1685. for (let i = 0; i < this.all_table_data.length; i++) {
  1686. let isHasUnCharge = false
  1687. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1688. console.log('!111111111')
  1689. console.log(this.all_table_data[i].order_status)
  1690. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1691. console.log('!22222222222')
  1692. isHasUnCharge = true
  1693. } else {
  1694. if (this.all_table_data[i].his_patient_id > 0) {
  1695. console.log('!4444444444444')
  1696. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1697. isHasUnCharge = true
  1698. console.log('!33333333333')
  1699. }
  1700. }
  1701. }
  1702. }
  1703. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1704. console.log('11111111')
  1705. isHasUnCharge = true
  1706. }
  1707. if (isHasUnCharge) {
  1708. this.patientTableData.push(this.all_table_data[i])
  1709. }
  1710. }
  1711. this.all_patient = this.patientTableData
  1712. break
  1713. case 2:
  1714. this.patientTableData = []
  1715. for (let i = 0; i < this.all_table_data.length; i++) {
  1716. if (this.all_table_data[i].order_status == 2) {
  1717. this.patientTableData.push(this.all_table_data[i])
  1718. }
  1719. }
  1720. this.all_patient = this.patientTableData
  1721. break
  1722. case 4:
  1723. this.patientTableData = []
  1724. this.patientTableData = this.all_table_data
  1725. this.all_patient = this.patientTableData
  1726. break
  1727. }
  1728. this.cal_one = one_count
  1729. this.cal_two = two_count
  1730. this.cal_three = one_count + two_count
  1731. this.current_index = 0
  1732. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  1733. this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order_number, this.patientTableData[0].his_patient_id, this.patientTableData[0].order_id)
  1734. }
  1735. })
  1736. },
  1737. getMonthPatientList() {
  1738. let params = {
  1739. 'record_date': this.record_date
  1740. }
  1741. getChargeHisPatientList(params).then(response => {
  1742. if (response.data.state == 0) {
  1743. this.$message.error(response.data.msg)
  1744. return false
  1745. } else {
  1746. this.patientTableData = []
  1747. this.all_table_data = []
  1748. this.hisPatientDatas = []
  1749. let one_count = 0
  1750. let two_count = 0
  1751. let three_count = 0
  1752. for (let i = 0; i < response.data.data.list.length; i++) {
  1753. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  1754. if (response.data.data.list[i].prescription.length > 0) {
  1755. let obj = {
  1756. id: response.data.data.list[i].id,
  1757. name: response.data.data.list[i].name,
  1758. number: '',
  1759. order_status: 0,
  1760. order_number: '',
  1761. his_patient_id: 0,
  1762. prescription: response.data.data.list[i].prescription
  1763. }
  1764. this.all_table_data.push(obj)
  1765. }
  1766. } else { //挂号
  1767. if (response.data.data.list[i].his_patient.length == 1) {
  1768. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  1769. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  1770. let obj = {
  1771. id: response.data.data.list[i].id,
  1772. name: response.data.data.list[i].name,
  1773. number: response.data.data.list[i].his_patient[0].number,
  1774. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  1775. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1776. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  1777. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  1778. prescription: response.data.data.list[i].prescription
  1779. }
  1780. this.all_table_data.push(obj)
  1781. }
  1782. } else {
  1783. let obj = {
  1784. id: response.data.data.list[i].id,
  1785. name: response.data.data.list[i].name,
  1786. number: response.data.data.list[i].his_patient[0].number,
  1787. order_status: 0,
  1788. his_patient_id: response.data.data.list[i].his_patient[0].id,
  1789. order_number: '',
  1790. order_id: 0,
  1791. prescription: response.data.data.list[i].prescription
  1792. }
  1793. this.all_table_data.push(obj)
  1794. }
  1795. }
  1796. if (response.data.data.list[i].his_patient.length > 1) {
  1797. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  1798. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  1799. let obj = {
  1800. id: response.data.data.list[i].id,
  1801. name: response.data.data.list[i].name,
  1802. number: response.data.data.list[i].his_patient[b].number,
  1803. order_status: 0,
  1804. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1805. order_number: '',
  1806. order_id: 0,
  1807. prescription: response.data.data.list[i].prescription
  1808. }
  1809. this.all_table_data.push(obj)
  1810. } else {
  1811. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  1812. let obj = {
  1813. id: response.data.data.list[i].id,
  1814. name: response.data.data.list[i].name,
  1815. number: response.data.data.list[i].his_patient[b].number,
  1816. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  1817. his_patient_id: response.data.data.list[i].his_patient[b].id,
  1818. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  1819. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  1820. prescription: response.data.data.list[i].prescription
  1821. }
  1822. this.all_table_data.push(obj)
  1823. }
  1824. }
  1825. }
  1826. }
  1827. }
  1828. }
  1829. for (let i = 0; i < this.all_table_data.length; i++) {
  1830. if (this.all_table_data[i].his_patient_id > 0) {
  1831. this.hisPatientDatas.push(this.all_table_data[i])
  1832. }
  1833. }
  1834. let unChargePatient = []
  1835. for (let i = 0; i < this.all_table_data.length; i++) {
  1836. let isHasUnCharge = false
  1837. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1838. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1839. isHasUnCharge = true
  1840. } else {
  1841. if (this.all_table_data[i].his_patient_id > 0) {
  1842. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1843. isHasUnCharge = true
  1844. }
  1845. }
  1846. }
  1847. }
  1848. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1849. isHasUnCharge = true
  1850. }
  1851. if (isHasUnCharge) {
  1852. unChargePatient.push(this.all_table_data[i])
  1853. }
  1854. }
  1855. unChargePatient = this.unique_four(unChargePatient)
  1856. one_count = one_count + unChargePatient.length
  1857. let ChargePatient = []
  1858. for (let i = 0; i < this.all_table_data.length; i++) {
  1859. if (this.all_table_data[i].order_status == 2) {
  1860. ChargePatient.push(this.all_table_data[i])
  1861. }
  1862. }
  1863. two_count = two_count + ChargePatient.length
  1864. if (this.radio == 1) {
  1865. this.all_table_data = this.unique_four(this.all_table_data)
  1866. }
  1867. console.log(this.all_table_data)
  1868. switch (this.radio) {
  1869. case 1:
  1870. this.patientTableData = []
  1871. for (let i = 0; i < this.all_table_data.length; i++) {
  1872. let isHasUnCharge = false
  1873. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  1874. console.log('!111111111')
  1875. console.log(this.all_table_data[i].order_status)
  1876. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1877. console.log('!22222222222')
  1878. isHasUnCharge = true
  1879. } else {
  1880. if (this.all_table_data[i].his_patient_id > 0) {
  1881. console.log('!4444444444444')
  1882. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  1883. isHasUnCharge = true
  1884. console.log('!33333333333')
  1885. }
  1886. }
  1887. }
  1888. }
  1889. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  1890. console.log('11111111')
  1891. isHasUnCharge = true
  1892. }
  1893. if (isHasUnCharge) {
  1894. this.patientTableData.push(this.all_table_data[i])
  1895. }
  1896. }
  1897. this.all_patient = this.patientTableData
  1898. break
  1899. case 2:
  1900. this.patientTableData = []
  1901. for (let i = 0; i < this.all_table_data.length; i++) {
  1902. if (this.all_table_data[i].order_status == 2) {
  1903. this.patientTableData.push(this.all_table_data[i])
  1904. }
  1905. }
  1906. this.all_patient = this.patientTableData
  1907. break
  1908. case 4:
  1909. this.patientTableData = []
  1910. this.patientTableData = this.all_table_data
  1911. this.all_patient = this.patientTableData
  1912. break
  1913. }
  1914. this.cal_one = one_count
  1915. this.cal_two = two_count
  1916. this.cal_three = one_count + two_count
  1917. this.current_index = 0
  1918. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  1919. this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order_number, this.patientTableData[0].his_patient_id, this.patientTableData[0].order_id)
  1920. }
  1921. })
  1922. },
  1923. handleClick() {
  1924. this.loading = true
  1925. if (this.activeName == 'first') {
  1926. this.getPatientList()
  1927. } else if (this.activeName == 'second') {
  1928. const params = {
  1929. 'record_date': this.record_date,
  1930. 'patient_id': this.patientInfo.id,
  1931. 'his_patient_id': this.hisPatientInfo.id,
  1932. 'start_time': this.other_start_time,
  1933. 'end_time': this.other_end_time,
  1934. 'type': this.radio,
  1935. 'p_type': 2,
  1936. 'order_id': this.order.id
  1937. }
  1938. getMonthCharge(params).then(response => {
  1939. if (response.data.state == 1) {
  1940. this.loading = false
  1941. this.month_prescriptions = []
  1942. this.setMonthPrescription(response.data.data.month_prescriptions)
  1943. this.curMonthPrescriptions = this.month_prescriptions[0]
  1944. } else {
  1945. this.$message.error(response.data.msg)
  1946. }
  1947. })
  1948. } else {
  1949. const params = {
  1950. 'record_date': this.record_date,
  1951. 'patient_id': this.patientInfo.id,
  1952. 'his_patient_id': this.hisPatientInfo.id,
  1953. 'start_time': this.other_start_time_two,
  1954. 'end_time': this.other_end_time_two,
  1955. 'type': this.radio,
  1956. 'p_type': 2,
  1957. 'order_id': this.order.id
  1958. }
  1959. getDayOrMonthHisPrescription(params).then(response => {
  1960. if (response.data.state == 1) {
  1961. this.loading = false
  1962. this.big_prescriptions_two = []
  1963. this.setMonthPrescriptionTwo(response.data.data.day_prescription)
  1964. this.newCurMonthPrescriptions = this.big_prescriptions_two[0]
  1965. } else {
  1966. this.$message.error(response.data.msg)
  1967. }
  1968. })
  1969. }
  1970. },
  1971. setMonthPrescriptionTwo(month_prescriptions) {
  1972. const big_prescriptions = []
  1973. for (let i = 0; i < this.unique_three(month_prescriptions).length; i++) {
  1974. const obj = {
  1975. med_type: this.unique_three(month_prescriptions)[i].med_type,
  1976. prescriptions: []
  1977. }
  1978. big_prescriptions.push(obj)
  1979. }
  1980. for (let c = 0; c < big_prescriptions.length; c++) {
  1981. const inner_prescription = []
  1982. for (let i = 0; i < month_prescriptions.length; i++) {
  1983. var prescription = month_prescriptions[i]
  1984. if (big_prescriptions[c].med_type == prescription.med_type) {
  1985. const tempAdvice = []
  1986. const tempProject = []
  1987. const tempAddition = []
  1988. for (let b = 0; b < prescription.advices.length; b++) {
  1989. let spec = prescription.advices[b].drug.dose + prescription.advices[b].drug.dose_unit + '*' + prescription.advices[b].drug.min_number + prescription.advices[b].drug.min_unit + '/' + prescription.advices[b].drug.max_unit
  1990. const obj = {
  1991. advice_id: prescription.advices[b].id,
  1992. drug_name: prescription.advices[b].advice_name,
  1993. single_dose: prescription.advices[b].single_dose,
  1994. delivery_way: prescription.advices[b].delivery_way,
  1995. execution_frequency: prescription.advices[b].execution_frequency,
  1996. retail_price: prescription.advices[b].price.toString(),
  1997. remark: prescription.advices[b].remark,
  1998. day: prescription.advices[b].day,
  1999. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  2000. single_dose_unit: prescription.advices[b].single_dose_unit,
  2001. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  2002. code: prescription.advices[b].drug.medical_insurance_number,
  2003. spec: spec,
  2004. det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
  2005. name_id: prescription.advices[b].drug.manufacturer,
  2006. fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
  2007. overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
  2008. preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
  2009. inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt,
  2010. execution_state: prescription.advices[b].execution_state
  2011. }
  2012. tempAdvice.push(obj)
  2013. }
  2014. for (let b = 0; b < prescription.project.length; b++) {
  2015. const obj = {
  2016. id: prescription.project[b].id,
  2017. project_id: prescription.project[b].project.id,
  2018. // project_name: prescription.project[b].project.project_name,
  2019. // statistical_classification: prescription.project[b].project.statistical_classification,
  2020. single_dose: prescription.project[b].single_dose,
  2021. delivery_way: prescription.project[b].delivery_way,
  2022. execution_frequency: prescription.project[b].execution_frequency,
  2023. number_days: prescription.project[b].day,
  2024. total: prescription.project[b].count.toString(),
  2025. price: prescription.project[b].price,
  2026. remark: prescription.project[b].remark,
  2027. // medical_code: prescription.project[b].project.medical_code,
  2028. unit: prescription.project[b].unit,
  2029. type: prescription.project[b].type,
  2030. execution_state: prescription.project[b].execution_state,
  2031. det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt,
  2032. fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
  2033. overlmt_amt: prescription.project[b].order_info.overlmt_amt,
  2034. preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
  2035. inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt
  2036. }
  2037. if (prescription.project[b].type == 2) {
  2038. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  2039. obj['medical_code'] = prescription.project[b].project.medical_code
  2040. obj['project_name'] = prescription.project[b].project.project_name
  2041. obj['spec'] = ''
  2042. obj['name_id'] = 0
  2043. } else if (prescription.project[b].type == 3) {
  2044. obj['statistical_classification'] = ''
  2045. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  2046. obj['project_name'] = prescription.project[b].good_info.good_name
  2047. obj['spec'] = prescription.project[b].good_info.specification_name
  2048. obj['name_id'] = prescription.project[b].good_info.manufacturer
  2049. }
  2050. tempProject.push(obj)
  2051. }
  2052. const index = i + 1
  2053. prescription.order.order_status = prescription.order.order_status.toString()
  2054. prescription.order.order_status = parseInt(prescription.order.order_status)
  2055. const obj = {
  2056. id: prescription.id,
  2057. name: this.getPName(prescription.med_type, index),
  2058. advices: tempAdvice,
  2059. project: tempProject,
  2060. addition: tempAddition,
  2061. order_status: prescription.order_status,
  2062. type: prescription.type,
  2063. med_type: prescription.med_type,
  2064. order: prescription.order
  2065. }
  2066. // inner_prescription.push(obj)
  2067. big_prescriptions[c].prescriptions.push(obj)
  2068. this.prescriptions.push(obj)
  2069. }
  2070. }
  2071. }
  2072. this.big_prescriptions_two = JSON.parse(JSON.stringify(big_prescriptions))
  2073. // for (let i = 0; i < this.big_prescriptions_two.length; i++) {
  2074. // if (this.big_prescriptions_two[i].med_type == '11') {
  2075. // this.big_prescriptions_two[i]['is_true'] = 1
  2076. // }
  2077. // }
  2078. // for (let i = 0; i < this.big_prescriptions_two.length; i++) {
  2079. // if (this.big_prescriptions_two[i].is_true == 1) {
  2080. // for (let b = 0; b < this.big_prescriptions_two[i].prescriptions.length; b++) {
  2081. // const obj = {
  2082. // med_type: '11',
  2083. // prescriptions: []
  2084. // }
  2085. // const arr = []
  2086. // arr.push(this.big_prescriptions_two[i].prescriptions[b])
  2087. // obj.prescriptions = arr
  2088. // this.big_prescriptions_two.push(obj)
  2089. // }
  2090. // }
  2091. // }
  2092. // for (let i = 0; i < this.big_prescriptions_two.length; i++) {
  2093. // if (this.big_prescriptions_two[i].is_true == 1) {
  2094. // this.big_prescriptions_two.splice(i, 1)
  2095. // }
  2096. // }
  2097. // console.log(this.big_prescriptions)
  2098. for (let i = 0; i < this.big_prescriptions_two.length; i++) {
  2099. if (this.big_prescriptions_two[i].prescriptions.length > 0) {
  2100. this.big_prescriptions_two[i]['curPrescriptions'] = JSON.parse(JSON.stringify(this.big_prescriptions_two[i].prescriptions[0]))
  2101. } else {
  2102. this.big_prescriptions_two[i]['curPrescriptions'] = {}
  2103. }
  2104. this.big_prescriptions_two[i]['total'] = this.getTotalThree(this.big_prescriptions_two[i])
  2105. }
  2106. if (this.big_prescriptions_two.length > 0) {
  2107. this.editableTabsValue = this.getPName(this.big_prescriptions_two[0].med_type, 1)
  2108. }
  2109. },
  2110. searchAction() {
  2111. if (this.search_input.length == 0) {
  2112. this.patientTableData = this.all_patient
  2113. } else {
  2114. let arr = []
  2115. for (let i = 0; i < this.all_patient.length; i++) {
  2116. if (this.all_patient[i].name.indexOf(this.search_input) != -1 || this.all_patient[i].number.indexOf(this.search_input) != -1) {
  2117. arr = arr.concat(this.all_patient[i])
  2118. }
  2119. }
  2120. this.patientTableData = arr
  2121. }
  2122. },
  2123. tabclickEventTwo(val) {
  2124. for (let b = 0; b < this.big_month_prescriptions.length; b++) {
  2125. for (let i = 0; i < this.big_month_prescriptions[b].month_prescriptions.length; i++) {
  2126. if (this.big_month_prescriptions[b].month_prescriptions[i].name == val.name) {
  2127. this.big_month_prescriptions[b].curMonthPrescriptions = {}
  2128. var temp = this.deepClone(this.big_month_prescriptions[b].month_prescriptions[i])
  2129. this.big_month_prescriptions[b].curMonthPrescriptions = temp
  2130. this.big_month_prescriptions[b].month_total = this.getMonthTotalTwo(temp)
  2131. }
  2132. }
  2133. }
  2134. // this.prescription_id = this.month_prescriptions.id
  2135. // this.month_total = 0
  2136. },
  2137. tabclickEventThree(val) {
  2138. for (let i = 0; i < this.big_prescriptions_two.length; i++) {
  2139. for (let b = 0; b < this.big_prescriptions_two[i].prescriptions.length; b++) {
  2140. if (this.big_prescriptions_two[i].prescriptions[b].name == val.name) {
  2141. var temp = this.deepClone(this.big_prescriptions_two[i].prescriptions[b])
  2142. this.big_prescriptions_two[i].curPrescriptions = temp
  2143. this.big_prescriptions_two[i].total = 0
  2144. this.big_prescriptions_two[i].total = this.getTotalThree(this.big_prescriptions_two[i])
  2145. }
  2146. }
  2147. }
  2148. },
  2149. tabclickEvent(val) {
  2150. for (let i = 0; i < this.big_prescriptions.length; i++) {
  2151. for (let b = 0; b < this.big_prescriptions[i].prescriptions.length; b++) {
  2152. if (this.big_prescriptions[i].prescriptions[b].name == val.name) {
  2153. var temp = this.deepClone(this.big_prescriptions[i].prescriptions[b])
  2154. this.big_prescriptions[i].curPrescriptions = temp
  2155. // this.prescription_id = this.curPrescriptions.id
  2156. this.big_prescriptions[i].total = 0
  2157. this.big_prescriptions[i].total = this.getTotalThree(this.big_prescriptions[i])
  2158. }
  2159. }
  2160. }
  2161. },
  2162. deepClone(source) {
  2163. if (!source && typeof source !== 'object') {
  2164. throw new Error('error arguments', 'shallowClone')
  2165. }
  2166. const targetObj = source.constructor === Array ? [] : {}
  2167. Object.keys(source).forEach((keys) => {
  2168. if (source[keys] && typeof source[keys] === 'object') {
  2169. targetObj[keys] = this.deepClone(source[keys])
  2170. } else {
  2171. targetObj[keys] = source[keys]
  2172. }
  2173. })
  2174. return targetObj
  2175. },
  2176. getTotalOne(big_prescriptions) {
  2177. var total = 0
  2178. if (this.curPrescriptions.type == 1) {
  2179. if (this.curPrescriptions.advices != null) {
  2180. for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
  2181. total = parseFloat(total) + parseFloat(this.curPrescriptions.advices[a].retail_price * this.curPrescriptions.advices[a].prescribing_number)
  2182. }
  2183. }
  2184. } else {
  2185. if (this.curPrescriptions.project != null) {
  2186. for (let b = 0; b < this.curPrescriptions.project.length; b++) {
  2187. total = parseFloat(total) + parseFloat(this.curPrescriptions.project[b].price * this.curPrescriptions.project[b].total)
  2188. }
  2189. }
  2190. }
  2191. if (this.curPrescriptions.addition != null) {
  2192. for (let b = 0; b < this.curPrescriptions.addition.length; b++) {
  2193. total = parseFloat(total) + parseFloat(this.curPrescriptions.addition[b].price * this.curPrescriptions.addition[b].count)
  2194. }
  2195. }
  2196. return total.toFixed(2)
  2197. },
  2198. getTotalThree(big_prescriptions) {
  2199. var total = 0
  2200. if (big_prescriptions.curPrescriptions.type == 1) {
  2201. if (big_prescriptions.curPrescriptions.advices != null) {
  2202. for (let a = 0; a < big_prescriptions.curPrescriptions.advices.length; a++) {
  2203. total = parseFloat(total) + parseFloat(big_prescriptions.curPrescriptions.advices[a].retail_price * big_prescriptions.curPrescriptions.advices[a].prescribing_number)
  2204. }
  2205. }
  2206. } else {
  2207. if (big_prescriptions.curPrescriptions.project != null) {
  2208. for (let b = 0; b < big_prescriptions.curPrescriptions.project.length; b++) {
  2209. total = parseFloat(total) + parseFloat(big_prescriptions.curPrescriptions.project[b].price * big_prescriptions.curPrescriptions.project[b].total)
  2210. }
  2211. }
  2212. }
  2213. if (big_prescriptions.curPrescriptions.addition != null) {
  2214. for (let b = 0; b < big_prescriptions.curPrescriptions.addition.length; b++) {
  2215. total = parseFloat(total) + parseFloat(big_prescriptions.curPrescriptions.addition[b].price * big_prescriptions.curPrescriptions.addition[b].count)
  2216. }
  2217. }
  2218. return total.toFixed(2)
  2219. },
  2220. getMonthTotalOne() {
  2221. var total = 0
  2222. if (this.curMonthPrescriptions.type == 1) {
  2223. if (this.curMonthPrescriptions.advices != null) {
  2224. for (let a = 0; a < this.curMonthPrescriptions.advices.length; a++) {
  2225. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.advices[a].retail_price * this.curMonthPrescriptions.advices[a].prescribing_number)
  2226. }
  2227. }
  2228. } else {
  2229. if (this.curMonthPrescriptions.project != null) {
  2230. for (let b = 0; b < this.curMonthPrescriptions.project.length; b++) {
  2231. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.project[b].price * this.curMonthPrescriptions.project[b].total)
  2232. }
  2233. }
  2234. }
  2235. if (this.curMonthPrescriptions.addition != null) {
  2236. for (let b = 0; b < this.curMonthPrescriptions.addition.length; b++) {
  2237. total = parseFloat(total) + parseFloat(this.curMonthPrescriptions.addition[b].price * this.curMonthPrescriptions.addition[b].count)
  2238. }
  2239. }
  2240. return total.toFixed(2)
  2241. },
  2242. getMonthTotalTwo(month_prescriptions) {
  2243. var total = 0
  2244. if (month_prescriptions.type == 1) {
  2245. if (month_prescriptions.advices != null) {
  2246. for (let a = 0; a < month_prescriptions.advices.length; a++) {
  2247. total = parseFloat(total) + parseFloat(month_prescriptions.advices[a].retail_price * month_prescriptions.advices[a].prescribing_number)
  2248. }
  2249. }
  2250. } else {
  2251. if (month_prescriptions.project != null) {
  2252. for (let b = 0; b < month_prescriptions.project.length; b++) {
  2253. total = parseFloat(total) + parseFloat(month_prescriptions.project[b].price * month_prescriptions.project[b].total)
  2254. }
  2255. }
  2256. }
  2257. if (month_prescriptions.addition != null) {
  2258. for (let b = 0; b < month_prescriptions.addition.length; b++) {
  2259. total = parseFloat(total) + parseFloat(month_prescriptions.addition[b].price * month_prescriptions.addition[b].count)
  2260. }
  2261. }
  2262. return total.toFixed(2)
  2263. },
  2264. getTotal() {
  2265. var total = 0
  2266. for (let c = 0; c < this.big_prescriptions.length; c++) {
  2267. for (let i = 0; i < this.big_prescriptions[c].prescriptions.length; i++) {
  2268. if (this.big_prescriptions[c].prescriptions[i].advices != null) {
  2269. for (let a = 0; a < this.big_prescriptions[c].prescriptions[i].advices.length; a++) {
  2270. total = parseFloat(total) + parseFloat(this.big_prescriptions[c].prescriptions[i].advices[a].retail_price * this.big_prescriptions[c].prescriptions[i].advices[a].prescribing_number)
  2271. }
  2272. }
  2273. if (this.big_prescriptions[c].prescriptions[i].project != null) {
  2274. for (let b = 0; b < this.big_prescriptions[c].prescriptions[i].project.length; b++) {
  2275. total = parseFloat(total) + parseFloat(this.big_prescriptions[c].prescriptions[i].project[b].price * this.big_prescriptions[c].prescriptions[i].project[b].total)
  2276. }
  2277. }
  2278. if (this.big_prescriptions[c].prescriptions[i].addition != null) {
  2279. for (let b = 0; b < this.big_prescriptions[c].prescriptions[i].addition.length; b++) {
  2280. total = parseFloat(total) + parseFloat(this.big_prescriptions[c].prescriptions[i].addition[b].price * this.big_prescriptions[c].prescriptions[i].addition[b].count)
  2281. }
  2282. }
  2283. }
  2284. }
  2285. return total.toFixed(2)
  2286. },
  2287. getTotalTwo() {
  2288. var total = 0
  2289. for (let i = 0; i < this.month_prescriptions.length; i++) {
  2290. if (this.month_prescriptions[i].advices != null) {
  2291. for (let a = 0; a < this.month_prescriptions[i].advices.length; a++) {
  2292. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].advices[a].retail_price * this.month_prescriptions[i].advices[a].prescribing_number)
  2293. }
  2294. }
  2295. if (this.month_prescriptions[i].project != null) {
  2296. for (let a = 0; a < this.month_prescriptions[i].project.length; a++) {
  2297. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].project[a].price * this.month_prescriptions[i].project[a].total)
  2298. }
  2299. }
  2300. if (this.month_prescriptions[i].addition != null) {
  2301. for (let b = 0; b < this.month_prescriptions[i].addition.length; b++) {
  2302. total = parseFloat(total) + parseFloat(this.month_prescriptions[i].addition[a].price * this.month_prescriptions[i].addition[b].count)
  2303. }
  2304. }
  2305. }
  2306. return total.toFixed(2)
  2307. },
  2308. getTotalFour(month_prescriptions) {
  2309. var total = 0
  2310. for (let i = 0; i < month_prescriptions.length; i++) {
  2311. if (month_prescriptions[i].advices != null) {
  2312. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  2313. total = parseFloat(total) + parseFloat(month_prescriptions[i].advices[a].retail_price * month_prescriptions[i].advices[a].prescribing_number)
  2314. }
  2315. }
  2316. if (month_prescriptions[i].project != null) {
  2317. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  2318. total = parseFloat(total) + parseFloat(month_prescriptions[i].project[a].price * month_prescriptions[i].project[a].total)
  2319. }
  2320. }
  2321. // if (month_prescriptions[i].addition != null) {
  2322. // for (let b = 0; b < month_prescriptions[i].addition.length; b++) {
  2323. // total = parseFloat(total) + parseFloat(month_prescriptions[i].addition[a].price * month_prescriptions[i].addition[b].count)
  2324. // }
  2325. // }
  2326. }
  2327. return total.toFixed(2)
  2328. },
  2329. moreState(tab, event) {
  2330. if (tab == 'more') {
  2331. return false
  2332. }
  2333. },
  2334. open(index, med_type, order, prescriptions) {
  2335. this.other_prescriptions = prescriptions
  2336. if (index == 1) {
  2337. } else if (index == 2) {
  2338. this.$router.push('/outpatientDoctorStation/printtwo?record=' + this.record_date)
  2339. } else if (index == 3) {
  2340. let obj = {
  2341. record_date: this.record_date,
  2342. patient_id: this.patient_id,
  2343. prescription_id: this.prescription_id,
  2344. order_id: this.order.id
  2345. }
  2346. this.paramsObj = obj
  2347. this.treatVisible = true
  2348. // this.$router.push('/outpatientCharges/treatPrint?record_date=' + this.record_date + '&patient_id=' + this.patient_id + '&prescription_id=' + this.prescription_id)
  2349. } else if (index == 4) {
  2350. var ids = []
  2351. for (let i = 0; i < prescriptions.length; i++) {
  2352. ids.push(prescriptions[i].id)
  2353. }
  2354. var ids_str = ids.join(',')
  2355. this.temp_ids = ids_str
  2356. this.currentOrder = order
  2357. this.current_med_type = med_type
  2358. if (this.patientInfo.id == 0) {
  2359. this.$message({ message: '该选择要收费的患者', type: 'error' })
  2360. return
  2361. }
  2362. if (this.hisPatientInfo.id == 0) {
  2363. this.$message({ message: '该患者尚未挂号,请先挂号', type: 'error' })
  2364. return
  2365. }
  2366. if (this.hisPatientInfo.id_card_type == 1) {
  2367. if (this.hisPatientInfo.balance_accounts_type != 2 && this.$store.getters.xt_user.org_id != 10088 && this.$store.getters.xt_user.org_id != 10106 && this.$store.getters.xt_user.org_id != 10188 && this.$store.getters.xt_user.org_id != 10217) {
  2368. this.pwdFormVisible = true
  2369. this.pwd = ''
  2370. } else {
  2371. if (this.activeName == 'first') {
  2372. this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  2373. } else {
  2374. this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  2375. }
  2376. }
  2377. } else {
  2378. if (this.activeName == 'first') {
  2379. this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  2380. } else {
  2381. this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  2382. }
  2383. }
  2384. } else if (index == 5) {
  2385. var that = this
  2386. if (that.hisPatientInfo.balance_accounts_type == 2) {
  2387. let params = {
  2388. 'order_id': that.order.id,
  2389. 'number': that.order.number,
  2390. 'patient_id': that.patientInfo.id,
  2391. 'record_time': that.record_date
  2392. }
  2393. Refund(params).then(response => {
  2394. if (response.data.state == 0) {
  2395. this.$message.error(response.data.msg)
  2396. this.loadingtwo = false
  2397. return false
  2398. } else {
  2399. this.radio = 1
  2400. this.changeRadioAndPatient(1)
  2401. this.$message({ message: '退费成功', type: 'success' })
  2402. this.loadingtwo = false
  2403. }
  2404. })
  2405. } else {
  2406. var that = this
  2407. this.$confirm('是否退费', '退费', {
  2408. confirmButtonText: '确 定',
  2409. cancelButtonText: '取 消',
  2410. type: 'warning'
  2411. }).then(() => {
  2412. let params = {
  2413. 'order_id': this.order.id,
  2414. 'number': this.order.number,
  2415. 'patient_id': this.patientInfo.id,
  2416. 'record_time': this.record_date,
  2417. 'admin_user_id': this.$store.getters.xt_user.user.id,
  2418. 'org_id': this.$store.getters.xt_user.org_id
  2419. }
  2420. axios.get('http://127.0.0.1:9532/api/refund/post', {
  2421. params: params
  2422. })
  2423. .then(function(response) {
  2424. if (response.data.state == 0) {
  2425. that.$message.error(response.data.msg)
  2426. that.loadingtwo = false
  2427. return false
  2428. } else {
  2429. if (response.data.data.failed_code == -10) {
  2430. that.$confirm(response.data.data.msg, '医保错误信息', {
  2431. confirmButtonText: '确 定',
  2432. type: 'warning'
  2433. }).then(() => {
  2434. }).catch(() => {
  2435. })
  2436. } else {
  2437. that.radio = 1
  2438. that.changeRadioAndPatient(1)
  2439. that.$message({ message: '退费成功', type: 'success', duration: 5000 })
  2440. that.loadingtwo = false
  2441. }
  2442. }
  2443. })
  2444. .catch(function(error) {
  2445. })
  2446. }).catch(() => {
  2447. })
  2448. }
  2449. } else if (index == 6) {
  2450. if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10138 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10088) {
  2451. this.$refs.register9504.show()
  2452. } else {
  2453. this.$refs.register.show(this.doctors, this.department)
  2454. }
  2455. } else if (index == 8) {
  2456. var that = this
  2457. if (this.form.diagnosis.length == 0) {
  2458. that.$message.error('诊断不能为空,请选择诊断内容')
  2459. return
  2460. }
  2461. if (this.form.sick_type.length || this.form.sick_type == 0) {
  2462. that.$message.error('疾病类型不能为空,请选择疾病类型')
  2463. return
  2464. }
  2465. var ids = []
  2466. for (let i = 0; i < prescriptions.length; i++) {
  2467. ids.push(prescriptions[i].id)
  2468. }
  2469. var ids_str = ids.join(',')
  2470. this.temp_ids = ids_str
  2471. this.newLoading = true
  2472. var that = this
  2473. let form = {}
  2474. form['id'] = this.patientInfo.id
  2475. form['his_patient_id'] = this.hisPatientInfo.id
  2476. form['record_time'] = this.record_date
  2477. form['ids'] = this.temp_ids
  2478. form['begin_time'] = this.form.diagnosis_time
  2479. form['p_type'] = med_type
  2480. form['diagnosis'] = this.form.diagnosis.join(',')
  2481. form['sick_type'] = this.form.sick_type
  2482. form['admin_user_id'] = this.$store.getters.xt_user.user.id
  2483. form['org_id'] = this.$store.getters.xt_user.org_id
  2484. if (this.activeName == 'first') {
  2485. form['settle_accounts_type'] = 1
  2486. } else if (this.activeName == 'second') {
  2487. form['start_time'] = this.other_start_time
  2488. form['end_time'] = this.other_end_time
  2489. form['settle_accounts_type'] = 2
  2490. } else {
  2491. form['start_time'] = this.other_start_time_two
  2492. form['end_time'] = this.other_end_time_two
  2493. form['settle_accounts_type'] = 2
  2494. }
  2495. if (this.hisPatientInfo.balance_accounts_type == 2) {
  2496. this.$confirm('是否进行预结算', '预结算', {
  2497. confirmButtonText: '确 定',
  2498. cancelButtonText: '取 消',
  2499. type: 'warning'
  2500. }).then(() => {
  2501. preSettle(form).then(response => {
  2502. if (response.data.state == 0) {
  2503. this.$message.error(response.data.msg)
  2504. this.loadingtwo = false
  2505. this.newLoading = false
  2506. return false
  2507. } else {
  2508. this.changeRadioAndPatient(1)
  2509. this.$message({ message: '预结算成功', type: 'success' })
  2510. this.newLoading = false
  2511. }
  2512. })
  2513. }).catch(() => {
  2514. this.newLoading = false
  2515. })
  2516. } else {
  2517. this.$confirm('是否进行预结算', '预结算', {
  2518. confirmButtonText: '确 定',
  2519. cancelButtonText: '取 消',
  2520. type: 'warning'
  2521. }).then(() => {
  2522. axios.get('http://127.0.0.1:9532/api/presettle/get', {
  2523. params: form,
  2524. headers: {
  2525. 'Permission': 5
  2526. }
  2527. })
  2528. .then(function(response) {
  2529. if (response.data.state == 0) {
  2530. that.$message.error(response.data.msg)
  2531. return false
  2532. } else {
  2533. if (response.data.data.failed_code == -10) {
  2534. that.$confirm(response.data.data.msg, '医保错误信息', {
  2535. confirmButtonText: '确 定',
  2536. type: 'warning'
  2537. }).then(() => {
  2538. that.changeRadioAndPatient(1)
  2539. that.newLoading = false
  2540. }).catch(() => {
  2541. that.changeRadioAndPatient(1)
  2542. that.newLoading = false
  2543. })
  2544. } else {
  2545. that.changeRadioAndPatient(1)
  2546. that.$message({ message: '预结算成功', type: 'success', duration: 5000 })
  2547. that.newLoading = false
  2548. }
  2549. }
  2550. })
  2551. .catch(function(error) {
  2552. that.newLoading = false
  2553. })
  2554. }).catch(() => {
  2555. that.newLoading = false
  2556. })
  2557. }
  2558. } else if (index == 9) {
  2559. this.statementVisible = true
  2560. let obj = {
  2561. order_id: this.order.id,
  2562. settle_type: this.order.settle_type,
  2563. start_time: this.order.settle_start_time,
  2564. end_time: this.order.settle_end_time,
  2565. balance_accounts_type: this.hisPatientInfo.balance_accounts_type
  2566. }
  2567. this.orderObj = obj
  2568. // this.$refs.print.getInfo(this.order.id)
  2569. } else if (index == 10) {
  2570. if (this.hisPatientInfo.balance_accounts_type == 2) {
  2571. this.$confirm('是否退号', '退号', {
  2572. confirmButtonText: '确 定',
  2573. cancelButtonText: '取 消',
  2574. type: 'warning'
  2575. }).then(() => {
  2576. const params = {
  2577. 'id': this.hisPatientInfo.id
  2578. }
  2579. refundNumber(params).then(response => {
  2580. if (response.data.state == 0) {
  2581. this.$message.error(response.data.msg)
  2582. return false
  2583. } else {
  2584. this.radio = 1
  2585. this.changeRadioAndPatient(1)
  2586. this.$message({ message: '退号成功', type: 'success' })
  2587. }
  2588. })
  2589. }).catch(() => {
  2590. })
  2591. } else {
  2592. if(this.order.id > 0){
  2593. this.$message.error("该就诊号尚未撤销明细或者退费无法进行退号操作")
  2594. return
  2595. }
  2596. var that = this
  2597. this.$confirm('是否退号', '退号', {
  2598. confirmButtonText: '确 定',
  2599. cancelButtonText: '取 消',
  2600. type: 'warning'
  2601. }).then(() => {
  2602. let params = {
  2603. 'id': this.hisPatientInfo.id,
  2604. 'patient_id': this.patientInfo.id,
  2605. 'record_time': this.record_date,
  2606. 'org_id': this.$store.getters.xt_user.org_id,
  2607. 'admin_user_id': this.$store.getters.xt_user.user.id
  2608. }
  2609. axios.get('http://127.0.0.1:9532/api/refundnumber/post', {
  2610. params: params
  2611. })
  2612. .then(function(response) {
  2613. if (response.data.state == 0) {
  2614. that.$message.error(response.data.msg)
  2615. return false
  2616. } else {
  2617. if (response.data.data.failed_code == -10) {
  2618. // that.$message.error(response.data.data.msg)
  2619. that.$confirm(response.data.data.msg, '医保错误信息', {
  2620. confirmButtonText: '确 定',
  2621. type: 'warning'
  2622. }).then(() => {
  2623. }).catch(() => {
  2624. })
  2625. } else {
  2626. that.radio = 1
  2627. that.changeRadioAndPatient(1)
  2628. that.$message({ message: '退号成功', type: 'success', duration: 5000 })
  2629. }
  2630. }
  2631. })
  2632. .catch(function(error) {
  2633. })
  2634. }).catch(() => {
  2635. })
  2636. }
  2637. } else if (index == 11) {
  2638. var that = this
  2639. let params = {
  2640. 'order_id': order.id,
  2641. 'number': order.number,
  2642. 'patient_id': this.patientInfo.id,
  2643. 'record_time': this.record_date,
  2644. 'org_id': this.$store.getters.xt_user.org_id,
  2645. 'his_patient_id': this.hisPatientInfo.id
  2646. }
  2647. axios.get('http://127.0.0.1:9532/api/refunddetail/post', {
  2648. params: params
  2649. })
  2650. .then(function(response) {
  2651. if (response.data.state == 0) {
  2652. that.$message.error(response.data.msg)
  2653. return false
  2654. } else {
  2655. that.changeRadioAndPatient(1)
  2656. // that.$message({ message: '退号成功', type: 'success' })
  2657. that.$message({ message: '退明细成功', type: 'success', duration: 5000 })
  2658. }
  2659. })
  2660. .catch(function(error) {
  2661. })
  2662. } else if (index == 20) {
  2663. var that = this
  2664. let params = {
  2665. 'patient_id': this.patientInfo.id,
  2666. 'admin_user_id': this.$store.getters.xt_user.user.id
  2667. }
  2668. axios.get('http://127.0.0.1:9532/api/psn/info', {
  2669. params: params
  2670. })
  2671. .then(function(response) {
  2672. if (response.data.state == 0) {
  2673. that.$message.error(response.data.msg)
  2674. return false
  2675. } else {
  2676. that.$confirm(response.data.data.result, '备案信息', {
  2677. confirmButtonText: '确 定',
  2678. type: 'warning'
  2679. }).then(() => {
  2680. }).catch(() => {
  2681. })
  2682. }
  2683. })
  2684. .catch(function(error) {
  2685. })
  2686. } else if(index == 30){
  2687. let paramsObj = {
  2688. order_id: this.order.id,
  2689. patient_id: this.order.patient_id,
  2690. number: this.order.mdtrt_id,
  2691. name: this.patientInfo.name,
  2692. age: this.order.age,
  2693. gend: this.order.gend,
  2694. setl_time: this.order.setl_time,
  2695. chargeName: this.getName(this.order.creator)
  2696. }
  2697. this.invoiceParams = paramsObj
  2698. this.invoiceVisible = true
  2699. }
  2700. }, getName(admin_user_id) {
  2701. for (let i = 0; i < this.adminUserOptions.length; i++) {
  2702. if (this.adminUserOptions[i].id == admin_user_id) {
  2703. return this.adminUserOptions[i].name
  2704. }
  2705. }
  2706. },
  2707. choosePatient() {
  2708. this.radioStatus = id
  2709. this.getPatientList()
  2710. },
  2711. changeRadioAndPatient(id) {
  2712. let params = {
  2713. 'record_date': this.record_date
  2714. }
  2715. getChargeHisPatientList(params).then(response => {
  2716. if (response.data.state == 0) {
  2717. this.$message.error(response.data.msg)
  2718. return false
  2719. } else {
  2720. this.patientTableData = []
  2721. this.all_table_data = []
  2722. this.hisPatientDatas = []
  2723. let one_count = 0
  2724. let two_count = 0
  2725. let three_count = 0
  2726. for (let i = 0; i < response.data.data.list.length; i++) {
  2727. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  2728. if (response.data.data.list[i].prescription.length > 0) {
  2729. let obj = {
  2730. id: response.data.data.list[i].id,
  2731. name: response.data.data.list[i].name,
  2732. number: '',
  2733. order_status: 0,
  2734. order_number: '',
  2735. his_patient_id: 0,
  2736. prescription: response.data.data.list[i].prescription
  2737. }
  2738. this.all_table_data.push(obj)
  2739. }
  2740. } else { //挂号
  2741. if (response.data.data.list[i].his_patient.length == 1) {
  2742. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  2743. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  2744. let obj = {
  2745. id: response.data.data.list[i].id,
  2746. name: response.data.data.list[i].name,
  2747. number: response.data.data.list[i].his_patient[0].number,
  2748. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  2749. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2750. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  2751. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  2752. prescription: response.data.data.list[i].prescription
  2753. }
  2754. this.all_table_data.push(obj)
  2755. }
  2756. } else {
  2757. let obj = {
  2758. id: response.data.data.list[i].id,
  2759. name: response.data.data.list[i].name,
  2760. number: response.data.data.list[i].his_patient[0].number,
  2761. order_status: 0,
  2762. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2763. order_number: '',
  2764. order_id: 0,
  2765. prescription: response.data.data.list[i].prescription
  2766. }
  2767. this.all_table_data.push(obj)
  2768. }
  2769. }
  2770. if (response.data.data.list[i].his_patient.length > 1) {
  2771. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  2772. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  2773. let obj = {
  2774. id: response.data.data.list[i].id,
  2775. name: response.data.data.list[i].name,
  2776. number: response.data.data.list[i].his_patient[b].number,
  2777. order_status: 0,
  2778. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2779. order_number: '',
  2780. order_id: 0,
  2781. prescription: response.data.data.list[i].prescription
  2782. }
  2783. this.all_table_data.push(obj)
  2784. } else {
  2785. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  2786. let obj = {
  2787. id: response.data.data.list[i].id,
  2788. name: response.data.data.list[i].name,
  2789. number: response.data.data.list[i].his_patient[b].number,
  2790. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  2791. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2792. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  2793. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  2794. prescription: response.data.data.list[i].prescription
  2795. }
  2796. this.all_table_data.push(obj)
  2797. }
  2798. }
  2799. }
  2800. }
  2801. }
  2802. }
  2803. for (let i = 0; i < this.all_table_data.length; i++) {
  2804. if (this.all_table_data[i].his_patient_id > 0) {
  2805. this.hisPatientDatas.push(this.all_table_data[i])
  2806. }
  2807. }
  2808. let unChargePatient = []
  2809. for (let i = 0; i < this.all_table_data.length; i++) {
  2810. let isHasUnCharge = false
  2811. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  2812. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  2813. isHasUnCharge = true
  2814. } else {
  2815. if (this.all_table_data[i].his_patient_id > 0) {
  2816. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  2817. isHasUnCharge = true
  2818. }
  2819. }
  2820. }
  2821. }
  2822. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  2823. isHasUnCharge = true
  2824. }
  2825. if (isHasUnCharge) {
  2826. unChargePatient.push(this.all_table_data[i])
  2827. }
  2828. }
  2829. unChargePatient = this.unique_four(unChargePatient)
  2830. one_count = one_count + unChargePatient.length
  2831. let ChargePatient = []
  2832. for (let i = 0; i < this.all_table_data.length; i++) {
  2833. if (this.all_table_data[i].order_status == 2) {
  2834. ChargePatient.push(this.all_table_data[i])
  2835. }
  2836. }
  2837. two_count = two_count + ChargePatient.length
  2838. if (this.radio == 1) {
  2839. this.all_table_data = this.unique_four(this.all_table_data)
  2840. }
  2841. console.log(this.all_table_data)
  2842. switch (this.radio) {
  2843. case 1:
  2844. this.patientTableData = []
  2845. for (let i = 0; i < this.all_table_data.length; i++) {
  2846. let isHasUnCharge = false
  2847. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  2848. console.log('!111111111')
  2849. console.log(this.all_table_data[i].order_status)
  2850. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  2851. console.log('!22222222222')
  2852. isHasUnCharge = true
  2853. } else {
  2854. if (this.all_table_data[i].his_patient_id > 0) {
  2855. console.log('!4444444444444')
  2856. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  2857. isHasUnCharge = true
  2858. console.log('!33333333333')
  2859. }
  2860. }
  2861. }
  2862. }
  2863. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  2864. console.log('11111111')
  2865. isHasUnCharge = true
  2866. }
  2867. if (isHasUnCharge) {
  2868. this.patientTableData.push(this.all_table_data[i])
  2869. }
  2870. }
  2871. this.all_patient = this.patientTableData
  2872. break
  2873. case 2:
  2874. this.patientTableData = []
  2875. for (let i = 0; i < this.all_table_data.length; i++) {
  2876. if (this.all_table_data[i].order_status == 2) {
  2877. this.patientTableData.push(this.all_table_data[i])
  2878. }
  2879. }
  2880. this.all_patient = this.patientTableData
  2881. break
  2882. case 4:
  2883. this.patientTableData = []
  2884. this.patientTableData = this.all_table_data
  2885. this.all_patient = this.patientTableData
  2886. break
  2887. }
  2888. this.cal_one = one_count
  2889. this.cal_two = two_count
  2890. this.cal_three = one_count + two_count
  2891. this.current_index = 0
  2892. let ids = []
  2893. let temp_order_id = 0
  2894. var index = 0
  2895. if (this.radio == 2) {
  2896. for (let i = 0; i < this.patientTableData.length; i++) {
  2897. if (this.hisPatientInfo.id == this.patientTableData[i].his_patient_id) {
  2898. ids.push(this.patientTableData[i].order_id)
  2899. }
  2900. }
  2901. temp_order_id = ids[ids.length - 1]
  2902. for (let i = 0; i < this.patientTableData.length; i++) {
  2903. if (temp_order_id == this.patientTableData[i].order_id) {
  2904. index = i
  2905. // this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order_number, this.patientTableData[i].his_patient_id, this.patientTableData[i].order_id)
  2906. }
  2907. }
  2908. this.$refs.tab.setCurrentRow(this.patientTableData[index])
  2909. } else {
  2910. var index = 0
  2911. for (let i = 0; i < this.patientTableData.length; i++) {
  2912. if (this.hisPatientInfo.id == 0) {
  2913. if (this.patientInfo.id == this.patientTableData[i].id) {
  2914. index = i
  2915. }
  2916. } else {
  2917. if (this.hisPatientInfo.id == this.patientTableData[i].his_patient_id) {
  2918. index = i
  2919. }
  2920. }
  2921. }
  2922. this.$refs.tab.setCurrentRow(this.patientTableData[index])
  2923. }
  2924. }
  2925. })
  2926. },
  2927. changeRadio(id) {
  2928. let temp_id = id
  2929. this.radio = id
  2930. let params = {
  2931. 'record_date': this.record_date
  2932. }
  2933. getChargeHisPatientList(params).then(response => {
  2934. if (response.data.state == 0) {
  2935. this.$message.error(response.data.msg)
  2936. return false
  2937. } else {
  2938. this.patientTableData = []
  2939. this.all_table_data = []
  2940. this.hisPatientDatas = []
  2941. let one_count = 0
  2942. let two_count = 0
  2943. let three_count = 0
  2944. for (let i = 0; i < response.data.data.list.length; i++) {
  2945. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  2946. if (response.data.data.list[i].prescription.length > 0) {
  2947. let obj = {
  2948. id: response.data.data.list[i].id,
  2949. name: response.data.data.list[i].name,
  2950. number: '',
  2951. order_status: 0,
  2952. order_number: '',
  2953. his_patient_id: 0,
  2954. prescription: response.data.data.list[i].prescription
  2955. }
  2956. this.all_table_data.push(obj)
  2957. }
  2958. } else { //挂号
  2959. if (response.data.data.list[i].his_patient.length == 1) {
  2960. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  2961. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  2962. let obj = {
  2963. id: response.data.data.list[i].id,
  2964. name: response.data.data.list[i].name,
  2965. number: response.data.data.list[i].his_patient[0].number,
  2966. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  2967. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2968. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  2969. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  2970. prescription: response.data.data.list[i].prescription
  2971. }
  2972. this.all_table_data.push(obj)
  2973. }
  2974. } else {
  2975. let obj = {
  2976. id: response.data.data.list[i].id,
  2977. name: response.data.data.list[i].name,
  2978. number: response.data.data.list[i].his_patient[0].number,
  2979. order_status: 0,
  2980. his_patient_id: response.data.data.list[i].his_patient[0].id,
  2981. order_number: '',
  2982. order_id: 0,
  2983. prescription: response.data.data.list[i].prescription
  2984. }
  2985. this.all_table_data.push(obj)
  2986. }
  2987. }
  2988. if (response.data.data.list[i].his_patient.length > 1) {
  2989. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  2990. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  2991. let obj = {
  2992. id: response.data.data.list[i].id,
  2993. name: response.data.data.list[i].name,
  2994. number: response.data.data.list[i].his_patient[b].number,
  2995. order_status: 0,
  2996. his_patient_id: response.data.data.list[i].his_patient[b].id,
  2997. order_number: '',
  2998. order_id: 0,
  2999. prescription: response.data.data.list[i].prescription
  3000. }
  3001. this.all_table_data.push(obj)
  3002. } else {
  3003. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  3004. let obj = {
  3005. id: response.data.data.list[i].id,
  3006. name: response.data.data.list[i].name,
  3007. number: response.data.data.list[i].his_patient[b].number,
  3008. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  3009. his_patient_id: response.data.data.list[i].his_patient[b].id,
  3010. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  3011. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  3012. prescription: response.data.data.list[i].prescription
  3013. }
  3014. this.all_table_data.push(obj)
  3015. }
  3016. }
  3017. }
  3018. }
  3019. }
  3020. }
  3021. for (let i = 0; i < this.all_table_data.length; i++) {
  3022. if (this.all_table_data[i].his_patient_id > 0) {
  3023. this.hisPatientDatas.push(this.all_table_data[i])
  3024. }
  3025. }
  3026. let unChargePatient = []
  3027. for (let i = 0; i < this.all_table_data.length; i++) {
  3028. let isHasUnCharge = false
  3029. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  3030. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3031. isHasUnCharge = true
  3032. } else {
  3033. if (this.all_table_data[i].his_patient_id > 0) {
  3034. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  3035. isHasUnCharge = true
  3036. }
  3037. }
  3038. }
  3039. }
  3040. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3041. isHasUnCharge = true
  3042. }
  3043. if (isHasUnCharge) {
  3044. unChargePatient.push(this.all_table_data[i])
  3045. }
  3046. }
  3047. unChargePatient = this.unique_four(unChargePatient)
  3048. one_count = one_count + unChargePatient.length
  3049. let ChargePatient = []
  3050. for (let i = 0; i < this.all_table_data.length; i++) {
  3051. if (this.all_table_data[i].order_status == 2) {
  3052. ChargePatient.push(this.all_table_data[i])
  3053. }
  3054. }
  3055. two_count = two_count + ChargePatient.length
  3056. if (this.radio == 1) {
  3057. this.all_table_data = this.unique_four(this.all_table_data)
  3058. }
  3059. console.log(this.all_table_data)
  3060. switch (this.radio) {
  3061. case 1:
  3062. this.patientTableData = []
  3063. for (let i = 0; i < this.all_table_data.length; i++) {
  3064. let isHasUnCharge = false
  3065. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  3066. console.log('!111111111')
  3067. console.log(this.all_table_data[i].order_status)
  3068. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3069. console.log('!22222222222')
  3070. isHasUnCharge = true
  3071. } else {
  3072. if (this.all_table_data[i].his_patient_id > 0) {
  3073. console.log('!4444444444444')
  3074. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  3075. isHasUnCharge = true
  3076. console.log('!33333333333')
  3077. }
  3078. }
  3079. }
  3080. }
  3081. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3082. console.log('11111111')
  3083. isHasUnCharge = true
  3084. }
  3085. if (isHasUnCharge) {
  3086. this.patientTableData.push(this.all_table_data[i])
  3087. }
  3088. }
  3089. this.all_patient = this.patientTableData
  3090. break
  3091. case 2:
  3092. this.patientTableData = []
  3093. for (let i = 0; i < this.all_table_data.length; i++) {
  3094. if (this.all_table_data[i].order_status == 2) {
  3095. this.patientTableData.push(this.all_table_data[i])
  3096. }
  3097. }
  3098. this.all_patient = this.patientTableData
  3099. break
  3100. case 4:
  3101. this.patientTableData = []
  3102. this.patientTableData = this.all_table_data
  3103. this.all_patient = this.patientTableData
  3104. break
  3105. }
  3106. this.cal_one = one_count
  3107. this.cal_two = two_count
  3108. this.cal_three = one_count + two_count
  3109. this.current_index = 0
  3110. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  3111. // this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order_number, this.patientTableData[0].his_patient_id, this.patientTableData[0].order_id)
  3112. }
  3113. })
  3114. },
  3115. formatDecimal(num, decimal) {
  3116. num = num.toString()
  3117. let index = num.indexOf('.')
  3118. if (index !== -1) {
  3119. num = num.substring(0, decimal + index + 1)
  3120. } else {
  3121. num = num.substring(0)
  3122. }
  3123. return parseFloat(num).toFixed(decimal)
  3124. },
  3125. //患者列表
  3126. getPatientList() {
  3127. let params = {
  3128. 'record_date': this.record_date,
  3129. 'type': this.radio,
  3130. }
  3131. getChargeHisPatientList(params).then(response => {
  3132. if (response.data.state == 0) {
  3133. this.$message.error(response.data.msg)
  3134. return false
  3135. } else {
  3136. this.patientTableData = []
  3137. this.all_table_data = []
  3138. this.hisPatientDatas = []
  3139. let one_count = 0
  3140. let two_count = 0
  3141. let three_count = 0
  3142. for (let i = 0; i < response.data.data.list.length; i++) {
  3143. if (response.data.data.list[i].his_patient.length == 0) { //没挂号
  3144. if (response.data.data.list[i].prescription.length > 0) {
  3145. let obj = {
  3146. id: response.data.data.list[i].id,
  3147. name: response.data.data.list[i].name,
  3148. number: '',
  3149. order_status: 0,
  3150. order_number: '',
  3151. his_patient_id: 0,
  3152. prescription: response.data.data.list[i].prescription
  3153. }
  3154. this.all_table_data.push(obj)
  3155. }
  3156. } else { //挂号
  3157. if (response.data.data.list[i].his_patient.length == 1) {
  3158. if (response.data.data.list[i].his_patient[0].orders.length > 0) {
  3159. for (let b = 0; b < response.data.data.list[i].his_patient[0].orders.length; b++) {
  3160. let obj = {
  3161. id: response.data.data.list[i].id,
  3162. name: response.data.data.list[i].name,
  3163. number: response.data.data.list[i].his_patient[0].number,
  3164. order_status: response.data.data.list[i].his_patient[0].orders[b].order_status,
  3165. his_patient_id: response.data.data.list[i].his_patient[0].id,
  3166. order_number: response.data.data.list[i].his_patient[0].orders[b].order_number,
  3167. order_id: response.data.data.list[i].his_patient[0].orders[b].id,
  3168. prescription: response.data.data.list[i].prescription
  3169. }
  3170. this.all_table_data.push(obj)
  3171. }
  3172. } else {
  3173. let obj = {
  3174. id: response.data.data.list[i].id,
  3175. name: response.data.data.list[i].name,
  3176. number: response.data.data.list[i].his_patient[0].number,
  3177. order_status: 0,
  3178. his_patient_id: response.data.data.list[i].his_patient[0].id,
  3179. order_number: '',
  3180. order_id: 0,
  3181. prescription: response.data.data.list[i].prescription
  3182. }
  3183. this.all_table_data.push(obj)
  3184. }
  3185. }
  3186. if (response.data.data.list[i].his_patient.length > 1) {
  3187. for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
  3188. if (response.data.data.list[i].his_patient[b].orders.length == 0) {
  3189. let obj = {
  3190. id: response.data.data.list[i].id,
  3191. name: response.data.data.list[i].name,
  3192. number: response.data.data.list[i].his_patient[b].number,
  3193. order_status: 0,
  3194. his_patient_id: response.data.data.list[i].his_patient[b].id,
  3195. order_number: '',
  3196. order_id: 0,
  3197. prescription: response.data.data.list[i].prescription
  3198. }
  3199. this.all_table_data.push(obj)
  3200. } else {
  3201. for (let c = 0; c < response.data.data.list[i].his_patient[b].orders.length; c++) {
  3202. let obj = {
  3203. id: response.data.data.list[i].id,
  3204. name: response.data.data.list[i].name,
  3205. number: response.data.data.list[i].his_patient[b].number,
  3206. order_status: response.data.data.list[i].his_patient[b].orders[c].order_status,
  3207. his_patient_id: response.data.data.list[i].his_patient[b].id,
  3208. order_number: response.data.data.list[i].his_patient[b].orders[c].number,
  3209. order_id: response.data.data.list[i].his_patient[b].orders[c].id,
  3210. prescription: response.data.data.list[i].prescription
  3211. }
  3212. this.all_table_data.push(obj)
  3213. }
  3214. }
  3215. }
  3216. }
  3217. }
  3218. }
  3219. for (let i = 0; i < this.all_table_data.length; i++) {
  3220. if (this.all_table_data[i].his_patient_id > 0) {
  3221. this.hisPatientDatas.push(this.all_table_data[i])
  3222. }
  3223. }
  3224. let unChargePatient = []
  3225. for (let i = 0; i < this.all_table_data.length; i++) {
  3226. let isHasUnCharge = false
  3227. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  3228. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3229. isHasUnCharge = true
  3230. } else {
  3231. if (this.all_table_data[i].his_patient_id > 0) {
  3232. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  3233. isHasUnCharge = true
  3234. }
  3235. }
  3236. }
  3237. }
  3238. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3239. isHasUnCharge = true
  3240. }
  3241. if (isHasUnCharge) {
  3242. unChargePatient.push(this.all_table_data[i])
  3243. }
  3244. }
  3245. unChargePatient = this.unique_four(unChargePatient)
  3246. one_count = one_count + unChargePatient.length
  3247. let ChargePatient = []
  3248. for (let i = 0; i < this.all_table_data.length; i++) {
  3249. if (this.all_table_data[i].order_status == 2) {
  3250. ChargePatient.push(this.all_table_data[i])
  3251. }
  3252. }
  3253. two_count = two_count + ChargePatient.length
  3254. if (this.radio == 1) {
  3255. this.all_table_data = this.unique_four(this.all_table_data)
  3256. }
  3257. console.log(this.all_table_data)
  3258. switch (this.radio) {
  3259. case 1:
  3260. this.patientTableData = []
  3261. for (let i = 0; i < this.all_table_data.length; i++) {
  3262. let isHasUnCharge = false
  3263. for (let b = 0; b < this.all_table_data[i].prescription.length; b++) {
  3264. if (this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3265. isHasUnCharge = true
  3266. } else {
  3267. if (this.all_table_data[i].his_patient_id > 0) {
  3268. if (this.all_table_data[i].his_patient_id == this.all_table_data[i].prescription[0].his_patient_id) {
  3269. isHasUnCharge = true
  3270. }
  3271. }
  3272. }
  3273. }
  3274. if (this.all_table_data[i].his_patient_id > 0 && this.all_table_data[i].order_status != 2 && this.all_table_data[i].order_status != 3) {
  3275. isHasUnCharge = true
  3276. }
  3277. if (isHasUnCharge) {
  3278. this.patientTableData.push(this.all_table_data[i])
  3279. }
  3280. }
  3281. this.all_patient = this.patientTableData
  3282. break
  3283. case 2:
  3284. this.patientTableData = []
  3285. for (let i = 0; i < this.all_table_data.length; i++) {
  3286. if (this.all_table_data[i].order_status == 2) {
  3287. this.patientTableData.push(this.all_table_data[i])
  3288. }
  3289. }
  3290. this.all_patient = this.patientTableData
  3291. break
  3292. case 4:
  3293. this.patientTableData = []
  3294. this.patientTableData = this.all_table_data
  3295. this.all_patient = this.patientTableData
  3296. break
  3297. }
  3298. this.cal_one = one_count
  3299. this.cal_two = two_count
  3300. this.cal_three = one_count + two_count
  3301. this.current_index = 0
  3302. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  3303. this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].order_number, this.patientTableData[0].his_patient_id, this.patientTableData[0].order_id)
  3304. }
  3305. })
  3306. },
  3307. setMonthPrescription(month_prescriptions) {
  3308. let big_prescriptions = []
  3309. for (let i = 0; i < this.unique_three(month_prescriptions).length; i++) {
  3310. let obj = {
  3311. med_type: this.unique_three(month_prescriptions)[i].med_type,
  3312. prescriptions: []
  3313. }
  3314. big_prescriptions.push(obj)
  3315. }
  3316. this.month_prescriptions = []
  3317. let drug_prescriptions_ids = ''
  3318. let project_prescriptions_ids = ''
  3319. for (let c = 0; c < big_prescriptions.length; c++) {
  3320. let drug_month_prescriptions = {
  3321. advices: []
  3322. }
  3323. let drug_ids = []
  3324. let project_month_prescriptions = {
  3325. project: []
  3326. }
  3327. let project_ids = []
  3328. for (let i = 0; i < month_prescriptions.length; i++) {
  3329. if (big_prescriptions[c].med_type == month_prescriptions[i].med_type) {
  3330. if (month_prescriptions[i].type == 1) { //药品
  3331. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  3332. let obj = {
  3333. id: month_prescriptions[i].advices[a].drug_id,
  3334. price: month_prescriptions[i].advices[a].price
  3335. }
  3336. drug_ids.push(obj)
  3337. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  3338. }
  3339. if (drug_prescriptions_ids.length == 0) {
  3340. drug_prescriptions_ids = month_prescriptions[i].id.toString()
  3341. } else {
  3342. drug_prescriptions_ids = drug_prescriptions_ids + ',' + month_prescriptions[i].id.toString()
  3343. }
  3344. } else if (month_prescriptions[i].type == 2) { //项目
  3345. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  3346. let obj = {
  3347. id: month_prescriptions[i].project[a].project_id,
  3348. price: month_prescriptions[i].project[a].price
  3349. }
  3350. project_ids.push(obj)
  3351. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  3352. }
  3353. if (project_prescriptions_ids.length == 0) {
  3354. project_prescriptions_ids = month_prescriptions[i].id.toString()
  3355. } else {
  3356. project_prescriptions_ids = project_prescriptions_ids + ',' + month_prescriptions[i].id.toString()
  3357. }
  3358. }
  3359. big_prescriptions[c]['drug_ids'] = []
  3360. big_prescriptions[c]['project_ids'] = []
  3361. // big_prescriptions[c]['additions_ids'] = []
  3362. big_prescriptions[c]['drug_month_prescriptions'] = []
  3363. big_prescriptions[c]['project_month_prescriptions'] = []
  3364. // big_prescriptions[c]['addition_month_prescriptions'] = []
  3365. big_prescriptions[c]['drug_ids'] = drug_ids
  3366. big_prescriptions[c]['project_ids'] = project_ids
  3367. // big_prescriptions[c]['additions_ids'] = additions_ids
  3368. big_prescriptions[c]['drug_month_prescriptions'] = drug_month_prescriptions
  3369. big_prescriptions[c]['project_month_prescriptions'] = project_month_prescriptions
  3370. // big_prescriptions[c]['addition_month_prescriptions'] = addition_month_prescriptions
  3371. big_prescriptions[c]['order'] = month_prescriptions[i].order
  3372. }
  3373. }
  3374. }
  3375. //
  3376. //
  3377. for (let y = 0; y < big_prescriptions.length; y++) {
  3378. let drug_ids = this.unique_two(big_prescriptions[y].drug_ids)
  3379. let project_ids = this.unique_two(big_prescriptions[y].project_ids)
  3380. // let additions_ids = this.unique_two(big_prescriptions[y].additions_ids)
  3381. let drugs = []
  3382. let projects = []
  3383. // let additions = []
  3384. for (let i = 0; i < drug_ids.length; i++) {
  3385. let obj = {}
  3386. let count = 0
  3387. for (let a = 0; a < big_prescriptions[y].drug_month_prescriptions.advices.length; a++) {
  3388. if (drug_ids[i].price == big_prescriptions[y].drug_month_prescriptions.advices[a].price && drug_ids[i].id == big_prescriptions[y].drug_month_prescriptions.advices[a].drug_id) {
  3389. obj['drug_name'] = big_prescriptions[y].drug_month_prescriptions.advices[a].advice_name
  3390. obj['single_dose'] = big_prescriptions[y].drug_month_prescriptions.advices[a].single_dose
  3391. obj['delivery_way'] = big_prescriptions[y].drug_month_prescriptions.advices[a].delivery_way
  3392. obj['execution_frequency'] = big_prescriptions[y].drug_month_prescriptions.advices[a].execution_frequency
  3393. obj['day'] = big_prescriptions[y].drug_month_prescriptions.advices[a].day
  3394. // obj['prescribing_number'] = obj['prescribing_number'] + drug_month_prescriptions.advices[a].prescribing_number
  3395. obj['prescribing_number_unit'] = big_prescriptions[y].drug_month_prescriptions.advices[a].prescribing_number_unit
  3396. obj['medical_insurance_number'] = big_prescriptions[y].drug_month_prescriptions.advices[a].drug.medical_insurance_number
  3397. obj['id'] = big_prescriptions[y].drug_month_prescriptions.advices[a].drug_id
  3398. // obj['retail_price'] = obj['retail_price'] + drug_month_prescriptions.advices[a].drug.retail_price
  3399. obj['retail_price'] = parseFloat(big_prescriptions[y].drug_month_prescriptions.advices[a].price)
  3400. count = count + big_prescriptions[y].drug_month_prescriptions.advices[a].prescribing_number
  3401. }
  3402. }
  3403. obj['prescribing_number'] = count
  3404. drugs.push(obj)
  3405. }
  3406. for (let i = 0; i < project_ids.length; i++) {
  3407. let obj = {}
  3408. let count = 0
  3409. for (let a = 0; a < big_prescriptions[y].project_month_prescriptions.project.length; a++) {
  3410. if (project_ids[i].price == big_prescriptions[y].project_month_prescriptions.project[a].price && project_ids[i].id == big_prescriptions[y].project_month_prescriptions.project[a].project_id) {
  3411. if (big_prescriptions[y].project_month_prescriptions.project[a].type == 2) {
  3412. obj['statistical_classification'] = big_prescriptions[y].project_month_prescriptions.project[a].project.statistical_classification
  3413. obj['medical_code'] = big_prescriptions[y].project_month_prescriptions.project[a].project.medical_code
  3414. obj['project_name'] = big_prescriptions[y].project_month_prescriptions.project[a].project.project_name
  3415. } else if (big_prescriptions[y].project_month_prescriptions.project[a].type == 3) {
  3416. obj['statistical_classification'] = ''
  3417. obj['medical_code'] = big_prescriptions[y].project_month_prescriptions.project[a].good_info.medical_insurance_number
  3418. obj['project_name'] = big_prescriptions[y].project_month_prescriptions.project[a].good_info.good_name
  3419. }
  3420. // obj['project_name'] = project_month_prescriptions.project[a].project.project_name
  3421. // obj['statistical_classification'] = project_month_prescriptions.project[a].project.statistical_classification
  3422. obj['single_dose'] = big_prescriptions[y].project_month_prescriptions.project[a].single_dose
  3423. obj['delivery_way'] = big_prescriptions[y].project_month_prescriptions.project[a].delivery_way
  3424. obj['execution_frequency'] = big_prescriptions[y].project_month_prescriptions.project[a].execution_frequency
  3425. obj['number_days'] = big_prescriptions[y].project_month_prescriptions.project[a].day
  3426. // obj['medical_code'] = project_month_prescriptions.project[a].project.medical_code
  3427. obj['unit'] = big_prescriptions[y].project_month_prescriptions.project[a].unit
  3428. obj['project_id'] = big_prescriptions[y].project_month_prescriptions.project[a].project_id
  3429. count = count + parseFloat(big_prescriptions[y].project_month_prescriptions.project[a].count)
  3430. // price = price + project_month_prescriptions.project[a].price
  3431. obj['price'] = parseFloat(big_prescriptions[y].project_month_prescriptions.project[a].price)
  3432. obj['type'] = big_prescriptions[y].project_month_prescriptions.project[a].type
  3433. }
  3434. }
  3435. obj['total'] = count
  3436. projects.push(obj)
  3437. }
  3438. // for (let i = 0; i < additions_ids.length; i++) {
  3439. // let obj = {}
  3440. // let count = 0
  3441. // if (big_prescriptions[y].addition_month_prescriptions.addition) {
  3442. // for (let a = 0; a < big_prescriptions[y].addition_month_prescriptions.addition.length; a++) {
  3443. // if (additions_ids[i].price == big_prescriptions[y].addition_month_prescriptions.addition[a].price && additions_ids[i].id == big_prescriptions[y].addition_month_prescriptions.addition[a].item_id) {
  3444. // obj['item_name'] = big_prescriptions[y].addition_month_prescriptions.addition[a].item_name
  3445. // obj['id'] = big_prescriptions[y].addition_month_prescriptions.addition[a].id
  3446. // obj['item_id'] = big_prescriptions[y].addition_month_prescriptions.addition[a].item_id
  3447. // count = count + big_prescriptions[y].addition_month_prescriptions.addition[a].count
  3448. // obj['price'] = parseFloat(big_prescriptions[y].addition_month_prescriptions.addition[a].price)
  3449. // }
  3450. // }
  3451. // obj['count'] = count
  3452. // additions.push(obj)
  3453. // }
  3454. // }
  3455. console.log('ids==')
  3456. console.log(drug_prescriptions_ids)
  3457. console.log(project_prescriptions_ids)
  3458. let p1 = {
  3459. name: this.getPName(big_prescriptions[y].med_type, 1),
  3460. advices: drugs,
  3461. project: [],
  3462. prescriptions_ids: drug_prescriptions_ids,
  3463. type: 1,
  3464. order: big_prescriptions[y].order
  3465. }
  3466. let p2 = {
  3467. name: this.getPName(big_prescriptions[y].med_type, 2),
  3468. type: 2,
  3469. project: projects,
  3470. prescriptions_ids: project_prescriptions_ids,
  3471. advices: [],
  3472. order: big_prescriptions[y].order
  3473. }
  3474. big_prescriptions[y]['month_prescriptions'] = []
  3475. big_prescriptions[y]['month_prescriptions'].push(p1)
  3476. big_prescriptions[y]['month_prescriptions'].push(p2)
  3477. }
  3478. this.big_month_prescriptions = big_prescriptions
  3479. console.log(this.big_month_prescriptions)
  3480. for (let i = 0; i < this.big_month_prescriptions.length; i++) {
  3481. if (this.big_month_prescriptions[i].month_prescriptions.length > 0) {
  3482. this.big_month_prescriptions[i]['curMonthPrescriptions'] = JSON.parse(JSON.stringify(this.big_month_prescriptions[i].month_prescriptions[0]))
  3483. } else {
  3484. this.big_month_prescriptions[i]['curMonthPrescriptions'] = {}
  3485. }
  3486. this.big_month_prescriptions[i]['month_total'] = this.getMonthTotalTwo(this.big_month_prescriptions[i].month_prescriptions[0])
  3487. }
  3488. if (this.big_month_prescriptions.length > 0) {
  3489. this.editableTabsValue = this.big_month_prescriptions[0].curMonthPrescriptions.name
  3490. }
  3491. },
  3492. getPName(med_type, index) {
  3493. var med_type = parseInt(med_type)
  3494. switch (med_type) {
  3495. case 11:
  3496. return '普通门诊' + '处方' + index
  3497. break
  3498. case 12:
  3499. return '门诊挂号' + '处方' + index
  3500. break
  3501. case 13:
  3502. return '急诊' + '处方' + index
  3503. break
  3504. case 14:
  3505. return '门诊特殊病' + '处方' + index
  3506. break
  3507. case 15:
  3508. return '门诊统筹' + '处方' + index
  3509. break
  3510. case 16:
  3511. return '门诊慢性病' + '处方' + index
  3512. break
  3513. case 21:
  3514. return '普通住院' + '处方' + index
  3515. break
  3516. case 1111:
  3517. return '精一' + '处方' + index
  3518. break
  3519. case 1112:
  3520. return '精二' + '处方' + index
  3521. break
  3522. case 9933:
  3523. return '门诊特殊病(9933)' + '处方' + index
  3524. break
  3525. case 990602:
  3526. return '门诊特殊病(990602)' + '处方' + index
  3527. break
  3528. case 1402:
  3529. return '门诊特殊病(1402)' + '处方' + index
  3530. break
  3531. case 9922:
  3532. return '家庭通道' + '处方' + index
  3533. break
  3534. }
  3535. }, unique_four(array) {
  3536. // res用来存储结果
  3537. var res = []
  3538. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3539. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3540. if (array[i].id === res[j].id && array[i].number === res[j].number) {
  3541. break
  3542. }
  3543. }
  3544. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3545. if (j === resLen) {
  3546. res.push(array[i])
  3547. }
  3548. }
  3549. return res
  3550. },
  3551. unique_two(array) {
  3552. // res用来存储结果
  3553. var res = []
  3554. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3555. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3556. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  3557. break
  3558. }
  3559. }
  3560. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3561. if (j === resLen) {
  3562. res.push(array[i])
  3563. }
  3564. }
  3565. return res
  3566. },
  3567. unique(arr) {
  3568. const res = new Map()
  3569. return arr.filter((arr) => !res.has(arr.id_card_no) && res.set(arr.id_card_no, 1))
  3570. }, unique_three(array) {
  3571. // res用来存储结果
  3572. var res = []
  3573. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3574. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3575. if (array[i].med_type === res[j].med_type) {
  3576. break
  3577. }
  3578. }
  3579. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3580. if (j === resLen) {
  3581. res.push(array[i])
  3582. }
  3583. }
  3584. return res
  3585. },
  3586. handleCurrentChange(val) {
  3587. this.curPrescriptions = null
  3588. this.curMonthPrescriptions = null
  3589. this.prescriptions = []
  3590. this.month_prescriptions = []
  3591. this.big_prescriptions = []
  3592. this.big_month_prescriptions = []
  3593. this.getPatientInformation(val.id, val.order_number, val.his_patient_id, val.order_id)
  3594. this.patient_id = val.id
  3595. for (let i = 0; i < this.patientTableData.length; i++) {
  3596. if (this.patientTableData[i].his_patient_id == val.his_patient_id) {
  3597. this.current_index = i
  3598. }
  3599. }
  3600. },
  3601. // 获取患者的基本信息
  3602. getPatientInformation(id, batch_number, his_patient_id, order_id) {
  3603. const params = {
  3604. 'record_date': this.record_date,
  3605. 'patient_id': id,
  3606. 'his_patient_id': his_patient_id,
  3607. 'number': batch_number,
  3608. 'start_time': this.other_start_time,
  3609. 'end_time': this.other_end_time,
  3610. 'type': this.radio,
  3611. 'p_type': 2,
  3612. 'order_id': order_id
  3613. }
  3614. this.loading = true
  3615. if (this.activeName == 'first') {
  3616. getChargeHisPatientInfo(params).then(response => {
  3617. if (response.data.state == 0) {
  3618. this.loading = false
  3619. this.$message.error(response.data.msg)
  3620. return false
  3621. } else {
  3622. this.prescriptions = []
  3623. this.month_prescriptions = []
  3624. this.big_month_prescriptions = []
  3625. this.big_prescriptions = []
  3626. this.curPrescriptions = {}
  3627. this.curMonthPrescriptions = {}
  3628. this.loading = false
  3629. this.patientInfo = response.data.data.xt_info
  3630. this.hisPatientInfo = response.data.data.his_info
  3631. this.info = response.data.data.info
  3632. this.order = response.data.data.order
  3633. this.p_type = ''
  3634. this.sick_type = ''
  3635. this.diagnosis = []
  3636. this.sick_history = ''
  3637. this.form.diagnosis = []
  3638. if (this.info.id > 0) {
  3639. this.form.p_type = response.data.data.info.register_type
  3640. this.form.sick_type = response.data.data.info.sick_type
  3641. if (response.data.data.info.diagnosis.length == 0) {
  3642. this.form.diagnosis = []
  3643. } else {
  3644. for (let i = 0; i < response.data.data.info.diagnosis.split(',').length; i++) {
  3645. this.form.diagnosis.push(parseInt(response.data.data.info.diagnosis.split(',')[i]))
  3646. }
  3647. }
  3648. this.sick_history = this.info.sick_history
  3649. if (this.info.register_type == 0) {
  3650. this.form.p_type = ''
  3651. }
  3652. if (this.info.sick_type == 0) {
  3653. this.form.sick_type = ''
  3654. }
  3655. } else {
  3656. this.form.p_type = 14
  3657. this.form.sick_type = this.sick[0].id
  3658. if (response.data.data.last_info.diagnoses.length == 0) {
  3659. this.form.diagnosis = []
  3660. } else {
  3661. for (let i = 0; i < response.data.data.last_info.diagnosis.split(',').length; i++) {
  3662. this.form.diagnosis.push(parseInt(response.data.data.last_info.diagnosis.split(',')[i]))
  3663. }
  3664. }
  3665. this.sick_history = ''
  3666. }
  3667. this.addtions_charge = response.data.data.addtions_charge
  3668. if (response.data.data.prescription.length > 0 && response.data.data.prescription[0].advices.length > 0) {
  3669. this.prescription_id = response.data.data.prescription[0].advices[0].prescription_id
  3670. } else {
  3671. this.prescription_id = 0
  3672. }
  3673. const big_prescriptions = []
  3674. for (let i = 0; i < this.unique_three(response.data.data.prescription).length; i++) {
  3675. const obj = {
  3676. med_type: this.unique_three(response.data.data.prescription)[i].med_type,
  3677. prescriptions: []
  3678. }
  3679. big_prescriptions.push(obj)
  3680. }
  3681. for (let c = 0; c < big_prescriptions.length; c++) {
  3682. const inner_prescription = []
  3683. for (let i = 0; i < response.data.data.prescription.length; i++) {
  3684. var prescription = response.data.data.prescription[i]
  3685. if (big_prescriptions[c].med_type == prescription.med_type) {
  3686. const tempAdvice = []
  3687. const tempProject = []
  3688. const tempAddition = []
  3689. for (let b = 0; b < prescription.advices.length; b++) {
  3690. let spec = prescription.advices[b].drug.dose + prescription.advices[b].drug.dose_unit + '*' + prescription.advices[b].drug.min_number + prescription.advices[b].drug.min_unit + '/' + prescription.advices[b].drug.max_unit
  3691. const obj = {
  3692. advice_id: prescription.advices[b].id,
  3693. drug_name: prescription.advices[b].advice_name,
  3694. single_dose: prescription.advices[b].single_dose,
  3695. delivery_way: prescription.advices[b].delivery_way,
  3696. execution_frequency: prescription.advices[b].execution_frequency,
  3697. retail_price: prescription.advices[b].price.toString(),
  3698. remark: prescription.advices[b].remark,
  3699. day: prescription.advices[b].day,
  3700. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  3701. single_dose_unit: prescription.advices[b].single_dose_unit,
  3702. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  3703. code: prescription.advices[b].drug.medical_insurance_number,
  3704. spec: spec,
  3705. det_item_fee_sumamt: prescription.advices[b].order_info.det_item_fee_sumamt,
  3706. name_id: prescription.advices[b].drug.manufacturer,
  3707. fulamt_ownpay_amt: prescription.advices[b].order_info.fulamt_ownpay_amt,
  3708. overlmt_amt: prescription.advices[b].order_info.overlmt_amt,
  3709. preselfpay_amt: prescription.advices[b].order_info.preselfpay_amt,
  3710. inscp_scp_amt: prescription.advices[b].order_info.inscp_scp_amt,
  3711. execution_state: prescription.advices[b].execution_state
  3712. }
  3713. tempAdvice.push(obj)
  3714. }
  3715. for (let b = 0; b < prescription.project.length; b++) {
  3716. const obj = {
  3717. id: prescription.project[b].id,
  3718. project_id: prescription.project[b].project.id,
  3719. // project_name: prescription.project[b].project.project_name,
  3720. // statistical_classification: prescription.project[b].project.statistical_classification,
  3721. single_dose: prescription.project[b].single_dose,
  3722. delivery_way: prescription.project[b].delivery_way,
  3723. execution_frequency: prescription.project[b].execution_frequency,
  3724. number_days: prescription.project[b].day,
  3725. total: prescription.project[b].count.toString(),
  3726. price: prescription.project[b].price,
  3727. remark: prescription.project[b].remark,
  3728. // medical_code: prescription.project[b].project.medical_code,
  3729. unit: prescription.project[b].unit,
  3730. type: prescription.project[b].type,
  3731. execution_state: prescription.project[b].execution_state,
  3732. det_item_fee_sumamt: prescription.project[b].order_info.det_item_fee_sumamt,
  3733. fulamt_ownpay_amt: prescription.project[b].order_info.fulamt_ownpay_amt,
  3734. overlmt_amt: prescription.project[b].order_info.overlmt_amt,
  3735. preselfpay_amt: prescription.project[b].order_info.preselfpay_amt,
  3736. inscp_scp_amt: prescription.project[b].order_info.inscp_scp_amt
  3737. }
  3738. if (prescription.project[b].type == 2) {
  3739. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  3740. obj['medical_code'] = prescription.project[b].project.medical_code
  3741. obj['project_name'] = prescription.project[b].project.project_name
  3742. obj['spec'] = ''
  3743. obj['name_id'] = 0
  3744. } else if (prescription.project[b].type == 3) {
  3745. obj['statistical_classification'] = ''
  3746. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  3747. obj['project_name'] = prescription.project[b].good_info.good_name
  3748. obj['spec'] = prescription.project[b].good_info.specification_name
  3749. obj['name_id'] = prescription.project[b].good_info.manufacturer
  3750. }
  3751. tempProject.push(obj)
  3752. }
  3753. // for (let b = 0; b < prescription.addition.length; b++) {
  3754. // const obj = {
  3755. // id: prescription.addition[b].id,
  3756. // item_name: prescription.addition[b].item_name,
  3757. // price: prescription.addition[b].price,
  3758. // count: prescription.addition[b].count,
  3759. // item_id: prescription.addition[b].item_id
  3760. // }
  3761. // tempAddition.push(obj)
  3762. // }
  3763. const index = i + 1
  3764. console.log('~~~~~~~~')
  3765. console.log(prescription.order)
  3766. prescription.order.order_status = prescription.order.order_status.toString()
  3767. prescription.order.order_status = parseInt(prescription.order.order_status)
  3768. const obj = {
  3769. id: prescription.id,
  3770. name: this.getPName(prescription.med_type, index),
  3771. advices: tempAdvice,
  3772. project: tempProject,
  3773. addition: tempAddition,
  3774. order_status: prescription.order_status,
  3775. type: prescription.type,
  3776. med_type: prescription.med_type,
  3777. order: prescription.order
  3778. }
  3779. // inner_prescription.push(obj)
  3780. big_prescriptions[c].prescriptions.push(obj)
  3781. this.prescriptions.push(obj)
  3782. }
  3783. }
  3784. }
  3785. this.big_prescriptions = JSON.parse(JSON.stringify(big_prescriptions))
  3786. for (let i = 0; i < this.big_prescriptions.length; i++) {
  3787. if (this.big_prescriptions[i].med_type == '11') {
  3788. this.big_prescriptions[i]['is_true'] = 1
  3789. }
  3790. }
  3791. for (let i = 0; i < this.big_prescriptions.length; i++) {
  3792. if (this.big_prescriptions[i].is_true == 1) {
  3793. for (let b = 0; b < this.big_prescriptions[i].prescriptions.length; b++) {
  3794. const obj = {
  3795. med_type: '11',
  3796. prescriptions: []
  3797. }
  3798. const arr = []
  3799. arr.push(this.big_prescriptions[i].prescriptions[b])
  3800. obj.prescriptions = arr
  3801. this.big_prescriptions.push(obj)
  3802. }
  3803. }
  3804. }
  3805. console.log(this.big_prescriptions)
  3806. //
  3807. for (let i = 0; i < this.big_prescriptions.length; i++) {
  3808. if (this.big_prescriptions[i].is_true == 1) {
  3809. this.big_prescriptions.splice(i, 1)
  3810. }
  3811. }
  3812. // console.log(this.big_prescriptions)
  3813. for (let i = 0; i < this.big_prescriptions.length; i++) {
  3814. if (this.big_prescriptions[i].prescriptions.length > 0) {
  3815. this.big_prescriptions[i]['curPrescriptions'] = JSON.parse(JSON.stringify(this.big_prescriptions[i].prescriptions[0]))
  3816. } else {
  3817. this.big_prescriptions[i]['curPrescriptions'] = {}
  3818. }
  3819. this.big_prescriptions[i]['total'] = this.getTotalThree(this.big_prescriptions[i])
  3820. }
  3821. if (this.big_prescriptions.length > 0) {
  3822. this.editableTabsValue = this.getPName(this.big_prescriptions[0].med_type, 1)
  3823. }
  3824. }
  3825. })
  3826. } else {
  3827. getMonthCharge(params).then(response => {
  3828. if (response.data.state == 0) {
  3829. this.loading = false
  3830. this.$message.error(response.data.msg)
  3831. return false
  3832. } else {
  3833. this.prescriptions = []
  3834. this.month_prescriptions = []
  3835. this.big_month_prescriptions = []
  3836. this.big_prescriptions = []
  3837. this.curPrescriptions = {}
  3838. this.curMonthPrescriptions = {}
  3839. this.loading = false
  3840. this.patientInfo = response.data.data.xt_info
  3841. this.hisPatientInfo = response.data.data.his_info
  3842. this.info = response.data.data.info
  3843. this.order = response.data.data.order
  3844. this.p_type = ''
  3845. this.sick_type = ''
  3846. this.diagnosis = []
  3847. this.sick_history = ''
  3848. this.form.diagnosis = []
  3849. if (this.info.id > 0) {
  3850. this.form.p_type = response.data.data.info.register_type
  3851. this.form.sick_type = response.data.data.info.sick_type
  3852. if (response.data.data.info.diagnosis.length == 0) {
  3853. this.form.diagnosis = []
  3854. } else {
  3855. for (let i = 0; i < response.data.data.info.diagnosis.split(',').length; i++) {
  3856. this.form.diagnosis.push(parseInt(response.data.data.info.diagnosis.split(',')[i]))
  3857. }
  3858. }
  3859. this.sick_history = this.info.sick_history
  3860. if (this.info.register_type == 0) {
  3861. this.form.p_type = ''
  3862. }
  3863. if (this.info.sick_type == 0) {
  3864. this.form.sick_type = ''
  3865. }
  3866. } else {
  3867. this.form.p_type = 14
  3868. this.form.sick_type = this.sick[0].id
  3869. if (response.data.data.last_info.diagnoses.length == 0) {
  3870. this.form.diagnosis = []
  3871. } else {
  3872. for (let i = 0; i < response.data.data.last_info.diagnosis.split(',').length; i++) {
  3873. this.form.diagnosis.push(parseInt(response.data.data.last_info.diagnosis.split(',')[i]))
  3874. }
  3875. }
  3876. this.sick_history = ''
  3877. }
  3878. this.addtions_charge = response.data.data.addtions_charge
  3879. this.setMonthPrescription(response.data.data.month_prescriptions)
  3880. }
  3881. })
  3882. }
  3883. }
  3884. // sz_open(index, med_type, order, prescriptions) {
  3885. // switch (index) {
  3886. // case 1:
  3887. // this.$refs.register9504.show()
  3888. // break
  3889. // case 2:
  3890. // var that = this
  3891. // if (this.activeName == 'first') {
  3892. // this.settle_accounts_type = 1
  3893. // } else {
  3894. // this.settle_accounts_type = 2
  3895. // this.start_time = this.other_start_time
  3896. // this.end_time = this.other_end_time
  3897. // this.settle_accounts_type = 2
  3898. // }
  3899. // const params = {
  3900. // 'patient_id': this.patientInfo.id,
  3901. // 'record_time': this.record_date,
  3902. // 'settle_accounts_type': this.settle_accounts_type,
  3903. // 'admin_user_id': this.$store.getters.xt_user.user.id,
  3904. // 'his_patient_id': this.hisPatientInfo.id
  3905. // }
  3906. //
  3907. // params['p_type'] = med_type
  3908. // params['diagnosis'] = this.form.diagnosis.join(',')
  3909. //
  3910. // axios.get('http://127.0.0.1:9532/sz/api/upload/get', {
  3911. // params: params,
  3912. // headers: {
  3913. // 'Permission': 5
  3914. // }
  3915. // })
  3916. // .then(function(response) {
  3917. // if (response.data.state == 0) {
  3918. // that.$message.error(response.data.msg)
  3919. // return false
  3920. // } else {
  3921. //
  3922. // if (response.data.data.failed_code == -10) {
  3923. // that.$message.error(response.data.data.msg)
  3924. //
  3925. // } else {
  3926. // that.changeRadioAndPatient(1)
  3927. // that.$message({ message: '预结算成功', type: 'success' })
  3928. // }
  3929. //
  3930. // }
  3931. // })
  3932. // .catch(function(error) {
  3933. // })
  3934. // break
  3935. // case 3:
  3936. // this.currentOrder = order
  3937. // this.current_med_type = med_type
  3938. //
  3939. // var ids = []
  3940. // for (let i = 0; i < prescriptions.length; i++) {
  3941. // ids.push(prescriptions[i].id)
  3942. // }
  3943. // var ids_str = ids.join(',')
  3944. // this.temp_ids = ids_str
  3945. //
  3946. // if (this.activeName == 'first') {
  3947. // this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  3948. // } else {
  3949. // this.$refs.charge.show(this.getTotalFour(prescriptions), this.currentOrder)
  3950. // }
  3951. //
  3952. // break
  3953. // case 4:
  3954. // break
  3955. // case 5:
  3956. // var that = this
  3957. // this.$confirm('是否退费', '退费', {
  3958. // confirmButtonText: '确 定',
  3959. // cancelButtonText: '取 消',
  3960. // type: 'warning'
  3961. // }).then(() => {
  3962. // if (that.hisPatientInfo.balance_accounts_type == 2) {
  3963. // const params = {
  3964. // 'order_id': that.order.id,
  3965. // 'number': that.order.number,
  3966. // 'patient_id': that.patientInfo.id,
  3967. // 'record_time': that.record_date
  3968. //
  3969. // }
  3970. // Refund(params).then(response => {
  3971. // if (response.data.state == 0) {
  3972. // that.$message.error(response.data.msg)
  3973. // that.loadingtwo = false
  3974. // return false
  3975. // } else {
  3976. // that.radio = 1
  3977. // that.changeRadioAndPatient(1)
  3978. // that.$message({ message: '退费成功', type: 'success' })
  3979. // that.loadingtwo = false
  3980. // }
  3981. // })
  3982. // } else {
  3983. // axios.get('http://127.0.0.1:9532/sz/api/refund/get', {
  3984. // params: {
  3985. // order_id: this.order.id,
  3986. // record_time: this.record_date,
  3987. // his_patient_id: this.hisPatientInfo.id,
  3988. // admin_user_id: this.$store.getters.xt_user.user.id,
  3989. // patient_id: this.patientInfo.id
  3990. // }
  3991. // })
  3992. // .then(function(response) {
  3993. // if (response.data.state == 0) {
  3994. // that.$message.error(response.data.msg)
  3995. // return false
  3996. // } else {
  3997. // if (response.data.data.failed_code == -10) {
  3998. // that.$message.error(response.data.data.msg)
  3999. // } else {
  4000. // that.changeRadioAndPatient(1)
  4001. // that.$message({ message: '退费成功', type: 'success' })
  4002. // }
  4003. // }
  4004. // })
  4005. // .catch(function(error) {
  4006. // })
  4007. // }
  4008. // }).catch(() => {
  4009. // })
  4010. // break
  4011. // case 6:
  4012. // var that = this
  4013. // axios.get('http://127.0.0.1:9532/sz/api/settle/query', {
  4014. // params: {
  4015. // order_id: this.order.id,
  4016. // record_time: this.record_date,
  4017. // admin_user_id: this.$store.getters.xt_user.user.id,
  4018. // patient_id: this.patientInfo.id
  4019. // }
  4020. // })
  4021. // .then(function(response) {
  4022. // if (response.data.state == 0) {
  4023. // // that.$message.error(response.data.msg)
  4024. // return false
  4025. // } else {
  4026. // if (response.data.data.failed_code == -10) {
  4027. // that.$confirm(response.data.data.msg, '医保错误信息', {
  4028. // confirmButtonText: '确 定',
  4029. // type: 'warning'
  4030. // }).then(() => {
  4031. //
  4032. // }).catch(() => {
  4033. // })
  4034. // } else {
  4035. // that.$message({ message: '查询成功', type: 'success' })
  4036. // }
  4037. // }
  4038. // })
  4039. // .catch(function(error) {
  4040. // })
  4041. // break
  4042. // case 7:
  4043. // if (this.hisPatientInfo.balance_accounts_type != 2) {
  4044. // var that = this
  4045. // axios.get('http://127.0.0.1:9532/sz/api/detail/cancel', {
  4046. // params: {
  4047. // order_id: order.id,
  4048. // record_time: this.record_date,
  4049. // admin_user_id: this.$store.getters.xt_user.user.id,
  4050. // patient_id: this.patientInfo.id,
  4051. // his_patient_id: this.hisPatientInfo.id
  4052. //
  4053. // }
  4054. // })
  4055. // .then(function(response) {
  4056. // if (response.data.state == 0) {
  4057. // that.$message.error(response.data.msg)
  4058. // return false
  4059. // } else {
  4060. // if (response.data.data.failed_code == -10) {
  4061. // that.$confirm(response.data.data.msg, '医保错误信息', {
  4062. // confirmButtonText: '确 定',
  4063. // type: 'warning'
  4064. // }).then(() => {
  4065. //
  4066. // }).catch(() => {
  4067. // })
  4068. // } else {
  4069. // that.$message({ message: '明细撤销成功', type: 'success' })
  4070. // that.changeRadioAndPatient(1)
  4071. // }
  4072. // }
  4073. // })
  4074. // .catch(function(error) {
  4075. // })
  4076. // } else {
  4077. // const params = {
  4078. // order_id: this.order.id,
  4079. // record_time: this.record_date,
  4080. // admin_user_id: this.$store.getters.xt_user.user.id,
  4081. // patient_id: this.patientInfo.id
  4082. // }
  4083. //
  4084. // refunddetail(params).then(response => {
  4085. // if (response.data.state == 0) {
  4086. // this.$message.error(response.data.msg)
  4087. // this.loadingtwo = false
  4088. // return false
  4089. // } else {
  4090. // this.changeRadioAndPatient(1)
  4091. // this.$message({ message: '撤销明细成功', type: 'success' })
  4092. // }
  4093. // })
  4094. // }
  4095. //
  4096. // break
  4097. // case 8:
  4098. // var ids = []
  4099. // for (let i = 0; i < prescriptions.length; i++) {
  4100. // ids.push(prescriptions[i].id)
  4101. // }
  4102. // var ids_str = ids.join(',')
  4103. //
  4104. // if (this.hisPatientInfo.balance_accounts_type == 2) {
  4105. // this.$confirm('是否进行预结算', '预结算', {
  4106. // confirmButtonText: '确 定',
  4107. // cancelButtonText: '取 消',
  4108. // type: 'warning'
  4109. // }).then(() => {
  4110. // const form = {}
  4111. // form['id'] = this.patientInfo.id
  4112. // form['his_patient_id'] = this.hisPatientInfo.id
  4113. // form['record_time'] = this.record_date
  4114. // form['admin_user_id'] = this.$store.getters.xt_user.user.id
  4115. // form['org_id'] = this.$store.getters.xt_user.org_id
  4116. // form['ids'] = ids_str
  4117. // form['p_type'] = med_type
  4118. // form['diagnosis'] = this.form.diagnosis.join(',')
  4119. // form['sick_type'] = this.form.sick_type
  4120. //
  4121. // if (this.activeName == 'first') {
  4122. // form['settle_accounts_type'] = 1
  4123. // } else {
  4124. // form['start_time'] = this.other_start_time
  4125. // form['end_time'] = this.other_end_time
  4126. // form['settle_accounts_type'] = 2
  4127. // }
  4128. // preSettle(form).then(response => {
  4129. // if (response.data.state == 0) {
  4130. // this.$message.error(response.data.msg)
  4131. // this.loadingtwo = false
  4132. // return false
  4133. // } else {
  4134. // this.changeRadioAndPatient(1)
  4135. // this.$message({ message: '预结算成功', type: 'success' })
  4136. // }
  4137. // })
  4138. // }).catch(() => {
  4139. //
  4140. // })
  4141. // } else {
  4142. // var ids = []
  4143. // for (let i = 0; i < prescriptions.length; i++) {
  4144. // ids.push(prescriptions[i].id)
  4145. // }
  4146. // var ids_str = ids.join(',')
  4147. // var that = this
  4148. // const form = {}
  4149. // form['id'] = this.patientInfo.id
  4150. // form['his_patient_id'] = this.hisPatientInfo.id
  4151. // form['record_time'] = this.record_date
  4152. // form['admin_user_id'] = this.$store.getters.xt_user.user.id
  4153. // form['org_id'] = this.$store.getters.xt_user.org_id
  4154. // form['ids'] = ids_str
  4155. // form['p_type'] = med_type
  4156. // form['diagnosis'] = this.form.diagnosis.join(',')
  4157. // form['sick_type'] = this.form.sick_type
  4158. //
  4159. // if (this.activeName == 'first') {
  4160. // form['settle_accounts_type'] = 1
  4161. // } else {
  4162. // form['start_time'] = this.other_start_time
  4163. // form['end_time'] = this.other_end_time
  4164. // form['settle_accounts_type'] = 2
  4165. // }
  4166. // this.$confirm('是否进行预结算', '预结算', {
  4167. // confirmButtonText: '确 定',
  4168. // cancelButtonText: '取 消',
  4169. // type: 'warning'
  4170. // }).then(() => {
  4171. // axios.get('http://127.0.0.1:9532/sz/api/presettle/get', {
  4172. // params: form,
  4173. // headers: {
  4174. // 'Permission': 5
  4175. // }
  4176. // })
  4177. // .then(function(response) {
  4178. // if (response.data.state == 0) {
  4179. // that.$message.error(response.data.msg)
  4180. // return false
  4181. // } else {
  4182. // if (response.data.data.failed_code == -10) {
  4183. // that.$confirm(response.data.data.msg, '医保错误信息', {
  4184. // confirmButtonText: '确 定',
  4185. // type: 'warning'
  4186. // }).then(() => {
  4187. //
  4188. // }).catch(() => {
  4189. // })
  4190. // } else {
  4191. // that.changeRadioAndPatient(1)
  4192. // that.$message({ message: '预结算成功', type: 'success', duration: 5000 })
  4193. // }
  4194. // }
  4195. // })
  4196. // .catch(function(error) {
  4197. //
  4198. // })
  4199. // }).catch(() => {
  4200. //
  4201. // })
  4202. //
  4203. // }
  4204. //
  4205. // break
  4206. //
  4207. // case 10:
  4208. // this.newStatementVisible = true
  4209. // const obj = {
  4210. // record_time: this.record_date,
  4211. // patient_id: this.patient_id,
  4212. // prescription_id: this.prescription_id,
  4213. // order_id: this.order.id,
  4214. // admin_user_id: this.$store.getters.xt_user.user.id,
  4215. // balance_accounts_type: this.hisPatientInfo.balance_accounts_type,
  4216. // his_patient_id: this.hisPatientInfo.id
  4217. //
  4218. // }
  4219. // this.newOrderObj = obj
  4220. // // this.$refs.print.getInfo(this.order.id)
  4221. // break
  4222. // case 11:
  4223. // if (this.hisPatientInfo.balance_accounts_type == 2) {
  4224. // this.$confirm('是否退号', '退号', {
  4225. // confirmButtonText: '确 定',
  4226. // cancelButtonText: '取 消',
  4227. // type: 'warning'
  4228. // }).then(() => {
  4229. // const params = {
  4230. // 'id': this.hisPatientInfo.id
  4231. // }
  4232. // refundNumber(params).then(response => {
  4233. // if (response.data.state == 0) {
  4234. // this.$message.error(response.data.msg)
  4235. // return false
  4236. // } else {
  4237. // this.radio = 1
  4238. // this.changeRadioAndPatient(1)
  4239. // this.$message({ message: '退号成功', type: 'success' })
  4240. // }
  4241. // })
  4242. // }).catch(() => {
  4243. // })
  4244. // } else {
  4245. // var that = this
  4246. // this.$confirm('是否退号', '退号', {
  4247. // confirmButtonText: '确 定',
  4248. // cancelButtonText: '取 消',
  4249. // type: 'warning'
  4250. // }).then(() => {
  4251. // axios.get('http://127.0.0.1:9532/sz/api/refundnumber/get', {
  4252. // params: {
  4253. // order_id: this.order.id,
  4254. // record_time: this.record_date,
  4255. // admin_user_id: this.$store.getters.xt_user.user.id,
  4256. // patient_id: this.patientInfo.id,
  4257. // his_patient_id: this.hisPatientInfo.id
  4258. // }
  4259. // })
  4260. // .then(function(response) {
  4261. // if (response.data.state == 0) {
  4262. // that.$message.error(response.data.msg)
  4263. // return false
  4264. // } else {
  4265. // if (response.data.data.failed_code == -10) {
  4266. // that.$confirm(response.data.data.msg, '医保错误信息', {
  4267. // confirmButtonText: '确 定',
  4268. // type: 'warning'
  4269. // }).then(() => {
  4270. //
  4271. // }).catch(() => {
  4272. // })
  4273. // } else {
  4274. // that.changeRadioAndPatient(1)
  4275. // that.$message({ message: '退号成功', type: 'success' })
  4276. // }
  4277. // }
  4278. // })
  4279. // .catch(function(error) {
  4280. // })
  4281. // }).catch(() => {
  4282. // })
  4283. // }
  4284. // break
  4285. // }
  4286. // }
  4287. }
  4288. ,
  4289. mounted() {
  4290. const that = this
  4291. window.onresize = () => {
  4292. return (() => {
  4293. window.fullHeight = document.documentElement.clientHeight
  4294. that.fullHeight = window.fullHeight
  4295. })()
  4296. }
  4297. }
  4298. ,
  4299. watch: {
  4300. fullHeight(val) {
  4301. if (!this.timer) {
  4302. this.fullHeight = val
  4303. const tableHeight = val - 243
  4304. this.tableHeight = tableHeight
  4305. this.timer = true
  4306. const that = this
  4307. setTimeout(function() {
  4308. that.timer = false
  4309. }, 400)
  4310. }
  4311. }
  4312. }
  4313. }
  4314. </script>
  4315. <style lang="scss" scoped>
  4316. .app-container {
  4317. height: 100%;
  4318. }
  4319. .outpatientChargesManagement {
  4320. height: 100%;
  4321. display: flex;
  4322. flex-direction: column;
  4323. .mainLeft {
  4324. width: 200px;
  4325. height: 100%;
  4326. display: flex;
  4327. flex-direction: column;
  4328. padding-top: 20px;
  4329. .el-radio {
  4330. margin-right: 5px;
  4331. }
  4332. }
  4333. .mainCell {
  4334. display: flex;
  4335. align-items: center;
  4336. }
  4337. .fixedCell {
  4338. position: fixed;
  4339. z-index: 99;
  4340. right: 42px;
  4341. background: #fff;
  4342. display: flex;
  4343. justify-content: space-between;
  4344. }
  4345. .mainRight {
  4346. margin-left: 10px;
  4347. flex: 1;
  4348. height: 100%;
  4349. display: flex;
  4350. flex-direction: column;
  4351. overflow-y: auto;
  4352. .cellSpan {
  4353. min-width: 80px;
  4354. display: inline-block;
  4355. margin-right: 10px;
  4356. }
  4357. }
  4358. .tabsBox {
  4359. position: relative;
  4360. overflow-y: auto;
  4361. height: 450px;
  4362. .el-tabs__item {
  4363. padding: 0 10px;
  4364. }
  4365. }
  4366. .addTab {
  4367. position: absolute;
  4368. right: 6px;
  4369. top: 3px;
  4370. z-index: 20;
  4371. }
  4372. .mainCenter {
  4373. display: flex;
  4374. flex: 1;
  4375. height: 100%;
  4376. }
  4377. .costBox {
  4378. width: 100%;
  4379. height: 60px;
  4380. background: #fff;
  4381. position: absolute;
  4382. bottom: 0;
  4383. display: flex;
  4384. align-items: center;
  4385. justify-content: space-between;
  4386. }
  4387. .centerLeft {
  4388. flex: 1;
  4389. display: flex;
  4390. flex-direction: column;
  4391. position: relative;
  4392. overflow-y: auto;
  4393. }
  4394. .preTabs {
  4395. height: 100%;
  4396. display: flex;
  4397. flex-direction: column;
  4398. .el-tab-pane {
  4399. height: auto !important;
  4400. }
  4401. }
  4402. .settlementTabs {
  4403. flex: 1;
  4404. width: 100%;
  4405. .el-tab-pane {
  4406. height: 100%;
  4407. }
  4408. .el-tabs__content {
  4409. height: 100%;
  4410. }
  4411. }
  4412. .centerRight {
  4413. width: 300px;
  4414. margin-left: 10px;
  4415. display: flex;
  4416. flex-direction: column;
  4417. overflow-y: auto;
  4418. }
  4419. .RP {
  4420. color: #409EFF;
  4421. font-size: 20px;
  4422. margin-bottom: 5px;
  4423. }
  4424. .centerRightTitle {
  4425. color: #409EFF;
  4426. }
  4427. .basicUl {
  4428. border-top: 1px solid #e5e5e5;
  4429. border-left: 1px solid #e5e5e5;
  4430. display: flex;
  4431. flex-wrap: wrap;
  4432. li {
  4433. border-bottom: 1px solid #e5e5e5;
  4434. border-right: 1px solid #e5e5e5;
  4435. width: 100%;
  4436. min-height: 38px;
  4437. /* line-height: 38px;
  4438. text-indent: 5px; */
  4439. font-size: 14px;
  4440. display: flex;
  4441. align-items: center;
  4442. padding: 5px;
  4443. box-sizing: border-box;
  4444. }
  4445. }
  4446. }
  4447. </style>
  4448. <style lang="scss">
  4449. #tab-more {
  4450. .el-icon-close {
  4451. display: none;
  4452. }
  4453. }
  4454. .settlementTabs {
  4455. .el-tabs__content {
  4456. height: 90%;
  4457. }
  4458. }
  4459. .preTabs {
  4460. .el-tabs__content {
  4461. flex: 1;
  4462. overflow-y: auto;
  4463. padding: 5px 0 5px 5px;
  4464. }
  4465. }
  4466. .centerDialog {
  4467. .el-dialog__body {
  4468. max-height: calc(100vh - 100px) !important;
  4469. padding: 0 20px;
  4470. }
  4471. }
  4472. ::-webkit-scrollbar {
  4473. height: 20px;
  4474. }
  4475. </style>