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

summary.vue 118KB

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