XMLWAN 4 years ago
parent
commit
ca7423d86c

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

106
               name: '1-3',
106
               name: '1-3',
107
               label: '检验检查'
107
               label: '检验检查'
108
             },
108
             },
109
-            // {
110
-            //   name:'1-8',
111
-            //   label:'传染病管理'
112
-            // },
109
+            {
110
+              name:'1-8',
111
+              label:'传染病管理'
112
+            },
113
             {
113
             {
114
               name: '1-5',
114
               name: '1-5',
115
               label: '抢救记录'
115
               label: '抢救记录'

+ 58 - 57
src/xt_pages/user/inspectionInfectious.vue View File

283
           var params = {
283
           var params = {
284
             patient: this.patientID,
284
             patient: this.patientID,
285
             date: this.itemDate,
285
             date: this.itemDate,
286
-            project_id: this.project.project_id
286
+            project_id: 14
287
           }
287
           }
288
           DeletePatientInspection(params).then(response => {
288
           DeletePatientInspection(params).then(response => {
289
             if (response.data.state == 0) {
289
             if (response.data.state == 0) {
322
       }
322
       }
323
 
323
 
324
       this.form.method = 'edit'
324
       this.form.method = 'edit'
325
-      this.formTitle = '修改' + this.project.project_name
326
-      this.form.project_id = this.project.project_id
325
+      this.formTitle = '修改' 
326
+      this.form.project_id = 14
327
       this.form.inspect_date = this.itemDate
327
       this.form.inspect_date = this.itemDate
328
       this.form.old_inspect_date = this.itemDate
328
       this.form.old_inspect_date = this.itemDate
329
       this.form.remind_cycle = this.patient_info.remind_cycle
329
       this.form.remind_cycle = this.patient_info.remind_cycle
330
       console.log(this.form.remind_cycle)
330
       console.log(this.form.remind_cycle)
331
 
331
 
332
       this.form.formItem = []
332
       this.form.formItem = []
333
-      for (var index in this.project.inspection_reference) {
333
+    
334
+      for (var index in this.project) {
334
         this.form.formItem.push({
335
         this.form.formItem.push({
335
-          id: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].id : 0,
336
-          project_id: this.project.inspection_reference[index].project_id,
337
-          project_name: this.project.inspection_reference[index].project_name,
338
-          item_id: this.project.inspection_reference[index].id,
339
-          item: this.project.inspection_reference[index].item,
340
-          item_name: this.project.inspection_reference[index].item_name,
341
-          range_type: this.project.inspection_reference[index].range_type,
342
-          value: this.project.inspection_reference[index].id in this.inspectionsMap ? this.inspectionsMap[this.project.inspection_reference[index].id].inspect_value : '',
343
-          select_options: this.project.inspection_reference[index].range_options.split(','),
344
-          unit: this.project.inspection_reference[index].unit
336
+          id: this.project[index].id in this.inspectionsMap ? this.inspectionsMap[this.project[index].id].id : 0,
337
+          project_id: this.project[index].project_id,
338
+          project_name: this.project[index].project_name,
339
+          item_id: this.project[index].id,
340
+          item: this.project[index].item,
341
+          item_name: this.project[index].item_name,
342
+          range_type: this.project[index].range_type,
343
+          value: this.project[index].id in this.inspectionsMap ? this.inspectionsMap[this.project[index].id].inspect_value : '',
344
+          select_options: this.project[index].range_options.split(','),
345
+          unit: this.project[index].unit
345
         })
346
         })
346
       }
347
       }
347
       console.log(this.form.formItem)
348
       console.log(this.form.formItem)
348
       this.dialogFormVisible = true
349
       this.dialogFormVisible = true
349
     },
350
     },
350
     openNew() {
351
     openNew() {
352
+     
351
       if (this.project == null) {
353
       if (this.project == null) {
352
         this.$message.error('请先选择项目')
354
         this.$message.error('请先选择项目')
353
         return false
355
         return false
354
       }
356
       }
355
       this.form.method = 'add'
357
       this.form.method = 'add'
356
       this.formTitle = '新增' + this.project.project_name
358
       this.formTitle = '新增' + this.project.project_name
357
-      this.form.project_id = this.project.project_id
359
+      this.form.project_id = 14
358
       this.form.remind_cycle = this.patient_info.remind_cycle
360
       this.form.remind_cycle = this.patient_info.remind_cycle
359
       var today = new Date()
361
       var today = new Date()
360
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
362
       this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
361
       this.form.formItem = []
363
       this.form.formItem = []
362
-      for (var index in this.project.inspection_reference) {
363
-        // var formItem = this.project.inspection_reference[index];
364
-        // formItem["value"] = '';
365
-        // if (formItem.range_type==2) {
366
-        //   formItem["select_options"] = formItem.range_options.split(",");
367
-        // }
368
-        this.form.formItem.push({
369
-          id: 0,
370
-          project_id: this.project.inspection_reference[index].project_id,
371
-          project_name: this.project.inspection_reference[index].project_name,
372
-          item_id: this.project.inspection_reference[index].id,
373
-          item: this.project.inspection_reference[index].item,
374
-          item_name: this.project.inspection_reference[index].item_name,
375
-          range_type: this.project.inspection_reference[index].range_type,
376
-          value: '',
377
-          select_options: this.project.inspection_reference[
378
-            index
379
-          ].range_options.split(','),
380
-          unit: this.project.inspection_reference[index].unit
381
-        })
382
-      }
383
 
364
 
365
+      for(let i=0;i<this.project.length;i++){
366
+          this.form.formItem.push({
367
+            id:0,
368
+            project_id: 14,
369
+            project_name: this.project[i].project_name,
370
+            item_id: this.project[i].id,
371
+            item: this.project[i].item,
372
+            item_name: this.project[i].item_name,
373
+            range_type: this.project[i].range_type,
374
+            value: '',
375
+            select_options: (this.project[i].range_options).split(','),
376
+            unit: this.project[i].unit
377
+          })
378
+      }
384
       this.dialogFormVisible = true
379
       this.dialogFormVisible = true
385
     },
380
     },
386
     submitEdit(formName) {
381
     submitEdit(formName) {
421
                 this.inspectionsMap[inspections[index].item_id] =
416
                 this.inspectionsMap[inspections[index].item_id] =
422
                     inspections[index]
417
                     inspections[index]
423
               }
418
               }
424
-              var items = this.project.inspection_reference
419
+              var items = this.project
425
               for (var index in items) {
420
               for (var index in items) {
426
                 if (items[index].id in inspectionsMap) {
421
                 if (items[index].id in inspectionsMap) {
427
                   var item = {}
422
                   var item = {}
463
       })
458
       })
464
     },
459
     },
465
     submitNew(formName) {
460
     submitNew(formName) {
461
+     
466
       this.$refs[formName].validate(valid => {
462
       this.$refs[formName].validate(valid => {
467
         if (valid) {
463
         if (valid) {
468
           this.formLoading = true
464
           this.formLoading = true
474
             this.form.formItem[index].value =
470
             this.form.formItem[index].value =
475
               '' + this.form.formItem[index].value
471
               '' + this.form.formItem[index].value
476
           }
472
           }
473
+          console.log("22222",this.form)
474
+          console.log("33333",this.patientID)
475
+          console.log("444444",this.form.remind_cycle)
476
+         
477
           CreatePatientInspection(
477
           CreatePatientInspection(
478
             this.patientID,
478
             this.patientID,
479
             this.form,
479
             this.form,
494
 
494
 
495
                 this.itemDate = this.form.inspect_date
495
                 this.itemDate = this.form.inspect_date
496
                 this.items = []
496
                 this.items = []
497
-                for (var index in this.projects) {
498
-                  if (this.projects[index].project_id == this.form.project_id) {
499
-                    this.projects[index].count++
500
-                    break
501
-                  }
497
+              
498
+                for(let i=0;i<this.projects.length;i++){
499
+                   if(this.projects[i].project_id == this.form.project_id){
500
+                      this.projects[i].count ++
501
+                      break
502
+                   }
502
                 }
503
                 }
503
                 this.total += 1
504
                 this.total += 1
504
                 var inspections = response.data.data.inspections
505
                 var inspections = response.data.data.inspections
515
                   this.inspectionsMap[inspections[index].item_id] =
516
                   this.inspectionsMap[inspections[index].item_id] =
516
                     inspections[index]
517
                     inspections[index]
517
                 }
518
                 }
518
-                var items = this.project.inspection_reference
519
+                var items = this.project
519
                 for (var index in items) {
520
                 for (var index in items) {
520
                   if (items[index].id in inspectionsMap) {
521
                   if (items[index].id in inspectionsMap) {
521
                     var item = {}
522
                     var item = {}
542
                 this.dialogFormVisible = false
543
                 this.dialogFormVisible = false
543
 
544
 
544
                 this.queryParams.patient = this.patientID
545
                 this.queryParams.patient = this.patientID
545
-                this.queryParams.project_id = this.project.project_id
546
+                this.queryParams.project_id = 14
546
                 this.queryParams.page = 1
547
                 this.queryParams.page = 1
547
                 this.total = 0
548
                 this.total = 0
548
                 this.fetchPatientInspections(this.queryParams)
549
                 this.fetchPatientInspections(this.queryParams)
566
       fetchInspectionReference(this.patientID)
567
       fetchInspectionReference(this.patientID)
567
         .then(response => {
568
         .then(response => {
568
           if (response.data.state == 1) {
569
           if (response.data.state == 1) {
569
-            var reference = response.data.data.reference
570
-            console.log("reference22222",reference)
571
-          
570
+            // var reference = response.data.data.reference
571
+            // console.log("reference22222",reference)
572
+            var list = response.data.data.list
573
+            console.log("list2222",list)
572
             var patient_info = response.data.data.patient_info
574
             var patient_info = response.data.data.patient_info
573
-            this.projects = reference
575
+            this.projects = list
574
             this.patient_info = patient_info
576
             this.patient_info = patient_info
575
             var project_id = 0
577
             var project_id = 0
576
-            for(let i=0;i<reference.length;i++){
577
-               if(reference[i].project_name == "传染病检查"){
578
-                 project_id = reference[i].project_id
579
-                 this.project = reference[i]
580
-                 this.itemLoading = true
581
-                 this.items = reference[i].inspection_reference
582
-                 this.itemName = reference[i].project_name
583
-               }
578
+            for(let i=0;i<list.length;i++){
579
+              project_id = 14
580
+              this.project = list
581
+              this.itemLoading = true
582
+              this.items = list
583
+              this.itemName =list[i].project_name
584
+               
584
             }
585
             }
585
             this.queryParams.patient = this.patientID
586
             this.queryParams.patient = this.patientID
586
             this.queryParams.project_id = project_id
587
             this.queryParams.project_id = project_id
631
               inspectionsMap[inspections[index].item_id] = inspections[index]
632
               inspectionsMap[inspections[index].item_id] = inspections[index]
632
               this.inspectionsMap[inspections[index].item_id] = inspections[index]
633
               this.inspectionsMap[inspections[index].item_id] = inspections[index]
633
             }
634
             }
634
-            var items = this.project.inspection_reference
635
+            var items = this.project
635
             console.log("items222222222",items)
636
             console.log("items222222222",items)
636
             for (var index in items) {
637
             for (var index in items) {
637
               if (items[index].id in inspectionsMap || items[index].item_id in inspectionsMap) {
638
               if (items[index].id in inspectionsMap || items[index].item_id in inspectionsMap) {