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

outpatientChargesManagement.vue 175KB

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