Przeglądaj źródła

Merge branch '20230223_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20230223_pc_vue_new_branch

28169 1 rok temu
rodzic
commit
22a2e05343
2 zmienionych plików z 403 dodań i 28 usunięć
  1. 41 0
      src/api/his/his.js
  2. 362 28
      src/xt_pages/outpatientTool/labelPrint.vue

+ 41 - 0
src/api/his/his.js Wyświetl plik

780
 }
780
 }
781
 
781
 
782
 
782
 
783
+export function getColorTubeLablePrints(params){
784
+  return request({
785
+    url:"/api/his/inspectionlisttwo/get",
786
+    method:"get",
787
+    params:params
788
+  })
789
+}
790
+
791
+
792
+
793
+export function handleTeamData(params){
794
+  return request({
795
+    url:"/handleTeamData",
796
+    method:"get",
797
+    params:params
798
+  })
799
+}
800
+
801
+
802
+
803
+export function createPrintLable(params){
804
+  return request({
805
+    url:"/api/his/label/create",
806
+    method:"get",
807
+    params:params
808
+  })
809
+}
810
+
811
+
812
+export function getPrintLable(params){
813
+  return request({
814
+    url:"/api/his/label/get",
815
+    method:"get",
816
+    params:params
817
+  })
818
+}
819
+
820
+
821
+
822
+
823
+
783
 
824
 

+ 362 - 28
src/xt_pages/outpatientTool/labelPrint.vue Wyświetl plik

44
                         :value="item.id">
44
                         :value="item.id">
45
                       </el-option>
45
                       </el-option>
46
                     </el-select>
46
                     </el-select>
47
+
48
+                  <el-checkbox v-model="is_combination_print">是否组合打印</el-checkbox>
49
+
47
                 </div>
50
                 </div>
48
             </div>
51
             </div>
49
-            <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="table"
52
+            <el-table :data="isShow?tableData:tableDataTwo" border :row-style="{ color: '#303133' }" ref="table"
50
                       :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
53
                       :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
51
                       highlight-current-row>
54
                       highlight-current-row>
52
 
55
 
58
                     <template slot-scope="scope">{{scope.row.number}}</template>
61
                     <template slot-scope="scope">{{scope.row.number}}</template>
59
                 </el-table-column>
62
                 </el-table-column>
60
                 <el-table-column align="center" prop="name" label="创建时间">
63
                 <el-table-column align="center" prop="name" label="创建时间">
61
-                    <template slot-scope="scope">{{getTime(scope.row.record_date, '{y}-{m}-{d}')}}</template>
64
+                    <template slot-scope="scope">
65
+                      <div v-if="isShow">{{getTime(scope.row.record_date, '{y}-{m}-{d}')}}</div>
66
+                      <div v-if="!isShow">{{scope.row.record_date}}</div>
67
+                    </template>
62
                 </el-table-column>
68
                 </el-table-column>
63
                 <el-table-column align="center" prop="name" label="创建医生">
69
                 <el-table-column align="center" prop="name" label="创建医生">
64
                     <template slot-scope="scope">{{scope.row.doctor_name}}</template>
70
                     <template slot-scope="scope">{{scope.row.doctor_name}}</template>
92
 
98
 
93
 
99
 
94
             </el-table>
100
             </el-table>
101
+
102
+<!--          <el-table  :data="tableDataTwo" border :row-style="{ color: '#303133' }" ref="table"-->
103
+<!--                    :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"-->
104
+<!--                    highlight-current-row>-->
105
+
106
+<!--            <el-table-column align="center" prop="name" label="患者名字">-->
107
+<!--              <template slot-scope="scope">{{ scope.row.patient_name }}</template>-->
108
+<!--            </el-table-column>-->
109
+
110
+<!--            <el-table-column align="center" prop="name" label="创建时间">-->
111
+<!--              <template slot-scope="scope">{{scope.row.record_date)}}</template>-->
112
+<!--            </el-table-column>-->
113
+<!--&lt;!&ndash;            <el-table-column align="center" prop="name" label="创建医生">&ndash;&gt;-->
114
+<!--&lt;!&ndash;              <template slot-scope="scope">{{scope.row.doctor_name}}</template>&ndash;&gt;-->
115
+<!--&lt;!&ndash;            </el-table-column>&ndash;&gt;-->
116
+<!--            <el-table-column align="center" prop="name" label="项目名称">-->
117
+<!--              <template slot-scope="scope">-->
118
+<!--                <div>{{scope.row.project_name}}</div>-->
119
+<!--              </template>-->
120
+<!--            </el-table-column>-->
121
+
122
+<!--            <el-table-column-->
123
+<!--              align="center"-->
124
+<!--              label="操作"-->
125
+<!--              width="180"-->
126
+<!--              class-name="small-padding fixed-width"-->
127
+<!--            >-->
128
+<!--              <template slot-scope="scope">-->
129
+<!--                <el-tooltip class="item" effect="dark" content="打印" placement="top">-->
130
+<!--                  <el-button-->
131
+<!--                    type="primary"-->
132
+<!--                    size="small"-->
133
+<!--                    icon="el-icon-printer"-->
134
+<!--                    @click="Print(scope.row, scope.$index)"-->
135
+<!--                  >-->
136
+
137
+<!--                    &lt;!&ndash; icon="el-icon-edit-outline" &ndash;&gt;-->
138
+<!--                  </el-button>-->
139
+<!--                </el-tooltip>-->
140
+<!--              </template>-->
141
+<!--            </el-table-column>-->
142
+
143
+
144
+<!--          </el-table>-->
145
+
95
             <el-pagination
146
             <el-pagination
147
+              v-if="isShow"
96
                     @size-change="handleSizeChange"
148
                     @size-change="handleSizeChange"
97
                     @current-change="handleCurrentChange"
149
                     @current-change="handleCurrentChange"
98
                     :page-sizes="[10, 50, 100]"
150
                     :page-sizes="[10, 50, 100]"
141
 
193
 
142
 <script>
194
 <script>
143
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
195
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
144
-  import { GetLabelList } from '@/api/his/his'
196
+  import { GetLabelList,getColorTubeLablePrints,createPrintLable,getPrintLable } from '@/api/his/his'
145
   import { uParseTime } from '@/utils/tools'
197
   import { uParseTime } from '@/utils/tools'
146
   import SignPrint from '../dialysis/signPrint'
198
   import SignPrint from '../dialysis/signPrint'
147
   import JsBarcode from 'jsbarcode'
199
   import JsBarcode from 'jsbarcode'
156
     },
208
     },
157
     data() {
209
     data() {
158
       return {
210
       return {
211
+        isShow:true,
159
         tube_color:"0",
212
         tube_color:"0",
213
+        tube_color_two:"0",
214
+        is_combination_print:false,
160
         current_ctime: 0,
215
         current_ctime: 0,
161
         current_number: '',
216
         current_number: '',
162
         current_project_name: '',
217
         current_project_name: '',
177
         sameRowArr: [],
232
         sameRowArr: [],
178
         keywords: '',
233
         keywords: '',
179
         tableData: [],
234
         tableData: [],
235
+        tableDataTwo: [],
236
+        current_params:{},
180
         chargeDate: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
237
         chargeDate: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
181
         item_type: '0',
238
         item_type: '0',
182
         items: [
239
         items: [
200
           style: style,
257
           style: style,
201
           scanStyles: false
258
           scanStyles: false
202
         })
259
         })
260
+        // createPrintLable(this.current_params).then(response => {
261
+        //   if (response.data.state == 0) {
262
+        //     this.$message.error(response.data.msg)
263
+        //     return false
264
+        //   } else {
265
+        //     const style = '@media print { .sign{width:960px;margin: 0 auto;text-align: center;border-collapse: collapse;}.order_title_panl {text-align: center;.main_title {font-size: 18px;line-height: 40px;font-weight: 500;}}.dialysisTable tr{padding: 10px 0;}.dialysisTable th {color: #000;padding: 0;margin: 0;height: 30px;}.dialysisTable tr td {padding: 12px 0;}.subadvice_content {text-align: left;padding-left: 25px !important;padding-right: 5px !important;}.advice_content {text-align: left;padding-left: 5px !important;padding-right: 5px !important;padding: 15px 5px !important;} }'
266
+        //     printJS({
267
+        //       printable: 'sign',
268
+        //       type: 'html',
269
+        //       documentTitle: '  ',
270
+        //       style: style,
271
+        //       scanStyles: false
272
+        //     })
273
+        //   }
274
+        // })
203
       },
275
       },
204
       getTime(value, temp) {
276
       getTime(value, temp) {
205
         if (value != undefined) {
277
         if (value != undefined) {
208
         return ''
280
         return ''
209
       },
281
       },
210
       Print(row, index) {
282
       Print(row, index) {
211
-        this.labelVisible = true
212
-        this.current_ctime = row.ctime
213
-        this.current_number = row.number
214
-        this.current_project_name = row.project_name
215
-        this.current_name = row.patient_name
216
-        this.$nextTick(() => {
217
-          JsBarcode('#barcode',row.id, {
218
-            format: 'CODE39',
219
-            lineColor: '#000',
220
-            background: '#EBEEF5',
221
-            width: 3,
222
-            height: 200,
223
-            displayValue: false,
224
-            fontOptions:"bold italic",//使文字加粗体或变斜体
225
-            font:"fantasy",//设置文本的字体
226
-            textAlign:"left",//设置文本的水平对齐方式
227
-            textPosition:"top",//设置文本的垂直位置
228
-            textMargin:5,//设置条形码和文本之间的间距
229
-            fontSize:15,//设置文本的大小
230
-            margin:15//设置条形码周围的空白边距
231
-          })
232
-
233
-        });
283
+        let params = {
284
+          patient_id: row.patient_id,
285
+          ids: row.ids,
286
+          record_date:this.chargeDate,
287
+        }
288
+        getPrintLable(params).then(response => {
289
+          if (response.data.state == 0) {
290
+            this.$message.error(response.data.msg)
291
+            return false
292
+          } else {
293
+            this.labelVisible = true
294
+            if(response.data.data.labels.id > 0){
295
+              this.current_ctime = row.ctime
296
+              this.current_number = row.number
297
+              this.current_project_name = row.project_name
298
+              this.current_name = row.patient_name
299
+              this.$nextTick(() => {
300
+                JsBarcode('#barcode',response.data.data.labels.id, {
301
+                  format: 'CODE39',
302
+                  lineColor: '#000',
303
+                  background: '#EBEEF5',
304
+                  width: 3,
305
+                  height: 200,
306
+                  displayValue: false,
307
+                  fontOptions:"bold italic",//使文字加粗体或变斜体
308
+                  font:"fantasy",//设置文本的字体
309
+                  textAlign:"left",//设置文本的水平对齐方式
310
+                  textPosition:"top",//设置文本的垂直位置
311
+                  textMargin:5,//设置条形码和文本之间的间距
312
+                  fontSize:15,//设置文本的大小
313
+                  margin:15//设置条形码周围的空白边距
314
+                })
315
+              });
316
+
317
+            }else{
318
+              let params = {
319
+                is_combination_print:this.is_combination_print,
320
+                patient_id: row.patient_id,
321
+                ids: row.ids,
322
+                team_ids: row.team_ids,
323
+                project_ids:row.project_ids,
324
+                doctor_id:row.doctor_id,
325
+                is_team:0,
326
+                record_date:this.chargeDate,
327
+              }
328
+              this.current_params = params
329
+              console.log(this.current_params)
330
+              if(!this.current_params.is_combination_print){
331
+                if(this.current_params.project_ids.toString().length > 0 && this.current_params.team_ids.toString().length == 0){
332
+                  this.current_params.is_team = 0
333
+                }else if(this.current_params.project_ids.toString().length == 0 && this.current_params.team_ids.toString().length > 0){
334
+                  this.current_params.is_team= 1
335
+                }
336
+              }else{
337
+                this.current_params.is_team = 0
338
+
339
+              }
340
+
341
+
342
+              if(!this.isShow){
343
+                createPrintLable(this.current_params).then(response => {
344
+                  if (response.data.state == 0) {
345
+                    this.$message.error(response.data.msg)
346
+                    return false
347
+                  } else {
348
+                    this.current_ctime = row.ctime
349
+                    this.current_number = row.number
350
+                    this.current_project_name = row.project_name
351
+                    this.current_name = row.patient_name
352
+                    this.$nextTick(() => {
353
+                      JsBarcode('#barcode',response.data.data.hlpsi.id, {
354
+                        format: 'CODE39',
355
+                        lineColor: '#000',
356
+                        background: '#EBEEF5',
357
+                        width: 3,
358
+                        height: 200,
359
+                        displayValue: false,
360
+                        fontOptions:"bold italic",//使文字加粗体或变斜体
361
+                        font:"fantasy",//设置文本的字体
362
+                        textAlign:"left",//设置文本的水平对齐方式
363
+                        textPosition:"top",//设置文本的垂直位置
364
+                        textMargin:5,//设置条形码和文本之间的间距
365
+                        fontSize:15,//设置文本的大小
366
+                        margin:15//设置条形码周围的空白边距
367
+                      })
234
 
368
 
369
+                    });
370
+                  }
371
+                })
372
+
373
+              }else{
374
+                createPrintLable(this.current_params).then(response => {
375
+                  if (response.data.state == 0) {
376
+                    this.$message.error(response.data.msg)
377
+                    return false
378
+                  } else {
379
+                    this.current_ctime = row.ctime
380
+                    this.current_number = row.number
381
+                    this.current_project_name = row.project_name
382
+                    this.current_name = row.patient_name
383
+                    this.$nextTick(() => {
384
+                      JsBarcode('#barcode',response.data.data.hlpsi.id, {
385
+                        format: 'CODE39',
386
+                        lineColor: '#000',
387
+                        background: '#EBEEF5',
388
+                        width: 5,
389
+                        height: 300,
390
+                        displayValue: false,
391
+                        fontOptions:"bold italic",//使文字加粗体或变斜体
392
+                        font:"fantasy",//设置文本的字体
393
+                        textAlign:"left",//设置文本的水平对齐方式
394
+                        textPosition:"top",//设置文本的垂直位置
395
+                        textMargin:5,//设置条形码和文本之间的间距
396
+                        fontSize:15,//设置文本的大小
397
+                        margin:15//设置条形码周围的空白边距
398
+                      })
399
+
400
+                    });
401
+                  }
402
+                })
403
+
404
+              }
405
+            }
406
+          }
407
+        })
235
       },
408
       },
236
       handleCurrentChange(page) {
409
       handleCurrentChange(page) {
410
+        this.isShow = true
411
+        this.is_combination_print =false
412
+
237
         this.page = page
413
         this.page = page
238
         this.getList()
414
         this.getList()
239
 
415
 
240
       },
416
       },
241
 
417
 
242
       handleSizeChange(limit) {
418
       handleSizeChange(limit) {
419
+        this.isShow = true
420
+        this.is_combination_print =false
421
+
243
         this.limit = limit
422
         this.limit = limit
244
         this.getList()
423
         this.getList()
245
 
424
 
248
       changeDate() {
427
       changeDate() {
249
         this.page = 1
428
         this.page = 1
250
         this.limit = 10
429
         this.limit = 10
430
+        this.isShow = true
431
+        this.is_combination_print =false
432
+
251
         this.getList()
433
         this.getList()
252
       },changeItemTwo(){
434
       },changeItemTwo(){
435
+        this.isShow = true
436
+        this.is_combination_print =false
253
         this.page = 1
437
         this.page = 1
254
         this.limit = 10
438
         this.limit = 10
255
         this.getList()
439
         this.getList()
256
       },
440
       },
257
       changeItem() {
441
       changeItem() {
442
+        this.isShow = true
443
+        this.is_combination_print =false
444
+
258
         this.page = 1
445
         this.page = 1
259
         this.limit = 10
446
         this.limit = 10
260
         this.getList()
447
         this.getList()
261
       },
448
       },
262
       searchAction() {
449
       searchAction() {
450
+        this.isShow = true
451
+        this.is_combination_print =false
263
         this.page = 1
452
         this.page = 1
264
         this.limit = 10
453
         this.limit = 10
265
         this.getList()
454
         this.getList()
275
         }
464
         }
276
         GetLabelList(params).then(response => {
465
         GetLabelList(params).then(response => {
277
           if (response.data.state == 0) {
466
           if (response.data.state == 0) {
278
-
279
             this.$message.error(response.data.msg)
467
             this.$message.error(response.data.msg)
280
             return false
468
             return false
281
           } else {
469
           } else {
282
-
283
             this.tableData = response.data.data.labels
470
             this.tableData = response.data.data.labels
284
             this.total = response.data.data.total
471
             this.total = response.data.data.total
285
 
472
 
473
+
474
+            for(var i = 0; i <  this.tableData.length; i++){
475
+              this.tableData[i]["ids"] =  this.tableData[i].id
476
+              if( this.tableData[i].team.id > 0 ){
477
+                this.tableData[i]["project_ids"] = ""
478
+                this.tableData[i]["team_ids"] =  this.tableData[i].team.id
479
+
480
+
481
+              }
482
+              if( this.tableData[i].team.id == 0 ){
483
+                this.tableData[i]["project_ids"] =  this.tableData[i].project_id
484
+                this.tableData[i]["team_ids"] = ""
485
+              }
486
+            }
487
+
488
+
286
           }
489
           }
287
 
490
 
288
         })
491
         })
492
+      }, unique(array) {
493
+        // res用来存储结果
494
+        var res = []
495
+        for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
496
+          for (var j = 0, resLen = res.length; j < resLen; j++) {
497
+            if (array[i].patient_id === res[j].patient_id && array[i].tube_color === res[j].tube_color) {
498
+              break
499
+            }
500
+          }
501
+          // 如果array[i]是唯一的,那么执行完循环,j等于resLen
502
+          if (j === resLen) {
503
+            res.push(array[i])
504
+          }
505
+        }
506
+        return res
507
+      },
508
+      getListTwo() {
509
+        let params = {
510
+          record_date: this.chargeDate,
511
+          is_print: this.item_type,
512
+          keyword: this.keywords,
513
+          page: this.page,
514
+          limit: this.limit,
515
+          tube_color:this.tube_color_two,
516
+        }
517
+        getColorTubeLablePrints(params).then(response => {
518
+          if (response.data.state == 0) {
519
+            this.$message.error(response.data.msg)
520
+            return false
521
+          } else {
522
+            this.tableDataTwo = []
523
+            var tableDataOne = [] //有设置试管颜色的数组
524
+            var tableDataTwo = [] //没有设置试管颜色的数组
525
+            for(let i = 0; i < response.data.data.labels.length; i++){
526
+              if(response.data.data.labels[i].team.tube_color == 0){
527
+                tableDataTwo.push(response.data.data.labels[i])
528
+              }
529
+            }
530
+            for(let i = 0; i < response.data.data.labels.length; i++){
531
+              if(response.data.data.labels[i].team.tube_color > 0){
532
+                tableDataOne.push(response.data.data.labels[i])
533
+              }
534
+            }
535
+
536
+            for(var i = 0; i < tableDataTwo.length; i++){
537
+              tableDataTwo[i]["ids"] = tableDataTwo[i].id
538
+              if(tableDataTwo[i].team.id > 0 ){
539
+                tableDataTwo[i]["team_ids"] = tableDataTwo[i].team.id
540
+                tableDataTwo[i]["project_ids"] = ""
541
+
542
+              }else if(tableDataTwo[i].team.id == 0 ){
543
+                tableDataTwo[i]["team_ids"] = ""
544
+                tableDataTwo[i]["project_ids"] = tableDataTwo[i].project_id
545
+
546
+              }
547
+            }
548
+            var patients = []
549
+            for(var i = 0; i < tableDataOne.length; i++){
550
+              let obj = {
551
+                patient_id:tableDataOne[i].patient_id,
552
+                patient_name:tableDataOne[i].patient_name,
553
+                tube_color: tableDataOne[i].team.tube_color,
554
+              }
555
+              patients.push(obj)
556
+            }
557
+            patients = this.unique(patients)
558
+            for(let b = 0; b < patients.length; b++){
559
+              var obj = {
560
+                patient_id:patients[b].patient_id,
561
+                patient_name:patients[b].patient_name,
562
+                tube_color:patients[b].tube_color,
563
+                record_date:"",
564
+                doctor:"",
565
+                project_name:"",
566
+                ids:"",
567
+                project_ids:"",
568
+                team_ids:"",
569
+              }
570
+              for(let c = 0; c < tableDataOne.length;c++){
571
+                if(patients[b].patient_id == tableDataOne[c].patient_id && patients[b].tube_color == tableDataOne[c].team.tube_color){
572
+                  obj["number"] = tableDataOne[c].number
573
+                  obj["team"] = tableDataOne[c].team
574
+                  obj.record_date = this.getTime(tableDataOne[c].record_date,'{y}-{m}-{d}')
575
+                  if(obj.project_name.length == 0){
576
+                    obj.project_name = tableDataOne[c].project_name
577
+                  }else{
578
+                    obj.project_name =  obj.project_name +"," + tableDataOne[c].project_name
579
+                  }
580
+                  if (obj.ids.length == 0) {
581
+                    obj.ids = tableDataOne[c].id
582
+                  } else {
583
+                    obj.ids = obj.ids + "-" + tableDataOne[c].id
584
+                  }
585
+
586
+                  if(obj.team.id > 0) {
587
+                    if (obj.team_ids.length == 0) {
588
+                      obj.team_ids = tableDataOne[c].team.id
589
+                    } else {
590
+                      obj.team_ids = obj.team_ids + "-" + tableDataOne[c].team.id
591
+                    }
592
+                  }else if(obj.team.id == 0) {
593
+                    if(obj.project_ids.length == 0){
594
+                      obj.project_ids = tableDataOne[c].project_id
595
+                    }else{
596
+                      obj.project_ids =  obj.project_ids +"-" + tableDataOne[c].project_id
597
+                    }
598
+                  }
599
+                }
600
+              }
601
+              this.tableDataTwo.push(obj)
602
+            }
603
+            console.log(this.tableDataTwo)
604
+            this.tableDataTwo =  this.tableDataTwo.concat(tableDataTwo)
605
+            console.log(this.tableDataTwo)
606
+            this.total = response.data.data.total
607
+          }
608
+        })
289
       }
609
       }
610
+
290
     },
611
     },
291
     created() {
612
     created() {
292
       this.getList()
613
       this.getList()
293
 
614
 
294
     }, mounted() {
615
     }, mounted() {
295
 
616
 
617
+    },watch:{
618
+      is_combination_print:function(){
619
+        if(this.is_combination_print){
620
+          this.isShow = false
621
+          this.getListTwo()
622
+        }else{
623
+          this.isShow = true
624
+
625
+        }
626
+
627
+
628
+      }
629
+
296
     }
630
     }
297
   }
631
   }
298
 </script>
632
 </script>