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

outpatientChargesManagement.vue 120KB

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