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

outpatientChargesManagement.vue 132KB

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