Kaynağa Gözat

12月10 结算单

yq1 4 ay önce
ebeveyn
işleme
e2dbda91b8

+ 51 - 70
src/xt_pages/dialysis/batch_print/batch_print_order_sixty.vue Dosyayı Görüntüle

@@ -372,7 +372,7 @@
372 372
                       class="row"
373 373
                       style="padding: 2px 0; line-height: 23px; display: flex"
374 374
                     >
375
-                      <div class="inline_block">
375
+                      <div class="inline_block" style="flex: 1;">
376 376
                         血管通路:
377 377
                         <div
378 378
                           class="under_line"
@@ -401,7 +401,7 @@
401 401
                         内瘘:
402 402
                         <div
403 403
                           class="under_line"
404
-                          style="width: 120px; text-align: center"
404
+                          style="width: 80%; text-align: center"
405 405
                         >
406 406
                           {{
407 407
                             record.assessment_before_dislysis &&
@@ -415,12 +415,12 @@
415 415
 
416 416
                       <div
417 417
                         class="inline_block"
418
-                        style="margin-left: 10px; flex: 1"
418
+                        style="flex: 1"
419 419
                       >
420 420
                         导管:
421 421
                         <div
422 422
                           class="under_line"
423
-                          style="width: 120px; text-align: center"
423
+                          style="width: 80%; text-align: center"
424 424
                         >
425 425
                           {{
426 426
                             record.assessment_before_dislysis &&
@@ -1041,33 +1041,7 @@
1041 1041
                           class="under_line"
1042 1042
                           style="width: 150px; text-align: center"
1043 1043
                         >
1044
-                          <span v-if="record.prescription.anticoagulant == 0"
1045
-                            >&nbsp;/</span
1046
-                          >
1047
-                          <span v-if="record.prescription.anticoagulant == 1"
1048
-                            >&nbsp;无肝素</span
1049
-                          >
1050
-                          <span v-if="record.prescription.anticoagulant == 2"
1051
-                            >&nbsp;普通肝素</span
1052
-                          >
1053
-                          <span v-if="record.prescription.anticoagulant == 3"
1054
-                            >&nbsp;低分子肝素</span
1055
-                          >
1056
-                          <span v-if="record.prescription.anticoagulant == 4"
1057
-                            >&nbsp;阿加曲班</span
1058
-                          >
1059
-                          <span v-if="record.prescription.anticoagulant == 5"
1060
-                            >&nbsp;枸橼酸钠</span
1061
-                          >
1062
-                          <span v-if="record.prescription.anticoagulant == 6"
1063
-                            >&nbsp;低分子肝素钙</span
1064
-                          >
1065
-                          <span v-if="record.prescription.anticoagulant == 7"
1066
-                            >&nbsp;低分子肝素钠</span
1067
-                          >
1068
-                          <span v-if="record.prescription.anticoagulant == 8"
1069
-                            >&nbsp;依诺肝素</span
1070
-                          >
1044
+                          {{ getvalue(record.prescription.anticoagulant) }}
1071 1045
                         </div>
1072 1046
                       </div>
1073 1047
                       <div class="inline_block" style="margin-left: 20px">
@@ -1083,18 +1057,8 @@
1083 1057
                               : "/"
1084 1058
                           }}
1085 1059
                         </div>
1086
-                        <span v-if="record.prescription.anticoagulant == 4"
1087
-                          >mg</span
1088
-                        >
1089
-                        <span v-if="record.prescription.anticoagulant == 3"
1090
-                          >iu</span
1091
-                        >
1092
-                        <span v-if="record.prescription.anticoagulant == 2"
1093
-                          >iu</span
1094
-                        >
1095
-                        <span v-if="record.prescription.anticoagulant == 1"
1096
-                          >mg</span
1097
-                        >
1060
+                        {{ getshouji(record.prescription.anticoagulant) }}
1061
+                       
1098 1062
                       </div>
1099 1063
                       <div class="inline_block" style="margin-left: 20px">
1100 1064
                         维持:
@@ -1128,21 +1092,8 @@
1128 1092
                               : 0
1129 1093
                           }}
1130 1094
                         </div>
1131
-                        <span v-if="record.prescription.anticoagulant == 5"
1132
-                          >ml/h</span
1133
-                        >
1134
-                        <span v-if="record.prescription.anticoagulant == 4"
1135
-                          >mg/h</span
1136
-                        >
1137
-                        <span v-if="record.prescription.anticoagulant == 3"
1138
-                          >iu/h</span
1139
-                        >
1140
-                        <span v-if="record.prescription.anticoagulant == 2"
1141
-                          >iu/h</span
1142
-                        >
1143
-                        <span v-if="record.prescription.anticoagulant == 1"
1144
-                          >mg/h</span
1145
-                        >
1095
+                        {{ getweichi(record.prescription.anticoagulant) }}
1096
+                      
1146 1097
                       </div>
1147 1098
                       <div class="inline_block" style="margin-left: 20px">
1148 1099
                         总量:
@@ -1157,18 +1108,8 @@
1157 1108
                               : "/"
1158 1109
                           }}
1159 1110
                         </div>
1160
-                        <span v-if="record.prescription.anticoagulant == 4"
1161
-                          >mg</span
1162
-                        >
1163
-                        <span v-if="record.prescription.anticoagulant == 3"
1164
-                          >iu</span
1165
-                        >
1166
-                        <span v-if="record.prescription.anticoagulant == 2"
1167
-                          >iu</span
1168
-                        >
1169
-                        <span v-if="record.prescription.anticoagulant == 1"
1170
-                          >mg</span
1171
-                        >
1111
+                        {{ getzongliang(record.prescription.anticoagulant) }}
1112
+                        
1172 1113
                       </div>
1173 1114
                     </div>
1174 1115
                     <div
@@ -3063,6 +3004,46 @@ export default {
3063 3004
     getNumber: function (record) {
3064 3005
       console.log(record);
3065 3006
     },
3007
+    getvalue(id){
3008
+      const options = this.anticoagulantsConfit
3009
+      if(id!=0){
3010
+        for(let i in options){
3011
+          if(options[i].id == id){
3012
+            return options[i].name
3013
+          }
3014
+        }
3015
+      }
3016
+    },
3017
+    getshouji(id){
3018
+      const options = this.anticoagulantsConfit
3019
+      if(id!=0){
3020
+        for(let i in options){
3021
+          if(options[i].id == id){
3022
+            return options[i].shouji_unit
3023
+          }
3024
+        }
3025
+      }
3026
+    },
3027
+    getweichi(id){
3028
+      const options = this.anticoagulantsConfit
3029
+      if(id!=0){
3030
+        for(let i in options){
3031
+          if(options[i].id == id){
3032
+            return options[i].weichi_unit
3033
+          }
3034
+        }
3035
+      }
3036
+    },
3037
+    getzongliang(id){
3038
+      const options = this.anticoagulantsConfit
3039
+      if(id!=0){
3040
+        for(let i in options){
3041
+          if(options[i].id == id){
3042
+            return options[i].zongliang_unit
3043
+          }
3044
+        }
3045
+      }
3046
+    }
3066 3047
   },
3067 3048
 };
3068 3049
 </script>

+ 43 - 30
src/xt_pages/dialysis/template/DialysisPrintOrderSixty.vue Dosyayı Görüntüle

@@ -184,8 +184,7 @@
184 184
               </tr>
185 185
               <tr>
186 186
                 <td colspan="2">
187
-                  <div
188
-                    class="row"
187
+                  <div class="row"
189 188
                     style="padding: 2px 0; line-height: 23px; display: flex"
190 189
                   >
191 190
                     <div class="inline_block" style="flex: 1">
@@ -359,11 +358,10 @@
359 358
                     </div>
360 359
                   </div>
361 360
 
362
-                  <div
363
-                    class="row"
361
+                  <div class="row"
364 362
                     style="padding: 2px 0; line-height: 23px; display: flex"
365 363
                   >
366
-                    <div class="inline_block">
364
+                    <div class="inline_block" style="flex: 1;">
367 365
                       血管通路:
368 366
                       <div
369 367
                         class="under_line"
@@ -374,12 +372,11 @@
374 372
                         {{ predialysis.blood_access_part_opera_name }}
375 373
                       </div>
376 374
                     </div>
377
-                    <div class="inline_block" style="margin-left: 10px">
375
+                    <div class="inline_block" style="flex: 1;">
378 376
                       内瘘:
379
-                      <div
380
-                        class="under_line"
377
+                      <div class="under_line"
381 378
                         style="
382
-                          width: 180px;
379
+                          width: 80%;
383 380
                           text-align: center;
384 381
                           white-space: normal;
385 382
                         "
@@ -392,10 +389,7 @@
392 389
                       </div>
393 390
                     </div>
394 391
 
395
-                    <div
396
-                      class="inline_block"
397
-                      style="margin-left: 10px; flex: 1.4"
398
-                    >
392
+                    <div class="inline_block" style="flex: 1">
399 393
                       导管:
400 394
                       <div
401 395
                         class="under_line"
@@ -941,8 +935,7 @@
941 935
                   <div class="row" style="padding: 2px 0; line-height: 23px">
942 936
                     <div class="inline_block">
943 937
                       抗凝剂:
944
-                      <div
945
-                        class="under_line"
938
+                      <div class="under_line"
946 939
                         style="width: 150px; text-align: center"
947 940
                       >
948 941
                         {{
@@ -968,10 +961,7 @@
968 961
                             : "/"
969 962
                         }}
970 963
                       </div>
971
-                      <span v-if="prescription.anticoagulant == 4">mg</span>
972
-                      <span v-if="prescription.anticoagulant == 3">iu</span>
973
-                      <span v-if="prescription.anticoagulant == 2">iu</span>
974
-                      <span v-if="prescription.anticoagulant == 1">mg</span>
964
+                      {{ getshouji(prescription.anticoagulant) }}
975 965
                     </div>
976 966
                     <div class="inline_block" style="margin-left: 20px">
977 967
                       维持:
@@ -997,11 +987,7 @@
997 987
                             : "0"
998 988
                         }}
999 989
                       </div>
1000
-                      <span v-if="prescription.anticoagulant == 5">ml/h</span>
1001
-                      <span v-if="prescription.anticoagulant == 4">mg/h</span>
1002
-                      <span v-if="prescription.anticoagulant == 3">iu/h</span>
1003
-                      <span v-if="prescription.anticoagulant == 2">iu/h</span>
1004
-                      <span v-if="prescription.anticoagulant == 1">mg/h</span>
990
+                      {{ getweichi(prescription.anticoagulant) }}
1005 991
                     </div>
1006 992
                     <div
1007 993
                       class="inline_block"
@@ -1054,10 +1040,7 @@
1054 1040
                             : "/"
1055 1041
                         }}
1056 1042
                       </div>
1057
-                      <span v-if="prescription.anticoagulant == 4">mg</span>
1058
-                      <span v-if="prescription.anticoagulant == 3">iu</span>
1059
-                      <span v-if="prescription.anticoagulant == 2">iu</span>
1060
-                      <span v-if="prescription.anticoagulant == 1">mg</span>
1043
+                      {{ getzongliang(prescription.anticoagulant) }}
1061 1044
                     </div>
1062 1045
                     <!-- <div class="inline_block" style="margin-left: 20px">
1063 1046
                       透析机号:
@@ -2786,7 +2769,6 @@ export default {
2786 2769
         );
2787 2770
       }
2788 2771
     },
2789
-
2790 2772
     getXuserName(id) {
2791 2773
       if (id <= 0) {
2792 2774
         return "";
@@ -3252,6 +3234,36 @@ export default {
3252 3234
         return "0.0";
3253 3235
       }
3254 3236
     },
3237
+    getshouji(id){
3238
+      const options = this.anticoagulantsConfit
3239
+      if(id!=0){
3240
+        for(let i in options){
3241
+          if(options[i].id == id){
3242
+            return options[i].shouji_unit
3243
+          }
3244
+        }
3245
+      }
3246
+    },
3247
+    getweichi(id){
3248
+      const options = this.anticoagulantsConfit
3249
+      if(id!=0){
3250
+        for(let i in options){
3251
+          if(options[i].id == id){
3252
+            return options[i].weichi_unit
3253
+          }
3254
+        }
3255
+      }
3256
+    },
3257
+    getzongliang(id){
3258
+      const options = this.anticoagulantsConfit
3259
+      if(id!=0){
3260
+        for(let i in options){
3261
+          if(options[i].id == id){
3262
+            return options[i].zongliang_unit
3263
+          }
3264
+        }
3265
+      }
3266
+    }
3255 3267
   },
3256 3268
   watch: {
3257 3269
     "patientInfo.gender": function () {
@@ -3297,7 +3309,8 @@ export default {
3297 3309
     this.perfusionApparatus = this.$store.getters.perfusion_apparatus;
3298 3310
     this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit;
3299 3311
     this.displaceLiquiPartOptions = this.$store.getters.displace_liqui;
3300
-
3312
+    console.log('this.anticoagulantsConfit',this.anticoagulantsConfit);
3313
+    
3301 3314
     this.blood_access_part = getDataConfig("hemodialysis", "vascular_access");
3302 3315
     this.blood_access_part_opera = getDataConfig(
3303 3316
       "hemodialysis",

+ 1 - 1
src/xt_pages/user/components/PatientSidebar.vue Dosyayı Görüntüle

@@ -328,7 +328,7 @@ export default {
328 328
       } else if (name == '1-2') {
329 329
         this.$router.push({ path: '/patients/course?id=' + this.id })
330 330
       } else if (name == '1-3') {
331
-        this.$router.push({ path: '/patients/inspection?id=' + this.id })
331
+        this.$router.push({ path: '/patients/inspection?id=' + this.id,query:{patient:this.currentPatient}})
332 332
       } else if (name == '1-4') {
333 333
         this.$router.push({
334 334
           path: '/patients/patient/' + this.id + '/doctorAdvice'

+ 126 - 4
src/xt_pages/user/inspection.vue Dosyayı Görüntüle

@@ -102,6 +102,9 @@
102 102
             >删除
103 103
             </el-button
104 104
             >
105
+            <el-button size="small" class="filter-item" type="primary" icon="el-icon-printer" @click="Printcheck" >
106
+              打印
107
+            </el-button>
105 108
           </div>
106 109
           <div class="filter-container">
107 110
             <el-button class="filter-item" type="text" style="color:#000"
@@ -247,6 +250,76 @@
247 250
             :total="total"
248 251
           >
249 252
           </el-pagination>
253
+
254
+          <div style="display: none">
255
+            <div id="print_content">
256
+              <div style="text-align: center;border-bottom: 1px solid black;">
257
+                <h1>检验报告</h1>
258
+              </div>
259
+              <div style="display: flex;margin: 10px 0;">
260
+                <div style="flex: 1;">姓名:{{ patient.name }}</div>
261
+                <div style="flex: 1;">性别:{{ patient.gender ==1 ? '男' : '女' }}</div>
262
+                <div style="flex: 1;">年龄:{{ patient.age }}
263
+                  <!-- <span v-if="getAge(patient)>200">
264
+                    {{ patient.age }}
265
+                  </span>
266
+                  <span v-else>
267
+                    {{ getAge(patient) }}
268
+                  </span> -->
269
+                </div>
270
+              </div>
271
+              <table class="checktable" border="1" style="border-collapse: collapse;width: 100%;border-left: 0;border-right: 0;">
272
+                <thead>
273
+                  <tr style="padding: 5px 0;border-top:1px solid black ;border-bottom:1px solid black ;">
274
+                    <th width="150">项目</th>
275
+                    <th width="80">结果</th>
276
+                    <th width="50">提示</th>
277
+                    <th width="100">单位</th>
278
+                    <th width="100">参考区间</th>
279
+                  </tr>
280
+                </thead>
281
+                <tbody>
282
+                  <tr v-for="(item,index) in items" :key="index">
283
+                    <td width="150">{{ item.item_name }} {{ item.item_name_addition }}</td>
284
+                    <td width="80">
285
+                      <div>
286
+                        <span v-if="item.range_type == 2">
287
+                          <span v-if="item.value=='阳性'" style="color: red"> {{ item.value }}</span>
288
+                          <span v-else> {{ item.value }}</span>
289
+                        </span>
290
+                        <span v-if="item.range_type == 1">
291
+                          <span v-if="parseFloat(item.value) < parseFloat(getrange(item.range_min)) ">
292
+                            {{ item.value }}
293
+                          </span>
294
+                          <span v-if="parseFloat(getrange(item.range_min))<= parseFloat( item.value) && parseFloat(item.value)<= parseFloat(getrange(item.range_max)) ">
295
+                            {{ item.value }}
296
+                          </span>
297
+                          <span v-if="parseFloat(item.value) >parseFloat(getrange(item.range_max)) ">
298
+                            {{ item.value }}
299
+                          </span>
300
+                          <span v-if ="item.range_max ==''||item.range_min ==''">
301
+                            {{ item.value }}
302
+                          </span>
303
+                        </span>
304
+                      </div>
305
+                    </td>
306
+                    <td width="50">
307
+                      <span v-if="item.range_type == 1">
308
+                        <span v-if="parseFloat(item.value) < parseFloat(getrange(item.range_min)) ">
309
+                          <span v-if="item.value>0">↓</span>
310
+                        </span>
311
+                        <span v-if="parseFloat(item.value) >parseFloat(getrange(item.range_max)) ">
312
+                          <span v-if="item.value>0">↑</span>
313
+                        </span>
314
+                      </span>
315
+                    </td>
316
+                    <td width="100">{{ item.unit }}</td>
317
+                    <td width="100">{{ item.range_min }}~{{ item.range_max }}</td>
318
+                  </tr>
319
+                </tbody>
320
+              </table>
321
+            </div>
322
+          </div>
250 323
         </el-col>
251 324
       </el-row>
252 325
     </div>
@@ -505,7 +578,7 @@
505 578
 import PatientSidebar from './components/PatientSidebar'
506 579
 import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
507 580
 import { getToken } from '@/api/qiniu'
508
-
581
+import print from "print-js";
509 582
 import {
510 583
   CreatePatientInspection,
511 584
   CreatePatientPICInspection,
@@ -573,6 +646,7 @@ export default {
573 646
         page: 1
574 647
       },
575 648
       org_id:0,
649
+      patient:{},
576 650
     }
577 651
   },
578 652
   methods: {
@@ -724,7 +798,24 @@ export default {
724 798
         })
725 799
         .catch(() => {
726 800
         })
727
-    },submitRemindDialog(){
801
+    },
802
+    // 打印
803
+    Printcheck(){
804
+      if (this.project == null || this.itemDate == '') {
805
+        this.$message.error('请先选择打印的记录')
806
+        return false
807
+      }else{
808
+        const style='@media print{.checktable tr td,th{border: 0 !important;padding: 5px 0;text-align: center;}}'
809
+        printJS({
810
+          printable: "print_content",
811
+          type: "html",
812
+          documentTitle: "  ",
813
+          style: style,
814
+          scanStyles: false,
815
+        });
816
+      }
817
+    },
818
+    submitRemindDialog(){
728 819
       var temp_is_open = 0
729 820
       if(this.is_open){
730 821
         temp_is_open = 1
@@ -751,7 +842,8 @@ export default {
751 842
           this.dialogRemindDialogFormVisible = false
752 843
         }
753 844
       })
754
-    },submitNewRemind(){
845
+    },
846
+    submitNewRemind(){
755 847
       // console.log(this.is_open)
756 848
       var params = {
757 849
         patient: this.patientID,
@@ -953,6 +1045,7 @@ export default {
953 1045
           for (var index in this.form.formItem) {
954 1046
             this.form.formItem[index].value = '' + this.form.formItem[index].value
955 1047
           }
1048
+          console.log('this.patientID, this.form,',this.patientID, this.form, this.form.remind_cycle, this.form.inspect_date, this.form.project_id);
956 1049
 
957 1050
           EditPatientInspection(this.patientID, this.form, this.form.remind_cycle, this.form.inspect_date, this.form.project_id).then(response => {
958 1051
             if (response.data.state == 1) {
@@ -1364,7 +1457,7 @@ export default {
1364 1457
                     item.item_name = inspectionsMap[items[index].id].item_name
1365 1458
                   }else{
1366 1459
                     console.log('执行1');
1367
-                    
1460
+
1368 1461
                     if(this.org_id == 10702 || this.org_id == 0){
1369 1462
                       if(item.project_name == '血常规'|| item.project_name == '透后肾功能' ||
1370 1463
                           item.project_name == '肝功能' || item.project_name == '电解质' || item.project_name == '透前肾功能' ||
@@ -1454,9 +1547,33 @@ export default {
1454 1547
       }
1455 1548
 
1456 1549
     },
1550
+    getAge: function(val) {
1551
+      if (val.id_card_no == undefined) {
1552
+        return false
1553
+      }
1554
+      var thisLen = val.id_card_no.length
1555
+      var birth = ''
1556
+      if (thisLen == 15) {
1557
+        birth = '19' + val.id_card_no.substr(6, 6)
1558
+      } else {
1559
+        birth = val.id_card_no.substr(6, 8)
1560
+      }
1561
+      var birthtwo =
1562
+        birth.substr(0, 4) +
1563
+        '-' +
1564
+        birth.substr(4, 2) +
1565
+        '-' +
1566
+        birth.substr(6, 2)
1567
+
1568
+      var age = jsGetAge(birthtwo, '-')
1569
+      return age
1570
+    }
1457 1571
   },
1458 1572
   created() {
1459 1573
     const id = this.$route.query && this.$route.query.id
1574
+    this.patient = this.$route.query.patient
1575
+    console.log('this.patient',this.patient);
1576
+
1460 1577
     this.org_id = this.$store.getters.xt_user.org.id,
1461 1578
     this.patientID = parseInt(id)
1462 1579
     if (isNaN(this.patientID) || this.patientID <= 0) {
@@ -1504,4 +1621,9 @@ export default {
1504 1621
 .el-table::before {
1505 1622
   background-color: #d0d3da;
1506 1623
 }
1624
+.checktable tr td,th{
1625
+  border: 0 !important;
1626
+  padding: 5px 0;
1627
+  text-align: center;
1628
+}
1507 1629
 </style>

+ 237 - 39
src/xt_pages/user/sickHistory_new.vue Dosyayı Görüntüle

@@ -136,8 +136,6 @@
136 136
       </div>
137 137
 
138 138
 
139
-
140
-
141 139
       <el-dialog
142 140
         title="设置模板"
143 141
         :visible.sync="template_dialog"
@@ -196,20 +194,11 @@
196 194
           <el-button @click="library_dialog = false">取消</el-button>
197 195
         </span>
198 196
       </el-dialog>
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
-
207
-
208
-     
209
-     
210 197
     </div>
198
+
199
+    <p></p>
211 200
   </div>
212
- 
201
+
213 202
 </template>
214 203
 
215 204
 <script>
@@ -227,11 +216,13 @@ import {
227 216
   saveSickHistoryTemplate,
228 217
   getSickHistoryTempalate,
229 218
   modifySickHistoryTemplate,
230
-  deleteSickHistoryTempalte
219
+  deleteSickHistoryTempalte,
220
+  fetchPatient,
231 221
 } from '@/api/patient'
232 222
 import { parseTime } from '@/utils'
233
-import BreadCrumb from '@/xt_pages/components/bread-crumb' 
223
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
234 224
 import { uParseTime } from '@/utils/tools'
225
+import { getDataConfig } from "@/utils/data";
235 226
 export default {
236 227
   name: 'CourseOfDisease',
237 228
   components: {
@@ -300,13 +291,18 @@ export default {
300 291
       templateList:[],
301 292
       template_content:"",
302 293
       template_id:0,
294
+      form:{},
295
+      wayOptions: null,
296
+      patientVascularAccessOne:{},
303 297
     }
304 298
   },
305 299
   created() {
306
-    this.admin_user_id = this.$store.getters.xt_user.user.id
300
+    this.wayOptions = getDataConfig("patient", "reimbursement_ways");
301
+    console.log('this.wayOptions',this.wayOptions);
307 302
     
303
+    this.admin_user_id = this.$store.getters.xt_user.user.id
308 304
     this.patient_id = parseInt(this.$route.query.id)
309
-
305
+    
310 306
     if (isNaN(this.patient_id) || this.patient_id <= 0) {
311 307
       this.$notify.error({
312 308
         title: '错误',
@@ -341,7 +337,7 @@ export default {
341 337
 
342 338
     this.getlist()
343 339
     this.fetchAllDoctorAndNurse()
344
-
340
+    this.fetchPatient(this.patient_id)
345 341
   },
346 342
   methods: {
347 343
     template_dele(){
@@ -387,26 +383,197 @@ export default {
387 383
       this.edit_index = row.index
388 384
     },
389 385
     template_click(){
390
-      console.log('this.add_index',this.add_index);
391
-
386
+      
387
+      console.log('this.add_index',this.getwayoption(this.form.reimbursement_way_id));
392 388
       if(this.add_index ==0){
393 389
         this.template_dialog = true
394 390
       }else{
391
+        const mode=`<p style="font-size: 18px;font-weight: 600;width:100%;margin-bottom: 10px;text-align: center;">血液净化治疗患者首次门诊病历</p>
392
+        <table border="1" style="border-collapse: collapse;text-align: center;">
393
+      <tbody>
394
+        <tr>
395
+          <td style="width:8%;padding: 5px 0px;font-size: 16px;">
396
+            姓名
397
+          </td>
398
+          <td style="padding: 5px 0px;font-size: 16px;width:15%;">
399
+            ${this.form.name}
400
+          </td>
401
+          <td style="padding: 5px 0px;font-size: 16px;width:7%;">
402
+            性别
403
+          </td>
404
+          <td style="padding: 5px 0px;font-size: 16px;width:5%;">
405
+            ${this.form.gender==1 ? '男':'女'}
406
+          </td>
407
+          <td style="padding: 5px 0px;font-size: 16px;width:8%;">
408
+            年龄
409
+          </td>
410
+          <td style="padding: 5px 0px;font-size: 16px;width:10%;">
411
+            ${this.form.age}岁
412
+          </td>
413
+          <td style="padding: 5px 0px;font-size: 16px;width:12%;">
414
+            医保类型
415
+          </td>
416
+          <td style="padding: 5px 0px;font-size: 16px;width: 15%;">
417
+            ${this.getwayoption(this.form.reimbursement_way_id)}
418
+          </td>
419
+          <td style="padding: 5px 0px;font-size: 16px;width:10%;">
420
+            透析号
421
+          </td>
422
+          <td style="padding: 5px 0px;font-size: 16px;width:10%;">
423
+            ${this.form.dialysis_no}
424
+          </td>
425
+        </tr>
426
+        <tr>
427
+          <td style="padding: 5px 0px;font-size: 16px;">
428
+            电话
429
+          </td>
430
+          <td style="padding: 5px 0px;font-size: 16px;">
431
+            ${this.form.phone}
432
+          </td>
433
+          <td  style="padding: 5px 0px;font-size: 16px;">
434
+            民族
435
+          </td>
436
+          <td colspan="3" style="padding: 5px 0px;font-size: 16px;">
437
+            ${this.form.nation}
438
+          </td>
439
+          <td style="padding: 5px 0px;font-size: 16px;">
440
+            身份证号
441
+          </td>
442
+          <td colspan="3" style="padding: 5px 0px;font-size: 16px;">
443
+            ${this.form.id_card_no}
444
+          </td>
445
+        </tr>
446
+        <tr>
447
+          <td style="padding: 5px 0px;font-size: 16px;">
448
+            联系人
449
+          </td>
450
+          <td style="padding: 5px 0px;font-size: 16px;">
451
+            ${this.form.contact_name}
452
+          </td>
453
+          <td  style="padding: 5px 0px;font-size: 16px;">
454
+            电话
455
+          </td>
456
+          <td colspan="3" style="padding: 5px 0px;font-size: 16px;">
457
+            ${this.form.home_telephone}
458
+          </td>
459
+          <td style="padding: 5px 0px;font-size: 16px;">
460
+            联系地址
461
+          </td>
462
+          <td colspan="3" style="padding: 5px 0px;font-size: 16px;">
463
+            ${this.form.home_address}
464
+          </td>
465
+        </tr>
466
+        <tr>
467
+          <td colspan="2" style="padding: 5px 0px;font-size: 16px;">
468
+            首次透析时间
469
+          </td>
470
+          <td colspan="4" style="padding: 5px 0px;font-size: 16px;">
471
+            ${this.getTime(this.form.first_dialysis_date)}
472
+          </td>
473
+          <td style="padding: 5px 0px;font-size: 16px;">
474
+            血管通路
475
+          </td>
476
+          <td colspan="3" style="padding: 5px 0px;font-size: 16px;">
477
+            ${this.patientVascularAccessOne.blood_access_part_id } ${ this.patientVascularAccessOne.blood_access_part_opera_id }
478
+          </td>
479
+        </tr>
480
+
481
+        <tr>
482
+          <td style="padding: 5px 0px;font-size: 16px; ">
483
+            主诉
484
+          </td>
485
+          <td colspan="9" style="text-align: left; padding:0px 5px ;font-size: 16px;">
486
+            ${this.form.patient_complains}
487
+          </td>
488
+        </tr>
489
+        <tr>
490
+          <td>
491
+            <div  class="td_proj_title">现<br />病<br />史</div>
492
+          </td>
493
+          <td colspan="9">${this.form.present_history}</td>
494
+        </tr>
495
+        <tr>
496
+          <td>
497
+            <div class="td_proj_title">既<br />往<br />史</div>
498
+          </td>
499
+          <td colspan="9">${this.form.past_history}</td>
500
+        </tr>
501
+        <tr>
502
+          <td>
503
+            <div class="td_proj_title">过敏史</div>
504
+          </td>
505
+          <td colspan="5">${this.form.allergic_history}</td>
506
+          <td>
507
+            <div class="td_proj_title">家族史</div>
508
+          </td>
509
+          <td colspan="3">${this.form.famality_record}</td>
510
+        </tr>
511
+
512
+        <tr>
513
+          <td colspan="10"><div class="td_proj_title">体格检查</div></td>
514
+        </tr>
515
+        <tr>
516
+          <td colspan="10">
517
+            T:${this.form.temperature}℃&nbsp;&nbsp;&nbsp; P:${this.form.pulse}次/分&nbsp;&nbsp;&nbsp; R:${this.form.respiratory}次/分&nbsp;&nbsp;&nbsp; BP:${this.form.sbp}/${this.form.dbp}mmHg
518
+          </td>
519
+        </tr>
520
+        <tr>
521
+          <td colspan="10">${this.form.remark}</td>
522
+        </tr>
523
+        <tr>
524
+          <td style="width: 15%;">
525
+            <div class="td_proj_title">辅助检查</div>
526
+          </td>
527
+          <td colspan="9">
528
+            <p style='min-height:30px'></p>
529
+          </td>
530
+        </tr>
531
+        <tr>
532
+          <td>
533
+            <div class="td_proj_title">诊<br />断</div>
534
+          </td>
535
+          <td colspan="9">${this.form.diagnose}</td>
536
+        </tr>
537
+        <tr>
538
+          <td>
539
+            <div class="td_proj_title">诊<br />疗<br />计<br />划</div>
540
+          </td>
541
+          <td colspan="9"><p>${this.form.treatment_plan}</p></td>
542
+        </tr>
543
+      </tbody>
544
+        </table>`
545
+        const obj={
546
+          id:0,
547
+          title:'病史模板',
548
+          status:1,
549
+          content:mode,
550
+          ctime:parseFloat((new Date()).getTime()/1000).toFixed(0),
551
+          mtime: parseFloat((new Date()).getTime()/1000).toFixed(0),
552
+        }
553
+        const arr = []
554
+        arr.push(obj)
555
+        console.log('1111',arr);
395 556
         getSickHistoryTempalate().then(response=>{
396 557
           if(response.data.state == 1){
397 558
             this.library_dialog = true
398 559
             this.templateList = response.data.data.templateList
560
+            this.templateList = this.templateList.concat(arr)
561
+            // this.templateList.unshift(obj)
399 562
             console.log("hahhahahaha",this.$refs)
400 563
             if(this.templateList!=null && this.templateList.length>0){
401
-              this.$refs.record_table_one.setCurrentRow(this.templateList[0])
564
+              this.$nextTick(()=>{
565
+                this.$refs.record_table_one.setCurrentRow(this.templateList[0])
566
+              })
402 567
             }
403 568
             console.log("haaaaaaaaaaaaa",this.templateList)
404
-            
405 569
           }
406 570
         })
407
-     
408
-      }
571
+        
572
+        // this.templateList.push(obj)
573
+        
574
+        console.log('11111111',obj);
409 575
 
576
+      }
410 577
     },
411 578
     template_save(){
412 579
        var params = {
@@ -420,8 +587,8 @@ export default {
420 587
            this.template_dialog = false
421 588
          }
422 589
       })
423
-    
424
-    
590
+
591
+
425 592
     },
426 593
     prints(){
427 594
       const style ='@media print{.content{width:960px;margin:0 auto;font-size: 23px;}}'
@@ -441,7 +608,7 @@ export default {
441 608
         }
442 609
       });
443 610
     },
444
-  
611
+
445 612
     didChangeCurrentRecord: function(record) {
446 613
       this.current_select_record = record
447 614
     },
@@ -499,7 +666,7 @@ export default {
499 666
     },
500 667
 
501 668
     createAction: function() {
502
-    
669
+
503 670
       console.log("hhhhhhhhhhhhhhhhhh",this.$refs)
504 671
       this.new_content = this.$refs.editor.contents
505 672
       if (this.new_content.length == 0) {
@@ -518,14 +685,15 @@ export default {
518 685
         guominyaowu_desc:this.guominyaowu_desc,
519 686
         doctor_id: this.admin_user_id
520 687
       }
521
-     
688
+
522 689
       createNewSickHistoryRecord(params).then(response => {
523 690
          if(response.data.state == 1){
524 691
            var patientSickHistory = response.data.data.patientSickHistory
525 692
            this.$message.success("保存成功!")
526 693
            this.getlist()
694
+           this.add_index = 0
695
+           this.disabled = true
527 696
          }
528
-
529 697
       }).catch(error => {
530 698
         this.uploading_new_record = false
531 699
         this.$message.error(error)
@@ -572,11 +740,11 @@ export default {
572 740
 
573 741
 
574 742
       },
575
-   
743
+
576 744
     showEdit() {
577 745
       this.add_index =1
578 746
       this.disabled = false
579
-   
747
+
580 748
     }, tableRow({ row, rowIndex }) {
581 749
       // 把每一行的索引放进row
582 750
       row.index = rowIndex
@@ -599,7 +767,7 @@ export default {
599 767
           var list = response.data.data.list
600 768
           this.tableData = list
601 769
           this.$refs.record_table.setCurrentRow(this.tableData[0])
602
-        } 
770
+        }
603 771
       })
604 772
     },
605 773
     getDocName(admin_user_id){
@@ -628,20 +796,20 @@ export default {
628 796
       if(val.is_hypersusceptibility>0){
629 797
         this.shen_guomi = val.is_hypersusceptibility
630 798
       }
631
-      
799
+
632 800
       this.patient_id = val.patient_id
633 801
       this.admin_user_id = val.admin_user_id
634
-    
802
+
635 803
     },
636 804
     getCurrentChangeOne(val){
637
-   
805
+
638 806
       this.$refs.editorOne.contents = val.content
639 807
       this.template_content = ""
640 808
       this.template_content = val.content
641 809
       this.template_id = val.id
642 810
     },
643 811
     saveTemplate(){
644
-   
812
+
645 813
       var params = {
646 814
         title:this.template_name,
647 815
         content: this.$refs.editor.contents,
@@ -657,7 +825,37 @@ export default {
657 825
    toContentPint(){
658 826
     this.$refs.editor.contents = this.template_content
659 827
     this.library_dialog = false
660
-   }
828
+   },
829
+   fetchPatient(id) {
830
+      fetchPatient(id).then((response) => {
831
+          console.log('fetchPatient11111',response.data.data);
832
+          if(response.data.state ==1){
833
+            this.form = response.data.data.patient;
834
+            this.patientVascularAccessOne = response.data.data.patientVascularAccessOne
835
+          }
836
+        })
837
+        .catch((err) => {
838
+          console.log("patient get err", err);
839
+          this.$notify.error({
840
+            title: "错误",
841
+            message: "网络异常",
842
+          });
843
+          this.$router.push("/patients/patients");
844
+        });
845
+    },
846
+    getwayoption(id){
847
+      if(id != 0){
848
+        for(let i in this.wayOptions){
849
+          if(id == this.wayOptions[i].id){
850
+            console.log('22222',this.wayOptions[i].name);
851
+            return this.wayOptions[i].name
852
+          }
853
+        }
854
+      }else{
855
+        return ''
856
+      }
857
+      
858
+    }
661 859
   }
662 860
 }
663 861
 </script>