summary.vue 75KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327
  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. />
  27. <el-button
  28. size="small"
  29. style="margin-left: 10px"
  30. class="filter-item"
  31. type="primary"
  32. @click="searchAction"
  33. >
  34. 搜索
  35. </el-button>
  36. <!-- <el-select size="small" v-model="admin_user_id" placeholder="请选择"-->
  37. <!-- style="width:150px;margin-left:10px;" @change="changeDoctor">-->
  38. <!-- <el-option-->
  39. <!-- label="全部"-->
  40. <!-- value="0">-->
  41. <!-- </el-option>-->
  42. <!-- <el-option-->
  43. <!-- v-for="(item,index) in doctors"-->
  44. <!-- :key="index"-->
  45. <!-- :label="item.user_name"-->
  46. <!-- :value="item.admin_user_id">-->
  47. <!-- </el-option>-->
  48. <!-- </el-select>-->
  49. <el-select
  50. size="small"
  51. v-model="sort_type"
  52. placeholder="请选择"
  53. style="width: 150px; margin-left: 10px"
  54. @change="changeSortType"
  55. >
  56. <el-option
  57. v-for="(item, index) in sort_types"
  58. :key="index"
  59. :label="item.label"
  60. :value="item.value"
  61. >
  62. </el-option>
  63. </el-select>
  64. <el-date-picker
  65. size="small"
  66. v-model="start_time"
  67. prefix-icon="el-icon-date"
  68. @change="handleStartTimeChange"
  69. :editable="false"
  70. :clearable="false"
  71. style="width: 196px; margin-right: 10px"
  72. type="date"
  73. placeholder="选择开始日期"
  74. format="yyyy-MM-dd"
  75. value-format="yyyy-MM-dd"
  76. align="right"
  77. ></el-date-picker>
  78. <el-date-picker
  79. size="small"
  80. v-model="end_time"
  81. prefix-icon="el-icon-date"
  82. @change="handleEndTimeChange"
  83. :editable="false"
  84. :clearable="false"
  85. style="width: 196px; margin-right: 10px"
  86. type="date"
  87. placeholder="选择结束日期"
  88. format="yyyy-MM-dd"
  89. value-format="yyyy-MM-dd"
  90. align="right"
  91. ></el-date-picker>
  92. <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
  93. <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
  94. </div>
  95. <div>
  96. <!-- <el-popover
  97. placement="bottom"
  98. width="210"
  99. trigger="click">
  100. <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
  101. <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
  102. <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
  103. </el-popover> -->
  104. <el-button size="small" type="primary" @click="export_detail"
  105. >报表下载
  106. </el-button
  107. >
  108. <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>
  109. <!-- <el-button size="small" type="primary" @click="export_detail_two"-->
  110. <!-- >报表下载2-->
  111. <!-- </el-button-->
  112. <!-- >-->
  113. <!-- <el-button size="small" type="primary" @click="export_detail_three">报表下载2</el-button>-->
  114. <!-- <el-button size="small" type="primary" @click="export_detail_four">报表下载3</el-button>-->
  115. <!-- <el-button size="small" type="primary" @click="export_detail_five">报表下载3</el-button>-->
  116. <!-- <el-button size="small" type="primary" @click="export_detail_six">报表下载9</el-button>-->
  117. <!-- <el-button size="small" type="primary" @click="export_detail_seven">报表下载4</el-button>-->
  118. </div>
  119. </div>
  120. <el-table
  121. :data="tableData"
  122. border
  123. style="width: 100%"
  124. :row-style="{ color: '#303133' }"
  125. :header-cell-style="{
  126. backgroundColor: 'rgb(245, 247, 250)',
  127. color: '#606266',
  128. }"
  129. highlight-current-row
  130. >
  131. <el-table-column
  132. prop="date"
  133. label="序号"
  134. width="60"
  135. align="center"
  136. type="index"
  137. >
  138. </el-table-column>
  139. <el-table-column align="center" width="100" prop="name" label="就诊号">
  140. <template slot-scope="scope">{{ scope.row.mdtrt_id }}</template>
  141. </el-table-column>
  142. <el-table-column align="center" width="90" prop="name" label="患者名字">
  143. <template slot-scope="scope">{{ scope.row.patient.name }}</template>
  144. </el-table-column>
  145. <!--<el-table-column align="center" prop="name" label="患者类型">-->
  146. <!--<template slot-scope="scope"></template>-->
  147. <!--</el-table-column>-->
  148. <el-table-column align="center" width="90" prop="name" label="应收金额">
  149. <template slot-scope="scope">{{
  150. scope.row.medfee_sumamt.toFixed(2)
  151. }}
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="center" width="90" prop="name" label="实收金额">
  155. <template slot-scope="scope">{{
  156. scope.row.reality_price.toFixed(2)
  157. }}
  158. </template>
  159. </el-table-column>
  160. <el-table-column align="center" width="90" prop="name" label="科室">
  161. <template slot-scope="scope">{{
  162. scope.row.department_name
  163. }}
  164. </template>
  165. </el-table-column>
  166. <el-table-column align="center" width="90" prop="name" label="医疗类型">
  167. <template slot-scope="scope">
  168. <div>{{ getMedType(scope.row.med_type) }}</div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column align="center" width="90" prop="name" label="收费类型">
  172. <template slot-scope="scope">
  173. <div v-if="scope.row.his_patient.balance_accounts_type != 2">
  174. 医保
  175. </div>
  176. <div v-if="scope.row.his_patient.balance_accounts_type == 2">
  177. 自费
  178. </div>
  179. </template>
  180. </el-table-column>
  181. <el-table-column
  182. align="center"
  183. width="100"
  184. prop="name"
  185. label="收费日期"
  186. >
  187. <template slot-scope="scope">
  188. {{
  189. scope.row.setl_time
  190. ? scope.row.setl_time
  191. : getTimes(scope.row.settle_accounts_date)
  192. }}
  193. </template>
  194. </el-table-column>
  195. <el-table-column align="center" width="90" prop="name" label="收费员">
  196. <template slot-scope="scope">{{
  197. getName(scope.row.creator)
  198. }}
  199. </template>
  200. </el-table-column>
  201. <el-table-column align="center" width="80" prop="name" label="状态">
  202. <template slot-scope="scope">
  203. <div v-if="scope.row.order_status == 1">待结算</div>
  204. <div v-if="scope.row.order_status == 2">已结算</div>
  205. <div v-if="scope.row.order_status == 3">已退费</div>
  206. </template>
  207. </el-table-column>
  208. <el-table-column align="center" prop="name" label="操作">
  209. <template slot-scope="scope">
  210. <el-button size="mini" type="primary" @click="toDetail(scope.row)"
  211. >详情
  212. </el-button
  213. >
  214. <el-button size="mini" type="primary" @click="toPrint(scope.row)">
  215. 结算单
  216. </el-button>
  217. <el-button
  218. size="mini"
  219. type="primary"
  220. @click="uploadInfo(scope.row)"
  221. v-if="scope.row.order_status == 2 && scope.row.result.id == 0"
  222. >
  223. 上传结算清单
  224. </el-button>
  225. <el-button
  226. size="mini"
  227. type="primary"
  228. @click="cancelUpload(scope.row)"
  229. v-if="scope.row.order_status == 2 && scope.row.result.id > 0"
  230. >
  231. 撤销结算清单
  232. </el-button>
  233. <el-button
  234. size="mini"
  235. type="primary"
  236. v-if="
  237. scope.row.order_status == 2 &&
  238. $store.getters.xt_user.org_id == 10106
  239. "
  240. @click="settlementPrint(scope.row)"
  241. >结算单
  242. </el-button>
  243. <el-button size="mini" type="primary" @click="toRefund(scope.row)">
  244. 退费
  245. </el-button>
  246. <el-button
  247. size="mini"
  248. type="primary"
  249. @click="invoicePrint(scope.row)"
  250. >打印发票
  251. </el-button
  252. >
  253. </template>
  254. </el-table-column>
  255. </el-table>
  256. <el-pagination
  257. @size-change="handleSizeChange"
  258. @current-change="handleCurrentChange"
  259. :page-sizes="[10, 50, 100]"
  260. :page-size="10"
  261. :current-page.sync="page"
  262. background
  263. style="margin-top: 20px; float: right"
  264. layout="total, sizes, prev, pager, next, jumper"
  265. :total="total"
  266. >
  267. </el-pagination>
  268. </div>
  269. <el-dialog
  270. class="centerDialog"
  271. width="1200px"
  272. title="打印"
  273. :visible.sync="statementVisible"
  274. >
  275. <!--<statementPrint ref="print" :paramsObj='orderObj'></statementPrint>-->
  276. <new-statement-print
  277. ref="print"
  278. :paramsObj="orderObj"
  279. ></new-statement-print>
  280. </el-dialog>
  281. <el-dialog
  282. class="centerDialog"
  283. width="900px"
  284. title="打印"
  285. :visible.sync="listVisible"
  286. >
  287. <listPrint></listPrint>
  288. </el-dialog>
  289. <el-dialog
  290. class="centerDialog"
  291. width="900px"
  292. title="打印"
  293. :visible.sync="allListVisible"
  294. >
  295. <allListPrint :paramsObj="paramsObj"></allListPrint>
  296. </el-dialog>
  297. <!--<el-dialog-->
  298. <!--class="centerDialog"-->
  299. <!--width="1200px"-->
  300. <!--title="打印"-->
  301. <!--:visible.sync="statementVisible9504">-->
  302. <!--&lt;!&ndash;<statementPrint ref="print" :paramsObj='orderObj'></statementPrint>&ndash;&gt;-->
  303. <!--&lt;!&ndash;<new-statement-print ref="print" :paramsObj='orderObj9504'></new-statement-print>&ndash;&gt;-->
  304. <!--<new-statement-print-two ref="print" :paramsObj='orderObj9504'></new-statement-print-two>-->
  305. <!--</el-dialog>-->
  306. <el-dialog
  307. class="centerDialog"
  308. width="1200px"
  309. title="打印"
  310. :visible.sync="invoiceVisible"
  311. >
  312. <invoice-print ref="print" :invoiceParams="invoiceParams"></invoice-print>
  313. </el-dialog>
  314. <el-dialog
  315. class="centerDialog"
  316. width="1200px"
  317. title="打印"
  318. :visible.sync="settlementVisible"
  319. >
  320. <settlement-print
  321. ref="print"
  322. :paramsObj="settlementObj"
  323. ></settlement-print>
  324. </el-dialog>
  325. </div>
  326. </template>
  327. <script>
  328. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  329. import {getDoctorList, getExportConsumeDetailList, getHisOrderList, Refund,} from "@/api/his/his";
  330. // import NewStatementPrint from './newStatementPrint'
  331. import NewStatementPrint from "./statementPrint.vue";
  332. import listPrint from "./listPrint";
  333. import allListPrint from "./allListPrint";
  334. import NewStatementPrintTwo from "./newStatementPrintTwo";
  335. import {fetchAllAdminUsers} from "@/api/doctor";
  336. import axios from "axios";
  337. import invoicePrint from "./invoicePrint";
  338. import settlementPrint from "./settlementPrint";
  339. import {jsGetAge, uParseTime} from "@/utils/tools";
  340. import {getHisDataFive, getHisDataSix, getHisDataThree, getHisDataTwo,getAllOrders} from "../../api/his/his";
  341. import {handleData10106} from "../../api/his/his_export";
  342. export default {
  343. name: "OutpatientChargesSummary",
  344. components: {
  345. NewStatementPrintTwo,
  346. NewStatementPrint,
  347. BreadCrumb,
  348. listPrint,
  349. allListPrint,
  350. invoicePrint,
  351. settlementPrint,
  352. },
  353. data() {
  354. return {
  355. orderObj: {},
  356. statementVisible: false,
  357. statementVisible9504: false,
  358. orderObj9504: {},
  359. crumbs: [
  360. {path: false, name: "门诊收费"},
  361. {path: false, name: "项目消费明细汇总"},
  362. ],
  363. tableData: [],
  364. limit: 10,
  365. page: 1,
  366. keywords: "",
  367. start_time: "",
  368. end_time: "",
  369. total: "",
  370. doctors: [],
  371. sort_type: 1,
  372. sort_types: [
  373. {value: 1, label: "处方时间"},
  374. {value: 2, label: "结算时间"},
  375. ],
  376. admin_user_id: "",
  377. listVisible: false,
  378. allListVisible: false,
  379. adminUserOptions: [],
  380. invoiceVisible: false,
  381. paramsObj: {},
  382. invoiceParams: {},
  383. settlementVisible: false,
  384. settlementObj: {},
  385. };
  386. },
  387. //判断列表页是否刷新
  388. beforeRouteEnter(to, from, next) {
  389. console.log(from, "beforeRouteEnter");
  390. if (from.path == "/outpatientCharges/summaryDetail") {
  391. next((vm) => {
  392. vm.page = vm.$store.getters.pagedata.list.page;
  393. vm.limit = vm.$store.getters.pagedata.list.limit;
  394. vm.keywords = vm.$store.getters.pagedata.list.keywords;
  395. vm.start_time = vm.$store.getters.pagedata.list.start_time;
  396. vm.end_time = vm.$store.getters.pagedata.list.end_time;
  397. vm.admin_user_id = vm.$store.getters.pagedata.list.admin_user_id;
  398. vm.p_type = 2;
  399. vm.sort_type = vm.$store.getters.pagedata.list.sort_type;
  400. setTimeout(() => {
  401. vm.getHisOrderList();
  402. }, 300)
  403. });
  404. } else {
  405. next();
  406. }
  407. },
  408. beforeRouteLeave(to, from, next) {
  409. if (to.path == "/outpatientCharges/summaryDetail") {
  410. console.log(to.path, "路由跳转判断");
  411. this.setStorage();
  412. next();
  413. } else {
  414. next();
  415. }
  416. },
  417. created() {
  418. this.fetchAllAdminUsers();
  419. this.getDoctorList();
  420. this.getHisOrderList();
  421. },
  422. methods: {
  423. setStorage() {
  424. this.$store.commit("SET_PAGEDATA", {
  425. page: this.page,
  426. limit: this.limit,
  427. keywords: this.keywords,
  428. start_time: this.start_time,
  429. end_time: this.end_time,
  430. type: this.admin_user_id || "",
  431. p_type: 2,
  432. sort_type: this.sort_type,
  433. });
  434. },
  435. getMedType(med_type) {
  436. var med_type = parseInt(med_type);
  437. switch (med_type) {
  438. case 11:
  439. return "普通门诊";
  440. break;
  441. case 12:
  442. return "门诊挂号";
  443. break;
  444. case 13:
  445. return "急诊";
  446. break;
  447. case 14:
  448. return "门诊特殊病";
  449. break;
  450. case 15:
  451. return "门诊统筹";
  452. break;
  453. case 16:
  454. return "门诊慢性病";
  455. break;
  456. case 21:
  457. return "普通住院";
  458. break;
  459. }
  460. },
  461. cancelUpload(row) {
  462. var that = this;
  463. axios
  464. .get("http://127.0.0.1:9532/zh/api/clearsettle", {
  465. params: {
  466. order_id: row.id,
  467. admin_user_id: this.$store.getters.xt_user.user.id,
  468. },
  469. })
  470. .then(function (response) {
  471. if (response.data.state == 0) {
  472. that.$message.error(response.data.msg);
  473. return false;
  474. } else {
  475. if (response.data.data.failed_code == -10) {
  476. // that.$message.error(response.data.data.msg)
  477. that
  478. .$confirm(response.data.data.msg, "医保错误信息", {
  479. confirmButtonText: "确 定",
  480. type: "warning",
  481. })
  482. .then(() => {
  483. })
  484. .catch(() => {
  485. });
  486. } else {
  487. that.$message.success("撤销成功");
  488. row.result.id = 0;
  489. }
  490. }
  491. })
  492. .catch(function (error) {
  493. });
  494. },
  495. uploadInfo(row) {
  496. var that = this;
  497. axios
  498. .get("http://127.0.0.1:9532/api/settlelist/get", {
  499. params: {
  500. order_id: row.id,
  501. admin_user_id: this.$store.getters.xt_user.user.id,
  502. },
  503. })
  504. .then(function (response) {
  505. if (response.data.state == 0) {
  506. that.$message.error(response.data.msg);
  507. return false;
  508. } else {
  509. if (response.data.data.failed_code == -10) {
  510. // that.$message.error(response.data.data.msg)
  511. that
  512. .$confirm(response.data.data.msg, "医保错误信息", {
  513. confirmButtonText: "确 定",
  514. type: "warning",
  515. })
  516. .then(() => {
  517. })
  518. .catch(() => {
  519. });
  520. } else {
  521. that.$message.success("上传成功");
  522. row.result.id = response.data.data.result.id;
  523. }
  524. }
  525. })
  526. .catch(function (error) {
  527. });
  528. },
  529. fetchAllAdminUsers() {
  530. fetchAllAdminUsers().then((response) => {
  531. if (response.data.state == 1) {
  532. this.adminUserOptions = response.data.data.users;
  533. }
  534. });
  535. },
  536. getName(admin_user_id) {
  537. for (let i = 0; i < this.adminUserOptions.length; i++) {
  538. if (this.adminUserOptions[i].id == admin_user_id) {
  539. return this.adminUserOptions[i].name;
  540. }
  541. }
  542. },
  543. toRefund(row) {
  544. if (row.his_patient.balance_accounts_type == 2) {
  545. this.$confirm("是否退费", "退费", {
  546. confirmButtonText: "确 定",
  547. cancelButtonText: "取 消",
  548. type: "warning",
  549. })
  550. .then(() => {
  551. let params = {
  552. order_id: row.id,
  553. patient_id: row.patient_id,
  554. record_time: this.getTimes(row.settle_accounts_date),
  555. };
  556. Refund(params).then((response) => {
  557. if (response.data.state == 0) {
  558. this.$message.error(response.data.msg);
  559. return false;
  560. } else {
  561. this.$message({message: "退费成功", type: "success"});
  562. this.getHisOrderList();
  563. }
  564. });
  565. })
  566. .catch(() => {
  567. });
  568. } else {
  569. var that = this;
  570. this.$confirm("是否退费", "退费", {
  571. confirmButtonText: "确 定",
  572. cancelButtonText: "取 消",
  573. type: "warning",
  574. })
  575. .then(() => {
  576. let params = {
  577. order_id: row.id,
  578. patient_id: row.patient_id,
  579. record_time: that.getTimes(row.settle_accounts_date),
  580. admin_user_id: that.$store.getters.xt_user.user.id,
  581. };
  582. axios
  583. .get("http://127.0.0.1:9532/api/refund/post", {
  584. params: params,
  585. })
  586. .then(function (response) {
  587. if (response.data.state == 0) {
  588. that.$message.error(response.data.msg);
  589. return false;
  590. } else {
  591. if (response.data.data.failed_code == -10) {
  592. // that.$message.error(response.data.data.msg)
  593. that
  594. .$confirm(response.data.data.msg, "医保错误信息", {
  595. confirmButtonText: "确 定",
  596. type: "warning",
  597. })
  598. .then(() => {
  599. })
  600. .catch(() => {
  601. });
  602. } else {
  603. that.$message({
  604. message: "退费成功",
  605. type: "success",
  606. duration: 5000,
  607. });
  608. that.getHisOrderList();
  609. }
  610. }
  611. })
  612. .catch(function (error) {
  613. });
  614. })
  615. .catch(() => {
  616. });
  617. }
  618. },
  619. toPrint(row) {
  620. // 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) {
  621. // if (row.mdtrt_id.indexOf('H') > -1) {
  622. // this.statementVisible9504 = true
  623. // let obj = {
  624. // order_id: row.id,
  625. // patient_id: row.patient_id,
  626. // record_time: this.getTimes(row.settle_accounts_date),
  627. // admin_user_id: this.$store.getters.xt_user.user.id
  628. // }
  629. // this.orderObj9504 = obj
  630. // } else {
  631. //
  632. // this.statementVisible9504 = true
  633. // let obj = {
  634. // order_id: row.id,
  635. // patient_id: row.patient_id,
  636. // record_time: this.getTimes(row.settle_accounts_date),
  637. // admin_user_id: this.$store.getters.xt_user.user.id,
  638. // balance_accounts_type: 2
  639. // }
  640. // this.orderObj9504 = obj
  641. // }
  642. //
  643. // } else {
  644. this.statementVisible = true;
  645. let obj = {
  646. order_id: row.id,
  647. settle_type: row.settle_type,
  648. start_time: row.settle_start_time,
  649. end_time: row.settle_end_time,
  650. balance_accounts_type: row.his_patient.balance_accounts_type,
  651. };
  652. this.orderObj = obj;
  653. },
  654. settlementPrint(row) {
  655. this.settlementVisible = true;
  656. let obj = {
  657. order_id: row.id,
  658. };
  659. this.settlementObj = obj;
  660. },
  661. export_detail_two() {
  662. let params = {};
  663. getHisDataTwo(params).then((response) => {
  664. if (response.data.state == 0) {
  665. this.$message.error(response.data.msg);
  666. return false;
  667. } else {
  668. let list = [];
  669. console.log(response.data.data.order)
  670. for (let i = 0; i < response.data.data.order.length; i++) {
  671. let order = response.data.data.order[i];
  672. for (let b = 0; b < order.info.length; b++) {
  673. let obj = {
  674. index: b + 1,
  675. org_name: "肇庆三鹤血液透析中心",
  676. name: order.psn_name,
  677. id_card_no: order.certno,
  678. level: "未定级",
  679. psn_type: order.psn_type,
  680. date: "2022年3月",
  681. start_time: order.his.in_hosptial_time,
  682. end_time: order.his.out_hosptial_time,
  683. total: order.info[b].det_item_fee_sumamt,
  684. fund_total: order.info[b].inscp_scp_amt,
  685. patient_id: order.info[b].patient_id,
  686. dialysis_time: this.getTimes(order.info[b].upload_date)
  687. }
  688. // if (order.info[b].advice_id > 0 && order.info[b].project_id == 0) {
  689. // obj["dialysis_time"] = this.getTimes(order.info[b].advice_date)
  690. // } else if (order.info[b].advice_id == 0 && order.info[b].project_id > 0) {
  691. // obj["dialysis_time"] = this.getTimes(order.info[b].record_date)
  692. // }
  693. if (order.psn_type == "11") {
  694. obj["psn_type"] = "职工在职"
  695. } else if (order.psn_type == "12") {
  696. obj["psn_type"] = "职工退休"
  697. } else if (order.psn_type == "13") {
  698. obj["psn_type"] = "离休"
  699. } else if (order.psn_type == "14") {
  700. obj["psn_type"] = "居民医保"
  701. } else if (order.psn_type == "15") {
  702. obj["psn_type"] = "居民医保"
  703. } else if (order.psn_type == "16") {
  704. obj["psn_type"] = "居民医保"
  705. }
  706. list.push(obj)
  707. }
  708. }
  709. console.log(list)
  710. var new_list = this.unique_two(list)
  711. for (let i = 0; i < new_list.length; i++) {
  712. let total = 0
  713. let fund_total = 0
  714. for (let b = 0; b < list.length; b++) {
  715. if (new_list[i].patient_id == list[b].patient_id && new_list[i].dialysis_time == list[b].dialysis_time) {
  716. total = total + list[b].total
  717. fund_total = fund_total + list[b].fund_total
  718. }
  719. }
  720. new_list[i].total = total.toFixed(2)
  721. new_list[i].fund_total = fund_total.toFixed(2)
  722. }
  723. console.log(new_list)
  724. var tarList = [];
  725. for (let i = 0; i < new_list.length; i++) {
  726. let obj = {
  727. "序号": i + 1,
  728. "医疗机构名称": new_list[i].org_name,
  729. "姓名": new_list[i].name,
  730. "身份证号": new_list[i].id_card_no,
  731. "医院等级": new_list[i].level,
  732. "参保类型": new_list[i].psn_type,
  733. "费用所属期": new_list[i].date,
  734. "开始就医时间": new_list[i].start_time,
  735. "结束就医时间": new_list[i].end_time,
  736. "透析日期": new_list[i].dialysis_time,
  737. "本次透析医疗总金额": new_list[i].total,
  738. "本次透析医保结算费用金额": new_list[i].fund_total,
  739. }
  740. tarList.push(obj)
  741. }
  742. import("@/vendor/Export2Excel").then((excel) => {
  743. const tHeader = [
  744. "序号",
  745. "医疗机构名称",
  746. "姓名",
  747. "身份证号",
  748. "医院等级",
  749. "参保类型",
  750. "费用所属期",
  751. "开始就医时间",
  752. "结束就医时间",
  753. "透析日期",
  754. "本次透析医疗总金额",
  755. "本次透析医保结算费用金额",
  756. ];
  757. const filterVal = [
  758. "序号",
  759. "医疗机构名称",
  760. "姓名",
  761. "身份证号",
  762. "医院等级",
  763. "参保类型",
  764. "费用所属期",
  765. "开始就医时间",
  766. "结束就医时间",
  767. "透析日期",
  768. "本次透析医疗总金额",
  769. "本次透析医保结算费用金额",
  770. ];
  771. const data = this.formatJson(filterVal, tarList);
  772. excel.export_json_to_excel({
  773. header: tHeader,
  774. data,
  775. filename: "消费明细",
  776. });
  777. });
  778. }
  779. });
  780. },
  781. export_detail_three() {
  782. let params = {};
  783. getHisDataThree(params).then((response) => {
  784. if (response.data.state == 0) {
  785. this.$message.error(response.data.msg);
  786. return false;
  787. } else {
  788. let list = [];
  789. for (let i = 0; i < response.data.data.order.length; i++) {
  790. let order = response.data.data.order[i];
  791. let data = this.setMonthPrescription(order.info)
  792. // console.log(data)
  793. for (let b = 0; b < data.length; b++) {
  794. let obj = {
  795. name: order.patient.name,
  796. id_card_no: order.patient.id_card_no,
  797. year: "2022",
  798. month: "8",
  799. code: data[b].code,
  800. pric: data[b].count * data[b].price,
  801. item_name: data[b].name,
  802. unit: data[b].unit,
  803. count: data[b].count,
  804. }
  805. if (order.insutype == "310") {
  806. obj["insutype"] = "职工"
  807. } else if (order.insutype == "390") {
  808. obj["insutype"] = "城乡"
  809. }
  810. list.push(obj)
  811. }
  812. }
  813. var tarList = []
  814. for (let i = 0; i < list.length; i++) {
  815. if (list[i].pric > 0) {
  816. let obj = {
  817. "姓名": list[i].name,
  818. "身份证号": list[i].id_card_no,
  819. "医保类型": list[i].insutype,
  820. "年": list[i].year,
  821. "月": list[i].month,
  822. "药品编码": list[i].code,
  823. "名称": list[i].item_name,
  824. "单位": list[i].unit,
  825. "数量": list[i].count,
  826. "金额": list[i].pric,
  827. }
  828. tarList.push(obj)
  829. }
  830. }
  831. import("@/vendor/Export2Excel").then((excel) => {
  832. const tHeader = [
  833. "姓名",
  834. "身份证号",
  835. "医保类型",
  836. "年",
  837. "月",
  838. "药品编码",
  839. "名称",
  840. "单位",
  841. "数量",
  842. "金额",
  843. ];
  844. const filterVal = [
  845. "姓名",
  846. "身份证号",
  847. "医保类型",
  848. "年",
  849. "月",
  850. "药品编码",
  851. "名称",
  852. "单位",
  853. "数量",
  854. "金额",
  855. ];
  856. const data = this.formatJson(filterVal, tarList);
  857. excel.export_json_to_excel({
  858. header: tHeader,
  859. data,
  860. filename: "消费明细",
  861. });
  862. });
  863. }
  864. });
  865. },
  866. export_detail_four() {
  867. let params = {};
  868. getHisDataFive(params).then((response) => {
  869. if (response.data.state == 0) {
  870. this.$message.error(response.data.msg);
  871. return false;
  872. } else {
  873. let list = [];
  874. for (let i = 0; i < response.data.data.order.length; i++) {
  875. let order = response.data.data.order[i];
  876. // console.log(data)
  877. for (let b = 0; b < order.info.length; b++) {
  878. let obj = {
  879. org_name: "生命之源血液透析中心",
  880. name: order.patient.name,
  881. id_card_no: order.patient.id_card_no,
  882. jiuyi_date: this.getTimes(order.settle_accounts_date),
  883. dianhua: order.patient.phone,
  884. pric: order.info[b].pric,
  885. cnt: order.info[b].cnt,
  886. det_item_fee_sumamt: order.info[b].det_item_fee_sumamt,
  887. zhenduan: "慢性肾衰竭",
  888. shifouyibao: "是",
  889. doctor: "高华",
  890. jiesuanfangshi: "医保",
  891. jizhangshijian: order.setl_time,
  892. feiyongheji: order.medfee_sumamt,
  893. jizhangjine: order.fund_pay_sumamt,
  894. xianjinheji: order.psn_cash_pay,
  895. }
  896. if (order.is_medicine_insurance == 1) {
  897. obj.jiesuanfangshi = "是"
  898. } else {
  899. obj.jiesuanfangshi = "否"
  900. }
  901. if (order.info[b].advice_id > 0 && order.info[b].project_id == 0) {
  902. obj["yibaomulucode"] = order.info[b].advices.drug.medical_insurance_number
  903. obj["yibaomuluname"] = order.info[b].advices.drug.drug_name
  904. obj["neibumulucode"] = order.info[b].advices.drug.id
  905. obj["neibumuluname"] = order.info[b].advices.drug.drug_name
  906. }
  907. if (order.info[b].advice_id == 0 && order.info[b].project_id > 0) {
  908. if (order.info[b].project.type == 2) {
  909. obj["yibaomulucode"] = order.info[b].project.project.medical_code
  910. obj["yibaomuluname"] = order.info[b].project.project.project_name
  911. obj["neibumulucode"] = order.info[b].project.project.id
  912. obj["neibumuluname"] = order.info[b].project.project.project_name
  913. } else {
  914. obj["yibaomulucode"] = order.info[b].project.good_info.medical_insurance_number
  915. obj["yibaomuluname"] = order.info[b].project.good_info.good_name
  916. obj["neibumulucode"] = order.info[b].project.good_info.id
  917. obj["neibumuluname"] = order.info[b].project.good_info.good_name
  918. }
  919. }
  920. var thisLen = order.patient.id_card_no.length
  921. var birth = ''
  922. if (thisLen == 15) {
  923. birth = '19' + order.patient.id_card_no.substr(6, 6)
  924. } else {
  925. birth = order.patient.id_card_no.substr(6, 8)
  926. }
  927. var births =
  928. birth.substr(0, 4) +
  929. '-' +
  930. birth.substr(4, 2) +
  931. '-' +
  932. birth.substr(6, 2)
  933. obj["age"] = jsGetAge(births, '-')
  934. if (order.patient.gender == 1) {
  935. obj['gender'] = "男"
  936. } else {
  937. obj['gender'] = "女"
  938. }
  939. list.push(obj)
  940. }
  941. }
  942. var tarList = []
  943. for (let i = 0; i < list.length; i++) {
  944. if (list[i].pric > 0) {
  945. let obj = {
  946. "机构编码": list[i].org_name,
  947. "就诊人姓名": list[i].name,
  948. "性别": list[i].gender,
  949. "年龄": list[i].age,
  950. "身份证号码": list[i].id_card_no,
  951. "就医日期": list[i].jiuyi_date,
  952. "电话": list[i].dianhua,
  953. "医保目录编码": list[i].yibaomulucode,
  954. "医保目录名称": list[i].yibaomuluname,
  955. "机构内部编码": list[i].neibumulucode,
  956. "机构内部名称": list[i].neibumuluname,
  957. "就诊项目明细": list[i].yibaomuluname,
  958. "单价": list[i].pric,
  959. "数量": list[i].cnt,
  960. "金额": list[i].det_item_fee_sumamt,
  961. "费用合计": list[i].feiyongheji,
  962. "记账金额": list[i].jizhangjine,
  963. "现金合计": list[i].xianjinheji,
  964. "结算方式": list[i].jiesuanfangshi,
  965. "接诊医生": list[i].doctor,
  966. "诊断": list[i].zhenduan,
  967. "记账时间": list[i].jizhangshijian,
  968. "是否医保": list[i].shifouyibao,
  969. }
  970. tarList.push(obj)
  971. }
  972. }
  973. import("@/vendor/Export2Excel").then((excel) => {
  974. const tHeader = [
  975. "机构编码",
  976. "就诊人姓名",
  977. "性别",
  978. "年龄",
  979. "身份证号码",
  980. "就医日期",
  981. "电话",
  982. "医保目录编码",
  983. "医保目录名称",
  984. "机构内部编码",
  985. "机构内部名称",
  986. "就诊项目明细",
  987. "单价",
  988. "数量",
  989. "金额",
  990. "费用合计",
  991. "记账金额",
  992. "现金合计",
  993. "结算方式",
  994. "接诊医生",
  995. "诊断",
  996. "记账时间",
  997. "是否医保",
  998. ];
  999. const filterVal = [
  1000. "机构编码",
  1001. "就诊人姓名",
  1002. "性别",
  1003. "年龄",
  1004. "身份证号码",
  1005. "就医日期",
  1006. "电话",
  1007. "医保目录编码",
  1008. "医保目录名称",
  1009. "机构内部编码",
  1010. "机构内部名称",
  1011. "就诊项目明细",
  1012. "单价",
  1013. "数量",
  1014. "金额",
  1015. "费用合计",
  1016. "记账金额",
  1017. "现金合计",
  1018. "结算方式",
  1019. "接诊医生",
  1020. "诊断",
  1021. "记账时间",
  1022. "是否医保",
  1023. ];
  1024. const data = this.formatJson(filterVal, tarList);
  1025. excel.export_json_to_excel({
  1026. header: tHeader,
  1027. data,
  1028. filename: "消费明细",
  1029. });
  1030. });
  1031. }
  1032. });
  1033. },
  1034. export_detail_five() {
  1035. let params = {};
  1036. getHisDataFive(params).then((response) => {
  1037. if (response.data.state == 0) {
  1038. this.$message.error(response.data.msg);
  1039. return false;
  1040. } else {
  1041. let list = [];
  1042. for (let i = 0; i < response.data.data.order.length; i++) {
  1043. let order = response.data.data.order[i];
  1044. // console.log(data)
  1045. for (let b = 0; b < order.info.length; b++) {
  1046. if (order.info[b].project.project.cost_classify == 3) {
  1047. let obj = {
  1048. p_name: order.psn_name,
  1049. code: order.info[b].project.project.id,
  1050. name: order.info[b].project.project.project_name,
  1051. unit: order.info[b].project.project.unit,
  1052. jiage: order.info[b].det_item_fee_sumamt,
  1053. name_yibao: order.info[b].project.project.project_name,
  1054. guoma: order.info[b].project.project.medical_code,
  1055. zifu: order.info[b].selfpay_prop,
  1056. cnt: order.info[b].cnt,
  1057. pric: order.info[b].pric,
  1058. gerenzifu: order.info[b].fulamt_ownpay_amt + order.info[b].preselfpay_amt,
  1059. baoxiaojine: order.info[b].inscp_scp_amt,
  1060. }
  1061. if (order.info[b].chrgitm_lv == "01") {
  1062. obj["yibao_dengji"] = "甲"
  1063. } else if (order.info[b].chrgitm_lv == "02") {
  1064. obj["yibao_dengji"] = "乙"
  1065. } else {
  1066. obj["yibao_dengji"] = "丙"
  1067. }
  1068. list.push(obj)
  1069. }
  1070. }
  1071. }
  1072. console.log(list)
  1073. var tarList = []
  1074. for (let i = 0; i < list.length; i++) {
  1075. let obj = {
  1076. "姓名": list[i].p_name,
  1077. "医保目录编码": list[i].guoma,
  1078. "名称": list[i].name,
  1079. "单位": list[i].unit,
  1080. "价格": list[i].jiage,
  1081. "医保等级": list[i].yibao_dengji,
  1082. "自付比例": list[i].zifu,
  1083. "数量": list[i].cnt,
  1084. "金额": list[i].pric,
  1085. "个人自付": list[i].gerenzifu,
  1086. "报销金额": list[i].baoxiaojine,
  1087. }
  1088. tarList.push(obj)
  1089. }
  1090. import("@/vendor/Export2Excel").then((excel) => {
  1091. const tHeader = [
  1092. "姓名",
  1093. "医保目录编码",
  1094. "名称",
  1095. "单位",
  1096. "价格",
  1097. "医保等级",
  1098. "自付比例",
  1099. "数量",
  1100. "金额",
  1101. "个人自付",
  1102. "报销金额",
  1103. ];
  1104. const filterVal = [
  1105. "姓名",
  1106. "医保目录编码",
  1107. "名称",
  1108. "单位",
  1109. "价格",
  1110. "医保等级",
  1111. "自付比例",
  1112. "数量",
  1113. "金额",
  1114. "个人自付",
  1115. "报销金额",
  1116. ];
  1117. const data = this.formatJson(filterVal, tarList);
  1118. excel.export_json_to_excel({
  1119. header: tHeader,
  1120. data,
  1121. filename: "消费明细",
  1122. });
  1123. });
  1124. }
  1125. });
  1126. },
  1127. export_detail_six() {
  1128. let params = {};
  1129. getHisDataSix(params).then((response) => {
  1130. if (response.data.state == 0) {
  1131. this.$message.error(response.data.msg);
  1132. return false;
  1133. } else {
  1134. let list = [];
  1135. let new_list = [];
  1136. for (let i = 0; i < response.data.data.order.length; i++) {
  1137. let order = response.data.data.order[i];
  1138. for (let b = 0; b < order.info.length; b++) {
  1139. new_list.push(order.info[b])
  1140. }
  1141. }
  1142. var infos = this.setMonthPrescriptiontwo(new_list)
  1143. for (let b = 0; b < infos.length; b++) {
  1144. list.push(infos[b])
  1145. }
  1146. var tarList = []
  1147. for (let i = 0; i < list.length; i++) {
  1148. let obj = {
  1149. "周期": "2022年第三季度",
  1150. "类别": "门诊",
  1151. "医保目录编码": list[i].code,
  1152. "医保目录名称": list[i].name,
  1153. "本机构目录编码": list[i].code,
  1154. "本机构目录名称": list[i].name,
  1155. "使用例数": list[i].count,
  1156. "价格": list[i].price,
  1157. }
  1158. tarList.push(obj)
  1159. }
  1160. import("@/vendor/Export2Excel").then((excel) => {
  1161. const tHeader = [
  1162. "周期",
  1163. "类别",
  1164. "医保目录编码",
  1165. "医保目录名称",
  1166. "本机构目录编码",
  1167. "本机构目录名称",
  1168. "使用例数",
  1169. "价格",
  1170. ];
  1171. const filterVal = [
  1172. "周期",
  1173. "类别",
  1174. "医保目录编码",
  1175. "医保目录名称",
  1176. "本机构目录编码",
  1177. "本机构目录名称",
  1178. "使用例数",
  1179. "价格",
  1180. ];
  1181. const data = this.formatJson(filterVal, tarList);
  1182. excel.export_json_to_excel({
  1183. header: tHeader,
  1184. data,
  1185. filename: "消费明细",
  1186. });
  1187. });
  1188. }
  1189. });
  1190. },
  1191. export_detail_seven() {
  1192. let params = {};
  1193. handleData10106(params).then((response) => {
  1194. if (response.data.state == 0) {
  1195. this.$message.error(response.data.msg);
  1196. return false;
  1197. } else {
  1198. let new_orders = []
  1199. for (let i = 0; i < response.data.data.order.length; i++) {
  1200. let order = response.data.data.order[i];
  1201. let islvguo = false
  1202. for (let b = 0; b < order.info.length; b++) {
  1203. if (order.info[b].project.project.id == 372) {
  1204. islvguo = true
  1205. }
  1206. }
  1207. if(islvguo){
  1208. new_orders.push(order)
  1209. }
  1210. }
  1211. console.log(new_orders.length)
  1212. let list = [];
  1213. for (let i = 0; i < new_orders.length; i++) {
  1214. let order = response.data.data.order[i];
  1215. let obj = {
  1216. md: order.mdtrt_id,
  1217. name: order.patient.name,
  1218. kaichu: this.getTimes(order.settle_start_time),
  1219. xianzhong: "",
  1220. yingshou: order.medfee_sumamt,
  1221. yibaotongchou: order.hifp_pay,
  1222. dabingjijin: order.hifmi_pay,
  1223. yiliaojiuzhu: order.maf_pay,
  1224. gongwujijin: order.cvlserv_pay,
  1225. gerenzhifu: order.psn_part_amt,
  1226. zongjine: order.medfee_sumamt,
  1227. setl_time: order.setl_time,
  1228. jiesuanleixing: '医保',
  1229. xueyetouxilvguo: 480,
  1230. lvhuana: 3,
  1231. zhihuanguan: 40,
  1232. good_name: "",
  1233. }
  1234. if (order.insutype == "390") {
  1235. obj.xianzhong = "城乡"
  1236. } else {
  1237. obj.xianzhong = "职工"
  1238. }
  1239. for (let b = 0; b < order.info.length; b++) {
  1240. if (order.info[b].advice_id == 0 && order.info[b].project_id > 0) {
  1241. if (order.info[b].project.type == 2) {
  1242. 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) {
  1243. obj.good_name = this.GetGoodName(order.info[b].project.project.id)
  1244. }
  1245. } else if (order.info[b].project.type == 3) {
  1246. 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) {
  1247. obj.good_name = this.GetGoodName(order.info[b].project.good_info.id)
  1248. }
  1249. }
  1250. }
  1251. }
  1252. list.push(obj)
  1253. }
  1254. var tarList = []
  1255. for (let i = 0; i < list.length; i++) {
  1256. if (list[i].good_name.length > 0) {
  1257. let obj = {
  1258. "序号": i + 1,
  1259. "就诊号": list[i].md,
  1260. "患者姓名": list[i].name,
  1261. "开处时间": list[i].kaichu,
  1262. "项目(透析器)": list[i].good_name,
  1263. "血液透析滤过": list[i].xueyetouxilvguo,
  1264. "0.9%氯化钠注射液": list[i].lvhuana,
  1265. "置换液管": list[i].zhihuanguan,
  1266. "险种类型": list[i].xianzhong,
  1267. "应收金额": list[i].yingshou,
  1268. "医保统筹金额": list[i].yibaotongchou,
  1269. "大病基金金额": list[i].dabingjijin,
  1270. "医疗救助金额": list[i].yiliaojiuzhu,
  1271. "公务员基金": list[i].gongwujijin,
  1272. "个人支付基金": list[i].gerenzhifu,
  1273. "总金额": list[i].zongjine,
  1274. "收费时间": list[i].setl_time,
  1275. "结算类型": list[i].jiesuanleixing,
  1276. "收费状态": "已收费",
  1277. }
  1278. tarList.push(obj)
  1279. }
  1280. }
  1281. import("@/vendor/Export2Excel").then((excel) => {
  1282. const tHeader = [
  1283. "序号",
  1284. "就诊号",
  1285. "患者姓名",
  1286. "开处时间",
  1287. "项目(透析器)",
  1288. "血液透析滤过",
  1289. "0.9%氯化钠注射液",
  1290. "置换液管",
  1291. "险种类型",
  1292. "应收金额",
  1293. "医保统筹金额",
  1294. "大病基金金额",
  1295. "医疗救助金额",
  1296. "公务员基金",
  1297. "个人支付基金",
  1298. "总金额",
  1299. "收费时间",
  1300. "结算类型",
  1301. "收费状态",
  1302. ];
  1303. const filterVal = [
  1304. "序号",
  1305. "就诊号",
  1306. "患者姓名",
  1307. "开处时间",
  1308. "项目(透析器)",
  1309. "血液透析滤过",
  1310. "0.9%氯化钠注射液",
  1311. "置换液管",
  1312. "险种类型",
  1313. "应收金额",
  1314. "医保统筹金额",
  1315. "大病基金金额",
  1316. "医疗救助金额",
  1317. "公务员基金",
  1318. "个人支付基金",
  1319. "总金额",
  1320. "收费时间",
  1321. "结算类型",
  1322. "收费状态",
  1323. ];
  1324. const data = this.formatJson(filterVal, tarList);
  1325. excel.export_json_to_excel({
  1326. header: tHeader,
  1327. data,
  1328. filename: "消费明细",
  1329. });
  1330. });
  1331. }
  1332. });
  1333. },
  1334. getType(med_chrgitm_type) {
  1335. switch (med_chrgitm_type) {
  1336. case '01':
  1337. return '床位费'
  1338. break
  1339. case '02':
  1340. return '诊察费'
  1341. break
  1342. case '03':
  1343. return '检查费'
  1344. break
  1345. case '04':
  1346. return '化验费'
  1347. break
  1348. case '05':
  1349. return '治疗费'
  1350. break
  1351. case '06':
  1352. return '手术费'
  1353. break
  1354. case '07':
  1355. return '护理费'
  1356. break
  1357. case '08':
  1358. return '材料费'
  1359. break
  1360. case '09':
  1361. return '西药费'
  1362. break
  1363. case '10':
  1364. return '中药饮片费'
  1365. break
  1366. case '11':
  1367. return '中成药费'
  1368. break
  1369. case '12':
  1370. return '一般诊疗费'
  1371. break
  1372. case '13':
  1373. return '挂号费'
  1374. break
  1375. case '14':
  1376. return '其他费'
  1377. break
  1378. case '0':
  1379. return '其他费'
  1380. break
  1381. }
  1382. },
  1383. export_detail_ten() {
  1384. let params = {
  1385. start_time:this.start_time,
  1386. end_time:this.end_time
  1387. };
  1388. handleData10106(params).then((response) => {
  1389. if (response.data.state == 0) {
  1390. this.$message.error(response.data.msg);
  1391. return false;
  1392. } else {
  1393. let list = [];
  1394. for (let i = 0; i < response.data.data.order.length; i++) {
  1395. let order = response.data.data.order[i];
  1396. let med_chrgitm_types = []
  1397. for (let b = 0; b < order.info.length; b++) {
  1398. med_chrgitm_types.push(order.info[b].med_chrgitm_type)
  1399. const obj = {}
  1400. med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
  1401. obj[next] ? '' : obj[next] = true && cur.push(next)
  1402. return cur
  1403. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1404. }
  1405. for (let i = 0; i < med_chrgitm_types.length; i++) {
  1406. let price = 0
  1407. let obj = {
  1408. number:"440722196501072316",
  1409. name: order.patient.name,
  1410. idNo: "",
  1411. med_chrgitm_name:this.getType(med_chrgitm_types[i]),
  1412. price:"",
  1413. remark:"",
  1414. }
  1415. if(i == 0){
  1416. obj.remark = "就诊日期:" + this.getTimes(order.settle_accounts_date) + " 医保报销: "+order.fund_pay_sumamt + " 现金:"+order.psn_cash_pay
  1417. obj.idNo = order.patient.id_card_no
  1418. }else{
  1419. obj.remark = ""
  1420. obj.idNo = ""
  1421. }
  1422. for (let b = 0; b < order.info.length; b++) {
  1423. if(med_chrgitm_types[i] == order.info[b].med_chrgitm_type){
  1424. price = price + order.info[b].det_item_fee_sumamt
  1425. }
  1426. }
  1427. obj.price = price
  1428. list.push(obj)
  1429. }
  1430. }
  1431. let list_two = []
  1432. const obj = {}
  1433. for(let i = 0; i < list.length; i++){
  1434. console.log(list[i])
  1435. list_two.push(list[i].name)
  1436. }
  1437. list_two = list_two.reduce((cur, next) => {
  1438. obj[next] ? '' : obj[next] = true && cur.push(next)
  1439. return cur
  1440. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1441. for(let i = 0; i < list_two.length; i++){
  1442. for(let b = 0; b < list.length; b++){
  1443. if(list_two[i] == list[b].name){
  1444. list[b]['index'] = i+1
  1445. }
  1446. }
  1447. }
  1448. var tarList = []
  1449. for (let i = 0; i < list.length; i++) {
  1450. let obj = {
  1451. "订单序号": list[i].index,
  1452. "订单号码":"",
  1453. "购方名称": list[i].name,
  1454. "购方纳税人识别号":list[i].idNo,
  1455. "开户行及账号":"",
  1456. "地址电话":"",
  1457. "税收编码":"3070202000000000000",
  1458. "商品名称": list[i].med_chrgitm_name,
  1459. "规格型号":"",
  1460. "计量单位":"",
  1461. "数量":"",
  1462. "单价":"",
  1463. "金额": list[i].price,
  1464. "税率":"0%",
  1465. "优惠政策":"普通零税率",
  1466. "税额":"0",
  1467. "备注": list[i].remark,
  1468. "电子邮箱":"",
  1469. }
  1470. tarList.push(obj)
  1471. }
  1472. import("@/vendor/Export2Excel").then((excel) => {
  1473. const tHeader = [
  1474. "订单序号",
  1475. "订单号码",
  1476. "购方名称",
  1477. "购方纳税人识别号",
  1478. "开户行及账号",
  1479. "地址电话",
  1480. "税收编码",
  1481. "商品名称",
  1482. "规格型号",
  1483. "计量单位",
  1484. "数量",
  1485. "单价",
  1486. "金额",
  1487. "税率",
  1488. "优惠政策",
  1489. "税额",
  1490. "备注",
  1491. "电子邮箱",
  1492. ];
  1493. const filterVal = [
  1494. "订单序号",
  1495. "订单号码",
  1496. "购方名称",
  1497. "购方纳税人识别号",
  1498. "开户行及账号",
  1499. "地址电话",
  1500. "税收编码",
  1501. "商品名称",
  1502. "规格型号",
  1503. "计量单位",
  1504. "数量",
  1505. "单价",
  1506. "金额",
  1507. "税率",
  1508. "优惠政策",
  1509. "税额",
  1510. "备注",
  1511. "电子邮箱",
  1512. ];
  1513. const data = this.formatJson(filterVal, tarList);
  1514. excel.export_json_to_excel({
  1515. header: tHeader,
  1516. data,
  1517. filename: "消费明细",
  1518. });
  1519. });
  1520. }
  1521. });
  1522. },
  1523. GetGoodName(id) {
  1524. switch (id) {
  1525. case 254:
  1526. return "空心纤维透析器REXEED-18UC(旭化成)"
  1527. break
  1528. case 253:
  1529. return "空心纤维透析器REXEED-15UC(旭化成)"
  1530. break
  1531. case 250:
  1532. return "聚砜膜透析滤过器-XevontaHI18(贝朗)"
  1533. break
  1534. case 249:
  1535. return "聚砜膜透析滤过器-XevontaHI15(贝朗)"
  1536. break
  1537. case 1478:
  1538. return "聚砜膜透析滤过器-XevontaHI15(贝朗)"
  1539. break
  1540. case 1479:
  1541. return "聚砜膜透析滤过器-XevontaHI18(贝朗)"
  1542. break
  1543. case 1482:
  1544. return "空心纤维透析器REXEED-15UC(旭化成)"
  1545. break
  1546. case 1483:
  1547. return "REXEED-18UC(旭化成)"
  1548. break
  1549. case 2577:
  1550. return "空心纤维透析器(FB-15U)(尼普洛)"
  1551. break
  1552. case 2578:
  1553. return "空心纤维透析器(FB-17U)(尼普洛)"
  1554. break
  1555. case 2058:
  1556. return "中空纤维透析器CTA-1500"
  1557. break
  1558. case 2059:
  1559. return "中空纤维透析器CTA-2000"
  1560. break
  1561. break
  1562. }
  1563. },
  1564. unique_two(array) {
  1565. // res用来存储结果
  1566. var res = []
  1567. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  1568. for (var j = 0, resLen = res.length; j < resLen; j++) {
  1569. if (array[i].patient_id === res[j].patient_id && array[i].dialysis_time === res[j].dialysis_time) {
  1570. break
  1571. }
  1572. }
  1573. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  1574. if (j === resLen) {
  1575. res.push(array[i])
  1576. }
  1577. }
  1578. return res
  1579. },
  1580. export_detail() {
  1581. let params = {
  1582. start_time: this.start_time,
  1583. end_time: this.end_time,
  1584. p_type: 2,
  1585. };
  1586. getExportConsumeDetailList(params).then((response) => {
  1587. if (response.data.state == 0) {
  1588. this.$message.error(response.data.msg);
  1589. return false;
  1590. } else {
  1591. let list = [];
  1592. for (let i = 0; i < response.data.data.order.length; i++) {
  1593. let order = response.data.data.order[i];
  1594. let number = "";
  1595. let name = "";
  1596. let department = "";
  1597. let doctor_name = "";
  1598. let balance_accounts = "";
  1599. let order_status = "";
  1600. let charge_name = "";
  1601. let insutypeName = "";
  1602. let time = "";
  1603. if (
  1604. order.his_patient != null &&
  1605. order.his_patient.number.length > 0
  1606. ) {
  1607. number = order.his_patient.number;
  1608. }
  1609. if (order.his_patient != null) {
  1610. if (order.his_patient.balance_accounts_type == 2) {
  1611. balance_accounts = "自费";
  1612. }
  1613. if (order.his_patient.balance_accounts_type == 1) {
  1614. balance_accounts = "医保";
  1615. }
  1616. }
  1617. if (order.patient != null && order.patient.name.length > 0) {
  1618. name = order.patient.name;
  1619. }
  1620. if (
  1621. order.p_info != null &&
  1622. order.p_info.department != null &&
  1623. order.p_info.department.name.length > 0
  1624. ) {
  1625. department = order.p_info.department.name;
  1626. }
  1627. if (order.p_info != null && order.p_info.doctor.length > 0) {
  1628. doctor_name = order.p_info.doctor;
  1629. }
  1630. if (order.creator != null) {
  1631. charge_name = this.getName(order.creator);
  1632. }
  1633. if (order.insutype == "390") {
  1634. insutypeName = "城乡居民基本医疗保险";
  1635. } else if (order.insutype == "310") {
  1636. insutypeName = "职工基本医疗保险";
  1637. }
  1638. if (order.order_status == 1) {
  1639. order_status = "待结算";
  1640. }
  1641. if (order.order_status == 2) {
  1642. order_status = "已结算";
  1643. }
  1644. if (order.order_status == 3) {
  1645. order_status = "已退费";
  1646. }
  1647. if (order.settle_type == 2) {
  1648. time = this.getTimes(order.settle_start_time);
  1649. } else {
  1650. time = this.getTimes(order.settle_accounts_date);
  1651. }
  1652. var hifmi_pay = 0.0;
  1653. if (order.setl_detail && order.setl_detail.length > 0) {
  1654. var jsonObj = JSON.parse(order.setl_detail);
  1655. console.log(jsonObj);
  1656. if (jsonObj != null) {
  1657. for (let i = 0; i < jsonObj.length; i++) {
  1658. if (order.insutype == "310") {
  1659. if (jsonObj[i].fund_pay_type == "310300") {
  1660. hifmi_pay = jsonObj[i].fund_payamt;
  1661. }
  1662. } else if (order.insutype == "390") {
  1663. if (order.fund_pay_type == "390200") {
  1664. hifmi_pay = jsonObj[i].fund_payamt;
  1665. }
  1666. }
  1667. }
  1668. }
  1669. }
  1670. var hifmi_pay = 0.0;
  1671. console.log(order.setl_detail);
  1672. if (order.setl_detail && order.setl_detail.length > 0) {
  1673. var jsonObj = JSON.parse(order.setl_detail);
  1674. if (jsonObj != null) {
  1675. for (let i = 0; i < jsonObj.length; i++) {
  1676. if (order.insutype == "310") {
  1677. if (jsonObj[i].fund_pay_type == "310300") {
  1678. hifmi_pay = jsonObj[i].fund_payamt;
  1679. }
  1680. }
  1681. if (order.insutype == "390") {
  1682. if (jsonObj[i].fund_pay_type == "390200") {
  1683. hifmi_pay = jsonObj[i].fund_payamt;
  1684. }
  1685. }
  1686. }
  1687. }
  1688. }
  1689. let insuplc_admdvs_name = ""
  1690. if (order.his_patient.insuplc_admdvs == "440703"){
  1691. insuplc_admdvs_name = "蓬江区"
  1692. } else if (order.his_patient.insuplc_admdvs == "440704"){
  1693. insuplc_admdvs_name = "江海区"
  1694. } else if (order.his_patient.insuplc_admdvs == "440705"){
  1695. insuplc_admdvs_name = "新会区"
  1696. }else if (order.his_patient.insuplc_admdvs == "440781"){
  1697. insuplc_admdvs_name = "台山市"
  1698. }else if (order.his_patient.insuplc_admdvs == "440783"){
  1699. insuplc_admdvs_name = "开平市"
  1700. }else if (order.his_patient.insuplc_admdvs == "440784"){
  1701. insuplc_admdvs_name = "鹤山市"
  1702. }else if (order.his_patient.insuplc_admdvs == "440785"){
  1703. insuplc_admdvs_name = "恩平市"
  1704. }else if (order.his_patient.insuplc_admdvs == "440799"){
  1705. insuplc_admdvs_name = "市直"
  1706. }
  1707. let obj = {
  1708. 就诊号: order.mdtrt_id,
  1709. 患者姓名: name,
  1710. 开处时间: time,
  1711. 险种类型: insutypeName,
  1712. 参保所属医保区划: order.his_patient.insuplc_admdvs,
  1713. 属地名称: insuplc_admdvs_name,
  1714. 应收金额: order.medfee_sumamt,
  1715. 实收金额: order.medfee_sumamt,
  1716. 医保统筹金额: order.hifp_pay,
  1717. 大额基金金额: order.hifob_pay,
  1718. 大病基金金额: hifmi_pay,
  1719. 补充保险基金金额: order.hifes_pay,
  1720. 医疗救助基金金额: order.maf_pay,
  1721. 公务员基金: order.cvlserv_pay,
  1722. 个人支付基金: order.psn_cash_pay,
  1723. 个人账户支付金额: order.acct_pay,
  1724. 科室: department,
  1725. 医生姓名: doctor_name,
  1726. 收费类别: balance_accounts,
  1727. 收费者姓名: charge_name,
  1728. 总金额: order.medfee_sumamt,
  1729. 现金支付: "",
  1730. 账户支付: "",
  1731. 支付宝支付: "",
  1732. 微信支付: "",
  1733. 其他支付: "",
  1734. 收费时间: order.setl_time,
  1735. 收费状态: order_status,
  1736. 退费日期: "",
  1737. };
  1738. list.push(obj);
  1739. }
  1740. import("@/vendor/Export2Excel").then((excel) => {
  1741. const tHeader = [
  1742. "就诊号",
  1743. "患者姓名",
  1744. "开处时间",
  1745. "险种类型",
  1746. "参保所属医保区划",
  1747. "属地名称",
  1748. "应收金额",
  1749. "实收金额",
  1750. "医保统筹金额",
  1751. "大额基金金额",
  1752. "大病基金金额",
  1753. "补充保险基金金额",
  1754. "医疗救助基金金额",
  1755. "公务员基金",
  1756. "个人支付基金",
  1757. "个人账户支付金额",
  1758. "科室",
  1759. "医生姓名",
  1760. "收费类别",
  1761. "收费者姓名",
  1762. "总金额",
  1763. "现金支付",
  1764. "账户支付",
  1765. "支付宝支付",
  1766. "微信支付",
  1767. "其他支付",
  1768. "收费时间",
  1769. "收费状态",
  1770. "退费日期",
  1771. ];
  1772. const filterVal = [
  1773. "就诊号",
  1774. "患者姓名",
  1775. "开处时间",
  1776. "险种类型",
  1777. "参保所属医保区划",
  1778. "属地名称",
  1779. "应收金额",
  1780. "实收金额",
  1781. "医保统筹金额",
  1782. "大额基金金额",
  1783. "大病基金金额",
  1784. "补充保险基金金额",
  1785. "医疗救助基金金额",
  1786. "公务员基金",
  1787. "个人支付基金",
  1788. "个人账户支付金额",
  1789. "科室",
  1790. "医生姓名",
  1791. "收费类别",
  1792. "收费者姓名",
  1793. "总金额",
  1794. "现金支付",
  1795. "账户支付",
  1796. "支付宝支付",
  1797. "微信支付",
  1798. "其他支付",
  1799. "收费时间",
  1800. "收费状态",
  1801. "退费日期",
  1802. ];
  1803. const data = this.formatJson(filterVal, list);
  1804. excel.export_json_to_excel({
  1805. header: tHeader,
  1806. data,
  1807. filename: "消费明细",
  1808. });
  1809. });
  1810. }
  1811. });
  1812. },
  1813. formatJson(filterVal, jsonData) {
  1814. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1815. },
  1816. changeSortType() {
  1817. this.page = 1;
  1818. this.keywords = "";
  1819. this.getHisOrderList();
  1820. },
  1821. changeDoctor() {
  1822. this.page = 1;
  1823. this.keywords = "";
  1824. this.getHisOrderList();
  1825. },
  1826. handleSizeChange(limit) {
  1827. this.limit = limit;
  1828. this.getHisOrderList();
  1829. },
  1830. handleCurrentChange(page) {
  1831. this.page = page;
  1832. this.getHisOrderList();
  1833. },
  1834. handleStartTimeChange() {
  1835. this.page = 1;
  1836. this.keywords = "";
  1837. this.getHisOrderList();
  1838. },
  1839. handleEndTimeChange() {
  1840. this.page = 1;
  1841. this.keywords = "";
  1842. this.getHisOrderList();
  1843. },
  1844. setMonthPrescription(month_prescriptions) {
  1845. let tableData = []
  1846. let drug_month_prescriptions = {
  1847. advices: []
  1848. }
  1849. let drug_ids = []
  1850. let project_month_prescriptions = {
  1851. project: []
  1852. }
  1853. let project_ids = []
  1854. // let addition_month_prescriptions = {
  1855. // addition: []
  1856. //
  1857. // }
  1858. // let additions_ids = []
  1859. for (let i = 0; i < month_prescriptions.length; i++) {
  1860. if (month_prescriptions[i].type == 1) { //药品
  1861. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  1862. let obj = {
  1863. id: month_prescriptions[i].advices[a].drug_id,
  1864. price: month_prescriptions[i].advices[a].price
  1865. }
  1866. drug_ids.push(obj)
  1867. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  1868. }
  1869. } else if (month_prescriptions[i].type == 2) { //项目
  1870. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  1871. let obj = {
  1872. id: month_prescriptions[i].project[a].project_id,
  1873. price: month_prescriptions[i].project[a].price
  1874. }
  1875. project_ids.push(obj)
  1876. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  1877. }
  1878. }
  1879. }
  1880. drug_ids = this.unique(drug_ids)
  1881. project_ids = this.unique(project_ids)
  1882. // additions_ids= this.unique(additions_ids)
  1883. for (let i = 0; i < drug_ids.length; i++) {
  1884. let obj = {}
  1885. let count = 0
  1886. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  1887. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  1888. obj['name'] = drug_month_prescriptions.advices[a].advice_name
  1889. obj['code'] = drug_month_prescriptions.advices[a].id
  1890. obj['unit'] = drug_month_prescriptions.advices[a].drug.min_unit
  1891. obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  1892. count = count + drug_month_prescriptions.advices[a].prescribing_number
  1893. }
  1894. }
  1895. obj['count'] = count
  1896. tableData.push(obj)
  1897. }
  1898. for (let i = 0; i < project_ids.length; i++) {
  1899. let obj = {}
  1900. let count = 0
  1901. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  1902. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  1903. if (project_month_prescriptions.project[a].type == 2) {
  1904. obj['name'] = project_month_prescriptions.project[a].project.project_name
  1905. obj['code'] = project_month_prescriptions.project[a].id
  1906. obj['unit'] = project_month_prescriptions.project[a].project.unit
  1907. obj['type'] = 2
  1908. } else if (project_month_prescriptions.project[a].type == 3) {
  1909. obj['name'] = project_month_prescriptions.project[a].good_info.good_name
  1910. obj['code'] = project_month_prescriptions.project[a].id
  1911. obj['unit'] = project_month_prescriptions.project[a].good_info.packing_unit
  1912. obj['type'] = 3
  1913. }
  1914. count = count + parseFloat(project_month_prescriptions.project[a].count)
  1915. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  1916. obj['type'] = 1
  1917. }
  1918. }
  1919. obj['count'] = count
  1920. tableData.push(obj)
  1921. }
  1922. return tableData
  1923. },
  1924. setMonthPrescriptiontwo(month_prescriptions) {
  1925. let tableData = []
  1926. let project_month_prescriptions = {
  1927. project: []
  1928. }
  1929. let project_ids = []
  1930. for (let i = 0; i < month_prescriptions.length; i++) {
  1931. if (month_prescriptions[i].type == 2) { //项目
  1932. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  1933. if (month_prescriptions[i].project[a].type == 2) {
  1934. let obj = {
  1935. id: month_prescriptions[i].project[a].project_id,
  1936. price: month_prescriptions[i].project[a].price
  1937. }
  1938. project_ids.push(obj)
  1939. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  1940. }
  1941. }
  1942. }
  1943. }
  1944. project_ids = this.unique(project_ids)
  1945. console.log(project_ids)
  1946. for (let i = 0; i < project_ids.length; i++) {
  1947. let obj = {}
  1948. let count = 0
  1949. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  1950. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  1951. if (project_month_prescriptions.project[a].type == 2) {
  1952. obj['name'] = project_month_prescriptions.project[a].project.project_name
  1953. obj['code'] = project_month_prescriptions.project[a].project.medical_code
  1954. count = count + parseFloat(project_month_prescriptions.project[a].count)
  1955. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  1956. }
  1957. }
  1958. }
  1959. obj['count'] = count
  1960. tableData.push(obj)
  1961. }
  1962. return tableData
  1963. },
  1964. Action() {
  1965. getAllOrders().then((response) => {
  1966. if (response.data.state == 0) {
  1967. this.$message.error(response.data.msg);
  1968. return false;
  1969. } else {
  1970. let list = [];
  1971. for (let i = 0; i < response.data.data.order.length; i++) {
  1972. let order = response.data.data.order[i]
  1973. for (let b = 0; b < order.info.length; b++) {
  1974. let item_name = "";
  1975. let item_code = "";
  1976. let price = "";
  1977. let unit = "";
  1978. let spec = "";
  1979. let time = "";
  1980. let cnt = "";
  1981. if (
  1982. order.info[b].advices.id == 0 &&
  1983. order.info[b].project.id > 0
  1984. ) {
  1985. if (order.info[b].project.type == 2){
  1986. item_name = order.info[b].project.project.project_name;
  1987. item_code = order.info[b].project.project.medical_code;
  1988. price = order.info[b].pric;
  1989. unit = order.info[b].project.project.unit;
  1990. cnt=order.info[b].cnt;
  1991. time = order.setl_time;
  1992. }else{
  1993. item_name = order.info[b].project.good_info.good_name;
  1994. item_code = order.info[b].project.good_info.medical_insurance_number;
  1995. price = order.info[b].pric;
  1996. unit = order.info[b].project.good_info.packing_unit;
  1997. cnt=order.info[b].cnt;
  1998. time = order.setl_time;
  1999. }
  2000. } else if (
  2001. order.info[b].advices.id > 0 &&
  2002. order.info[b].project.id == 0
  2003. ) {
  2004. item_name = order.info[b].advices.advice_name;
  2005. item_code =
  2006. order.info[b].advices.drug.medical_insurance_number;
  2007. price = order.info[b].pric;
  2008. unit = order.info[b].advices.prescribing_number_unit;
  2009. 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
  2010. cnt=order.info[b].cnt;
  2011. time = order.setl_time;
  2012. }
  2013. let obj = {
  2014. 项目编码: item_code,
  2015. 项目名称: item_name,
  2016. 规格: spec,
  2017. 厂家:"",
  2018. 单位: unit,
  2019. 数量: cnt,
  2020. 时间: time,
  2021. };
  2022. list.push(obj);
  2023. }
  2024. }
  2025. import("@/vendor/Export2Excel").then((excel) => {
  2026. const tHeader = [
  2027. "项目编码",
  2028. "项目名称",
  2029. "规格",
  2030. "厂家",
  2031. "单位",
  2032. "数量",
  2033. "时间",
  2034. ];
  2035. const filterVal = [
  2036. "项目编码",
  2037. "项目名称",
  2038. "规格",
  2039. "厂家",
  2040. "单位",
  2041. "数量",
  2042. "时间",
  2043. ];
  2044. const data = this.formatJson(filterVal, list);
  2045. excel.export_json_to_excel({
  2046. header: tHeader,
  2047. data,
  2048. filename: "消费明细",
  2049. });
  2050. });
  2051. }
  2052. });
  2053. },
  2054. searchAction() {
  2055. this.page = 1;
  2056. this.getHisOrderList();
  2057. },
  2058. getTimes(time) {
  2059. return uParseTime(time, "{y}-{m}-{d}");
  2060. },
  2061. toDetail(row) {
  2062. this.$router.push(
  2063. "/outpatientCharges/summaryDetail?patient_id=" +
  2064. row.patient.id +
  2065. "&number=" +
  2066. row.number +
  2067. "&id=" +
  2068. row.id
  2069. );
  2070. },
  2071. getTime(value, temp) {
  2072. if (value != undefined) {
  2073. return uParseTime(value, temp);
  2074. }
  2075. return "";
  2076. },
  2077. getHisOrderList() {
  2078. let params = {
  2079. page: this.page,
  2080. limit: this.limit,
  2081. keywords: this.keywords,
  2082. start_time: this.start_time,
  2083. end_time: this.end_time,
  2084. type: this.admin_user_id,
  2085. p_type: 2,
  2086. sort_type: this.sort_type,
  2087. };
  2088. getHisOrderList(params).then((response) => {
  2089. if (response.data.state == 0) {
  2090. this.$message.error(response.data.msg);
  2091. return false;
  2092. } else {
  2093. this.tableData = response.data.data.order;
  2094. this.total = response.data.data.total;
  2095. }
  2096. });
  2097. },
  2098. getDoctorList() {
  2099. getDoctorList().then((response) => {
  2100. if (response.data.state == 0) {
  2101. this.$message.error(response.data.msg);
  2102. return false;
  2103. } else {
  2104. this.doctors = response.data.data.doctors;
  2105. }
  2106. });
  2107. },
  2108. open(index) {
  2109. if (index == 1) {
  2110. this.listVisible = true;
  2111. } else if (index == 2) {
  2112. this.allListVisible = true;
  2113. }
  2114. }, unique(array) {
  2115. // res用来存储结果
  2116. var res = []
  2117. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  2118. for (var j = 0, resLen = res.length; j < resLen; j++) {
  2119. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  2120. break
  2121. }
  2122. }
  2123. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  2124. if (j === resLen) {
  2125. res.push(array[i])
  2126. }
  2127. }
  2128. return res
  2129. },
  2130. invoicePrint(obj) {
  2131. console.log(obj);
  2132. let paramsObj = {
  2133. order_id: obj.id,
  2134. patient_id: obj.patient_id,
  2135. number: obj.mdtrt_id,
  2136. name: obj.patient.name,
  2137. age: obj.age,
  2138. gend: obj.patient.gender,
  2139. setl_time: obj.setl_time,
  2140. chargeName: this.getName(obj.creator),
  2141. };
  2142. this.invoiceParams = paramsObj;
  2143. this.invoiceVisible = true;
  2144. },
  2145. },
  2146. };
  2147. </script>