summary.vue 130KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069
  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">
  7. <div style=" display: flex; justify-content: space-between; margin-bottom: 10px;">
  8. <div class="content_top" style="margin-right: 10px;">
  9. <el-input style="width: 120px"
  10. v-model="keywords" @input="searchAction"
  11. @keyup.enter.native="searchAction"
  12. class="filter-item" placeholder="请输入患者姓名"
  13. />
  14. <el-button class="filter-item" type="primary" @click="searchAction">
  15. 搜索
  16. </el-button>
  17. <el-select v-model="sort_type"
  18. placeholder="请选择"
  19. style="width: 120px;"
  20. @change="changeSortType"
  21. >
  22. <el-option
  23. v-for="(item, index) in sort_types"
  24. :key="index"
  25. :label="item.label"
  26. :value="item.value"
  27. >
  28. </el-option>
  29. </el-select>
  30. <el-select v-model="sch_type" placeholder="请选择班次" @change="handleSchType" style="width: 120px;">
  31. <el-option label="全部" value="0"></el-option>
  32. <el-option label="上午" value="1"></el-option>
  33. <el-option label="下午" value="2"></el-option>
  34. <el-option label="晚上" value="3"></el-option>
  35. </el-select>
  36. <el-select v-model="zoneVal" placeholder="请选择分区" style="width: 120px;" @change="handleZoneChange">
  37. <el-option
  38. v-for="item in zone_options"
  39. :key="item.id"
  40. :label="item.text"
  41. :value="item.id">
  42. </el-option>
  43. </el-select>
  44. </div>
  45. <div class="content_top">
  46. <el-button
  47. size="small" type="primary" @click="query">查询
  48. </el-button>
  49. <el-button
  50. v-if="$store.getters.xt_user.org_id == 10138 || $store.getters.xt_user.org_id == 10278 ||
  51. $store.getters.xt_user.org_id == 10610 || $store.getters.xt_user.org_id == 0"
  52. size="small" type="primary" @click="batch_print_settlte">批量打印结算单
  53. </el-button>
  54. <el-button size="small" type="primary" @click="export_detail"
  55. >报表下载
  56. </el-button
  57. >
  58. <el-button v-if="$store.getters.xt_user.org_id == 10106 || $store.getters.xt_user.org_id == 0" size="small"
  59. type="primary" @click="export_detail_ten">报表下载2
  60. </el-button>
  61. <el-button v-if="$store.getters.xt_user.org_id == 10318 || $store.getters.xt_user.org_id == 0" size="small"
  62. type="primary" @click="export_detail_ten_two">报表下载3
  63. </el-button>
  64. <el-button size="small" type="primary"
  65. @click="export_detail_ten_five">导出就诊凭证类型人员
  66. </el-button>
  67. </div>
  68. </div>
  69. <div style=" display: flex; justify-content: space-between; margin-bottom: 10px;">
  70. <div class="content_top" style="margin-right: 10px;">
  71. <el-date-picker size="small" v-model="start_time" prefix-icon="el-icon-date"
  72. @change="handleStartTimeChange":editable="false" :clearable="false"
  73. style="width: 150px;"
  74. type="date"
  75. placeholder="选择开始日期"
  76. format="yyyy-MM-dd"
  77. value-format="yyyy-MM-dd"
  78. align="right"
  79. ></el-date-picker>
  80. <span style="text-align: center;">-</span>
  81. <el-date-picker
  82. size="small"
  83. v-model="end_time"
  84. prefix-icon="el-icon-date"
  85. @change="handleEndTimeChange"
  86. :editable="false"
  87. :clearable="false"
  88. style="width: 150px; "
  89. type="date"
  90. placeholder="选择结束日期"
  91. format="yyyy-MM-dd"
  92. value-format="yyyy-MM-dd"
  93. align="right"
  94. ></el-date-picker>
  95. <el-select size="small" v-model="staff" placeholder="请选择缴费人员"
  96. style="width:120px;" >
  97. <el-option
  98. v-for="item,index in admins"
  99. :key="index"
  100. :label="item.user_name"
  101. :value="item.user_name">
  102. </el-option>
  103. </el-select>
  104. <el-select v-model="medTypeVal" @change="handleMedChange"
  105. placeholder="请选择医疗类别" style="width: 120px;"
  106. >
  107. <el-option
  108. v-for="item in med_options"
  109. :key="item.id"
  110. :label="item.text"
  111. :value="item.id">
  112. </el-option>
  113. </el-select>
  114. </div>
  115. <div class="content_button">
  116. <el-button size="small" type="primary" @click="export_detail_three" v-if="$store.getters.xt_user.org_id == 10265 || $store.getters.xt_user.org_id == 0">报表下载12</el-button>
  117. <el-button size="small" type="primary" @click="accounts_click()">门诊结账</el-button>
  118. <el-button size="small" type="primary" @click="export_detail_six">诊疗下载</el-button>
  119. </div>
  120. </div>
  121. <div style=" display: flex; justify-content: space-between; margin-bottom: 10px;">
  122. <div class="content_top">
  123. <el-date-picker size="small"
  124. v-model="pay_time"
  125. prefix-icon="el-icon-date"
  126. :editable="false"
  127. :clearable="false"
  128. style="width:250px; "
  129. type="datetime"
  130. placeholder="选择缴费日期"
  131. format="yyyy-MM-dd HH:mm:ss"
  132. value-format="yyyy-MM-dd HH:mm:ss"
  133. align="right"
  134. ></el-date-picker>
  135. </div>
  136. <div class="content_top"></div>
  137. </div>
  138. <el-table
  139. :data="tableData"
  140. border
  141. style="width: 100%"
  142. :row-style="{ color: '#303133' }"
  143. @selection-change="handleSelectionChange"
  144. :header-cell-style="{
  145. backgroundColor: 'rgb(245, 247, 250)',
  146. color: '#606266',
  147. }"
  148. highlight-current-row
  149. height="calc(100vh - 300px)"
  150. >
  151. <el-table-column align="center" type="selection" width="55"></el-table-column>
  152. <el-table-column
  153. prop="date"
  154. label="序号"
  155. width="40"
  156. align="center"
  157. type="index"
  158. >
  159. </el-table-column>
  160. <el-table-column align="center" width="80" prop="name" label="就诊号">
  161. <template slot-scope="scope">{{ scope.row.mdtrt_id }}</template>
  162. </el-table-column>
  163. <el-table-column align="center" width="80" prop="name" label="患者名字">
  164. <template slot-scope="scope">{{ scope.row.patient.name }}</template>
  165. </el-table-column>
  166. <el-table-column align="center" width="60" prop="name" label="患者性别">
  167. <template slot-scope="scope">{{ scope.row.patient.gender == 1 ? '男':'女' }}</template>
  168. </el-table-column>
  169. <el-table-column align="center" width="60" prop="name" label="患者年龄">
  170. <template slot-scope="scope">{{getAge(scope.row.patient.id_card_no)}}</template>
  171. </el-table-column>
  172. <!--<el-table-column align="center" prop="name" label="患者类型">-->
  173. <!--<template slot-scope="scope"></template>-->
  174. <!--</el-table-column>-->
  175. <el-table-column align="center" width="80" prop="name" label="应收金额">
  176. <template slot-scope="scope">{{
  177. scope.row.medfee_sumamt.toFixed(2)
  178. }}
  179. </template>
  180. </el-table-column>
  181. <el-table-column align="center" width="80" prop="name" label="实收金额">
  182. <template slot-scope="scope">{{
  183. scope.row.medfee_sumamt.toFixed(2)
  184. }}
  185. </template>
  186. </el-table-column>
  187. <el-table-column align="center" width="70" prop="name" label="科室">
  188. <template slot-scope="scope">{{
  189. scope.row.department_name
  190. }}
  191. </template>
  192. </el-table-column>
  193. <el-table-column align="center" width="90" prop="name" label="医疗类型">
  194. <template slot-scope="scope">
  195. <div>{{ getMedType(scope.row.med_type) }}</div>
  196. </template>
  197. </el-table-column>
  198. <el-table-column align="center" width="60" prop="name" label="收费类型">
  199. <template slot-scope="scope">
  200. <div v-if="scope.row.his_patient.balance_accounts_type != 2">
  201. 医保
  202. </div>
  203. <div v-if="scope.row.his_patient.balance_accounts_type == 2">
  204. 自费
  205. </div>
  206. </template>
  207. </el-table-column>
  208. <el-table-column align="center" width="90" prop="name" label="险种类型">
  209. <template slot-scope="scope">
  210. <div v-if="scope.row.insutype == '390'">
  211. 城乡居民
  212. </div>
  213. <div v-if="scope.row.insutype == '310'">
  214. 职工
  215. </div>
  216. </template>
  217. </el-table-column>
  218. <el-table-column align="center" width="90" prop="name" label="就诊凭证类型">
  219. <template slot-scope="scope">
  220. <div v-if="scope.row.mdtrt_cert_type =='01'">
  221. 医保电子凭证
  222. </div>
  223. <div v-if="scope.row.mdtrt_cert_type =='02'">
  224. 居民身份证
  225. </div>
  226. <div v-if="scope.row.mdtrt_cert_type =='03'">
  227. 社会保障卡
  228. </div>
  229. </template>
  230. </el-table-column>
  231. <el-table-column align="center" width="100" prop="name" label="收费日期">
  232. <template slot-scope="scope">
  233. {{
  234. scope.row.setl_time
  235. ? scope.row.setl_time
  236. : getTimes(scope.row.settle_accounts_date)
  237. }}
  238. </template>
  239. </el-table-column>
  240. <el-table-column align="center" width="70" prop="name" label="收费员">
  241. <template slot-scope="scope">{{
  242. getName(scope.row.creator)
  243. }}
  244. </template>
  245. </el-table-column>
  246. <el-table-column align="center" width="70" prop="name" label="状态">
  247. <template slot-scope="scope">
  248. <div v-if="scope.row.order_status == 1">待结算</div>
  249. <div v-if="scope.row.order_status == 2">已结算</div>
  250. <div v-if="scope.row.order_status == 3">已退费</div>
  251. </template>
  252. </el-table-column>
  253. <el-table-column align="center" prop="name" label="操作">
  254. <template slot-scope="scope">
  255. <el-button class="butt_1" size="mini" type="primary" @click="toDetail(scope.row)"
  256. >详情
  257. </el-button
  258. >
  259. <el-button class="butt_2" size="mini" type="primary" @click="toPrint(scope.row)">
  260. 结算单
  261. </el-button>
  262. <el-button v-if="$store.getters.xt_user.org_id == 10191" class="butt_2" size="mini" type="primary"
  263. @click="tolistPrint(scope.row)">
  264. 结算清单
  265. </el-button>
  266. <el-button
  267. class="butt_2"
  268. size="mini"
  269. type="primary"
  270. @click="uploadInfo(scope.row)"
  271. v-if="scope.row.order_status == 2 && scope.row.result.id == 0"
  272. >
  273. 上传结算清单
  274. </el-button>
  275. <el-button
  276. class="butt_2"
  277. size="mini"
  278. type="primary"
  279. @click="confirmUploadInfo(scope.row)"
  280. v-if="$store.getters.xt_user.org_id == 10265 || $store.getters.xt_user.org_id == 10191"
  281. >
  282. 确认结算清单
  283. </el-button>
  284. <el-button
  285. class="butt_2"
  286. size="mini"
  287. type="primary"
  288. @click="cancelUploadTwo(scope.row)"
  289. v-if="$store.getters.xt_user.org_id == 10265"
  290. >
  291. 取消结算清单
  292. </el-button>
  293. <el-button
  294. class="butt_2"
  295. size="mini"
  296. type="primary"
  297. @click="queryData(scope.row)"
  298. v-if="$store.getters.xt_user.org_id == 10265"
  299. >
  300. 查询结算清单
  301. </el-button>
  302. <el-button
  303. class="butt_2"
  304. size="mini"
  305. type="primary"
  306. @click="cancelUpload(scope.row)"
  307. v-if="$store.getters.xt_user.org_id != 10265 && scope.row.order_status == 2 && scope.row.result.id > 0"
  308. >
  309. 撤销结算清单
  310. </el-button>
  311. <el-button
  312. class="butt_2"
  313. size="mini"
  314. type="primary"
  315. @click="cancelUploadThree(scope.row)"
  316. >
  317. 更改结算清单状态为未提交
  318. </el-button>
  319. <el-button
  320. class="butt_2"
  321. size="mini"
  322. type="primary"
  323. v-if="
  324. scope.row.order_status == 2 &&
  325. $store.getters.xt_user.org_id == 10106
  326. "
  327. @click="settlementPrint(scope.row)"
  328. >结算单
  329. </el-button>
  330. <el-button class="butt_2" size="mini" type="primary" @click="toRefund(scope.row)">
  331. 退费
  332. </el-button>
  333. <el-button
  334. class="butt_2"
  335. size="mini"
  336. type="primary"
  337. @click="invoicePrint(scope.row)"
  338. >打印发票
  339. </el-button>
  340. </template>
  341. </el-table-column>
  342. </el-table>
  343. <el-pagination
  344. @size-change="handleSizeChange"
  345. @current-change="handleCurrentChange"
  346. :page-sizes="[10, 50, 100]"
  347. :page-size="10"
  348. :current-page.sync="page"
  349. background
  350. style="margin-top: 20px; float: right"
  351. layout="total, sizes, prev, pager, next, jumper"
  352. :total="total"
  353. >
  354. </el-pagination>
  355. </div>
  356. <el-dialog
  357. class="centerDialog"
  358. width="1200px"
  359. title="打印"
  360. :visible.sync="statementVisible"
  361. >
  362. <!--<statementPrint ref="print" :paramsObj='orderObj'></statementPrint>-->
  363. <new-statement-print
  364. ref="print"
  365. :paramsObj="orderObj"
  366. ></new-statement-print>
  367. </el-dialog>
  368. <!-- 批量打印 -->
  369. <el-dialog
  370. class="centerDialog"
  371. width="1200px"
  372. title="打印"
  373. :visible.sync="batchStatementVisible"
  374. >
  375. <!-- <batchStatementPrint-->
  376. <!-- ref="batchPrint"-->
  377. <!-- :paramsObj="batchOrderObj"-->
  378. <!-- ></batchStatementPrint>-->
  379. <batch-statement-print
  380. ref="batchPrint"
  381. :paramsObj="batchOrderObj"
  382. ></batch-statement-print>
  383. </el-dialog>
  384. <el-dialog
  385. class="centerDialog"
  386. width="1200px"
  387. title="打印"
  388. :visible.sync="statementListVisible"
  389. >
  390. <!--<statementPrint ref="print" :paramsObj='orderObj'></statementPrint>-->
  391. <statement-list-print ref="printlist" :paramsObj='orderObj'></statement-list-print>
  392. </el-dialog>
  393. <el-dialog
  394. class="centerDialog"
  395. width="900px"
  396. title="打印"
  397. :visible.sync="listVisible"
  398. >
  399. <listPrint></listPrint>
  400. </el-dialog>
  401. <el-dialog
  402. class="centerDialog"
  403. width="900px"
  404. title="打印"
  405. :visible.sync="allListVisible"
  406. >
  407. <allListPrint :paramsObj="paramsObj"></allListPrint>
  408. </el-dialog>
  409. <!--<el-dialog-->
  410. <!--class="centerDialog"-->
  411. <!--width="1200px"-->
  412. <!--title="打印"-->
  413. <!--:visible.sync="statementVisible9504">-->
  414. <!--&lt;!&ndash;<statementPrint ref="print" :paramsObj='orderObj'></statementPrint>&ndash;&gt;-->
  415. <!--&lt;!&ndash;<new-statement-print ref="print" :paramsObj='orderObj9504'></new-statement-print>&ndash;&gt;-->
  416. <!--<new-statement-print-two ref="print" :paramsObj='orderObj9504'></new-statement-print-two>-->
  417. <!--</el-dialog>-->
  418. <el-dialog
  419. class="centerDialog"
  420. width="1200px"
  421. title="打印"
  422. :visible.sync="invoiceVisible"
  423. >
  424. <invoice-print ref="print" :invoiceParams="invoiceParams"></invoice-print>
  425. </el-dialog>
  426. <el-dialog
  427. class="centerDialog"
  428. width="1200px"
  429. title="打印"
  430. :visible.sync="settlementVisible"
  431. >
  432. <settlement-print
  433. ref="print"
  434. :paramsObj="settlementObj"
  435. ></settlement-print>
  436. </el-dialog>
  437. <el-dialog
  438. class="centerDialog"
  439. width="1200px"
  440. title="打印"
  441. :visible.sync="settlementVisible"
  442. >
  443. <settlement-print
  444. ref="print"
  445. :paramsObj="settlementObj"
  446. ></settlement-print>
  447. </el-dialog>
  448. <!-- 门诊结账 -->
  449. <el-dialog
  450. class="centerDialog"
  451. width="70%"
  452. title="打印"
  453. :visible.sync="accounts_click_vi"
  454. >
  455. <div>
  456. <div id="accounts_print">
  457. <div style="text-align: center;font-size: 18px;margin-bottom:20px ;">门诊结账</div>
  458. <div style="margin: auto;">
  459. <div style="margin-bottom: 20px;">
  460. <table class="table" border="1" style="border-collapse: collapse;text-align: center;width: 100%;">
  461. <tr>
  462. <td>起始日期:</td>
  463. <td>{{start_time}}</td>
  464. <td>终止日期:</td>
  465. <td>{{end_time}}</td>
  466. <td>缴款日期:</td>
  467. <td>{{pay_time}}</td>
  468. </tr>
  469. <tr>
  470. <td>起始单号:</td>
  471. <td v-if="tableData2&&tableData2.length > 0">{{tableData2[0].number}}</td>
  472. <td v-else></td>
  473. <td>终止单号:</td>
  474. <td v-if="tableData2&&tableData2.length > 0">{{tableData2[tableData2.length-1].number}}</td>
  475. <td v-else></td>
  476. <td>缴款人员:</td>
  477. <td>{{staff}}</td>
  478. </tr>
  479. <tr>
  480. <td>收费张数:</td>
  481. <td v-if="tableData2">{{tableData2.length}}</td>
  482. <td v-else></td>
  483. <td>作废张数:</td>
  484. <td>0</td>
  485. <td>退费张数:</td>
  486. <td>0</td>
  487. </tr>
  488. <tr>
  489. <td>收费金额:</td>
  490. <td>{{getTotal()}}</td>
  491. <td>作废金额:</td>
  492. <td>0</td>
  493. <td>退费金额:</td>
  494. <td>0</td>
  495. </tr>
  496. <tr>
  497. <td>合计张数:</td>
  498. <td v-if="tableData2">{{tableData2.length}}</td>
  499. <td v-else></td>
  500. <td>合计金额:</td>
  501. <td colspan="3">{{getTotal()}}</td>
  502. </tr>
  503. </table>
  504. </div>
  505. <div style="margin-bottom: 20px;">
  506. <table class="table" border="1" style="border-collapse: collapse;text-align: center;width: 50%;">
  507. <tr>
  508. <td>医保</td>
  509. <td>微信</td>
  510. <td>现金</td>
  511. <td>门诊预存</td>
  512. <td>合计</td>
  513. </tr>
  514. <tr>
  515. <td>{{getYibao()}}</td>
  516. <td>0</td>
  517. <td>{{getPsnCash()}}</td>
  518. <td>0</td>
  519. <td>{{getTotal()}}</td>
  520. </tr>
  521. </table>
  522. </div>
  523. <div>
  524. <table class="table" border="1" style="border-collapse: collapse;text-align: center;width: 100%;">
  525. <tr>
  526. <td>单号</td>
  527. <td>卡号</td>
  528. <td>姓名</td>
  529. <td>年龄</td>
  530. <td>性别</td>
  531. <td>收费金额</td>
  532. <td>收费时间</td>
  533. <td>类型</td>
  534. </tr>
  535. <tr v-for="item in tableData2">
  536. <td>{{item.number}}</td>
  537. <td>{{item.certno}}</td>
  538. <td>{{item.psn_name}}</td>
  539. <td>{{item.patient.age}}</td>
  540. <td v-if="item.gend == 1">男</td>
  541. <td v-if="item.gend != 1">女</td>
  542. <td>{{item.medfee_sumamt}}</td>
  543. <td>{{item.setl_time}}</td>
  544. <td></td>
  545. </tr>
  546. </table>
  547. </div>
  548. </div>
  549. </div>
  550. </div>
  551. <span slot="footer" class="dialog-footer">
  552. <el-button @click="accounts_click_vi = false">取 消</el-button>
  553. <el-button type="primary" @click="accounts_sum">确 定</el-button>
  554. </span>
  555. </el-dialog>
  556. <el-dialog title="修改发票号码" :visible.sync="dialogfapiaoVisible">
  557. <el-input v-model="fapiao_number" type="text"></el-input>
  558. <div slot="footer" class="dialog-footer">
  559. <el-button @click="camcleModifyFaPiaoCode">取 消</el-button>
  560. <el-button type="primary" @click="modifyFaPiaoCode">确 定</el-button>
  561. </div>
  562. </el-dialog>
  563. </div>
  564. </template>
  565. <script>
  566. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  567. import { getDoctorList, getExportConsumeDetailList, getHisOrderList, Refund } from '@/api/his/his'
  568. import { ModifyFapiaoCode } from '@/api/his/his_tools'
  569. // import NewStatementPrint from './newStatementPrint'
  570. import { adminMainView} from "@/api/role/admin";
  571. import NewStatementPrint from './statementPrint.vue'
  572. import listPrint from './listPrint'
  573. import allListPrint from './allListPrint'
  574. import NewStatementPrintTwo from './newStatementPrintTwo'
  575. import { fetchAllAdminUsers } from '@/api/doctor'
  576. import axios from 'axios'
  577. import invoicePrint from './invoicePrint'
  578. import settlementPrint from './settlementPrint'
  579. import { jsGetAge, uParseTime } from '@/utils/tools'
  580. import {
  581. exportOrderInfo,
  582. getAllOrders,
  583. getHisDataFive,
  584. getHisDataSix,
  585. getHisDataThree,
  586. getHisDataTwo,
  587. handleOne,
  588. getHisOrderListtwo,
  589. modifyFapiaoCodetwo
  590. } from '../../api/his/his'
  591. import { handleData10106, handleData10138Two, handleData10318 } from '../../api/his/his_export'
  592. import StatementListPrint from './statementListPrint'
  593. import { getDialysisRecordInitData } from '@/api/dialysis_record'
  594. import BatchStatementPrint from './batchStatementPrint'
  595. import { exportMdtrtCertType } from '../../api/his/his_tools'
  596. const moment = require('moment')
  597. export default {
  598. name: 'OutpatientChargesSummary',
  599. components: {
  600. BatchStatementPrint,
  601. StatementListPrint,
  602. NewStatementPrintTwo,
  603. NewStatementPrint,
  604. BreadCrumb,
  605. listPrint,
  606. allListPrint,
  607. invoicePrint,
  608. settlementPrint
  609. },
  610. data() {
  611. return {
  612. staff:"",
  613. admins:[],
  614. orderObj: {},
  615. batchOrderObj: {},
  616. fapiao_number:"",
  617. med_options: [
  618. { id: 0, text: '全部' },
  619. { id: 11, text: '普通门诊' },
  620. { id: 14, text: '门诊特殊病' }
  621. ],
  622. zone_options: [
  623. { id: 0, text: '全部分区' }
  624. ],
  625. statementListVisible: false,
  626. statementVisible: false,
  627. batchStatementVisible: false,
  628. statementVisible9504: false,
  629. orderObj9504: {},
  630. crumbs: [
  631. { path: false, name: '门诊收费' },
  632. { path: false, name: '项目消费明细汇总' }
  633. ],
  634. tableData: [],
  635. tableData2:[],
  636. selecting_schs: [],
  637. dialogfapiaoVisible:false,
  638. targeOrderId:0,
  639. targeObj:{},
  640. limit: 10,
  641. page: 1,
  642. keywords: '',
  643. sch_type: '0',//班次
  644. zoneVal: 0,//分区
  645. medTypeVal: 0,
  646. start_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  647. end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  648. pay_time:"",
  649. total: '',
  650. doctors: [],
  651. sort_type: 1,
  652. sort_types: [
  653. { value: 1, label: '处方时间' },
  654. { value: 2, label: '结算时间' }
  655. ],
  656. admin_user_id: '',
  657. listVisible: false,
  658. allListVisible: false,
  659. adminUserOptions: [],
  660. invoiceVisible: false,
  661. paramsObj: {},
  662. invoiceParams: {},
  663. settlementVisible: false,
  664. settlementObj: {},
  665. accounts_click_vi:false,
  666. }
  667. },
  668. //判断列表页是否刷新
  669. beforeRouteEnter(to, from, next) {
  670. console.log(from, 'beforeRouteEnter')
  671. if (from.path == '/outpatientCharges/summaryDetail') {
  672. next((vm) => {
  673. vm.page = vm.$store.getters.pagedata.list.page
  674. vm.limit = vm.$store.getters.pagedata.list.limit
  675. vm.keywords = vm.$store.getters.pagedata.list.keywords
  676. vm.start_time = vm.$store.getters.pagedata.list.start_time
  677. vm.end_time = vm.$store.getters.pagedata.list.end_time
  678. vm.admin_user_id = vm.$store.getters.pagedata.list.admin_user_id
  679. vm.p_type = 2
  680. vm.sort_type = vm.$store.getters.pagedata.list.sort_type
  681. setTimeout(() => {
  682. vm.getHisOrderList()
  683. }, 300)
  684. })
  685. } else {
  686. next()
  687. }
  688. },
  689. beforeRouteLeave(to, from, next) {
  690. if (to.path == '/outpatientCharges/summaryDetail') {
  691. console.log(to.path, '路由跳转判断')
  692. this.setStorage()
  693. next()
  694. } else {
  695. next()
  696. }
  697. },
  698. created() {
  699. this.getInitData()
  700. this.fetchAllAdminUsers()
  701. this.getDoctorList()
  702. this.getHisOrderList()
  703. this.getAllstaff()
  704. },
  705. methods: {
  706. query(){
  707. this.getHisOrderList()
  708. },
  709. getAge(UUserCard) {
  710. if (UUserCard != null && UUserCard != '') {
  711. //获取年龄
  712. var myDate = new Date();
  713. var month = myDate.getMonth() + 1;
  714. var day = myDate.getDate();
  715. var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
  716. if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
  717. age++;
  718. }
  719. return age;
  720. }
  721. },
  722. accounts_click(){
  723. let params = {
  724. start_time: this.start_time,
  725. end_time: this.end_time,
  726. }
  727. getHisOrderListtwo(params).then((response) => {
  728. if (response.data.state == 0) {
  729. this.$message.error(response.data.msg)
  730. return false
  731. } else {
  732. this.accounts_click_vi= true
  733. this.tableData2 = response.data.data.order2
  734. }
  735. })
  736. },
  737. getPsnCash(){
  738. let result = 0
  739. if(this.tableData2 != null) {
  740. for (let i = 0; i < this.tableData2.length; i++) {
  741. result = result + this.tableData2[i].psn_cash_pay
  742. }
  743. }
  744. return result.toFixed(2)
  745. },
  746. getYibao(){
  747. let result = 0
  748. if(this.tableData2 != null) {
  749. for (let i = 0; i < this.tableData2.length; i++) {
  750. result = result + this.tableData2[i].fund_pay_sumamt
  751. }
  752. }
  753. return result.toFixed(2)
  754. },
  755. getTotal(){
  756. let result = 0
  757. if(this.tableData2 != null) {
  758. for (let i = 0; i < this.tableData2.length; i++) {
  759. result = result + this.tableData2[i].medfee_sumamt
  760. }
  761. }
  762. return result.toFixed(2)
  763. },
  764. getAllstaff(){
  765. adminMainView()
  766. .then(rs => {
  767. var resp = rs.data;
  768. if (resp.state === 1) {
  769. var adminData = resp.data.admins
  770. this.admins.push(...adminData);
  771. } else {
  772. this.$message.error(resp.msg);
  773. }
  774. })
  775. .catch(err => {
  776. this.$message.error(err);
  777. });
  778. },
  779. // 门诊结账
  780. accounts_sum(){
  781. const style = '@media print {#accounts_print{font-size:15px} .table tr td{padding:5px 0;}}'
  782. printJS({
  783. printable: "accounts_print",
  784. type: "html",
  785. style: style,
  786. scanStyles: false
  787. });
  788. },
  789. handleSelectionChange(val) {
  790. this.selecting_schs = val
  791. },
  792. handleSchType(val) {
  793. this.sch_type = val
  794. // this.getHisOrderList()
  795. }, handleMedChange() {
  796. // this.getHisOrderList()
  797. },
  798. handleZoneChange(val) {
  799. this.zoneVal = val
  800. // this.getHisOrderList()
  801. },
  802. getInitData: function() {
  803. getDialysisRecordInitData().then((rs) => {
  804. var resp = rs.data
  805. if (resp.state == 1) {
  806. var zones = resp.data.zones
  807. var zone_options = [{ id: 0, text: '全部' }]
  808. for (let z_i = 0; z_i < zones.length; z_i++) {
  809. const zone = zones[z_i]
  810. zone_options.push({ id: zone.id, text: zone.name })
  811. }
  812. this.zone_options = zone_options
  813. } else {
  814. this.$message.error(resp.msg)
  815. }
  816. })
  817. },
  818. setStorage() {
  819. this.$store.commit('SET_PAGEDATA', {
  820. page: this.page,
  821. limit: this.limit,
  822. keywords: this.keywords,
  823. start_time: this.start_time,
  824. end_time: this.end_time,
  825. type: this.admin_user_id || '',
  826. p_type: 2,
  827. sort_type: this.sort_type
  828. })
  829. },
  830. getMedType(med_type) {
  831. var med_type = parseInt(med_type)
  832. switch (med_type) {
  833. case 11:
  834. return '普通门诊'
  835. break
  836. case 12:
  837. return '门诊挂号'
  838. break
  839. case 13:
  840. return '急诊'
  841. break
  842. case 14:
  843. return '门诊特殊病'
  844. break
  845. case 15:
  846. return '门诊统筹'
  847. break
  848. case 16:
  849. return '门诊慢性病'
  850. break
  851. case 21:
  852. return '普通住院'
  853. break
  854. case 140104:
  855. return '城乡门诊特殊病(140104)'
  856. break
  857. case 992102:
  858. return '单病种(992102)'
  859. break
  860. }
  861. },
  862. cancelUploadTwo(row) {
  863. if (this.$store.getters.xt_user.org_id == 10265) {
  864. var that = this
  865. axios
  866. .get('http://127.0.0.1:9532/api/4102', {
  867. params: {
  868. order_id: row.id,
  869. admin_user_id: this.$store.getters.xt_user.user.id,
  870. stas_type: 0
  871. }
  872. })
  873. .then(function(response) {
  874. if (response.data.state == 0) {
  875. that.$message.error(response.data.msg)
  876. return false
  877. } else {
  878. if (response.data.data.failed_code == -10) {
  879. // that.$message.error(response.data.data.msg)
  880. that
  881. .$confirm(response.data.data.msg, '医保错误信息', {
  882. confirmButtonText: '确 定',
  883. type: 'warning'
  884. })
  885. .then(() => {
  886. })
  887. .catch(() => {
  888. })
  889. } else {
  890. that.$message.success('撤销成功')
  891. row.result.id = 0
  892. }
  893. }
  894. })
  895. .catch(function(error) {
  896. })
  897. }
  898. },
  899. cancelUpload(row) {
  900. var that = this
  901. axios
  902. .get('http://127.0.0.1:9532/zh/api/clearsettle', {
  903. params: {
  904. order_id: row.id,
  905. admin_user_id: this.$store.getters.xt_user.user.id
  906. }
  907. })
  908. .then(function(response) {
  909. if (response.data.state == 0) {
  910. that.$message.error(response.data.msg)
  911. return false
  912. } else {
  913. if (response.data.data.failed_code == -10) {
  914. // that.$message.error(response.data.data.msg)
  915. that
  916. .$confirm(response.data.data.msg, '医保错误信息', {
  917. confirmButtonText: '确 定',
  918. type: 'warning'
  919. })
  920. .then(() => {
  921. })
  922. .catch(() => {
  923. })
  924. } else {
  925. that.$message.success('撤销成功')
  926. row.result.id = 0
  927. }
  928. }
  929. })
  930. .catch(function(error) {
  931. })
  932. },
  933. uploadInfo(row) {
  934. var that = this
  935. axios
  936. .get('http://127.0.0.1:9532/api/settlelist/get', {
  937. params: {
  938. order_id: row.id,
  939. admin_user_id: this.$store.getters.xt_user.user.id
  940. }
  941. })
  942. .then(function(response) {
  943. if (response.data.state == 0) {
  944. that.$message.error(response.data.msg)
  945. return false
  946. } else {
  947. if (response.data.data.failed_code == -10) {
  948. // that.$message.error(response.data.data.msg)
  949. that
  950. .$confirm(response.data.data.msg, '医保错误信息', {
  951. confirmButtonText: '确 定',
  952. type: 'warning'
  953. })
  954. .then(() => {
  955. })
  956. .catch(() => {
  957. })
  958. } else {
  959. that.$message.success('上传成功')
  960. row.result.id = response.data.data.result.id
  961. }
  962. }
  963. })
  964. .catch(function(error) {
  965. })
  966. }, export_detail_zzzz() {
  967. handleTeamData({}).then((response) => {
  968. if (response.data.state == 0) {
  969. this.$message.error(response.data.msg)
  970. return false
  971. } else {
  972. let list = []
  973. for (let i = 0; i < response.data.data.ps.length; i++) {
  974. let order = response.data.data.ps[i]
  975. let obj = {
  976. id: order.team_id,
  977. name: order.pn,
  978. sub_id: order.project.id,
  979. sub_name: order.project.project_name
  980. }
  981. list.push(obj)
  982. }
  983. var tarList = []
  984. for (let i = 0; i < list.length; i++) {
  985. let obj = {
  986. '大项id': list[i].id,
  987. '大项名称': list[i].name,
  988. '子项id': list[i].sub_id,
  989. '子项名称': list[i].sub_name
  990. }
  991. tarList.push(obj)
  992. }
  993. import('@/vendor/Export2Excel').then((excel) => {
  994. const tHeader = [
  995. '大项id',
  996. '大项名称',
  997. '子项id',
  998. '子项名称'
  999. ]
  1000. const filterVal = [
  1001. '大项id',
  1002. '大项名称',
  1003. '子项id',
  1004. '子项名称'
  1005. ]
  1006. const data = this.formatJson(filterVal, tarList)
  1007. excel.export_json_to_excel({
  1008. header: tHeader,
  1009. data,
  1010. filename: '消费明细'
  1011. })
  1012. })
  1013. }
  1014. })
  1015. },
  1016. queryData(row) {
  1017. var that = this
  1018. axios
  1019. .get('http://127.0.0.1:9532/api/4103', {
  1020. params: {
  1021. order_id: row.id,
  1022. admin_user_id: this.$store.getters.xt_user.user.id
  1023. }
  1024. })
  1025. .then(function(response) {
  1026. if (response.data.state == 0) {
  1027. that.$message.error(response.data.msg)
  1028. return false
  1029. } else {
  1030. if (response.data.data.failed_code == -10) {
  1031. that
  1032. .$confirm(response.data.data.msg, '医保错误信息', {
  1033. confirmButtonText: '确 定',
  1034. type: 'warning'
  1035. })
  1036. .then(() => {
  1037. })
  1038. .catch(() => {
  1039. })
  1040. } else {
  1041. that
  1042. .$confirm(response.data.data.msg, '医保信息', {
  1043. confirmButtonText: '确 定'
  1044. })
  1045. .then(() => {
  1046. })
  1047. .catch(() => {
  1048. })
  1049. }
  1050. }
  1051. })
  1052. .catch(function(error) {
  1053. })
  1054. }, cancelUploadThree(row) {
  1055. var that = this
  1056. // if(this.$store.getters.xt_user.org_id == 10191){
  1057. axios
  1058. .get('http://127.0.0.1:9532/api/comfirm/upload', {
  1059. params: {
  1060. order_id: row.id,
  1061. admin_user_id: this.$store.getters.xt_user.user.id,
  1062. stas_type: 0
  1063. }
  1064. })
  1065. .then(function(response) {
  1066. if (response.data.state == 0) {
  1067. that.$message.error(response.data.msg)
  1068. return false
  1069. } else {
  1070. if (response.data.data.failed_code == -10) {
  1071. that
  1072. .$confirm(response.data.data.msg, '医保错误信息', {
  1073. confirmButtonText: '确 定',
  1074. type: 'warning'
  1075. })
  1076. .then(() => {
  1077. })
  1078. .catch(() => {
  1079. })
  1080. } else {
  1081. that.$message.success('确认成功')
  1082. row.result.id = response.data.data.result.id
  1083. }
  1084. }
  1085. })
  1086. .catch(function(error) {
  1087. })
  1088. // }
  1089. },
  1090. confirmUploadInfo(row) {
  1091. var that = this
  1092. if (this.$store.getters.xt_user.org_id == 10191) {
  1093. axios
  1094. .get('http://127.0.0.1:9532/api/comfirm/upload', {
  1095. params: {
  1096. order_id: row.id,
  1097. admin_user_id: this.$store.getters.xt_user.user.id,
  1098. stas_type: 1
  1099. }
  1100. })
  1101. .then(function(response) {
  1102. if (response.data.state == 0) {
  1103. that.$message.error(response.data.msg)
  1104. return false
  1105. } else {
  1106. if (response.data.data.failed_code == -10) {
  1107. that
  1108. .$confirm(response.data.data.msg, '医保错误信息', {
  1109. confirmButtonText: '确 定',
  1110. type: 'warning'
  1111. })
  1112. .then(() => {
  1113. })
  1114. .catch(() => {
  1115. })
  1116. } else {
  1117. that.$message.success('确认成功')
  1118. row.result.id = response.data.data.result.id
  1119. }
  1120. }
  1121. })
  1122. .catch(function(error) {
  1123. })
  1124. } else {
  1125. axios
  1126. .get('http://127.0.0.1:9532/api/4102', {
  1127. params: {
  1128. order_id: row.id,
  1129. admin_user_id: this.$store.getters.xt_user.user.id,
  1130. stas_type: 1
  1131. }
  1132. })
  1133. .then(function(response) {
  1134. if (response.data.state == 0) {
  1135. that.$message.error(response.data.msg)
  1136. return false
  1137. } else {
  1138. if (response.data.data.failed_code == -10) {
  1139. that
  1140. .$confirm(response.data.data.msg, '医保错误信息', {
  1141. confirmButtonText: '确 定',
  1142. type: 'warning'
  1143. })
  1144. .then(() => {
  1145. })
  1146. .catch(() => {
  1147. })
  1148. } else {
  1149. that.$message.success('确认成功')
  1150. row.result.id = response.data.data.result.id
  1151. }
  1152. }
  1153. })
  1154. .catch(function(error) {
  1155. })
  1156. }
  1157. },
  1158. fetchAllAdminUsers() {
  1159. fetchAllAdminUsers().then((response) => {
  1160. if (response.data.state == 1) {
  1161. this.adminUserOptions = response.data.data.users
  1162. }
  1163. })
  1164. },
  1165. getName(admin_user_id) {
  1166. for (let i = 0; i < this.adminUserOptions.length; i++) {
  1167. if (this.adminUserOptions[i].id == admin_user_id) {
  1168. return this.adminUserOptions[i].name
  1169. }
  1170. }
  1171. },
  1172. toRefund(row) {
  1173. if (row.his_patient.balance_accounts_type == 2) {
  1174. this.$confirm('是否退费', '退费', {
  1175. confirmButtonText: '确 定',
  1176. cancelButtonText: '取 消',
  1177. type: 'warning'
  1178. })
  1179. .then(() => {
  1180. let params = {
  1181. order_id: row.id,
  1182. patient_id: row.patient_id,
  1183. record_time: this.getTimes(row.settle_accounts_date)
  1184. }
  1185. Refund(params).then((response) => {
  1186. if (response.data.state == 0) {
  1187. this.$message.error(response.data.msg)
  1188. return false
  1189. } else {
  1190. this.$message({ message: '退费成功', type: 'success' })
  1191. this.getHisOrderList()
  1192. }
  1193. })
  1194. })
  1195. .catch(() => {
  1196. })
  1197. } else {
  1198. var that = this
  1199. this.$confirm('是否退费', '退费', {
  1200. confirmButtonText: '确 定',
  1201. cancelButtonText: '取 消',
  1202. type: 'warning'
  1203. })
  1204. .then(() => {
  1205. let params = {
  1206. order_id: row.id,
  1207. patient_id: row.patient_id,
  1208. record_time: that.getTimes(row.settle_accounts_date),
  1209. admin_user_id: that.$store.getters.xt_user.user.id
  1210. }
  1211. axios
  1212. .get('http://127.0.0.1:9532/api/refund/post', {
  1213. params: params
  1214. })
  1215. .then(function(response) {
  1216. if (response.data.state == 0) {
  1217. that.$message.error(response.data.msg)
  1218. return false
  1219. } else {
  1220. if (response.data.data.failed_code == -10) {
  1221. // that.$message.error(response.data.data.msg)
  1222. that
  1223. .$confirm(response.data.data.msg, '医保错误信息', {
  1224. confirmButtonText: '确 定',
  1225. type: 'warning'
  1226. })
  1227. .then(() => {
  1228. })
  1229. .catch(() => {
  1230. })
  1231. } else {
  1232. that.$message({
  1233. message: '退费成功',
  1234. type: 'success',
  1235. duration: 5000
  1236. })
  1237. that.getHisOrderList()
  1238. }
  1239. }
  1240. })
  1241. .catch(function(error) {
  1242. })
  1243. })
  1244. .catch(() => {
  1245. })
  1246. }
  1247. }, tolistPrint(row) {
  1248. // if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10138) {
  1249. // if (row.mdtrt_id.indexOf('H') > -1) {
  1250. // this.statementVisible9504 = true
  1251. // let obj = {
  1252. // order_id: row.id,
  1253. // patient_id: row.patient_id,
  1254. // record_time: this.getTimes(row.settle_accounts_date),
  1255. // admin_user_id: this.$store.getters.xt_user.user.id
  1256. // }
  1257. // this.orderObj9504 = obj
  1258. // } else {
  1259. //
  1260. // this.statementVisible9504 = true
  1261. // let obj = {
  1262. // order_id: row.id,
  1263. // patient_id: row.patient_id,
  1264. // record_time: this.getTimes(row.settle_accounts_date),
  1265. // admin_user_id: this.$store.getters.xt_user.user.id,
  1266. // balance_accounts_type: 2
  1267. // }
  1268. // this.orderObj9504 = obj
  1269. // }
  1270. //
  1271. // } else {
  1272. this.statementListVisible = true
  1273. let obj = {
  1274. order_id: row.id,
  1275. settle_type: row.settle_type,
  1276. start_time: row.settle_start_time,
  1277. end_time: row.settle_end_time,
  1278. balance_accounts_type: row.his_patient.balance_accounts_type
  1279. }
  1280. this.orderObj = obj
  1281. },
  1282. toPrint(row) {
  1283. // if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10138) {
  1284. // if (row.mdtrt_id.indexOf('H') > -1) {
  1285. // this.statementVisible9504 = true
  1286. // let obj = {
  1287. // order_id: row.id,
  1288. // patient_id: row.patient_id,
  1289. // record_time: this.getTimes(row.settle_accounts_date),
  1290. // admin_user_id: this.$store.getters.xt_user.user.id
  1291. // }
  1292. // this.orderObj9504 = obj
  1293. // } else {
  1294. //
  1295. // this.statementVisible9504 = true
  1296. // let obj = {
  1297. // order_id: row.id,
  1298. // patient_id: row.patient_id,
  1299. // record_time: this.getTimes(row.settle_accounts_date),
  1300. // admin_user_id: this.$store.getters.xt_user.user.id,
  1301. // balance_accounts_type: 2
  1302. // }
  1303. // this.orderObj9504 = obj
  1304. // }
  1305. //
  1306. // } else {
  1307. var balance_accounts_type = row.his_patient.balance_accounts_type
  1308. if (row.is_medicine_insurance == 1){
  1309. balance_accounts_type = 1
  1310. }else{
  1311. balance_accounts_type = 2
  1312. }
  1313. this.statementVisible = true
  1314. let obj = {
  1315. order_id: row.id,
  1316. settle_type: row.settle_type,
  1317. start_time: row.settle_start_time,
  1318. end_time: row.settle_end_time,
  1319. balance_accounts_type:balance_accounts_type
  1320. }
  1321. this.orderObj = obj
  1322. },
  1323. settlementPrint(row) {
  1324. this.settlementVisible = true
  1325. let obj = {
  1326. order_id: row.id
  1327. }
  1328. this.settlementObj = obj
  1329. },
  1330. export_detail_two() {
  1331. let params = {}
  1332. getHisDataTwo(params).then((response) => {
  1333. if (response.data.state == 0) {
  1334. this.$message.error(response.data.msg)
  1335. return false
  1336. } else {
  1337. let list = []
  1338. console.log(response.data.data.order)
  1339. for (let i = 0; i < response.data.data.order.length; i++) {
  1340. let order = response.data.data.order[i]
  1341. for (let b = 0; b < order.info.length; b++) {
  1342. let obj = {
  1343. index: b + 1,
  1344. org_name: '肇庆三鹤血液透析中心',
  1345. name: order.psn_name,
  1346. id_card_no: order.certno,
  1347. level: '未定级',
  1348. psn_type: order.psn_type,
  1349. date: '202年3月',
  1350. start_time: order.his.in_hosptial_time,
  1351. end_time: order.his.out_hosptial_time,
  1352. total: order.info[b].det_item_fee_sumamt,
  1353. fund_total: order.info[b].inscp_scp_amt,
  1354. patient_id: order.info[b].patient_id,
  1355. dialysis_time: this.getTimes(order.info[b].upload_date)
  1356. }
  1357. // if (order.info[b].advice_id > 0 && order.info[b].project_id == 0) {
  1358. // obj["dialysis_time"] = this.getTimes(order.info[b].advice_date)
  1359. // } else if (order.info[b].advice_id == 0 && order.info[b].project_id > 0) {
  1360. // obj["dialysis_time"] = this.getTimes(order.info[b].record_date)
  1361. // }
  1362. if (order.psn_type == '11') {
  1363. obj['psn_type'] = '职工在职'
  1364. } else if (order.psn_type == '12') {
  1365. obj['psn_type'] = '职工退休'
  1366. } else if (order.psn_type == '13') {
  1367. obj['psn_type'] = '离休'
  1368. } else if (order.psn_type == '14') {
  1369. obj['psn_type'] = '居民医保'
  1370. } else if (order.psn_type == '15') {
  1371. obj['psn_type'] = '居民医保'
  1372. } else if (order.psn_type == '16') {
  1373. obj['psn_type'] = '居民医保'
  1374. }
  1375. list.push(obj)
  1376. }
  1377. }
  1378. console.log(list)
  1379. var new_list = this.unique_two(list)
  1380. for (let i = 0; i < new_list.length; i++) {
  1381. let total = 0
  1382. let fund_total = 0
  1383. for (let b = 0; b < list.length; b++) {
  1384. if (new_list[i].patient_id == list[b].patient_id && new_list[i].dialysis_time == list[b].dialysis_time) {
  1385. total = total + list[b].total
  1386. fund_total = fund_total + list[b].fund_total
  1387. }
  1388. }
  1389. new_list[i].total = total.toFixed(2)
  1390. new_list[i].fund_total = fund_total.toFixed(2)
  1391. }
  1392. console.log(new_list)
  1393. var tarList = []
  1394. for (let i = 0; i < new_list.length; i++) {
  1395. let obj = {
  1396. '序号': i + 1,
  1397. '医疗机构名称': new_list[i].org_name,
  1398. '姓名': new_list[i].name,
  1399. '身份证号': new_list[i].id_card_no,
  1400. '医院等级': new_list[i].level,
  1401. '参保类型': new_list[i].psn_type,
  1402. '费用所属期': new_list[i].date,
  1403. '开始就医时间': new_list[i].start_time,
  1404. '结束就医时间': new_list[i].end_time,
  1405. '透析日期': new_list[i].dialysis_time,
  1406. '本次透析医疗总金额': new_list[i].total,
  1407. '本次透析医保结算费用金额': new_list[i].fund_total
  1408. }
  1409. tarList.push(obj)
  1410. }
  1411. import('@/vendor/Export2Excel').then((excel) => {
  1412. const tHeader = [
  1413. '序号',
  1414. '医疗机构名称',
  1415. '姓名',
  1416. '身份证号',
  1417. '医院等级',
  1418. '参保类型',
  1419. '费用所属期',
  1420. '开始就医时间',
  1421. '结束就医时间',
  1422. '透析日期',
  1423. '本次透析医疗总金额',
  1424. '本次透析医保结算费用金额'
  1425. ]
  1426. const filterVal = [
  1427. '序号',
  1428. '医疗机构名称',
  1429. '姓名',
  1430. '身份证号',
  1431. '医院等级',
  1432. '参保类型',
  1433. '费用所属期',
  1434. '开始就医时间',
  1435. '结束就医时间',
  1436. '透析日期',
  1437. '本次透析医疗总金额',
  1438. '本次透析医保结算费用金额'
  1439. ]
  1440. const data = this.formatJson(filterVal, tarList)
  1441. excel.export_json_to_excel({
  1442. header: tHeader,
  1443. data,
  1444. filename: '消费明细'
  1445. })
  1446. })
  1447. }
  1448. })
  1449. }, getItemTypeName(order_infos, id, type) {
  1450. console.log(type)
  1451. var name = ''
  1452. for (let i = 0; i < order_infos.length; i++) {
  1453. if (type == 1) {
  1454. if (order_infos[i].advice_id == id) {
  1455. name = this.getItemName(order_infos[i].med_chrgitm_type)
  1456. }
  1457. } else {
  1458. if (order_infos[i].project_id == id) {
  1459. name = this.getItemName(order_infos[i].med_chrgitm_type)
  1460. }
  1461. }
  1462. }
  1463. return name
  1464. }, getItemName(med_chrgitm_type) {
  1465. switch (med_chrgitm_type) {
  1466. case '01':
  1467. return '床位费'
  1468. break
  1469. case '02':
  1470. return '诊察费'
  1471. break
  1472. case '03':
  1473. return '检查费'
  1474. break
  1475. case '04':
  1476. return '化验费'
  1477. break
  1478. case '05':
  1479. return '治疗费'
  1480. break
  1481. case '06':
  1482. return '手术费'
  1483. break
  1484. case '07':
  1485. return '护理费'
  1486. break
  1487. case '08':
  1488. return '材料费'
  1489. break
  1490. case '09':
  1491. return '西药费'
  1492. break
  1493. case '10':
  1494. return '中药饮片费'
  1495. break
  1496. case '11':
  1497. return '中成药费'
  1498. break
  1499. case '12':
  1500. return '一般诊疗费'
  1501. break
  1502. case '13':
  1503. return '挂号费'
  1504. break
  1505. case '14':
  1506. return '其他费'
  1507. break
  1508. case '0':
  1509. return '其他费'
  1510. break
  1511. }
  1512. },
  1513. export_detail_three() {
  1514. let params = {
  1515. start_time: this.start_time,
  1516. end_time: this.end_time,
  1517. org_id: 10265,
  1518. }
  1519. getHisDataThree(params).then((response) => {
  1520. if (response.data.state == 0) {
  1521. this.$message.error(response.data.msg)
  1522. return false
  1523. } else {
  1524. let list = []
  1525. console.log(response.data.data.order)
  1526. for (let i = 0; i < response.data.data.order.length; i++) {
  1527. let order = response.data.data.order[i]
  1528. let data = this.setMonthPrescription(order.info)
  1529. console.log(data)
  1530. for (let b = 0; b < data.length; b++) {
  1531. let obj = {
  1532. name: order.patient.name,
  1533. id_card_no: order.patient.id_card_no,
  1534. year: order.setl_time.split(' ')[0].split('-')[0],
  1535. month: order.setl_time.split(' ')[0].split('-')[1],
  1536. ddd: this.getTimes(order.settle_accounts_date),
  1537. code: data[b].code,
  1538. pric: data[b].total,
  1539. item_name: data[b].name,
  1540. unit: data[b].unit,
  1541. count: data[b].count,
  1542. item_type_name: this.getItemTypeName(order.info, data[b].id, data[b].type),
  1543. pric_two: data[b].pric
  1544. }
  1545. if (order.insutype == '310') {
  1546. obj['insutype'] = '职工'
  1547. } else if (order.insutype == '390') {
  1548. obj['insutype'] = '城乡'
  1549. }
  1550. list.push(obj)
  1551. }
  1552. }
  1553. var tarList = []
  1554. for (let i = 0; i < list.length; i++) {
  1555. if (list[i].pric > 0) {
  1556. let obj = {
  1557. '姓名': list[i].name,
  1558. '身份证号': list[i].id_card_no,
  1559. '医保类型': list[i].insutype,
  1560. '年': list[i].year,
  1561. '月': list[i].month,
  1562. '时间': list[i].ddd,
  1563. '药品编码': list[i].code,
  1564. '费用类型': list[i].item_type_name,
  1565. '名称': list[i].item_name,
  1566. '单位': list[i].unit,
  1567. '数量': list[i].count,
  1568. '金额': list[i].pric,
  1569. }
  1570. tarList.push(obj)
  1571. }
  1572. }
  1573. import('@/vendor/Export2Excel').then((excel) => {
  1574. const tHeader = [
  1575. '姓名',
  1576. '身份证号',
  1577. '医保类型',
  1578. '年',
  1579. '月',
  1580. '时间',
  1581. '药品编码',
  1582. '费用类型',
  1583. '名称',
  1584. '单位',
  1585. '数量',
  1586. '金额',
  1587. ]
  1588. const filterVal = [
  1589. '姓名',
  1590. '身份证号',
  1591. '医保类型',
  1592. '年',
  1593. '月',
  1594. '时间',
  1595. '药品编码',
  1596. '费用类型',
  1597. '名称',
  1598. '单位',
  1599. '数量',
  1600. '金额',
  1601. ]
  1602. const data = this.formatJson(filterVal, tarList)
  1603. excel.export_json_to_excel({
  1604. header: tHeader,
  1605. data,
  1606. filename: '消费明细'
  1607. })
  1608. })
  1609. }
  1610. })
  1611. },
  1612. export_detail_four() {
  1613. let params = {}
  1614. getHisDataFive(params).then((response) => {
  1615. if (response.data.state == 0) {
  1616. this.$message.error(response.data.msg)
  1617. return false
  1618. } else {
  1619. let list = []
  1620. for (let i = 0; i < response.data.data.order.length; i++) {
  1621. let order = response.data.data.order[i]
  1622. // console.log(data)
  1623. for (let b = 0; b < order.info.length; b++) {
  1624. let obj = {
  1625. org_name: '生命之源血液透析中心',
  1626. name: order.patient.name,
  1627. id_card_no: order.patient.id_card_no,
  1628. jiuyi_date: this.getTimes(order.settle_accounts_date),
  1629. dianhua: order.patient.phone,
  1630. pric: order.info[b].pric,
  1631. cnt: order.info[b].cnt,
  1632. det_item_fee_sumamt: order.info[b].det_item_fee_sumamt,
  1633. zhenduan: '慢性肾衰竭',
  1634. shifouyibao: '是',
  1635. doctor: '高华',
  1636. jiesuanfangshi: '医保',
  1637. jizhangshijian: order.setl_time,
  1638. feiyongheji: order.medfee_sumamt,
  1639. jizhangjine: order.fund_pay_sumamt,
  1640. xianjinheji: order.psn_cash_pay
  1641. }
  1642. if (order.is_medicine_insurance == 1) {
  1643. obj.jiesuanfangshi = '是'
  1644. } else {
  1645. obj.jiesuanfangshi = '否'
  1646. }
  1647. if (order.info[b].advice_id > 0 && order.info[b].project_id == 0) {
  1648. obj['yibaomulucode'] = order.info[b].advices.drug.medical_insurance_number
  1649. obj['yibaomuluname'] = order.info[b].advices.drug.drug_name
  1650. obj['neibumulucode'] = order.info[b].advices.drug.id
  1651. obj['neibumuluname'] = order.info[b].advices.drug.drug_name
  1652. }
  1653. if (order.info[b].advice_id == 0 && order.info[b].project_id > 0) {
  1654. if (order.info[b].project.type == 2) {
  1655. obj['yibaomulucode'] = order.info[b].project.project.medical_code
  1656. obj['yibaomuluname'] = order.info[b].project.project.project_name
  1657. obj['neibumulucode'] = order.info[b].project.project.id
  1658. obj['neibumuluname'] = order.info[b].project.project.project_name
  1659. } else {
  1660. obj['yibaomulucode'] = order.info[b].project.good_info.medical_insurance_number
  1661. obj['yibaomuluname'] = order.info[b].project.good_info.good_name
  1662. obj['neibumulucode'] = order.info[b].project.good_info.id
  1663. obj['neibumuluname'] = order.info[b].project.good_info.good_name
  1664. }
  1665. }
  1666. var thisLen = order.patient.id_card_no.length
  1667. var birth = ''
  1668. if (thisLen == 15) {
  1669. birth = '19' + order.patient.id_card_no.substr(6, 6)
  1670. } else {
  1671. birth = order.patient.id_card_no.substr(6, 8)
  1672. }
  1673. var births =
  1674. birth.substr(0, 4) +
  1675. '-' +
  1676. birth.substr(4, 2) +
  1677. '-' +
  1678. birth.substr(6, 2)
  1679. obj['age'] = jsGetAge(births, '-')
  1680. if (order.patient.gender == 1) {
  1681. obj['gender'] = '男'
  1682. } else {
  1683. obj['gender'] = '女'
  1684. }
  1685. list.push(obj)
  1686. }
  1687. }
  1688. var tarList = []
  1689. for (let i = 0; i < list.length; i++) {
  1690. if (list[i].pric > 0) {
  1691. let obj = {
  1692. '机构编码': list[i].org_name,
  1693. '就诊人姓名': list[i].name,
  1694. '性别': list[i].gender,
  1695. '年龄': list[i].age,
  1696. '身份证号码': list[i].id_card_no,
  1697. '就医日期': list[i].jiuyi_date,
  1698. '电话': list[i].dianhua,
  1699. '医保目录编码': list[i].yibaomulucode,
  1700. '医保目录名称': list[i].yibaomuluname,
  1701. '机构内部编码': list[i].neibumulucode,
  1702. '机构内部名称': list[i].neibumuluname,
  1703. '就诊项目明细': list[i].yibaomuluname,
  1704. '单价': list[i].pric,
  1705. '数量': list[i].cnt,
  1706. '金额': list[i].det_item_fee_sumamt,
  1707. '费用合计': list[i].feiyongheji,
  1708. '记账金额': list[i].jizhangjine,
  1709. '现金合计': list[i].xianjinheji,
  1710. '结算方式': list[i].jiesuanfangshi,
  1711. '接诊医生': list[i].doctor,
  1712. '诊断': list[i].zhenduan,
  1713. '记账时间': list[i].jizhangshijian,
  1714. '是否医保': list[i].shifouyibao
  1715. }
  1716. tarList.push(obj)
  1717. }
  1718. }
  1719. import('@/vendor/Export2Excel').then((excel) => {
  1720. const tHeader = [
  1721. '机构编码',
  1722. '就诊人姓名',
  1723. '性别',
  1724. '年龄',
  1725. '身份证号码',
  1726. '就医日期',
  1727. '电话',
  1728. '医保目录编码',
  1729. '医保目录名称',
  1730. '机构内部编码',
  1731. '机构内部名称',
  1732. '就诊项目明细',
  1733. '单价',
  1734. '数量',
  1735. '金额',
  1736. '费用合计',
  1737. '记账金额',
  1738. '现金合计',
  1739. '结算方式',
  1740. '接诊医生',
  1741. '诊断',
  1742. '记账时间',
  1743. '是否医保'
  1744. ]
  1745. const filterVal = [
  1746. '机构编码',
  1747. '就诊人姓名',
  1748. '性别',
  1749. '年龄',
  1750. '身份证号码',
  1751. '就医日期',
  1752. '电话',
  1753. '医保目录编码',
  1754. '医保目录名称',
  1755. '机构内部编码',
  1756. '机构内部名称',
  1757. '就诊项目明细',
  1758. '单价',
  1759. '数量',
  1760. '金额',
  1761. '费用合计',
  1762. '记账金额',
  1763. '现金合计',
  1764. '结算方式',
  1765. '接诊医生',
  1766. '诊断',
  1767. '记账时间',
  1768. '是否医保'
  1769. ]
  1770. const data = this.formatJson(filterVal, tarList)
  1771. excel.export_json_to_excel({
  1772. header: tHeader,
  1773. data,
  1774. filename: '消费明细'
  1775. })
  1776. })
  1777. }
  1778. })
  1779. },
  1780. export_detail_five() {
  1781. let params = {}
  1782. getHisDataFive(params).then((response) => {
  1783. if (response.data.state == 0) {
  1784. this.$message.error(response.data.msg)
  1785. return false
  1786. } else {
  1787. let list = []
  1788. for (let i = 0; i < response.data.data.order.length; i++) {
  1789. let order = response.data.data.order[i]
  1790. // console.log(data)
  1791. for (let b = 0; b < order.info.length; b++) {
  1792. if (order.info[b].project.project.cost_classify == 3) {
  1793. let obj = {
  1794. p_name: order.psn_name,
  1795. code: order.info[b].project.project.id,
  1796. name: order.info[b].project.project.project_name,
  1797. unit: order.info[b].project.project.unit,
  1798. jiage: order.info[b].det_item_fee_sumamt,
  1799. name_yibao: order.info[b].project.project.project_name,
  1800. guoma: order.info[b].project.project.medical_code,
  1801. zifu: order.info[b].selfpay_prop,
  1802. cnt: order.info[b].cnt,
  1803. pric: order.info[b].pric,
  1804. gerenzifu: order.info[b].fulamt_ownpay_amt + order.info[b].preselfpay_amt,
  1805. baoxiaojine: order.info[b].inscp_scp_amt
  1806. }
  1807. if (order.info[b].chrgitm_lv == '01') {
  1808. obj['yibao_dengji'] = '甲'
  1809. } else if (order.info[b].chrgitm_lv == '02') {
  1810. obj['yibao_dengji'] = '乙'
  1811. } else {
  1812. obj['yibao_dengji'] = '丙'
  1813. }
  1814. list.push(obj)
  1815. }
  1816. }
  1817. }
  1818. console.log(list)
  1819. var tarList = []
  1820. for (let i = 0; i < list.length; i++) {
  1821. let obj = {
  1822. '姓名': list[i].p_name,
  1823. '医保目录编码': list[i].guoma,
  1824. '名称': list[i].name,
  1825. '单位': list[i].unit,
  1826. '价格': list[i].jiage,
  1827. '医保等级': list[i].yibao_dengji,
  1828. '自付比例': list[i].zifu,
  1829. '数量': list[i].cnt,
  1830. '金额': list[i].pric,
  1831. '个人自付': list[i].gerenzifu,
  1832. '报销金额': list[i].baoxiaojine
  1833. }
  1834. tarList.push(obj)
  1835. }
  1836. import('@/vendor/Export2Excel').then((excel) => {
  1837. const tHeader = [
  1838. '姓名',
  1839. '医保目录编码',
  1840. '名称',
  1841. '单位',
  1842. '价格',
  1843. '医保等级',
  1844. '自付比例',
  1845. '数量',
  1846. '金额',
  1847. '个人自付',
  1848. '报销金额'
  1849. ]
  1850. const filterVal = [
  1851. '姓名',
  1852. '医保目录编码',
  1853. '名称',
  1854. '单位',
  1855. '价格',
  1856. '医保等级',
  1857. '自付比例',
  1858. '数量',
  1859. '金额',
  1860. '个人自付',
  1861. '报销金额'
  1862. ]
  1863. const data = this.formatJson(filterVal, tarList)
  1864. excel.export_json_to_excel({
  1865. header: tHeader,
  1866. data,
  1867. filename: '消费明细'
  1868. })
  1869. })
  1870. }
  1871. })
  1872. },
  1873. export_detail_six() {
  1874. let params = {}
  1875. getHisDataSix(params).then((response) => {
  1876. if (response.data.state == 0) {
  1877. this.$message.error(response.data.msg)
  1878. return false
  1879. } else {
  1880. let list = []
  1881. let new_list = []
  1882. for (let i = 0; i < response.data.data.order.length; i++) {
  1883. let order = response.data.data.order[i]
  1884. for (let b = 0; b < order.info.length; b++) {
  1885. new_list.push(order.info[b])
  1886. }
  1887. }
  1888. var infos = this.setMonthPrescriptiontwo(new_list)
  1889. for (let b = 0; b < infos.length; b++) {
  1890. list.push(infos[b])
  1891. }
  1892. var tarList = []
  1893. for (let i = 0; i < list.length; i++) {
  1894. let obj = {
  1895. '周期': '2024年第二季度',
  1896. '类别': '门诊',
  1897. '医保目录编码': list[i].code,
  1898. '医保目录名称': list[i].name,
  1899. '本机构目录编码': list[i].code,
  1900. '本机构目录名称': list[i].name,
  1901. '使用例数': list[i].count,
  1902. '价格': list[i].price
  1903. }
  1904. tarList.push(obj)
  1905. }
  1906. import('@/vendor/Export2Excel').then((excel) => {
  1907. const tHeader = [
  1908. '周期',
  1909. '类别',
  1910. '医保目录编码',
  1911. '医保目录名称',
  1912. '本机构目录编码',
  1913. '本机构目录名称',
  1914. '使用例数',
  1915. '价格'
  1916. ]
  1917. const filterVal = [
  1918. '周期',
  1919. '类别',
  1920. '医保目录编码',
  1921. '医保目录名称',
  1922. '本机构目录编码',
  1923. '本机构目录名称',
  1924. '使用例数',
  1925. '价格'
  1926. ]
  1927. const data = this.formatJson(filterVal, tarList)
  1928. excel.export_json_to_excel({
  1929. header: tHeader,
  1930. data,
  1931. filename: '消费明细'
  1932. })
  1933. })
  1934. }
  1935. })
  1936. }, export_detail_ten_five() {
  1937. let params = {
  1938. start_time: this.start_time,
  1939. end_time: this.end_time
  1940. }
  1941. exportMdtrtCertType(params).then((response) => {
  1942. if (response.data.state == 0) {
  1943. this.$message.error(response.data.msg)
  1944. return false
  1945. } else {
  1946. let new_list = response.data.data.list
  1947. var tarList = []
  1948. for (let i = 0; i < new_list.length; i++) {
  1949. let obj = {
  1950. '姓名': new_list[i].psn_name
  1951. }
  1952. if (new_list[i].mdtrt_cert_type == '01') {
  1953. obj['就诊凭证类型'] = '医保电子凭证'
  1954. } else if (new_list[i].mdtrt_cert_type == '02') {
  1955. obj['就诊凭证类型'] = '身份证'
  1956. } else if (new_list[i].mdtrt_cert_type == '03') {
  1957. obj['就诊凭证类型'] = '社会保障卡'
  1958. }
  1959. tarList.push(obj)
  1960. }
  1961. import('@/vendor/Export2Excel').then((excel) => {
  1962. const tHeader = [
  1963. '姓名',
  1964. '就诊凭证类型',
  1965. ]
  1966. const filterVal = [
  1967. '姓名',
  1968. '就诊凭证类型',
  1969. ]
  1970. const data = this.formatJson(filterVal, tarList)
  1971. excel.export_json_to_excel({
  1972. header: tHeader,
  1973. data,
  1974. filename: '名单'
  1975. })
  1976. })
  1977. }
  1978. })
  1979. }, export_detail_ten_four() {
  1980. let params = {
  1981. start_time: '2022-01-01',
  1982. end_time: '2022-04-30'
  1983. }
  1984. handleOne(params).then((response) => {
  1985. if (response.data.state == 0) {
  1986. this.$message.error(response.data.msg)
  1987. return false
  1988. } else {
  1989. let new_orders = []
  1990. let new_orders_3663 = []
  1991. let new_orders_4059 = []
  1992. let new_orders_4039 = []
  1993. for (let i = 0; i < response.data.data.order.length; i++) {
  1994. let order = response.data.data.order[i]
  1995. for (let b = 0; b < order.info.length; b++) {
  1996. order.info[b]['new_order'] = order
  1997. order.info[b]['new_date'] = this.getTime(order.info[b].pre_time, '{y}-{m}')
  1998. new_orders.push(order.info[b])
  1999. }
  2000. }
  2001. let new_list_four = []
  2002. for (let i = 0; i < new_orders.length; i++) {
  2003. let order = new_orders[i]
  2004. new_list_four.push(order.p_info)
  2005. }
  2006. const obj111 = {}
  2007. new_list_four = new_list_four.reduce((cur, next) => {
  2008. obj111[next.id] ? '' : obj111[next.id] = true && cur.push(next)
  2009. return cur
  2010. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  2011. let new_list_six = []
  2012. for (let i = 0; i < new_list_four.length; i++) {
  2013. let order = new_list_four[i]
  2014. let obj = {
  2015. p_id: order.id,
  2016. patient_id: order.patient_id,
  2017. cur_date: this.getTime(order.record_date, '{y}-{m}'),
  2018. list: []
  2019. }
  2020. for (let b = 0; b < new_orders.length; b++) {
  2021. if (order.id == new_orders[b].p_info.id) {
  2022. obj.list.push(new_orders[b])
  2023. }
  2024. }
  2025. new_list_six.push(obj)
  2026. }
  2027. console.log(new_list_six)
  2028. for (let i = 0; i < new_list_six.length; i++) {
  2029. let order = new_list_six[i]
  2030. let islvguo = false
  2031. for (let b = 0; b < order.list.length; b++) {
  2032. for (let c = 0; c < order.list[b].project.length; c++) {
  2033. if (order.list[b].project[c].project.id == 78 && order.list[b].project[c].project.id != 79 && order.list[b].project[c].project.id != 1074) {
  2034. islvguo = true
  2035. }
  2036. }
  2037. }
  2038. if (islvguo) {
  2039. new_orders_3663.push(order)
  2040. }
  2041. }
  2042. console.log(new_orders_3663)
  2043. for (let i = 0; i < new_list_six.length; i++) {
  2044. let order = new_list_six[i]
  2045. let islvguo = false
  2046. for (let b = 0; b < order.list.length; b++) {
  2047. for (let c = 0; c < order.list[b].project.length; c++) {
  2048. if (order.list[b].project[c].project.id == 1074 && order.list[b].project[c].project.id != 78 && order.list[b].project[c].project.id != 79) {
  2049. islvguo = true
  2050. }
  2051. }
  2052. }
  2053. if (islvguo) {
  2054. new_orders_4059.push(order)
  2055. }
  2056. }
  2057. console.log(new_orders_4059)
  2058. for (let i = 0; i < new_list_six.length; i++) {
  2059. let order = new_list_six[i]
  2060. let islvguo = false
  2061. for (let b = 0; b < order.list.length; b++) {
  2062. for (let c = 0; c < order.list[b].project.length; c++) {
  2063. if (order.list[b].project[c].project.id == 79 && order.list[b].project[c].project.id != 78 && order.list[b].project[c].project.id != 1074) {
  2064. islvguo = true
  2065. }
  2066. }
  2067. }
  2068. if (islvguo) {
  2069. new_orders_4039.push(order)
  2070. }
  2071. }
  2072. console.log(new_orders_4039)
  2073. var months_3663 = []
  2074. for (let i = 0; i < new_orders_3663.length; i++) {
  2075. months_3663.push(new_orders_3663[i].cur_date)
  2076. }
  2077. const obj = {}
  2078. months_3663 = months_3663.reduce((cur, next) => {
  2079. obj[next] ? '' : obj[next] = true && cur.push(next)
  2080. return cur
  2081. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  2082. var months_4039 = []
  2083. for (let i = 0; i < new_orders_4039.length; i++) {
  2084. months_4039.push(new_orders_4039[i].cur_date)
  2085. }
  2086. const obj2 = {}
  2087. months_4039 = months_4039.reduce((cur, next) => {
  2088. obj2[next] ? '' : obj2[next] = true && cur.push(next)
  2089. return cur
  2090. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  2091. var months_4059 = []
  2092. for (let i = 0; i < new_orders_4059.length; i++) {
  2093. months_4059.push(new_orders_4059[i].cur_date)
  2094. }
  2095. const obj3 = {}
  2096. months_4059 = months_4059.reduce((cur, next) => {
  2097. obj3[next] ? '' : obj3[next] = true && cur.push(next)
  2098. return cur
  2099. }, [])
  2100. // 设置cur默认类型为数组,并且初始值为空的数组
  2101. let new_list = []
  2102. for (let i = 0; i < months_3663.length; i++) {
  2103. let obj = {
  2104. cus_date: months_3663[i],
  2105. info: []
  2106. }
  2107. for (let b = 0; b < new_orders_3663.length; b++) {
  2108. if (months_3663[i] == new_orders_3663[b].cur_date) {
  2109. obj.info.push(new_orders_3663[b])
  2110. }
  2111. }
  2112. new_list.push(obj)
  2113. }
  2114. let new_list_two = []
  2115. for (let i = 0; i < months_4039.length; i++) {
  2116. let obj = {
  2117. cus_date: months_4039[i],
  2118. info: []
  2119. }
  2120. for (let b = 0; b < new_orders_4039.length; b++) {
  2121. if (months_4039[i] == new_orders_4039[b].cur_date) {
  2122. obj.info.push(new_orders_4039[b])
  2123. }
  2124. }
  2125. new_list_two.push(obj)
  2126. }
  2127. let new_list_three = []
  2128. for (let i = 0; i < months_4059.length; i++) {
  2129. let obj = {
  2130. cus_date: months_4059[i],
  2131. info: []
  2132. }
  2133. for (let b = 0; b < new_orders_4059.length; b++) {
  2134. if (months_4059[i] == new_orders_4059[b].cur_date) {
  2135. obj.info.push(new_orders_4059[b])
  2136. }
  2137. }
  2138. new_list_three.push(obj)
  2139. }
  2140. console.log(new_list)
  2141. console.log(new_list_two)
  2142. console.log(new_list_three)
  2143. var list_one = []
  2144. var list_two = []
  2145. var list_three = []
  2146. for (let b = 0; b < new_list.length; b++) {
  2147. let obj = {
  2148. cur_date: new_list[b].cus_date,
  2149. order_info: [],
  2150. info_length: new_list[b].info.length
  2151. }
  2152. for (let c = 0; c < new_list[b].info.length; c++) {
  2153. for (let d = 0; d < new_list[b].info[c].list.length; d++) {
  2154. if (new_list[b].info[c].list[d].advices.length > 0 && new_list[b].info[c].list[d].project.length == 0) {
  2155. for (let e = 0; e < new_list[b].info[c].list[d].advices.length; e++) {
  2156. obj.order_info.push(new_list[b].info[c].list[d].advices[e].order_info)
  2157. }
  2158. }
  2159. if (new_list[b].info[c].list[d].advices.length == 0 && new_list[b].info[c].list[d].project.length > 0) {
  2160. for (let e = 0; e < new_list[b].info[c].list[d].project.length; e++) {
  2161. obj.order_info.push(new_list[b].info[c].list[d].project[e].order_info)
  2162. }
  2163. }
  2164. }
  2165. }
  2166. list_one.push(obj)
  2167. }
  2168. for (let b = 0; b < new_list_two.length; b++) {
  2169. let obj = {
  2170. cur_date: new_list_two[b].cus_date,
  2171. order_info: [],
  2172. info_length: new_list_two[b].info.length
  2173. }
  2174. for (let c = 0; c < new_list_two[b].info.length; c++) {
  2175. for (let d = 0; d < new_list_two[b].info[c].list.length; d++) {
  2176. if (new_list_two[b].info[c].list[d].advices.length > 0 && new_list_two[b].info[c].list[d].project.length == 0) {
  2177. for (let e = 0; e < new_list_two[b].info[c].list[d].advices.length; e++) {
  2178. obj.order_info.push(new_list_two[b].info[c].list[d].advices[e].order_info)
  2179. }
  2180. }
  2181. if (new_list_two[b].info[c].list[d].advices.length == 0 && new_list_two[b].info[c].list[d].project.length > 0) {
  2182. for (let e = 0; e < new_list_two[b].info[c].list[d].project.length; e++) {
  2183. obj.order_info.push(new_list_two[b].info[c].list[d].project[e].order_info)
  2184. }
  2185. }
  2186. }
  2187. }
  2188. list_two.push(obj)
  2189. }
  2190. for (let b = 0; b < new_list_three.length; b++) {
  2191. let obj = {
  2192. cur_date: new_list_three[b].cus_date,
  2193. order_info: [],
  2194. info_length: new_list_three[b].info.length
  2195. }
  2196. for (let c = 0; c < new_list_three[b].info.length; c++) {
  2197. for (let d = 0; d < new_list_three[b].info[c].list.length; d++) {
  2198. if (new_list_three[b].info[c].list[d].advices.length > 0 && new_list_three[b].info[c].list[d].project.length == 0) {
  2199. for (let e = 0; e < new_list_three[b].info[c].list[d].advices.length; e++) {
  2200. obj.order_info.push(new_list_three[b].info[c].list[d].advices[e].order_info)
  2201. }
  2202. }
  2203. if (new_list_three[b].info[c].list[d].advices.length == 0 && new_list_three[b].info[c].list[d].project.length > 0) {
  2204. for (let e = 0; e < new_list_three[b].info[c].list[d].project.length; e++) {
  2205. obj.order_info.push(new_list_three[b].info[c].list[d].project[e].order_info)
  2206. }
  2207. }
  2208. }
  2209. }
  2210. list_three.push(obj)
  2211. }
  2212. console.log(list_one)
  2213. console.log(list_two)
  2214. console.log(list_three)
  2215. // list_one = []
  2216. // list_one = list_two
  2217. // list_one = []
  2218. // list_one = list_three
  2219. var tarList = []
  2220. for (let i = 0; i < list_one.length; i++) {
  2221. let obj = {
  2222. '年月': list_one[i].cur_date,
  2223. '总人数': this.getTotalOneOne(list_one[i].order_info),
  2224. '总人次': list_one[i].info_length,
  2225. '总费用': this.getTotalOne(list_one[i].order_info),
  2226. '总治疗费': this.getTotalTwo(list_one[i].order_info),
  2227. '总材料费': this.getTotalThree(list_one[i].order_info),
  2228. '总检查检验费': this.getTotalFour(list_one[i].order_info),
  2229. '总药品费': this.getTotalFive(list_one[i].order_info),
  2230. '人均费用': this.getTotalOne(list_one[i].order_info) / this.getTotalOneOne(list_one[i].order_info),
  2231. '次均费用': this.getTotalOne(list_one[i].order_info) / list_one[i].info_length,
  2232. '次均治疗费': this.getTotalTwo(list_one[i].order_info) / list_one[i].info_length,
  2233. '次均材料费': this.getTotalThree(list_one[i].order_info) / list_one[i].info_length,
  2234. '次均检查检验费': this.getTotalFour(list_one[i].order_info) / list_one[i].info_length,
  2235. '次均药品费': this.getTotalFive(list_one[i].order_info) / list_one[i].info_length
  2236. }
  2237. tarList.push(obj)
  2238. }
  2239. }
  2240. import('@/vendor/Export2Excel').then((excel) => {
  2241. const tHeader = [
  2242. '年月',
  2243. '总人数',
  2244. '总人次',
  2245. '总费用',
  2246. '总治疗费',
  2247. '总材料费',
  2248. '总检查检验费',
  2249. '总药品费',
  2250. '人均费用',
  2251. '次均费用',
  2252. '次均治疗费',
  2253. '次均材料费',
  2254. '次均检查检验费',
  2255. '次均药品费'
  2256. ]
  2257. const filterVal = [
  2258. '年月',
  2259. '总人数',
  2260. '总人次',
  2261. '总费用',
  2262. '总治疗费',
  2263. '总材料费',
  2264. '总检查检验费',
  2265. '总药品费',
  2266. '人均费用',
  2267. '次均费用',
  2268. '次均治疗费',
  2269. '次均材料费',
  2270. '次均检查检验费',
  2271. '次均药品费'
  2272. ]
  2273. const data = this.formatJson(filterVal, tarList)
  2274. excel.export_json_to_excel({
  2275. header: tHeader,
  2276. data,
  2277. filename: '消费明细'
  2278. })
  2279. })
  2280. })
  2281. }, getTotalOneOne(order_info) {
  2282. var patient_ids = []
  2283. for (var i = 0; i < order_info.length; i++) {
  2284. patient_ids.push(order_info[i].patient_id)
  2285. }
  2286. const obj2 = {}
  2287. patient_ids = patient_ids.reduce((cur, next) => {
  2288. obj2[next] ? '' : obj2[next] = true && cur.push(next)
  2289. return cur
  2290. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  2291. return patient_ids.length
  2292. }, getTotalOneTwo(order_info) {
  2293. let total = 0
  2294. for (var i = 0; i < order_info.length; i++) {
  2295. total = total + order_info[i].det_item_fee_sumamt
  2296. }
  2297. return total.toFixed(2)
  2298. }, getTotalOne(order_info) {
  2299. let total = 0
  2300. for (var i = 0; i < order_info.length; i++) {
  2301. total = total + order_info[i].det_item_fee_sumamt
  2302. }
  2303. return total.toFixed(2)
  2304. }, getTotalTwo(order_info) {
  2305. let total = 0
  2306. for (var i = 0; i < order_info.length; i++) {
  2307. if (order_info[i].med_chrgitm_type == '05') {
  2308. total = total + order_info[i].det_item_fee_sumamt
  2309. }
  2310. }
  2311. return total.toFixed(2)
  2312. }, getTotalThree(order_info) {
  2313. let total = 0
  2314. for (var i = 0; i < order_info.length; i++) {
  2315. if (order_info[i].med_chrgitm_type == '08') {
  2316. total = total + order_info[i].det_item_fee_sumamt
  2317. }
  2318. }
  2319. return total.toFixed(2)
  2320. }, getTotalFour(order_info) {
  2321. let total = 0
  2322. for (var i = 0; i < order_info.length; i++) {
  2323. if (order_info[i].med_chrgitm_type == '03' || order_info[i].med_chrgitm_type == '04') {
  2324. total = total + order_info[i].det_item_fee_sumamt
  2325. }
  2326. }
  2327. return total.toFixed(2)
  2328. }, getTotalFive(order_info) {
  2329. let total = 0
  2330. for (var i = 0; i < order_info.length; i++) {
  2331. if (order_info[i].med_chrgitm_type == '09' || order_info[i].med_chrgitm_type == '10' || order_info[i].med_chrgitm_type == '11') {
  2332. total = total + order_info[i].det_item_fee_sumamt
  2333. }
  2334. }
  2335. return total.toFixed(2)
  2336. }, getTotalSix(order_info) {
  2337. }, getTotalSeven(order_info) {
  2338. }, getTotalEigth(order_info) {
  2339. }, getTotalNine(order_info) {
  2340. }, getTotalTen(order_info) {
  2341. }, getTotalTenOne(order_info) {
  2342. },
  2343. export_detail_seven() {
  2344. let params = {}
  2345. handleData10106(params).then((response) => {
  2346. if (response.data.state == 0) {
  2347. this.$message.error(response.data.msg)
  2348. return false
  2349. } else {
  2350. let new_orders = []
  2351. for (let i = 0; i < response.data.data.order.length; i++) {
  2352. let order = response.data.data.order[i]
  2353. let islvguo = false
  2354. for (let b = 0; b < order.info.length; b++) {
  2355. if (order.info[b].project.project.id == 372) {
  2356. islvguo = true
  2357. }
  2358. }
  2359. if (islvguo) {
  2360. new_orders.push(order)
  2361. }
  2362. }
  2363. console.log(new_orders.length)
  2364. let list = []
  2365. for (let i = 0; i < new_orders.length; i++) {
  2366. let order = response.data.data.order[i]
  2367. let obj = {
  2368. md: order.mdtrt_id,
  2369. name: order.patient.name,
  2370. kaichu: this.getTimes(order.settle_start_time),
  2371. xianzhong: '',
  2372. yingshou: order.medfee_sumamt,
  2373. yibaotongchou: order.hifp_pay,
  2374. dabingjijin: order.hifmi_pay,
  2375. yiliaojiuzhu: order.maf_pay,
  2376. gongwujijin: order.cvlserv_pay,
  2377. gerenzhifu: order.psn_part_amt,
  2378. zongjine: order.medfee_sumamt,
  2379. setl_time: order.setl_time,
  2380. jiesuanleixing: '医保',
  2381. xueyetouxilvguo: 480,
  2382. lvhuana: 3,
  2383. zhihuanguan: 40,
  2384. good_name: ''
  2385. }
  2386. if (order.insutype == '390') {
  2387. obj.xianzhong = '城乡'
  2388. } else {
  2389. obj.xianzhong = '职工'
  2390. }
  2391. for (let b = 0; b < order.info.length; b++) {
  2392. if (order.info[b].advice_id == 0 && order.info[b].project_id > 0) {
  2393. if (order.info[b].project.type == 2) {
  2394. if (order.info[b].project.project.id == 254 || order.info[b].project.project.id == 253 || order.info[b].project.project.id == 250 || order.info[b].project.project.id == 249) {
  2395. obj.good_name = this.GetGoodName(order.info[b].project.project.id)
  2396. }
  2397. } else if (order.info[b].project.type == 3) {
  2398. if (order.info[b].project.project.id == 1478 || order.info[b].project.project.id == 1479 || order.info[b].project.project.id == 1482 || order.info[b].project.project.id == 1483 || order.info[b].project.project.id == 2577 || order.info[b].project.project.id == 2578 || order.info[b].project.project.id == 2058 || order.info[b].project.project.id == 2059) {
  2399. obj.good_name = this.GetGoodName(order.info[b].project.good_info.id)
  2400. }
  2401. }
  2402. }
  2403. }
  2404. list.push(obj)
  2405. }
  2406. var tarList = []
  2407. for (let i = 0; i < list.length; i++) {
  2408. if (list[i].good_name.length > 0) {
  2409. let obj = {
  2410. '序号': i + 1,
  2411. '就诊号': list[i].md,
  2412. '患者姓名': list[i].name,
  2413. '开处时间': list[i].kaichu,
  2414. '项目(透析器)': list[i].good_name,
  2415. '血液透析滤过': list[i].xueyetouxilvguo,
  2416. '0.9%氯化钠注射液': list[i].lvhuana,
  2417. '置换液管': list[i].zhihuanguan,
  2418. '险种类型': list[i].xianzhong,
  2419. '应收金额': list[i].yingshou,
  2420. '医保统筹金额': list[i].yibaotongchou,
  2421. '大病基金金额': list[i].dabingjijin,
  2422. '医疗救助金额': list[i].yiliaojiuzhu,
  2423. '公务员基金': list[i].gongwujijin,
  2424. '个人支付基金': list[i].gerenzhifu,
  2425. '总金额': list[i].zongjine,
  2426. '收费时间': list[i].setl_time,
  2427. '结算类型': list[i].jiesuanleixing,
  2428. '收费状态': '已收费'
  2429. }
  2430. tarList.push(obj)
  2431. }
  2432. }
  2433. import('@/vendor/Export2Excel').then((excel) => {
  2434. const tHeader = [
  2435. '序号',
  2436. '就诊号',
  2437. '患者姓名',
  2438. '开处时间',
  2439. '项目(透析器)',
  2440. '血液透析滤过',
  2441. '0.9%氯化钠注射液',
  2442. '置换液管',
  2443. '险种类型',
  2444. '应收金额',
  2445. '医保统筹金额',
  2446. '大病基金金额',
  2447. '医疗救助金额',
  2448. '公务员基金',
  2449. '个人支付基金',
  2450. '总金额',
  2451. '收费时间',
  2452. '结算类型',
  2453. '收费状态'
  2454. ]
  2455. const filterVal = [
  2456. '序号',
  2457. '就诊号',
  2458. '患者姓名',
  2459. '开处时间',
  2460. '项目(透析器)',
  2461. '血液透析滤过',
  2462. '0.9%氯化钠注射液',
  2463. '置换液管',
  2464. '险种类型',
  2465. '应收金额',
  2466. '医保统筹金额',
  2467. '大病基金金额',
  2468. '医疗救助金额',
  2469. '公务员基金',
  2470. '个人支付基金',
  2471. '总金额',
  2472. '收费时间',
  2473. '结算类型',
  2474. '收费状态'
  2475. ]
  2476. const data = this.formatJson(filterVal, tarList)
  2477. excel.export_json_to_excel({
  2478. header: tHeader,
  2479. data,
  2480. filename: '消费明细'
  2481. })
  2482. })
  2483. }
  2484. })
  2485. },
  2486. export_detail_tenone() {
  2487. let params = {
  2488. start_time: this.start_time,
  2489. end_time: this.end_time
  2490. }
  2491. handleData10138Two(params).then((response) => {
  2492. if (response.data.state == 0) {
  2493. this.$message.error(response.data.msg)
  2494. return false
  2495. } else {
  2496. var list = []
  2497. var orders = response.data.data.info
  2498. for (let i = 0; i < orders.length; i++) {
  2499. for (let b = 0; b < orders[i].order.length; b++) {
  2500. for (let c = 0; c < orders[i].order[b].infos.length; c++) {
  2501. let name = orders[i].name
  2502. let date = this.getTimes(orders[i].order[b].settle_accounts_date)
  2503. let code = orders[i].order[b].number
  2504. let cnt = orders[i].order[b].infos[c].cnt
  2505. let pric = orders[i].order[b].infos[c].pric
  2506. let det_item_fee_sumamt = orders[i].order[b].infos[c].det_item_fee_sumamt
  2507. let item_name = ''
  2508. let unit = ''
  2509. let spec = ''
  2510. if (orders[i].order[b].infos[c].advice_id > 0) {
  2511. item_name = orders[i].order[b].infos[c].advices.drug.drug_name
  2512. unit = orders[i].order[b].infos[c].advices.prescribing_number_unit
  2513. spec = (orders[i].order[b].infos[c].advices.drug.dose + orders[i].order[b].infos[c].advices.drug.dose_unit) + '*' + orders[i].order[b].infos[c].advices.drug.min_number + orders[i].order[b].infos[c].advices.drug.min_unit + '/' + orders[i].order[b].infos[c].advices.drug.max_unit
  2514. }
  2515. if (orders[i].order[b].infos[c].project_id > 0 && orders[i].order[b].infos[c].project.type == 2) {
  2516. item_name = orders[i].order[b].infos[c].project.project.project_name
  2517. unit = orders[i].order[b].infos[c].project.project.unit
  2518. spec = orders[i].order[b].infos[c].project.project.project_name
  2519. }
  2520. if (orders[i].order[b].infos[c].project_id > 0 && orders[i].order[b].infos[c].project.type == 3) {
  2521. item_name = orders[i].order[b].infos[c].project.good_info.good_name
  2522. unit = orders[i].order[b].infos[c].project.good_info.packing_unit
  2523. spec = orders[i].order[b].infos[c].project.good_info.specification_name
  2524. }
  2525. let obj = {
  2526. '姓名': name,
  2527. '处方日期': date,
  2528. '费用编码': code,
  2529. '项目名称': item_name,
  2530. '规格': spec,
  2531. '数量': cnt,
  2532. '单位': unit,
  2533. '金额': det_item_fee_sumamt,
  2534. '单价': pric
  2535. }
  2536. list.push(obj)
  2537. }
  2538. }
  2539. }
  2540. import('@/vendor/Export2Excel').then((excel) => {
  2541. const tHeader = [
  2542. '姓名',
  2543. '处方日期',
  2544. '费用编码',
  2545. '项目名称',
  2546. '规格',
  2547. '数量',
  2548. '单位',
  2549. '单价',
  2550. '金额'
  2551. ]
  2552. const filterVal = [
  2553. '姓名',
  2554. '处方日期',
  2555. '费用编码',
  2556. '项目名称',
  2557. '规格',
  2558. '数量',
  2559. '单位',
  2560. '单价',
  2561. '金额'
  2562. ]
  2563. const data = this.formatJson(filterVal, list)
  2564. excel.export_json_to_excel({
  2565. header: tHeader,
  2566. data,
  2567. filename: '消费明细'
  2568. })
  2569. })
  2570. }
  2571. })
  2572. },
  2573. getType(med_chrgitm_type) {
  2574. switch (med_chrgitm_type) {
  2575. case '01':
  2576. return '床位费'
  2577. break
  2578. case '1':
  2579. return '床位费'
  2580. break
  2581. case '02':
  2582. return '诊察费'
  2583. break
  2584. case '2':
  2585. return '诊察费'
  2586. break
  2587. case '03':
  2588. return '检查费'
  2589. break
  2590. case '3':
  2591. return '检查费'
  2592. break
  2593. case '04':
  2594. return '化验费'
  2595. break
  2596. case '4':
  2597. return '化验费'
  2598. break
  2599. case '05':
  2600. return '治疗费'
  2601. break
  2602. case '5':
  2603. return '治疗费'
  2604. break
  2605. case '06':
  2606. return '手术费'
  2607. break
  2608. case '6':
  2609. return '手术费'
  2610. break
  2611. case '07':
  2612. return '护理费'
  2613. break
  2614. case '7':
  2615. return '护理费'
  2616. break
  2617. case '08':
  2618. return '材料费'
  2619. break
  2620. case '8':
  2621. return '材料费'
  2622. break
  2623. case '09':
  2624. return '西药费'
  2625. break
  2626. case '9':
  2627. return '西药费'
  2628. break
  2629. case '10':
  2630. return '中药饮片费'
  2631. break
  2632. case '11':
  2633. return '中成药费'
  2634. break
  2635. case '12':
  2636. return '一般诊疗费'
  2637. break
  2638. case '13':
  2639. return '挂号费'
  2640. break
  2641. case '14':
  2642. return '其他费'
  2643. break
  2644. case '0':
  2645. return '其他费'
  2646. break
  2647. }
  2648. },
  2649. export_detail_ten() {
  2650. let params = {
  2651. start_time: this.start_time,
  2652. end_time: this.end_time
  2653. }
  2654. handleData10106(params).then((response) => {
  2655. if (response.data.state == 0) {
  2656. this.$message.error(response.data.msg)
  2657. return false
  2658. } else {
  2659. let list = []
  2660. for (let i = 0; i < response.data.data.order.length; i++) {
  2661. let order = response.data.data.order[i]
  2662. let med_chrgitm_types = []
  2663. for (let b = 0; b < order.info.length; b++) {
  2664. med_chrgitm_types.push(order.info[b].med_chrgitm_type)
  2665. const obj = {}
  2666. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  2667. obj[next] ? '' : obj[next] = true && cur.push(next)
  2668. return cur
  2669. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  2670. }
  2671. for (let i = 0; i < med_chrgitm_types.length; i++) {
  2672. let price = 0
  2673. let obj = {
  2674. number: '440722196501072316',
  2675. name: order.patient.name,
  2676. idNo: '',
  2677. med_chrgitm_name: this.getType(med_chrgitm_types[i]),
  2678. price: '',
  2679. remark: ''
  2680. }
  2681. if (i == 0) {
  2682. obj.remark = '就诊日期:' + this.getTimes(order.settle_accounts_date) + ' 医保报销: ' + order.fund_pay_sumamt + ' 现金:' + order.psn_cash_pay
  2683. obj.idNo = order.patient.id_card_no
  2684. } else {
  2685. obj.remark = ''
  2686. obj.idNo = ''
  2687. }
  2688. for (let b = 0; b < order.info.length; b++) {
  2689. if (med_chrgitm_types[i] == order.info[b].med_chrgitm_type) {
  2690. price = price + order.info[b].det_item_fee_sumamt
  2691. }
  2692. }
  2693. obj.price = price
  2694. list.push(obj)
  2695. }
  2696. }
  2697. let list_two = []
  2698. const obj = {}
  2699. for (let i = 0; i < list.length; i++) {
  2700. console.log(list[i])
  2701. list_two.push(list[i].name)
  2702. }
  2703. list_two = list_two.reduce((cur, next) => {
  2704. obj[next] ? '' : obj[next] = true && cur.push(next)
  2705. return cur
  2706. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  2707. for (let i = 0; i < list_two.length; i++) {
  2708. for (let b = 0; b < list.length; b++) {
  2709. if (list_two[i] == list[b].name) {
  2710. list[b]['index'] = i + 1
  2711. }
  2712. }
  2713. }
  2714. var tarList = []
  2715. for (let i = 0; i < list.length; i++) {
  2716. let obj = {
  2717. '订单序号': list[i].index,
  2718. '订单号码': '',
  2719. '购方名称': list[i].name,
  2720. '购方纳税人识别号': list[i].idNo,
  2721. '开户行及账号': '',
  2722. '地址电话': '',
  2723. '税收编码': '3070202000000000000',
  2724. '商品名称': list[i].med_chrgitm_name,
  2725. '规格型号': '',
  2726. '计量单位': '',
  2727. '数量': '',
  2728. '单价': '',
  2729. '金额': list[i].price,
  2730. '税率': '0%',
  2731. '优惠政策': '普通零税率',
  2732. '税额': '0',
  2733. '备注': list[i].remark,
  2734. '电子邮箱': ''
  2735. }
  2736. tarList.push(obj)
  2737. }
  2738. import('@/vendor/Export2Excel').then((excel) => {
  2739. const tHeader = [
  2740. '订单序号',
  2741. '订单号码',
  2742. '购方名称',
  2743. '购方纳税人识别号',
  2744. '开户行及账号',
  2745. '地址电话',
  2746. '税收编码',
  2747. '商品名称',
  2748. '规格型号',
  2749. '计量单位',
  2750. '数量',
  2751. '单价',
  2752. '金额',
  2753. '税率',
  2754. '优惠政策',
  2755. '税额',
  2756. '备注',
  2757. '电子邮箱'
  2758. ]
  2759. const filterVal = [
  2760. '订单序号',
  2761. '订单号码',
  2762. '购方名称',
  2763. '购方纳税人识别号',
  2764. '开户行及账号',
  2765. '地址电话',
  2766. '税收编码',
  2767. '商品名称',
  2768. '规格型号',
  2769. '计量单位',
  2770. '数量',
  2771. '单价',
  2772. '金额',
  2773. '税率',
  2774. '优惠政策',
  2775. '税额',
  2776. '备注',
  2777. '电子邮箱'
  2778. ]
  2779. const data = this.formatJson(filterVal, tarList)
  2780. excel.export_json_to_excel({
  2781. header: tHeader,
  2782. data,
  2783. filename: '消费明细'
  2784. })
  2785. })
  2786. }
  2787. })
  2788. },
  2789. export_detail_ten_two() {
  2790. let params = {
  2791. start_time: this.start_time,
  2792. end_time: this.end_time
  2793. }
  2794. handleData10318(params).then((response) => {
  2795. if (response.data.state == 0) {
  2796. this.$message.error(response.data.msg)
  2797. return false
  2798. } else {
  2799. let list = []
  2800. for (let i = 0; i < response.data.data.order.length; i++) {
  2801. let order = response.data.data.order[i]
  2802. let obj = {
  2803. 姓名: order.patient.name,
  2804. 身份证: order.patient.id_card_no,
  2805. 西药费: 0,
  2806. 化验费: 0,
  2807. 检查费: 0,
  2808. 治疗费: 0,
  2809. 材料费: 0,
  2810. 中成药费: 0,
  2811. 护理费: 0,
  2812. 备注: '就诊日期:' + this.getTimes(order.settle_accounts_date) + ' 医保报销: ' + order.fund_pay_sumamt + ' 现金:' + order.psn_cash_pay
  2813. }
  2814. let xiyaoPrice = 0
  2815. let huaYanPrice = 0
  2816. let jianChaPrice = 0
  2817. let zhiLiaoPrice = 0
  2818. let cailiaoPrice = 0
  2819. let zhongchengyaoPrice = 0
  2820. let huliPrice = 0
  2821. for (let b = 0; b < order.info.length; b++) {
  2822. if (order.info[b].med_chrgitm_type == '09') {
  2823. xiyaoPrice = xiyaoPrice + order.info[b].det_item_fee_sumamt
  2824. }
  2825. if (order.info[b].med_chrgitm_type == '04') {
  2826. huaYanPrice = huaYanPrice + order.info[b].det_item_fee_sumamt
  2827. }
  2828. if (order.info[b].med_chrgitm_type == '03') {
  2829. jianChaPrice = jianChaPrice + order.info[b].det_item_fee_sumamt
  2830. }
  2831. if (order.info[b].med_chrgitm_type == '05') {
  2832. zhiLiaoPrice = zhiLiaoPrice + order.info[b].det_item_fee_sumamt
  2833. }
  2834. if (order.info[b].med_chrgitm_type == '08') {
  2835. cailiaoPrice = cailiaoPrice + order.info[b].det_item_fee_sumamt
  2836. }
  2837. if (order.info[b].med_chrgitm_type == '11') {
  2838. zhongchengyaoPrice = zhongchengyaoPrice + order.info[b].det_item_fee_sumamt
  2839. }
  2840. if (order.info[b].med_chrgitm_type == '07') {
  2841. huliPrice = huliPrice + order.info[b].det_item_fee_sumamt
  2842. }
  2843. }
  2844. obj.西药费 = xiyaoPrice
  2845. obj.化验费 = huaYanPrice
  2846. obj.检查费 = jianChaPrice
  2847. obj.治疗费 = zhiLiaoPrice
  2848. obj.材料费 = cailiaoPrice
  2849. obj.中成药费 = zhongchengyaoPrice
  2850. obj.护理费 = huliPrice
  2851. list.push(obj)
  2852. }
  2853. import('@/vendor/Export2Excel').then((excel) => {
  2854. const tHeader = [
  2855. '姓名',
  2856. '身份证',
  2857. '西药费',
  2858. '化验费',
  2859. '检查费',
  2860. '治疗费',
  2861. '材料费',
  2862. '中成药费',
  2863. '护理费',
  2864. '备注'
  2865. ]
  2866. const filterVal = [
  2867. '姓名',
  2868. '身份证',
  2869. '西药费',
  2870. '化验费',
  2871. '检查费',
  2872. '治疗费',
  2873. '材料费',
  2874. '中成药费',
  2875. '护理费',
  2876. '备注'
  2877. ]
  2878. const data = this.formatJson(filterVal, list)
  2879. excel.export_json_to_excel({
  2880. header: tHeader,
  2881. data,
  2882. filename: '消费明细'
  2883. })
  2884. })
  2885. }
  2886. })
  2887. },
  2888. export_detail_ten_three() {
  2889. exportOrderInfo().then((response) => {
  2890. if (response.data.state == 0) {
  2891. this.$message.error(response.data.msg)
  2892. return false
  2893. } else {
  2894. let list = []
  2895. for (let b = 0; b < response.data.data.info.length; b++) {
  2896. let item_name = ''
  2897. let item_code = ''
  2898. let price = ''
  2899. let unit = ''
  2900. let spec = ''
  2901. let cnt = ''
  2902. if (
  2903. response.data.data.info[b].advices.id == 0 &&
  2904. response.data.data.info[b].project.id > 0
  2905. ) {
  2906. if (response.data.data.info[b].project.type == 2) {
  2907. item_name = response.data.data.info[b].project.project.project_name
  2908. item_code = response.data.data.info[b].project.project.medical_code
  2909. price = response.data.data.info[b].det_item_fee_sumamt
  2910. unit = response.data.data.info[b].project.project.unit
  2911. cnt = response.data.data.info[b].cnt
  2912. } else {
  2913. item_name = response.data.data.info[b].project.good_info.good_name
  2914. item_code = response.data.data.info[b].project.good_info.medical_insurance_number
  2915. price = response.data.data.info[b].det_item_fee_sumamt
  2916. unit = response.data.data.info[b].project.good_info.packing_unit
  2917. cnt = response.data.data.info[b].cnt
  2918. }
  2919. } else if (
  2920. response.data.data.info[b].advices.id > 0 &&
  2921. response.data.data.info[b].project.id == 0
  2922. ) {
  2923. item_name = response.data.data.info[b].advices.advice_name
  2924. item_code =
  2925. response.data.data.info[b].advices.drug.medical_insurance_number
  2926. price = response.data.data.info[b].det_item_fee_sumamt
  2927. unit = response.data.data.info[b].advices.prescribing_number_unit
  2928. spec = response.data.data.info[b].advices.drug.dose + response.data.data.info[b].advices.drug.dose_unit + '*' + response.data.data.info[b].advices.drug.min_number + response.data.data.info[b].advices.drug.min_unit + '/' + response.data.data.info[b].advices.drug.max_unit
  2929. cnt = response.data.data.info[b].cnt
  2930. }
  2931. let obj = {
  2932. 名称: item_name,
  2933. 总价: price,
  2934. 数量: cnt,
  2935. 规格: spec
  2936. }
  2937. list.push(obj)
  2938. }
  2939. import('@/vendor/Export2Excel').then((excel) => {
  2940. const tHeader = [
  2941. '名称',
  2942. '总价',
  2943. '数量',
  2944. '规格'
  2945. ]
  2946. const filterVal = [
  2947. '名称',
  2948. '总价',
  2949. '数量',
  2950. '规格'
  2951. ]
  2952. const data = this.formatJson(filterVal, list)
  2953. excel.export_json_to_excel({
  2954. header: tHeader,
  2955. data,
  2956. filename: '消费明细'
  2957. })
  2958. })
  2959. }
  2960. })
  2961. },
  2962. GetGoodName(id) {
  2963. switch (id) {
  2964. case 254:
  2965. return '空心纤维透析器REXEED-18UC(旭化成)'
  2966. break
  2967. case 253:
  2968. return '空心纤维透析器REXEED-15UC(旭化成)'
  2969. break
  2970. case 250:
  2971. return '聚砜膜透析滤过器-XevontaHI18(贝朗)'
  2972. break
  2973. case 249:
  2974. return '聚砜膜透析滤过器-XevontaHI15(贝朗)'
  2975. break
  2976. case 1478:
  2977. return '聚砜膜透析滤过器-XevontaHI15(贝朗)'
  2978. break
  2979. case 1479:
  2980. return '聚砜膜透析滤过器-XevontaHI18(贝朗)'
  2981. break
  2982. case 1482:
  2983. return '空心纤维透析器REXEED-15UC(旭化成)'
  2984. break
  2985. case 1483:
  2986. return 'REXEED-18UC(旭化成)'
  2987. break
  2988. case 2577:
  2989. return '空心纤维透析器(FB-15U)(尼普洛)'
  2990. break
  2991. case 2578:
  2992. return '空心纤维透析器(FB-17U)(尼普洛)'
  2993. break
  2994. case 2058:
  2995. return '中空纤维透析器CTA-1500'
  2996. break
  2997. case 2059:
  2998. return '中空纤维透析器CTA-2000'
  2999. break
  3000. break
  3001. }
  3002. },
  3003. unique_two(array) {
  3004. // res用来存储结果
  3005. var res = []
  3006. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3007. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3008. if (array[i].patient_id === res[j].patient_id && array[i].dialysis_time === res[j].dialysis_time) {
  3009. break
  3010. }
  3011. }
  3012. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3013. if (j === resLen) {
  3014. res.push(array[i])
  3015. }
  3016. }
  3017. return res
  3018. },
  3019. batch_print_settlte() {
  3020. if (this.selecting_schs.length === 0) {
  3021. this.$message.error('请至少选择一条需要打印的内容')
  3022. return false
  3023. } else {
  3024. var sch_ids = []
  3025. for (let index = 0; index < this.selecting_schs.length; index++) {
  3026. sch_ids.push(this.selecting_schs[index].id)
  3027. }
  3028. this.batchStatementVisible = true
  3029. let params = {
  3030. order_ids: sch_ids.join(','),
  3031. admin_user_id: this.$store.getters.xt_user.user.id
  3032. }
  3033. this.batchOrderObj = params
  3034. }
  3035. },
  3036. export_detail() {
  3037. let params = {
  3038. start_time: this.start_time,
  3039. end_time: this.end_time,
  3040. p_type: 2,
  3041. sort_type:this.sort_type
  3042. }
  3043. getExportConsumeDetailList(params).then((response) => {
  3044. if (response.data.state == 0) {
  3045. this.$message.error(response.data.msg)
  3046. return false
  3047. } else {
  3048. let list = []
  3049. for (let i = 0; i < response.data.data.order.length; i++) {
  3050. let order = response.data.data.order[i]
  3051. let number = ''
  3052. let name = ''
  3053. let department = ''
  3054. let doctor_name = ''
  3055. let balance_accounts = ''
  3056. let order_status = ''
  3057. let charge_name = ''
  3058. let gender = ""
  3059. let age = 0
  3060. let insutypeName = ''
  3061. if(order.patient.gender == 1){
  3062. gender = "男"
  3063. }else{
  3064. gender = "女"
  3065. }
  3066. age = this.getAge(order.patient.id_card_no)
  3067. let time = ''
  3068. if (
  3069. order.his_patient != null &&
  3070. order.his_patient.number.length > 0
  3071. ) {
  3072. number = order.his_patient.number
  3073. }
  3074. if (order.his_patient != null) {
  3075. if (order.his_patient.balance_accounts_type == 2) {
  3076. balance_accounts = '自费'
  3077. }
  3078. if (order.his_patient.balance_accounts_type == 1) {
  3079. balance_accounts = '医保'
  3080. }
  3081. }
  3082. if (order.patient != null && order.patient.name.length > 0) {
  3083. name = order.patient.name
  3084. }
  3085. if (
  3086. order.p_info != null &&
  3087. order.p_info.department != null &&
  3088. order.p_info.department.name.length > 0
  3089. ) {
  3090. department = order.p_info.department.name
  3091. }
  3092. if (order.p_info != null && order.p_info.doctor.length > 0) {
  3093. doctor_name = order.p_info.doctor
  3094. }
  3095. if (order.creator != null) {
  3096. charge_name = this.getName(order.creator)
  3097. }
  3098. if (order.insutype == '390') {
  3099. insutypeName = '城乡居民基本医疗保险'
  3100. } else if (order.insutype == '310') {
  3101. insutypeName = '职工基本医疗保险'
  3102. }
  3103. if (order.order_status == 1) {
  3104. order_status = '待结算'
  3105. }
  3106. if (order.order_status == 2) {
  3107. order_status = '已结算'
  3108. }
  3109. if (order.order_status == 3) {
  3110. order_status = '已退费'
  3111. }
  3112. if (order.settle_type == 2) {
  3113. time = this.getTimes(order.settle_start_time)
  3114. } else {
  3115. time = this.getTimes(order.settle_accounts_date)
  3116. }
  3117. // var hifmi_pay = 0.0
  3118. // if (order.setl_detail && order.setl_detail.length > 0) {
  3119. // var jsonObj = JSON.parse(order.setl_detail)
  3120. //
  3121. // console.log(jsonObj)
  3122. // if (jsonObj != null) {
  3123. // for (let i = 0; i < jsonObj.length; i++) {
  3124. // if (order.insutype == '310') {
  3125. // if (jsonObj[i].fund_pay_type == '310300') {
  3126. // hifmi_pay = jsonObj[i].fund_payamt
  3127. // }
  3128. // } else if (order.insutype == '390') {
  3129. // if (order.fund_pay_type == '390200') {
  3130. // hifmi_pay = jsonObj[i].fund_payamt
  3131. // }
  3132. // }
  3133. // }
  3134. // }
  3135. // }
  3136. // var hifmi_pay = 0.0
  3137. // console.log(order.setl_detail)
  3138. // if (order.setl_detail && order.setl_detail.length > 0) {
  3139. // var jsonObj = JSON.parse(order.setl_detail)
  3140. // if (jsonObj != null) {
  3141. // for (let i = 0; i < jsonObj.length; i++) {
  3142. // if (order.insutype == '310') {
  3143. // if (jsonObj[i].fund_pay_type == '310300') {
  3144. // hifmi_pay = jsonObj[i].fund_payamt
  3145. // }
  3146. // }
  3147. // if (order.insutype == '390') {
  3148. // if (jsonObj[i].fund_pay_type == '390200') {
  3149. // hifmi_pay = jsonObj[i].fund_payamt
  3150. // }
  3151. // }
  3152. // }
  3153. // }
  3154. // }
  3155. let insuplc_admdvs_name = ''
  3156. if (order.his_patient.insuplc_admdvs == '440703') {
  3157. insuplc_admdvs_name = '蓬江区'
  3158. } else if (order.his_patient.insuplc_admdvs == '440704') {
  3159. insuplc_admdvs_name = '江海区'
  3160. } else if (order.his_patient.insuplc_admdvs == '440705') {
  3161. insuplc_admdvs_name = '新会区'
  3162. } else if (order.his_patient.insuplc_admdvs == '440781') {
  3163. insuplc_admdvs_name = '台山市'
  3164. } else if (order.his_patient.insuplc_admdvs == '440783') {
  3165. insuplc_admdvs_name = '开平市'
  3166. } else if (order.his_patient.insuplc_admdvs == '440784') {
  3167. insuplc_admdvs_name = '鹤山市'
  3168. } else if (order.his_patient.insuplc_admdvs == '440785') {
  3169. insuplc_admdvs_name = '恩平市'
  3170. } else if (order.his_patient.insuplc_admdvs == '440799') {
  3171. insuplc_admdvs_name = '市直'
  3172. }
  3173. let obj = {
  3174. 就诊号: order.mdtrt_id,
  3175. 患者姓名: name,
  3176. 患者性别: gender,
  3177. 患者年龄: age,
  3178. 开处时间: time,
  3179. 险种类型: insutypeName,
  3180. 参保所属医保区划: order.his_patient.insuplc_admdvs,
  3181. 参保号: order.his_patient.id_card_no,
  3182. 属地名称: insuplc_admdvs_name,
  3183. 应收金额: order.medfee_sumamt,
  3184. 实收金额: order.medfee_sumamt,
  3185. 医保统筹金额: order.hifp_pay,
  3186. 大额基金金额: order.hifob_pay,
  3187. 大病基金金额: order.hifmi_pay,
  3188. 补充保险基金金额: order.hifes_pay,
  3189. 医疗救助基金金额: order.maf_pay,
  3190. 公务员基金: order.cvlserv_pay,
  3191. 个人支付基金: order.psn_cash_pay,
  3192. 个人账户支付金额: order.acct_pay,
  3193. 科室: department,
  3194. 医生姓名: doctor_name,
  3195. 收费类别: balance_accounts,
  3196. 收费者姓名: charge_name,
  3197. 总金额: order.medfee_sumamt,
  3198. 现金支付: '',
  3199. 账户支付: '',
  3200. 支付宝支付: '',
  3201. 微信支付: '',
  3202. 其他支付: '',
  3203. 收费时间: order.setl_time,
  3204. 收费状态: order_status,
  3205. 退费日期: ''
  3206. }
  3207. list.push(obj)
  3208. }
  3209. import('@/vendor/Export2Excel').then((excel) => {
  3210. const tHeader = [
  3211. '就诊号',
  3212. '患者姓名',
  3213. "患者性别",
  3214. "患者年龄",
  3215. '开处时间',
  3216. '险种类型',
  3217. '参保所属医保区划',
  3218. '参保号',
  3219. '属地名称',
  3220. '应收金额',
  3221. '实收金额',
  3222. '医保统筹金额',
  3223. '大额基金金额',
  3224. '大病基金金额',
  3225. '补充保险基金金额',
  3226. '医疗救助基金金额',
  3227. '公务员基金',
  3228. '个人支付基金',
  3229. '个人账户支付金额',
  3230. '科室',
  3231. '医生姓名',
  3232. '收费类别',
  3233. '收费者姓名',
  3234. '总金额',
  3235. '现金支付',
  3236. '账户支付',
  3237. '支付宝支付',
  3238. '微信支付',
  3239. '其他支付',
  3240. '收费时间',
  3241. '收费状态',
  3242. '退费日期'
  3243. ]
  3244. const filterVal = [
  3245. '就诊号',
  3246. '患者姓名',
  3247. "患者性别",
  3248. "患者年龄",
  3249. '开处时间',
  3250. '险种类型',
  3251. '参保所属医保区划',
  3252. '参保号',
  3253. '属地名称',
  3254. '应收金额',
  3255. '实收金额',
  3256. '医保统筹金额',
  3257. '大额基金金额',
  3258. '大病基金金额',
  3259. '补充保险基金金额',
  3260. '医疗救助基金金额',
  3261. '公务员基金',
  3262. '个人支付基金',
  3263. '个人账户支付金额',
  3264. '科室',
  3265. '医生姓名',
  3266. '收费类别',
  3267. '收费者姓名',
  3268. '总金额',
  3269. '现金支付',
  3270. '账户支付',
  3271. '支付宝支付',
  3272. '微信支付',
  3273. '其他支付',
  3274. '收费时间',
  3275. '收费状态',
  3276. '退费日期'
  3277. ]
  3278. const data = this.formatJson(filterVal, list)
  3279. excel.export_json_to_excel({
  3280. header: tHeader,
  3281. data,
  3282. filename: '消费明细'
  3283. })
  3284. })
  3285. }
  3286. })
  3287. },
  3288. formatJson(filterVal, jsonData) {
  3289. return jsonData.map((v) => filterVal.map((j) => v[j]))
  3290. },
  3291. changeSortType() {
  3292. this.page = 1
  3293. this.keywords = ''
  3294. // this.getHisOrderList()
  3295. },
  3296. changeDoctor() {
  3297. this.page = 1
  3298. this.keywords = ''
  3299. // this.getHisOrderList()
  3300. },
  3301. handleSizeChange(limit) {
  3302. this.limit = limit
  3303. this.getHisOrderList()
  3304. },
  3305. handleCurrentChange(page) {
  3306. this.page = page
  3307. this.getHisOrderList()
  3308. },
  3309. handleStartTimeChange() {
  3310. this.page = 1
  3311. this.keywords = ''
  3312. this.getHisOrderList()
  3313. },
  3314. handleEndTimeChange() {
  3315. this.page = 1
  3316. this.keywords = ''
  3317. this.getHisOrderList()
  3318. },
  3319. setMonthPrescription(month_prescriptions) {
  3320. console.log(month_prescriptions)
  3321. let tableData = []
  3322. let drug_month_prescriptions = {
  3323. advices: []
  3324. }
  3325. let drug_ids = []
  3326. let project_month_prescriptions = {
  3327. project: []
  3328. }
  3329. let project_ids = []
  3330. let to = 0
  3331. for (let i = 0; i < month_prescriptions.length; i++) {
  3332. to = to + month_prescriptions[i].det_item_fee_sumamt
  3333. }
  3334. console.log(to)
  3335. // let addition_month_prescriptions = {
  3336. // addition: []
  3337. //
  3338. // }
  3339. // let additions_ids = []
  3340. for (let i = 0; i < month_prescriptions.length; i++) {
  3341. if (month_prescriptions[i].advice_id > 0 && month_prescriptions[i].project_id == 0) { //药品
  3342. let obj = {
  3343. id: month_prescriptions[i].advices.drug_id,
  3344. price: month_prescriptions[i].pric
  3345. }
  3346. drug_ids.push(obj)
  3347. drug_month_prescriptions.advices.push(month_prescriptions[i])
  3348. } else if (month_prescriptions[i].advice_id == 0 && month_prescriptions[i].project_id > 0) { //项目
  3349. let obj = {
  3350. id: month_prescriptions[i].project.project_id,
  3351. price: month_prescriptions[i].pric
  3352. }
  3353. project_ids.push(obj)
  3354. project_month_prescriptions.project.push(month_prescriptions[i])
  3355. }
  3356. }
  3357. console.log(drug_ids)
  3358. console.log(project_ids)
  3359. drug_ids = this.unique(drug_ids)
  3360. project_ids = this.unique(project_ids)
  3361. console.log(drug_ids)
  3362. console.log(project_ids)
  3363. // additions_ids= this.unique(additions_ids)
  3364. for (let i = 0; i < drug_ids.length; i++) {
  3365. let obj = {}
  3366. let count = 0
  3367. let total = 0
  3368. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  3369. console.log(drug_month_prescriptions.advices[a].id)
  3370. console.log(drug_month_prescriptions.advices[a].det_item_fee_sumamt)
  3371. console.log((parseFloat(drug_month_prescriptions.advices[a].pric) * parseFloat(drug_month_prescriptions.advices[a].cnt)).toFixed(2))
  3372. if (drug_ids[i].price == drug_month_prescriptions.advices[a].pric && drug_ids[i].id == drug_month_prescriptions.advices[a].advices.drug_id) {
  3373. obj['name'] = drug_month_prescriptions.advices[a].advices.advice_name
  3374. obj['code'] = drug_month_prescriptions.advices[a].advices.id
  3375. obj['unit'] = drug_month_prescriptions.advices[a].advices.drug.min_unit
  3376. obj['price'] = parseFloat(drug_month_prescriptions.advices[a].pric)
  3377. obj['id'] = drug_month_prescriptions.advices[a].advices.id
  3378. obj['type'] = 1
  3379. count = count + drug_month_prescriptions.advices[a].cnt
  3380. total = total + drug_month_prescriptions.advices[a].det_item_fee_sumamt
  3381. }
  3382. }
  3383. obj['count'] = count
  3384. obj['total'] = total
  3385. tableData.push(obj)
  3386. }
  3387. for (let i = 0; i < project_ids.length; i++) {
  3388. let obj = {}
  3389. let count = 0
  3390. let total = 0
  3391. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  3392. if (project_ids[i].price == project_month_prescriptions.project[a].pric && project_ids[i].id == project_month_prescriptions.project[a].project.project_id) {
  3393. if (project_month_prescriptions.project[a].project.type == 2) {
  3394. obj['name'] = project_month_prescriptions.project[a].project.project.project_name
  3395. obj['code'] = project_month_prescriptions.project[a].project.id
  3396. obj['unit'] = project_month_prescriptions.project[a].project.project.unit
  3397. obj['type'] = 2
  3398. obj['id'] = project_month_prescriptions.project[a].project.id
  3399. } else if (project_month_prescriptions.project[a].project.type == 3) {
  3400. obj['name'] = project_month_prescriptions.project[a].project.good_info.good_name
  3401. obj['code'] = project_month_prescriptions.project[a].project.id
  3402. obj['unit'] = project_month_prescriptions.project[a].project.good_info.packing_unit
  3403. obj['type'] = 3
  3404. obj['id'] = project_month_prescriptions.project[a].project.id
  3405. }
  3406. count = count + parseFloat(project_month_prescriptions.project[a].cnt)
  3407. total = total + project_month_prescriptions.project[a].det_item_fee_sumamt
  3408. obj['price'] = parseFloat(project_month_prescriptions.project[a].pric)
  3409. obj['type'] = 2
  3410. }
  3411. }
  3412. obj['count'] = count
  3413. obj['total'] = total
  3414. tableData.push(obj)
  3415. }
  3416. return tableData
  3417. },
  3418. setMonthPrescriptiontwo(month_prescriptions) {
  3419. let tableData = []
  3420. let project_month_prescriptions = {
  3421. project: []
  3422. }
  3423. let project_ids = []
  3424. for (let i = 0; i < month_prescriptions.length; i++) {
  3425. if (month_prescriptions[i].type == 2) { //项目
  3426. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  3427. if (month_prescriptions[i].project[a].type == 2) {
  3428. let obj = {
  3429. id: month_prescriptions[i].project[a].project_id,
  3430. price: month_prescriptions[i].project[a].price
  3431. }
  3432. project_ids.push(obj)
  3433. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  3434. }
  3435. }
  3436. }
  3437. }
  3438. project_ids = this.unique(project_ids)
  3439. console.log(project_ids)
  3440. for (let i = 0; i < project_ids.length; i++) {
  3441. let obj = {}
  3442. let count = 0
  3443. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  3444. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  3445. if (project_month_prescriptions.project[a].type == 2) {
  3446. obj['name'] = project_month_prescriptions.project[a].project.project_name
  3447. obj['code'] = project_month_prescriptions.project[a].project.medical_code
  3448. count = count + parseFloat(project_month_prescriptions.project[a].count)
  3449. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  3450. }
  3451. }
  3452. }
  3453. obj['count'] = count
  3454. tableData.push(obj)
  3455. }
  3456. return tableData
  3457. },
  3458. Action() {
  3459. getAllOrders().then((response) => {
  3460. if (response.data.state == 0) {
  3461. this.$message.error(response.data.msg)
  3462. return false
  3463. } else {
  3464. let list = []
  3465. for (let i = 0; i < response.data.data.order.length; i++) {
  3466. let order = response.data.data.order[i]
  3467. for (let b = 0; b < order.info.length; b++) {
  3468. let item_name = ''
  3469. let item_code = ''
  3470. let price = ''
  3471. let unit = ''
  3472. let spec = ''
  3473. let time = ''
  3474. let cnt = ''
  3475. if (
  3476. order.info[b].advices.id == 0 &&
  3477. order.info[b].project.id > 0
  3478. ) {
  3479. if (order.info[b].project.type == 2) {
  3480. item_name = order.info[b].project.project.project_name
  3481. item_code = order.info[b].project.project.medical_code
  3482. price = order.info[b].pric
  3483. unit = order.info[b].project.project.unit
  3484. cnt = order.info[b].cnt
  3485. time = order.setl_time
  3486. } else {
  3487. item_name = order.info[b].project.good_info.good_name
  3488. item_code = order.info[b].project.good_info.medical_insurance_number
  3489. price = order.info[b].pric
  3490. unit = order.info[b].project.good_info.packing_unit
  3491. cnt = order.info[b].cnt
  3492. time = order.setl_time
  3493. }
  3494. } else if (
  3495. order.info[b].advices.id > 0 &&
  3496. order.info[b].project.id == 0
  3497. ) {
  3498. item_name = order.info[b].advices.advice_name
  3499. item_code =
  3500. order.info[b].advices.drug.medical_insurance_number
  3501. price = order.info[b].pric
  3502. unit = order.info[b].advices.prescribing_number_unit
  3503. spec = order.info[b].advices.drug.dose + order.info[b].advices.drug.dose_unit + '*' + order.info[b].advices.drug.min_number + order.info[b].advices.drug.min_unit + '/' + order.info[b].advices.drug.max_unit
  3504. cnt = order.info[b].cnt
  3505. time = order.setl_time
  3506. }
  3507. let obj = {
  3508. 项目编码: item_code,
  3509. 项目名称: item_name,
  3510. 规格: spec,
  3511. 厂家: '',
  3512. 单位: unit,
  3513. 数量: cnt,
  3514. 时间: time
  3515. }
  3516. list.push(obj)
  3517. }
  3518. }
  3519. import('@/vendor/Export2Excel').then((excel) => {
  3520. const tHeader = [
  3521. '项目编码',
  3522. '项目名称',
  3523. '规格',
  3524. '厂家',
  3525. '单位',
  3526. '数量',
  3527. '时间'
  3528. ]
  3529. const filterVal = [
  3530. '项目编码',
  3531. '项目名称',
  3532. '规格',
  3533. '厂家',
  3534. '单位',
  3535. '数量',
  3536. '时间'
  3537. ]
  3538. const data = this.formatJson(filterVal, list)
  3539. excel.export_json_to_excel({
  3540. header: tHeader,
  3541. data,
  3542. filename: '消费明细'
  3543. })
  3544. })
  3545. }
  3546. })
  3547. },
  3548. searchAction() {
  3549. this.page = 1
  3550. // const tableData = this.tableData
  3551. // if (this.keywords.length == 0) {
  3552. // this.getHisOrderList()
  3553. // } else {
  3554. // console.log('6666666',tableData);
  3555. // let arr = []
  3556. // for (let i = 0; i < tableData.length; i++) {
  3557. // if (tableData[i].patient.name.indexOf(this.keywords) != -1 ||
  3558. // tableData[i].patient.first_letter.indexOf(this.keywords) != -1) {
  3559. // arr = arr.concat(tableData[i])
  3560. // }
  3561. // }
  3562. // this.tableData = arr
  3563. // }
  3564. this.getHisOrderList()
  3565. },
  3566. getTimes(time) {
  3567. return uParseTime(time, '{y}-{m}-{d}')
  3568. },
  3569. toDetail(row) {
  3570. this.$router.push(
  3571. '/outpatientCharges/summaryDetail?patient_id=' +
  3572. row.patient.id +
  3573. '&number=' +
  3574. row.number +
  3575. '&id=' +
  3576. row.id
  3577. )
  3578. },
  3579. getTime(value, temp) {
  3580. if (value != undefined) {
  3581. return uParseTime(value, temp)
  3582. }
  3583. return ''
  3584. },
  3585. getHisOrderList() {
  3586. let params = {
  3587. page: this.page,
  3588. limit: this.limit,
  3589. keywords: this.keywords,
  3590. start_time: this.start_time,
  3591. end_time: this.end_time,
  3592. type: this.admin_user_id,
  3593. p_type: 2,
  3594. sort_type: this.sort_type,
  3595. sch_type: this.sch_type,
  3596. zone_type: this.zoneVal,
  3597. med_type: this.medTypeVal
  3598. }
  3599. getHisOrderList(params).then((response) => {
  3600. if (response.data.state == 0) {
  3601. this.$message.error(response.data.msg)
  3602. return false
  3603. } else {
  3604. console.log('8888888',response.data.data);
  3605. this.tableData = response.data.data.order
  3606. this.tableData2 = response.data.data.order2
  3607. this.total = response.data.data.total
  3608. }
  3609. })
  3610. },
  3611. getDoctorList() {
  3612. getDoctorList().then((response) => {
  3613. if (response.data.state == 0) {
  3614. this.$message.error(response.data.msg)
  3615. return false
  3616. } else {
  3617. this.doctors = response.data.data.doctors
  3618. }
  3619. })
  3620. },
  3621. open(index) {
  3622. if (index == 1) {
  3623. this.listVisible = true
  3624. } else if (index == 2) {
  3625. this.allListVisible = true
  3626. }
  3627. }, unique(array) {
  3628. // res用来存储结果
  3629. var res = []
  3630. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  3631. for (var j = 0, resLen = res.length; j < resLen; j++) {
  3632. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  3633. break
  3634. }
  3635. }
  3636. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  3637. if (j === resLen) {
  3638. res.push(array[i])
  3639. }
  3640. }
  3641. return res
  3642. },camcleModifyFaPiaoCode(){
  3643. this.dialogfapiaoVisible = false
  3644. this.invoiceVisible = true
  3645. var obj = this.targeObj
  3646. let paramsObj = {
  3647. order_id: obj.id,
  3648. patient_id: obj.patient_id,
  3649. number: obj.mdtrt_id,
  3650. name: obj.patient.name,
  3651. age: obj.age,
  3652. gend: obj.patient.gender,
  3653. setl_time: obj.setl_time,
  3654. chargeName: this.getName(obj.creator)
  3655. }
  3656. this.dialogfapiaoVisible = false
  3657. this.invoiceParams = paramsObj
  3658. this.invoiceVisible = true
  3659. },modifyFaPiaoCode(){
  3660. let params = {
  3661. id:this.targeOrderId,
  3662. fapiao_number: this.fapiao_number
  3663. }
  3664. modifyFapiaoCodetwo(params).then((response) => {
  3665. if (response.data.state == 0) {
  3666. this.$message.error(response.data.msg)
  3667. return false
  3668. } else {
  3669. var obj = this.targeObj
  3670. let paramsObj = {
  3671. order_id: obj.id,
  3672. patient_id: obj.patient_id,
  3673. number: obj.mdtrt_id,
  3674. name: obj.patient.name,
  3675. age: obj.age,
  3676. gend: obj.patient.gender,
  3677. setl_time: obj.setl_time,
  3678. chargeName: this.getName(obj.creator)
  3679. }
  3680. this.dialogfapiaoVisible = false
  3681. this.invoiceParams = paramsObj
  3682. this.invoiceVisible = true
  3683. this.getHisOrderList()
  3684. }
  3685. })
  3686. },
  3687. invoicePrint(obj) {
  3688. if(this.$store.getters.xt_user.org_id == 10480 || this.$store.getters.xt_user.org_id == 0){
  3689. this.fapiao_number = obj.fa_piao_number
  3690. this.dialogfapiaoVisible = true
  3691. this.targeOrderId = obj.id
  3692. this.targeObj = obj
  3693. }else{
  3694. let paramsObj = {
  3695. order_id: obj.id,
  3696. patient_id: obj.patient_id,
  3697. number: obj.mdtrt_id,
  3698. name: obj.patient.name,
  3699. age: obj.age,
  3700. gend: obj.patient.gender,
  3701. setl_time: obj.setl_time,
  3702. chargeName: this.getName(obj.creator)
  3703. }
  3704. this.dialogfapiaoVisible = false
  3705. this.invoiceParams = paramsObj
  3706. this.invoiceVisible = true
  3707. }
  3708. }
  3709. }
  3710. }
  3711. </script>
  3712. <style lang="scss">
  3713. .table{
  3714. tr td{
  3715. padding:5px 0;
  3716. }
  3717. }
  3718. .content_top{
  3719. flex: 1;
  3720. display: flex;
  3721. justify-content: space-between;
  3722. }
  3723. .content_button{
  3724. flex: 1;
  3725. display: flex;
  3726. justify-content:space-around;
  3727. }
  3728. .butt_1{
  3729. margin-left:10px;
  3730. }
  3731. .butt_2{
  3732. margin-top: 3px;
  3733. }
  3734. </style>