settleDetail.vue 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961
  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. </div>
  14. <div style="margin-bottom: 10px;">
  15. <el-date-picker
  16. size="small"
  17. v-model="start_time"
  18. prefix-icon="el-icon-date"
  19. @change="handleStartTimeChange"
  20. :editable="false"
  21. :clearable="false"
  22. style="width: 196px; "
  23. type="date"
  24. placeholder="选择开始日期"
  25. format="yyyy-MM-dd"
  26. value-format="yyyy-MM-dd"
  27. align="right"
  28. ></el-date-picker>
  29. <span style="text-align: center;">-</span>
  30. <el-date-picker
  31. size="small"
  32. v-model="end_time"
  33. prefix-icon="el-icon-date"
  34. @change="handleEndTimeChange"
  35. :editable="false"
  36. :clearable="false"
  37. style="width: 196px; "
  38. type="date"
  39. placeholder="选择结束日期"
  40. format="yyyy-MM-dd"
  41. value-format="yyyy-MM-dd"
  42. align="right"
  43. ></el-date-picker>
  44. <el-button size="small" type="primary"
  45. @click="query">查询
  46. </el-button>
  47. <el-button size="small" type="primary"
  48. @click="login">短信登录税局
  49. </el-button>
  50. <el-button size="small" type="primary"
  51. @click="auth">认证
  52. </el-button>
  53. </div>
  54. <el-table
  55. :data="tableData"
  56. border
  57. style="width: 100%"
  58. :row-style="{ color: '#303133' }"
  59. :header-cell-style="{
  60. backgroundColor: 'rgb(245, 247, 250)',
  61. color: '#606266',
  62. }"
  63. highlight-current-row
  64. >
  65. <el-table-column
  66. prop="date"
  67. label="序号"
  68. width="60"
  69. align="center"
  70. type="index"
  71. >
  72. </el-table-column>
  73. <el-table-column align="center" width="90" prop="name" label="患者名字">
  74. <template slot-scope="scope">{{ scope.row.patient.name }}</template>
  75. </el-table-column>
  76. <el-table-column align="center" width="90" prop="name" label="患者性别">
  77. <template slot-scope="scope">{{ scope.row.patient.gender == 1 ? '男':'女' }}</template>
  78. </el-table-column>
  79. <el-table-column align="center" width="90" prop="name" label="处方类型">
  80. <template slot-scope="scope">
  81. <div>{{ getMedType(scope.row.med_type) }}</div>
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="center" width="90" prop="name" label="结算类型">
  85. <template slot-scope="scope">
  86. <div v-if="scope.row.his_patient.balance_accounts_type != 2">
  87. 医保
  88. </div>
  89. <div v-if="scope.row.his_patient.balance_accounts_type == 2">
  90. 自费
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="center" width="90" prop="name" label="就诊凭证类型">
  95. <template slot-scope="scope">
  96. <div v-if="scope.row.his_patient.id_card_type == 1">
  97. 社会保障卡
  98. </div>
  99. <div v-if="scope.row.his_patient.id_card_type == 2">
  100. 居民身份证
  101. </div>
  102. <div v-if="scope.row.his_patient.id_card_type == 4">
  103. 医保电子凭证
  104. </div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column
  108. align="center"
  109. width="100"
  110. prop="name"
  111. label="处方日期"
  112. >
  113. <template slot-scope="scope">
  114. {{getTimes(scope.row.settle_accounts_date) }}
  115. </template>
  116. </el-table-column>
  117. <el-table-column
  118. align="center"
  119. width="100"
  120. prop="name"
  121. label="收费时间"
  122. >
  123. <template slot-scope="scope">
  124. {{
  125. scope.row.setl_time
  126. ? scope.row.setl_time
  127. : getTimes(scope.row.settle_accounts_date)
  128. }}
  129. </template>
  130. </el-table-column>
  131. <el-table-column align="center" width="90" prop="name" label="收费员">
  132. <template slot-scope="scope">
  133. {{getName(scope.row.creator)}}
  134. </template>
  135. </el-table-column>
  136. <el-table-column align="center" prop="name" label="操作">
  137. <template slot-scope="scope">
  138. <el-button v-if="scope.row.result.id == 0" size="mini" type="primary"
  139. @click="blue(scope.row)">
  140. 开票
  141. </el-button>
  142. <el-button v-if="scope.row.result.id > 0 && scope.row.result.is_red_washed == 0" size="mini" type="primary"
  143. @click="hongchong(scope.row)">
  144. 红冲
  145. </el-button>
  146. <el-button size="mini" type="primary" v-if="scope.row.result.id > 0 && scope.row.result.is_red_washed == 0"
  147. @click="yulan(scope.row)">
  148. 预览
  149. </el-button>
  150. <el-button size="mini" type="primary" @click="download(scope.row)" v-if="scope.row.result.id > 0 && scope.row.result.is_red_washed == 0">
  151. 下载
  152. </el-button>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <el-pagination
  157. @size-change="handleSizeChange"
  158. @current-change="handleCurrentChange"
  159. :page-sizes="[10, 50, 100]"
  160. :page-size="10"
  161. :current-page.sync="page"
  162. background
  163. style="margin-top: 20px; float: right"
  164. layout="total, sizes, prev, pager, next, jumper"
  165. :total="total"
  166. >
  167. </el-pagination>
  168. </div>
  169. <el-dialog
  170. title="登录"
  171. :visible.sync="login_dialogVisible"
  172. width="40%"
  173. >
  174. <div>
  175. <el-form :rules="rules" :label-position="labelPosition" label-width="100px" :model="formLabelAlign">
  176. <!-- <el-form-item label="税局账号">-->
  177. <!-- <el-input v-model="formLabelAlign.name"></el-input>-->
  178. <!-- </el-form-item>-->
  179. <!-- <el-form-item label="税局密码">-->
  180. <!-- <el-input v-model="formLabelAlign.region"></el-input>-->
  181. <!-- </el-form-item>-->
  182. <!-- <el-form-item label="手机号码">-->
  183. <!-- <el-input v-model="formLabelAlign.type"></el-input>-->
  184. <!-- </el-form-item>-->
  185. <el-form-item label="短信验证码" prop="verify">
  186. <div style="display: inline-block;width: 50%;">
  187. <el-input v-model="formLabelAlign.verify"></el-input>
  188. </div>
  189. <div style="display: inline-block;">
  190. <el-button :disabled="countdown > 0" @click="verify_click">{{countdown > 0?countdown:'获取短信验证码'}}</el-button>
  191. </div>
  192. </el-form-item>
  193. </el-form>
  194. </div>
  195. <span slot="footer" class="dialog-footer">
  196. <el-button @click="login_dialogVisible = false">取 消</el-button>
  197. <el-button type="primary" @click="loginSJ()">确 定</el-button>
  198. </span>
  199. </el-dialog>
  200. <!-- 二维码 -->
  201. <el-dialog
  202. title="提示"
  203. :visible.sync="qr_dialogVisible"
  204. width="30%"
  205. center
  206. >
  207. <div style="margin: auto;width: 120px;">
  208. <div class="qrcode" ref="qrCodeUrl"></div>
  209. </div>
  210. <span slot="footer" class="dialog-footer">
  211. <el-button @click="qr_dialogVisible = false">取 消</el-button>
  212. <el-button type="primary" @click="qr_dialogVisible = false">确 定</el-button>
  213. </span>
  214. </el-dialog>
  215. </div>
  216. </template>
  217. <script>
  218. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  219. import { getDoctorList, getExportConsumeDetailList, getHisOrderList, Refund } from '@/api/his/his'
  220. import { ModifyFapiaoCode } from '@/api/his/his_tools'
  221. // import NewStatementPrint from './newStatementPrint'
  222. import { adminMainView} from "@/api/role/admin";
  223. import { fetchAllAdminUsers } from '@/api/doctor'
  224. import axios from 'axios'
  225. import { jsGetAge, uParseTime } from '@/utils/tools'
  226. import {
  227. getOrderFapiaoList,
  228. OpenBlueFapiao,
  229. OpenRedFapiao,
  230. GetSMSCode,
  231. SMSLogin, GetQRCode
  232. } from '../../api/fapiao'
  233. import { getDialysisRecordInitData } from '@/api/dialysis_record'
  234. import QRCode from 'qrcodejs2'
  235. const moment = require('moment')
  236. export default {
  237. name: 'OutpatientChargesSummary',
  238. components: {
  239. BreadCrumb,
  240. },
  241. data() {
  242. return {
  243. staff:"",
  244. admins:[],
  245. orderObj: {},
  246. batchOrderObj: {},
  247. fapiao_number:"",
  248. med_options: [
  249. { id: 0, text: '全部' },
  250. { id: 11, text: '普通门诊' },
  251. { id: 14, text: '门诊特殊病' }
  252. ],
  253. zone_options: [
  254. { id: 0, text: '全部分区' }
  255. ],
  256. statementListVisible: false,
  257. statementVisible: false,
  258. batchStatementVisible: false,
  259. statementVisible9504: false,
  260. orderObj9504: {},
  261. crumbs: [
  262. { path: false, name: '门诊收费' },
  263. { path: false, name: '项目消费明细汇总' }
  264. ],
  265. tableData: [],
  266. tableData2:[],
  267. selecting_schs: [],
  268. dialogfapiaoVisible:false,
  269. targeOrderId:0,
  270. targeObj:{},
  271. limit: 10,
  272. page: 1,
  273. keywords: '',
  274. sch_type: '0',//班次
  275. zoneVal: 0,//分区
  276. medTypeVal: 0,
  277. start_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  278. end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  279. pay_time:"",
  280. total: '',
  281. doctors: [],
  282. sort_type: 1,
  283. sort_types: [
  284. { value: 1, label: '处方时间' },
  285. { value: 2, label: '结算时间' }
  286. ],
  287. admin_user_id: '',
  288. listVisible: false,
  289. allListVisible: false,
  290. adminUserOptions: [],
  291. invoiceVisible: false,
  292. paramsObj: {},
  293. invoiceParams: {},
  294. settlementVisible: false,
  295. settlementObj: {},
  296. accounts_click_vi:false,
  297. login_dialogVisible:false,
  298. qr_dialogVisible:false,
  299. formLabelAlign: {
  300. name: '',
  301. region: '',
  302. type: '',
  303. verify:'',
  304. },
  305. rules:{
  306. verify:[{ required: true, message: '请输入活动名称', trigger: 'blur' },]
  307. },
  308. time:null,
  309. countdown: 0,
  310. }
  311. },
  312. created() {
  313. this.getInitData()
  314. this.fetchAllAdminUsers()
  315. // this.getDoctorList()
  316. this.getHisOrderList()
  317. // this.getAllstaff()
  318. },
  319. methods: {
  320. loginSJ(){
  321. // let params = {
  322. // "code":this.formLabelAlign.verify,
  323. // }
  324. // SMSLogin(params).then((response) => {
  325. // if (response.data.state == 0) {
  326. // this.login_dialogVisible = false
  327. // this.$message.error(response.data.msg)
  328. // return false
  329. // } else {
  330. // this.login_dialogVisible = false
  331. // // this.$message.success(response.data.msg)
  332. // // this.$message.success(response.data.data.msg)
  333. // this
  334. // .$confirm(response.data.data.msg, '信息', {
  335. // confirmButtonText: '确 定',
  336. // type: 'warning'
  337. // })
  338. // .then(() => {
  339. // })
  340. // .catch(() => {
  341. // })
  342. //
  343. // }
  344. // })
  345. var that = this;
  346. let params = {
  347. "code":this.formLabelAlign.verify,
  348. }
  349. axios.get('http://127.0.0.1:9532/api/fapiao/sms/login',{params:params}).then(function(response) {
  350. if (response.data.state == 0) {
  351. that.$message.error(response.data.data.msg);
  352. return false
  353. } else {
  354. if(response.data.data.failed_code == -10){
  355. that.$confirm(response.data.data.msg, '错误信息', {
  356. confirmButtonText: '确 定',
  357. type: 'warning'
  358. }).then(() => {
  359. }).catch(() => {
  360. })
  361. }else{
  362. that.login_dialogVisible = false
  363. // this.$message.success(response.data.msg)
  364. // this.$message.success(response.data.data.msg)
  365. that
  366. .$confirm(response.data.data.msg, '信息', {
  367. confirmButtonText: '确 定',
  368. type: 'warning'
  369. })
  370. .then(() => {
  371. })
  372. .catch(() => {
  373. })
  374. }
  375. }
  376. }).catch(function(error) {
  377. })
  378. },
  379. login(){
  380. this.login_dialogVisible = true
  381. },
  382. verify_click(){
  383. var that = this;
  384. let params = {
  385. "admin_user_id":this.$store.getters.xt_user.user.id,
  386. }
  387. axios.get('http://127.0.0.1:9532/api/fapiao/sms/code',{params:params}).then(function(response) {
  388. if (response.data.state == 0) {
  389. that.$message.error(response.data.data.msg);
  390. return false
  391. } else {
  392. if(response.data.data.failed_code == -10){
  393. that.$confirm(response.data.data.msg, '错误信息', {
  394. confirmButtonText: '确 定',
  395. type: 'warning'
  396. }).then(() => {
  397. }).catch(() => {
  398. })
  399. }else{
  400. that.$message.success(response.data.data.msg)
  401. }
  402. }
  403. }).catch(function(error) {
  404. })
  405. this.countdown = 60
  406. this.time = setInterval(() => {
  407. if (this.countdown > 0) {
  408. this.countdown--
  409. } else {
  410. clearInterval(this.time)
  411. }
  412. }, 1000)
  413. },
  414. auth(){
  415. // let params = {
  416. // }
  417. // GetQRCode(params).then((response) => {
  418. // if (response.data.state == 0) {
  419. // this.$message.error(response.data.msg)
  420. // return false
  421. // } else {
  422. // if(response.data.data.cus_status == 1){
  423. // this.$nextTick(() =>{
  424. // var qrcode = new QRCode(this.$refs.qrCodeUrl, {
  425. // text: response.data.data.qr_code, // 需要转换为二维码的内容
  426. // width: 120,
  427. // height: 120,
  428. // colorDark: '#000000',
  429. // colorLight: '#ffffff',
  430. // correctLevel: QRCode.CorrectLevel.H
  431. // })
  432. // })
  433. // this.qr_dialogVisible =true
  434. // }else if(response.data.data.cus_status == -1){
  435. // // this.$message.error(response.data.msg)/* */
  436. // this
  437. // .$confirm(response.data.data.msg, '信息', {
  438. // confirmButtonText: '确 定',
  439. // type: 'warning'
  440. // })
  441. // .then(() => {
  442. // })
  443. // .catch(() => {
  444. // })
  445. // }else if(response.data.data.cus_status == 2){
  446. // // this.$message.error(response.data.data.msg)
  447. // this
  448. // .$confirm(response.data.data.msg, '信息', {
  449. // confirmButtonText: '确 定',
  450. // type: 'warning'
  451. // })
  452. // .then(() => {
  453. // })
  454. // .catch(() => {
  455. // })
  456. //
  457. // }else if(response.data.data.cus_status == -3){
  458. // // this.$message.error(response.data.data.msg)
  459. // this
  460. // .$confirm(response.data.data.msg, '信息', {
  461. // confirmButtonText: '确 定',
  462. // type: 'warning'
  463. // })
  464. // .then(() => {
  465. // })
  466. // .catch(() => {
  467. // })
  468. //
  469. // }else if(response.data.data.cus_status == -4){
  470. // // this.$message.error(response.data.data.msg)
  471. // this
  472. // .$confirm(response.data.data.msg, '信息', {
  473. // confirmButtonText: '确 定',
  474. // type: 'warning'
  475. // })
  476. // .then(() => {
  477. // })
  478. // .catch(() => {
  479. // })
  480. //
  481. // }
  482. // // this.$message.success(response.data.msg)
  483. // }
  484. // })
  485. var that = this;
  486. let params = {
  487. "admin_user_id":this.$store.getters.xt_user.user.id,
  488. }
  489. axios.get('http://127.0.0.1:9532/api/fapiao/qrcode/get',{params:params}).then(function(response) {
  490. if (response.data.state == 0) {
  491. that.$message.error(response.data.data.msg);
  492. return false
  493. } else {
  494. if(response.data.data.failed_code == -10){
  495. that.$confirm(response.data.data.msg, '错误信息', {
  496. confirmButtonText: '确 定',
  497. type: 'warning'
  498. }).then(() => {
  499. }).catch(() => {
  500. })
  501. }else{
  502. if(response.data.data.cus_status == 1){
  503. this.$nextTick(() =>{
  504. var qrcode = new QRCode(that.$refs.qrCodeUrl, {
  505. text: response.data.data.qr_code, // 需要转换为二维码的内容
  506. width: 120,
  507. height: 120,
  508. colorDark: '#000000',
  509. colorLight: '#ffffff',
  510. correctLevel: QRCode.CorrectLevel.H
  511. })
  512. })
  513. this.qr_dialogVisible =true
  514. }else if(response.data.data.cus_status == -1){
  515. // this.$message.error(response.data.msg)/* */
  516. that
  517. .$confirm(response.data.data.msg, '信息', {
  518. confirmButtonText: '确 定',
  519. type: 'warning'
  520. })
  521. .then(() => {
  522. })
  523. .catch(() => {
  524. })
  525. }else if(response.data.data.cus_status == 2){
  526. // this.$message.error(response.data.data.msg)
  527. that
  528. .$confirm(response.data.data.msg, '信息', {
  529. confirmButtonText: '确 定',
  530. type: 'warning'
  531. })
  532. .then(() => {
  533. })
  534. .catch(() => {
  535. })
  536. }else if(response.data.data.cus_status == -3){
  537. // this.$message.error(response.data.data.msg)
  538. that
  539. .$confirm(response.data.data.msg, '信息', {
  540. confirmButtonText: '确 定',
  541. type: 'warning'
  542. })
  543. .then(() => {
  544. })
  545. .catch(() => {
  546. })
  547. }else if(response.data.data.cus_status == -4){
  548. // this.$message.error(response.data.data.msg)
  549. that
  550. .$confirm(response.data.data.msg, '信息', {
  551. confirmButtonText: '确 定',
  552. type: 'warning'
  553. })
  554. .then(() => {
  555. })
  556. .catch(() => {
  557. })
  558. }
  559. }
  560. }
  561. }).catch(function(error) {
  562. })
  563. },
  564. query(){
  565. this.getHisOrderList()
  566. },download(){
  567. },
  568. blue(row){
  569. var ids = row.id
  570. let params = {
  571. "order_ids":ids,
  572. "admin_user_id":this.$store.getters.xt_user.user.id,
  573. }
  574. var that = this;
  575. axios.get('http://127.0.0.1:9532/api/fapiao/blue',{params:params}).then(function(response) {
  576. if (response.data.state == 0) {
  577. that.$message.error(response.data.data.msg);
  578. return false
  579. } else {
  580. if(response.data.data.failed_code == -10){
  581. that.$confirm(response.data.data.msg, '错误信息', {
  582. confirmButtonText: '确 定',
  583. type: 'warning'
  584. }).then(() => {
  585. }).catch(() => {
  586. })
  587. }else{
  588. that.$message.success(response.data.data.msg)
  589. that.getHisOrderList()
  590. }
  591. }
  592. }).catch(function(error) {
  593. })
  594. // OpenBlueFapiao(params).then((response) => {
  595. // if (response.data.state == 0) {
  596. // this.$message.error(response.data.msg)
  597. // return false
  598. // } else {
  599. // this.$message.success(response.data.msg)
  600. // this.getHisOrderList()
  601. // }
  602. // })
  603. }, yulan(row){
  604. },hongchong(row){
  605. var id = row.result.id
  606. let params = {
  607. "id":id,
  608. "admin_user_id":this.$store.getters.xt_user.user.id,
  609. }
  610. var that = this;
  611. axios.get('http://127.0.0.1:9532/api/fapiao/red',{params:params}).then(function(response) {
  612. if (response.data.state == 0) {
  613. that.$message.error(response.data.data.msg);
  614. return false
  615. } else {
  616. if(response.data.data.failed_code == -10){
  617. that.$confirm(response.data.data.msg, '错误信息', {
  618. confirmButtonText: '确 定',
  619. type: 'warning'
  620. }).then(() => {
  621. }).catch(() => {
  622. })
  623. }else{
  624. that.$message.success(response.data.msg)
  625. that.getHisOrderList()
  626. }
  627. }
  628. }).catch(function(error) {
  629. })
  630. },
  631. getAllstaff(){
  632. adminMainView()
  633. .then(rs => {
  634. var resp = rs.data;
  635. if (resp.state === 1) {
  636. var adminData = resp.data.admins
  637. this.admins.push(...adminData);
  638. } else {
  639. this.$message.error(resp.msg);
  640. }
  641. })
  642. .catch(err => {
  643. this.$message.error(err);
  644. });
  645. },
  646. handleSelectionChange(val) {
  647. this.selecting_schs = val
  648. },
  649. handleSchType(val) {
  650. this.sch_type = val
  651. this.getHisOrderList()
  652. }, handleMedChange() {
  653. this.getHisOrderList()
  654. },
  655. handleZoneChange(val) {
  656. this.zoneVal = val
  657. this.getHisOrderList()
  658. },
  659. getInitData: function() {
  660. getDialysisRecordInitData().then((rs) => {
  661. var resp = rs.data
  662. if (resp.state == 1) {
  663. var zones = resp.data.zones
  664. var zone_options = [{ id: 0, text: '全部' }]
  665. for (let z_i = 0; z_i < zones.length; z_i++) {
  666. const zone = zones[z_i]
  667. zone_options.push({ id: zone.id, text: zone.name })
  668. }
  669. this.zone_options = zone_options
  670. } else {
  671. this.$message.error(resp.msg)
  672. }
  673. })
  674. },
  675. getMedType(med_type) {
  676. var med_type = parseInt(med_type)
  677. switch (med_type) {
  678. case 11:
  679. return '普通门诊'
  680. break
  681. case 12:
  682. return '门诊挂号'
  683. break
  684. case 13:
  685. return '急诊'
  686. break
  687. case 14:
  688. return '门诊特殊病'
  689. break
  690. case 15:
  691. return '门诊统筹'
  692. break
  693. case 16:
  694. return '门诊慢性病'
  695. break
  696. case 21:
  697. return '普通住院'
  698. break
  699. case 140104:
  700. return '城乡门诊特殊病(140104)'
  701. break
  702. case 992102:
  703. return '单病种(992102)'
  704. break
  705. }
  706. },
  707. fetchAllAdminUsers() {
  708. fetchAllAdminUsers().then((response) => {
  709. if (response.data.state == 1) {
  710. this.adminUserOptions = response.data.data.users
  711. }
  712. })
  713. },
  714. getName(admin_user_id) {
  715. for (let i = 0; i < this.adminUserOptions.length; i++) {
  716. if (this.adminUserOptions[i].id == admin_user_id) {
  717. return this.adminUserOptions[i].name
  718. }
  719. }
  720. },
  721. handleSizeChange(limit) {
  722. this.limit = limit
  723. this.getHisOrderList()
  724. },
  725. handleCurrentChange(page) {
  726. this.page = page
  727. this.getHisOrderList()
  728. },
  729. handleStartTimeChange() {
  730. this.page = 1
  731. this.keywords = ''
  732. this.getHisOrderList()
  733. },
  734. handleEndTimeChange() {
  735. this.page = 1
  736. this.keywords = ''
  737. this.getHisOrderList()
  738. },
  739. getTimes(time) {
  740. return uParseTime(time, '{y}-{m}-{d}')
  741. },
  742. getTime(value, temp) {
  743. if (value != undefined) {
  744. return uParseTime(value, temp)
  745. }
  746. return ''
  747. },
  748. getHisOrderList() {
  749. let params = {
  750. page: this.page,
  751. limit: this.limit,
  752. keywords: this.keywords,
  753. start_time: this.start_time,
  754. end_time: this.end_time,
  755. sort_type: this.sort_type,
  756. }
  757. getOrderFapiaoList(params).then((response) => {
  758. if (response.data.state == 0) {
  759. this.$message.error(response.data.msg)
  760. return false
  761. } else {
  762. this.tableData = response.data.data.order
  763. this.total = response.data.data.total
  764. }
  765. })
  766. },
  767. getDoctorList() {
  768. getDoctorList().then((response) => {
  769. if (response.data.state == 0) {
  770. this.$message.error(response.data.msg)
  771. return false
  772. } else {
  773. this.doctors = response.data.data.doctors
  774. }
  775. })
  776. },
  777. open(index) {
  778. if (index == 1) {
  779. this.listVisible = true
  780. } else if (index == 2) {
  781. this.allListVisible = true
  782. }
  783. }, unique(array) {
  784. // res用来存储结果
  785. var res = []
  786. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  787. for (var j = 0, resLen = res.length; j < resLen; j++) {
  788. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  789. break
  790. }
  791. }
  792. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  793. if (j === resLen) {
  794. res.push(array[i])
  795. }
  796. }
  797. return res
  798. },camcleModifyFaPiaoCode(){
  799. this.dialogfapiaoVisible = false
  800. this.invoiceVisible = true
  801. var obj = this.targeObj
  802. let paramsObj = {
  803. order_id: obj.id,
  804. patient_id: obj.patient_id,
  805. number: obj.mdtrt_id,
  806. name: obj.patient.name,
  807. age: obj.age,
  808. gend: obj.patient.gender,
  809. setl_time: obj.setl_time,
  810. chargeName: this.getName(obj.creator)
  811. }
  812. this.dialogfapiaoVisible = false
  813. this.invoiceParams = paramsObj
  814. this.invoiceVisible = true
  815. },modifyFaPiaoCode(){
  816. let params = {
  817. id:this.targeOrderId,
  818. fapiao_number: this.fapiao_number
  819. }
  820. modifyFapiaoCodetwo(params).then((response) => {
  821. if (response.data.state == 0) {
  822. this.$message.error(response.data.msg)
  823. return false
  824. } else {
  825. var obj = this.targeObj
  826. let paramsObj = {
  827. order_id: obj.id,
  828. patient_id: obj.patient_id,
  829. number: obj.mdtrt_id,
  830. name: obj.patient.name,
  831. age: obj.age,
  832. gend: obj.patient.gender,
  833. setl_time: obj.setl_time,
  834. chargeName: this.getName(obj.creator)
  835. }
  836. this.dialogfapiaoVisible = false
  837. this.invoiceParams = paramsObj
  838. this.invoiceVisible = true
  839. this.getHisOrderList()
  840. }
  841. })
  842. },
  843. invoicePrint(obj) {
  844. if(this.$store.getters.xt_user.org_id == 10480 || this.$store.getters.xt_user.org_id == 0){
  845. this.fapiao_number = obj.fa_piao_number
  846. this.dialogfapiaoVisible = true
  847. this.targeOrderId = obj.id
  848. this.targeObj = obj
  849. }else{
  850. let paramsObj = {
  851. order_id: obj.id,
  852. patient_id: obj.patient_id,
  853. number: obj.mdtrt_id,
  854. name: obj.patient.name,
  855. age: obj.age,
  856. gend: obj.patient.gender,
  857. setl_time: obj.setl_time,
  858. chargeName: this.getName(obj.creator)
  859. }
  860. this.dialogfapiaoVisible = false
  861. this.invoiceParams = paramsObj
  862. this.invoiceVisible = true
  863. }
  864. }
  865. },
  866. watch:{
  867. countdown(news,old){
  868. if(this.countdown ==0){
  869. clearInterval(this.time)
  870. }
  871. }
  872. }
  873. }
  874. </script>
  875. <style lang="scss">
  876. .table{
  877. tr td{
  878. padding:5px 0;
  879. }
  880. }
  881. </style>