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

outpatientChargesManagement.vue 138KB

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