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

summary.vue 74KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289
  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 obj = {
  1690. 就诊号: order.mdtrt_id,
  1691. 患者姓名: name,
  1692. 开处时间: time,
  1693. 险种类型: insutypeName,
  1694. 应收金额: order.medfee_sumamt,
  1695. 实收金额: order.medfee_sumamt,
  1696. 医保统筹金额: order.hifp_pay,
  1697. 大额基金金额: order.hifob_pay,
  1698. 大病基金金额: hifmi_pay,
  1699. 补充保险基金金额: order.hifes_pay,
  1700. 医疗救助基金金额: order.maf_pay,
  1701. 公务员基金: order.cvlserv_pay,
  1702. 个人支付基金: order.psn_cash_pay,
  1703. 个人账户支付金额: order.acct_pay,
  1704. 科室: department,
  1705. 医生姓名: doctor_name,
  1706. 收费类别: balance_accounts,
  1707. 收费者姓名: charge_name,
  1708. 总金额: order.medfee_sumamt,
  1709. 现金支付: "",
  1710. 账户支付: "",
  1711. 支付宝支付: "",
  1712. 微信支付: "",
  1713. 其他支付: "",
  1714. 收费时间: order.setl_time,
  1715. 收费状态: order_status,
  1716. 退费日期: "",
  1717. };
  1718. list.push(obj);
  1719. }
  1720. import("@/vendor/Export2Excel").then((excel) => {
  1721. const tHeader = [
  1722. "就诊号",
  1723. "患者姓名",
  1724. "开处时间",
  1725. "险种类型",
  1726. "应收金额",
  1727. "实收金额",
  1728. "医保统筹金额",
  1729. "大额基金金额",
  1730. "大病基金金额",
  1731. "补充保险基金金额",
  1732. "医疗救助基金金额",
  1733. "公务员基金",
  1734. "个人支付基金",
  1735. "个人账户支付金额",
  1736. "科室",
  1737. "医生姓名",
  1738. "收费类别",
  1739. "收费者姓名",
  1740. "总金额",
  1741. "现金支付",
  1742. "账户支付",
  1743. "支付宝支付",
  1744. "微信支付",
  1745. "其他支付",
  1746. "收费时间",
  1747. "收费状态",
  1748. "退费日期",
  1749. ];
  1750. const filterVal = [
  1751. "就诊号",
  1752. "患者姓名",
  1753. "开处时间",
  1754. "险种类型",
  1755. "应收金额",
  1756. "实收金额",
  1757. "医保统筹金额",
  1758. "大额基金金额",
  1759. "大病基金金额",
  1760. "补充保险基金金额",
  1761. "医疗救助基金金额",
  1762. "公务员基金",
  1763. "个人支付基金",
  1764. "个人账户支付金额",
  1765. "科室",
  1766. "医生姓名",
  1767. "收费类别",
  1768. "收费者姓名",
  1769. "总金额",
  1770. "现金支付",
  1771. "账户支付",
  1772. "支付宝支付",
  1773. "微信支付",
  1774. "其他支付",
  1775. "收费时间",
  1776. "收费状态",
  1777. "退费日期",
  1778. ];
  1779. const data = this.formatJson(filterVal, list);
  1780. excel.export_json_to_excel({
  1781. header: tHeader,
  1782. data,
  1783. filename: "消费明细",
  1784. });
  1785. });
  1786. }
  1787. });
  1788. },
  1789. formatJson(filterVal, jsonData) {
  1790. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1791. },
  1792. changeSortType() {
  1793. this.page = 1;
  1794. this.keywords = "";
  1795. this.getHisOrderList();
  1796. },
  1797. changeDoctor() {
  1798. this.page = 1;
  1799. this.keywords = "";
  1800. this.getHisOrderList();
  1801. },
  1802. handleSizeChange(limit) {
  1803. this.limit = limit;
  1804. this.getHisOrderList();
  1805. },
  1806. handleCurrentChange(page) {
  1807. this.page = page;
  1808. this.getHisOrderList();
  1809. },
  1810. handleStartTimeChange() {
  1811. this.page = 1;
  1812. this.keywords = "";
  1813. this.getHisOrderList();
  1814. },
  1815. handleEndTimeChange() {
  1816. this.page = 1;
  1817. this.keywords = "";
  1818. this.getHisOrderList();
  1819. },
  1820. setMonthPrescription(month_prescriptions) {
  1821. let tableData = []
  1822. let drug_month_prescriptions = {
  1823. advices: []
  1824. }
  1825. let drug_ids = []
  1826. let project_month_prescriptions = {
  1827. project: []
  1828. }
  1829. let project_ids = []
  1830. // let addition_month_prescriptions = {
  1831. // addition: []
  1832. //
  1833. // }
  1834. // let additions_ids = []
  1835. for (let i = 0; i < month_prescriptions.length; i++) {
  1836. if (month_prescriptions[i].type == 1) { //药品
  1837. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  1838. let obj = {
  1839. id: month_prescriptions[i].advices[a].drug_id,
  1840. price: month_prescriptions[i].advices[a].price
  1841. }
  1842. drug_ids.push(obj)
  1843. drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
  1844. }
  1845. } else if (month_prescriptions[i].type == 2) { //项目
  1846. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  1847. let obj = {
  1848. id: month_prescriptions[i].project[a].project_id,
  1849. price: month_prescriptions[i].project[a].price
  1850. }
  1851. project_ids.push(obj)
  1852. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  1853. }
  1854. }
  1855. }
  1856. drug_ids = this.unique(drug_ids)
  1857. project_ids = this.unique(project_ids)
  1858. // additions_ids= this.unique(additions_ids)
  1859. for (let i = 0; i < drug_ids.length; i++) {
  1860. let obj = {}
  1861. let count = 0
  1862. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  1863. if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
  1864. obj['name'] = drug_month_prescriptions.advices[a].advice_name
  1865. obj['code'] = drug_month_prescriptions.advices[a].id
  1866. obj['unit'] = drug_month_prescriptions.advices[a].drug.min_unit
  1867. obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
  1868. count = count + drug_month_prescriptions.advices[a].prescribing_number
  1869. }
  1870. }
  1871. obj['count'] = count
  1872. tableData.push(obj)
  1873. }
  1874. for (let i = 0; i < project_ids.length; i++) {
  1875. let obj = {}
  1876. let count = 0
  1877. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  1878. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  1879. if (project_month_prescriptions.project[a].type == 2) {
  1880. obj['name'] = project_month_prescriptions.project[a].project.project_name
  1881. obj['code'] = project_month_prescriptions.project[a].id
  1882. obj['unit'] = project_month_prescriptions.project[a].project.unit
  1883. obj['type'] = 2
  1884. } else if (project_month_prescriptions.project[a].type == 3) {
  1885. obj['name'] = project_month_prescriptions.project[a].good_info.good_name
  1886. obj['code'] = project_month_prescriptions.project[a].id
  1887. obj['unit'] = project_month_prescriptions.project[a].good_info.packing_unit
  1888. obj['type'] = 3
  1889. }
  1890. count = count + parseFloat(project_month_prescriptions.project[a].count)
  1891. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  1892. obj['type'] = 1
  1893. }
  1894. }
  1895. obj['count'] = count
  1896. tableData.push(obj)
  1897. }
  1898. return tableData
  1899. },
  1900. setMonthPrescriptiontwo(month_prescriptions) {
  1901. let tableData = []
  1902. let project_month_prescriptions = {
  1903. project: []
  1904. }
  1905. let project_ids = []
  1906. for (let i = 0; i < month_prescriptions.length; i++) {
  1907. if (month_prescriptions[i].type == 2) { //项目
  1908. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  1909. if (month_prescriptions[i].project[a].type == 2) {
  1910. let obj = {
  1911. id: month_prescriptions[i].project[a].project_id,
  1912. price: month_prescriptions[i].project[a].price
  1913. }
  1914. project_ids.push(obj)
  1915. project_month_prescriptions.project.push(month_prescriptions[i].project[a])
  1916. }
  1917. }
  1918. }
  1919. }
  1920. project_ids = this.unique(project_ids)
  1921. console.log(project_ids)
  1922. for (let i = 0; i < project_ids.length; i++) {
  1923. let obj = {}
  1924. let count = 0
  1925. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  1926. if (project_ids[i].price == project_month_prescriptions.project[a].price && project_ids[i].id == project_month_prescriptions.project[a].project_id) {
  1927. if (project_month_prescriptions.project[a].type == 2) {
  1928. obj['name'] = project_month_prescriptions.project[a].project.project_name
  1929. obj['code'] = project_month_prescriptions.project[a].project.medical_code
  1930. count = count + parseFloat(project_month_prescriptions.project[a].count)
  1931. obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
  1932. }
  1933. }
  1934. }
  1935. obj['count'] = count
  1936. tableData.push(obj)
  1937. }
  1938. return tableData
  1939. },
  1940. Action() {
  1941. getAllOrders().then((response) => {
  1942. if (response.data.state == 0) {
  1943. this.$message.error(response.data.msg);
  1944. return false;
  1945. } else {
  1946. let list = [];
  1947. for (let i = 0; i < response.data.data.order.length; i++) {
  1948. let order = response.data.data.order[i]
  1949. for (let b = 0; b < order.info.length; b++) {
  1950. let item_name = "";
  1951. let item_code = "";
  1952. let price = "";
  1953. let unit = "";
  1954. let spec = "";
  1955. let time = "";
  1956. let cnt = "";
  1957. if (
  1958. order.info[b].advices.id == 0 &&
  1959. order.info[b].project.id > 0
  1960. ) {
  1961. if (order.info[b].project.type == 2){
  1962. item_name = order.info[b].project.project.project_name;
  1963. item_code = order.info[b].project.project.medical_code;
  1964. price = order.info[b].pric;
  1965. unit = order.info[b].project.project.unit;
  1966. cnt=order.info[b].cnt;
  1967. time = order.setl_time;
  1968. }else{
  1969. item_name = order.info[b].project.good_info.good_name;
  1970. item_code = order.info[b].project.good_info.medical_insurance_number;
  1971. price = order.info[b].pric;
  1972. unit = order.info[b].project.good_info.packing_unit;
  1973. cnt=order.info[b].cnt;
  1974. time = order.setl_time;
  1975. }
  1976. } else if (
  1977. order.info[b].advices.id > 0 &&
  1978. order.info[b].project.id == 0
  1979. ) {
  1980. item_name = order.info[b].advices.advice_name;
  1981. item_code =
  1982. order.info[b].advices.drug.medical_insurance_number;
  1983. price = order.info[b].pric;
  1984. unit = order.info[b].advices.prescribing_number_unit;
  1985. 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
  1986. cnt=order.info[b].cnt;
  1987. time = order.setl_time;
  1988. }
  1989. let obj = {
  1990. 项目编码: item_code,
  1991. 项目名称: item_name,
  1992. 规格: spec,
  1993. 厂家:"",
  1994. 单位: unit,
  1995. 数量: cnt,
  1996. 时间: time,
  1997. };
  1998. list.push(obj);
  1999. }
  2000. }
  2001. import("@/vendor/Export2Excel").then((excel) => {
  2002. const tHeader = [
  2003. "项目编码",
  2004. "项目名称",
  2005. "规格",
  2006. "厂家",
  2007. "单位",
  2008. "数量",
  2009. "时间",
  2010. ];
  2011. const filterVal = [
  2012. "项目编码",
  2013. "项目名称",
  2014. "规格",
  2015. "厂家",
  2016. "单位",
  2017. "数量",
  2018. "时间",
  2019. ];
  2020. const data = this.formatJson(filterVal, list);
  2021. excel.export_json_to_excel({
  2022. header: tHeader,
  2023. data,
  2024. filename: "消费明细",
  2025. });
  2026. });
  2027. }
  2028. });
  2029. },
  2030. searchAction() {
  2031. this.page = 1;
  2032. this.getHisOrderList();
  2033. },
  2034. getTimes(time) {
  2035. return uParseTime(time, "{y}-{m}-{d}");
  2036. },
  2037. toDetail(row) {
  2038. this.$router.push(
  2039. "/outpatientCharges/summaryDetail?patient_id=" +
  2040. row.patient.id +
  2041. "&number=" +
  2042. row.number +
  2043. "&id=" +
  2044. row.id
  2045. );
  2046. },
  2047. getTime(value, temp) {
  2048. if (value != undefined) {
  2049. return uParseTime(value, temp);
  2050. }
  2051. return "";
  2052. },
  2053. getHisOrderList() {
  2054. let params = {
  2055. page: this.page,
  2056. limit: this.limit,
  2057. keywords: this.keywords,
  2058. start_time: this.start_time,
  2059. end_time: this.end_time,
  2060. type: this.admin_user_id,
  2061. p_type: 2,
  2062. sort_type: this.sort_type,
  2063. };
  2064. getHisOrderList(params).then((response) => {
  2065. if (response.data.state == 0) {
  2066. this.$message.error(response.data.msg);
  2067. return false;
  2068. } else {
  2069. this.tableData = response.data.data.order;
  2070. this.total = response.data.data.total;
  2071. }
  2072. });
  2073. },
  2074. getDoctorList() {
  2075. getDoctorList().then((response) => {
  2076. if (response.data.state == 0) {
  2077. this.$message.error(response.data.msg);
  2078. return false;
  2079. } else {
  2080. this.doctors = response.data.data.doctors;
  2081. }
  2082. });
  2083. },
  2084. open(index) {
  2085. if (index == 1) {
  2086. this.listVisible = true;
  2087. } else if (index == 2) {
  2088. this.allListVisible = true;
  2089. }
  2090. }, unique(array) {
  2091. // res用来存储结果
  2092. var res = []
  2093. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  2094. for (var j = 0, resLen = res.length; j < resLen; j++) {
  2095. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  2096. break
  2097. }
  2098. }
  2099. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  2100. if (j === resLen) {
  2101. res.push(array[i])
  2102. }
  2103. }
  2104. return res
  2105. },
  2106. invoicePrint(obj) {
  2107. console.log(obj);
  2108. let paramsObj = {
  2109. order_id: obj.id,
  2110. patient_id: obj.patient_id,
  2111. number: obj.mdtrt_id,
  2112. name: obj.patient.name,
  2113. age: obj.age,
  2114. gend: obj.patient.gender,
  2115. setl_time: obj.setl_time,
  2116. chargeName: this.getName(obj.creator),
  2117. };
  2118. this.invoiceParams = paramsObj;
  2119. this.invoiceVisible = true;
  2120. },
  2121. },
  2122. };
  2123. </script>