陈少旭 7 months ago
parent
commit
0b1dd9eaca
1 changed files with 570 additions and 0 deletions
  1. 570 0
      src/xt_pages/fapiao/newSettleDetail.vue

+ 570 - 0
src/xt_pages/fapiao/newSettleDetail.vue View File

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