Browse Source

hah阿凡达

28169 4 months ago
parent
commit
0b9fe987e1

+ 54 - 0
src/api/patient.js View File

@@ -1242,3 +1242,57 @@ export function getNewSickHistory(params){
1242 1242
   })
1243 1243
 }
1244 1244
 
1245
+
1246
+export function deleteNewSickHistory(id,params){
1247
+  
1248
+  return request({
1249
+    url:"/api/patient/deletenewsickhistory?id="+id,
1250
+    method:"get",
1251
+    params:params,
1252
+  })
1253
+}
1254
+
1255
+export function saveSickHistoryTemplate(data){
1256
+
1257
+  return request({
1258
+    url:"/api/patient/savesickhistorytemplate",
1259
+    method:"post",
1260
+    data:data,
1261
+  })
1262
+}
1263
+
1264
+export function getSickHistoryTempalate(params){
1265
+
1266
+  return request({
1267
+    url:"/api/patient/getsickhistorytemplate",
1268
+    method:"get",
1269
+    params:params
1270
+  })
1271
+}
1272
+
1273
+export function modifySickHistoryTemplate(data){
1274
+
1275
+  return request({
1276
+    url:"/api/patient/modifysickhistorytemplate",
1277
+    method:"post",
1278
+    data:data,
1279
+  })
1280
+}
1281
+
1282
+export function deleteSickHistoryTempalte(id,params){
1283
+
1284
+  return request({
1285
+    url:"/api/patient/deletesickhistorytemplate?id="+id,
1286
+    method:"get",
1287
+    params:params
1288
+  })
1289
+}
1290
+
1291
+export function createNewCourseOfDiseaseRecord(data){
1292
+
1293
+  return request({
1294
+    url:"/api/patient/createnewcourseofdiseaserecord",
1295
+    method:"post",
1296
+    data:data,
1297
+  })
1298
+}

+ 4 - 0
src/xt_pages/Pharmacy/drugCode.vue View File

@@ -299,6 +299,10 @@
299 299
                 this.tableData[i].is_medicine_name = "未发药"
300 300
              }
301 301
              this.tableData[i].specification_name = this.getDrugSpec(this.tableData[i].drug_id)
302
+
303
+             this.tableData[i].prescribing_numbers = ""
304
+
305
+             this.tableData[i].prescribing_numbers = this.tableData[i].prescribing_number + this.tableData[i].prescribing_number_unit
302 306
            }
303 307
         }
304 308
 

+ 4 - 4
src/xt_pages/user/components/PatientSidebar.vue View File

@@ -167,10 +167,10 @@ export default {
167 167
               name: '3-1',
168 168
               label: '病史'
169 169
             },
170
-            // {
171
-            //   name: '3-4',
172
-            //   label: '病史新'
173
-            // },
170
+            {
171
+              name: '3-4',
172
+              label: '病史新'
173
+            },
174 174
             {
175 175
               name: '3-2',
176 176
               label: '体格检查'

+ 66 - 49
src/xt_pages/user/courseOfDisease_new.vue View File

@@ -67,20 +67,23 @@
67 67
               <div style="flex: 1;">
68 68
                 记录时间:
69 69
                 <el-date-picker
70
-                  v-model="value1"
70
+                  v-model="record_date"
71
+                  type="date"
72
+                  format="yyyy-MM-dd"
71 73
                   :disabled="disabled"
72
-                  type="datetime"
73
-                  placeholder="选择日期时间">
74
+                  style="width: 150px;"
75
+                   value-format="yyyy-MM-dd"
76
+                  placeholder="选择日期">
74 77
                 </el-date-picker>
75 78
               </div>
76 79
               <div style="flex: 1;">
77 80
                 病程医生:
78
-                <el-select v-model="value" placeholder="请选择" :disabled="disabled">
81
+                <el-select v-model="admin_user_id" placeholder="请选择" :disabled="disabled">
79 82
                   <el-option
80
-                    v-for="item in options"
81
-                    :key="item.value"
82
-                    :label="item.label"
83
-                    :value="item.value">
83
+                    v-for="item in doctorOptions"
84
+                    :key="item.id"
85
+                    :label="item.name"
86
+                    :value="item.id">
84 87
                   </el-option>
85 88
                 </el-select>
86 89
               </div>
@@ -102,6 +105,8 @@
102 105
           </div>
103 106
         </div>
104 107
       </div>
108
+
109
+
105 110
       <el-dialog
106 111
         title="设置模板"
107 112
         :visible.sync="template_dialog"
@@ -245,7 +250,7 @@
245 250
                 <editor ref="editor"
246 251
                         id="editors"
247 252
                         style="width: 80%"
248
-                        v-bind:r_content="new_content"
253
+                        :content="new_content"
249 254
                         >
250 255
                 </editor>
251 256
               </keep-alive>
@@ -320,13 +325,13 @@
320 325
   const moment = require('moment')
321 326
   import { getDataConfig } from "@/utils/data";
322 327
   import {
323
-    createCourseOfDiseaseRecord,
328
+    createNewCourseOfDiseaseRecord,
324 329
     deleteCourseOfDiseaseRecords,
325 330
     getCourseOfDiseaseRecords,
326 331
     modifyCourseOfDiseaseRecord,
327
-    GetCoursePrintData,
328 332
     getPatientDialysisInfor
329 333
   } from '@/api/patient'
334
+  import { fetchAllDoctorAndNurse } from "@/api/doctor";
330 335
   import { parseTime } from '@/utils'
331 336
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
332 337
   import { uParseTime } from '@/utils/tools'
@@ -366,8 +371,6 @@
366 371
         ids:"",
367 372
         idArr:[],
368 373
         org_id:0,
369
-
370
-
371 374
         add_index:0,
372 375
         disabled:true,
373 376
         template_dialog:false,
@@ -378,9 +381,30 @@
378 381
         end_date:'',
379 382
         quzhi_options:[{value:1,label:'本周'},{value:2,label:'上周'},{value:3,label:'本月'},{value:4,label:'上周'},],
380 383
         tableData:[{index:1,date:'2024-11-12',doctor:'王启年'}],
384
+        admin_user_id:0,
385
+        record_date:""
381 386
       }
382 387
     },
383 388
     created() {
389
+      this.admin_user_id = this.$store.getters.xt_user.user.id
390
+      var now = new Date()
391
+      this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
392
+
393
+      var nowDate = new Date()
394
+      var nowYear = nowDate.getFullYear()
395
+      var nowMonth = nowDate.getMonth() + 1
396
+      var nowDay = nowDate.getDate()
397
+      this.end_time =
398
+        nowYear +
399
+        '-' +
400
+        (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
401
+        '-' +
402
+        (nowDay < 10 ? '0' + nowDay : nowDay)
403
+      nowDate.setMonth(nowDate.getMonth() - 1)
404
+      nowYear = nowDate.getFullYear()
405
+      nowMonth = nowDate.getMonth() + 1
406
+      nowDay = nowDate.getDate()
407
+      this.record_date = nowYear +'-' +(nowMonth < 10 ? '0' + nowMonth : nowMonth) +'-' +(nowDay < 10 ? '0' + nowDay : nowDay)
384 408
       this.patient_id = parseInt(this.$route.query.id)
385 409
       this.org_id = this.$store.getters.xt_user.template_info.org_id;
386 410
       if (isNaN(this.patient_id) || this.patient_id <= 0) {
@@ -391,27 +415,25 @@
391 415
         this.$router.push('/patients/patients')
392 416
         return
393 417
       }
394
-      // var now = new Date()
395
-      // this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
396
-
397
-      // var nowDate = new Date()
398
-      // var nowYear = nowDate.getFullYear()
399
-      // var nowMonth = nowDate.getMonth() + 1
400
-      // var nowDay = nowDate.getDate()
401
-      // this.end_time =nowYear +'-' +(nowMonth < 10 ? '0' + nowMonth : nowMonth) +'-' +(nowDay < 10 ? '0' + nowDay : nowDay)
402
-      // nowDate.setMonth(nowDate.getMonth() - 1)
403
-      // nowYear = nowDate.getFullYear() -1
404
-      // nowMonth = nowDate.getMonth() + 1
405
-      // nowDay = nowDate.getDate()
406
-      // this.start_time = nowYear +'-' +(nowMonth < 10 ? '0' + nowMonth : nowMonth) +'-' +(nowDay < 10 ? '0' + nowDay : nowDay)
407
-      this.start_time = moment().month(moment().month() - 6).startOf('month').format('YYYY-MM-DD');
408
-      console.log("start_time",this.start_time)
409
-      this.end_time = moment().endOf('month').format('YYYY-MM-DD');
410
-      console.log("end_time",this.end_time)
418
+     
419
+      // this.start_time = moment().month(moment().month() - 6).startOf('month').format('YYYY-MM-DD');
420
+      // console.log("start_time",this.start_time)
421
+      // this.end_time = moment().endOf('month').format('YYYY-MM-DD');
422
+      // console.log("end_time",this.end_time)
423
+      this.fetchAllDoctorAndNurse()
411 424
       this.requestCourseRecords()
425
+     
412 426
 
413 427
     },
414 428
     methods: {
429
+     fetchAllDoctorAndNurse() {
430
+       fetchAllDoctorAndNurse().then(response => {
431
+        if (response.data.state == 1) {
432
+          this.doctorOptions= []
433
+          this.doctorOptions = response.data.data.doctors;
434
+        }
435
+       });
436
+      },
415 437
       add_click(){
416 438
         this.add_index = 1
417 439
         this.disabled = false
@@ -423,6 +445,9 @@
423 445
       showSave(){
424 446
         this.add_index = 0
425 447
         this.disabled = true
448
+        saveNewCousreOfDisease().then(response=>{
449
+
450
+        })
426 451
       },
427 452
       template_click(){
428 453
         console.log('this.add_index',this.add_index);
@@ -516,33 +541,25 @@
516 541
       },
517 542
 
518 543
       createAction: function() {
519
-        this.new_content = this.$refs.editor.content
544
+        this.new_content = this.$refs.editor.contents
520 545
         console.log("hhhhh2h3h232323232",this.new_content)
521 546
         if (this.new_content.length == 0) {
522 547
           this.$message.error('请填写病程内容')
523 548
           return
524 549
         }
525
-        this.uploading_new_record = true
526
-
527
-        createCourseOfDiseaseRecord(this.patient_id, this.new_content, this.course_of_disease_time, this.title).then(rs => {
528
-          this.uploading_new_record = false
529
-          var resp = rs.data
530
-          if (resp.state == 1) {
531
-            this.records.unshift(resp.data.record)
532
-            // this.$refs.record_table.setCurrentRow()
533
-            // this.$refs.record_table.setCurrentRow(this.records[0])
534
-            // this.current_select_record = this.records[0]
535
-            this.show_dialog = false
536
-            this.new_content = ''
537
-            this.title = ''
550
+        var params = {
551
+          patient_id:this.patient_id,
552
+          record_date:this.record_date,
553
+          content:this.new_content,
554
+          admin_user_id:this.admin_user_id,
555
+        }
556
+        createNewCourseOfDiseaseRecord(params).then(response => {
557
+         if(response.data.state == 1){
538 558
 
539
-          } else {
540
-            this.$message.error(resp.msg)
541
-          }
559
+         }
542 560
 
543 561
         }).catch(error => {
544
-          this.uploading_new_record = false
545
-          this.$message.error(error)
562
+         
546 563
         })
547 564
       },
548 565
       didSelectTemplate: function(templateContent) {

+ 148 - 109
src/xt_pages/user/sickHistory_new.vue View File

@@ -52,7 +52,7 @@
52 52
                   <el-button type="primary" size="small" @click="prints">打印</el-button>
53 53
                 </div>
54 54
                 <div v-if="add_index == 1">
55
-                  <el-button type="primary" size="small" @click="createAction">保存2</el-button>
55
+                  <el-button type="primary" size="small" @click="createAction">保存</el-button>
56 56
                   <el-button size="small" @click="showCancel">取消</el-button>
57 57
                 </div>
58 58
               </div>
@@ -63,8 +63,10 @@
63 63
                 <el-date-picker
64 64
                   v-model="start_time"
65 65
                   type="date"
66
+                  format="yyyy-MM-dd"
66 67
                   :disabled="disabled"
67 68
                   style="width: 150px;"
69
+                   value-format="yyyy-MM-dd"
68 70
                   placeholder="选择日期">
69 71
                 </el-date-picker>
70 72
               </div>
@@ -120,7 +122,7 @@
120 122
             <div style="margin-top: 15px;">
121 123
               <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;margin-bottom: 5px;">详情</span>
122 124
               <keep-alive>
123
-                <ueditor ref="edit" :content="new_content" id="editor"></ueditor>
125
+                <ueditor ref="editor" :content="new_content" id="editors" :disabled="disabled"></ueditor>
124 126
               </keep-alive>
125 127
             </div>
126 128
             <div style="text-align: right;margin-top:10px ;">
@@ -132,6 +134,10 @@
132 134
         </div>
133 135
 
134 136
       </div>
137
+
138
+
139
+
140
+
135 141
       <el-dialog
136 142
         title="设置模板"
137 143
         :visible.sync="template_dialog"
@@ -143,7 +149,7 @@
143 149
         </div>
144 150
         <span slot="footer" class="dialog-footer">
145 151
           <el-button @click="template_dialog = false">取 消</el-button>
146
-          <el-button type="primary" @click="template_save">确 定</el-button>
152
+          <el-button type="primary" @click="saveTemplate">确 定</el-button>
147 153
         </span>
148 154
       </el-dialog>
149 155
       <el-dialog
@@ -156,19 +162,20 @@
156 162
           <div style="display: flex;">
157 163
             <div style="width: 27%;">
158 164
               <el-table
159
-                :data="tableData"
165
+                 ref="record_table_one"
166
+                :data="templateList"
160 167
                 :highlight-current-row="true"
161
-                @row-click="rowclick"
168
+                @current-change="getCurrentChangeOne"
162 169
                 style="width: 100%">
163
-                <el-table-column
164
-                  prop="index"
165
-                  label="序号"
166
-                  width="">
170
+                <el-table-column prop="index" label="序号" width="" align="center">
171
+                  <template slot-scope="scope">
172
+                       {{ scope.$index + 1 }}
173
+                   </template>
167 174
                 </el-table-column>
168
-                <el-table-column
169
-                  prop="name"
170
-                  label="模板名称"
171
-                  width="">
175
+                <el-table-column  prop="name" label="模板名称" width="" align="center">
176
+                  <template slot-scope="scope">
177
+                       {{ scope.row.title }}
178
+                   </template>
172 179
                 </el-table-column>
173 180
               </el-table>
174 181
             </div>
@@ -176,7 +183,7 @@
176 183
               <div class="Second_title">模板内容</div>
177 184
               <div style="">
178 185
                 <keep-alive>
179
-                  <ueditor ref="editor" id="editors" v-bind:r_content="new_content"></ueditor>
186
+                  <ueditor ref="editorOne" id="editors" :content="new_content"></ueditor>
180 187
                 </keep-alive>
181 188
               </div>
182 189
             </div>
@@ -185,7 +192,7 @@
185 192
         <span slot="footer" class="dialog-footer" style="text-align: center;">
186 193
           <el-button type="danger" @click="template_dele">删除模板</el-button>
187 194
           <el-button type="primary" @click="template_save">保存模板</el-button>
188
-          <el-button type="primary" @click="template_save">应用</el-button>
195
+          <el-button type="primary" @click="toContentPint">应用</el-button>
189 196
           <el-button @click="library_dialog = false">取消</el-button>
190 197
         </span>
191 198
       </el-dialog>
@@ -214,9 +221,13 @@ import { fetchAllDoctorAndNurse } from "@/api/doctor";
214 221
  import print from 'print-js'
215 222
 import {
216 223
   createNewSickHistoryRecord,
217
-  deleteSickHistoryRecords,
224
+  deleteNewSickHistory,
218 225
   getNewSickHistory,
219
-  ModifySickHistoryRecord
226
+  ModifySickHistoryRecord,
227
+  saveSickHistoryTemplate,
228
+  getSickHistoryTempalate,
229
+  modifySickHistoryTemplate,
230
+  deleteSickHistoryTempalte
220 231
 } from '@/api/patient'
221 232
 import { parseTime } from '@/utils'
222 233
 import BreadCrumb from '@/xt_pages/components/bread-crumb' 
@@ -286,6 +297,9 @@ export default {
286 297
       guomi_options:[{value:1,label:'无'},{value:2,label:'有'},{value:3,label:'不详'}],
287 298
       tableData:[],
288 299
       admin_user_id:"",
300
+      templateList:[],
301
+      template_content:"",
302
+      template_id:0,
289 303
     }
290 304
   },
291 305
   created() {
@@ -329,18 +343,34 @@ export default {
329 343
     this.fetchAllDoctorAndNurse()
330 344
 
331 345
   },
332
-  mounted(){
333
-    // setTimeout(()=>{
334
-      // console.log('1111222',this.new_content);
335
-
336
-    //   this.$refs.ue.parent.setDisabled()
337
-    // },10)
338
-  },
339 346
   methods: {
340 347
     template_dele(){
341
-
348
+     deleteSickHistoryTempalte(this.template_id).then(response=>{
349
+        if(response.data.state == 1){
350
+          var msg =  response.data.data.msg
351
+          this.$message.success("删除成功!")
352
+          this.getSickHistoryTempalateOne()
353
+        }
354
+     })
355
+    },
356
+    getSickHistoryTempalateOne(){
357
+      getSickHistoryTempalate().then(response=>{
358
+          if(response.data.state == 1){
359
+
360
+            this.templateList = []
361
+            this.templateList = response.data.data.templateList
362
+            if(this.templateList!=null && this.templateList.length>0){
363
+              this.$refs.record_table_one.setCurrentRow(this.templateList[0])
364
+            }
365
+          }
366
+        })
342 367
     },
343 368
     add_click(){
369
+      this.admin_user_id = ""
370
+      this.admin_user_id = this.$store.getters.xt_user.user.id
371
+      this.fetchAllDoctorAndNurse()
372
+      this.$refs.editor.contents = ""
373
+      this.id = 0
344 374
       this.disabled = false
345 375
       this.add_index = 1
346 376
     },
@@ -362,16 +392,36 @@ export default {
362 392
       if(this.add_index ==0){
363 393
         this.template_dialog = true
364 394
       }else{
365
-        this.library_dialog = true
395
+        getSickHistoryTempalate().then(response=>{
396
+          if(response.data.state == 1){
397
+            this.library_dialog = true
398
+            this.templateList = response.data.data.templateList
399
+            console.log("hahhahahaha",this.$refs)
400
+            if(this.templateList!=null && this.templateList.length>0){
401
+              this.$refs.record_table_one.setCurrentRow(this.templateList[0])
402
+            }
403
+            console.log("haaaaaaaaaaaaa",this.templateList)
404
+            
405
+          }
406
+        })
407
+     
366 408
       }
367 409
 
368 410
     },
369 411
     template_save(){
370
-      this.template_dialog = false
371
-      this.$message({
372
-        message: '模板设置成功',
373
-        type: 'success'
412
+       var params = {
413
+         template_id:this.template_id,
414
+         content:this.$refs.editorOne.contents
415
+       }
416
+      modifySickHistoryTemplate(params).then(response=>{
417
+         if(response.data.state == 1){
418
+           var msg = response.data.data.msg
419
+           this.$message.success("保存成功!")
420
+           this.template_dialog = false
421
+         }
374 422
       })
423
+    
424
+    
375 425
     },
376 426
     prints(){
377 427
       const style ='@media print{.content{width:960px;margin:0 auto;font-size: 23px;}}'
@@ -383,18 +433,15 @@ export default {
383 433
       })
384 434
     },
385 435
 
386
-
387
-
388
-
389 436
     fetchAllDoctorAndNurse() {
390 437
       fetchAllDoctorAndNurse().then(response => {
391 438
         if (response.data.state == 1) {
439
+          this.doctorOptions= []
392 440
           this.doctorOptions = response.data.data.doctors;
393 441
         }
394 442
       });
395 443
     },
396 444
   
397
-
398 445
     didChangeCurrentRecord: function(record) {
399 446
       this.current_select_record = record
400 447
     },
@@ -453,12 +500,14 @@ export default {
453 500
 
454 501
     createAction: function() {
455 502
     
456
-      this.new_content = this.$refs.edit.contents
503
+      console.log("hhhhhhhhhhhhhhhhhh",this.$refs)
504
+      this.new_content = this.$refs.editor.contents
457 505
       if (this.new_content.length == 0) {
458 506
         this.$message.error('请填写病程内容')
459 507
         return
460 508
       }
461 509
       let params = {
510
+        id:this.id,
462 511
         patient_id: this.patient_id,
463 512
         content: this.new_content,
464 513
         record_time: this.start_time,
@@ -469,7 +518,7 @@ export default {
469 518
         guominyaowu_desc:this.guominyaowu_desc,
470 519
         doctor_id: this.admin_user_id
471 520
       }
472
-      console.log("params-------------",params)
521
+     
473 522
       createNewSickHistoryRecord(params).then(response => {
474 523
          if(response.data.state == 1){
475 524
            var patientSickHistory = response.data.data.patientSickHistory
@@ -500,65 +549,34 @@ export default {
500 549
       console.log("select23322332",this.ids)
501 550
       this.selectingRows = selectRows
502 551
     },
503
-    deleteAction: function() {
504
-      if (this.selectingRows.length == 0) {
505
-        return
506
-      }
507
-      var ids = []
508
-      for (let index = 0; index < this.selectingRows.length; index++) {
509
-        const row = this.selectingRows[index]
510
-        ids.push(row.id)
511
-      }
512
-      var ids_str = ids.join(',')
513
-      this.loading = true
552
+    deleteAction(){
553
+        if(this.id == 0){
554
+          this.$message.error("请选择要删除的信息!")
555
+          return false
556
+        }
557
+        this.$confirm('确定要取消吗?', '提示', {
558
+          confirmButtonText: '确定',
559
+          cancelButtonText: '取消',
560
+          type: 'warning'
561
+        }).then(() => {
562
+          deleteNewSickHistory(this.id).then(response=>{
563
+            if (response.data.state==1) {
564
+              var msg = response.data.data.msg
565
+              this.$message.success("保存成功!")
566
+              this.getlist()
567
+            }
568
+          });
569
+        }).catch(() => {
514 570
 
515
-      let params={
516
-        patient_id:this.patient_id,
517
-        ids:ids_str,
518
-      }
571
+        });
519 572
 
520
-      deleteSickHistoryRecords(params).then(rs => {
521
-        var resp = rs.data
522
-        if (resp.state == 1) {
523
-          for (let id_index = 0; id_index < ids.length; id_index++) {
524
-            for (let record_index = 0; record_index < this.records.length; record_index++) {
525
-              if (ids[id_index] == this.records[record_index].id) {
526
-                this.records.splice(record_index, 1)
527
-                break
528
-              }
529
-            }
530
-          }
531
-          this.selectingRows = []
532
-          this.$message.success('已删除')
533 573
 
534
-        } else {
535
-          this.$message.error(resp.msg)
536
-        }
537
-        this.loading = false
538
-      }).catch(err => {
539
-        this.loading = false
540
-        this.$message.error(err)
541
-      })
542
-    },
574
+      },
575
+   
543 576
     showEdit() {
544
-      if (this.table_current_index == -1) {
545
-        this.$message.error('请选择要修改的病程内容')
546
-        return
547
-      }
548
-      this.edit_is_shenyizhishi = this.records[this.table_current_index].is_shenyizhi_history.toString()
549
-      this.edit_is_fumotouxishi = this.records[this.table_current_index].is_fumo_dialysis_history.toString()
550
-      this.edit_is_guominyaowu = this.records[this.table_current_index].is_hypersusceptibility.toString()
551
-      this.edit_guominyaowu_desc = this.records[this.table_current_index].hypersusceptibility_desc
552
-      this.edit_sick_history_time = this.recordTime(this.records[this.table_current_index].record_time)
553
-      this.edit_new_content = this.records[this.table_current_index].content
554
-      this.edit_current_id = this.records[this.table_current_index].id
555
-      this.edit_doctor_id = this.records[this.table_current_index].doctor_id
556
-      console.log(this.edit_new_content )
557
-      this.edit_title = this.records[this.table_current_index].title//
558
-      this.show_edit_dialog = true
559
-
560
-      this.$refs.record_table.setCurrentRow(null)
561
-
577
+      this.add_index =1
578
+      this.disabled = false
579
+   
562 580
     }, tableRow({ row, rowIndex }) {
563 581
       // 把每一行的索引放进row
564 582
       row.index = rowIndex
@@ -566,10 +584,6 @@ export default {
566 584
       this.table_current_index = row.index
567 585
     },
568 586
     print(){
569
-      // if (this.table_current_index == -1) {
570
-      //   this.$message.error('请选择要打印的病程')
571
-      //   return
572
-      // }
573 587
       if(this.ids.length == 0){
574 588
         this.$message.error('请选择要打印的病程')
575 589
         return
@@ -601,24 +615,49 @@ export default {
601 615
       return uParseTime(time, '{y}-{m}-{d}')
602 616
     },
603 617
     getCurrentChange(val){
604
-      
605
-      console.log("new_content2222222222222222222---------------",val.content)
606
-      this.new_content = ""
607
-      this.new_content = val.content
608
-      // var ue = UE.getEditor('editor')
609
-      // ue.setContent(val.content)
610
-     
618
+      this.$refs.editor.contents = val.content
611 619
       this.record_time = this.getTime(val.record_time)
612 620
       this.id = val.id
613 621
       this.guominyaowu_desc = val.hypersusceptibility_desc
614
-      this.shen_fumo = val.is_fumo_dialysis_history
615
-      this.shen_yizhi  = val.is_shenyizhi_history
616
-      this.shen_guomi = val.is_hypersusceptibility
617
-      this.patient_id = val.patient_id
618
-     
619
-     
622
+      if(val.is_fumo_dialysis_history>0){
623
+        this.shen_fumo = val.is_fumo_dialysis_history
624
+      }
625
+      if(val.is_shenyizhi_history>0){
626
+        this.shen_yizhi  = val.is_shenyizhi_history
627
+      }
628
+      if(val.is_hypersusceptibility>0){
629
+        this.shen_guomi = val.is_hypersusceptibility
630
+      }
620 631
       
621
-    }
632
+      this.patient_id = val.patient_id
633
+      this.admin_user_id = val.admin_user_id
634
+    
635
+    },
636
+    getCurrentChangeOne(val){
637
+   
638
+      this.$refs.editorOne.contents = val.content
639
+      this.template_content = ""
640
+      this.template_content = val.content
641
+      this.template_id = val.id
642
+    },
643
+    saveTemplate(){
644
+   
645
+      var params = {
646
+        title:this.template_name,
647
+        content: this.$refs.editor.contents,
648
+      }
649
+   saveSickHistoryTemplate(params).then(response=>{
650
+      if(response.data.state == 1){
651
+        var sickHistoryTemplate =  response.data.data.sickHistoryTemplate
652
+        this.$message.success("保存成功!")
653
+        this.template_dialog = false
654
+      }
655
+     })
656
+   },
657
+   toContentPint(){
658
+    this.$refs.editor.contents = this.template_content
659
+    this.library_dialog = false
660
+   }
622 661
   }
623 662
 }
624 663
 </script>