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

outpatientChargesManagement.vue 218KB

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