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

outpatientChargesManagement.vue 230KB

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