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

outpatientChargesManagement.vue 144KB

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