settleDetail.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  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. <el-button size="small" type="primary"
  15. @click="query">查询
  16. </el-button>
  17. <el-button size="small" type="primary"
  18. @click="auth">认证
  19. </el-button>
  20. </div>
  21. </div>
  22. <div style="margin-bottom: 10px;">
  23. <el-date-picker
  24. size="small"
  25. v-model="start_time"
  26. prefix-icon="el-icon-date"
  27. @change="handleStartTimeChange"
  28. :editable="false"
  29. :clearable="false"
  30. style="width: 196px; "
  31. type="date"
  32. placeholder="选择开始日期"
  33. format="yyyy-MM-dd"
  34. value-format="yyyy-MM-dd"
  35. align="right"
  36. ></el-date-picker>
  37. <span style="text-align: center;">-</span>
  38. <el-date-picker
  39. size="small"
  40. v-model="end_time"
  41. prefix-icon="el-icon-date"
  42. @change="handleEndTimeChange"
  43. :editable="false"
  44. :clearable="false"
  45. style="width: 196px; "
  46. type="date"
  47. placeholder="选择结束日期"
  48. format="yyyy-MM-dd"
  49. value-format="yyyy-MM-dd"
  50. align="right"
  51. ></el-date-picker>
  52. </div>
  53. <el-table
  54. :data="tableData"
  55. border
  56. style="width: 100%"
  57. :row-style="{ color: '#303133' }"
  58. @selection-change="handleSelectionChange"
  59. :header-cell-style="{
  60. backgroundColor: 'rgb(245, 247, 250)',
  61. color: '#606266',
  62. }"
  63. highlight-current-row
  64. >
  65. <el-table-column align="center" type="selection" width="55"></el-table-column>
  66. <el-table-column
  67. prop="date"
  68. label="序号"
  69. width="60"
  70. align="center"
  71. type="index"
  72. >
  73. </el-table-column>
  74. <el-table-column align="center" width="90" prop="name" label="患者名字">
  75. <template slot-scope="scope">{{ scope.row.patient.name }}</template>
  76. </el-table-column>
  77. <el-table-column align="center" width="90" prop="name" label="患者性别">
  78. <template slot-scope="scope">{{ scope.row.patient.gender == 1 ? '男':'女' }}</template>
  79. </el-table-column>
  80. <el-table-column align="center" width="90" prop="name" label="处方类型">
  81. <template slot-scope="scope">
  82. <div>{{ getMedType(scope.row.med_type) }}</div>
  83. </template>
  84. </el-table-column>
  85. <el-table-column align="center" width="90" prop="name" label="结算类型">
  86. <template slot-scope="scope">
  87. <div v-if="scope.row.his_patient.balance_accounts_type != 2">
  88. 医保
  89. </div>
  90. <div v-if="scope.row.his_patient.balance_accounts_type == 2">
  91. 自费
  92. </div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="center" width="90" prop="name" label="就诊凭证类型">
  96. <template slot-scope="scope">
  97. <div v-if="scope.row.mdtrt_cert_type =='01'">
  98. 医保电子凭证
  99. </div>
  100. <div v-if="scope.row.mdtrt_cert_type =='02'">
  101. 居民身份证
  102. </div>
  103. <div v-if="scope.row.mdtrt_cert_type =='03'">
  104. 社会保障卡
  105. </div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column
  109. align="center"
  110. width="100"
  111. prop="name"
  112. label="处方日期"
  113. >
  114. <template slot-scope="scope">
  115. {{getTimes(scope.row.settle_accounts_date) }}
  116. </template>
  117. </el-table-column>
  118. <el-table-column
  119. align="center"
  120. width="100"
  121. prop="name"
  122. label="收费时间"
  123. >
  124. <template slot-scope="scope">
  125. {{
  126. scope.row.setl_time
  127. ? scope.row.setl_time
  128. : getTimes(scope.row.settle_accounts_date)
  129. }}
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="center" width="90" prop="name" label="收费员">
  133. <template slot-scope="scope">
  134. {{getName(scope.row.creator)}}
  135. </template>
  136. </el-table-column>
  137. <el-table-column align="center" prop="name" label="操作">
  138. <template slot-scope="scope">
  139. <el-button size="mini" type="primary" @click="blue(scope.row)">
  140. 开票
  141. </el-button>
  142. <el-button size="mini" type="primary"
  143. @click="yulan(scope.row)">
  144. 预览
  145. </el-button>
  146. <el-button size="mini" type="primary"
  147. @click="hongchong(scope.row)">
  148. 红冲
  149. </el-button>
  150. </template>
  151. </el-table-column>
  152. </el-table>
  153. <el-pagination
  154. @size-change="handleSizeChange"
  155. @current-change="handleCurrentChange"
  156. :page-sizes="[10, 50, 100]"
  157. :page-size="10"
  158. :current-page.sync="page"
  159. background
  160. style="margin-top: 20px; float: right"
  161. layout="total, sizes, prev, pager, next, jumper"
  162. :total="total"
  163. >
  164. </el-pagination>
  165. </div>
  166. </div>
  167. </template>
  168. <script>
  169. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  170. import { getDoctorList, getExportConsumeDetailList, getHisOrderList, Refund } from '@/api/his/his'
  171. import { ModifyFapiaoCode } from '@/api/his/his_tools'
  172. // import NewStatementPrint from './newStatementPrint'
  173. import { adminMainView} from "@/api/role/admin";
  174. import { fetchAllAdminUsers } from '@/api/doctor'
  175. import axios from 'axios'
  176. import { jsGetAge, uParseTime } from '@/utils/tools'
  177. import {
  178. getOrderFapiaoList
  179. } from '../../api/fapiao'
  180. import { getDialysisRecordInitData } from '@/api/dialysis_record'
  181. const moment = require('moment')
  182. export default {
  183. name: 'OutpatientChargesSummary',
  184. components: {
  185. BreadCrumb,
  186. },
  187. data() {
  188. return {
  189. staff:"",
  190. admins:[],
  191. orderObj: {},
  192. batchOrderObj: {},
  193. fapiao_number:"",
  194. med_options: [
  195. { id: 0, text: '全部' },
  196. { id: 11, text: '普通门诊' },
  197. { id: 14, text: '门诊特殊病' }
  198. ],
  199. zone_options: [
  200. { id: 0, text: '全部分区' }
  201. ],
  202. statementListVisible: false,
  203. statementVisible: false,
  204. batchStatementVisible: false,
  205. statementVisible9504: false,
  206. orderObj9504: {},
  207. crumbs: [
  208. { path: false, name: '门诊收费' },
  209. { path: false, name: '项目消费明细汇总' }
  210. ],
  211. tableData: [],
  212. tableData2:[],
  213. selecting_schs: [],
  214. dialogfapiaoVisible:false,
  215. targeOrderId:0,
  216. targeObj:{},
  217. limit: 10,
  218. page: 1,
  219. keywords: '',
  220. sch_type: '0',//班次
  221. zoneVal: 0,//分区
  222. medTypeVal: 0,
  223. start_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  224. end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  225. pay_time:"",
  226. total: '',
  227. doctors: [],
  228. sort_type: 1,
  229. sort_types: [
  230. { value: 1, label: '处方时间' },
  231. { value: 2, label: '结算时间' }
  232. ],
  233. admin_user_id: '',
  234. listVisible: false,
  235. allListVisible: false,
  236. adminUserOptions: [],
  237. invoiceVisible: false,
  238. paramsObj: {},
  239. invoiceParams: {},
  240. settlementVisible: false,
  241. settlementObj: {},
  242. accounts_click_vi:false,
  243. }
  244. },
  245. created() {
  246. this.getInitData()
  247. this.fetchAllAdminUsers()
  248. // this.getDoctorList()
  249. this.getHisOrderList()
  250. // this.getAllstaff()
  251. },
  252. methods: {
  253. auth(){
  254. },
  255. query(){
  256. },
  257. blue(row){
  258. }, yulan(row){
  259. },hongchong(row){
  260. },
  261. getAllstaff(){
  262. adminMainView()
  263. .then(rs => {
  264. var resp = rs.data;
  265. if (resp.state === 1) {
  266. var adminData = resp.data.admins
  267. this.admins.push(...adminData);
  268. } else {
  269. this.$message.error(resp.msg);
  270. }
  271. })
  272. .catch(err => {
  273. this.$message.error(err);
  274. });
  275. },
  276. handleSelectionChange(val) {
  277. this.selecting_schs = val
  278. },
  279. handleSchType(val) {
  280. this.sch_type = val
  281. this.getHisOrderList()
  282. }, handleMedChange() {
  283. this.getHisOrderList()
  284. },
  285. handleZoneChange(val) {
  286. this.zoneVal = val
  287. this.getHisOrderList()
  288. },
  289. getInitData: function() {
  290. getDialysisRecordInitData().then((rs) => {
  291. var resp = rs.data
  292. if (resp.state == 1) {
  293. var zones = resp.data.zones
  294. var zone_options = [{ id: 0, text: '全部' }]
  295. for (let z_i = 0; z_i < zones.length; z_i++) {
  296. const zone = zones[z_i]
  297. zone_options.push({ id: zone.id, text: zone.name })
  298. }
  299. this.zone_options = zone_options
  300. } else {
  301. this.$message.error(resp.msg)
  302. }
  303. })
  304. },
  305. getMedType(med_type) {
  306. var med_type = parseInt(med_type)
  307. switch (med_type) {
  308. case 11:
  309. return '普通门诊'
  310. break
  311. case 12:
  312. return '门诊挂号'
  313. break
  314. case 13:
  315. return '急诊'
  316. break
  317. case 14:
  318. return '门诊特殊病'
  319. break
  320. case 15:
  321. return '门诊统筹'
  322. break
  323. case 16:
  324. return '门诊慢性病'
  325. break
  326. case 21:
  327. return '普通住院'
  328. break
  329. case 140104:
  330. return '城乡门诊特殊病(140104)'
  331. break
  332. case 992102:
  333. return '单病种(992102)'
  334. break
  335. }
  336. },
  337. fetchAllAdminUsers() {
  338. fetchAllAdminUsers().then((response) => {
  339. if (response.data.state == 1) {
  340. this.adminUserOptions = response.data.data.users
  341. }
  342. })
  343. },
  344. getName(admin_user_id) {
  345. for (let i = 0; i < this.adminUserOptions.length; i++) {
  346. if (this.adminUserOptions[i].id == admin_user_id) {
  347. return this.adminUserOptions[i].name
  348. }
  349. }
  350. },
  351. handleSizeChange(limit) {
  352. this.limit = limit
  353. this.getHisOrderList()
  354. },
  355. handleCurrentChange(page) {
  356. this.page = page
  357. this.getHisOrderList()
  358. },
  359. handleStartTimeChange() {
  360. this.page = 1
  361. this.keywords = ''
  362. this.getHisOrderList()
  363. },
  364. handleEndTimeChange() {
  365. this.page = 1
  366. this.keywords = ''
  367. this.getHisOrderList()
  368. },
  369. getTimes(time) {
  370. return uParseTime(time, '{y}-{m}-{d}')
  371. },
  372. getTime(value, temp) {
  373. if (value != undefined) {
  374. return uParseTime(value, temp)
  375. }
  376. return ''
  377. },
  378. getHisOrderList() {
  379. let params = {
  380. page: this.page,
  381. limit: this.limit,
  382. keywords: this.keywords,
  383. start_time: this.start_time,
  384. end_time: this.end_time,
  385. sort_type: this.sort_type,
  386. }
  387. getOrderFapiaoList(params).then((response) => {
  388. if (response.data.state == 0) {
  389. this.$message.error(response.data.msg)
  390. return false
  391. } else {
  392. this.tableData = response.data.data.order
  393. this.total = response.data.data.total
  394. }
  395. })
  396. },
  397. getDoctorList() {
  398. getDoctorList().then((response) => {
  399. if (response.data.state == 0) {
  400. this.$message.error(response.data.msg)
  401. return false
  402. } else {
  403. this.doctors = response.data.data.doctors
  404. }
  405. })
  406. },
  407. open(index) {
  408. if (index == 1) {
  409. this.listVisible = true
  410. } else if (index == 2) {
  411. this.allListVisible = true
  412. }
  413. }, unique(array) {
  414. // res用来存储结果
  415. var res = []
  416. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  417. for (var j = 0, resLen = res.length; j < resLen; j++) {
  418. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  419. break
  420. }
  421. }
  422. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  423. if (j === resLen) {
  424. res.push(array[i])
  425. }
  426. }
  427. return res
  428. },camcleModifyFaPiaoCode(){
  429. this.dialogfapiaoVisible = false
  430. this.invoiceVisible = true
  431. var obj = this.targeObj
  432. let paramsObj = {
  433. order_id: obj.id,
  434. patient_id: obj.patient_id,
  435. number: obj.mdtrt_id,
  436. name: obj.patient.name,
  437. age: obj.age,
  438. gend: obj.patient.gender,
  439. setl_time: obj.setl_time,
  440. chargeName: this.getName(obj.creator)
  441. }
  442. this.dialogfapiaoVisible = false
  443. this.invoiceParams = paramsObj
  444. this.invoiceVisible = true
  445. },modifyFaPiaoCode(){
  446. let params = {
  447. id:this.targeOrderId,
  448. fapiao_number: this.fapiao_number
  449. }
  450. modifyFapiaoCodetwo(params).then((response) => {
  451. if (response.data.state == 0) {
  452. this.$message.error(response.data.msg)
  453. return false
  454. } else {
  455. var obj = this.targeObj
  456. let paramsObj = {
  457. order_id: obj.id,
  458. patient_id: obj.patient_id,
  459. number: obj.mdtrt_id,
  460. name: obj.patient.name,
  461. age: obj.age,
  462. gend: obj.patient.gender,
  463. setl_time: obj.setl_time,
  464. chargeName: this.getName(obj.creator)
  465. }
  466. this.dialogfapiaoVisible = false
  467. this.invoiceParams = paramsObj
  468. this.invoiceVisible = true
  469. this.getHisOrderList()
  470. }
  471. })
  472. },
  473. invoicePrint(obj) {
  474. if(this.$store.getters.xt_user.org_id == 10480 || this.$store.getters.xt_user.org_id == 0){
  475. this.fapiao_number = obj.fa_piao_number
  476. this.dialogfapiaoVisible = true
  477. this.targeOrderId = obj.id
  478. this.targeObj = obj
  479. }else{
  480. let paramsObj = {
  481. order_id: obj.id,
  482. patient_id: obj.patient_id,
  483. number: obj.mdtrt_id,
  484. name: obj.patient.name,
  485. age: obj.age,
  486. gend: obj.patient.gender,
  487. setl_time: obj.setl_time,
  488. chargeName: this.getName(obj.creator)
  489. }
  490. this.dialogfapiaoVisible = false
  491. this.invoiceParams = paramsObj
  492. this.invoiceVisible = true
  493. }
  494. }
  495. }
  496. }
  497. </script>
  498. <style lang="scss">
  499. .table{
  500. tr td{
  501. padding:5px 0;
  502. }
  503. }
  504. </style>