28169 1 год назад
Родитель
Сommit
57be395103
1 измененных файлов: 647 добавлений и 0 удалений
  1. 647 0
      src/xt_pages/hospitalStation/inHospitalHistory.vue

+ 647 - 0
src/xt_pages/hospitalStation/inHospitalHistory.vue Просмотреть файл

@@ -0,0 +1,647 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+      <div class="cell clearfix">
8
+        <!-- <el-input style="width: 180px;" v-model.trim="search_input" class="filter-item"/> -->
9
+        <el-autocomplete
10
+          style="margin:16px 5px"
11
+          popper-class="my-autocomplete"
12
+          v-model.trim="search_input"
13
+          :fetch-suggestions="querySearchAsync"
14
+          :trigger-on-focus="false"
15
+          placeholder="病人名字或者透析号"
16
+          @select="handleSelect"
17
+        >
18
+          <i class="el-icon-search el-input__icon" slot="suffix"> </i>
19
+          <template slot-scope="{ item }">
20
+            <div class="name">{{ item.name }}</div>
21
+          </template>
22
+        </el-autocomplete>
23
+        <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
24
+                   @click="searchAction">搜索
25
+        </el-button>
26
+
27
+        <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
28
+                        placeholder="选择时间" v-model="start_time" style="width:200px"
29
+                        @change="changeStart"
30
+        >
31
+        </el-date-picker>
32
+        -
33
+        <el-date-picker type="datetime" format="yyyy-MM-dd HH:mm" value-format="yyyy-MM-dd HH:mm"
34
+                        placeholder="选择时间" v-model="end_time" style="width:200px"
35
+                        @change="changeEnd"
36
+        >
37
+        </el-date-picker>
38
+
39
+      </div>
40
+      <el-table :data="tableData" border  :row-style="{ color: '#303133' }"
41
+                :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
42
+                highlight-current-row>
43
+        <el-table-column align="center" type="index" label="序号" width="60">
44
+        </el-table-column>
45
+        <el-table-column align="center" prop="dialysis_no" label="姓名" width="80">
46
+          <template slot-scope="scope">{{scope.row.name }}</template>
47
+        </el-table-column>
48
+        <el-table-column align="center" prop="name" label="证件号" width='180'>
49
+          <template slot-scope="scope">{{ scope.row.id_card_no }}</template>
50
+        </el-table-column>
51
+        <el-table-column align="center" prop="name" label="就诊号" width="80">
52
+          <template slot-scope="scope">
53
+            {{scope.row.number}}
54
+          </template>
55
+        </el-table-column>
56
+        <el-table-column align="center" prop="name" label="入院科室" width="80">
57
+          <template slot-scope="scope">{{getDepartMent(scope.row.departments)}}</template>
58
+        </el-table-column>
59
+        <el-table-column align="center" prop="name" label="入院时间" width="100">
60
+          <template slot-scope="scope">{{scope.row.in_hosptial_time}}</template>
61
+        </el-table-column>
62
+        <el-table-column align="center" prop="name" label="出院时间" width="100">
63
+          <template slot-scope="scope">{{scope.row.out_hosptial_time}}</template>
64
+        </el-table-column>
65
+        <el-table-column align="center" prop="name" label="疾病类型" width="100">
66
+          <template slot-scope="scope">{{GetSickType(scope.row.sick_type)}}</template>
67
+        </el-table-column>
68
+        <el-table-column align="center" prop="name" label="诊断" width="100">
69
+          <template slot-scope="scope">{{GetDiagnosisName(parseInt(scope.row.diagnosis))}}</template>
70
+        </el-table-column>
71
+        <el-table-column align="center" prop="name" label="医疗类别" width="100">
72
+          <template slot-scope="scope">
73
+            <div v-if="scope.row.med_type == 11">普通住院</div>
74
+            <div v-if="scope.row.med_type == 14">门诊特殊病</div>
75
+          </template>
76
+        </el-table-column>
77
+
78
+        <el-table-column align="center" prop="name" label="结算类型" width="70">
79
+          <template slot-scope="scope">{{getBanlance(scope.row.balance_accounts_type) }}</template>
80
+        </el-table-column>
81
+
82
+
83
+
84
+        <el-table-column align="center" prop="name" label="医生" width="80">
85
+          <template slot-scope="scope">{{getDoctor(scope.row.doctor) }}</template>
86
+        </el-table-column>
87
+        <el-table-column align="center" prop="name" label="状态" width="70">
88
+          <template slot-scope="scope">
89
+            <div v-if="scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 0">{{"在院"}}</div>
90
+            <div v-if="scope.row.in_hospital_status == 1 && scope.row.out_hospital_status == 1">{{"已出院"}}</div>
91
+          </template>
92
+        </el-table-column>
93
+<!--        <el-table-column align="center" prop="name" label="操作" width="180">-->
94
+<!--          <template slot-scope="scope">-->
95
+<!--            <el-button size="mini" type="primary" v-if="scope.row.status == 1"-->
96
+<!--                       @click="toReturnPatient(scope.row)">退号-->
97
+<!--            </el-button>-->
98
+<!--          </template>-->
99
+<!--        </el-table-column>-->
100
+      </el-table>
101
+
102
+      <el-pagination
103
+        @size-change="handleSizeChange"
104
+        @current-change="handleCurrentChange"
105
+        :page-sizes="[10, 50, 100]"
106
+        :page-size="10"
107
+        background
108
+        style="margin-top:20px;float: right"
109
+        layout="total, sizes, prev, pager, next, jumper"
110
+        :total="total"
111
+      >
112
+      </el-pagination>
113
+
114
+    </div>
115
+  </div>
116
+</template>
117
+
118
+<script>
119
+const moment = require('moment')
120
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
121
+import {getInHospitalHistory,getInitData} from '@/api/his/his'
122
+import { uParseTime } from '@/utils/tools'
123
+import { getDictionaryDataConfig } from '@/utils/data'
124
+import axios from 'axios'
125
+export default {
126
+  components: {
127
+    BreadCrumb
128
+  },
129
+  data() {
130
+    return {
131
+      crumbs: [
132
+        { path: false, name: '门诊挂号' },
133
+        { path: false, name: '挂号历史' }
134
+      ],
135
+      register_type: 0,
136
+      search_input: '',
137
+      value1: '',
138
+      tableData: [],
139
+      register: [
140
+        { value: 0, label: '全部' },
141
+        { value: 1, label: '普通' },
142
+        { value: 2, label: '主治' },
143
+        { value: 3, label: '主任' },
144
+        { value: 4, label: '免收诊金' },
145
+        { value: 5, label: '专家' }
146
+      ],
147
+      start_time: moment().format('YYYY-MM-DD HH:mm'),
148
+      end_time: moment().format('YYYY-MM-DD HH:mm'),
149
+      limit: 10,
150
+      page: 1,
151
+      total: 0,
152
+      departMent: [],
153
+      doctorList: [],
154
+      medicalCare: [{
155
+        id: 1,
156
+        name: '职工基本医疗保险'
157
+      }, {
158
+        id: 2,
159
+        name: '公务员医疗补助'
160
+      }, {
161
+        id: 3,
162
+        name: '大额医疗费用补助'
163
+      }, {
164
+        id: 4,
165
+        name: '离休人员医疗'
166
+      }, {
167
+        id: 5,
168
+        name: '城乡居民基本医疗保险'
169
+      }, {
170
+        id: 6,
171
+        name: '城乡居民大病医疗保险'
172
+      },
173
+        {
174
+          id: 7,
175
+          name: '生育保险'
176
+        }],
177
+      certificates: [{
178
+        value: 1,
179
+        label: '内地身份证'
180
+      }, {
181
+        value: 2,
182
+        label: '社保卡'
183
+      }, {
184
+        value: 3,
185
+        label: '护照'
186
+      }, {
187
+        value: 4,
188
+        label: '军官证'
189
+      }, {
190
+        value: 5,
191
+        label: '台胞证'
192
+      }, {
193
+        value: 6,
194
+        label: '港澳地区身份证'
195
+      }],
196
+      settlement:
197
+        [
198
+          { value: 1, label: '医保' },
199
+          { value: 2, label: '自费' },
200
+          { value: 3, label: '公费' },
201
+          { value: 4, label: '农保' },
202
+          { value: 5, label: '会员' },
203
+          { value: 6, label: '职工' },
204
+          { value: 7, label: '合同' },
205
+          {value: 8, label: '医保自费'},
206
+
207
+        ],
208
+      // medicalCare: [{
209
+      //   value: 1,
210
+      //   label: '职工基本医疗保险'
211
+      //   }, {
212
+      //   value: 2,
213
+      //   label: "公务员医疗补助"
214
+      //   },{
215
+      //   value: 3,
216
+      //   label: "大额医疗费用补助"
217
+      //   },{
218
+      //   value: 4,
219
+      //   label: "离休人员医疗"
220
+      //   },{
221
+      //   value: 5,
222
+      //   label: "城乡居民基本医疗保险"
223
+      //   },{
224
+      //   value: 6,
225
+      //   label: "城乡居民大病医疗保险"
226
+      //   },
227
+      //   {
228
+      //   value: 7,
229
+      //   label: "生育保险"
230
+      // }],
231
+      newRegister: [{
232
+        value: 1,
233
+        label: '普通'
234
+      }, {
235
+        value: 2,
236
+        label: '主治'
237
+      }, {
238
+        value: 3,
239
+        label: '主任'
240
+      }, {
241
+        value: 4,
242
+        label: '免收诊金'
243
+      }, {
244
+        value: 5,
245
+        label: '专家'
246
+      }],
247
+
248
+      tablePatient: [],
249
+      creator: '',
250
+      startUnix: '',
251
+
252
+      dialogVisible: false,
253
+      form: {},
254
+      is_Name: false,
255
+      sick:[],
256
+      diagnoses:[],
257
+    }
258
+  },
259
+  created() {
260
+    // let a = JSON.parse(localStorage.getItem("temp"))
261
+    // let arr = []
262
+    // a.map(item => {
263
+    //     if(item.org_id == this.$store.getters.xt_user.org_id){
264
+    //         item.create_time = moment(item.create_time * 1000).format('YYYY-MM-DD')
265
+    //         arr.push(item)
266
+    //     }
267
+
268
+    // })
269
+    // this.tableData = arr
270
+    //获取所有挂号号的患者
271
+
272
+    this.creator = this.$store.getters.xt_user.user.user_name
273
+    var today = moment().startOf('day').format('YYYY-MM-DD')
274
+    var todayUnix = Date.parse(today) / 1000
275
+    this.startUnix = todayUnix - 28800
276
+    this.getInitData()
277
+    this.getlist()
278
+    this.getDictionaryDataConfig()
279
+  },
280
+  methods: {
281
+    getInitData() {
282
+      getInitData().then((response) => {
283
+        if (response.data.state == 0) {
284
+          this.$message.error(response.data.msg);
285
+          return false;
286
+        } else {
287
+          this.sick = response.data.data.sick;
288
+          this.diagnoses = response.data.data.diagnose;
289
+        }
290
+      });
291
+    },GetSickType(id){
292
+      for(let i = 0;i < this.sick.length; i++){
293
+        if(this.sick[i].id == id){
294
+          return this.sick[i].class_name
295
+        }
296
+      }
297
+      return ""
298
+    },
299
+    GetDiagnosisName(id){
300
+      for(let i = 0;i < this.diagnoses.length; i++){
301
+        if(this.diagnoses[i].id == id){
302
+          return this.diagnoses[i].class_name
303
+        }
304
+      }
305
+      return ""
306
+    },
307
+    searchAction() {
308
+      this.getlist()
309
+    },
310
+    // changeTime(val){
311
+    //     let arr = JSON.parse(localStorage.getItem("temp"))
312
+    //     arr.map(item => {
313
+    //         item.create_time = moment(item.create_time * 1000).format('YYYY-MM-DD')
314
+    //     })
315
+    //     this.tableData = arr
316
+    //     console.log(new Date(val[0]).getTime() / 1000)
317
+    //     console.log(new Date(val[1]).getTime() / 1000)
318
+    //     let arr1 = this.tableData
319
+    //     let a = []
320
+    //     arr1.map(item => {
321
+    //      if(new Date(item.create_time).getTime() / 1000 > new Date(val[0]).getTime() / 1000 && new Date(item.create_time).getTime() / 1000 < new Date(val[1]).getTime() / 1000 && item.org_id == this.$store.getters.xt_user.org_id){
322
+    //         a.push(item)
323
+    //       }
324
+    //     })
325
+    //     this.tableData = a
326
+    // },
327
+    changeStart(val) {
328
+      this.start_time = val
329
+      this.getlist()
330
+    },
331
+    changeEnd(val) {
332
+      this.end_time = val
333
+      this.getlist()
334
+    },
335
+    changeRegister(val) {
336
+      this.getlist()
337
+    },
338
+    handleSizeChange(val) {
339
+      this.limit = val
340
+      this.getlist()
341
+    },
342
+    handleCurrentChange(val) {
343
+      this.page = val
344
+      this.getlist()
345
+    },
346
+    getlist() {
347
+      var params = {
348
+        keyword: this.search_input,
349
+        start_time: this.start_time,
350
+        end_time: this.end_time,
351
+        limit: this.limit,
352
+        page: this.page
353
+      }
354
+      getInHospitalHistory(params).then(response => {
355
+        if (response.data.state == 1) {
356
+          var history = response.data.data.history
357
+
358
+          console.log('history', history)
359
+          this.tableData = history
360
+          var total = response.data.data.total
361
+          console.log('total', total)
362
+          this.total = total
363
+          var department = response.data.data.department
364
+          console.log('department', department)
365
+          this.departMent = department
366
+          var doctor = response.data.data.doctor
367
+          console.log('doctor', doctor)
368
+          this.doctorList = doctor
369
+        }
370
+      })
371
+
372
+    },
373
+    getDepartMent(id) {
374
+      var name = ''
375
+      for (let i = 0; i < this.departMent.length; i++) {
376
+        if (id == this.departMent[i].id) {
377
+          name = this.departMent[i].name
378
+        }
379
+      }
380
+      return name
381
+    },
382
+    getDoctor(id) {
383
+      var user_name = ''
384
+      for (let i = 0; i < this.doctorList.length; i++) {
385
+        if (id == this.doctorList[i].admin_user_id) {
386
+          user_name = this.doctorList[i].user_name
387
+        }
388
+      }
389
+      return user_name
390
+    },
391
+    getMedicalTreatment(id) {
392
+      var name = ''
393
+      for (let i = 0; i < this.medicalCare.length; i++) {
394
+        if (this.medicalCare[i].id == id) {
395
+          name = this.medicalCare[i].name
396
+        }
397
+      }
398
+      return name
399
+    },
400
+    getTime(value, temp) {
401
+      if (value != undefined) {
402
+        return uParseTime(value, temp)
403
+      }
404
+      return ''
405
+    }, toReturnSZPatient(val) {
406
+      if(val.balance_accounts_type == 2){
407
+        this.$confirm('是否退号', '退号 ', {
408
+          confirmButtonText: '确 定',
409
+          cancelButtonText: '取 消',
410
+          type: 'warning'
411
+        }).then(() => {
412
+          let params = {
413
+            'id': val.id,
414
+          };
415
+          refundNumber(params).then(response => {
416
+            if (response.data.state == 0) {
417
+              this.$message.error(response.data.msg);
418
+              this.loadingtwo = false;
419
+              return false
420
+            } else {
421
+              this.getlist()
422
+              this.$message({ message: '退号成功', type: 'success' });
423
+
424
+            }
425
+          })
426
+
427
+        }).catch(() => {
428
+
429
+        })
430
+
431
+      }else{
432
+        var that = this
433
+        this.$confirm('是否退号', '退号', {
434
+          confirmButtonText: '确 定',
435
+          cancelButtonText: '取 消',
436
+          type: 'warning'
437
+        }).then(() => {
438
+          axios.get('http://127.0.0.1:9532/sz/api/refundnumber/get', {
439
+            params: {
440
+              his_patient_id: val.id,
441
+              record_time: this.getTime(val.record_date, '{y}-{m}-{d}'),
442
+              admin_user_id: this.$store.getters.xt_user.user.id,
443
+              patient_id: val.patient_id
444
+            }
445
+          })
446
+            .then(function(response) {
447
+              if (response.data.state == 0) {
448
+                that.$message.error(response.data.msg)
449
+                return false
450
+              } else {
451
+                if (response.data.data.failed_code == -10) {
452
+                  that.$confirm(response.data.data.msg, '医保错误信息', {
453
+                    confirmButtonText: '确 定',
454
+                    type: 'warning'
455
+                  }).then(() => {
456
+
457
+                  }).catch(() => {
458
+                  })
459
+                  // that.$message.error(response.data.data.msg)
460
+
461
+                } else {
462
+                  that.getlist()
463
+                  that.$message({ message: '退号成功', type: 'success' })
464
+                }
465
+              }
466
+            })
467
+            .catch(function(error) {
468
+            })
469
+        }).catch(() => {
470
+        })
471
+      }
472
+    },
473
+    toReturnPatient(row) {
474
+      var that = this
475
+      this.$confirm('确认退号吗?', '退号', {
476
+        confirmButtonText: '确 定',
477
+        cancelButtonText: '取 消',
478
+        type: 'warning'
479
+      }).then(() => {
480
+        //
481
+        let params = {
482
+          'id':row.id,
483
+          'patient_id': row.patient_id,
484
+          'record_time': that.getTimes(row.record_date),
485
+          'admin_user_id': this.$store.getters.xt_user.user.id
486
+        }
487
+        axios.get('http://127.0.0.1:9532/api/refundnumber/post', {
488
+          params: params
489
+        })
490
+          .then(function(response) {
491
+            if (response.data.state == 0) {
492
+              that.$message.error(response.data.msg)
493
+              return false
494
+            } else {
495
+              if (response.data.data.failed_code == -10) {
496
+                // that.$message.error(response.data.data.msg)
497
+                that.$confirm(response.data.data.msg, '医保错误信息', {
498
+                  confirmButtonText: '确 定',
499
+                  type: 'warning'
500
+                }).then(() => {
501
+
502
+                }).catch(() => {
503
+                })
504
+              } else {
505
+                that.$message({ message: '退号成功', type: 'success', duration: 5000 });
506
+                that.getlist()
507
+              }
508
+            }
509
+          })
510
+          .catch(function(error) {
511
+          })
512
+        //
513
+        // changePatient(id).then(response => {
514
+        //   if (response.data.state == 1) {
515
+        //     var msg = response.data.data.msg
516
+        //     this.$message.success('退号成功')
517
+        //     this.getlist()
518
+        //   } else {
519
+        //     this.$message.error('患者已就诊,退号失败')
520
+        //   }
521
+        // })
522
+      })
523
+        .catch(() => {
524
+        })
525
+    }, getTimes(time) {
526
+      return uParseTime(time, '{y}-{m}-{d}')
527
+    },
528
+
529
+    querySearchAsync(keyword, cb) {
530
+      let key = '';
531
+      if (keyword != undefined) {
532
+        key = keyword
533
+      }
534
+      let searchArray = []
535
+
536
+      var params = {
537
+        keyword: key
538
+      }
539
+      console.log('params', params)
540
+      getHisPatient(params).then(response => {
541
+        if (response.data.state == 1) {
542
+          searchArray = response.data.data.patient
543
+          console.log('searcharrya', searchArray)
544
+          cb(searchArray)
545
+        }
546
+      })
547
+      return searchArray
548
+    },
549
+
550
+    handleSelect(val) {
551
+      this.search_input = val.name
552
+      this.getlist()
553
+    },
554
+    handleClose(done) {
555
+      done()
556
+    },
557
+    open(obj) {
558
+      this.dialogVisible = true
559
+      this.form = obj
560
+      console.log(obj)
561
+    },
562
+    getDictionaryDataConfig(type) {
563
+      let arr = getDictionaryDataConfig('system', 'social_type')
564
+      let str = ''
565
+      arr.map(item => {
566
+        if (item.id == type) {
567
+          str = item.name
568
+        }
569
+      })
570
+      return str
571
+    },
572
+    getCertificates(type) {
573
+      let arr = this.certificates
574
+      let str = ''
575
+      arr.map(item => {
576
+        if (item.value == type) {
577
+          str = item.label
578
+        }
579
+      })
580
+      return str
581
+    },
582
+    getSettlement(type) {
583
+      let arr = this.settlement
584
+      let str = ''
585
+      arr.map(item => {
586
+        if (item.value == type) {
587
+          str = item.label
588
+        }
589
+      })
590
+      return str
591
+    },
592
+    getMedicalCare(type) {
593
+      let arr = this.medicalCare
594
+      let str = ''
595
+      arr.map(item => {
596
+        if (item.id == type) {
597
+          str = item.name
598
+        }
599
+      })
600
+      return str
601
+    },
602
+    getRegister(type) {
603
+      let arr = this.newRegister
604
+      let str = ''
605
+      arr.map(item => {
606
+        if (item.value == type) {
607
+          str = item.label
608
+        }
609
+      })
610
+      return str
611
+    },
612
+    getDepartMent(type) {
613
+      let arr = this.departMent
614
+      let str = ''
615
+      arr.map(item => {
616
+        if (item.id == type) {
617
+          str = item.name
618
+        }
619
+      })
620
+      return str
621
+    },
622
+
623
+    getBanlance(id) {
624
+      var label = ''
625
+      for (let i = 0; i < this.settlement.length; i++) {
626
+        if (id == this.settlement[i].value) {
627
+          label = this.settlement[i].label
628
+        }
629
+      }
630
+      return label
631
+    }
632
+  }
633
+}
634
+</script>
635
+
636
+<style lang="scss" scoped>
637
+.basicForm {
638
+  display: flex;
639
+  flex-wrap: wrap;
640
+  justify-content: space-between;
641
+
642
+.el-form-item {
643
+  width: 33%;
644
+}
645
+
646
+}
647
+</style>