Browse Source

提交代码

陈少旭 1 year ago
parent
commit
c7125d3ea4
28 changed files with 5726 additions and 481 deletions
  1. 10 0
      src/api/his/his.js
  2. 9 0
      src/api/qcd.js
  3. 10 1
      src/router/modules/Dialysisanalysis.js
  4. 686 0
      src/xt_pages/Dialysisanalysis/platelets/all_ktv.vue
  5. 684 0
      src/xt_pages/Dialysisanalysis/platelets/all_urr.vue
  6. 28 10
      src/xt_pages/Dialysisanalysis/platelets/index.vue
  7. 643 0
      src/xt_pages/Dialysisanalysis/platelets/p_ktv.vue
  8. 647 0
      src/xt_pages/Dialysisanalysis/platelets/p_urr.vue
  9. 275 0
      src/xt_pages/Dialysisanalysis/summary/index.vue
  10. 66 33
      src/xt_pages/hospitalStation/summary.vue
  11. 51 13
      src/xt_pages/outpatientCharges/invoicePrint.vue
  12. 248 0
      src/xt_pages/outpatientCharges/invoiceTemplate/printEleven.vue
  13. 187 187
      src/xt_pages/outpatientCharges/invoiceTemplate/printSix.vue
  14. 265 0
      src/xt_pages/outpatientCharges/invoiceTemplate/printTen.vue
  15. 3 2
      src/xt_pages/outpatientCharges/outpatientChargesManagement.vue
  16. 7 162
      src/xt_pages/outpatientCharges/statementPrint.vue
  17. 1 1
      src/xt_pages/outpatientCharges/statementTemplate/printThree.vue
  18. 10 3
      src/xt_pages/outpatientCharges/statementTemplate/privateChargePrint.vue
  19. 2 2
      src/xt_pages/outpatientCharges/summary.vue
  20. 128 10
      src/xt_pages/outpatientDoctorStation/batch_print_checkTemplate/printOne.vue
  21. 696 0
      src/xt_pages/outpatientDoctorStation/batch_print_checkTemplate/printTwo.vue
  22. 2 4
      src/xt_pages/outpatientDoctorStation/pastInquiries.vue
  23. 19 20
      src/xt_pages/outpatientDoctorStation/print.vue
  24. 751 0
      src/xt_pages/outpatientDoctorStation/template/prinSeven.vue
  25. 13 0
      src/xt_pages/outpatientTool/components/batchPrint.vue
  26. 33 0
      src/xt_pages/outpatientTool/components/detail.vue
  27. 206 26
      src/xt_pages/outpatientTool/components/settle.vue
  28. 46 7
      src/xt_pages/outpatientTool/labelPrint.vue

+ 10 - 0
src/api/his/his.js View File

@@ -827,6 +827,16 @@ export function getMonthHisPatient(params){
827 827
 }
828 828
 
829 829
 
830
+export function changeOrderDesc(params){
831
+  return request({
832
+    url:"/api/changeorderdesc",
833
+    method:"get",
834
+    params:params
835
+  })
836
+}
837
+
838
+
839
+
830 840
 
831 841
 
832 842
 

+ 9 - 0
src/api/qcd.js View File

@@ -135,6 +135,15 @@ export function GetAllQCStatistisData(params) {
135 135
 
136 136
 
137 137
 
138
+export function GetFiveInstatistisc(params) {
139
+  return request({
140
+    url: '/api/qc/patientinspectionstatistis/get',
141
+    method: 'get',
142
+    params: params
143
+  })
144
+}
145
+
146
+
138 147
 
139 148
 
140 149
 

+ 10 - 1
src/router/modules/Dialysisanalysis.js View File

@@ -11,6 +11,15 @@ export default {
11 11
     icon: 'statistics'
12 12
   },
13 13
   children: [
14
+    {
15
+      path: '/Dialysisanalysis/qualitycontrol/summary',
16
+      component: () => import('@/xt_pages/Dialysisanalysis/summary/index'),
17
+      name: 'summary',
18
+      meta: {
19
+        title: '指标汇总',
20
+        noCache: true
21
+      }
22
+    },
14 23
     {
15 24
       path: '/Dialysisanalysis/qualitycontrol/thyroidGland',
16 25
       component: () => import('@/xt_pages/Dialysisanalysis/qualitycontrol/thyroidGland'),
@@ -67,7 +76,7 @@ export default {
67 76
       component: () => import('@/xt_pages/Dialysisanalysis/platelets/index'),
68 77
       name: 'thyroidGland',
69 78
       meta: {
70
-        title: '血小板',
79
+        title: 'KTV/URR',
71 80
         noCache: true
72 81
       }
73 82
     },{

+ 686 - 0
src/xt_pages/Dialysisanalysis/platelets/all_ktv.vue View File

@@ -0,0 +1,686 @@
1
+<template>
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
26
+            type="date"
27
+
28
+            placeholder="选择日期">
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
33
+            v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
36
+            type="date"
37
+            placeholder="选择日期">
38
+          </el-date-picker>
39
+        </div>
40
+      </el-col>
41
+      <el-col :span="3">
42
+        <el-button type="primary" @click="getData()">查询</el-button>
43
+      </el-col>
44
+    </el-row>
45
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
46
+      <p class="chartTitle">统计图</p>
47
+    </div>
48
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
49
+    <div style="width: 80%;margin: auto;">
50
+      <el-table
51
+        :data="tableData"
52
+        border
53
+        :header-cell-style="{
54
+          backgroundColor: 'rgb(245, 247, 250)',
55
+          color: '#606266'
56
+        }"
57
+        style="width: 100%;">
58
+        <el-table-column
59
+          prop="name"
60
+          align="center"
61
+          label="KTV"
62
+
63
+        >
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="count"
67
+          align="center"
68
+          label="人数"
69
+        >
70
+        </el-table-column>
71
+        <el-table-column
72
+          prop="address"
73
+          align="center"
74
+          label="操作">
75
+          <template slot-scope="scope">
76
+            <el-button @click="handleClick(scope.row)" style="font-size:16px;"
77
+                       type="text">查看详情
78
+            </el-button>
79
+          </template>
80
+        </el-table-column>
81
+      </el-table>
82
+    </div>
83
+    <el-dialog
84
+      width="1000px" class="registerDialog" :visible.sync="detailVisibility"
85
+      :close-on-click-modal="isClose"
86
+      :close-on-press-escape="isClose"
87
+    >
88
+      <el-row :gutter="25">
89
+        <el-col :span="5">
90
+          <div class="block">
91
+            <span>查询时间:</span>
92
+            <el-select size="small" v-model="time_type_two" placeholder="请选择"
93
+                       style="width:100px;margin-left:5px;" @change="changeItemTwo">
94
+              <el-option
95
+                v-for="item,index in times"
96
+                :key="index"
97
+                :label="item.label"
98
+                :value="item.value">
99
+              </el-option>
100
+            </el-select>
101
+          </div>
102
+        </el-col>
103
+        <el-col :span="10">
104
+          <div>
105
+            <el-date-picker
106
+              style="width: 120px"
107
+              v-model="start_time_one"
108
+              format="yyyy-MM-dd"
109
+              value-format="yyyy-MM-dd"
110
+              type="date"
111
+
112
+              placeholder="选择日期">
113
+            </el-date-picker>
114
+            <span>-</span>
115
+            <el-date-picker
116
+              style="width: 120px"
117
+              v-model="end_time_one"
118
+              format="yyyy-MM-dd"
119
+              value-format="yyyy-MM-dd"
120
+              type="date"
121
+              placeholder="选择日期">
122
+            </el-date-picker>
123
+          </div>
124
+        </el-col>
125
+
126
+        <el-col :span="4">
127
+          <div>
128
+
129
+            <el-select size="small" v-model="statistics_type" placeholder="请选择"
130
+                       style="width:100px;margin-left:5px;">
131
+              <el-option
132
+                v-for="item,index in statistics_types"
133
+                :key="index"
134
+                :label="item.label"
135
+                :value="item.value">
136
+              </el-option>
137
+            </el-select>
138
+
139
+          </div>
140
+        </el-col>
141
+
142
+        <!--        <el-col :span="4">-->
143
+        <!--          <div>-->
144
+        <!--            <el-select size="small" v-model="sort_type" placeholder="请选择"-->
145
+        <!--                       style="width:100px;margin-left:5px;">-->
146
+        <!--              <el-option-->
147
+        <!--                v-for="item,index in sort_types"-->
148
+        <!--                :key="index"-->
149
+        <!--                :label="item.label"-->
150
+        <!--                :value="item.value">-->
151
+        <!--              </el-option>-->
152
+        <!--            </el-select>-->
153
+        <!--          </div>-->
154
+        <!--        </el-col>-->
155
+
156
+        <el-col :span="4">
157
+          <div >
158
+            <el-input v-model="keyword" placeholder="请输入患者姓名或透析号"></el-input>
159
+          </div>
160
+        </el-col>
161
+
162
+        <el-col :span="2">
163
+          <div>
164
+            <el-button @click="getDataTwo()">查询</el-button>
165
+          </div>
166
+        </el-col>
167
+
168
+        <el-col :span="2">
169
+          <div>
170
+            <el-button @click="exportAction()">导出</el-button>
171
+          </div>
172
+        </el-col>
173
+
174
+        <!--        <el-col :span="2">-->
175
+        <!--          <div>-->
176
+        <!--            <el-button @click="getDataTwo()">打印</el-button>-->
177
+        <!--          </div>-->
178
+        <!--        </el-col>-->
179
+
180
+
181
+
182
+
183
+
184
+      </el-row>
185
+
186
+      <el-table
187
+        :data="patientTableData"
188
+        border
189
+        ref="table"
190
+        max-height="500px"
191
+        style="width: 100%">
192
+        <el-table-column
193
+          prop="dialysis_no"
194
+          align="center"
195
+          label="透析号"
196
+        >
197
+        </el-table-column>
198
+        <el-table-column
199
+          prop="name"
200
+          label="患者姓名"
201
+        >
202
+        </el-table-column>
203
+        <el-table-column
204
+          prop="date"
205
+          label="检查日期"
206
+        >
207
+        </el-table-column>
208
+
209
+        <el-table-column
210
+          prop="inspect_value"
211
+          label="结果"
212
+        >
213
+        </el-table-column>
214
+
215
+      </el-table>
216
+
217
+      <div slot="footer" class="dialog-footer">
218
+        <el-button @click="detailVisibility = false">取消</el-button>
219
+        <el-button type="primary" @click="detailVisibility = false">确定</el-button>
220
+      </div>
221
+    </el-dialog>
222
+
223
+  </div>
224
+</template>
225
+<script>
226
+import * as echarts from 'echarts'
227
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
228
+
229
+const moment = require('moment')
230
+
231
+export default {
232
+  props: {
233
+
234
+    width: {
235
+      type: String,
236
+      default: '100%'
237
+    },
238
+    height: {
239
+      type: String,
240
+      default: '400px'
241
+    }
242
+
243
+  },
244
+  data() {
245
+    return {
246
+      statistics_types:[
247
+        { value: 1, label: '不达标患者' },
248
+        { value: 2, label: '未检查患者' },
249
+        { value: 3, label: '达标患者' },
250
+      ],
251
+      sort_types:[
252
+        { value: 1, label: '时间' },
253
+        { value: 2, label: '患者' },
254
+      ],
255
+      detailVisibility:false,
256
+      isClose:true,
257
+      time_type: 1,
258
+      time_type_two:1,
259
+      times: [
260
+        { value: 1, label: '本月' },
261
+        { value: 2, label: '上月' },
262
+        { value: 3, label: '今年' },
263
+        { value: 4, label: '上一年' },
264
+        { value: 5, label: '第一季度' },
265
+        { value: 6, label: '第二季度' },
266
+        { value: 7, label: '第三季度' },
267
+        { value: 8, label: '第四季度' },
268
+        { value: 9, label: '自定义' }
269
+
270
+      ],
271
+      time_month: '',
272
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
273
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
274
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
275
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
276
+
277
+      input: '',
278
+      myChart: {},
279
+      pieData: [],
280
+      pieName: [],
281
+      reference:{},
282
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
283
+      tableData: [],
284
+      statistics_type:1,
285
+      sort_type:"",
286
+      keyword:"",
287
+      patientTableData:[],
288
+    }
289
+  },
290
+  mounted() {
291
+    this.getData()
292
+  },
293
+  methods: {
294
+    exportAction(){
295
+      let list = []
296
+      for (let i = 0; i < this.patientTableData.length; i++) {
297
+        let order = this.patientTableData[i]
298
+        let name = order.name
299
+        let value = order.inspect_value
300
+        let inspect_date = order.date
301
+
302
+        let obj = {
303
+          '姓名': name,
304
+          '数值': value,
305
+          '日期': inspect_date,
306
+        }
307
+        list.push(obj)
308
+      }
309
+      import('@/vendor/Export2Excel').then(excel => {
310
+        const tHeader = ['姓名', '数值', '日期']
311
+        const filterVal = ['姓名', '数值', '日期']
312
+        const data = this.formatJson(filterVal, list)
313
+        excel.export_json_to_excel1({
314
+          header: tHeader,
315
+          data,
316
+          filename: '明细',
317
+          ref: this.$refs['table'].$el
318
+        })
319
+      })
320
+    },
321
+
322
+    formatJson(filterVal, jsonData) {
323
+      return jsonData.map(v => filterVal.map(j => v[j]))
324
+    },
325
+    getDataTwo() {
326
+      if(this.start_time_one.length == 0){
327
+        this.$message.error("请选择开始时间")
328
+      }
329
+      if(this.end_time_one.length == 0){
330
+        this.$message.error("请选择结束时间")
331
+      }
332
+      let params = {
333
+        start_date: this.start_time_one,
334
+        end_date: this.end_time_one,
335
+        item_type:this.statistics_type,
336
+        order_type:this.sort_type,
337
+        keyword: this.keyword,
338
+        type:2,
339
+      }
340
+      this.patientTableData = []
341
+      GetAllQCStatistisData(params).then(response => {
342
+        if (response.data.state == 1) {
343
+          this.detailVisibility = true
344
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
345
+        } else {
346
+          this.$message.error(response.data.msg)
347
+        }
348
+      })
349
+
350
+    },
351
+    getData() {
352
+      if(this.start_time.length == 0){
353
+        this.$message.error("请选择开始时间")
354
+      }
355
+      if(this.end_time.length == 0){
356
+        this.$message.error("请选择结束时间")
357
+      }
358
+      let params = {
359
+        start_date: this.start_time,
360
+        end_date: this.end_time,
361
+        type:2,
362
+
363
+      }
364
+      this.pieData = []
365
+      this.tableData = []
366
+      GetQCStatistisData(params).then(response => {
367
+        if (response.data.state == 1) {
368
+          // this.reference = response.data.data.reference
369
+          // this.input = response.data.data.reference.range_min + "<=" + response.data.data.reference.item_name + "<=" + response.data.data.reference.range_max
370
+          let objone = {
371
+            value:  response.data.data.unusual_total ,
372
+            name: '不达标值患者',
373
+            count:response.data.data.unusual_total,
374
+          }
375
+          this.pieData.push(objone)
376
+          this.tableData.push(objone)
377
+
378
+          let objtwo = {
379
+            value:   response.data.data.normal_total,
380
+            name: '达标值患者',
381
+            count:response.data.data.normal_total,
382
+
383
+          }
384
+          this.pieData.push(objtwo)
385
+          this.tableData.push(objtwo)
386
+
387
+          let objthree = {
388
+            value: response.data.data.no_check_total ,
389
+            name: '未检查患者',
390
+            count:response.data.data.no_check_total,
391
+
392
+          }
393
+          this.pieData.push(objthree)
394
+          this.tableData.push(objthree)
395
+
396
+          let objfour = {
397
+            value: response.data.data.patient_count,
398
+            name: '合计',
399
+            count:response.data.data.patient_count,
400
+          }
401
+          this.tableData.push(objfour)
402
+          for (let i = 0; i < this.pieData.length; i++) {
403
+            this.pieName[i] = this.pieData[i].name
404
+          }
405
+          this.myChart = echarts.init(document.getElementById('mychart'))
406
+          window.addEventListener('resize', () => {
407
+            this.myChart.resize()
408
+          })
409
+          const option = {
410
+            legend: {
411
+              // 图例
412
+              data: this.pieName,
413
+              left: '10%',
414
+              top: '30%',
415
+              orient: 'vertical'
416
+            },
417
+            color: ['#F74587', '#32D79B', '#6590FF'],
418
+
419
+
420
+            title: {
421
+              // 设置饼图标题,位置设为顶部居中
422
+              //   text: "国内院士前五省份图示",
423
+              top: '0%',
424
+              left: 'center'
425
+            },
426
+            series: [
427
+              {
428
+                type: 'pie',
429
+                label: {
430
+                  normal : {
431
+                    formatter: '{b}:{c}: ({d}%)',
432
+                    textStyle : {
433
+                      fontWeight : 'normal',
434
+                      fontSize : 15,
435
+                      color : "black"
436
+                    }
437
+                  }
438
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
439
+                },
440
+                radius: '65%', //饼图半径
441
+                data: this.pieData,
442
+                itemStyle : {
443
+                  emphasis: {
444
+                    shadowBlur: 10,
445
+                    shadowOffsetX: 0,
446
+                    shadowColor: 'rgba(0, 0, 0, 0.5)'
447
+                  }
448
+                }
449
+              }
450
+            ]
451
+          }
452
+          //   console.log(this.seriesData);
453
+          const optionFree = {
454
+            series: [
455
+              {
456
+                data: this.seriesData,
457
+                type: 'line',
458
+                smooth: true
459
+              }
460
+            ]
461
+          }
462
+          this.myChart = echarts.init(document.getElementById('mychart'))
463
+          this.myChart.setOption(option)
464
+        } else {
465
+          this.$message.error(response.data.msg)
466
+        }
467
+      })
468
+
469
+    },
470
+    changeItem(val) {
471
+      const currentDate = new Date()
472
+      switch (val) {
473
+        case 1:
474
+
475
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
476
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
477
+
478
+          this.start_time = startOfMonth
479
+          this.end_time = endOfMonth
480
+          this.getData()
481
+
482
+          break
483
+        case 2:
484
+          // 上月的起始日期和结束日期
485
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
486
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
487
+
488
+          this.start_time = startOfLastMonth
489
+          this.end_time = endOfLastMonth
490
+          this.getData()
491
+
492
+          break
493
+        case 3:
494
+          // 今年的起始日期和结束日期
495
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
496
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
497
+
498
+          this.start_time = startOfYear
499
+          this.end_time = endOfYear
500
+          this.getData()
501
+
502
+          break
503
+        case 4:
504
+          // 上一年的起始日期和结束日期
505
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
506
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
507
+
508
+          this.start_time = startOfLastYear
509
+          this.end_time = endOfLastYear
510
+          this.getData()
511
+
512
+          break
513
+        case 5:
514
+          // 第一季度的起始日期和结束日期
515
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
516
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
517
+
518
+          this.start_time = startOfFirstQuarter
519
+          this.end_time = endOfFirstQuarter
520
+          this.getData()
521
+
522
+          break
523
+        case 6:
524
+          // 第二季度的起始日期和结束日期
525
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
526
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
527
+
528
+          this.start_time = startOfSecondQuarter
529
+          this.end_time = endOfSecondQuarter
530
+          this.getData()
531
+
532
+          break
533
+        case 7:
534
+          // 第三季度的起始日期和结束日期
535
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
536
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
537
+
538
+          this.start_time = startOfThirdQuarter
539
+          this.end_time = endOfThirdQuarter
540
+          this.getData()
541
+
542
+          break
543
+        case 8:
544
+          // 第四季度的起始日期和结束日期
545
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
546
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
547
+
548
+          this.start_time = startOfFourthQuarter
549
+          this.end_time = endOfFourthQuarter
550
+          this.getData()
551
+          break
552
+        case 9:
553
+          this.start_time = ''
554
+          this.end_time = ''
555
+          break
556
+      }
557
+    },
558
+    changeItemTwo(val) {
559
+      const currentDate = new Date()
560
+      switch (val) {
561
+        case 1:
562
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
563
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
564
+          this.start_time_one = startOfMonth
565
+          this.end_time_one = endOfMonth
566
+          // this.getDataTwo()
567
+          break
568
+        case 2:
569
+          // 上月的起始日期和结束日期
570
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
571
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
572
+          this.start_time_one = startOfLastMonth
573
+          this.end_time_one = endOfLastMonth
574
+          // this.getDataTwo()
575
+          break
576
+        case 3:
577
+          // 今年的起始日期和结束日期
578
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
579
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
580
+
581
+          this.start_time_one = startOfYear
582
+          this.end_time_one = endOfYear
583
+          // this.getDataTwo()
584
+
585
+          break
586
+        case 4:
587
+          // 上一年的起始日期和结束日期
588
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
589
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
590
+
591
+          this.start_time_one = startOfLastYear
592
+          this.end_time_one = endOfLastYear
593
+          // this.getDataTwo()
594
+
595
+          break
596
+        case 5:
597
+          // 第一季度的起始日期和结束日期
598
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
599
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
600
+          this.start_time_one = startOfFirstQuarter
601
+          this.end_time_one = endOfFirstQuarter
602
+          // this.getDataTwo()
603
+          break
604
+        case 6:
605
+          // 第二季度的起始日期和结束日期
606
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
607
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
608
+          this.start_time_one = startOfSecondQuarter
609
+          this.end_time_one = endOfSecondQuarter
610
+          // this.getDataTwo()
611
+          break
612
+        case 7:
613
+          // 第三季度的起始日期和结束日期
614
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
615
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
616
+
617
+          this.start_time_one = startOfThirdQuarter
618
+          this.end_time_one = endOfThirdQuarter
619
+          // this.getDataTwo()
620
+
621
+          break
622
+        case 8:
623
+          // 第四季度的起始日期和结束日期
624
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
625
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
626
+
627
+          this.start_time_one = startOfFourthQuarter
628
+          this.end_time_one = endOfFourthQuarter
629
+          // this.getDataTwo()
630
+          break
631
+        case 9:
632
+          this.start_time_one = ''
633
+          this.end_time_one = ''
634
+          break
635
+      }
636
+    },
637
+
638
+
639
+    getSummaries(param) {
640
+      const { columns, data } = param
641
+      const sums = []
642
+      columns.forEach((column, index) => {
643
+        if (index === 0) {
644
+          sums[index] = '总价'
645
+          return
646
+        }
647
+        const values = data.map(item => Number(item[column.property]))
648
+        if (!values.every(value => isNaN(value))) {
649
+          sums[index] = values.reduce((prev, curr) => {
650
+            const value = Number(curr)
651
+            if (!isNaN(value)) {
652
+              return prev + curr
653
+            } else {
654
+              return prev
655
+            }
656
+          }, 0)
657
+          sums[index] += ' 元'
658
+        } else {
659
+          sums[index] = 'N/A'
660
+        }
661
+      })
662
+
663
+      return sums
664
+    },
665
+    handleClick(row) {
666
+      console.log(row)
667
+      if(row.name == "不达标值患者"){
668
+        this.statistics_type = 1
669
+      }else if(row.name == "达标值患者"){
670
+        this.statistics_type = 3
671
+      }else {
672
+        this.statistics_type = 2
673
+      }
674
+      this.getDataTwo()
675
+    }
676
+  }
677
+
678
+}
679
+</script>
680
+<style lang="scss" scoped>
681
+.content_top {
682
+  display: flex;
683
+  justify-content: space-around;
684
+  color: #1e5feb;
685
+}
686
+</style>

+ 684 - 0
src/xt_pages/Dialysisanalysis/platelets/all_urr.vue View File

@@ -0,0 +1,684 @@
1
+<template>
2
+  <div>
3
+    <el-row :gutter="25">
4
+      <el-col :span="5">
5
+        <div class="block">
6
+          <span>查询时间:</span>
7
+          <el-select size="small" v-model="time_type" placeholder="请选择"
8
+                     style="width:150px;margin-left:10px;" @change="changeItem">
9
+            <el-option
10
+              v-for="item,index in times"
11
+              :key="index"
12
+              :label="item.label"
13
+              :value="item.value">
14
+            </el-option>
15
+          </el-select>
16
+        </div>
17
+      </el-col>
18
+      <el-col :span="8">
19
+        <div>
20
+          <el-date-picker
21
+            style="width: 200px"
22
+
23
+            v-model="start_time"
24
+            format="yyyy-MM-dd"
25
+            value-format="yyyy-MM-dd"
26
+            type="date"
27
+
28
+            placeholder="选择日期">
29
+          </el-date-picker>
30
+          <span>-</span>
31
+          <el-date-picker
32
+            style="width: 200px"
33
+            v-model="end_time"
34
+            format="yyyy-MM-dd"
35
+            value-format="yyyy-MM-dd"
36
+            type="date"
37
+            placeholder="选择日期">
38
+          </el-date-picker>
39
+        </div>
40
+      </el-col>
41
+      <el-col :span="3">
42
+        <el-button type="primary" @click="getData()">查询</el-button>
43
+      </el-col>
44
+    </el-row>
45
+    <div class="cell clearfix" style="margin: 20px; font-weight: bold;">
46
+      <p class="chartTitle">统计图</p>
47
+    </div>
48
+    <div class="echart" id="mychart" :style={width:width,height:height}></div>
49
+    <div style="width: 80%;margin: auto;">
50
+      <el-table
51
+        :data="tableData"
52
+        border
53
+        :header-cell-style="{
54
+          backgroundColor: 'rgb(245, 247, 250)',
55
+          color: '#606266'
56
+        }"
57
+        style="width: 100%;">
58
+        <el-table-column
59
+          prop="name"
60
+          align="center"
61
+          label="URR"
62
+
63
+        >
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="count"
67
+          align="center"
68
+          label="人数"
69
+        >
70
+        </el-table-column>
71
+        <el-table-column
72
+          prop="address"
73
+          align="center"
74
+          label="操作">
75
+          <template slot-scope="scope">
76
+            <el-button @click="handleClick(scope.row)" style="font-size:16px;"
77
+                       type="text">查看详情
78
+            </el-button>
79
+          </template>
80
+        </el-table-column>
81
+      </el-table>
82
+    </div>
83
+    <el-dialog
84
+      width="1000px" class="registerDialog" :visible.sync="detailVisibility"
85
+      :close-on-click-modal="isClose"
86
+      :close-on-press-escape="isClose"
87
+    >
88
+      <el-row :gutter="25">
89
+        <el-col :span="5">
90
+          <div class="block">
91
+            <span>查询时间:</span>
92
+            <el-select size="small" v-model="time_type_two" placeholder="请选择"
93
+                       style="width:100px;margin-left:5px;" @change="changeItemTwo">
94
+              <el-option
95
+                v-for="item,index in times"
96
+                :key="index"
97
+                :label="item.label"
98
+                :value="item.value">
99
+              </el-option>
100
+            </el-select>
101
+          </div>
102
+        </el-col>
103
+        <el-col :span="10">
104
+          <div>
105
+            <el-date-picker
106
+              style="width: 120px"
107
+              v-model="start_time_one"
108
+              format="yyyy-MM-dd"
109
+              value-format="yyyy-MM-dd"
110
+              type="date"
111
+
112
+              placeholder="选择日期">
113
+            </el-date-picker>
114
+            <span>-</span>
115
+            <el-date-picker
116
+              style="width: 120px"
117
+              v-model="end_time_one"
118
+              format="yyyy-MM-dd"
119
+              value-format="yyyy-MM-dd"
120
+              type="date"
121
+              placeholder="选择日期">
122
+            </el-date-picker>
123
+          </div>
124
+        </el-col>
125
+
126
+        <el-col :span="4">
127
+          <div>
128
+
129
+            <el-select size="small" v-model="statistics_type" placeholder="请选择"
130
+                       style="width:100px;margin-left:5px;">
131
+              <el-option
132
+                v-for="item,index in statistics_types"
133
+                :key="index"
134
+                :label="item.label"
135
+                :value="item.value">
136
+              </el-option>
137
+            </el-select>
138
+
139
+          </div>
140
+        </el-col>
141
+
142
+        <!--        <el-col :span="4">-->
143
+        <!--          <div>-->
144
+        <!--            <el-select size="small" v-model="sort_type" placeholder="请选择"-->
145
+        <!--                       style="width:100px;margin-left:5px;">-->
146
+        <!--              <el-option-->
147
+        <!--                v-for="item,index in sort_types"-->
148
+        <!--                :key="index"-->
149
+        <!--                :label="item.label"-->
150
+        <!--                :value="item.value">-->
151
+        <!--              </el-option>-->
152
+        <!--            </el-select>-->
153
+        <!--          </div>-->
154
+        <!--        </el-col>-->
155
+
156
+        <el-col :span="4">
157
+          <div >
158
+            <el-input v-model="keyword" placeholder="请输入患者姓名或透析号"></el-input>
159
+          </div>
160
+        </el-col>
161
+
162
+        <el-col :span="2">
163
+          <div>
164
+            <el-button @click="getDataTwo()">查询</el-button>
165
+          </div>
166
+        </el-col>
167
+
168
+        <el-col :span="2">
169
+          <div>
170
+            <el-button @click="exportAction()">导出</el-button>
171
+          </div>
172
+        </el-col>
173
+
174
+        <!--        <el-col :span="2">-->
175
+        <!--          <div>-->
176
+        <!--            <el-button @click="getDataTwo()">打印</el-button>-->
177
+        <!--          </div>-->
178
+        <!--        </el-col>-->
179
+
180
+
181
+
182
+
183
+
184
+      </el-row>
185
+
186
+      <el-table
187
+        :data="patientTableData"
188
+        border
189
+        ref="table"
190
+        max-height="500px"
191
+        style="width: 100%">
192
+        <el-table-column
193
+          prop="dialysis_no"
194
+          align="center"
195
+          label="透析号"
196
+        >
197
+        </el-table-column>
198
+        <el-table-column
199
+          prop="name"
200
+          label="患者姓名"
201
+        >
202
+        </el-table-column>
203
+        <el-table-column
204
+          prop="date"
205
+          label="检查日期"
206
+        >
207
+        </el-table-column>
208
+
209
+        <el-table-column
210
+          prop="inspect_value"
211
+          label="结果"
212
+        >
213
+        </el-table-column>
214
+
215
+      </el-table>
216
+
217
+      <div slot="footer" class="dialog-footer">
218
+        <el-button @click="detailVisibility = false">取消</el-button>
219
+        <el-button type="primary" @click="detailVisibility = false">确定</el-button>
220
+      </div>
221
+    </el-dialog>
222
+
223
+  </div>
224
+</template>
225
+<script>
226
+import * as echarts from 'echarts'
227
+import { GetAllQCStatistisData, GetQCStatistisData } from '../../../api/qcd'
228
+
229
+const moment = require('moment')
230
+
231
+export default {
232
+  props: {
233
+
234
+    width: {
235
+      type: String,
236
+      default: '100%'
237
+    },
238
+    height: {
239
+      type: String,
240
+      default: '400px'
241
+    }
242
+
243
+  },
244
+  data() {
245
+    return {
246
+      statistics_types:[
247
+        { value: 1, label: '不达标患者' },
248
+        { value: 2, label: '未检查患者' },
249
+        { value: 3, label: '达标患者' },
250
+      ],
251
+      sort_types:[
252
+        { value: 1, label: '时间' },
253
+        { value: 2, label: '患者' },
254
+      ],
255
+      detailVisibility:false,
256
+      isClose:true,
257
+      time_type: 1,
258
+      time_type_two:1,
259
+      times: [
260
+        { value: 1, label: '本月' },
261
+        { value: 2, label: '上月' },
262
+        { value: 3, label: '今年' },
263
+        { value: 4, label: '上一年' },
264
+        { value: 5, label: '第一季度' },
265
+        { value: 6, label: '第二季度' },
266
+        { value: 7, label: '第三季度' },
267
+        { value: 8, label: '第四季度' },
268
+        { value: 9, label: '自定义' }
269
+
270
+      ],
271
+      time_month: '',
272
+      start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
273
+      end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
274
+      start_time_one: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
275
+      end_time_one: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
276
+
277
+      input: '',
278
+      myChart: {},
279
+      pieData: [],
280
+      pieName: [],
281
+      reference:{},
282
+      // myChartStyle:{float: "right", width: "100%", height: "400px"},
283
+      tableData: [],
284
+      statistics_type:1,
285
+      sort_type:"",
286
+      keyword:"",
287
+      patientTableData:[],
288
+    }
289
+  },
290
+  mounted() {
291
+    this.getData()
292
+  },
293
+  methods: {
294
+    exportAction(){
295
+      let list = []
296
+      for (let i = 0; i < this.patientTableData.length; i++) {
297
+        let order = this.patientTableData[i]
298
+        let name = order.name
299
+        let value = order.inspect_value
300
+        let inspect_date = order.date
301
+
302
+        let obj = {
303
+          '姓名': name,
304
+          '数值': value,
305
+          '日期': inspect_date,
306
+        }
307
+        list.push(obj)
308
+      }
309
+      import('@/vendor/Export2Excel').then(excel => {
310
+        const tHeader = ['姓名', '数值', '日期']
311
+        const filterVal = ['姓名', '数值', '日期']
312
+        const data = this.formatJson(filterVal, list)
313
+        excel.export_json_to_excel1({
314
+          header: tHeader,
315
+          data,
316
+          filename: '明细',
317
+          ref: this.$refs['table'].$el
318
+        })
319
+      })
320
+    },
321
+
322
+    formatJson(filterVal, jsonData) {
323
+      return jsonData.map(v => filterVal.map(j => v[j]))
324
+    },
325
+    getDataTwo() {
326
+      if(this.start_time_one.length == 0){
327
+        this.$message.error("请选择开始时间")
328
+      }
329
+      if(this.end_time_one.length == 0){
330
+        this.$message.error("请选择结束时间")
331
+      }
332
+      let params = {
333
+        start_date: this.start_time_one,
334
+        end_date: this.end_time_one,
335
+        item_type:this.statistics_type,
336
+        order_type:this.sort_type,
337
+        keyword: this.keyword,
338
+        type:3,
339
+      }
340
+      this.patientTableData = []
341
+      GetAllQCStatistisData(params).then(response => {
342
+        if (response.data.state == 1) {
343
+          this.detailVisibility = true
344
+          this.patientTableData  =  this.patientTableData.concat(response.data.data.list)
345
+        } else {
346
+          this.$message.error(response.data.msg)
347
+        }
348
+      })
349
+
350
+    },
351
+    getData() {
352
+      if(this.start_time.length == 0){
353
+        this.$message.error("请选择开始时间")
354
+      }
355
+      if(this.end_time.length == 0){
356
+        this.$message.error("请选择结束时间")
357
+      }
358
+      let params = {
359
+        start_date: this.start_time,
360
+        end_date: this.end_time,
361
+        type:3,
362
+      }
363
+      this.pieData = []
364
+      this.tableData = []
365
+      console.log("~~~~~~~~~~")
366
+      GetQCStatistisData(params).then(response => {
367
+        if (response.data.state == 1) {
368
+          let objone = {
369
+            value:  response.data.data.unusual_total ,
370
+            name: '不达标值患者',
371
+            count:response.data.data.unusual_total,
372
+          }
373
+          this.pieData.push(objone)
374
+          this.tableData.push(objone)
375
+
376
+          let objtwo = {
377
+            value:   response.data.data.normal_total,
378
+            name: '达标值患者',
379
+            count:response.data.data.normal_total,
380
+
381
+          }
382
+          this.pieData.push(objtwo)
383
+          this.tableData.push(objtwo)
384
+
385
+          let objthree = {
386
+            value: response.data.data.no_check_total ,
387
+            name: '未检查患者',
388
+            count:response.data.data.no_check_total,
389
+
390
+          }
391
+          this.pieData.push(objthree)
392
+          this.tableData.push(objthree)
393
+
394
+          let objfour = {
395
+            value: response.data.data.patient_count,
396
+            name: '合计',
397
+            count:response.data.data.patient_count,
398
+          }
399
+          this.tableData.push(objfour)
400
+          for (let i = 0; i < this.pieData.length; i++) {
401
+            this.pieName[i] = this.pieData[i].name
402
+          }
403
+          this.myChart = echarts.init(document.getElementById('mychart'))
404
+          window.addEventListener('resize', () => {
405
+            this.myChart.resize()
406
+          })
407
+          const option = {
408
+            legend: {
409
+              // 图例
410
+              data: this.pieName,
411
+              left: '10%',
412
+              top: '30%',
413
+              orient: 'vertical'
414
+            },
415
+            color: ['#F74587', '#32D79B', '#6590FF'],
416
+
417
+
418
+            title: {
419
+              // 设置饼图标题,位置设为顶部居中
420
+              //   text: "国内院士前五省份图示",
421
+              top: '0%',
422
+              left: 'center'
423
+            },
424
+            series: [
425
+              {
426
+                type: 'pie',
427
+                label: {
428
+                  normal : {
429
+                    formatter: '{b}:{c}: ({d}%)',
430
+                    textStyle : {
431
+                      fontWeight : 'normal',
432
+                      fontSize : 15,
433
+                      color : "black"
434
+                    }
435
+                  }
436
+                  // b代表名称,c代表对应值,d代表百分比"{b} : {d}% ({c})"
437
+                },
438
+                radius: '65%', //饼图半径
439
+                data: this.pieData,
440
+                itemStyle : {
441
+                  emphasis: {
442
+                    shadowBlur: 10,
443
+                    shadowOffsetX: 0,
444
+                    shadowColor: 'rgba(0, 0, 0, 0.5)'
445
+                  }
446
+                }
447
+              }
448
+            ]
449
+          }
450
+          //   console.log(this.seriesData);
451
+          const optionFree = {
452
+            series: [
453
+              {
454
+                data: this.seriesData,
455
+                type: 'line',
456
+                smooth: true
457
+              }
458
+            ]
459
+          }
460
+          this.myChart = echarts.init(document.getElementById('mychart'))
461
+          this.myChart.setOption(option)
462
+        } else {
463
+          this.$message.error(response.data.msg)
464
+        }
465
+      })
466
+
467
+    },
468
+    changeItem(val) {
469
+      const currentDate = new Date()
470
+      switch (val) {
471
+        case 1:
472
+
473
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
474
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
475
+
476
+          this.start_time = startOfMonth
477
+          this.end_time = endOfMonth
478
+          this.getData()
479
+
480
+          break
481
+        case 2:
482
+          // 上月的起始日期和结束日期
483
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
484
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
485
+
486
+          this.start_time = startOfLastMonth
487
+          this.end_time = endOfLastMonth
488
+          this.getData()
489
+
490
+          break
491
+        case 3:
492
+          // 今年的起始日期和结束日期
493
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
494
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
495
+
496
+          this.start_time = startOfYear
497
+          this.end_time = endOfYear
498
+          this.getData()
499
+
500
+          break
501
+        case 4:
502
+          // 上一年的起始日期和结束日期
503
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
504
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
505
+
506
+          this.start_time = startOfLastYear
507
+          this.end_time = endOfLastYear
508
+          this.getData()
509
+
510
+          break
511
+        case 5:
512
+          // 第一季度的起始日期和结束日期
513
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
514
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
515
+
516
+          this.start_time = startOfFirstQuarter
517
+          this.end_time = endOfFirstQuarter
518
+          this.getData()
519
+
520
+          break
521
+        case 6:
522
+          // 第二季度的起始日期和结束日期
523
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
524
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
525
+
526
+          this.start_time = startOfSecondQuarter
527
+          this.end_time = endOfSecondQuarter
528
+          this.getData()
529
+
530
+          break
531
+        case 7:
532
+          // 第三季度的起始日期和结束日期
533
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
534
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
535
+
536
+          this.start_time = startOfThirdQuarter
537
+          this.end_time = endOfThirdQuarter
538
+          this.getData()
539
+
540
+          break
541
+        case 8:
542
+          // 第四季度的起始日期和结束日期
543
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
544
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
545
+
546
+          this.start_time = startOfFourthQuarter
547
+          this.end_time = endOfFourthQuarter
548
+          this.getData()
549
+          break
550
+        case 9:
551
+          this.start_time = ''
552
+          this.end_time = ''
553
+          break
554
+      }
555
+    },
556
+    changeItemTwo(val) {
557
+      const currentDate = new Date()
558
+      switch (val) {
559
+        case 1:
560
+          const startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1).toLocaleDateString('en-CA')
561
+          const endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).toLocaleDateString('en-CA')
562
+          this.start_time_one = startOfMonth
563
+          this.end_time_one = endOfMonth
564
+          // this.getDataTwo()
565
+          break
566
+        case 2:
567
+          // 上月的起始日期和结束日期
568
+          const startOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1).toLocaleDateString('en-CA')
569
+          const endOfLastMonth = new Date(currentDate.getFullYear(), currentDate.getMonth(), 0).toLocaleDateString('en-CA')
570
+          this.start_time_one = startOfLastMonth
571
+          this.end_time_one = endOfLastMonth
572
+          // this.getDataTwo()
573
+          break
574
+        case 3:
575
+          // 今年的起始日期和结束日期
576
+          const startOfYear = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
577
+          const endOfYear = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
578
+
579
+          this.start_time_one = startOfYear
580
+          this.end_time_one = endOfYear
581
+          // this.getDataTwo()
582
+
583
+          break
584
+        case 4:
585
+          // 上一年的起始日期和结束日期
586
+          const startOfLastYear = new Date(currentDate.getFullYear() - 1, 0, 1).toLocaleDateString('en-CA')
587
+          const endOfLastYear = new Date(currentDate.getFullYear() - 1, 11, 31).toLocaleDateString('en-CA')
588
+
589
+          this.start_time_one = startOfLastYear
590
+          this.end_time_one = endOfLastYear
591
+          // this.getDataTwo()
592
+
593
+          break
594
+        case 5:
595
+          // 第一季度的起始日期和结束日期
596
+          const startOfFirstQuarter = new Date(currentDate.getFullYear(), 0, 1).toLocaleDateString('en-CA')
597
+          const endOfFirstQuarter = new Date(currentDate.getFullYear(), 2, 31).toLocaleDateString('en-CA')
598
+          this.start_time_one = startOfFirstQuarter
599
+          this.end_time_one = endOfFirstQuarter
600
+          // this.getDataTwo()
601
+          break
602
+        case 6:
603
+          // 第二季度的起始日期和结束日期
604
+          const startOfSecondQuarter = new Date(currentDate.getFullYear(), 3, 1).toLocaleDateString('en-CA')
605
+          const endOfSecondQuarter = new Date(currentDate.getFullYear(), 5, 30).toLocaleDateString('en-CA')
606
+          this.start_time_one = startOfSecondQuarter
607
+          this.end_time_one = endOfSecondQuarter
608
+          // this.getDataTwo()
609
+          break
610
+        case 7:
611
+          // 第三季度的起始日期和结束日期
612
+          const startOfThirdQuarter = new Date(currentDate.getFullYear(), 6, 1).toLocaleDateString('en-CA')
613
+          const endOfThirdQuarter = new Date(currentDate.getFullYear(), 8, 30).toLocaleDateString('en-CA')
614
+
615
+          this.start_time_one = startOfThirdQuarter
616
+          this.end_time_one = endOfThirdQuarter
617
+          // this.getDataTwo()
618
+
619
+          break
620
+        case 8:
621
+          // 第四季度的起始日期和结束日期
622
+          const startOfFourthQuarter = new Date(currentDate.getFullYear(), 9, 1).toLocaleDateString('en-CA')
623
+          const endOfFourthQuarter = new Date(currentDate.getFullYear(), 11, 31).toLocaleDateString('en-CA')
624
+
625
+          this.start_time_one = startOfFourthQuarter
626
+          this.end_time_one = endOfFourthQuarter
627
+          // this.getDataTwo()
628
+          break
629
+        case 9:
630
+          this.start_time_one = ''
631
+          this.end_time_one = ''
632
+          break
633
+      }
634
+    },
635
+
636
+
637
+    getSummaries(param) {
638
+      const { columns, data } = param
639
+      const sums = []
640
+      columns.forEach((column, index) => {
641
+        if (index === 0) {
642
+          sums[index] = '总价'
643
+          return
644
+        }
645
+        const values = data.map(item => Number(item[column.property]))
646
+        if (!values.every(value => isNaN(value))) {
647
+          sums[index] = values.reduce((prev, curr) => {
648
+            const value = Number(curr)
649
+            if (!isNaN(value)) {
650
+              return prev + curr
651
+            } else {
652
+              return prev
653
+            }
654
+          }, 0)
655
+          sums[index] += ' 元'
656
+        } else {
657
+          sums[index] = 'N/A'
658
+        }
659
+      })
660
+
661
+      return sums
662
+    },
663
+    handleClick(row) {
664
+      console.log(row)
665
+      if(row.name == "不达标值患者"){
666
+        this.statistics_type = 1
667
+      }else if(row.name == "达标值患者"){
668
+        this.statistics_type = 3
669
+      }else {
670
+        this.statistics_type = 2
671
+      }
672
+      this.getDataTwo()
673
+    }
674
+  }
675
+
676
+}
677
+</script>
678
+<style lang="scss" scoped>
679
+.content_top {
680
+  display: flex;
681
+  justify-content: space-around;
682
+  color: #1e5feb;
683
+}
684
+</style>

+ 28 - 10
src/xt_pages/Dialysisanalysis/platelets/index.vue View File

@@ -7,35 +7,53 @@
7 7
       <div class="app-container">
8 8
         <div class="page_patientControlAnalysis">
9 9
             <el-tabs v-model="activeName" @tab-click="handleClick" >
10
-                <el-tab-pane label="统计全部" name="first">
10
+                <el-tab-pane label="统计全部(KTV)" name="first">
11 11
                   <keep-alive>
12
-                    <plateletsall v-if="activeName == 'first'"></plateletsall>
12
+                    <all_ktv v-if="activeName == 'first'"></all_ktv>
13 13
                   </keep-alive>
14 14
                 </el-tab-pane>
15
-                
16
-                <el-tab-pane label="统计个人" name="second">
15
+              <el-tab-pane label="统计全部(URR)" name="second">
16
+                <keep-alive>
17
+                  <all_urr v-if="activeName == 'second'"></all_urr>
18
+                </keep-alive>
19
+              </el-tab-pane>
20
+
21
+                <el-tab-pane label="统计个人(KTV)" name="third">
17 22
                   <keep-alive>
18
-                    <plateletsalone v-if="activeName == 'second'"></plateletsalone>
23
+                    <p_ktv v-if="activeName == 'third'"></p_ktv>
19 24
                   </keep-alive>
20 25
                 </el-tab-pane>
21
-            
26
+
27
+
28
+              <el-tab-pane label="统计个人(URR)" name="four">
29
+                <keep-alive>
30
+                  <p_urr v-if="activeName == 'four'"></p_urr>
31
+                </keep-alive>
32
+              </el-tab-pane>
33
+
22 34
             </el-tabs>
23 35
         </div>
24 36
       </div>
25 37
     </div>
26 38
   </template>
27
-  
39
+
28 40
 <script>
29 41
 import echarts from 'echarts'
30 42
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
31 43
 import plateletsall from './plateletsall'
32 44
 import plateletsalone from './plateletsalone.vue'
45
+import All_ktv from './all_ktv.vue'
46
+import All_urr from './all_urr.vue'
47
+import P_ktv from './p_ktv.vue'
48
+import P_urr from './p_urr.vue'
33 49
 export default {
34 50
     name:'thyroidGland',
35 51
     components: {
52
+      P_urr,
53
+      P_ktv,
54
+      All_urr,
55
+      All_ktv,
36 56
         BreadCrumb,
37
-        plateletsall,
38
-        plateletsalone
39 57
     },
40 58
     data() {
41 59
         return {
@@ -99,4 +117,4 @@ export default {
99 117
 // }
100 118
 
101 119
 // }
102
-</style>
120
+</style>

+ 643 - 0
src/xt_pages/Dialysisanalysis/platelets/p_ktv.vue View File

@@ -0,0 +1,643 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
85
+            <div>
86
+              <line-chart :options="chart"></line-chart>
87
+              <!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+              <!--              <line-chart></line-chart>-->
89
+
90
+            </div>
91
+            <div class="tableTitle">统计表</div>
92
+            <div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
106
+
107
+                <el-table-column width="100" label="KTV" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
119
+    </div>
120
+  </div>
121
+</template>
122
+
123
+
124
+<script>
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
147
+        }
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        limit: 10,
162
+        page: 1,
163
+        type:2,
164
+      },
165
+      crumbs: [
166
+        { path: false, name: '科室质控' },
167
+        { path: false, name: '指标评估统计' },
168
+        { path: false, name: '透析过程指标统计' }
169
+      ],
170
+      tableData1: [],
171
+      chart: {
172
+        title: {
173
+          text: 'ECharts 入门示例'
174
+        },
175
+        tooltip: {},
176
+        legend: {
177
+          data: [],
178
+          left: 0
179
+        },
180
+        xAxis: {
181
+          data: []
182
+        },
183
+        yAxis: {
184
+          axisLabel: {
185
+            formatter: '{value} %'
186
+          },
187
+          show: false
188
+        },
189
+        series: [
190
+          {
191
+            name: '',
192
+            type: 'line',
193
+            data: [],
194
+            barWidth: 30,
195
+            label: {
196
+              normal: {
197
+                show: true,
198
+                position: 'top',
199
+                formatter: (params) => {
200
+                  if(this.percent.length > 0){
201
+                    let str = ''
202
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
203
+                    return str
204
+                  }else{
205
+                    let str = ''
206
+                    str = params.data
207
+                    return str
208
+                  }
209
+                }
210
+              }
211
+            },
212
+            //配置样式
213
+            itemStyle: {
214
+              //通常情况下:
215
+
216
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
217
+              normal: {
218
+                color: function(params) {
219
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
220
+                  var colorList = [
221
+                    ['#A9E0F3', '#9FBDFC'],
222
+
223
+                    ['#FFD7C0', '#FF9994']
224
+                  ]
225
+
226
+                  var index = params.dataIndex
227
+                  if (params.dataIndex >= colorList.length) {
228
+                    index = params.dataIndex % colorList.length
229
+                  }
230
+
231
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
232
+                    { offset: 0, color: colorList[index][0] },
233
+                    // { offset: 0.5, color: colorList[index][1] },
234
+                    { offset: 1, color: colorList[index][1] }
235
+                  ])
236
+                },
237
+                lineStyle:{
238
+                  color:'#409eff' //改变折线颜色
239
+                },
240
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
241
+              },
242
+
243
+              //鼠标悬停时:
244
+              emphasis: {
245
+                shadowBlur: 10,
246
+                shadowOffsetX: 0,
247
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
248
+              }
249
+            }
250
+          }
251
+        ],
252
+        dataZoom: [
253
+          {
254
+            // Y轴固定,让内容滚动
255
+            type: 'slider',
256
+            show: false,
257
+            xAxisIndex: [0],
258
+            start: 1,
259
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
260
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
261
+          },
262
+          {
263
+            type: 'inside',
264
+            xAxisIndex: [0],
265
+            start: 1,
266
+            end: 20,
267
+            zoomLock: true // 锁定区域禁止缩放
268
+          }
269
+        ]
270
+      },
271
+      bar: {
272
+        title: {
273
+          text: 'ECharts 入门示例'
274
+        },
275
+        tooltip: {},
276
+        legend: {
277
+          data: [],
278
+          left: 0
279
+        },
280
+        xAxis: {
281
+          data: []
282
+        },
283
+        yAxis: {
284
+          axisLabel: {
285
+            formatter: '{value} %'
286
+          },
287
+          show: false
288
+        },
289
+        series: [
290
+          {
291
+            name: '',
292
+            type: 'bar',
293
+            data: [],
294
+            barWidth: 30,
295
+            label: {
296
+              normal: {
297
+                show: true,
298
+                position: 'top',
299
+                formatter: (params) => {
300
+                  if(this.percent.length > 0){
301
+                    let str = ''
302
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
303
+                    return str
304
+                  }else{
305
+                    let str = ''
306
+                    str = params.data
307
+                    return str
308
+                  }
309
+                }
310
+              }
311
+            },
312
+            //配置样式
313
+            itemStyle: {
314
+              //通常情况下:
315
+
316
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
317
+              normal: {
318
+                color: function(params) {
319
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
320
+                  var colorList = [
321
+                    ['#A9E0F3', '#9FBDFC'],
322
+                    ['#FFD7C0', '#FF9994']
323
+                  ]
324
+
325
+                  var index = params.dataIndex
326
+                  if (params.dataIndex >= colorList.length) {
327
+                    index = params.dataIndex % colorList.length
328
+                  }
329
+
330
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
331
+                    { offset: 0, color: colorList[index][0] },
332
+                    // { offset: 0.5, color: colorList[index][1] },
333
+                    { offset: 1, color: colorList[index][1] }
334
+                  ])
335
+                },
336
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
337
+              },
338
+
339
+              //鼠标悬停时:
340
+              emphasis: {
341
+                shadowBlur: 10,
342
+                shadowOffsetX: 0,
343
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
344
+              }
345
+            }
346
+          }
347
+        ]
348
+      }
349
+
350
+    }
351
+  },
352
+  methods: {
353
+    printAction(){
354
+      this.$router.push({
355
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
356
+      });
357
+
358
+    },exportAction(){
359
+      let list = []
360
+      for (let i = 0; i < this.tableData.length; i++) {
361
+        let order = this.tableData[i]
362
+        let name = order.name
363
+        let value = order.value
364
+        let inspect_date = order.inspect_date
365
+
366
+        let obj = {
367
+          '姓名': name,
368
+          '数值': value,
369
+          '日期': inspect_date,
370
+        }
371
+        list.push(obj)
372
+      }
373
+      import('@/vendor/Export2Excel').then(excel => {
374
+        const tHeader = ['姓名', '数值', '日期']
375
+        const filterVal = ['姓名', '数值', '日期']
376
+        const data = this.formatJson(filterVal, list)
377
+        excel.export_json_to_excel1({
378
+          header: tHeader,
379
+          data,
380
+          filename: '明细',
381
+          ref: this.$refs['table'].$el
382
+        })
383
+      })
384
+    },
385
+    changeProject(val) {
386
+      this.query.statistics_type = val
387
+      this.query.page = 1
388
+      this.GetPersonQCStatistisData(this.query)
389
+      this.GetInspectionCheckIndexTableData(this.query)
390
+
391
+    },
392
+    handleChange(val) {
393
+      this.query.patient_id = val.id
394
+      this.query.page = 1
395
+      this.patient_name = val.name
396
+      this.GetPersonQCStatistisData(this.query)
397
+      this.GetInspectionCheckIndexTableData(this.query)
398
+    },
399
+    handleSizeChange(limit) {
400
+      this.query.limit = limit
401
+      this.GetInspectionCheckIndexTableData(this.query)
402
+
403
+    },
404
+    handleCurrentChange(page) {
405
+      this.query.page = page
406
+      this.GetPersonQCStatistisData(this.query)
407
+    },formatJson(filterVal, jsonData) {
408
+      return jsonData.map(v => filterVal.map(j => v[j]))
409
+    },
410
+    changeTime(val) {
411
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
412
+      if (time > 0) {
413
+        this.$message.error('结束时间不能小于开始时间')
414
+        this.query.start_time = ''
415
+      } else {
416
+        // this.getDialysisList()
417
+        this.query.page = 1
418
+        this.GetPersonQCStatistisData(this.query)
419
+        this.GetInspectionCheckIndexTableData(this.query)
420
+
421
+      }
422
+
423
+    },
424
+    changeEndTime(val) {
425
+      var time =
426
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
427
+      if (time < 0) {
428
+        this.$message.error('结束时间不能小于开始时间')
429
+        this.query.end_time = ''
430
+      } else {
431
+        this.query.page = 1
432
+        this.GetPersonQCStatistisData(this.query)
433
+        this.GetInspectionCheckIndexTableData(this.query)
434
+
435
+      }
436
+    },
437
+    getTimestamp(time) {
438
+      // 把时间日期转成时间戳
439
+      return new Date(time).getTime() / 1000
440
+    },
441
+    QueryOperaById: function(val) {
442
+      let vascular_access_desc_name = ''
443
+      let vascular_access_desc = getDataConfig(
444
+        'hemodialysis',
445
+        'vascular_access_desc'
446
+      )
447
+      for (let i = 0; i < vascular_access_desc.length; i++) {
448
+        if (vascular_access_desc[i].id == val) {
449
+          vascular_access_desc_name = vascular_access_desc[i].name
450
+        }
451
+      }
452
+
453
+      return vascular_access_desc_name
454
+    },
455
+    GetAnticoagulantById: function(val) {
456
+      let anticoagulan_name = ''
457
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
458
+      let anticoagulant = anticoagulantsConfitTwo
459
+      for (let keys in anticoagulant) {
460
+        if (anticoagulant[keys].id == val) {
461
+          anticoagulan_name = anticoagulant[keys].name
462
+        }
463
+      }
464
+      return anticoagulan_name
465
+    },
466
+    getModeName(mode_id) {
467
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
468
+    },  getTime(val) {
469
+      if(val == "" || val == undefined){
470
+        return ""
471
+      }else {
472
+        return uParseTime(val, '{y}-{m}-{d}')
473
+      }
474
+    },
475
+    GetInspectionCheckIndexTableData(params) {
476
+      this.loading = true
477
+      GetPersonQCStatistisData(params)
478
+        .then(rs => {
479
+          var resp = rs.data
480
+          console.log("resp=====",resp)
481
+          if (resp.state == 1) {
482
+            this.loading = false
483
+            this.tableData = []
484
+            for (let i = 0; i < resp.data.inspections.length; i++) {
485
+              let obj = {
486
+                name:resp.data.patient.name,
487
+                value:resp.data.inspections[i].inspect_value,
488
+                inspect_date:resp.data.inspections[i].inspect_date
489
+              }
490
+              this.tableData.push(obj)
491
+            }
492
+            this.total = resp.data.total
493
+
494
+          } else {
495
+            this.loading = false
496
+          }
497
+        })
498
+        .catch(error => {
499
+
500
+        })
501
+    },
502
+    GetPersonQCStatistisData(params) {
503
+      this.chart.xAxis.data = []
504
+      this.chart.series[0].data = []
505
+      this.bar.xAxis.data = []
506
+      this.bar.series[0].data = []
507
+      this.percent = []
508
+      GetPersonQCStatistisData(params)
509
+        .then(rs => {
510
+          var resp = rs.data
511
+          if (resp.state == 1) {
512
+            for (let i = 0; i < resp.data.inspections.length; i++) {
513
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
514
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
515
+            }
516
+            this.getArrLength(this.chart.xAxis.data,1)
517
+          } else {
518
+
519
+          }
520
+        })
521
+        .catch(error => {
522
+        })
523
+    },
524
+    handleSelect(val) {
525
+      this.query.patient_id = val.id
526
+      this.query.page = 1
527
+      this.patient_name = val.name
528
+      for (let i = 0;i < this.patientsData.length; i++){
529
+        if (this.patientsData[i].id == val.id){
530
+          this.$refs.table.setCurrentRow(this.patientsData[i])
531
+        }
532
+      }
533
+
534
+
535
+    },
536
+    querySearchAsync(keyword, cb) {
537
+      let key = ''
538
+      if (keyword != undefined) {
539
+        key = keyword
540
+      }
541
+      let searchArray = []
542
+      PostSearch(key).then(response => {
543
+        if (response.data.state == 1) {
544
+          searchArray = response.data.data.patient
545
+          cb(searchArray)
546
+        } else {
547
+          cb([])
548
+        }
549
+      })
550
+    },
551
+    chooseWay(way) {
552
+      this.wayType = way
553
+    }, getCurrentOrgPatients() {
554
+      getCurrentOrgPatients().then(response => {
555
+        if (response.data.state == 1) {
556
+          var patients = response.data.data.patients
557
+          this.patientsData = patients
558
+          this.GetDefaultPatient()
559
+        }
560
+      })
561
+    }, GetDefaultPatient() {
562
+      GetDefaultPatient().then(response => {
563
+        if (response.data.state == 1) {
564
+          var patient = response.data.data.patient
565
+          for (let i = 0;i < this.patientsData.length; i++){
566
+            if (this.patientsData[i].id == patient.id){
567
+              this.patient_name = this.patientsData[i].name
568
+              this.$refs.table.setCurrentRow(this.patientsData[i])
569
+            }
570
+          }
571
+          this.query.patient_id = patient.id
572
+          this.GetPersonQCStatistisData(this.query)
573
+
574
+        }
575
+      })
576
+
577
+    },
578
+    getArrLength(result,type){
579
+      if(type == 1){
580
+        if(result.length > 10){
581
+          var dataZoom_end = (10/result.length)*100;
582
+          this.chart.dataZoom[0].end = dataZoom_end
583
+        }else{
584
+          var dataZoom_end = 100;
585
+          this.chart.dataZoom[0].end = dataZoom_end
586
+        }
587
+      }else if(type == 2){
588
+        if(result.length > 10){
589
+          var dataZoom_end = (10/result.length)*100;
590
+          this.bar.dataZoom[0].end = dataZoom_end
591
+        }else{
592
+          var dataZoom_end = 100;
593
+          this.bar.dataZoom[0].end = dataZoom_end
594
+        }
595
+      }
596
+
597
+    }
598
+  }, mounted() {
599
+    var date = new Date()
600
+    var year = date.getFullYear() //获取完整的年份(4位)
601
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
602
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
603
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
604
+    this.query.patient_id = 0
605
+    this.query.end_time = year + '-' + month + '-' + day
606
+    this.query.start_time = year + '-' + last_month + '-' + day
607
+    this.query.project_id = 1
608
+    this.query.item_id = 166
609
+    this.getCurrentOrgPatients()
610
+
611
+    // this.GetPersonQCStatistisData()
612
+
613
+
614
+  }
615
+}
616
+</script>
617
+
618
+<style lang="scss" scoped>
619
+.tableTitle {
620
+  font-size: 16px;
621
+  color: #000;
622
+  font-weight: bold;
623
+  margin-bottom: 10px;
624
+}
625
+</style>
626
+<style lang="scss">
627
+.page_process {
628
+.el-tabs{
629
+  margin-bottom:0 !important;
630
+}
631
+.el-button--medium {
632
+  padding: 10px 8px;
633
+}
634
+
635
+.el-form-item {
636
+  margin-bottom: 0;
637
+}
638
+::-webkit-scrollbar{
639
+  height: 15px !important;
640
+}
641
+
642
+}
643
+</style>

+ 647 - 0
src/xt_pages/Dialysisanalysis/platelets/p_urr.vue View File

@@ -0,0 +1,647 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="app-container">
4
+      <div class="page_process">
5
+        <new-nav activeName="process"></new-nav>
6
+        <div class="cell clearfix">
7
+          <el-form :inline="true">
8
+            <el-form-item label>
9
+              <el-autocomplete
10
+                class="checkSearch"
11
+                popper-class="my-autocomplete"
12
+                v-model="search_value"
13
+                :fetch-suggestions="querySearchAsync"
14
+                :trigger-on-focus="false"
15
+                placeholder="请输入病人名字"
16
+                @select="handleSelect"
17
+                style="width:160px;"
18
+              >
19
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
20
+                <template slot-scope="{ item }">
21
+                  <div class="name">{{ item.name }}</div>
22
+                </template>
23
+              </el-autocomplete>
24
+
25
+            </el-form-item>
26
+          </el-form>
27
+
28
+          <label class="title">
29
+            <span class="name">日期查询</span> :
30
+          </label>
31
+          <el-date-picker
32
+            v-model="query.start_time"
33
+            prefix-icon="el-icon-date"
34
+            @change="changeTime"
35
+            :editable="false"
36
+            style="width: 150px;"
37
+            type="date"
38
+            placeholder="选择日期时间"
39
+            align="right"
40
+            format="yyyy-MM-dd"
41
+            value-format="yyyy-MM-dd"
42
+          ></el-date-picker>
43
+          <span class>-</span>
44
+          <el-date-picker
45
+            v-model="query.end_time"
46
+            prefix-icon="el-icon-date"
47
+            @change="changeEndTime"
48
+            :editable="false"
49
+            style="width: 150px;"
50
+            type="date"
51
+            placeholder="选择日期时间"
52
+            align="right"
53
+            format="yyyy-MM-dd"
54
+            value-format="yyyy-MM-dd"
55
+          ></el-date-picker>
56
+
57
+          <el-button size="small" icon="el-icon-printer" @click="printAction" type="primary">打印
58
+          </el-button>
59
+          <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
60
+
61
+          </el-button>
62
+        </div>
63
+
64
+        <el-container>
65
+          <div style="width:160px">
66
+
67
+            <div class="tableTitle">患者列表</div>
68
+
69
+
70
+            <el-table ref="table" :data="patientsData" border style="width: 100%;" height="500"
71
+                      :row-style="{ color: '#303133' }"
72
+                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
73
+                      highlight-current-row
74
+                      @current-change="handleChange">
75
+              <el-table-column prop="dialysis_no" label="透析号" width="70" align="center">
76
+                <template slot-scope="scope">{{scope.row.dialysis_no}}</template>
77
+              </el-table-column>
78
+              <el-table-column prop="name" label="姓名" width="90" align="center">
79
+                <template slot-scope="scope">{{ scope.row.name }}</template>
80
+              </el-table-column>
81
+            </el-table>
82
+          </div>
83
+          <div style="padding-left:10px;flex:1;width:0;">
84
+            <div class="tableTitle">指标趋势<span style="font-weight:normal">&nbsp;&nbsp;(当前患者: {{patient_name}})</span></div>
85
+            <div>
86
+              <line-chart :options="chart"></line-chart>
87
+              <!--              <line-chart :options="bar" v-if="query.statistics_type == 9 || query.statistics_type == 10"></line-chart>-->
88
+              <!--              <line-chart></line-chart>-->
89
+
90
+            </div>
91
+            <div class="tableTitle">统计表</div>
92
+            <div>
93
+              <el-table ref="table" :data="tableData" v-loading="loading" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
94
+                <el-table-column label="姓名" align="center">
95
+                  <template slot-scope="scope">
96
+                    {{scope.row.name}}
97
+                  </template>
98
+                </el-table-column>
99
+
100
+                <el-table-column width="100" label="检查日期" align="center">
101
+                  <template slot-scope="scope">
102
+                    {{getTime(scope.row.inspect_date)}}
103
+
104
+                  </template>
105
+                </el-table-column>
106
+
107
+                <el-table-column width="100" label="URR" align="center">
108
+                  <template slot-scope="scope">
109
+                    {{scope.row.value}}
110
+                  </template>
111
+                </el-table-column>
112
+              </el-table>
113
+
114
+
115
+            </div>
116
+          </div>
117
+        </el-container>
118
+      </div>
119
+    </div>
120
+  </div>
121
+</template>
122
+
123
+
124
+<script>
125
+import echarts from 'echarts'
126
+import {  uParseTime } from '@/utils/tools'
127
+import { getCurrentOrgPatients } from '@/api/common/common'
128
+import {
129
+  GetDefaultPatient,
130
+} from '@/api/common/statistics'
131
+import { PostSearch } from '@/api/patient'
132
+import { getDataConfig } from '@/utils/data'
133
+import { GetPersonQCStatistisData } from '../../../api/qcd'
134
+import LineChart from '../../qcd/components/LineChart.vue'
135
+
136
+export default {
137
+  components: {
138
+    LineChart
139
+  },
140
+  data() {
141
+    return {
142
+      pickerOptions: {
143
+        disabledDate(time) {
144
+          let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear() - 1)).getTime() - 24 * 3600 * 1000
145
+          return time.getTime() > Date.now() || time.getTime() < threeMonths
146
+
147
+        }
148
+      },
149
+      patient_name:'',
150
+      percent:[],
151
+      patientsData: [],
152
+      tableData: [],
153
+      loading: false,
154
+      search_value: '',
155
+      total: 0,
156
+      query: {
157
+        patient_id: '',
158
+        statistics_type: 1,
159
+        start_time: '',
160
+        end_time: '',
161
+        type:3,
162
+        limit: 10,
163
+        page: 1
164
+      },
165
+      crumbs: [
166
+        { path: false, name: '科室质控' },
167
+        { path: false, name: '指标评估统计' },
168
+        { path: false, name: '透析过程指标统计' }
169
+      ],
170
+      tableData1: [],
171
+      chart: {
172
+        title: {
173
+          text: 'ECharts 入门示例'
174
+        },
175
+        tooltip: {},
176
+        legend: {
177
+          data: [],
178
+          left: 0
179
+        },
180
+        xAxis: {
181
+          data: []
182
+        },
183
+        yAxis: {
184
+          axisLabel: {
185
+            formatter: '{value} %'
186
+          },
187
+          show: false
188
+        },
189
+        series: [
190
+          {
191
+            name: '',
192
+            type: 'line',
193
+            data: [],
194
+            barWidth: 30,
195
+            label: {
196
+              normal: {
197
+                show: true,
198
+                position: 'top',
199
+                formatter: (params) => {
200
+                  if(this.percent.length > 0){
201
+                    let str = ''
202
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
203
+                    return str
204
+                  }else{
205
+                    let str = ''
206
+                    str = params.data
207
+                    return str
208
+                  }
209
+                }
210
+              }
211
+            },
212
+            //配置样式
213
+            itemStyle: {
214
+              //通常情况下:
215
+
216
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
217
+              normal: {
218
+                color: function(params) {
219
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
220
+                  var colorList = [
221
+                    ['#A9E0F3', '#9FBDFC'],
222
+
223
+                    ['#FFD7C0', '#FF9994']
224
+                  ]
225
+
226
+                  var index = params.dataIndex
227
+                  if (params.dataIndex >= colorList.length) {
228
+                    index = params.dataIndex % colorList.length
229
+                  }
230
+
231
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
232
+                    { offset: 0, color: colorList[index][0] },
233
+                    // { offset: 0.5, color: colorList[index][1] },
234
+                    { offset: 1, color: colorList[index][1] }
235
+                  ])
236
+                },
237
+                lineStyle:{
238
+                  color:'#409eff' //改变折线颜色
239
+                },
240
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
241
+              },
242
+
243
+              //鼠标悬停时:
244
+              emphasis: {
245
+                shadowBlur: 10,
246
+                shadowOffsetX: 0,
247
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
248
+              }
249
+            }
250
+          }
251
+        ],
252
+        dataZoom: [
253
+          {
254
+            // Y轴固定,让内容滚动
255
+            type: 'slider',
256
+            show: false,
257
+            xAxisIndex: [0],
258
+            start: 1,
259
+            end: 20, // 设置X轴刻度之间的间隔(根据数据量来调整)
260
+            zoomLock: true // 锁定区域禁止缩放(鼠标滚动会缩放,所以禁止)
261
+          },
262
+          {
263
+            type: 'inside',
264
+            xAxisIndex: [0],
265
+            start: 1,
266
+            end: 20,
267
+            zoomLock: true // 锁定区域禁止缩放
268
+          }
269
+        ]
270
+      },
271
+      bar: {
272
+        title: {
273
+          text: 'ECharts 入门示例'
274
+        },
275
+        tooltip: {},
276
+        legend: {
277
+          data: [],
278
+          left: 0
279
+        },
280
+        xAxis: {
281
+          data: []
282
+        },
283
+        yAxis: {
284
+          axisLabel: {
285
+            formatter: '{value} %'
286
+          },
287
+          show: false
288
+        },
289
+        series: [
290
+          {
291
+            name: '',
292
+            type: 'bar',
293
+            data: [],
294
+            barWidth: 30,
295
+            label: {
296
+              normal: {
297
+                show: true,
298
+                position: 'top',
299
+                formatter: (params) => {
300
+                  if(this.percent.length > 0){
301
+                    let str = ''
302
+                    str = params.data + '('+ this.percent[params.dataIndex] +'%)'
303
+                    return str
304
+                  }else{
305
+                    let str = ''
306
+                    str = params.data
307
+                    return str
308
+                  }
309
+                }
310
+              }
311
+            },
312
+            //配置样式
313
+            itemStyle: {
314
+              //通常情况下:
315
+
316
+              //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组
317
+              normal: {
318
+                color: function(params) {
319
+                  //我这边就两个柱子,大体就两个柱子颜色渐变,所以数组只有两个值,多个颜色就多个值
320
+                  var colorList = [
321
+                    ['#A9E0F3', '#9FBDFC'],
322
+                    ['#FFD7C0', '#FF9994']
323
+                  ]
324
+
325
+                  var index = params.dataIndex
326
+                  if (params.dataIndex >= colorList.length) {
327
+                    index = params.dataIndex % colorList.length
328
+                  }
329
+
330
+                  return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
331
+                    { offset: 0, color: colorList[index][0] },
332
+                    // { offset: 0.5, color: colorList[index][1] },
333
+                    { offset: 1, color: colorList[index][1] }
334
+                  ])
335
+                },
336
+                barBorderRadius: [5, 5, 0, 0] //柱状角成椭圆形
337
+              },
338
+
339
+              //鼠标悬停时:
340
+              emphasis: {
341
+                shadowBlur: 10,
342
+                shadowOffsetX: 0,
343
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
344
+              }
345
+            }
346
+          }
347
+        ]
348
+      }
349
+
350
+    }
351
+  },
352
+  methods: {
353
+    printAction(){
354
+      this.$router.push({
355
+        path: "/Dialysisanalysis/qualitycontrol/print?patient_id=" + this.query.patient_id+"&project_id="+this.query.project_id+"&item_id="+this.query.item_id+"&start_time="+this.query.start_time+"&end_time="+this.query.end_time
356
+      });
357
+
358
+    },exportAction(){
359
+      let list = []
360
+      for (let i = 0; i < this.tableData.length; i++) {
361
+        let order = this.tableData[i]
362
+        let name = order.name
363
+        let value = order.value
364
+        let inspect_date = order.inspect_date
365
+
366
+        let obj = {
367
+          '姓名': name,
368
+          '数值': value,
369
+          '日期': inspect_date,
370
+        }
371
+        list.push(obj)
372
+      }
373
+      import('@/vendor/Export2Excel').then(excel => {
374
+        const tHeader = ['姓名', '数值', '日期']
375
+        const filterVal = ['姓名', '数值', '日期']
376
+        const data = this.formatJson(filterVal, list)
377
+        excel.export_json_to_excel1({
378
+          header: tHeader,
379
+          data,
380
+          filename: '明细',
381
+          ref: this.$refs['table'].$el
382
+        })
383
+      })
384
+    },
385
+    changeProject(val) {
386
+      this.query.statistics_type = val
387
+      this.query.page = 1
388
+      this.GetPersonQCStatistisData(this.query)
389
+      this.GetInspectionCheckIndexTableData(this.query)
390
+
391
+    },
392
+    handleChange(val) {
393
+      this.query.patient_id = val.id
394
+      this.query.page = 1
395
+      this.patient_name = val.name
396
+      this.GetPersonQCStatistisData(this.query)
397
+      this.GetInspectionCheckIndexTableData(this.query)
398
+    },
399
+    handleSizeChange(limit) {
400
+      this.query.limit = limit
401
+      this.GetInspectionCheckIndexTableData(this.query)
402
+
403
+    },
404
+    handleCurrentChange(page) {
405
+      this.query.page = page
406
+      this.GetPersonQCStatistisData(this.query)
407
+    },formatJson(filterVal, jsonData) {
408
+      return jsonData.map(v => filterVal.map(j => v[j]))
409
+    },
410
+    changeTime(val) {
411
+      var time = this.getTimestamp(val) - this.getTimestamp(this.query.end_time)
412
+      if (time > 0) {
413
+        this.$message.error('结束时间不能小于开始时间')
414
+        this.query.start_time = ''
415
+      } else {
416
+        // this.getDialysisList()
417
+        this.query.page = 1
418
+        this.GetPersonQCStatistisData(this.query)
419
+        this.GetInspectionCheckIndexTableData(this.query)
420
+
421
+      }
422
+
423
+    },
424
+    changeEndTime(val) {
425
+      var time =
426
+        this.getTimestamp(val) - this.getTimestamp(this.query.start_time)
427
+      if (time < 0) {
428
+        this.$message.error('结束时间不能小于开始时间')
429
+        this.query.end_time = ''
430
+      } else {
431
+        this.query.page = 1
432
+        this.GetPersonQCStatistisData(this.query)
433
+        this.GetInspectionCheckIndexTableData(this.query)
434
+
435
+      }
436
+    },
437
+    getTimestamp(time) {
438
+      // 把时间日期转成时间戳
439
+      return new Date(time).getTime() / 1000
440
+    },
441
+    QueryOperaById: function(val) {
442
+      let vascular_access_desc_name = ''
443
+      let vascular_access_desc = getDataConfig(
444
+        'hemodialysis',
445
+        'vascular_access_desc'
446
+      )
447
+      for (let i = 0; i < vascular_access_desc.length; i++) {
448
+        if (vascular_access_desc[i].id == val) {
449
+          vascular_access_desc_name = vascular_access_desc[i].name
450
+        }
451
+      }
452
+
453
+      return vascular_access_desc_name
454
+    },
455
+    GetAnticoagulantById: function(val) {
456
+      let anticoagulan_name = ''
457
+      var anticoagulantsConfitTwo = this.$store.getters.anticoagulants_confit
458
+      let anticoagulant = anticoagulantsConfitTwo
459
+      for (let keys in anticoagulant) {
460
+        if (anticoagulant[keys].id == val) {
461
+          anticoagulan_name = anticoagulant[keys].name
462
+        }
463
+      }
464
+      return anticoagulan_name
465
+    },
466
+    getModeName(mode_id) {
467
+      return this.$store.getters.treatment_mode[mode_id] != undefined ? this.$store.getters.treatment_mode[mode_id].name : ''
468
+    },  getTime(val) {
469
+      if(val == "" || val == undefined){
470
+        return ""
471
+      }else {
472
+        return uParseTime(val, '{y}-{m}-{d}')
473
+      }
474
+    },
475
+    GetInspectionCheckIndexTableData(params) {
476
+      this.loading = true
477
+      GetPersonQCStatistisData(params)
478
+        .then(rs => {
479
+          var resp = rs.data
480
+          console.log("resp=====",resp)
481
+          if (resp.state == 1) {
482
+            this.loading = false
483
+            this.tableData = []
484
+            for (let i = 0; i < resp.data.inspections.length; i++) {
485
+              let obj = {
486
+                name:resp.data.patient.name,
487
+                value:resp.data.inspections[i].inspect_value,
488
+                inspect_date:resp.data.inspections[i].inspect_date
489
+              }
490
+              this.tableData.push(obj)
491
+            }
492
+            this.total = resp.data.total
493
+
494
+          } else {
495
+            this.loading = false
496
+          }
497
+        })
498
+        .catch(error => {
499
+
500
+        })
501
+    },
502
+    GetPersonQCStatistisData(params) {
503
+      this.chart.xAxis.data = []
504
+      this.chart.series[0].data = []
505
+      this.bar.xAxis.data = []
506
+      this.bar.series[0].data = []
507
+      this.percent = []
508
+      GetPersonQCStatistisData(params)
509
+        .then(rs => {
510
+          var resp = rs.data
511
+          if (resp.state == 1) {
512
+            console.log(resp.data.inspections)
513
+            for (let i = 0; i < resp.data.inspections.length; i++) {
514
+              this.chart.xAxis.data.push(this.getTime(resp.data.inspections[i].inspect_date))
515
+              this.chart.series[0].data.push(resp.data.inspections[i].inspect_value)
516
+            }
517
+            console.log(this.chart.xAxis.data)
518
+            console.log( this.chart.series[0].data)
519
+
520
+            this.getArrLength(this.chart.xAxis.data,1)
521
+          } else {
522
+
523
+          }
524
+        })
525
+        .catch(error => {
526
+        })
527
+    },
528
+    handleSelect(val) {
529
+      this.query.patient_id = val.id
530
+      this.query.page = 1
531
+      this.patient_name = val.name
532
+      for (let i = 0;i < this.patientsData.length; i++){
533
+        if (this.patientsData[i].id == val.id){
534
+          this.$refs.table.setCurrentRow(this.patientsData[i])
535
+        }
536
+      }
537
+
538
+
539
+    },
540
+    querySearchAsync(keyword, cb) {
541
+      let key = ''
542
+      if (keyword != undefined) {
543
+        key = keyword
544
+      }
545
+      let searchArray = []
546
+      PostSearch(key).then(response => {
547
+        if (response.data.state == 1) {
548
+          searchArray = response.data.data.patient
549
+          cb(searchArray)
550
+        } else {
551
+          cb([])
552
+        }
553
+      })
554
+    },
555
+    chooseWay(way) {
556
+      this.wayType = way
557
+    }, getCurrentOrgPatients() {
558
+      getCurrentOrgPatients().then(response => {
559
+        if (response.data.state == 1) {
560
+          var patients = response.data.data.patients
561
+          this.patientsData = patients
562
+          this.GetDefaultPatient()
563
+        }
564
+      })
565
+    }, GetDefaultPatient() {
566
+      GetDefaultPatient().then(response => {
567
+        if (response.data.state == 1) {
568
+          var patient = response.data.data.patient
569
+          for (let i = 0;i < this.patientsData.length; i++){
570
+            if (this.patientsData[i].id == patient.id){
571
+              this.patient_name = this.patientsData[i].name
572
+              this.$refs.table.setCurrentRow(this.patientsData[i])
573
+            }
574
+          }
575
+          this.query.patient_id = patient.id
576
+          this.GetPersonQCStatistisData(this.query)
577
+
578
+        }
579
+      })
580
+
581
+    },
582
+    getArrLength(result,type){
583
+      if(type == 1){
584
+        if(result.length > 10){
585
+          var dataZoom_end = (10/result.length)*100;
586
+          this.chart.dataZoom[0].end = dataZoom_end
587
+        }else{
588
+          var dataZoom_end = 100;
589
+          this.chart.dataZoom[0].end = dataZoom_end
590
+        }
591
+      }else if(type == 2){
592
+        if(result.length > 10){
593
+          var dataZoom_end = (10/result.length)*100;
594
+          this.bar.dataZoom[0].end = dataZoom_end
595
+        }else{
596
+          var dataZoom_end = 100;
597
+          this.bar.dataZoom[0].end = dataZoom_end
598
+        }
599
+      }
600
+
601
+    }
602
+  }, mounted() {
603
+    var date = new Date()
604
+    var year = date.getFullYear() //获取完整的年份(4位)
605
+    var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
606
+    var day = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate() //获取当前日(1-31)
607
+    var last_month = date.getMonth() < 10 ? '0' + date.getMonth().toString() : date.getMonth() //获取当前月份(0-11,0代表1月)
608
+    this.query.patient_id = 0
609
+    this.query.end_time = year + '-' + month + '-' + day
610
+    this.query.start_time = year + '-' + last_month + '-' + day
611
+    this.query.project_id = 1
612
+    this.query.item_id = 166
613
+    this.getCurrentOrgPatients()
614
+
615
+    // this.GetPersonQCStatistisData()
616
+
617
+
618
+  }
619
+}
620
+</script>
621
+
622
+<style lang="scss" scoped>
623
+.tableTitle {
624
+  font-size: 16px;
625
+  color: #000;
626
+  font-weight: bold;
627
+  margin-bottom: 10px;
628
+}
629
+</style>
630
+<style lang="scss">
631
+.page_process {
632
+.el-tabs{
633
+  margin-bottom:0 !important;
634
+}
635
+.el-button--medium {
636
+  padding: 10px 8px;
637
+}
638
+
639
+.el-form-item {
640
+  margin-bottom: 0;
641
+}
642
+::-webkit-scrollbar{
643
+  height: 15px !important;
644
+}
645
+
646
+}
647
+</style>

+ 275 - 0
src/xt_pages/Dialysisanalysis/summary/index.vue View File

@@ -0,0 +1,275 @@
1
+<!-- 血钾 -->
2
+<template>
3
+    <div class="main-contain">
4
+      <div class="position">
5
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      </div>
7
+      <div class="app-container">
8
+        <div class="page_patientControlAnalysis">
9
+          <div>
10
+            <el-row :gutter="25">
11
+              <el-col :span="5">
12
+                <div>
13
+                  <div class="block">
14
+                    <el-date-picker
15
+                      v-model="start_month"
16
+                      type="month"
17
+                      format="yyyy-MM"
18
+                      value-format="yyyy-MM"
19
+                      @change="changemonth"
20
+                      placeholder="选择月">
21
+                    </el-date-picker>
22
+                  </div>
23
+                </div>
24
+              </el-col>
25
+
26
+              <el-col :span="5">
27
+                <el-button size="small" icon="el-icon-printer" @click="exportAction" type="primary">导出
28
+                </el-button>
29
+              </el-col>
30
+
31
+            </el-row>
32
+
33
+            <div style="width: 80%;margin: auto;margin: 20px">
34
+              <el-table
35
+                :data="patientTableData"
36
+                border
37
+                ref="table"
38
+                :header-cell-style="{
39
+          backgroundColor: 'rgb(245, 247, 250)',
40
+          color: '#606266'
41
+        }"
42
+                style="width: 100%;">
43
+                <el-table-column type="index" label="序号" align="center" width="60">
44
+                </el-table-column>
45
+                <el-table-column
46
+                  prop="count"
47
+                  label="姓名"
48
+                >
49
+                  <template slot-scope="scope">
50
+                    {{ scope.row.name }}
51
+                  </template>
52
+                </el-table-column>
53
+                <el-table-column
54
+                  prop="count"
55
+                  label="月"
56
+                >
57
+                  <template slot-scope="scope">
58
+                    {{start_month.split("-")[1]}}
59
+                  </template>
60
+                </el-table-column>
61
+                <el-table-column
62
+                  prop="count"
63
+                  label="IPTH"
64
+                >
65
+                  <template slot-scope="scope">
66
+                    {{scope.row.ipth}}
67
+                  </template>
68
+                </el-table-column>
69
+                <el-table-column
70
+                  prop="count"
71
+                  label="血红蛋白"
72
+                >
73
+                  <template slot-scope="scope">
74
+                    {{scope.row.xhdb}}
75
+                  </template>
76
+                </el-table-column>
77
+                <el-table-column
78
+                  prop="count"
79
+                  label="血钾"
80
+                >
81
+                  <template slot-scope="scope">
82
+                    {{scope.row.xuejia}}
83
+                  </template>
84
+                </el-table-column>
85
+                <el-table-column
86
+                  prop="count"
87
+                  label="白蛋白"
88
+                >
89
+                  <template slot-scope="scope">
90
+                    {{scope.row.bdb}}
91
+                  </template>
92
+                </el-table-column>
93
+                <el-table-column
94
+                  prop="count"
95
+                  label="血磷"
96
+                >
97
+                  <template slot-scope="scope">
98
+                    {{scope.row.xuelin}}
99
+                  </template>
100
+                </el-table-column>
101
+              </el-table>
102
+            </div>
103
+          </div>
104
+        </div>
105
+      </div>
106
+    </div>
107
+  </template>
108
+
109
+<script>
110
+
111
+import {  GetFiveInstatistisc } from '../../../api/qcd'
112
+import { uParseTime } from '@/utils/tools'
113
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
114
+const moment = require('moment')
115
+
116
+export default {
117
+    name:'summary',
118
+    components: {
119
+        BreadCrumb,
120
+    },
121
+    data() {
122
+        return {
123
+          start_month:new Date(new Date().getFullYear(), new Date().getMonth()).toLocaleDateString('en-CA'),
124
+          start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
125
+          end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
126
+          patientTableData:[],
127
+            activeName: 'first'
128
+        }
129
+    },
130
+    methods:{
131
+      exportAction(){
132
+        let list = []
133
+        for (let i = 0; i < this.patientTableData.length; i++) {
134
+          let order = this.patientTableData[i]
135
+          let name = order.name
136
+
137
+          let obj = {
138
+            '姓名': name,
139
+          }
140
+          list.push(obj)
141
+        }
142
+        import('@/vendor/Export2Excel').then(excel => {
143
+          const tHeader = ['姓名']
144
+          const filterVal = ['姓名']
145
+          const data = this.formatJson(filterVal, list)
146
+          excel.export_json_to_excel1({
147
+            header: tHeader,
148
+            data,
149
+            filename: '明细',
150
+            ref: this.$refs['table'].$el
151
+          })
152
+        })
153
+      },formatJson(filterVal, jsonData) {
154
+        return jsonData.map(v => filterVal.map(j => v[j]))
155
+      },
156
+      getMonthStartAndEndDates(year, month) {
157
+        // month参数是从1到12的数字
158
+        // 将month减去1以得到JavaScript Date对象中对应的月份(0到11)
159
+        const jsMonth = month - 1;
160
+
161
+        // 获取指定月份的第一天
162
+        const startDate = new Date(year, jsMonth, 1);
163
+
164
+        // 获取下一个月的第一天
165
+        const endDate = new Date(year, jsMonth + 1, 1);
166
+
167
+        // 将endDate减去1毫秒以得到指定月份的最后一天
168
+        endDate.setTime(endDate.getTime() - 1);
169
+        let date1 = new Date(startDate);
170
+        let date2 = new Date(endDate);
171
+        let month3 =  date1.getMonth() + 1;
172
+        let month2 =  date2.getMonth() + 1;
173
+        let day1 =  date1.getDate();
174
+        let day2 =  date2.getDate();
175
+        this.start_time = date1.getFullYear() + "-"  + (month3 < 10 ? "0" + month3:month3) + "-"+(day1 < 10 ? "0" + day1:day1)
176
+        this.end_time =  date2.getFullYear() + "-"  + (month2 < 10 ? "0" + month2:month2)+"-"+(day2 < 10 ? "0" + day2:day2)
177
+        console.log(this.start_time)
178
+        console.log(this.end_time)
179
+      },
180
+      changemonth(){
181
+        this.getMonthStartAndEndDates(this.start_month.split("-")[0],this.start_month.split("-")[1])
182
+        this.getData()
183
+
184
+      },
185
+      getData(){
186
+        if(this.start_time.length == 0){
187
+          this.$message.error("请选择开始时间")
188
+          return
189
+        }
190
+        if(this.end_time.length == 0){
191
+          this.$message.error("请选择结束时间")
192
+          return
193
+
194
+        }
195
+        let params = {
196
+          start_date: this.start_time,
197
+          end_date: this.end_time,
198
+          keyword: this.keyword,
199
+        }
200
+        this.patientTableData = []
201
+        GetFiveInstatistisc(params).then(response => {
202
+          if (response.data.state == 1) {
203
+            this.patientTableData  =  response.data.data.list
204
+          } else {
205
+            this.$message.error(response.data.msg)
206
+          }
207
+        })
208
+
209
+      },
210
+      getTime(value, temp) {
211
+        if (value != undefined) {
212
+          return uParseTime(value, temp)
213
+        }
214
+        return ''
215
+      },
216
+      handleClick(tab, event) {
217
+        console.log(tab, event);
218
+      }
219
+    },created() {
220
+      this.getData()
221
+
222
+  }
223
+}
224
+</script>
225
+
226
+<style lang="scss" scoped>
227
+// .page_patientControlAnalysis {
228
+
229
+// .pointTitle {
230
+//   font-size: 13px;
231
+// }
232
+
233
+// .chartTitle {
234
+//   font-size: 16px;
235
+//   font-weight: bold;
236
+//   color: #000000;
237
+// }
238
+
239
+// .point {
240
+//   width: 13px;
241
+//   height: 13px;
242
+//   background: linear-gradient(
243
+//       0deg,
244
+//       rgba(169, 224, 243, 1),
245
+//       rgba(159, 189, 252, 1)
246
+//   );
247
+//   border-radius: 7px;
248
+//   margin-right: 8px;
249
+// }
250
+
251
+// .pointTitle {
252
+//   font-size: 13px;
253
+// }
254
+
255
+// }
256
+
257
+</style>
258
+
259
+<style lang="scss">
260
+// .page_patientControlAnalysis {
261
+
262
+// .el-form-item {
263
+//   margin-bottom: 0;
264
+// }
265
+
266
+// .cell {
267
+//   text-align: center;
268
+// }
269
+
270
+// ::-webkit-scrollbar {
271
+//   height: 15px !important;
272
+// }
273
+
274
+// }
275
+</style>

+ 66 - 33
src/xt_pages/hospitalStation/summary.vue View File

@@ -227,7 +227,7 @@
227 227
               size="mini"
228 228
               type="primary"
229 229
               @click="confirmUploadInfo(scope.row)"
230
-              v-if="$store.getters.xt_user.org_id == 10265"
230
+              v-if="$store.getters.xt_user.org_id == 10265 || $store.getters.xt_user.org_id == 10210"
231 231
             >
232 232
               确认结算清单
233 233
             </el-button>
@@ -510,40 +510,73 @@ export default {
510 510
       this.selecting_schs = val
511 511
     },
512 512
     confirmUploadInfo(row){
513
-      var that = this;
514
-      axios
515
-        .get("http://127.0.0.1:9532/api/4102", {
516
-          params: {
517
-            order_id: row.id,
518
-            admin_user_id: this.$store.getters.xt_user.user.id,
519
-            stas_type: 1
520
-          },
521
-        })
522
-        .then(function (response) {
523
-          if (response.data.state == 0) {
524
-            that.$message.error(response.data.msg);
525
-            return false;
526
-          } else {
527
-            if (response.data.data.failed_code == -10) {
528
-              that
529
-                .$confirm(response.data.data.msg, "医保错误信息", {
530
-                  confirmButtonText: "确 定",
531
-                  type: "warning",
532
-                })
533
-                .then(() => {
534
-                })
535
-                .catch(() => {
536
-                });
513
+      if(this.$store.getters.xt_user.org_id == 10265) {
514
+        var that = this;
515
+        axios
516
+          .get("http://127.0.0.1:9532/api/4102", {
517
+            params: {
518
+              order_id: row.id,
519
+              admin_user_id: this.$store.getters.xt_user.user.id,
520
+              stas_type: 1
521
+            },
522
+          })
523
+          .then(function(response) {
524
+            if (response.data.state == 0) {
525
+              that.$message.error(response.data.msg);
526
+              return false;
537 527
             } else {
538
-              that.$message.success("确认成功");
539
-              row.result.id = response.data.data.result.id;
528
+              if (response.data.data.failed_code == -10) {
529
+                that
530
+                  .$confirm(response.data.data.msg, "医保错误信息", {
531
+                    confirmButtonText: "确 定",
532
+                    type: "warning",
533
+                  })
534
+                  .then(() => {
535
+                  })
536
+                  .catch(() => {
537
+                  });
538
+              } else {
539
+                that.$message.success("确认成功");
540
+                row.result.id = response.data.data.result.id;
541
+              }
540 542
             }
541
-          }
542
-        })
543
-        .catch(function (error) {
544
-        });
545
-
546
-
543
+          })
544
+          .catch(function(error) {
545
+          });
546
+      }else{
547
+        var that = this;
548
+        axios
549
+          .get("http://127.0.0.1:9532/api/comfirm/upload", {
550
+            params: {
551
+              order_id: row.id,
552
+              admin_user_id: this.$store.getters.xt_user.user.id,
553
+              stas_type: 1
554
+            },
555
+          })
556
+          .then(function(response) {
557
+            if (response.data.state == 0) {
558
+              that.$message.error(response.data.msg);
559
+              return false;
560
+            } else {
561
+              if (response.data.data.failed_code == -10) {
562
+                that
563
+                  .$confirm(response.data.data.msg, "医保错误信息", {
564
+                    confirmButtonText: "确 定",
565
+                    type: "warning",
566
+                  })
567
+                  .then(() => {
568
+                  })
569
+                  .catch(() => {
570
+                  });
571
+              } else {
572
+                that.$message.success("确认成功");
573
+                row.result.id = response.data.data.result.id;
574
+              }
575
+            }
576
+          })
577
+          .catch(function(error) {
578
+          });
579
+      }
547 580
     },
548 581
     cancelUploadTwo(row){
549 582
       if(this.$store.getters.xt_user.org_id == 10265){

+ 51 - 13
src/xt_pages/outpatientCharges/invoicePrint.vue View File

@@ -8,10 +8,9 @@
8 8
         icon="el-icon-printer"
9 9
         @click="printThisPage"
10 10
         type="primary"
11
-      >打印</el-button
12
-      >
11
+      >打印</el-button>
13 12
     </template>
14
-    <div class="app-container" style="padding-top:40px;">
13
+    <div class="app-container" style="padding-top:40px;" v-if="org_id != 10217 && org_id != 0 && org_id != 10485 && org_id != 10375">
15 14
         <div class='dialysisPage'>
16 15
           <div v-if="org_id != 10106 && org_id != 10215 && org_id != 4 && org_id != 10188 && org_id != 10217 && org_id != 0 && org_id != 10387&& org_id != 10210" >
17 16
             <printOne v-if="org_id != 10088 " :paramsObj="invoiceParams"></printOne>
@@ -20,12 +19,32 @@
20 19
           <printTwo v-if="org_id == 10106" :paramsObj="invoiceParams"></printTwo>
21 20
           <printFour v-if="org_id == 10215 || org_id == 4 " :paramsObj="invoiceParams"></printFour>
22 21
           <printFive v-if="org_id == 10188 " :paramsObj="invoiceParams"></printFive>
23
-          <printSix v-if="org_id == 10217" :paramsObj="invoiceParams"></printSix>
22
+          <printSix v-if="org_id == 10217  || org_id == 0" :paramsObj="invoiceParams"></printSix>
24 23
 <!--          <printEight v-if="org_id == 10387 || org_id == 0" :paramsObj="invoiceParams"></printEight>-->
25 24
           <print-eight v-if="org_id == 10387" :paramsObj="invoiceParams"></print-eight>
26
-          <PrintNight v-if="org_id == 10210 || org_id == 0" :paramsObj="invoiceParams"></PrintNight>
25
+          <PrintNight v-if="org_id == 10210" :paramsObj="invoiceParams"></PrintNight>
27 26
         </div>
28 27
     </div>
28
+
29
+    <div class="app-container" style="padding-top:40px;" v-if="org_id == 10485  ">
30
+      <div class='dialysisPage'>
31
+      <print-eleven :paramsObj="invoiceParams"></print-eleven>
32
+      </div>
33
+    </div>
34
+
35
+    <div class="app-container" style="" v-if="org_id == 10217 || org_id == 0">
36
+      <div class='dialysisPage'>
37
+        <printSix  :paramsObj="invoiceParams"></printSix>
38
+      </div>
39
+    </div>
40
+
41
+    <div class="app-container" style="padding-top:40px;" v-if="org_id == 10375">
42
+      <div class='dialysisPage'>
43
+        <print-ten :paramsObj="invoiceParams"></print-ten>
44
+      </div>
45
+    </div>
46
+
47
+
29 48
   </div>
30 49
 </template>
31 50
 
@@ -40,9 +59,13 @@
40 59
   import printEight from './invoiceTemplate/printEight'
41 60
   import PrintEight from "./invoiceTemplate/printEight";
42 61
   import PrintNight from "./invoiceTemplate/PrintNight";
62
+  import PrintEleven from './invoiceTemplate/printEleven.vue'
63
+  import PrintTen from './invoiceTemplate/printTen.vue'
43 64
   export default {
44 65
     name: "invoicePrint",
45 66
     components: {
67
+      PrintTen,
68
+      PrintEleven,
46 69
       PrintNight,
47 70
       PrintEight,
48 71
       printOne,
@@ -89,14 +112,29 @@
89 112
         return "";
90 113
       },
91 114
       printThisPage() {
92
-        const style =
93
-          '@media print {#invoice-print{font-size:12px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar div{width:150px;}}';
94
-        printJS({
95
-          printable: "invoice-print",
96
-          type: "html",
97
-          style: style,
98
-          scanStyles: false
99
-        });
115
+        if (this.org_id == 10217){
116
+          const style =
117
+            // '@media print {#invoice-print{font-size:12px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar div{width:150px;}}';
118
+            '@media print {#invoice-print{font-size:12px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none}.actionBar{display: flex;justify-content: space-between; line-height: 24px;}.actionBar div{width:150px;}}';
119
+          printJS({
120
+            printable: "invoice-print",
121
+            type: "html",
122
+            style: style,
123
+            scanStyles: false
124
+          });
125
+        }else{
126
+          const style =
127
+            '@media print {#invoice-print{font-size:12px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar div{width:150px;}}';
128
+          printJS({
129
+            printable: "invoice-print",
130
+            type: "html",
131
+            style: style,
132
+            scanStyles: false
133
+          });
134
+
135
+
136
+        }
137
+
100 138
 
101 139
 
102 140
         // if (this.org_template_info.template_id == 1) {

+ 248 - 0
src/xt_pages/outpatientCharges/invoiceTemplate/printEleven.vue View File

@@ -0,0 +1,248 @@
1
+<template>
2
+  <div id='invoice-print' style="position: relative;">
3
+    <div>
4
+      <div style="display: inline-block; position: absolute;top: 100px;left: 100px;">{{list.order.mdtrt_id}}</div>
5
+      <div style="display: inline-block; position: absolute;top: 100px;left: 300px;">{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</div>
6
+      <div style="display: inline-block; position: absolute;top: 100px;left: 350px;">{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</div>
7
+      <div style="display: inline-block; position: absolute;top: 100px;left: 400px;">{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</div>
8
+    </div>
9
+    <div>
10
+      <div style="position: absolute;top: 120px;left: 115px;">{{ paramsObj.name }}</div>
11
+      <div style="display:flex;justify-content: space-between;">
12
+          <div  style="position: absolute;top:120px;left:308px;">√</div>
13
+          <div  style="position: absolute;top:120px;left:366px;"></div>
14
+          <div  style="position: absolute;top:120px;left:425px;"></div>
15
+      </div>
16
+      <div style="display:flex;justify-content: space-between;">
17
+          <div  style="position: absolute;top:120px;left:555px;" v-if="list.gender == 1">√</div>
18
+          <div  style="position: absolute;top:120px;left:599px;" v-else-if="list.gender == 2">√</div>
19
+      </div>
20
+    </div>
21
+    <div style="display:flex;justify-content: space-between;">
22
+      <div  style="position: absolute;top:146px;left:180px;">医保</div>
23
+      <div  style="position: absolute;top:146px;left:360px;">{{ list.number.length <= 13 ? list.psn_cash_money.toFixed(2) : (list.psn_cash_money).toFixed(2) }}</div>
24
+      <div  style="position: absolute;top:146px;left:540px;">现金</div>
25
+    </div>
26
+    <div style="display:flex;justify-content: space-between;">
27
+      <div  style="position: absolute;top:172px;left:100px;">西药</div>
28
+      <div  style="position: absolute;top:172px;left:160px;">{{ list.westernMedicineCostTotal ? list.westernMedicineCostTotal.toFixed(2) : '' }}</div>
29
+      <div  style="position: absolute;top:172px;left:220px;">检查费</div>
30
+      <div  style="position: absolute;top:172px;left:280px;">{{ list.checkCostTotal ? list.checkCostTotal.toFixed(2) : '' }}</div>
31
+      <div  style="position: absolute;top:172px;left:340px;">治疗费</div>
32
+      <div  style="position: absolute;top:172px;left:400px;">{{ list.treatCostTotal ? list.treatCostTotal.toFixed(2) : '' }}</div>
33
+      <div  style="position: absolute;top:172px;left:518px;">床位费</div>
34
+      <div  style="position: absolute;top:172px;left:578px;">{{ list.bedCostTotal ? list.bedCostTotal.toFixed(2) : '' }}</div>
35
+    </div>
36
+    <div style="display:flex;justify-content: space-between;">
37
+      <div  style="position: absolute;top:198px;left:100px;">中成药</div>
38
+      <div  style="position: absolute;top:198px;left:160px;">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
39
+      <div  style="position: absolute;top:198px;left:220px;">化验费</div>
40
+      <div  style="position: absolute;top:198px;left:280px;">{{ list.laboratoryCostTotal ? list.laboratoryCostTotal.toFixed(2) : '' }}</div>
41
+      <div  style="position: absolute;top:198px;left:340px;">手术费</div>
42
+      <div  style="position: absolute;top:198px;left:400px;">{{ list.operationCostTotal ? list.operationCostTotal.toFixed(2) : '' }}</div>
43
+      <div  style="position: absolute;top:198px;left:518px;">其他费</div>
44
+      <div  style="position: absolute;top:198px;left:578px;">{{ list.otherCostTotal ? list.otherCostTotal.toFixed(2) : '' }}</div>
45
+    </div>
46
+    <div style="display:flex;justify-content: space-between;">
47
+      <div  style="position: absolute;top:224px;left:100px;">诊察费</div>
48
+      <div  style="position: absolute;top:224px;left:160px;">{{ list.zhenChaCostTotal ? list.zhenChaCostTotal.toFixed(2) : '' }}</div>
49
+      <div  style="position: absolute;top:224px;left:220px;">材料费</div>
50
+      <div  style="position: absolute;top:224px;left:280px;">{{ list.materialCostTotal ? list.materialCostTotal.toFixed(2) : '' }}</div>
51
+      <div  style="position: absolute;top:224px;left:340px;"></div>
52
+      <div  style="position: absolute;top:224px;left:400px;"></div>
53
+      <div  style="position: absolute;top:224px;left:518px;"></div>
54
+      <div  style="position: absolute;top:224px;left:578px;"></div>
55
+    </div>
56
+    <div style="display:flex;justify-content: space-between;">
57
+      <div  style="position: absolute;top:250px;left:160px;"></div>
58
+      <div  style="position: absolute;top:250px;left:280px;"></div>
59
+      <div  style="position: absolute;top:250px;left:400px;"></div>
60
+      <div  style="position: absolute;top:250px;left:578px;"></div>
61
+    </div>
62
+    <div>
63
+      <span>
64
+        <span  style="position: absolute;top:276px;left:210px">
65
+          <span v-if="zhongwen.indexOf('万') > -1 && zhongwen.indexOf('拾') > -1 && zhongwen.indexOf('拾') == 1">
66
+                    {{ zhongwen.substring(0,1) }}
67
+                </span>
68
+                <span v-else>零</span>
69
+        </span>
70
+        <span  style="position: absolute;top:276px;left:260px">
71
+            <span v-if="zhongwen.indexOf('万') > -1">
72
+                    {{ zhongwen.substring(zhongwen.indexOf('万') - 1,zhongwen.indexOf('万')) }}
73
+                </span>
74
+                <span v-else>零</span>
75
+        </span>
76
+        <span  style="position: absolute;top:276px;left:310px">
77
+            <span v-if="zhongwen.indexOf('仟') > -1">
78
+                    {{ zhongwen.substring(zhongwen.indexOf('仟') - 1,zhongwen.indexOf('仟')) }}
79
+                </span>
80
+                <span v-else>零</span>
81
+        </span>
82
+        <span  style="position: absolute;top:276px;left:360px">
83
+            <span v-if="zhongwen.indexOf('佰') > -1">
84
+                    {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
85
+                </span>
86
+                <span v-else>零</span>
87
+        </span>
88
+        <span style="position: absolute;top:276px;left:410px">
89
+            <span v-if="zhongwen.indexOf('拾') > -1">
90
+                    {{zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) == '佰' ||  !zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾'))? '壹' : zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) }}
91
+                </span>
92
+                <span v-else>零</span>
93
+        </span>
94
+        <span  style="position: absolute;top:276px;left:460px">
95
+           <span v-if="zhongwen.indexOf('元') > -1 && zhongwen.substring(this.zhongwen.indexOf('元') - 1).substring(0,1)!= '拾'">
96
+                    {{ zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) }}
97
+                </span>
98
+                <span v-else>零</span>
99
+        </span>
100
+        <span  style="position: absolute;top:276px;left:510px">
101
+             <span v-if="zhongwen.indexOf('角') > -1">
102
+                    {{ zhongwen.substring(zhongwen.indexOf('角') - 1,zhongwen.indexOf('角')) }}
103
+                </span>
104
+                <span v-else>零</span>
105
+        </span>
106
+
107
+        <span  style="position: absolute;top:276px;left:560px">
108
+             <span v-if="zhongwen.indexOf('分') > -1">
109
+                    {{ zhongwen.substring(zhongwen.indexOf('分') - 1,zhongwen.indexOf('分')) }}
110
+                </span>
111
+                <span v-else>零</span>
112
+        </span>
113
+      </span>
114
+      <span style="position: absolute;top:276px;left:580px">{{ totalPrice.toFixed(2) }}</span>
115
+    </div>
116
+
117
+    <div style="display:flex;justify-content: space-between;">
118
+      <div style="position: absolute;top:365px;left:180px;">{{ org_name}}</div>
119
+      <div style="position: absolute;top:365px;left:340px;"></div>
120
+      <div style="position: absolute;top:365px;left:490px;">{{list.admin_user_name}}</div>
121
+    </div>
122
+  </div>
123
+</template>
124
+<script>
125
+import { getInvoice } from '@/api/project/project'
126
+import { uParseTime } from '@/utils/tools'
127
+export default {
128
+  props:{
129
+    paramsObj:Object
130
+  },
131
+  data(){
132
+    return{
133
+      gender:'',
134
+      list:{},
135
+      printDate:'',
136
+      zhongwen:'',
137
+      totalPrice:0.0,
138
+      org_id:'',
139
+      org_name:''
140
+    }
141
+  },
142
+  created(){
143
+    console.log('paramsObj',this.paramsObj)
144
+    let params = {
145
+      order_id: this.paramsObj.order_id,
146
+      patient_id: this.paramsObj.patient_id,
147
+      number: this.paramsObj.number,
148
+    }
149
+    this.getInvoice(params)
150
+    // var data = new Date();
151
+    // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
152
+    // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
153
+    // this.printDate = data.getFullYear() + "-" + month + "-" + date;
154
+    // this.smalltoBIG(982732.21)
155
+    this.org_id = this.$store.getters.xt_user.org_id
156
+    this.org_name = this.$store.getters.xt_user.org.org_name
157
+  },
158
+  methods:{
159
+    getInvoice(params){
160
+      getInvoice(params).then((res) => {
161
+        console.log('res',res)
162
+        this.list = res.data.data
163
+        this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
164
+          this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal + this.list.zhenChaCostTotal
165
+        if(this.totalPrice == 0){
166
+
167
+          this.totalPrice = this.list.medfee_sumamt
168
+        }
169
+        console.log( "this.totalPrice")
170
+
171
+        this.smalltoBIG(this.totalPrice.toFixed(2))
172
+        var data = new Date(res.data.data.date * 1000);
173
+        var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
174
+        var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
175
+        this.printDate = data.getFullYear() + "-" + month + "-" + date;
176
+        this.gender = this.list.gender
177
+      })
178
+    },
179
+    smalltoBIG(n) {
180
+      // let fraction = ['角', '分'];
181
+      // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
182
+      // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
183
+      // let head = price < 0 ? '欠' : '';
184
+      // price = Math.abs(price);
185
+      // let upper = '';
186
+      // for (let i = 0; i < fraction.length; i++) {
187
+      // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
188
+      // }
189
+      // upper = upper || '整';
190
+      // price = Math.floor(price);
191
+      // for (let i = 0; i < unit[0].length && price > 0; i++) {
192
+      // let p = '';
193
+      // for (let j = 0; j < unit[1].length && price > 0; j++) {
194
+      //     p = digit[price % 10] + unit[1][j] + p;
195
+      //     price = Math.floor(price / 10);
196
+      // }
197
+      // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
198
+      // }
199
+      // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
200
+      // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
201
+      if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
202
+        return "数据非法";  //判断数据是否大于0
203
+      }
204
+
205
+      var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
206
+      n += "00";
207
+
208
+      var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
209
+
210
+      if (indexpoint >= 0){
211
+
212
+        n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
213
+      }
214
+
215
+      unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
216
+      for (var i=0; i < n.length; i++){
217
+        str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
218
+      }
219
+
220
+      this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
221
+      console.log(this.zhongwen)
222
+    },
223
+    getTime(value, temp) {
224
+      if (value == 0) {
225
+        return ''
226
+      }
227
+      if (value != undefined) {
228
+        return uParseTime(value, temp)
229
+      }
230
+      return ''
231
+    },
232
+  },
233
+  watch:{
234
+    paramsObj:{//深度监听,可监听到对象、数组的变化
235
+      handler(val, oldVal){
236
+        let params = {
237
+          order_id: val.order_id,
238
+          patient_id: val.patient_id,
239
+          number: val.number,
240
+        }
241
+        this.getInvoice(params)
242
+
243
+      },
244
+      deep:true
245
+    }
246
+  }
247
+}
248
+</script>

+ 187 - 187
src/xt_pages/outpatientCharges/invoiceTemplate/printSix.vue View File

@@ -1,23 +1,23 @@
1 1
 <template>
2
-    <div id='invoice-print'>
3
-        <div v-for='(i,index) in pageArr.length' :key="index" >
4
-            <div :style="{position: 'absolute',top:(20 + (index * 660))  + 'px',left:200+ 'px',}">盐城大丰悦达金骆驼血液透析中心</div>
5
-            <div :style="{position: 'absolute',top:(70 + (index * 660))  + 'px',left:150+ 'px',}">{{ list.order_number }}</div>
6
-            <div style="display:flex;justify-content: space-between;">
7
-                <div :style="{position: 'absolute',top:(100 + (index * 660))  + 'px',left:100+ 'px',}">{{ paramsObj.name }}</div>
8
-            </div>
9
-            <div :style="{position: 'absolute',top:(190 + (index * 660))  + 'px',left:120+ 'px',}">
10
-                <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
11
-                <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
12
-                <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
13
-                <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
14
-                <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
15
-                <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
16
-                <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
17
-                <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
18
-            </div>
19
-            <div :style="{position: 'absolute',top:(190 + (index * 660))  + 'px',left:280+ 'px'}">
20
-                <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])">
2
+  <div id='invoice-print'>
3
+    <div v-for='(i,index) in pageArr.length' :key="index" >
4
+      <div :style="{position: 'absolute',top:(20 + (index * 520))  + 'px',left:200+ 'px',}">盐城大丰悦达金骆驼血液透析中心</div>
5
+      <div :style="{position: 'absolute',top:(70 + (index * 520))  + 'px',left:150+ 'px',}">{{ list.order_number }}</div>
6
+      <div style="display:flex;justify-content: space-between;">
7
+        <div :style="{position: 'absolute',top:(100 + (index * 520))  + 'px',left:100+ 'px',}">{{ paramsObj.name }}</div>
8
+      </div>
9
+      <div :style="{position: 'absolute',top:(190 + (index * 520))  + 'px',left:120+ 'px',}">
10
+        <div v-if="list.westernMedicineCostTotal">西药 {{ list.westernMedicineCostTotal }}</div>
11
+        <div v-if="list.treatCostTotal">治疗费 {{ list.treatCostTotal }}</div>
12
+        <div v-if="list.bedCostTotal">床位费 {{ list.bedCostTotal }}</div>
13
+        <div v-if="list.chineseTraditionalMedicineCostTotal">中成药 {{ list.chineseTraditionalMedicineCostTotal }}</div>
14
+        <div v-if="list.laboratoryCostTotal">化验费 {{ list.laboratoryCostTotal }}</div>
15
+        <div v-if="list.operationCostTotal">手术费 {{ list.operationCostTotal }}</div>
16
+        <div v-if="list.otherCostTotal">其他费 {{ list.otherCostTotal }}</div>
17
+        <div v-if="list.materialCostTotal">材料费 {{ list.materialCostTotal }}</div>
18
+      </div>
19
+      <div :style="{position: 'absolute',top:(190 + (index * 520))  + 'px',left:300+ 'px'}">
20
+        <div v-for="item in list.order_info.slice(index * 10,(index * 10) + pageArr[index])">
21 21
                     <span style="display:inline-block;width:200px;">
22 22
                         <span v-if="item.advice.id == 0">
23 23
                             <span v-if="item.project.type == 2"> {{ item.project.project.project_name }}</span>
@@ -25,65 +25,65 @@
25 25
                         </span>
26 26
                         <span v-else>{{ item.advice.advice_name }}</span>
27 27
                     </span>
28
-                    <span style="display:inline-block;width:50px;">
28
+          <span style="display:inline-block;width:50px;">
29 29
                         <span v-if="item.advice.id == 0">
30 30
                             <span v-if="item.project.type == 2">{{ item.project.count }}{{ item.project.unit }}</span>
31 31
                             <span v-if="item.project.type == 3">{{ item.project.count }}{{ item.project.unit }}</span>
32 32
                         </span>
33 33
                         <span v-else>{{ item.advice.prescribing_number }}{{ item.advice.prescribing_number_unit }}</span>
34 34
                     </span>
35
-                    <span>
35
+          <span>
36 36
                         <span v-if="item.advice.id == 0">
37 37
                             <span v-if="item.project.type == 2">{{ (item.project.count * item.pric).toFixed(2) }}</span>
38 38
                             <span v-if="item.project.type == 3">{{ (item.project.count * item.pric).toFixed(2) }}</span>
39 39
                         </span>
40 40
                         <span v-else>{{ (item.advice.prescribing_number * item.pric).toFixed(2) }}</span>
41 41
                     </span>
42
-                </div>
43
-            </div>
44
-            <div :style="{position: 'absolute',top:(390 + (index * 660))  + 'px',left:130+ 'px'}">{{ zhongwen }}</div>
45
-            <div :style="{position: 'absolute',top:(390 + (index * 660))  + 'px',left:480+ 'px'}">{{ list.medfee_sumamt }}</div>
46
-            <div v-if="index == pageArr.length - 1" :style="{position: 'absolute',top:(420 + (index * 660))  + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
47
-                <div style="display:flex;">
48
-                  <div style="width:140px">医疗总费用:{{ list.order.medfee_sumamt }}</div>
49
-                  <div style="width:140px">基金支付总额:{{ list.order.fund_pay_sumamt }}</div>
50
-                  <div style="width:140px">统筹支出:{{ list.order.hifp_pay }}</div>
51
-                  <div style="width:140px">大病支出:{{list.order.hifmi_pay}}</div>
42
+        </div>
43
+      </div>
44
+      <div :style="{position: 'absolute',top:(390 + (index * 520))  + 'px',left:130+ 'px'}">{{ zhongwen }}</div>
45
+      <div :style="{position: 'absolute',top:(390 + (index * 520))  + 'px',left:480+ 'px'}">{{ list.medfee_sumamt }}</div>
46
+      <div v-if="index == pageArr.length - 1" :style="{position: 'absolute',top:(410 + (index * 520))  + 'px',left:110+ 'px',width:100 + '%',fontSize:12+'px'}">
47
+        <div style="display:flex;">
48
+          <div style="width:140px">医疗总费用:{{ list.order.medfee_sumamt }}</div>
49
+          <div style="width:140px">基金支付总额:{{ list.order.fund_pay_sumamt }}</div>
50
+          <div style="width:140px">统筹支出:{{ list.order.hifp_pay }}</div>
51
+          <div style="width:140px">大病支出:{{list.order.hifmi_pay}}</div>
52 52
 
53
-                </div>
54
-                <div style="display:flex;">
55
-                  <div style="width:140px">个人账户支付:{{ list.order.acct_pay }}</div>
56
-                  <div style="width:140px">现金支出:{{ list.order.psn_cash_pay }}</div>
57
-                  <div style="width:140px">本次账户:0</div>
58
-                  <div style="width:140px">上次账户:0</div>
59
-                </div>
60
-              <div style="display:flex;">
61
-                <div style="width:140px">账户余额:{{ list.order.balc }}</div>
62
-                <div style="width:140px">其他支出:{{ list.order.oth_pay }}</div>
63
-                <div style="width:140px">大病补充保险支出:0</div>
64
-                <div style="width:140px">民政支出:0</div>
65
-              </div>
66
-              <div style="display:flex;">
67
-                <div style="width:220px">医疗救助基金支出:{{ list.order.maf_pay }}</div>
68
-                <div style="width:280px">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
69
-              </div>
53
+        </div>
54
+        <div style="display:flex;">
55
+          <div style="width:140px">个人账户支付:{{ list.order.acct_pay }}</div>
56
+          <div style="width:140px">现金支出:{{ list.order.psn_cash_pay }}</div>
57
+          <div style="width:140px">本次账户:0</div>
58
+          <div style="width:140px">上次账户:0</div>
59
+        </div>
60
+        <div style="display:flex;">
61
+          <div style="width:140px">账户余额:{{ list.order.balc }}</div>
62
+          <div style="width:140px">其他支出:{{ list.order.oth_pay }}</div>
63
+          <div style="width:140px">大病补充保险支出:0</div>
64
+          <div style="width:140px">民政支出:0</div>
65
+        </div>
66
+        <div style="display:flex;">
67
+          <div style="width:220px">医疗救助基金支出:{{ list.order.maf_pay }}</div>
68
+          <div style="width:280px">企业补充医疗保险基金支出:{{ list.order.hifes_pay }}</div>
69
+        </div>
70 70
 
71
-            </div>
72
-            <div>
73
-                <div :style="{position: 'absolute',top:(480 + (index * 660))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
74
-                <div :style="{position: 'absolute',top:(480 + (index * 660))  + 'px',left:410+ 'px'}">{{ paramsObj.chargeName }}</div>
75
-                <div :style="{position: 'absolute',top:(480 + (index * 660))  + 'px',left:550+ 'px'}">
76
-                    <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
77
-                </div>
78
-                <div :style="{position: 'absolute',top:(480 + (index * 660))  + 'px',left:610+ 'px'}">
79
-                    <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
80
-                </div>
81
-                <div :style="{position: 'absolute',top:(480 + (index * 660))  + 'px',left:650+ 'px'}">
82
-                    <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
83
-                </div>
84
-            </div>
71
+      </div>
72
+      <div>
73
+        <div :style="{position: 'absolute',top:(480 + (index * 520))  + 'px',left:140+ 'px'}">盐城大丰悦达金骆驼血液透析中心</div>
74
+        <div :style="{position: 'absolute',top:(480 + (index * 520))  + 'px',left:410+ 'px'}">{{ paramsObj.chargeName }}</div>
75
+        <div :style="{position: 'absolute',top:(480 + (index * 520))  + 'px',left:550+ 'px'}">
76
+          <span>{{  paramsObj.setl_time ? paramsObj.setl_time.split(' ')[0].slice(0,4) : getTime(list.date, '{y}-{m}-{d}').slice(0,4) }}</span>
77
+        </div>
78
+        <div :style="{position: 'absolute',top:(480 + (index * 520))  + 'px',left:610+ 'px'}">
79
+          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(5,7)) : getTime(list.date, '{y}-{m}-{d}').slice(5,7) }}</span>
85 80
         </div>
81
+        <div :style="{position: 'absolute',top:(480 + (index * 520))  + 'px',left:650+ 'px'}">
82
+          <span>{{ paramsObj.setl_time ? parseInt(paramsObj.setl_time.split(' ')[0].slice(8,11)) : getTime(list.date, '{y}-{m}-{d}').slice(8,11) }}</span>
83
+        </div>
84
+      </div>
86 85
     </div>
86
+  </div>
87 87
 </template>
88 88
 
89 89
 
@@ -91,142 +91,142 @@
91 91
 import { getInvoice } from '@/api/project/project'
92 92
 import { uParseTime } from '@/utils/tools'
93 93
 export default {
94
-    props:{
95
-        paramsObj:Object
96
-    },
97
-    data(){
98
-        return{
99
-            list:{},
100
-            printDate:'',
101
-            zhongwen:'',
102
-            totalPrice:0.0,
103
-            org_id:'',
104
-            org_name:'',
105
-            page:1,
106
-            pageArr:[],
107
-        }
108
-    },
109
-    created(){
110
-        console.log('paramsObj',this.paramsObj)
111
-        let params = {
112
-            order_id: this.paramsObj.order_id,
113
-            patient_id: this.paramsObj.patient_id,
114
-        }
115
-        this.getInvoice(params)
116
-        // var data = new Date();
117
-        // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
118
-        // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
119
-        // this.printDate = data.getFullYear() + "-" + month + "-" + date;
120
-        // this.smalltoBIG(982732.21)
121
-        this.org_id = this.$store.getters.xt_user.org_id
122
-        this.org_name = this.$store.getters.xt_user.org.org_name
94
+  props:{
95
+    paramsObj:Object
96
+  },
97
+  data(){
98
+    return{
99
+      list:{},
100
+      printDate:'',
101
+      zhongwen:'',
102
+      totalPrice:0.0,
103
+      org_id:'',
104
+      org_name:'',
105
+      page:1,
106
+      pageArr:[],
107
+    }
108
+  },
109
+  created(){
110
+    console.log('paramsObj',this.paramsObj)
111
+    let params = {
112
+      order_id: this.paramsObj.order_id,
113
+      patient_id: this.paramsObj.patient_id,
114
+    }
115
+    this.getInvoice(params)
116
+    // var data = new Date();
117
+    // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
118
+    // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
119
+    // this.printDate = data.getFullYear() + "-" + month + "-" + date;
120
+    // this.smalltoBIG(982732.21)
121
+    this.org_id = this.$store.getters.xt_user.org_id
122
+    this.org_name = this.$store.getters.xt_user.org.org_name
123
+  },
124
+  methods:{
125
+    getInvoice(params){
126
+      getInvoice(params).then((res) => {
127
+        // console.log('res',res)
128
+        this.list = res.data.data
129
+        // console.log(this.list,'表单内容打印记得注释')
130
+        this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
131
+          this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
132
+        this.smalltoBIG(this.list.medfee_sumamt)
133
+        var data = new Date(res.data.data.date * 1000);
134
+        var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
135
+        var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
136
+        this.printDate = data.getFullYear() + "-" + month + "-" + date;
137
+        this.pageArr = []
138
+        this.getPage()
139
+        this.pageArr.push(10)
140
+        console.log('pageArr',this.pageArr.length)
141
+      })
123 142
     },
124
-    methods:{
125
-        getInvoice(params){
126
-            getInvoice(params).then((res) => {
127
-                // console.log('res',res)
128
-                this.list = res.data.data
129
-                // console.log(this.list,'表单内容打印记得注释')
130
-                this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
131
-                                    this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal
132
-                this.smalltoBIG(this.list.medfee_sumamt)
133
-                var data = new Date(res.data.data.date * 1000);
134
-                var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
135
-                var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
136
-                this.printDate = data.getFullYear() + "-" + month + "-" + date;
137
-                this.pageArr = []
138
-                this.getPage()
139
-                this.pageArr.push(10)
140
-                console.log('pageArr',this.pageArr.length)
141
-            })
142
-        },
143
-        smalltoBIG(n) {
144
-            // let fraction = ['角', '分'];
145
-            // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
146
-            // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
147
-            // let head = price < 0 ? '欠' : '';
148
-            // price = Math.abs(price);
149
-            // let upper = '';
150
-            // for (let i = 0; i < fraction.length; i++) {
151
-            // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
152
-            // }
153
-            // upper = upper || '整';
154
-            // price = Math.floor(price);
155
-            // for (let i = 0; i < unit[0].length && price > 0; i++) {
156
-            // let p = '';
157
-            // for (let j = 0; j < unit[1].length && price > 0; j++) {
158
-            //     p = digit[price % 10] + unit[1][j] + p;
159
-            //     price = Math.floor(price / 10);
160
-            // }
161
-            // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
162
-            // }
163
-            // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
164
-            // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
165
-            if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
166
-                return "数据非法";  //判断数据是否大于0
167
-            }
168
-
169
-            var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
170
-            n += "00";
143
+    smalltoBIG(n) {
144
+      // let fraction = ['角', '分'];
145
+      // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
146
+      // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
147
+      // let head = price < 0 ? '欠' : '';
148
+      // price = Math.abs(price);
149
+      // let upper = '';
150
+      // for (let i = 0; i < fraction.length; i++) {
151
+      // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
152
+      // }
153
+      // upper = upper || '整';
154
+      // price = Math.floor(price);
155
+      // for (let i = 0; i < unit[0].length && price > 0; i++) {
156
+      // let p = '';
157
+      // for (let j = 0; j < unit[1].length && price > 0; j++) {
158
+      //     p = digit[price % 10] + unit[1][j] + p;
159
+      //     price = Math.floor(price / 10);
160
+      // }
161
+      // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
162
+      // }
163
+      // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
164
+      // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
165
+      if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
166
+        return "数据非法";  //判断数据是否大于0
167
+      }
171 168
 
172
-            var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
169
+      var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
170
+      n += "00";
173 171
 
174
-            if (indexpoint >= 0){
172
+      var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
175 173
 
176
-                n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
177
-            }
174
+      if (indexpoint >= 0){
178 175
 
179
-            unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
180
-            for (var i=0; i < n.length; i++){
181
-                str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
182
-            }
183
-            console.log("str",str)
184
-            if(str == '零元零角零分'){
185
-                this.zhongwen = '零'
186
-            }else{
187
-                this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
188
-            }
176
+        n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
177
+      }
189 178
 
190
-            console.log(this.zhongwen)
191
-        },
192
-        getTime(value, temp) {
193
-            if (value == 0) {
194
-                return ''
195
-            }
196
-            if (value != undefined) {
197
-                return uParseTime(value, temp)
198
-            }
199
-            return ''
200
-        },
201
-        getPage(){
202
-        if(this.list.order_info.length <= 10){
203
-            this.page = 1
204
-            this.pageArr.push(this.list.order_info.length)
205
-        }else if(this.list.order_info.length > 10){
206
-            this.page = parseInt(this.list.order_info.length / 10)
207
-            let num = this.list.order_info.length % 10
208
-            for (var i=0;i<this.page;i++){
209
-                this.pageArr.push(10)
210
-            }
211
-            if(num != 0){
212
-                this.pageArr.push(num)
213
-            }
214
-        }
179
+      unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
180
+      for (var i=0; i < n.length; i++){
181
+        str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
182
+      }
183
+      console.log("str",str)
184
+      if(str == '零元零角零分'){
185
+        this.zhongwen = '零'
186
+      }else{
187
+        this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
215 188
       }
216 189
 
190
+      console.log(this.zhongwen)
191
+    },
192
+    getTime(value, temp) {
193
+      if (value == 0) {
194
+        return ''
195
+      }
196
+      if (value != undefined) {
197
+        return uParseTime(value, temp)
198
+      }
199
+      return ''
217 200
     },
218
-    watch:{
219
-        paramsObj:{//深度监听,可监听到对象、数组的变化
220
-            handler(val, oldVal){
221
-                let params = {
222
-                    order_id: val.order_id,
223
-                    patient_id: val.patient_id,
224
-                }
225
-                this.getInvoice(params)
201
+    getPage(){
202
+      if(this.list.order_info.length <= 10){
203
+        this.page = 1
204
+        this.pageArr.push(this.list.order_info.length)
205
+      }else if(this.list.order_info.length > 10){
206
+        this.page = parseInt(this.list.order_info.length / 10)
207
+        let num = this.list.order_info.length % 10
208
+        for (var i=0;i<this.page;i++){
209
+          this.pageArr.push(10)
210
+        }
211
+        if(num != 0){
212
+          this.pageArr.push(num)
213
+        }
214
+      }
215
+    }
226 216
 
227
-            },
228
-            deep:true
217
+  },
218
+  watch:{
219
+    paramsObj:{//深度监听,可监听到对象、数组的变化
220
+      handler(val, oldVal){
221
+        let params = {
222
+          order_id: val.order_id,
223
+          patient_id: val.patient_id,
229 224
         }
225
+        this.getInvoice(params)
226
+
227
+      },
228
+      deep:true
230 229
     }
230
+  }
231 231
 }
232 232
 </script>

+ 265 - 0
src/xt_pages/outpatientCharges/invoiceTemplate/printTen.vue View File

@@ -0,0 +1,265 @@
1
+<template>
2
+  <div id='invoice-print' style="position: relative;">
3
+    <div style="display: flex;width: 575px;margin-bottom: 5px; position: absolute; top: 70px;right: 1px;">
4
+      {{printDate}}
5
+    </div>
6
+    <div style="display: flex; justify-content: space-between;width: 573px;">
7
+      <div style="position: absolute;top: 85px;">
8
+        <span>{{paramsObj.name}}</span>
9
+        <span></span>
10
+        <span style="margin-left: 60px;" v-if="list.gender == 1">女</span>
11
+        <span style="margin-left: 60px;" v-else-if="list.gender == 2">男</span>
12
+
13
+        <span></span>
14
+      </div>
15
+      <div style="position: absolute;top: 85px;left: 351px;">
16
+        <span style="margin-right: 60px;"></span>
17
+      </div>
18
+    </div>
19
+    <div style="display:flex;justify-content: space-between;">
20
+      <div style="position: absolute;top:120px;left:80px">西药费</div>
21
+      <div style="position: absolute;top:120px;left:171px">{{ list.westernMedicineCostTotal ? list.westernMedicineCostTotal.toFixed(2) : '' }}</div>
22
+      <div style="position: absolute;top:120px;left:262px">检查费</div>
23
+      <div style="position: absolute;top:120px;left:353px">{{ list.checkCostTotal ? list.checkCostTotal.toFixed(2) : '' }}</div>
24
+      <div style="position: absolute;top:120px;left:444px">治疗费</div>
25
+      <div style="position: absolute;top:120px;left:535px">{{ list.treatCostTotal ? list.treatCostTotal.toFixed(2) : '' }}</div>
26
+    </div>
27
+
28
+    <div style="display:flex;justify-content: space-between;">
29
+      <div style="position: absolute;top:140px;left:80px">床位费</div>
30
+      <div style="position: absolute;top:140px;left:171px">{{ list.bedCostTotal ? list.bedCostTotal.toFixed(2) : '' }}</div>
31
+      <div style="position: absolute;top:140px;left:262px">中成药</div>
32
+      <div style="position: absolute;top:140px;left:353px">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
33
+      <div style="position: absolute;top:140px;left:444px">化验费</div>
34
+      <div style="position: absolute;top:140px;left:535px">{{ list.laboratoryCostTotal ? list.laboratoryCostTotal.toFixed(2) : '' }}</div>
35
+    </div>
36
+
37
+    <div style="display:flex;justify-content: space-between;">
38
+      <div style="position: absolute;top:160px;left:80px">手术费</div>
39
+      <div style="position: absolute;top:160px;left:171px">{{ list.operationCostTotal ? list.operationCostTotal.toFixed(2) : '' }}</div>
40
+      <div style="position: absolute;top:160px;left:262px">中成药</div>
41
+      <div style="position: absolute;top:160px;left:353px">{{ list.chineseTraditionalMedicineCostTotal ? list.chineseTraditionalMedicineCostTotal.toFixed(2) : '' }}</div>
42
+      <div style="position: absolute;top:160px;left:444px">其他费</div>
43
+      <div style="position: absolute;top:160px;left:535px">{{ list.otherCostTotal ? list.otherCostTotal.toFixed(2) : '' }}</div>
44
+    </div>
45
+
46
+    <div style="display:flex;justify-content: space-between;">
47
+      <div style="position: absolute;top:180px;left:80px">诊察费</div>
48
+      <div style="position: absolute;top:180px;left:171px">{{ list.zhenChaCostTotal ? list.zhenChaCostTotal.toFixed(2) : '' }}</div>
49
+      <div style="position: absolute;top:180px;left:262px">材料费</div>
50
+      <div style="position: absolute;top:180px;left:353px">{{ list.materialCostTotal ? list.materialCostTotal.toFixed(2) : '' }}</div>
51
+    </div>
52
+
53
+
54
+
55
+    <div>
56
+      <span>
57
+      <span  style="position: absolute;top:230px;left:120px">
58
+         <span v-if="zhongwen.indexOf('万') > -1 && zhongwen.indexOf('拾') > -1 && zhongwen.indexOf('拾') == 1">
59
+                    {{ zhongwen.substring(0,1) }}
60
+                </span>
61
+                <span v-else>零</span>
62
+
63
+      </span>
64
+      <span  style="position: absolute;top:230px;left:140px">
65
+           <span v-if="zhongwen.indexOf('万') > -1">
66
+                    {{ zhongwen.substring(zhongwen.indexOf('万') - 1,zhongwen.indexOf('万')) }}
67
+                </span>
68
+                <span v-else>零</span>
69
+
70
+      </span>
71
+      <span  style="position: absolute;top:230px;left:160px">
72
+        <span v-if="zhongwen.indexOf('仟') > -1">
73
+                    {{ zhongwen.substring(zhongwen.indexOf('仟') - 1,zhongwen.indexOf('仟')) }}
74
+                </span>
75
+                <span v-else>零</span>
76
+
77
+      </span>
78
+      <span  style="position: absolute;top:230px;left:180px">
79
+          <span v-if="zhongwen.indexOf('佰') > -1">
80
+                    {{ zhongwen.substring(zhongwen.indexOf('佰') - 1,zhongwen.indexOf('佰')) }}
81
+                </span>
82
+                <span v-else>零</span>
83
+
84
+      </span>
85
+      <span style="position: absolute;top:230px;left:200px">
86
+          <span v-if="zhongwen.indexOf('拾') > -1">
87
+                    {{zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) == '佰' ||  !zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾'))? '壹' : zhongwen.substring(zhongwen.indexOf('拾') - 1,zhongwen.indexOf('拾')) }}
88
+                </span>
89
+                <span v-else>零</span>
90
+
91
+      </span>
92
+      <span  style="position: absolute;top:230px;left:220px">
93
+          <span v-if="zhongwen.indexOf('元') > -1 && zhongwen.substring(this.zhongwen.indexOf('元') - 1).substring(0,1)!= '拾'">
94
+                    {{ zhongwen.substring(zhongwen.indexOf('元') - 1,zhongwen.indexOf('元')) }}
95
+                </span>
96
+                <span v-else>零</span>
97
+      </span>
98
+      <span  style="position: absolute;top:230px;left:240px">
99
+           <span v-if="zhongwen.indexOf('角') > -1">
100
+                    {{ zhongwen.substring(zhongwen.indexOf('角') - 1,zhongwen.indexOf('角')) }}
101
+                </span>
102
+                <span v-else>零</span>
103
+      </span>
104
+      <span  style="position: absolute;top:230px;left:260px">
105
+         <span v-if="zhongwen.indexOf('分') > -1">
106
+                    {{ zhongwen.substring(zhongwen.indexOf('分') - 1,zhongwen.indexOf('分')) }}
107
+                </span>
108
+                <span v-else>零</span>
109
+      </span>
110
+      </span>
111
+      <span style="position: absolute;top:230px;left:450px">¥:{{totalPrice.toFixed(2)}}</span>
112
+    </div>
113
+
114
+    <div style="border-bottom: 1px solid black;position: absolute;top:250px;left:110;width:573px;font-Size:12px">
115
+      <div  style="display:flex;margin: 3px 0px;">
116
+        <div style="width:140px">医保:门慢统筹:{{list.order.hifp_pay}}</div>
117
+        <div style="width:140px">大病保险:{{list.order.hifmi_pay}}</div>
118
+        <div style="width:140px">民政救助: </div>
119
+        <div style="width:140px">兜底支付:</div>
120
+      </div>
121
+      <div style="display:flex;margin-bottom: 3px;">
122
+        <div style="width:140px">个人自付:{{list.order.psn_part_amt}}</div>
123
+        <div style="width:140px">个账支付:{{list.order.acct_pay}}</div>
124
+        <div style="width:140px">个账余额:{{list.order.balc}}</div>
125
+      </div>
126
+    </div>
127
+    <div style="position: absolute;top:290px;left:110;width:573px;font-Size:12px">
128
+      <div style="display:flex;margin: 3px 0px;">
129
+        <div style="width:140px">现金支付:{{list.order.psn_cash_pay}}</div>
130
+        <div style="width:140px">预存扣减:</div>
131
+        <div style="width:140px">预存余额:</div>
132
+      </div>
133
+      <div style="display:flex;justify-content: space-between; margin: 3px 0px;">
134
+        <div style="width:140px">收款单位(盖章)</div>
135
+        <div style="width:140px">收款人:{{list.admin_user_name}}</div>
136
+      </div>
137
+    </div>
138
+
139
+  </div>
140
+</template>
141
+<script>
142
+import { getInvoice } from '@/api/project/project'
143
+import { uParseTime } from '@/utils/tools'
144
+export default {
145
+  props:{
146
+    paramsObj:Object
147
+  },
148
+  data(){
149
+    return{
150
+      gender:'',
151
+      list:{},
152
+      printDate:'',
153
+      zhongwen:'',
154
+      totalPrice:0.0,
155
+      org_id:'',
156
+      org_name:''
157
+    }
158
+  },
159
+  created(){
160
+    console.log('paramsObj',this.paramsObj)
161
+    let params = {
162
+      order_id: this.paramsObj.order_id,
163
+      patient_id: this.paramsObj.patient_id,
164
+      number: this.paramsObj.number,
165
+    }
166
+    this.getInvoice(params)
167
+    // var data = new Date();
168
+    // var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
169
+    // var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
170
+    // this.printDate = data.getFullYear() + "-" + month + "-" + date;
171
+    // this.smalltoBIG(982732.21)
172
+    this.org_id = this.$store.getters.xt_user.org_id
173
+    this.org_name = this.$store.getters.xt_user.org.org_name
174
+  },
175
+  methods:{
176
+    getInvoice(params){
177
+      getInvoice(params).then((res) => {
178
+        console.log('res',res)
179
+        this.list = res.data.data
180
+        this.totalPrice = this.list.westernMedicineCostTotal + this.list.checkCostTotal + this.list.treatCostTotal + this.list.bedCostTotal + this.list.chineseTraditionalMedicineCostTotal +
181
+          this.list.laboratoryCostTotal + this.list.operationCostTotal + this.list.otherCostTotal + this.list.materialCostTotal + this.list.zhenChaCostTotal
182
+        if(this.totalPrice == 0){
183
+
184
+          this.totalPrice = this.list.medfee_sumamt
185
+        }
186
+        console.log( "this.totalPrice")
187
+
188
+        this.smalltoBIG(this.totalPrice.toFixed(2))
189
+        var data = new Date(res.data.data.date * 1000);
190
+        var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
191
+        var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
192
+        this.printDate = data.getFullYear() + "-" + month + "-" + date;
193
+        this.gender = this.list.gender
194
+      })
195
+    },
196
+    smalltoBIG(n) {
197
+      // let fraction = ['角', '分'];
198
+      // let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
199
+      // let unit = [['元.', '万,', '亿,'], ["元",'拾', '佰', '仟']];
200
+      // let head = price < 0 ? '欠' : '';
201
+      // price = Math.abs(price);
202
+      // let upper = '';
203
+      // for (let i = 0; i < fraction.length; i++) {
204
+      // upper += (digit[Math.floor(price * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
205
+      // }
206
+      // upper = upper || '整';
207
+      // price = Math.floor(price);
208
+      // for (let i = 0; i < unit[0].length && price > 0; i++) {
209
+      // let p = '';
210
+      // for (let j = 0; j < unit[1].length && price > 0; j++) {
211
+      //     p = digit[price % 10] + unit[1][j] + p;
212
+      //     price = Math.floor(price / 10);
213
+      // }
214
+      // upper = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + upper;
215
+      // }
216
+      // this.zhongwen = head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整')
217
+      // console.log('6666',head + upper.replace(/(零.)*零圆/, '圆').replace(/(零.)+/g, '零').replace(/^整$/, '零圆整'))
218
+      if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
219
+        return "数据非法";  //判断数据是否大于0
220
+      }
221
+
222
+      var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
223
+      n += "00";
224
+
225
+      var indexpoint = n.indexOf('.');  // 如果是小数,截取小数点前面的位数
226
+
227
+      if (indexpoint >= 0){
228
+
229
+        n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2);   // 若为小数,截取需要使用的unit单位
230
+      }
231
+
232
+      unit = unit.substr(unit.length - n.length);  // 若为整数,截取需要使用的unit单位
233
+      for (var i=0; i < n.length; i++){
234
+        str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i);  //遍历转化为大写的数字
235
+      }
236
+
237
+      this.zhongwen =  str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
238
+      console.log(this.zhongwen)
239
+    },
240
+    getTime(value, temp) {
241
+      if (value == 0) {
242
+        return ''
243
+      }
244
+      if (value != undefined) {
245
+        return uParseTime(value, temp)
246
+      }
247
+      return ''
248
+    },
249
+  },
250
+  watch:{
251
+    paramsObj:{//深度监听,可监听到对象、数组的变化
252
+      handler(val, oldVal){
253
+        let params = {
254
+          order_id: val.order_id,
255
+          patient_id: val.patient_id,
256
+          number: val.number,
257
+        }
258
+        this.getInvoice(params)
259
+
260
+      },
261
+      deep:true
262
+    }
263
+  }
264
+}
265
+</script>

+ 3 - 2
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

@@ -1113,8 +1113,6 @@ export default {
1113 1113
         { value: '1402', label: '门诊特殊病(1402)' },
1114 1114
         { value: '1401', label: '门诊慢性病(1401)' },
1115 1115
         { value: '2302', label: '异地就医(2302)' },
1116
-
1117
-
1118 1116
         { value: '0', label: '自费' }
1119 1117
 
1120 1118
       ],
@@ -4866,6 +4864,9 @@ export default {
4866 4864
         case 1401:
4867 4865
           return '门诊慢性病(1401)' + '处方' + index
4868 4866
           break
4867
+        case 2302:
4868
+          return '异地就医(2302)' + '处方' + index
4869
+          break
4869 4870
         case 9922:
4870 4871
           return '家庭通道' + '处方' + index
4871 4872
           break

+ 7 - 162
src/xt_pages/outpatientCharges/statementPrint.vue View File

@@ -23,7 +23,6 @@
23 23
           org_id == 10138 ||
24 24
           org_id == 9504 ||
25 25
           org_id == 10028 ||
26
-          org_id == 0 ||
27 26
           org_id == 10278
28 27
         "
29 28
       >
@@ -64,7 +63,7 @@
64 63
             org_id != 9504 &&
65 64
             org_id != 10028 &&
66 65
             org_id != 0 &&
67
-            org_id != 10278 && org_id != 10387 && org_id != 0 && org_id != 10191 &&org_id != 10210 && this.paramsObj.balance_accounts_type == 1"></printOne>
66
+            org_id != 10278 && org_id != 10387 && org_id != 10191 &&org_id != 10210 && this.paramsObj.balance_accounts_type == 1"></printOne>
68 67
 
69 68
       <privateChargePrint  :info="info" v-if="org_id != 9990 &&
70 69
             org_id != 10138 &&
@@ -406,7 +405,6 @@
406 405
             };
407 406
             if (
408 407
               this.org_id == 10138 ||
409
-              this.$store.getters.xt_user.org_id == 0 ||
410 408
               this.org_id == 10278
411 409
             ) {
412 410
               getPrivateExpenses(params).then((response) => {
@@ -485,7 +483,8 @@
485 483
                   console.log("this.num", this.num);
486 484
                 }
487 485
               });
488
-            } else if (this.org_id == 10028) {
486
+            } else
487
+              if (this.org_id == 10028) {
489 488
               getPrivateExpenses(params).then((response) => {
490 489
                 if (response.data.state == 0) {
491 490
                   // this.$message.error(response.data.msg)
@@ -529,7 +528,8 @@
529 528
                   console.log(111, this.balanceAccounts);
530 529
                 }
531 530
               });
532
-            } else if (this.org_id == 10215 ) {
531
+            } else
532
+            {
533 533
               getPrivateExpensesOrder(params).then((response) => {
534 534
                 if (response.data.state == 0) {
535 535
                   // this.$message.error(response.data.msg)
@@ -614,9 +614,10 @@
614 614
                   that.info["treat_cost_part_self_total"] =
615 615
                     response.data.data.treatCostPartSelfTotal;
616 616
                   that.info["date"] = response.data.data.date;
617
-                  // that.info["number"] = response.data.data.number;
617
+                  that.info["number"] = response.data.data.number;
618 618
                   that.info["order_infos"] = response.data.data.order_infos;
619 619
                   that.info["diagnosis"] = response.data.data.diagnosis;
620
+                  that.info["his"] = response.data.data.his;
620 621
 
621 622
                   let obj = {
622 623
                     type: 1,
@@ -685,162 +686,6 @@
685 686
                 }
686 687
               });
687 688
             }
688
-            // else if (this.org_id == 0) {
689
-            //
690
-            //   getPrivateExpensesOrder(params).then((response) => {
691
-            //     if (response.data.state == 0) {
692
-            //       // this.$message.error(response.data.msg)
693
-            //
694
-            //       return false;
695
-            //     } else {
696
-            //       var that = this;
697
-            //       that.info = response.data.data.info;
698
-            //       that.p_admin = response.data.data.printor_admin;
699
-            //       that.charge_admin = response.data.data.charge_admin;
700
-            //
701
-            //       that.info["p_admin"] = that.p_admin;
702
-            //       that.info["charge_admin"] = that.charge_admin;
703
-            //       that.info["order_number"] = response.data.data.order_number;
704
-            //       that.info["patient"] = response.data.data.patient;
705
-            //       that.info["date"] = response.data.data.date;
706
-            //       that.info["number"] = response.data.data.number;
707
-            //       that.info["order_infos"] = response.data.data.order_infos;
708
-            //       that.info["diagnosis"] = response.data.data.diagnosis;
709
-            //       that.info["fixmedins_name"] = response.data.data.org_name;
710
-            //       that.info["fixmedins_code"] = response.data.data.org_code;
711
-            //       // that.info["doctor_code"] = response.data.data.doctor_code;
712
-            //       // that.info["department"] = response.data.data.department;
713
-            //       // that.info["health_card_no"] = response.data.data.health_card_no;
714
-            //
715
-            //       that.info["bed_cost_total"] = response.data.data.bedCostTotal;
716
-            //       that.info["bed_cost_self_total"] =
717
-            //           response.data.data.bedCostSelfTotal;
718
-            //       that.info["bed_cost_part_self_total"] =
719
-            //           response.data.data.bedCostPartSelfTotal;
720
-            //
721
-            //       that.info["operation_cost_total"] =
722
-            //           response.data.data.operationCostTotal;
723
-            //       that.info["operation_cost_self_total"] =
724
-            //           response.data.data.operationCostSelfTotal;
725
-            //       that.info["operation_cost_part_self_total"] =
726
-            //           response.data.data.operationCostPartSelfTotal;
727
-            //
728
-            //       that.info["other_cost_total"] = response.data.data.otherCostTotal;
729
-            //       that.info["other_cost_self_total"] =
730
-            //           response.data.data.otherCostSelfTotal;
731
-            //       that.info["other_cost_part_self_total"] =
732
-            //           response.data.data.otherCostPartSelfTotal;
733
-            //
734
-            //       that.info["material_cost_total"] =
735
-            //           response.data.data.materialCostTotal;
736
-            //       that.info["material_cost_self_total"] =
737
-            //           response.data.data.materialCostSelfTotal;
738
-            //       that.info["material_cost_part_self_total"] =
739
-            //           response.data.data.materialCostPartSelfTotal;
740
-            //
741
-            //       that.info["western_medicine_cost_total"] =
742
-            //           response.data.data.westernMedicineCostTotal;
743
-            //       that.info["western_medicine_cost_self_total"] =
744
-            //           response.data.data.westernMedicineCostSelfTotal;
745
-            //       that.info["western_medicine_cost_part_self_total"] =
746
-            //           response.data.data.westernMedicineCostPartSelfTotal;
747
-            //
748
-            //       that.info["chinese_traditional_medicine_cost_total"] =
749
-            //           response.data.data.chineseTraditionalMedicineCostTotal;
750
-            //       that.info["chinese_traditional_medicine_cost_self_total"] =
751
-            //           response.data.data.chineseTraditionalMedicineCostSelfTotal;
752
-            //       that.info["chinese_traditional_medicine_cost_part_self_total"] =
753
-            //           response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
754
-            //
755
-            //       that.info["check_cost_total"] = response.data.data.checkCostTotal;
756
-            //       that.info["check_cost_self_total"] =
757
-            //           response.data.data.checkCostSelfTotal;
758
-            //       that.info["check_cost_part_self_total"] =
759
-            //           response.data.data.checkCostPartSelfTotal;
760
-            //
761
-            //       that.info["laboratory_cost_total"] =
762
-            //           response.data.data.laboratoryCostTotal;
763
-            //       that.info["laboratory_cost_self_total"] =
764
-            //           response.data.data.laboratoryCostSelfTotal;
765
-            //       that.info["laboratory_cost_part_self_total"] =
766
-            //           response.data.data.laboratoryCostPartSelfTotal;
767
-            //
768
-            //       that.info["treat_cost_total"] = response.data.data.treatCostTotal;
769
-            //       that.info["treat_cost_self_total"] =
770
-            //           response.data.data.treatCostSelfTotal;
771
-            //       that.info["treat_cost_part_self_total"] =
772
-            //           response.data.data.treatCostPartSelfTotal;
773
-            //       that.info["date"] = response.data.data.date;
774
-            //       // that.info["number"] = response.data.data.number;
775
-            //       that.info["order_infos"] = response.data.data.order_infos;
776
-            //       that.info["diagnosis"] = response.data.data.diagnosis;
777
-            //
778
-            //
779
-            //       let list = []
780
-            //       for (let i = 0; i < response.data.data.order_infos.length; i++) {
781
-            //         let order = response.data.data.order_infos[i]
782
-            //         let obj = {
783
-            //           code:"",
784
-            //           name: "",
785
-            //           spec: "",
786
-            //           cnt: "",
787
-            //           det_item_fee_sumamt: "",
788
-            //         }
789
-            //
790
-            //         if (order.advice_id > 0 && order.project_id == 0) {
791
-            //           obj.name = order.advice.advice_name
792
-            //           let spec = order.advice.drug.dose + order.advice.drug.dose_unit + '*' + order.advice.drug.min_number + order.advice.drug.min_unit + '/' + order.advice.drug.max_unit
793
-            //           obj.spec = spec
794
-            //           obj.cnt = order.cnt
795
-            //           obj.det_item_fee_sumamt =order.det_item_fee_sumamt
796
-            //           obj.code = order.advice.drug.medical_insurance_number
797
-            //           list.push(obj)
798
-            //         }else if (order.advice_id == 0 && order.project_id > 0) {
799
-            //           if(order.project.type == 2){
800
-            //             obj.name = order.project.project.project_name
801
-            //             obj.spec = ""
802
-            //             obj.cnt = order.cnt
803
-            //             obj.det_item_fee_sumamt =order.det_item_fee_sumamt
804
-            //             obj.code = order.project.project.medical_code
805
-            //           }else{
806
-            //             obj.name = order.project.good_info.good_name
807
-            //             obj.spec = order.project.good_info.specification_name
808
-            //             obj.cnt = order.cnt
809
-            //             obj.det_item_fee_sumamt =order.det_item_fee_sumamt
810
-            //             obj.code = order.project.good_info.medical_insurance_number
811
-            //           }
812
-            //           list.push(obj)
813
-            //         }
814
-            //
815
-            //       }
816
-            //       console.log(list)
817
-            //       let len = list.length / 2
818
-            //       let L_list = []
819
-            //       let R_list = []
820
-            //       len = Math.trunc(len)
821
-            //       for(let i = 0; i < len; i++){
822
-            //         L_list.push(list[i])
823
-            //       }
824
-            //       console.log(len)
825
-            //       for(let i = len; i < list.length; i++){
826
-            //         console.log(list[i])
827
-            //         R_list.push(list[i])
828
-            //       }
829
-            //       console.log(L_list)
830
-            //       console.log(R_list)
831
-            //
832
-            //       that.info["L_list"] = L_list
833
-            //       that.info["R_list"] = R_list
834
-            //
835
-            //
836
-            //
837
-            //
838
-            //
839
-            //
840
-            //     }
841
-            //   });
842
-            // }
843
-
844 689
           } else {
845 690
             console.log(this.org_id)
846 691
             if (this.org_id == 0) {

+ 1 - 1
src/xt_pages/outpatientCharges/statementTemplate/printThree.vue View File

@@ -123,7 +123,7 @@
123 123
                         <td colspan="7">
124 124
                             <div style="display:flex;flez-wrap:wrap;margin-bottom:10px;font-size:16px;">
125 125
                                 <div style="width:33%;">医疗费总额:{{info.medfee_sumamt?info.medfee_sumamt:info.new_order.medfee_sumamt}}元</div>
126
-                                <div style="width:33%;">基金支付金额:{{ (info.new_order.hifp_pay + info.new_order.maf_pay + info.new_order.hifmi_pay).toFixed(2)}}元</div>
126
+                                <div style="width:33%;">基金支付金额:{{ (info.new_order.hifp_pay + info.new_order.maf_pay + info.new_order.hifmi_pay + info.new_order.hifob_pay).toFixed(2)}}元</div>
127 127
                                 <div style="width:33%;">个人账户支付金额:{{info.acct_pay?info.acct_pay:info.new_order.acct_pay}}元</div>
128 128
 
129 129
                             </div>

+ 10 - 3
src/xt_pages/outpatientCharges/statementTemplate/privateChargePrint.vue View File

@@ -47,12 +47,19 @@
47 47
         <td width="100"></td>
48 48
         <td>床号</td>
49 49
         <td></td>
50
+<!--        <td>入院日期</td>-->
51
+<!--        <td>{{info.his.in_hosptial_time ? info.his.in_hosptial_time.split(' ')[0] : ''}}</td>-->
52
+<!--        <td>出院日期</td>-->
53
+<!--        <td width="100">{{info.his.out_hosptial_time ? info.his.out_hosptial_time.split(' ')[0] : ''}}</td>-->
54
+<!--        <td>住院天数</td>-->
55
+<!--        <td>{{getDay(info.his.in_hosptial_time.split(' ')[0] ,info.his.out_hosptial_time.split(' ')[0])}}</td>-->
56
+
50 57
         <td>入院日期</td>
51
-        <td>{{info.his.in_hosptial_time ? info.his.in_hosptial_time.split(' ')[0] : ''}}</td>
58
+        <td></td>
52 59
         <td>出院日期</td>
53
-        <td width="100">{{info.his.out_hosptial_time ? info.his.out_hosptial_time.split(' ')[0] : ''}}</td>
60
+        <td width="100"></td>
54 61
         <td>住院天数</td>
55
-        <td>{{getDay(info.his.in_hosptial_time.split(' ')[0] ,info.his.out_hosptial_time.split(' ')[0])}}</td>
62
+        <td></td>
56 63
 
57 64
       </tr>
58 65
       <tr>

+ 2 - 2
src/xt_pages/outpatientCharges/summary.vue View File

@@ -127,7 +127,7 @@
127 127
 <!--           <el-button size="small" type="primary" @click="export_detail_three">报表下载12</el-button>-->
128 128
           <!-- <el-button size="small" type="primary" @click="export_detail_four">报表下载3</el-button>-->
129 129
           <!-- <el-button size="small" type="primary" @click="export_detail_five">报表下载3</el-button>-->
130
-          <!-- <el-button size="small" type="primary" @click="export_detail_six">报表下载9</el-button>-->
130
+<!--           <el-button size="small" type="primary" @click="export_detail_six">报表下载9</el-button>-->
131 131
           <!-- <el-button size="small" type="primary" @click="export_detail_tenone">报表下载10</el-button>-->
132 132
           <!--  <el-button size="small" type="primary" @click="export_detail_seven">报表下载4</el-button>-->
133 133
 
@@ -1672,7 +1672,7 @@ export default {
1672 1672
           var tarList = []
1673 1673
           for (let i = 0; i < list.length; i++) {
1674 1674
             let obj = {
1675
-              "周期": "2023年第季度",
1675
+              "周期": "2023年第季度",
1676 1676
               "类别": "门诊",
1677 1677
               "医保目录编码": list[i].code,
1678 1678
               "医保目录名称": list[i].name,

+ 128 - 10
src/xt_pages/outpatientDoctorStation/batch_print_checkTemplate/printOne.vue View File

@@ -6,7 +6,7 @@
6 6
         style="box-shadow: 0 1 px 4 px rgba(0, 0, 0, 0.27),
7 7
          0 0 40 px rgba(0, 0, 0, 0.06) inset  "
8 8
     >
9
-       
9
+
10 10
       <div
11 11
           id="prescription-print"
12 12
           class="prescription-print"
@@ -90,8 +90,9 @@
90 90
                   :key="item.id"
91 91
                   style="margin-bottom: 10px"
92 92
               >
93
-                {{ item.team.project_team }}
93
+                {{ item.team.id > 0 ? item.team.project_team:item.project.project_name }}
94 94
               </div>
95
+
95 96
             </div>
96 97
           </div>
97 98
           <div
@@ -110,14 +111,32 @@
110 111
                 getTime(i.info.ctime) ? getTime(i.info.ctime).split(' ')[0] : ''
111 112
               }}
112 113
             </div>
113
-            <div>医生签字:{{ i.info.doctor ? i.info.doctor : '' }}</div>
114
+            <div>医生签字:
115
+              <img
116
+                v-if="setAdminUserES(i.info.creator)"
117
+                style="height: 30px"
118
+                :src="setAdminUserES(i.info.creator)"
119
+                alt=""
120
+                srcset=""
121
+              />
122
+              <span
123
+                style="width: 100px; display: inline-block"
124
+                v-else-if="i.info.doctor != ''"
125
+              >
126
+              {{ i.info.doctor ? i.info.doctor : "" }}
127
+            </span>
128
+              <span v-else>
129
+
130
+            </span>
131
+
132
+            </div>
114 133
           </div>
115 134
         </div>
116
-        
135
+
117 136
         <img style="width:100%;" v-if="org_id == 10138 || org_id == 0" src="https://kuyi.shengws.com/bailin/blend.jpg" alt="">
118 137
         <img style="width:100%;" v-if="org_id == 10278" src="https://kuyi.shengws.com/bailinbeier.png" alt="">
119 138
       </div>
120
-       
139
+
121 140
     </div>
122 141
   </div>
123 142
 </template>
@@ -151,11 +170,27 @@ export default {
151 170
       doctor: '',
152 171
       org_id: '',
153 172
       singleProjectPrint: [],
154
-      total_copy: []
173
+      total_copy: [],
174
+      operatorMaps: {},
175
+
155 176
     }
156 177
   },
157 178
 
158 179
   methods: {
180
+    // 电子签名
181
+    setAdminUserES(id) {
182
+      // console.log(id, "id");
183
+      if (id == 0) {
184
+        return "";
185
+      }
186
+      if (id in this.operatorMaps) {
187
+        // console.log(this.operatorMaps, "this.operatorMaps");
188
+        return this.operatorMaps[id].url;
189
+      } else {
190
+        // console.log("po");
191
+        return "";
192
+      }
193
+    },
159 194
     getAllDoctorList() {
160 195
       getAllDoctorList().then((response) => {
161 196
         if (response.data.state == 1) {
@@ -177,8 +212,10 @@ export default {
177 212
       var res = []
178 213
       for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
179 214
         for (var j = 0, resLen = res.length; j < resLen; j++) {
180
-          if (array[i].team_id === res[j].team_id) {
181
-            break
215
+          if(array[i].team_id != 0) {
216
+            if (array[i].team_id === res[j].team_id) {
217
+              break
218
+            }
182 219
           }
183 220
         }
184 221
         if (j === resLen) {
@@ -214,8 +251,43 @@ export default {
214 251
         // }
215 252
       })
216 253
       let data = []
254
+      projectPrint =  this.unique_two(projectPrint)
217 255
       console.log(projectPrint)
256
+      projectPrint.map((item) => {
257
+        // console.log(item, "999");
258
+        if (item.team.id == 0) {
259
+          console.log("~~~~~~")
260
+          data.push(item)
261
+        } else {
262
+          let status = data.some((it) => it.team.id == item.team.id)
263
+          if (!status) {
264
+            data.push(item)
265
+          }
266
+        }
267
+      })
268
+      if (isUpdate) {
269
+        this.projectPrint = data
270
+      }
271
+      console.log(data)
272
+      return data
273
+    },
274
+    getTeamTwo(prescriptions, isUpdate = true) {
275
+      let projectPrint = []
276
+      prescriptions.forEach((item) => {
277
+        // !此为修改前的处理方法,因考虑到可能有逻辑错误的存在故注释,若后续需求以这个为准可放开此条!
278
+        if (item.project.length > 0) {
279
+          item.project.map((it) => {
280
+            if (it.type == 2) {
281
+              if (it.project.cost_classify == 3) {
282
+                projectPrint.push(it)
283
+              }
284
+            }
285
+          })
286
+        }
287
+      })
288
+      let data = []
218 289
       projectPrint =  this.unique_two(projectPrint)
290
+      console.log(projectPrint)
219 291
       projectPrint.map((item) => {
220 292
         // console.log(item, "999");
221 293
         if (item.team.id == 0) {
@@ -233,6 +305,7 @@ export default {
233 305
       return data
234 306
     },
235 307
 
308
+
236 309
     // 计算金额(单独从上面的方法割开来,防止进入死循环)
237 310
     getSingleTeam(prescriptions) {
238 311
       let projectPrint = []
@@ -464,12 +537,57 @@ export default {
464 537
           return '二档医疗退休'
465 538
           break
466 539
       }
467
-    }
540
+    }, getPrescriptionPrint() {
541
+      var params = {
542
+        patient_id: this.patient_id,
543
+        record_date: this.record_date,
544
+        prescription_id: this.prescription_id,
545
+        his_patient_id: this.his_patient_id,
546
+        ids: this.ids,
547
+        p_type: 2,
548
+      };
549
+      console.log("params", params);
550
+      getPrescriptionPrint(params).then((response) => {
551
+        if (response.data.state == 1) {
552
+          var advicePrint = response.data.data.advicePrint;
553
+          console.log("adviceprint9999", advicePrint);
554
+          this.advicePrint = advicePrint;
555
+
556
+          this.doctorList_1 = response.data.data.eles;
557
+          console.log(this.doctorList_1, "百霖医生列表");
558
+          if (this.doctorList_1.length > 0) {
559
+            var operatorsLen = this.doctorList_1.length;
560
+            for (var index = 0; index < operatorsLen; index++) {
561
+              this.$set(
562
+                this.operatorMaps,
563
+                this.doctorList_1[index].creator,
564
+                this.doctorList_1[index]
565
+              );
566
+            }
567
+          }
568
+
569
+          this.getPage();
570
+          this.prescriptions = advicePrint;
571
+          console.log("处方222222", this.prescriptions);
572
+          var hisPatient = response.data.data.hisPatient;
573
+          console.log("hisPatient", hisPatient);
574
+          this.hisPatient = hisPatient;
575
+          var projectlist = response.data.data.projectlist;
576
+          console.log("所有项目列表", projectlist);
577
+          this.projectList = projectlist;
578
+
579
+          let outputlist1Name = response.data.data.his.patient_info
580
+            ? JSON.parse(response.data.data.his.patient_info)
581
+            : {};
582
+          this.faber = outputlist1Name;
583
+        }
584
+      });
585
+    },
468 586
   },
469 587
   created() {
470 588
     // this.getAllDoctorList()
471 589
     this.getInitData()
472
-    // this.getPrescriptionPrint()
590
+    this.getPrescriptionPrint()
473 591
     // this.getHisPatientDetail()
474 592
     // this.getPatientCaseHistory()
475 593
     var xtuser = this.$store.getters.xt_user

+ 696 - 0
src/xt_pages/outpatientDoctorStation/batch_print_checkTemplate/printTwo.vue View File

@@ -0,0 +1,696 @@
1
+<template>
2
+  <div>
3
+    <div id="prescriptionPrint1">
4
+      <div v-for="(i, index) in printData" :key="index">
5
+        <div v-for="(item, index) in i.prescriptions" :key="index">
6
+          <div id="prescription-print3" class="prescription-print">
7
+            <img
8
+              style="width: 100%; height: 80px"
9
+              v-if="org_id == 10138"
10
+              src="https://kuyi.shengws.com/bailin/bltotle.jpg"
11
+              alt=""
12
+            />
13
+            <img
14
+              style="width: 100%; height: 80px"
15
+              v-if="org_id == 10278 || org_id == 0"
16
+              src="https://kuyi.shengws.com/beierlog.png"
17
+              alt=""
18
+            />
19
+            <div class="printTitle">检验申请单</div>
20
+            <div style="border: 1px solid #000;margin-bottom: 10px;">
21
+              <div
22
+                style="
23
+            display: flex;
24
+            justify-content: space-between;
25
+            border-bottom: 1px solid #000;
26
+            line-height: 40px;
27
+            padding: 0 10px;
28
+          "
29
+              >
30
+                <div>是否急诊:否</div>
31
+                <div>
32
+                  结算方式:{{ '医保' }}
33
+                </div>
34
+                <div>金额:{{ item.total }}</div>
35
+              </div>
36
+              <div
37
+                style="
38
+            display: flex;
39
+            justify-content: space-between;
40
+            border-bottom: 1px solid #000;
41
+            line-height: 40px;
42
+            padding: 0 10px;
43
+          "
44
+              >
45
+                <div>
46
+                  姓名:{{
47
+                    i.name
48
+                      ? i.name.indexOf('(') > -1
49
+                        ? i.name.substring(
50
+                          0,
51
+                          i.name.indexOf('(')
52
+                        )
53
+                        : i.name
54
+                      : ''
55
+                  }}
56
+                </div>
57
+                <div>
58
+                  性别:
59
+                  <span v-if="i.gender == 1">男</span>
60
+                  <span v-if="i.gender == 2">女</span>
61
+                </div>
62
+                <!--          <div>-->
63
+                <!--            年龄:{{-->
64
+                <!--              advicePrint[0].patient.age ? advicePrint[0].patient.age : ""-->
65
+                <!--            }}岁-->
66
+                <!--          </div>-->
67
+                <div> 年龄:{{
68
+                    getNewAge(i.birthday)
69
+                      ? getNewAge(i.birthday)
70
+                      : ''
71
+                  }}岁
72
+                </div>
73
+
74
+              </div>
75
+              <div style="margin-bottom: 20px; padding: 10px 10px 0" v-if="org_id!=10278 && org_id!=10138 && org_id!=0">
76
+                病史摘要:{{
77
+                  i.history.history_of_present_illness
78
+                    ? i.history.history_of_present_illness
79
+                    : ''
80
+                }}
81
+              </div>
82
+              <!-- <div style="margin-bottom:20px;padding:0 10px;">体格检查:
83
+                          <span>体温:{{ history.temperature ? history.temperature + '℃' : '/' }}</span>
84
+                          <span>脉搏:{{ history.pulse ? history.pulse + '次/分' : '/' }}</span>
85
+                          <span>呼吸:{{ history.breathing ? history.breathing + '次/分' : '/' }}</span>
86
+                          <span>血压:{{ history.sbp }}/{{ history.dbp }}mmHg</span>
87
+                      </div> -->
88
+              <div style="margin-bottom: 20px; padding: 0 10px">
89
+                临床诊断:{{ getDiagnosis(i.info.diagnosis) }}
90
+              </div>
91
+              <div style="display: flex; margin-bottom: 20px; padding: 0 10px">
92
+                <div>检验项目:</div>
93
+                <div>
94
+                  <div v-for="subitem in item.projectPrint" style="margin-bottom: 10px">
95
+                    {{ subitem.team.project_team }}
96
+                  </div>
97
+                  <div v-for="subitem in item.singleProjectPrint" style="margin-bottom: 10px">
98
+                    {{ subitem.project.project_name }}
99
+                  </div>
100
+                </div>
101
+              </div>
102
+              <div
103
+                style="
104
+            display: flex;
105
+            justify-content: space-between;
106
+            border-top: 1px solid #000;
107
+            line-height: 40px;
108
+            padding: 0 10px;
109
+          "
110
+              >
111
+                <div>开单医生:{{ doctor ? doctor : '' }}</div>
112
+                <div>
113
+                  开单日期:
114
+                  {{ getTime(pre_time) ? getTime(pre_time).split(' ')[0] : '' }}
115
+                </div>
116
+                <div>
117
+                  医生签字:
118
+
119
+                  <span
120
+                    style="width: 100px; display: inline-block"
121
+                    v-if="i.info.creator == 0"
122
+                  >
123
+               {{ i.info.doctor ? i.info.doctor : '' }}
124
+              </span>
125
+                  <img
126
+                    style="height: 30px"
127
+                    :src="setAdminUserES(i.info.creator)"
128
+                    alt=""
129
+                    srcset=""
130
+                    v-else
131
+                  />
132
+                </div>
133
+              </div>
134
+            </div>
135
+            <img
136
+              style="width: 100%"
137
+              v-if="org_id == 10138 "
138
+              src="https://kuyi.shengws.com/bailin/blend.jpg"
139
+              alt=""
140
+            />
141
+            <img
142
+              style="width: 100%"
143
+              v-if="org_id == 10278 || org_id == 0"
144
+              src="https://kuyi.shengws.com/bailinbeier.png"
145
+              alt=""
146
+            />
147
+          </div>
148
+        </div>
149
+      </div>
150
+    </div>
151
+  </div>
152
+</template>
153
+<script>
154
+import { uParseTime } from '@/utils/tools'
155
+import {
156
+  getAllDoctorList,
157
+  getHisPatientDetail,
158
+  getPatientCaseHistory,
159
+  getPrescriptionPrint
160
+} from '@/api/project/project'
161
+import { getInitData } from '@/api/his/his'
162
+
163
+export default {
164
+  props: {
165
+    patient_id: Number,
166
+    record_date: String,
167
+    prescription_id: Number,
168
+    ids: String,
169
+    printData: Array
170
+
171
+  },
172
+  data() {
173
+    return {
174
+      doctorList_1: [],
175
+      doctorList: [],
176
+      advicePrint: {},
177
+      patient: {},
178
+      tableData: [],
179
+      prescriptionInfo: [],
180
+      hisPatient: {},
181
+      department: [],
182
+      prescriptions: [],
183
+      projectList: [],
184
+      doc_name: '',
185
+      orgname: '',
186
+      diagnoses: [],
187
+      pageArr: [],
188
+      faber: {},
189
+      total: 0,
190
+      projectPrint: [],
191
+      time: '',
192
+      doctor: '',
193
+      org_id: '',
194
+      singleProjectPrint: [],
195
+      operatorMaps: {}
196
+    }
197
+  },
198
+  methods: {
199
+    getAge(patient) {
200
+      // 将时间戳转换为 Date 对象
201
+      const birthday = new Date(patient.birthday * 1000)
202
+
203
+      // 获取当前日期
204
+      const now = new Date()
205
+      // 计算年龄差
206
+      const ageDiffMs = now - birthday
207
+      const ageDate = new Date(ageDiffMs) // 不需要减掉 1970 年的时间戳
208
+      // 提取年份
209
+      const age = ageDate.getUTCFullYear() - 1970
210
+      return age
211
+    }, getNewAge(birthday) {
212
+      // var myDate = new Date(birthday * 1000)
213
+      // var month = myDate.getMonth() + 1
214
+      // var day = myDate.getDate()
215
+      // var age = new Date().getFullYear() - myDate.getFullYear()
216
+      // if (month < new Date().getMonth() + 1 || new Date().getMonth() + 1 == month && day <= new Date().getDate()) {
217
+      //   age++
218
+      // }
219
+      // return age
220
+      var nowTime = new Date().getTime()
221
+      return Math.ceil((nowTime - birthday * 1000) / 31536000000)
222
+    },
223
+    getPatientCaseHistory() {
224
+      const params = {
225
+        patient_id: this.patient_id
226
+      }
227
+      getPatientCaseHistory(params).then((response) => {
228
+        if (response.data.state == 1) {
229
+          var history = response.data.data.history
230
+          // console.log("中国history222222", history);
231
+          this.history = history
232
+        }
233
+      })
234
+    },
235
+    getAllDoctorList() {
236
+      getAllDoctorList().then((response) => {
237
+        if (response.data.state == 1) {
238
+          var doctor = response.data.data.doctor
239
+
240
+          this.doctorList = doctor
241
+        }
242
+      })
243
+    },
244
+
245
+    getDoctor(id) {
246
+      var name = ''
247
+      for (let i = 0; i < this.doctorList.length; i++) {
248
+        if (id == this.doctorList[i].admin_user_id) {
249
+          name = this.doctorList[i].user_name
250
+        }
251
+      }
252
+      return name
253
+    },
254
+    getTime(value, temp) {
255
+      if (value != undefined) {
256
+        return uParseTime(value, temp)
257
+      }
258
+      return ''
259
+    },
260
+
261
+    getPrescriptionPrint() {
262
+      var params = {
263
+        // patient_id:this.patient_id,
264
+        // record_date:this.record_date,
265
+        // prescription_id:this.prescription_id,
266
+        patient_id: this.patient_id,
267
+        record_date: this.record_date,
268
+        prescription_id: this.prescription_id,
269
+        ids: this.ids,
270
+        p_type: 2
271
+      }
272
+      // console.log("params", params);
273
+      getPrescriptionPrint(params).then((response) => {
274
+        if (response.data.state == 1) {
275
+          var advicePrint = response.data.data.advicePrint
276
+          // console.log("adviceprint9999", advicePrint);
277
+          this.advicePrint = advicePrint
278
+          this.prescriptions = advicePrint
279
+          // console.log("处方222222", this.prescriptions);
280
+          var hisPatient = response.data.data.hisPatient
281
+          // console.log("hisPatient", hisPatient);
282
+          this.hisPatient = hisPatient
283
+          let projectPrint = []
284
+          let total = 0
285
+          this.advicePrint.map((item) => {
286
+            // console.log("imte233232323232323223", item.project);
287
+            if (item.project.length > 0) {
288
+              item.project.map((it) => {
289
+                if (it.type == 2) {
290
+                  if (it.project.cost_classify == 3) {
291
+                    projectPrint.push(it)
292
+                    total += it.project.price * parseInt(it.count)
293
+                  }
294
+                }
295
+              })
296
+            }
297
+          })
298
+          this.doctorList_1 = response.data.data.eles
299
+          // console.log(this.doctorList_1, "医生列表");
300
+          if (this.doctorList_1.length > 0) {
301
+            var operatorsLen = this.doctorList_1.length
302
+            for (var index = 0; index < operatorsLen; index++) {
303
+              this.$set(
304
+                this.operatorMaps,
305
+                this.doctorList_1[index].creator,
306
+                this.doctorList_1[index]
307
+              )
308
+            }
309
+          }
310
+          let data = []
311
+          let data2 = []
312
+          projectPrint.map((item) => {
313
+            if (item.team.id != 0) {
314
+              let status = data.some((it) => it.team.id == item.team.id)
315
+              if (!status) {
316
+                data.push(item)
317
+              }
318
+            }
319
+            if (item.team.id == 0) {
320
+              data2.push(item)
321
+            }
322
+          })
323
+          this.projectPrint = data
324
+          console.log('列表', this.projectPrint)
325
+          this.total = total.toFixed(2)
326
+          this.pre_time = this.advicePrint[0].pre_time
327
+          this.doctor = this.advicePrint[0].doctor
328
+
329
+          this.singleProjectPrint = data2
330
+
331
+          var projectlist = response.data.data.projectlist
332
+
333
+          var projectlist = response.data.data.projectlist
334
+          // console.log("所有项目列表", projectlist);
335
+          this.projectList = projectlist
336
+          this.getPage()
337
+          let outputlist1Name = response.data.data.his.patient_info
338
+            ? JSON.parse(response.data.data.his.patient_info)
339
+            : {}
340
+          this.faber = outputlist1Name
341
+        }
342
+      })
343
+    },
344
+    // 电子签名
345
+    setAdminUserES(id) {
346
+      // console.log(id, "id");
347
+      if (id == 0) {
348
+        return ''
349
+      }
350
+      if (id in this.operatorMaps) {
351
+        // console.log(this.operatorMaps, "this.operatorMaps");
352
+        return this.operatorMaps[id].url
353
+      } else {
354
+        // console.log("po");
355
+        return ''
356
+      }
357
+    },
358
+    getHisPatientDetail() {
359
+      const params = {
360
+        patient_id: this.patient_id
361
+      }
362
+      getHisPatientDetail(params).then((response) => {
363
+        if (response.data.state == 1) {
364
+          var hisPatient = response.data.data.hisPatient
365
+          // console.log("挂号病人", hisPatient);
366
+          this.hisPatient = hisPatient
367
+        }
368
+      })
369
+    },
370
+    getInitData() {
371
+      getInitData().then((response) => {
372
+        if (response.data.state == 1) {
373
+          this.department = response.data.data.department
374
+          this.diagnoses = response.data.data.diagnose.sort(this.compare('id'))
375
+          // console.log("争端", this.diagnoses);
376
+        }
377
+      })
378
+    },
379
+    getDepart(id) {
380
+      var name = ''
381
+      for (let i = 0; i < this.department.length; i++) {
382
+        if (id == this.department[i].id) {
383
+          name = this.department[i].name
384
+        }
385
+      }
386
+      return name
387
+    },
388
+    getTotalOne(id) {
389
+      var total = 0
390
+      var addtotal = 0
391
+      for (let i = 0; i < this.prescriptions.length; i++) {
392
+        if (id == this.prescriptions[i].id) {
393
+          if (this.prescriptions[i].project != null) {
394
+            for (let a = 0; a < this.prescriptions[i].project.length; a++) {
395
+              total =
396
+                total +
397
+                this.prescriptions[i].project[a].price *
398
+                this.prescriptions[i].project[a].count
399
+            }
400
+          }
401
+
402
+          if (this.prescriptions[i].additionalcharge != null) {
403
+            for (
404
+              let a = 0;
405
+              a < this.prescriptions[i].additionalcharge.length;
406
+              a++
407
+            ) {
408
+              addtotal =
409
+                addtotal +
410
+                this.prescriptions[i].additionalcharge[a].price *
411
+                this.prescriptions[i].additionalcharge[a].count
412
+            }
413
+          }
414
+          addtotal = Math.floor(addtotal * 100) / 100
415
+        }
416
+      }
417
+
418
+      for (let i = 0; i < this.prescriptions.length; i++) {
419
+        if (id == this.prescriptions[i].id) {
420
+          if (this.prescriptions[i].advices != null) {
421
+            for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
422
+              total =
423
+                total +
424
+                this.prescriptions[i].advices[a].price *
425
+                this.prescriptions[i].advices[a].prescribing_number
426
+            }
427
+          }
428
+
429
+          if (this.prescriptions[i].additionalcharge != null) {
430
+            for (
431
+              let a = 0;
432
+              a < this.prescriptions[i].additionalcharge.length;
433
+              a++
434
+            ) {
435
+              addtotal =
436
+                addtotal +
437
+                this.prescriptions[i].additionalcharge[a].price *
438
+                this.prescriptions[i].additionalcharge[a].count
439
+            }
440
+          }
441
+          addtotal = Math.floor(addtotal * 100) / 100
442
+        }
443
+      }
444
+
445
+      return total + addtotal
446
+    },
447
+
448
+    getProjectName(id) {
449
+      var project_name = ''
450
+      for (let i = 0; i < this.projectList.length; i++) {
451
+        if (id == this.projectList[i].id) {
452
+          project_name = this.projectList[i].project_name
453
+        }
454
+      }
455
+      return project_name
456
+    },
457
+
458
+    getDiagnosis(ids) {
459
+      let newIds = ids.split(',').sort(function(a, b) {
460
+        return a - b
461
+      })
462
+
463
+      var name = ''
464
+      let nameArr = []
465
+      for (let i = 0; i < this.diagnoses.length; i++) {
466
+        // if(id == this.diagnoses[i].id){
467
+        //    name = this.diagnoses[i].class_name
468
+        // }
469
+
470
+        if (newIds.indexOf(this.diagnoses[i].id.toString()) > -1) {
471
+          // name += diagnoses[i].class_name + ' '
472
+          nameArr.push(this.diagnoses[i].class_name)
473
+        }
474
+      }
475
+      let newNameArr = []
476
+      nameArr.map((item, index) => {
477
+        if (item == '尿毒症') {
478
+          newNameArr.push(item)
479
+          nameArr.splice(index, 1, '')
480
+        }
481
+      })
482
+      newNameArr.push(...nameArr)
483
+      return newNameArr.join(' ')
484
+    },
485
+    compare(property) {
486
+      return function(a, b) {
487
+        var value1 = a[property]
488
+        var value2 = b[property]
489
+        return value1 - value2 //升序排序
490
+      }
491
+    },
492
+    getPage() {
493
+      this.page = 1
494
+      this.pageArr = []
495
+
496
+      this.advicePrint.map((item) => {
497
+        let arr = []
498
+        item.pageArr = []
499
+        if (item.advices.length <= 5) {
500
+          this.page = 1
501
+          arr.push(item.advices.length)
502
+          item.pageArr.push(arr)
503
+        } else if (item.advices.length > 5) {
504
+          this.page = parseInt(item.advices.length / 5)
505
+          let num = item.advices.length % 5
506
+          for (var i = 0; i < this.page; i++) {
507
+            item.pageArr.push([5])
508
+          }
509
+          if (num != 0) {
510
+            item.pageArr.push([num])
511
+          }
512
+        }
513
+      })
514
+      // console.log('this.pageArr',this.pageArr)
515
+    },
516
+    getName(list) {
517
+      console.log('list', list)
518
+      let new_list = []
519
+      for (let i = 0; i < list.length; i++) {
520
+        if (list[i].aac031 == '1') {
521
+          new_list.push(list[i])
522
+        }
523
+      }
524
+
525
+      switch (new_list[0].bcc334) {
526
+        case 'A31001':
527
+          return '深圳医保1档'
528
+          break
529
+        case 'A31002':
530
+          return '深圳医保2档'
531
+
532
+          break
533
+        case 'A31003':
534
+          return '深圳医保3档'
535
+
536
+          break
537
+        case 'A31004':
538
+          return '二档(少儿)'
539
+
540
+          break
541
+        case 'A31005':
542
+          return '学生二档'
543
+
544
+          break
545
+        case 'A31006':
546
+          return '大学生二档'
547
+
548
+          break
549
+        case 'A32001':
550
+          return '在职公务员'
551
+          break
552
+        case 'A32002':
553
+          return '在职驻深公务员'
554
+
555
+          break
556
+        case 'A39301':
557
+          return '家属统筹医疗'
558
+
559
+          break
560
+        case 'A41001':
561
+          return '工伤在职'
562
+
563
+          break
564
+        case 'A51001':
565
+          return '生育在职'
566
+
567
+          break
568
+        case 'A52001':
569
+          return '生育医疗一档'
570
+
571
+          break
572
+        case 'A52002':
573
+          return '生育医疗一档'
574
+
575
+          break
576
+        case 'C31001':
577
+          return '一档医疗退休'
578
+
579
+          break
580
+        case 'C31002':
581
+          return '二档医疗退休'
582
+          break
583
+      }
584
+    }
585
+  },
586
+  created() {
587
+    this.getAllDoctorList()
588
+    this.getInitData()
589
+    this.getPrescriptionPrint()
590
+    this.getHisPatientDetail()
591
+    this.getPatientCaseHistory()
592
+    var xtuser = this.$store.getters.xt_user
593
+    this.orgname = xtuser.org.org_name
594
+    this.org_id = this.$store.getters.xt_user.org_id
595
+  },
596
+  watch: {
597
+    ids: function(val) {
598
+      this.ids = val
599
+      this.getPrescriptionPrint()
600
+    }
601
+  }
602
+}
603
+</script>
604
+
605
+
606
+<style lang="scss" scoped>
607
+.prescription-print {
608
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
609
+  0 0 60px rgba(0, 0, 0, 0.06) inset;
610
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
611
+  0 0 40px rgba(0, 0, 0, 0.06) inset;
612
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
613
+  margin-bottom: 20px;
614
+  padding: 20px 10px;
615
+}
616
+
617
+.printTitle {
618
+  font-size: 22px;
619
+  text-align: center;
620
+  font-weight: bold;
621
+  margin-bottom: 10px;
622
+}
623
+
624
+.infoTitle {
625
+  display: flex;
626
+  margin-top: 10px;
627
+  line-height: 24px;
628
+}
629
+
630
+.infoTitle div {
631
+  width: 200px;
632
+}
633
+
634
+.infoMain {
635
+  display: flex;
636
+  flex-wrap: wrap;
637
+  margin-top: 10px;
638
+}
639
+
640
+.infoMain div {
641
+  width: 50%;
642
+  line-height: 24px;
643
+}
644
+
645
+.prescriptionBox {
646
+  padding: 0 10px;
647
+  min-height: 400px;
648
+}
649
+
650
+.Rp {
651
+  font-size: 22px;
652
+  font-weight: bold;
653
+}
654
+
655
+.drugsBox {
656
+  padding-left: 40px;
657
+  margin-bottom: 10px;
658
+}
659
+
660
+.drugsBox div {
661
+  line-height: 20px;
662
+}
663
+
664
+.drugsOne {
665
+  line-height: 24px;
666
+}
667
+
668
+.drugsOne span {
669
+  margin-right: 20px;
670
+}
671
+
672
+.doctorBox {
673
+  display: flex;
674
+  justify-content: space-between;
675
+  padding: 0 10px;
676
+  line-height: 24px;
677
+  border-bottom: 2px solid #000;
678
+}
679
+
680
+.actionBar {
681
+  display: flex;
682
+  justify-content: space-between;
683
+  line-height: 24px;
684
+  padding: 0 10px;
685
+}
686
+
687
+.actionBar p {
688
+  width: 150px;
689
+}
690
+
691
+.under_line {
692
+  display: inline-block;
693
+  border-bottom: 1px solid #000;
694
+  flex: 1;
695
+}
696
+</style>

+ 2 - 4
src/xt_pages/outpatientDoctorStation/pastInquiries.vue View File

@@ -426,7 +426,6 @@ export default {
426 426
         getBatchPrint(params).then((res) => {
427 427
           let Arr = res.data.data.patients
428 428
 
429
-
430 429
           let new_patients = []
431 430
           if (type != 3) {
432 431
 
@@ -476,12 +475,11 @@ export default {
476 475
             Arr.forEach((el) => {
477 476
               el.new_prescriptions.forEach((o) => {
478 477
                 o.project.forEach((i) => {
479
-                  if (i.team.project_team != '') {
480 478
                     new_patients.push(el)
481
-                  }
482 479
                 })
483 480
               })
484 481
             })
482
+
485 483
             let projectPrint = []
486 484
             new_patients.forEach((el) => {
487 485
               el.new_prescriptions.map((item) => {
@@ -513,7 +511,7 @@ export default {
513 511
       }
514 512
       this.innerVisible = true
515 513
     },
516
-    // 外层去重方
514
+    // // 外层去重方
517 515
     split_project(Arr) {
518 516
       let hash = {}
519 517
       let new_Arr = []

+ 19 - 20
src/xt_pages/outpatientDoctorStation/print.vue View File

@@ -1,26 +1,23 @@
1 1
 <template>
2 2
   <div>
3
-    <!-- <template>
4
-        <el-button
5
-          style="float:right;"
6
-          :loading="loading"
7
-          size="small"
8
-          icon="el-icon-printer"
9
-          @click="printThisPage"
10
-          type="primary"
11
-          >打印</el-button
12
-        >
13
-      </template> -->
14
-<!-- 机构id列表
15
-3877 :测试
16
-10138、10243:百霖
17
-0:本地
18
-9675:测试
19
- -->
20 3
     <div class="dialysisPage" style="padding-top: 40px">
21 4
       <div v-if="org_id != 10138 && org_id != 10278 && org_id != 10243">
22 5
 
23
-        <printOne v-if="org_id != 10088 && org_id != 10215" v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :doctorPorject="doctorPorject" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id"></printOne>
6
+        <printOne v-if="org_id != 10088 && org_id != 10215 && org_id != 10375 && org_id !=0" v-bind:childResponse="childResponse" 
7
+        :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" 
8
+        :doctorPorject="doctorPorject" :patient_id="patient_id" :record_date="record_date" 
9
+        :prescription_id="prescription_id"></printOne>
10
+        <prinSeven v-if="org_id == 10375 ||org_id ==0" 
11
+          v-bind:childResponse="childResponse"
12
+          :advicePrint="advicePrint"
13
+          :ids="ids"
14
+          :patient="patient"
15
+          :hisPatient="hisPatient"
16
+          :doctorPorject="doctorPorject"
17
+          :patient_id="patient_id"
18
+          :record_date="record_date"
19
+          :prescription_id="prescription_id">
20
+        </prinSeven>
24 21
 
25 22
         <printFour
26 23
           v-if="org_id == 10088"
@@ -89,6 +86,7 @@ import printThree from "./template/printThree";
89 86
 import printFour from "./template/printFour";
90 87
 import printFive from "./template/printFive";
91 88
 import printSix from "./template/printSix";
89
+import prinSeven from './template/prinSeven.vue'
92 90
 import {
93 91
   getAllDoctorList,
94 92
   getAllHisPatientList,
@@ -102,10 +100,11 @@ export default {
102 100
     printFour,
103 101
     printFive,
104 102
     printSix,
103
+    prinSeven
105 104
   },
106 105
   props: {
107 106
     paramsObj: Object,
108
-    newHisPatient:Object
107
+    newHisPatient:Object,
109 108
   },
110 109
   data() {
111 110
     return {
@@ -147,7 +146,7 @@ export default {
147 146
         }, 500);
148 147
       } else {
149 148
         const style =
150
-          "@media print {#prescription-print{font-size:14px;}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoTitle{display: flex;border-bottom: 2px solid #000;margin-top:10px;line-height: 1px; padding:0 10px;}.infoTitle p{width: 200px;font-size:14px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{padding:0 10px;min-height:450px;}.Rp{font-size: 22px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;} .drugsOne{line-height: 1px;} .drugsOne span{margin-right: 20px;} .doctorBox{display: flex; justify-content: space-between; padding:0 10px; line-height: 1px; border-bottom: 2px solid #000;} .actionBar{display: flex; justify-content: space-between; line-height: 1px; padding:0 10px;} .actionBar p{width:150px;}}";
149
+          "@media print {#prescription-print{font-size:14px;}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoTitle{display: flex;border-bottom: 2px solid #000;margin-top:10px;line-height: 1px; padding:0 10px;}.infoTitle p{width: 200px;font-size:14px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{padding:0 10px;min-height:450px;}.Rp{font-size: 22px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;position: relative;}.drugsBox div{line-height: 20px;width:80%} .drugsOne{line-height: 1px;} .drugsOne span{margin-right: 20px;} .doctorBox{display: flex; justify-content: space-between; padding:0 10px; line-height: 1px; border-bottom: 2px solid #000;} .actionBar{display: flex; justify-content: space-between; line-height: 1px; padding:0 10px;} .actionBar p{width:150px;}}";
151 150
         printJS({
152 151
           printable: "prescriptionPrint",
153 152
           type: "html",

+ 751 - 0
src/xt_pages/outpatientDoctorStation/template/prinSeven.vue View File

@@ -0,0 +1,751 @@
1
+<template>
2
+  <div id="prescriptionPrint">
3
+    <div v-for="(item, index) in advicePrint" :key="index">
4
+      <div
5
+        id="prescription-print"
6
+        class="prescription-print"
7
+        style="page-break-after: always;"
8
+      >
9
+        <div class="printTitle" v-if="prescriptions[index].med_type == '1111'">
10
+          {{ orgname }}第一类精神处方笺
11
+        </div>
12
+        <div class="printTitle" v-if="prescriptions[index].med_type == '1112'">
13
+          {{ orgname }}第二类精神处方笺
14
+        </div>
15
+        <div
16
+          class="printTitle"
17
+          v-if="
18
+            prescriptions[index].med_type != '1111' &&
19
+            prescriptions[index].med_type != '1112'
20
+          "
21
+        >
22
+          {{ orgname }}处方笺
23
+        </div>
24
+        <div >
25
+          <div class="infoTitle">
26
+            <p>姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
27
+            <p>
28
+              性别:
29
+              <span v-if="item.patient.gender == 1">男</span>
30
+              <span v-if="item.patient.gender == 2">女</span>
31
+            </p>
32
+            <p>年龄:{{ getAge(item.patient) ? getAge(item.patient) : "" }}岁</p>
33
+          </div>
34
+          <div class="infoMain">
35
+            <div style="margin-bottom: 10px">
36
+              门诊号:{{ hisPatient.number ? hisPatient.number : "" }}
37
+            </div>
38
+            <div style="margin-bottom: 10px">
39
+              科室:{{ item.info ? getDepart(item.info.departments) : "" }}
40
+            </div>
41
+            <div style="margin-bottom: 10px">
42
+              <!-- 医保卡号:{{ item.hisPatient.number ? item.hisPatient.number : "" }} -->
43
+              费别:{{getExpenseKindName(item.patient.expense_kind)}}
44
+            </div>
45
+            <div style="margin-bottom: 10px" v-if="org_id != 10188">
46
+              <!-- 电话:{{ item.patient.phone }} -->
47
+              开方日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}
48
+            </div>
49
+            <div style="margin-bottom: 10px" v-else>
50
+              日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}
51
+            </div>
52
+            <div>地址:{{ item.patient.home_address }}</div>
53
+            <div style="display: flex; width: 50%">
54
+              临床诊断:{{ getDiagnosis(item.info.diagnosis) }}
55
+            </div>
56
+          </div>
57
+        </div>
58
+          <div class="prescriptionBox" >
59
+            <div class="Rp">Rp:</div>
60
+            <div
61
+              class="drugsBox"
62
+              v-for="(it, index) in advicess" :key="index"
63
+              :style="{'page-break-after':index==yi&&item.advices.length>5? 'always':'auto'}"
64
+            >
65
+            <!-- class="drugsBox"  item.advices.length>=5 ? 'danzhang' : 'drugsBox'  :style="{'page-break-after':index==yi&&item.advices.length>3? 'always':'auto'}"-->
66
+              <!-- <div class="drugsOne"><span style="font-weight:bold;">{{ index+1 + '.' }}</span>{{it.advice_name?it.advice_name:""}}&nbsp;&nbsp;{{it.single_dose}}{{it.single_dose_unit}}&nbsp;×&nbsp; {{it.prescribing_number}}{{it.prescribing_number_unit}}</div> -->
67
+              <template v-if="index==yi+1&&item.advices.length>5">
68
+                <div style="margin: 20px 0px;">
69
+                  <div class="infoTitle">
70
+                    <p>姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
71
+                    <p>
72
+                      性别:
73
+                      <span v-if="item.patient.gender == 1">男</span>
74
+                      <span v-if="item.patient.gender == 2">女</span>
75
+                    </p>
76
+                    <p>年龄:{{ getAge(item.patient) ? getAge(item.patient) : "" }}岁</p>
77
+                  </div>
78
+                  <div class="infoMain">
79
+                    <div style="margin-bottom: 10px">
80
+                      门诊号:{{ hisPatient.number ? hisPatient.number : "" }}
81
+                    </div>
82
+                    <div style="margin-bottom: 10px">
83
+                      科室:{{ item.info ? getDepart(item.info.departments) : "" }}
84
+                    </div>
85
+                    <div style="margin-bottom: 10px">
86
+                      <!-- 医保卡号:{{ item.hisPatient.number ? item.hisPatient.number : "" }} -->
87
+                      费别:{{getExpenseKindName()}}
88
+                    </div>
89
+                    <div style="margin-bottom: 10px" v-if="org_id != 10188">
90
+                      <!-- 电话:{{ item.patient.phone }} -->
91
+                      开方日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}
92
+                    </div>
93
+                    <div style="margin-bottom: 10px" v-else>
94
+                      日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}
95
+                    </div>
96
+                    <div>地址:{{ item.patient.home_address }}</div>
97
+                    <div style="display: flex; width: 50%">
98
+                      临床诊断:{{ getDiagnosis(item.info.diagnosis) }}
99
+                    </div>
100
+                  </div>
101
+                </div>
102
+              </template>
103
+              <div style="position: relative;">
104
+                <div class="drugsOne" :style="{'border-right':arr.length>0 && arr[0][0].groupno==it.groupno ? '1px solid black' :'none','width':'80%'}">
105
+                  <span style="font-weight: bold" >
106
+                    {{ index + 1 + "." }}
107
+                  </span>
108
+                  {{ it.advice_name ? it.advice_name : "" }}&nbsp;&nbsp;
109
+                  <span v-if="it.drug.min_unit != it.drug.dose_unit">
110
+                    {{ it.drug.dose }}{{ it.drug.dose_unit }}&nbsp;* {{ it.drug.min_number }}{{ it.drug.min_unit }}/
111
+                    {{it.drug.max_unit}}
112
+                  </span>&nbsp;
113
+                  <div>
114
+                    <template v-if="arr.length>0 && arr[0][0].groupno==it.groupno">
115
+                      <div >
116
+                        <!--  v-for="(its,indexs) in arr" :key="indexs" -->
117
+                        <span style="margin-left: 38px;">{{arr[0][0].advice_name ? arr[0][0].advice_name : ""}}</span>&nbsp;&nbsp;
118
+                        <span v-if="arr[0][0].drug.min_unit != arr[0][0].drug.dose_unit">
119
+                          {{ arr[0][0].drug.dose }}{{ arr[0][0].drug.dose_unit }}&nbsp;* {{ arr[0][0].drug.min_number }}{{ arr[0][0].drug.min_unit }}/
120
+                          {{arr[0][0].drug.max_unit}}
121
+                        </span>&nbsp;
122
+                      </div>
123
+                      <div style="display: inline-block;position: absolute;left:87%;top:20px;margin-left: 10px;">
124
+                        &nbsp;共{{ arr[0][0].single_dose }}{{ arr[0][0].single_dose_unit }}
125
+                      </div>
126
+                    </template>
127
+                  </div>
128
+
129
+                  <div style="margin-left: 70px">
130
+                    用法:
131
+                    <span v-if="(arr.length>0 && arr[0][0].groupno!=it.groupno)||arr.length<0">{{ it.single_dose }}{{ it.single_dose_unit }}</span
132
+                    >&nbsp;&nbsp;<span
133
+                      >{{ it.execution_frequency }}&nbsp;{{
134
+                        it.delivery_way
135
+                      }}&nbsp;</span>&nbsp;&nbsp;<span>{{ it.advice_desc }}</span>
136
+                  </div>
137
+
138
+                </div>
139
+                <div style="display: inline-block;position: absolute;left:80%;bottom:0px;margin-left: 10px;" v-if="arr.length>0 && arr[0][0].groupno==it.groupno">
140
+                  ×&nbsp;{{ it.prescribing_number}}
141
+                </div>
142
+                <div style="display: inline-block;position: absolute;left:87%;top:0px;margin-left: 10px;" v-if="arr.length>0 && arr[0][0].groupno==it.groupno">
143
+                  <!-- &nbsp;共{{ it.prescribing_number}}{{ it.prescribing_number_unit }} -->
144
+                  &nbsp;共{{ it.single_dose }}{{ it.single_dose_unit }}
145
+                </div>
146
+              </div>
147
+              <template v-if="index==yi&&item.advices.length>5">
148
+                <div style="margin: 20px 0px;">
149
+                  <div  style="border-bottom: 2px solid #000; width: 100%;margin-right: 30px;padding: 0 10px;line-height: 24px;" >
150
+                    <p style="text-align: right;">医师:{{ item.doctor ? item.doctor : "" }}</p>
151
+                  </div>
152
+
153
+                  <div class="actionBar" >
154
+                    <!-- <p>审核:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
155
+                          <p>配对:</p>
156
+                          <p>核对:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
157
+                          <p>发药:{{getDoctor(item.advices[0].execution_staff)?getDoctor(item.advices[0].execution_staff):""}}</p>
158
+                          <p>药费:{{getTotalOne(item.id)?getTotalOne(item.id):0}}元</p> -->
159
+
160
+                    <p>审核:</p>
161
+                    <p>配对:</p>
162
+                    <p>核对:</p>
163
+                    <p>发药:</p>
164
+                    <p>
165
+                      金额:{{
166
+                        getTotalOne(item.id).toFixed(2)
167
+                          ? getTotalOne(item.id).toFixed(2)
168
+                          : 0
169
+                      }}元
170
+                    </p>
171
+
172
+                  </div>
173
+                  <div class="actionBar" style="margin-bottom: 10px;">
174
+                    <p style="width:300px;">大额处方患者意见:
175
+                      <el-radio v-model="radio" label="1">同意</el-radio>
176
+                      <el-radio v-model="radio" label="2">不同意</el-radio>
177
+                    </p>
178
+                    <p>收费员:</p>
179
+                  </div>
180
+                  <div style="padding: 0px 10px;">
181
+                    <p >患者签名:</p>
182
+                  </div>
183
+                </div>
184
+              </template>
185
+            </div>
186
+
187
+            <div
188
+              class="drugsBox"
189
+              v-for="(it, i) in item.additionalcharge"
190
+              :key="i"
191
+            >
192
+              <div class="drugsOne">
193
+                {{ it.item_name ? it.item_name : "" }}:&nbsp;{{ it.price }}元/{{
194
+                  it.count
195
+                }}次
196
+              </div>
197
+            </div>
198
+
199
+            <div
200
+              class="drugsBox"
201
+              v-for="(it, index) in item.project"
202
+              :key="index"
203
+            >
204
+              <div class="drugsOne">
205
+                <span style="font-weight: bold">{{ index + 1 + "." }}</span
206
+                >{{
207
+                  it.type == 2
208
+                    ? getProjectName(it.project_id)
209
+                      ? getProjectName(it.project_id)
210
+                      : ""
211
+                    : it.good_info.good_name
212
+                }}&nbsp;&nbsp;{{ it.single_dose
213
+                }}{{ it.single_dose_unit }}&nbsp;×&nbsp; {{ it.count }}{{ unit }}
214
+              </div>
215
+              <div style="margin-left: 100px">
216
+                <span>用法:{{ it.single_dose }}{{ it.single_dose_unit }}</span
217
+                >&nbsp;&nbsp;<span>{{ it.delivery_way }}</span
218
+                >&nbsp;&nbsp;<span>{{ it.advice_desc }}</span>
219
+              </div>
220
+            </div>
221
+
222
+            <div
223
+              class="drugsBox"
224
+              v-for="(it, i) in item.additionalcharge"
225
+              :key="i"
226
+            >
227
+              <div class="drugsOne">
228
+                {{ it.project_id ? it.project_id : "" }}:&nbsp;{{
229
+                  it.price.toFixed(2)
230
+                }}元/{{ it.count }}次
231
+              </div>
232
+            </div>
233
+            <div style="text-align: center">(以下空白)</div>
234
+          </div>
235
+
236
+          <!-- <div class="doctorBox" v-if="org_id != 10188 && org_id != 0">
237
+            <p v-if="org_id == 10217 || org_id == 0">
238
+              医师:
239
+              <span
240
+                style="width: 100px; display: inline-block"
241
+                v-if="item.creator == ''"
242
+              >
243
+                {{ item.doctor }}
244
+              </span>
245
+              <span
246
+                style="width: 100px; display: inline-block"
247
+                v-else-if="doc_name != ''"
248
+              >
249
+                {{ doc_name }}
250
+              </span>
251
+              <img
252
+                style="height: 50px;"
253
+                :src="setAdminUserES(item.creator,item.doctor)"
254
+                alt=""
255
+                srcset=""
256
+
257
+              />
258
+            </p>
259
+            <p v-else>
260
+              医师: {{ item.doctor ? item.doctor : "" }}
261
+            </p>
262
+            <p>日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}</p>
263
+          </div> -->
264
+          <div  style="border-bottom: 2px solid #000; width: 100%;margin-right: 30px;padding: 0 10px;line-height: 24px;" >
265
+            <p style="text-align: right;">医师:{{ item.doctor ? item.doctor : "" }}</p>
266
+          </div>
267
+
268
+          <div class="actionBar" >
269
+            <!-- <p>审核:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
270
+                  <p>配对:</p>
271
+                  <p>核对:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</p>
272
+                  <p>发药:{{getDoctor(item.advices[0].execution_staff)?getDoctor(item.advices[0].execution_staff):""}}</p>
273
+                  <p>药费:{{getTotalOne(item.id)?getTotalOne(item.id):0}}元</p> -->
274
+
275
+            <p>审核:</p>
276
+            <p>配对:</p>
277
+            <p>核对:</p>
278
+            <p>发药:</p>
279
+            <p>
280
+              金额:{{
281
+                getTotalOne(item.id).toFixed(2)
282
+                  ? getTotalOne(item.id).toFixed(2)
283
+                  : 0
284
+              }}元
285
+            </p>
286
+
287
+          </div>
288
+          <div class="actionBar" style="margin-bottom: 10px;">
289
+            <p style="width:300px;">大额处方患者意见:
290
+              <el-radio v-model="radio" label="1">同意</el-radio>
291
+              <el-radio v-model="radio" label="2">不同意</el-radio>
292
+            </p>
293
+            <p>收费员:</p>
294
+          </div>
295
+          <div style="padding: 0px 10px;">
296
+            <p >患者签名:</p>
297
+          </div>
298
+
299
+          <!-- <div class="actionBar" v-else>
300
+            <p >审核、调配:</p>
301
+            <p >核对、发药:</p>
302
+            <p >
303
+              药费:{{
304
+                getTotalOne(item.id).toFixed(2)
305
+                  ? getTotalOne(item.id).toFixed(2)
306
+                  : 0
307
+              }}元
308
+            </p>
309
+
310
+          </div> -->
311
+        <!-- </div> -->
312
+      </div>
313
+    </div>
314
+  </div>
315
+</template>
316
+<script>
317
+import { jsGetAge, uParseTime } from "@/utils/tools";
318
+import {
319
+  getAllDoctorList,
320
+  getPrescriptionPrint,
321
+  getHisPatientDetail,
322
+} from "@/api/project/project";
323
+import { getInitData } from "@/api/his/his";
324
+export default{
325
+  props: {
326
+    patient_id: Number,
327
+    record_date: String,
328
+    prescription_id: Number,
329
+    ids: String,
330
+  },
331
+  data() {
332
+    return {
333
+      doc_name:"",
334
+      doctorList: [],
335
+      advicePrint: {},
336
+      yi:4,
337
+      radio:'',
338
+      arr:[],
339
+      advicess:[],
340
+      page:sessionStorage.getItem('dayin'),
341
+      patient: {},
342
+      tableData: [],
343
+      prescriptionInfo: [],
344
+      hisPatient: {},
345
+      department: [],
346
+      prescriptions: [],
347
+      projectList: [],
348
+      orgname: "",
349
+      diagnoses: [],
350
+      org_id: 0,
351
+      operatorMaps: {},
352
+      operators: [],
353
+      doctorList_1: [],
354
+      expenseOptions: [
355
+        { id: 1, name: "基本医保" },
356
+        { id: 2, name: "新农合" },
357
+        { id: 3, name: "自费医疗" },
358
+        { id: 4, name: "公费医疗" },
359
+        { id: 5, name: "商业保险" },
360
+        { id: 6, name: "军队医疗" },
361
+        { id: 7, name: "其他" },
362
+      ],
363
+    };
364
+  },
365
+  methods: {
366
+    getExpenseKindName(id){
367
+      for(let i = 0; i < this.expenseOptions.length; i++){
368
+        if(id == this.expenseOptions[i].id){
369
+          return this.expenseOptions[i].name
370
+        }
371
+      }
372
+
373
+
374
+
375
+    },
376
+    // 电子签名
377
+    setAdminUserES(id,name) {
378
+      console.log(id)
379
+      console.log(name)
380
+      console.log(this.operatorMaps)
381
+
382
+
383
+      if (id == 0) {
384
+        return "";
385
+      }
386
+      if (id in this.operatorMaps) {
387
+        return this.operatorMaps[id].url;
388
+      } else {
389
+        this.doc_name = name
390
+        return "";
391
+      }
392
+    },
393
+    getAge(patient) {
394
+      if(patient.id_card_no == "TWN001836483"){
395
+        return patient.age
396
+      }else{
397
+        var thisLen = patient.id_card_no.length;
398
+        var birth = "";
399
+        if (thisLen == 15) {
400
+          birth = "19" + patient.id_card_no.substr(6, 6);
401
+        } else {
402
+          birth = patient.id_card_no.substr(6, 8);
403
+        }
404
+        var births =
405
+          birth.substr(0, 4) +
406
+          "-" +
407
+          birth.substr(4, 2) +
408
+          "-" +
409
+          birth.substr(6, 2);
410
+        return jsGetAge(births, "-");
411
+
412
+      }
413
+
414
+    },
415
+
416
+    getAllDoctorList() {
417
+      getAllDoctorList().then((response) => {
418
+        if (response.data.state == 1) {
419
+          var doctor = response.data.data.doctor;
420
+
421
+          this.doctorList = doctor;
422
+        }
423
+      });
424
+    },
425
+
426
+    getDoctor(id) {
427
+      var name = "";
428
+      for (let i = 0; i < this.doctorList.length; i++) {
429
+        if (id == this.doctorList[i].admin_user_id) {
430
+          name = this.doctorList[i].user_name;
431
+        }
432
+      }
433
+      return name;
434
+    },
435
+    getTime(value, temp) {
436
+      if (value != undefined) {
437
+        return uParseTime(value, temp);
438
+      }
439
+      return "";
440
+    },
441
+    getPrescriptionPrint() {
442
+      var params = {
443
+        // patient_id:this.patient_id,
444
+        // record_date:this.record_date,
445
+        // prescription_id:this.prescription_id,
446
+        patient_id: this.patient_id,
447
+        record_date: this.record_date,
448
+        prescription_id: this.prescription_id,
449
+        ids: this.ids,
450
+        p_type: 2,
451
+      };
452
+      console.log("params", params);
453
+      getPrescriptionPrint(params).then((response) => {
454
+        if (response.data.state == 1) {
455
+          var advicePrint = response.data.data.advicePrint;
456
+          console.log("adviceprint9999", advicePrint);
457
+          this.advicePrint = advicePrint;
458
+          this.prescriptions = advicePrint;
459
+
460
+          this.doctorList_1 = response.data.data.eles;
461
+         for(let i=0;i<this.advicePrint.length;i++){
462
+          this.advicess=advicePrint[i].advices
463
+         }
464
+         for(let j=0;j<this.advicess.length;j++){
465
+            for(let x=j+1;x<this.advicess.length;x++){
466
+              if(this.advicess[j].groupno == this.advicess[x].groupno){
467
+                this.arr.push(this.advicess.splice(x,1))
468
+                // this.arrs=this.advicess.splice(x,1)
469
+              }
470
+            }
471
+          }
472
+        // this.merge(this.advicess)
473
+          // console.log('4444444',this.arrs);
474
+         console.log('55555555',this.arr);
475
+         console.log('6666666',this.advicess);
476
+          console.log(this.doctorList_1, "医生列表");
477
+          if (this.doctorList_1.length > 0) {
478
+            var operatorsLen = this.doctorList_1.length;
479
+            for (var index = 0; index < operatorsLen; index++) {
480
+              this.$set(
481
+                this.operatorMaps,
482
+                this.doctorList_1[index].creator,
483
+                this.doctorList_1[index]
484
+              );
485
+            }
486
+          }
487
+
488
+          console.log("处方222222", this.prescriptions);
489
+          var hisPatient = response.data.data.hisPatient;
490
+          console.log("hisPatient", hisPatient);
491
+          this.hisPatient = hisPatient;
492
+          var projectlist = response.data.data.projectlist;
493
+          console.log("所有项目列表", projectlist);
494
+          this.projectList = projectlist;
495
+        }
496
+      });
497
+    },
498
+    getHisPatientDetail() {
499
+      const params = {
500
+        patient_id: this.patient_id,
501
+      };
502
+      getHisPatientDetail(params).then((response) => {
503
+        if (response.data.state == 1) {
504
+          var hisPatient = response.data.data.hisPatient;
505
+          console.log("挂号病人", hisPatient);
506
+          this.hisPatient = hisPatient;
507
+        }
508
+      });
509
+    },
510
+    getInitData() {
511
+      getInitData().then((response) => {
512
+        if (response.data.state == 1) {
513
+          this.department = response.data.data.department;
514
+          this.diagnoses = response.data.data.diagnose;
515
+          console.log("争端", this.diagnoses);
516
+        }
517
+      });
518
+    },
519
+    getDepart(id) {
520
+      var name = "";
521
+      for (let i = 0; i < this.department.length; i++) {
522
+        if (id == this.department[i].id) {
523
+          name = this.department[i].name;
524
+        }
525
+      }
526
+      return name;
527
+    },
528
+    getTotalOne(id) {
529
+      var total = 0;
530
+      var addtotal = 0;
531
+      for (let i = 0; i < this.prescriptions.length; i++) {
532
+        if (id == this.prescriptions[i].id) {
533
+          if (this.prescriptions[i].project != null) {
534
+            for (let a = 0; a < this.prescriptions[i].project.length; a++) {
535
+              total =
536
+                total +
537
+                this.prescriptions[i].project[a].price *
538
+                  this.prescriptions[i].project[a].count;
539
+            }
540
+          }
541
+
542
+          if (this.prescriptions[i].additionalcharge != null) {
543
+            for (
544
+              let a = 0;
545
+              a < this.prescriptions[i].additionalcharge.length;
546
+              a++
547
+            ) {
548
+              addtotal =
549
+                addtotal +
550
+                this.prescriptions[i].additionalcharge[a].price *
551
+                  this.prescriptions[i].additionalcharge[a].count;
552
+            }
553
+          }
554
+          addtotal = Math.floor(addtotal * 100) / 100;
555
+        }
556
+      }
557
+
558
+      for (let i = 0; i < this.prescriptions.length; i++) {
559
+        if (id == this.prescriptions[i].id) {
560
+          if (this.prescriptions[i].advices != null) {
561
+            for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
562
+              total =
563
+                total +
564
+                this.prescriptions[i].advices[a].price *
565
+                  this.prescriptions[i].advices[a].prescribing_number;
566
+            }
567
+          }
568
+
569
+          if (this.prescriptions[i].additionalcharge != null) {
570
+            for (
571
+              let a = 0;
572
+              a < this.prescriptions[i].additionalcharge.length;
573
+              a++
574
+            ) {
575
+              addtotal =
576
+                addtotal +
577
+                this.prescriptions[i].additionalcharge[a].price *
578
+                  this.prescriptions[i].additionalcharge[a].count;
579
+            }
580
+          }
581
+          addtotal = Math.floor(addtotal * 100) / 100;
582
+        }
583
+      }
584
+
585
+      return total + addtotal;
586
+    },
587
+
588
+    getProjectName(id) {
589
+      var project_name = "";
590
+      for (let i = 0; i < this.projectList.length; i++) {
591
+        if (id == this.projectList[i].id) {
592
+          project_name = this.projectList[i].project_name;
593
+        }
594
+      }
595
+      return project_name;
596
+    },
597
+
598
+    getDiagnosis(id) {
599
+      let arr = id.split(",");
600
+      var name = "";
601
+      for (let i = 0; i < this.diagnoses.length; i++) {
602
+        if (arr.indexOf(String(this.diagnoses[i].id)) > -1) {
603
+          name += this.diagnoses[i].class_name + " ";
604
+        }
605
+      }
606
+      return name;
607
+    },
608
+    merge(arrA){
609
+      var len=arrA.lenfth
610
+      // for(let j=0;j<this.advicess.length;j++){
611
+      //   for(let x=j+1;x<this.advicess.length;x++){
612
+      //     if(this.advicess[j].groupno == this.advicess[x].groupno){
613
+      //       // this.arr.push(this.advicess.splice(x,1))
614
+      //       this.arrs=this.advicess.splice(x,1)
615
+      //     }
616
+      //   }
617
+      // }
618
+      for(let j=0;j<len;j++){
619
+        for(let x=j+1;x<len;x++){
620
+          if(arrA[j].groupno == arrA[x].groupno){
621
+            this.arr.push(arrA.splice(x,1))
622
+          }
623
+        }
624
+      }
625
+      console.log('777777777',this.arr);
626
+      return this.arr
627
+    }
628
+  },
629
+  created() {
630
+    this.getAllDoctorList();
631
+    this.getInitData();
632
+    this.getPrescriptionPrint();
633
+    this.getHisPatientDetail();
634
+    var xtuser = this.$store.getters.xt_user;
635
+    this.orgname = xtuser.org.org_name;
636
+    this.org_id = xtuser.org.id;
637
+
638
+    // for(let j=0;j<this.advicess.length;j++){
639
+    //   console.log('44444444');
640
+    //   for(let x=j+1;x<this.advicess.length;x++){
641
+    //     if(this.advicess[j].groupno == this.advicess[x].groupno){
642
+    //       this.arr.push(this.advicess.splice(x,1))
643
+    //     }
644
+    //   }
645
+    // }
646
+    // console.log('777777777',this.arr[0].advice_name);
647
+    // return this.arr
648
+
649
+  },
650
+
651
+  watch: {
652
+    ids: function (val) {
653
+      this.ids = val;
654
+      this.getPrescriptionPrint();
655
+    },
656
+  },
657
+};
658
+</script>
659
+
660
+
661
+<style lang="scss" scoped>
662
+.prescription-print {
663
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
664
+    0 0 60px rgba(0, 0, 0, 0.06) inset;
665
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
666
+    0 0 40px rgba(0, 0, 0, 0.06) inset;
667
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
668
+  margin-bottom: 20px;
669
+  padding: 20px 10px;
670
+}
671
+.printTitle {
672
+  font-size: 22px;
673
+  text-align: center;
674
+  font-weight: bold;
675
+}
676
+.infoTitle {
677
+  display: flex;
678
+  border-top: 2px solid #000;
679
+  margin-top: 10px;
680
+  line-height: 24px;
681
+  padding: 0 10px;
682
+}
683
+.infoTitle p {
684
+  width: 200px;
685
+}
686
+.infoMain {
687
+  display: flex;
688
+  flex-wrap: wrap;
689
+  border-bottom: 2px solid #000;
690
+  padding: 0 10px;
691
+}
692
+.infoMain div {
693
+  width: 50%;
694
+  line-height: 24px;
695
+}
696
+.prescriptionBox {
697
+  padding: 0 10px;
698
+  min-height: 450px;
699
+}
700
+.Rp {
701
+  font-size: 22px;
702
+  font-weight: bold;
703
+}
704
+.drugsBox {
705
+  padding-left: 40px;
706
+  margin-bottom: 10px;
707
+  position: relative;
708
+}
709
+.drugsBox div {
710
+  line-height: 20px;
711
+}
712
+.drugsOne {
713
+  line-height: 24px;
714
+  display: inline-block;
715
+  width: 80%;
716
+}
717
+.drugsOne span {
718
+  margin-right: 20px;
719
+}
720
+.doctorBox {
721
+  display: flex;
722
+  justify-content: space-between;
723
+  padding: 0 10px;
724
+  line-height: 24px;
725
+  border-bottom: 2px solid #000;
726
+}
727
+.doctorBoxs{
728
+  width: 100%;
729
+  margin-right: 30px;
730
+  text-align: right;
731
+  padding: 0 10px;
732
+  line-height: 24px;
733
+
734
+}
735
+.doctorBoxtwo {
736
+  display: flex;
737
+  justify-content: space-between;
738
+  padding: 0 10px;
739
+  line-height: 24px;
740
+
741
+}
742
+.actionBar {
743
+  display: flex;
744
+  justify-content: space-between;
745
+  line-height: 24px;
746
+  padding: 0 10px;
747
+}
748
+.actionBar p {
749
+  width: 150px;
750
+}
751
+</style>

+ 13 - 0
src/xt_pages/outpatientTool/components/batchPrint.vue View File

@@ -0,0 +1,13 @@
1
+<template>
2
+
3
+</template>
4
+
5
+<script>
6
+export default {
7
+  name: 'batchPrint'
8
+}
9
+</script>
10
+
11
+<style scoped>
12
+
13
+</style>

+ 33 - 0
src/xt_pages/outpatientTool/components/detail.vue View File

@@ -255,6 +255,9 @@ export default {
255 255
           let tempData = response.data.data.patients
256 256
           let data = response.data.data.patients
257 257
           let orders = this.unique(tempData)
258
+
259
+          let order_infos = []
260
+
258 261
           for (let i = 0; i < orders.length; i++) {
259 262
             let obj = {
260 263
               patient_id: orders[i].id,
@@ -276,6 +279,7 @@ export default {
276 279
               order_info: []
277 280
             }
278 281
             let orders = tempPatients[i].orders
282
+
279 283
             for (let b = 0; b < orders.length; b++) {
280 284
               for (let c = 0; c < orders[b].order_info.length; c++) {
281 285
                 let newObj = {}
@@ -314,6 +318,7 @@ export default {
314 318
                   }
315 319
                 }
316 320
                 obj.order_info.push(newObj)
321
+                order_infos.push(orders[b].order_info)
317 322
               }
318 323
             }
319 324
             tempPatientsTwo.push(obj)
@@ -437,8 +442,36 @@ export default {
437 442
 
438 443
           // console.log(tempPatientsTwo.length)
439 444
           //
445
+          console.log(order_infos)
446
+          let advices = []
447
+          let projects = []
448
+          let goods = []
449
+          for(let i = 0; i < order_infos.length; i++){
450
+            console.log(order_infos[i])
451
+            if(order_infos[i].advice_id > 0 && order_infos[i].project_id == 0){
452
+              advices.push(order_infos[i].advice)
453
+            }
454
+            if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
455
+              if(order_infos[i].project.type == 3){
456
+                goods.push(order_infos[i].project)
457
+              }
458
+            }
459
+            if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
460
+              if(order_infos[i].project.type == 2){
461
+                projects.push(order_infos[i].project)
462
+              }
463
+            }
464
+          }
465
+
466
+          console.log(advices)
467
+          console.log(projects)
468
+          console.log(goods)
440 469
 
441 470
         }
471
+
472
+
473
+
474
+
442 475
         //
443 476
         // console.log('去重前')
444 477
         // console.log(advice)

+ 206 - 26
src/xt_pages/outpatientTool/components/settle.vue View File

@@ -49,7 +49,7 @@
49 49
               <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
50 50
           </div>
51 51
       </div>
52
-      <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="report-table"
52
+      <el-table :data="tableData" border :row-style="{ color: '#303133' }"
53 53
                 :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
54 54
                 show-summary
55 55
                 v-loading="settle_loading"
@@ -94,73 +94,96 @@
94 94
                   <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
95 95
                   <div v-if="scope.row.med_type == '11'">普通门诊</div>
96 96
                   <div v-if="scope.row.med_type == '1112'">普通门诊</div>
97
-                
97
+
98 98
               </template>
99 99
           </el-table-column>
100
-          <el-table-column align="center" prop="item_name" label="医疗费总额">
100
+          <el-table-column align="center" prop="medfee_sumamt" label="医疗费总额">
101 101
               <template slot-scope="scope">{{scope.row.medfee_sumamt.toFixed(2)}}</template>
102 102
           </el-table-column>
103
-          <el-table-column align="center" prop="item_name" label="基金支付金额">
103
+          <el-table-column align="center" prop="fund_pay_sumamt" label="基金支付金额">
104 104
               <template slot-scope="scope">{{scope.row.fund_pay_sumamt.toFixed(2)}}</template>
105 105
           </el-table-column>
106
-          <el-table-column align="center" prop="item_name" label="个人账户支付金额">
106
+          <el-table-column align="center" prop="acct_pay" label="个人账户支付金额">
107 107
               <template slot-scope="scope">{{scope.row.acct_pay.toFixed(2)}}</template>
108 108
           </el-table-column>
109
-          <el-table-column align="center" prop="item_name" label="个人支付金额">
109
+          <el-table-column align="center" prop="psn_cash_pay" label="个人支付金额">
110 110
               <template slot-scope="scope">{{scope.row.psn_cash_pay.toFixed(2)}}</template>
111 111
           </el-table-column>
112
-          <el-table-column align="center" prop="item_name" label="基金统筹金额">
112
+          <el-table-column align="center" prop="hifp_pay" label="基金统筹金额">
113 113
               <template slot-scope="scope">{{scope.row.hifp_pay.toFixed(2)}}</template>
114 114
           </el-table-column>
115 115
 
116
-          <el-table-column align="center" prop="item_name" label="大额基金支付">
116
+          <el-table-column align="center" prop="hifob_pay" label="大额基金支付">
117 117
               <template slot-scope="scope">{{scope.row.hifob_pay.toFixed(2)}}</template>
118 118
           </el-table-column>
119 119
 
120 120
 
121
-          <el-table-column align="center" prop="item_name" label="医疗救助基金">
121
+          <el-table-column align="center" prop="maf_pay" label="医疗救助基金">
122 122
               <template slot-scope="scope">{{scope.row.maf_pay.toFixed(2)}}</template>
123 123
           </el-table-column>
124 124
 
125
-          <el-table-column align="center" prop="item_name" label="企业补充医疗保险基金支出">
125
+          <el-table-column align="center" prop="hifes_pay" label="企业补充医疗保险基金支出">
126 126
               <template slot-scope="scope">{{scope.row.hifes_pay.toFixed(2)}}</template>
127 127
           </el-table-column>
128 128
 
129 129
 
130
-          <el-table-column align="center" prop="item_name" label="居民大病保险资金支出">
130
+          <el-table-column align="center" prop="hifmi_pay" label="居民大病保险资金支出">
131 131
               <template slot-scope="scope">{{scope.row.hifmi_pay.toFixed(2)}}</template>
132 132
           </el-table-column>
133 133
 
134
-        <el-table-column align="center" prop="item_name" label="其他支付">
134
+        <el-table-column align="center" prop="oth_pay" label="其他支付">
135 135
           <template slot-scope="scope">{{scope.row.oth_pay.toFixed(2)}}</template>
136 136
         </el-table-column>
137 137
 
138
-        <el-table-column align="center" prop="item_name" label="公务员医疗补助资金支出">
138
+        <el-table-column align="center" prop="cvlserv_pay" label="公务员医疗补助资金支出">
139 139
           <template slot-scope="scope">{{scope.row.cvlserv_pay.toFixed(2)}}</template>
140 140
         </el-table-column>
141 141
 
142
-        <el-table-column align="center" prop="item_name" label="微信支付">
143
-          <template slot-scope="scope">{{scope.row.wechat_pay}}</template>
142
+        <el-table-column align="center" prop="wechat_pay" label="微信支付">
143
+          <template slot-scope="scope" style="width: 100px">
144
+            <el-input v-model="scope.row.wechat_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
145
+            <el-button size="small" @click="change(scope.row.id,scope.row.wechat_pay,'wechat_pay')">修改</el-button>
146
+          </template>
144 147
         </el-table-column>
145 148
 
146
-        <el-table-column align="center" prop="item_name" label="支付宝支付">
147
-          <template slot-scope="scope">{{scope.row.ali_pay}}</template>
149
+        <el-table-column align="center" prop="ali_pay" label="支付宝支付">
150
+<!--          <template slot-scope="scope">{{scope.row.ali_pay}}</template>-->
151
+          <template slot-scope="scope" style="width: 100px">
152
+            <el-input  v-model="scope.row.ali_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
153
+            <el-button size="small" @click="change(scope.row.id,scope.row.ali_pay,'ali_pay')">修改</el-button>
154
+          </template>
148 155
         </el-table-column>
149 156
 
150
-        <el-table-column align="center" prop="item_name" label="银行卡支付">
151
-          <template slot-scope="scope">{{scope.row.band_card_pay}}</template>
157
+        <el-table-column align="center" prop="band_card_pay" label="银行卡支付">
158
+<!--          <template slot-scope="scope">{{scope.row.band_card_pay}}</template>-->
159
+          <template slot-scope="scope" style="width: 100px">
160
+            <el-input v-model="scope.row.band_card_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
161
+            <el-button size="small" @click="change(scope.row.id,scope.row.band_card_pay,'band_card_pay')">修改</el-button>
162
+          </template>
152 163
         </el-table-column>
153 164
 
154
-        <el-table-column align="center" prop="item_name" label="积分支付">
155
-          <template slot-scope="scope">{{scope.row.jifen_pay}}</template>
165
+        <el-table-column align="center" prop="jifen_pay" label="积分支付">
166
+<!--          <template slot-scope="scope">{{scope.row.jifen_pay}}</template>-->
167
+          <template slot-scope="scope" style="width: 100px">
168
+            <el-input v-model="scope.row.jifen_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
169
+            <el-button size="small" @click="change(scope.row.id,scope.row.jifen_pay,'jifen_pay')">修改</el-button>
170
+          </template>
156 171
         </el-table-column>
157 172
 
158
-        <el-table-column align="center" prop="item_name" label="现金支付">
159
-          <template slot-scope="scope">{{scope.row.cash_pay}}</template>
173
+        <el-table-column align="center" prop="cash_pay" label="现金支付">
174
+<!--          <template slot-scope="scope">{{scope.row.cash_pay}}</template>-->
175
+          <template slot-scope="scope" style="width: 100px">
176
+            <el-input v-model="scope.row.cash_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>
177
+            <el-button size="small" @click="change(scope.row.id,scope.row.cash_pay,'cash_pay')">修改</el-button>
178
+          </template>
160 179
         </el-table-column>
161 180
 
162 181
         <el-table-column align="center" prop="item_name" label="其他说明">
163
-          <template slot-scope="scope">{{scope.row.oth_desc}}</template>
182
+<!--          <template slot-scope="scope">{{scope.row.oth_desc}}</template>-->
183
+          <template slot-scope="scope" style="width: 100px">
184
+            <el-input v-model="scope.row.oth_desc"></el-input>
185
+            <el-button size="small" @click="change(scope.row.id,scope.row.oth_desc,'oth_desc')">修改</el-button>
186
+          </template>
164 187
         </el-table-column>
165 188
 
166 189
           <el-table-column align="center" prop="total" label="费用总额">
@@ -170,13 +193,155 @@
170 193
           </el-table-column>
171 194
 
172 195
       </el-table>
196
+
197
+    <el-table ref="report-table" :data="tableData" v-show="false" border :row-style="{ color: '#303133' }"
198
+              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
199
+              show-summary
200
+              v-loading="settle_loading"
201
+              max-height="600"
202
+              :span-method="merge"
203
+              :summary-method="getTotal"
204
+              highlight-current-row>
205
+
206
+      <el-table-column align="center" prop="name" label="患者名字">
207
+        <template slot-scope="scope">{{ scope.row.other_name }}</template>
208
+      </el-table-column>
209
+      <el-table-column align="center" prop="item_name" label="身份证">
210
+        <template slot-scope="scope">
211
+          {{scope.row.id_card_no}}
212
+        </template>
213
+      </el-table-column>
214
+      <el-table-column align="center" prop="item_name" label="就诊号">
215
+        <template slot-scope="scope">
216
+          {{scope.row.mdtrt_id}}
217
+        </template>
218
+      </el-table-column>
219
+      <el-table-column align="center" prop="item_name" label="治疗日期">
220
+        <template slot-scope="scope">
221
+          {{getTimes(scope.row.settle_accounts_date)}}
222
+        </template>
223
+      </el-table-column>
224
+
225
+      <el-table-column align="center" prop="item_name" label="结算日期">
226
+        <template slot-scope="scope">
227
+          {{scope.row.setl_time?scope.row.setl_time.split(" ")[0]:getTimes(scope.row.settle_accounts_date)}}
228
+        </template>
229
+      </el-table-column>
230
+
231
+      <el-table-column align="center" prop="item_name" label="结算类型">
232
+        <template slot-scope="scope">
233
+          <div v-if="scope.row.is_medicine_insurance == 0">自费</div>
234
+          <div v-if="scope.row.is_medicine_insurance == 1">医保</div>
235
+        </template>
236
+      </el-table-column>
237
+      <el-table-column align="center" prop="item_name" label="处方类型">
238
+        <template slot-scope="scope">
239
+          <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
240
+          <div v-if="scope.row.med_type == '11'">普通门诊</div>
241
+          <div v-if="scope.row.med_type == '1112'">普通门诊</div>
242
+
243
+        </template>
244
+      </el-table-column>
245
+      <el-table-column align="center" prop="medfee_sumamt" label="医疗费总额">
246
+        <template slot-scope="scope">{{scope.row.medfee_sumamt.toFixed(2)}}</template>
247
+      </el-table-column>
248
+      <el-table-column align="center" prop="fund_pay_sumamt" label="基金支付金额">
249
+        <template slot-scope="scope">{{scope.row.fund_pay_sumamt.toFixed(2)}}</template>
250
+      </el-table-column>
251
+      <el-table-column align="center" prop="acct_pay" label="个人账户支付金额">
252
+        <template slot-scope="scope">{{scope.row.acct_pay.toFixed(2)}}</template>
253
+      </el-table-column>
254
+      <el-table-column align="center" prop="psn_cash_pay" label="个人支付金额">
255
+        <template slot-scope="scope">{{scope.row.psn_cash_pay.toFixed(2)}}</template>
256
+      </el-table-column>
257
+      <el-table-column align="center" prop="hifp_pay" label="基金统筹金额">
258
+        <template slot-scope="scope">{{scope.row.hifp_pay.toFixed(2)}}</template>
259
+      </el-table-column>
260
+
261
+      <el-table-column align="center" prop="hifob_pay" label="大额基金支付">
262
+        <template slot-scope="scope">{{scope.row.hifob_pay.toFixed(2)}}</template>
263
+      </el-table-column>
264
+
265
+
266
+      <el-table-column align="center" prop="maf_pay" label="医疗救助基金">
267
+        <template slot-scope="scope">{{scope.row.maf_pay.toFixed(2)}}</template>
268
+      </el-table-column>
269
+
270
+      <el-table-column align="center" prop="hifes_pay" label="企业补充医疗保险基金支出">
271
+        <template slot-scope="scope">{{scope.row.hifes_pay.toFixed(2)}}</template>
272
+      </el-table-column>
273
+
274
+
275
+      <el-table-column align="center" prop="hifmi_pay" label="居民大病保险资金支出">
276
+        <template slot-scope="scope">{{scope.row.hifmi_pay.toFixed(2)}}</template>
277
+      </el-table-column>
278
+
279
+      <el-table-column align="center" prop="oth_pay" label="其他支付">
280
+        <template slot-scope="scope">{{scope.row.oth_pay.toFixed(2)}}</template>
281
+      </el-table-column>
282
+
283
+      <el-table-column align="center" prop="cvlserv_pay" label="公务员医疗补助资金支出">
284
+        <template slot-scope="scope">{{scope.row.cvlserv_pay.toFixed(2)}}</template>
285
+      </el-table-column>
286
+
287
+      <el-table-column align="center" prop="wechat_pay" label="微信支付">
288
+        <template slot-scope="scope">{{scope.row.wechat_pay}}</template>
289
+
290
+<!--        <template slot-scope="scope" style="width: 100px">-->
291
+<!--          <el-input v-model="scope.row.wechat_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
292
+<!--        </template>-->
293
+      </el-table-column>
294
+
295
+      <el-table-column align="center" prop="ali_pay" label="支付宝支付">
296
+                  <template slot-scope="scope">{{scope.row.ali_pay}}</template>
297
+<!--        <template slot-scope="scope" style="width: 100px">-->
298
+<!--          <el-input  v-model="scope.row.ali_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
299
+<!--        </template>-->
300
+      </el-table-column>
301
+
302
+      <el-table-column align="center" prop="band_card_pay" label="银行卡支付">
303
+                  <template slot-scope="scope">{{scope.row.band_card_pay}}</template>
304
+<!--        <template slot-scope="scope" style="width: 100px">-->
305
+<!--          <el-input v-model="scope.row.band_card_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
306
+<!--        </template>-->
307
+      </el-table-column>
308
+
309
+      <el-table-column align="center" prop="jifen_pay" label="积分支付">
310
+                  <template slot-scope="scope">{{scope.row.jifen_pay}}</template>
311
+<!--        <template slot-scope="scope" style="width: 100px">-->
312
+<!--          <el-input v-model="scope.row.jifen_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
313
+<!--        </template>-->
314
+      </el-table-column>
315
+
316
+      <el-table-column align="center" prop="cash_pay" label="现金支付">
317
+                  <template slot-scope="scope">{{scope.row.cash_pay}}</template>
318
+<!--        <template slot-scope="scope" style="width: 100px">-->
319
+<!--          <el-input v-model="scope.row.cash_pay" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input>-->
320
+<!--        </template>-->
321
+      </el-table-column>
322
+
323
+      <el-table-column align="center" prop="item_name" label="其他说明">
324
+                  <template slot-scope="scope">{{scope.row.oth_desc}}</template>
325
+<!--        <template slot-scope="scope" style="width: 100px">-->
326
+<!--          <el-input v-model="scope.row.oth_desc"></el-input>-->
327
+<!--        </template>-->
328
+      </el-table-column>
329
+
330
+      <el-table-column align="center" prop="total" label="费用总额">
331
+        <template slot-scope="scope">
332
+          <div>{{scope.row.total.toFixed(2)}}</div>
333
+        </template>
334
+      </el-table-column>
335
+
336
+    </el-table>
337
+
173 338
   </div>
174 339
 </template>
175 340
 
176 341
 
177 342
 <script>
178 343
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
179
-import { GetSummarySettle } from '@/api/his/his'
344
+import { GetSummarySettle,changeOrderDesc } from '@/api/his/his'
180 345
 import { uParseTime } from '@/utils/tools'
181 346
 // import NewStatementPrint from './newStatementPrint'
182 347
   const moment = require('moment')
@@ -208,6 +373,20 @@ import { uParseTime } from '@/utils/tools'
208 373
       }
209 374
     },
210 375
     methods: {
376
+      change(id,desc,type){
377
+        let params = {
378
+          id: id,
379
+          desc: desc,
380
+          change_type: type
381
+        }
382
+        changeOrderDesc(params).then(response => {
383
+          if (response.data.state == 0) {
384
+            this.$message.error(response.data.msg)
385
+          } else {
386
+            this.$message.success(response.data.data.msg)
387
+          }
388
+        })
389
+      },
211 390
       getTimes(time) {
212 391
         return uParseTime(time, '{y}-{m}-{d}')
213 392
       },
@@ -269,6 +448,7 @@ import { uParseTime } from '@/utils/tools'
269 448
               for (let b = 0; b < data[i].orders.length; b++) {
270 449
                 let order = data[i].orders[b]
271 450
                 order['other_name'] = data[i].name
451
+                order['id'] = order.id
272 452
                 order['id_card_no'] = data[i].id_card_no
273 453
                 order['mdtrt_id'] =order.mdtrt_id
274 454
 
@@ -381,7 +561,7 @@ import { uParseTime } from '@/utils/tools'
381 561
           }
382 562
           console.log(data)
383 563
           const values = data.map(item => Number(item[column.property]))
384
-          if (column.property === 'total') {
564
+          if (column.property === 'total' || column.property === 'medfee_sumamt'  || column.property === 'fund_pay_sumamt'  || column.property === 'acct_pay'  || column.property === 'maf_pay'  || column.property === 'psn_cash_pay'  || column.property === 'hifp_pay'  || column.property === 'hifob_pay' ||  column.property === 'hifes_pay' || column.property === 'hifmi_pay' || column.property === 'oth_pay' || column.property === 'cvlserv_pay' || column.property === 'wechat_pay' || column.property === 'ali_pay' || column.property === 'band_card_pay' || column.property === 'jifen_pay' || column.property === 'cash_pay') {
385 565
             sums[index] = values.reduce((prev, curr) => {
386 566
               const value = Number(curr)
387 567
               if (!isNaN(value)) {

+ 46 - 7
src/xt_pages/outpatientTool/labelPrint.vue View File

@@ -44,11 +44,11 @@
44 44
                         :value="item.id">
45 45
                       </el-option>
46 46
                     </el-select>
47
-
47
+                  <el-button @click="printThree()">批量打印</el-button>
48 48
                   <el-checkbox v-model="is_combination_print">是否组合打印</el-checkbox>
49 49
 
50
-<!--                  <el-checkbox v-model="is_combination_print">是否组合打印</el-checkbox>-->
51
-                  <el-button v-if="!is_combination_print" @click="printTwo()">组合打印</el-button>
50
+<!--                  <el-checkbox @click="printTwo()">批量打印</el-checkbox>-->
51
+                  <el-button v-if="!is_combination_print && $store.getters.xt_user.org.id == 10138" @click="printTwo()">组合打印</el-button>
52 52
 
53 53
                 </div>
54 54
             </div>
@@ -134,7 +134,7 @@
134 134
                               <div>{{getTime(current_ctime,'{m}-{d}')}}</div>
135 135
                               <div>{{getTime(current_ctime,'{h}:{i}')}}</div>
136 136
                           </div>
137
-                          <img  v-if="$store.getters.xt_user.org.id != 0 &&  $store.getters.xt_user.org.id != 10138" style="width:300px;height:200px;margin-left:10px;" id="barcode">
137
+                          <img  v-if=" $store.getters.xt_user.org.id != 10138"  id="barcode">
138 138
                       </div>
139 139
                       <div style="margin-bottom:5px;">{{current_number}}</div>
140 140
                       <div style="display:flex;">
@@ -148,6 +148,39 @@
148 148
                 <el-button type="primary" @click="labelVisible = false">确 定</el-button>
149 149
             </div>
150 150
         </el-dialog>
151
+
152
+
153
+      <el-dialog title="批量打印" :visible.sync="batchLabelVisible">
154
+        <div>
155
+          <el-row style="float:right;">
156
+            <el-col :span="24">
157
+              <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印
158
+              </el-button>
159
+            </el-col>
160
+          </el-row>
161
+            <div id="sign" class="signPrint">
162
+              <div v-for="item in selecting_schs">
163
+               <div style="display:flex;margin-bottom:10px;" >
164
+              <div style="margin-left:15px;">
165
+                <div style="font-weight:bold;font-size:24px;">C</div>
166
+                <div>{{getTime(item.ctime,'{m}-{d}')}}</div>
167
+                <div>{{getTime(item.ctime,'{h}:{i}')}}</div>
168
+              </div>
169
+              <img  v-if=" $store.getters.xt_user.org.id != 10138"  id="barcode">
170
+            </div>
171
+                <div style="margin-bottom:5px;">{{item.number}}</div>
172
+               <div style="display:flex;">
173
+              <div style="font-size:24px;padding-left:20px;">{{item.project_name}}</div>
174
+              <div style="font-size:24px;margin-left:20px;">{{item.patient_name}}</div>
175
+              </div>
176
+              </div>
177
+          </div>
178
+        </div>
179
+        <div slot="footer" class="dialog-footer">
180
+          <el-button @click="batchLabelVisible = false">取 消</el-button>
181
+<!--          <el-button type="primary" @click="labelVisible = false">确 定</el-button>-->
182
+        </div>
183
+      </el-dialog>
151 184
     </div>
152 185
 
153 186
 </template>
@@ -201,11 +234,16 @@
201 234
         items: [
202 235
           { id: 1, name: '已打印' },
203 236
           { id: 2, name: '未打印' }
204
-        ]
237
+        ],
238
+        batchLabelVisible:false,
239
+
205 240
 
206 241
       }
207 242
     },
208 243
     methods: {
244
+      printThree(){
245
+      this.batchLabelVisible = true
246
+      },
209 247
       printTwo(){
210 248
         if(this.selecting_schs.length == 0){
211 249
           this.$message.error("请选择需要组合打印的记录")
@@ -287,8 +325,9 @@
287 325
                     lineColor: '#000',
288 326
                     background: '#EBEEF5',
289 327
                     width: 3,
290
-                    height: 200,
291
-                    displayValue: false,
328
+                    height: 100,
329
+                    displayValue: true,
330
+                    text:response.data.data.labels.id,
292 331
                     fontOptions:"bold italic",//使文字加粗体或变斜体
293 332
                     font:"fantasy",//设置文本的字体
294 333
                     textAlign:"left",//设置文本的水平对齐方式