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

summary.vue 119KB

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