summary.vue 131KB

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