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

outpatientChargesManagement.vue 141KB

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