Browse Source

Merge remote-tracking branch 'origin/20230223_pc_vue_new_branch' into 20230223_pc_vue_new_branch

yq1 6 months ago
parent
commit
735ae476e9

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

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
+}

+ 1 - 1
src/xt_pages/Pharmacy/PatientDispensing.vue View File

430
     changevalue(row){
430
     changevalue(row){
431
       var params = {
431
       var params = {
432
         id:row.ID,
432
         id:row.ID,
433
-        zero_flag:row.zero_flag,
433
+        zero_flag:row.ZeroFlag,
434
       }
434
       }
435
       changeZeroFlag(params).then(response=>{
435
       changeZeroFlag(params).then(response=>{
436
         if(response.data.state == 1){
436
         if(response.data.state == 1){

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

299
                 this.tableData[i].is_medicine_name = "未发药"
299
                 this.tableData[i].is_medicine_name = "未发药"
300
              }
300
              }
301
              this.tableData[i].specification_name = this.getDrugSpec(this.tableData[i].drug_id)
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
               name: '3-1',
167
               name: '3-1',
168
               label: '病史'
168
               label: '病史'
169
             },
169
             },
170
-            // {
171
-            //   name: '3-4',
172
-            //   label: '病史新'
173
-            // },
170
+            {
171
+              name: '3-4',
172
+              label: '病史新'
173
+            },
174
             {
174
             {
175
               name: '3-2',
175
               name: '3-2',
176
               label: '体格检查'
176
               label: '体格检查'

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

67
               <div style="flex: 1;">
67
               <div style="flex: 1;">
68
                 记录时间:
68
                 记录时间:
69
                 <el-date-picker
69
                 <el-date-picker
70
-                  v-model="value1"
70
+                  v-model="record_date"
71
+                  type="date"
72
+                  format="yyyy-MM-dd"
71
                   :disabled="disabled"
73
                   :disabled="disabled"
72
-                  type="datetime"
73
-                  placeholder="选择日期时间">
74
+                  style="width: 150px;"
75
+                   value-format="yyyy-MM-dd"
76
+                  placeholder="选择日期">
74
                 </el-date-picker>
77
                 </el-date-picker>
75
               </div>
78
               </div>
76
               <div style="flex: 1;">
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
                   <el-option
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
                   </el-option>
87
                   </el-option>
85
                 </el-select>
88
                 </el-select>
86
               </div>
89
               </div>
102
           </div>
105
           </div>
103
         </div>
106
         </div>
104
       </div>
107
       </div>
108
+
109
+
105
       <el-dialog
110
       <el-dialog
106
         title="设置模板"
111
         title="设置模板"
107
         :visible.sync="template_dialog"
112
         :visible.sync="template_dialog"
245
                 <editor ref="editor"
250
                 <editor ref="editor"
246
                         id="editors"
251
                         id="editors"
247
                         style="width: 80%"
252
                         style="width: 80%"
248
-                        v-bind:r_content="new_content"
253
+                        :content="new_content"
249
                         >
254
                         >
250
                 </editor>
255
                 </editor>
251
               </keep-alive>
256
               </keep-alive>
320
   const moment = require('moment')
325
   const moment = require('moment')
321
   import { getDataConfig } from "@/utils/data";
326
   import { getDataConfig } from "@/utils/data";
322
   import {
327
   import {
323
-    createCourseOfDiseaseRecord,
328
+    createNewCourseOfDiseaseRecord,
324
     deleteCourseOfDiseaseRecords,
329
     deleteCourseOfDiseaseRecords,
325
     getCourseOfDiseaseRecords,
330
     getCourseOfDiseaseRecords,
326
     modifyCourseOfDiseaseRecord,
331
     modifyCourseOfDiseaseRecord,
327
-    GetCoursePrintData,
328
     getPatientDialysisInfor
332
     getPatientDialysisInfor
329
   } from '@/api/patient'
333
   } from '@/api/patient'
334
+  import { fetchAllDoctorAndNurse } from "@/api/doctor";
330
   import { parseTime } from '@/utils'
335
   import { parseTime } from '@/utils'
331
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
336
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
332
   import { uParseTime } from '@/utils/tools'
337
   import { uParseTime } from '@/utils/tools'
366
         ids:"",
371
         ids:"",
367
         idArr:[],
372
         idArr:[],
368
         org_id:0,
373
         org_id:0,
369
-
370
-
371
         add_index:0,
374
         add_index:0,
372
         disabled:true,
375
         disabled:true,
373
         template_dialog:false,
376
         template_dialog:false,
378
         end_date:'',
381
         end_date:'',
379
         quzhi_options:[{value:1,label:'本周'},{value:2,label:'上周'},{value:3,label:'本月'},{value:4,label:'上周'},],
382
         quzhi_options:[{value:1,label:'本周'},{value:2,label:'上周'},{value:3,label:'本月'},{value:4,label:'上周'},],
380
         tableData:[{index:1,date:'2024-11-12',doctor:'王启年'}],
383
         tableData:[{index:1,date:'2024-11-12',doctor:'王启年'}],
384
+        admin_user_id:0,
385
+        record_date:""
381
       }
386
       }
382
     },
387
     },
383
     created() {
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
       this.patient_id = parseInt(this.$route.query.id)
408
       this.patient_id = parseInt(this.$route.query.id)
385
       this.org_id = this.$store.getters.xt_user.template_info.org_id;
409
       this.org_id = this.$store.getters.xt_user.template_info.org_id;
386
       if (isNaN(this.patient_id) || this.patient_id <= 0) {
410
       if (isNaN(this.patient_id) || this.patient_id <= 0) {
391
         this.$router.push('/patients/patients')
415
         this.$router.push('/patients/patients')
392
         return
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
       this.requestCourseRecords()
424
       this.requestCourseRecords()
425
+     
412
 
426
 
413
     },
427
     },
414
     methods: {
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
       add_click(){
437
       add_click(){
416
         this.add_index = 1
438
         this.add_index = 1
417
         this.disabled = false
439
         this.disabled = false
423
       showSave(){
445
       showSave(){
424
         this.add_index = 0
446
         this.add_index = 0
425
         this.disabled = true
447
         this.disabled = true
448
+        saveNewCousreOfDisease().then(response=>{
449
+
450
+        })
426
       },
451
       },
427
       template_click(){
452
       template_click(){
428
         console.log('this.add_index',this.add_index);
453
         console.log('this.add_index',this.add_index);
516
       },
541
       },
517
 
542
 
518
       createAction: function() {
543
       createAction: function() {
519
-        this.new_content = this.$refs.editor.content
544
+        this.new_content = this.$refs.editor.contents
520
         console.log("hhhhh2h3h232323232",this.new_content)
545
         console.log("hhhhh2h3h232323232",this.new_content)
521
         if (this.new_content.length == 0) {
546
         if (this.new_content.length == 0) {
522
           this.$message.error('请填写病程内容')
547
           this.$message.error('请填写病程内容')
523
           return
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
         }).catch(error => {
561
         }).catch(error => {
544
-          this.uploading_new_record = false
545
-          this.$message.error(error)
562
+         
546
         })
563
         })
547
       },
564
       },
548
       didSelectTemplate: function(templateContent) {
565
       didSelectTemplate: function(templateContent) {

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

52
                   <el-button type="primary" size="small" @click="prints">打印</el-button>
52
                   <el-button type="primary" size="small" @click="prints">打印</el-button>
53
                 </div>
53
                 </div>
54
                 <div v-if="add_index == 1">
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
                   <el-button size="small" @click="showCancel">取消</el-button>
56
                   <el-button size="small" @click="showCancel">取消</el-button>
57
                 </div>
57
                 </div>
58
               </div>
58
               </div>
63
                 <el-date-picker
63
                 <el-date-picker
64
                   v-model="start_time"
64
                   v-model="start_time"
65
                   type="date"
65
                   type="date"
66
+                  format="yyyy-MM-dd"
66
                   :disabled="disabled"
67
                   :disabled="disabled"
67
                   style="width: 150px;"
68
                   style="width: 150px;"
69
+                   value-format="yyyy-MM-dd"
68
                   placeholder="选择日期">
70
                   placeholder="选择日期">
69
                 </el-date-picker>
71
                 </el-date-picker>
70
               </div>
72
               </div>
120
             <div style="margin-top: 15px;">
122
             <div style="margin-top: 15px;">
121
               <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;margin-bottom: 5px;">详情</span>
123
               <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;margin-bottom: 5px;">详情</span>
122
               <keep-alive>
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
               </keep-alive>
126
               </keep-alive>
125
             </div>
127
             </div>
126
             <div style="text-align: right;margin-top:10px ;">
128
             <div style="text-align: right;margin-top:10px ;">
132
         </div>
134
         </div>
133
 
135
 
134
       </div>
136
       </div>
137
+
138
+
139
+
140
+
135
       <el-dialog
141
       <el-dialog
136
         title="设置模板"
142
         title="设置模板"
137
         :visible.sync="template_dialog"
143
         :visible.sync="template_dialog"
143
         </div>
149
         </div>
144
         <span slot="footer" class="dialog-footer">
150
         <span slot="footer" class="dialog-footer">
145
           <el-button @click="template_dialog = false">取 消</el-button>
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
         </span>
153
         </span>
148
       </el-dialog>
154
       </el-dialog>
149
       <el-dialog
155
       <el-dialog
156
           <div style="display: flex;">
162
           <div style="display: flex;">
157
             <div style="width: 27%;">
163
             <div style="width: 27%;">
158
               <el-table
164
               <el-table
159
-                :data="tableData"
165
+                 ref="record_table_one"
166
+                :data="templateList"
160
                 :highlight-current-row="true"
167
                 :highlight-current-row="true"
161
-                @row-click="rowclick"
168
+                @current-change="getCurrentChangeOne"
162
                 style="width: 100%">
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
                 </el-table-column>
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
                 </el-table-column>
179
                 </el-table-column>
173
               </el-table>
180
               </el-table>
174
             </div>
181
             </div>
176
               <div class="Second_title">模板内容</div>
183
               <div class="Second_title">模板内容</div>
177
               <div style="">
184
               <div style="">
178
                 <keep-alive>
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
                 </keep-alive>
187
                 </keep-alive>
181
               </div>
188
               </div>
182
             </div>
189
             </div>
185
         <span slot="footer" class="dialog-footer" style="text-align: center;">
192
         <span slot="footer" class="dialog-footer" style="text-align: center;">
186
           <el-button type="danger" @click="template_dele">删除模板</el-button>
193
           <el-button type="danger" @click="template_dele">删除模板</el-button>
187
           <el-button type="primary" @click="template_save">保存模板</el-button>
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
           <el-button @click="library_dialog = false">取消</el-button>
196
           <el-button @click="library_dialog = false">取消</el-button>
190
         </span>
197
         </span>
191
       </el-dialog>
198
       </el-dialog>
214
  import print from 'print-js'
221
  import print from 'print-js'
215
 import {
222
 import {
216
   createNewSickHistoryRecord,
223
   createNewSickHistoryRecord,
217
-  deleteSickHistoryRecords,
224
+  deleteNewSickHistory,
218
   getNewSickHistory,
225
   getNewSickHistory,
219
-  ModifySickHistoryRecord
226
+  ModifySickHistoryRecord,
227
+  saveSickHistoryTemplate,
228
+  getSickHistoryTempalate,
229
+  modifySickHistoryTemplate,
230
+  deleteSickHistoryTempalte
220
 } from '@/api/patient'
231
 } from '@/api/patient'
221
 import { parseTime } from '@/utils'
232
 import { parseTime } from '@/utils'
222
 import BreadCrumb from '@/xt_pages/components/bread-crumb' 
233
 import BreadCrumb from '@/xt_pages/components/bread-crumb' 
286
       guomi_options:[{value:1,label:'无'},{value:2,label:'有'},{value:3,label:'不详'}],
297
       guomi_options:[{value:1,label:'无'},{value:2,label:'有'},{value:3,label:'不详'}],
287
       tableData:[],
298
       tableData:[],
288
       admin_user_id:"",
299
       admin_user_id:"",
300
+      templateList:[],
301
+      template_content:"",
302
+      template_id:0,
289
     }
303
     }
290
   },
304
   },
291
   created() {
305
   created() {
329
     this.fetchAllDoctorAndNurse()
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
   methods: {
346
   methods: {
340
     template_dele(){
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
     add_click(){
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
       this.disabled = false
374
       this.disabled = false
345
       this.add_index = 1
375
       this.add_index = 1
346
     },
376
     },
362
       if(this.add_index ==0){
392
       if(this.add_index ==0){
363
         this.template_dialog = true
393
         this.template_dialog = true
364
       }else{
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
     template_save(){
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
     prints(){
426
     prints(){
377
       const style ='@media print{.content{width:960px;margin:0 auto;font-size: 23px;}}'
427
       const style ='@media print{.content{width:960px;margin:0 auto;font-size: 23px;}}'
383
       })
433
       })
384
     },
434
     },
385
 
435
 
386
-
387
-
388
-
389
     fetchAllDoctorAndNurse() {
436
     fetchAllDoctorAndNurse() {
390
       fetchAllDoctorAndNurse().then(response => {
437
       fetchAllDoctorAndNurse().then(response => {
391
         if (response.data.state == 1) {
438
         if (response.data.state == 1) {
439
+          this.doctorOptions= []
392
           this.doctorOptions = response.data.data.doctors;
440
           this.doctorOptions = response.data.data.doctors;
393
         }
441
         }
394
       });
442
       });
395
     },
443
     },
396
   
444
   
397
-
398
     didChangeCurrentRecord: function(record) {
445
     didChangeCurrentRecord: function(record) {
399
       this.current_select_record = record
446
       this.current_select_record = record
400
     },
447
     },
453
 
500
 
454
     createAction: function() {
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
       if (this.new_content.length == 0) {
505
       if (this.new_content.length == 0) {
458
         this.$message.error('请填写病程内容')
506
         this.$message.error('请填写病程内容')
459
         return
507
         return
460
       }
508
       }
461
       let params = {
509
       let params = {
510
+        id:this.id,
462
         patient_id: this.patient_id,
511
         patient_id: this.patient_id,
463
         content: this.new_content,
512
         content: this.new_content,
464
         record_time: this.start_time,
513
         record_time: this.start_time,
469
         guominyaowu_desc:this.guominyaowu_desc,
518
         guominyaowu_desc:this.guominyaowu_desc,
470
         doctor_id: this.admin_user_id
519
         doctor_id: this.admin_user_id
471
       }
520
       }
472
-      console.log("params-------------",params)
521
+     
473
       createNewSickHistoryRecord(params).then(response => {
522
       createNewSickHistoryRecord(params).then(response => {
474
          if(response.data.state == 1){
523
          if(response.data.state == 1){
475
            var patientSickHistory = response.data.data.patientSickHistory
524
            var patientSickHistory = response.data.data.patientSickHistory
500
       console.log("select23322332",this.ids)
549
       console.log("select23322332",this.ids)
501
       this.selectingRows = selectRows
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
     showEdit() {
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
     }, tableRow({ row, rowIndex }) {
580
     }, tableRow({ row, rowIndex }) {
563
       // 把每一行的索引放进row
581
       // 把每一行的索引放进row
564
       row.index = rowIndex
582
       row.index = rowIndex
566
       this.table_current_index = row.index
584
       this.table_current_index = row.index
567
     },
585
     },
568
     print(){
586
     print(){
569
-      // if (this.table_current_index == -1) {
570
-      //   this.$message.error('请选择要打印的病程')
571
-      //   return
572
-      // }
573
       if(this.ids.length == 0){
587
       if(this.ids.length == 0){
574
         this.$message.error('请选择要打印的病程')
588
         this.$message.error('请选择要打印的病程')
575
         return
589
         return
601
       return uParseTime(time, '{y}-{m}-{d}')
615
       return uParseTime(time, '{y}-{m}-{d}')
602
     },
616
     },
603
     getCurrentChange(val){
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
       this.record_time = this.getTime(val.record_time)
619
       this.record_time = this.getTime(val.record_time)
612
       this.id = val.id
620
       this.id = val.id
613
       this.guominyaowu_desc = val.hypersusceptibility_desc
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
 </script>
663
 </script>