|
@@ -283,7 +283,7 @@ export default {
|
283
|
283
|
var params = {
|
284
|
284
|
patient: this.patientID,
|
285
|
285
|
date: this.itemDate,
|
286
|
|
- project_id: this.project.project_id
|
|
286
|
+ project_id: 14
|
287
|
287
|
}
|
288
|
288
|
DeletePatientInspection(params).then(response => {
|
289
|
289
|
if (response.data.state == 0) {
|
|
@@ -322,65 +322,60 @@ export default {
|
322
|
322
|
}
|
323
|
323
|
|
324
|
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
|
327
|
this.form.inspect_date = this.itemDate
|
328
|
328
|
this.form.old_inspect_date = this.itemDate
|
329
|
329
|
this.form.remind_cycle = this.patient_info.remind_cycle
|
330
|
330
|
console.log(this.form.remind_cycle)
|
331
|
331
|
|
332
|
332
|
this.form.formItem = []
|
333
|
|
- for (var index in this.project.inspection_reference) {
|
|
333
|
+
|
|
334
|
+ for (var index in this.project) {
|
334
|
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
|
348
|
console.log(this.form.formItem)
|
348
|
349
|
this.dialogFormVisible = true
|
349
|
350
|
},
|
350
|
351
|
openNew() {
|
|
352
|
+
|
351
|
353
|
if (this.project == null) {
|
352
|
354
|
this.$message.error('请先选择项目')
|
353
|
355
|
return false
|
354
|
356
|
}
|
355
|
357
|
this.form.method = 'add'
|
356
|
358
|
this.formTitle = '新增' + this.project.project_name
|
357
|
|
- this.form.project_id = this.project.project_id
|
|
359
|
+ this.form.project_id = 14
|
358
|
360
|
this.form.remind_cycle = this.patient_info.remind_cycle
|
359
|
361
|
var today = new Date()
|
360
|
362
|
this.form.inspect_date = uParseTime(today, '{y}-{m}-{d} {h}:{i}')
|
361
|
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
|
379
|
this.dialogFormVisible = true
|
385
|
380
|
},
|
386
|
381
|
submitEdit(formName) {
|
|
@@ -421,7 +416,7 @@ export default {
|
421
|
416
|
this.inspectionsMap[inspections[index].item_id] =
|
422
|
417
|
inspections[index]
|
423
|
418
|
}
|
424
|
|
- var items = this.project.inspection_reference
|
|
419
|
+ var items = this.project
|
425
|
420
|
for (var index in items) {
|
426
|
421
|
if (items[index].id in inspectionsMap) {
|
427
|
422
|
var item = {}
|
|
@@ -463,6 +458,7 @@ export default {
|
463
|
458
|
})
|
464
|
459
|
},
|
465
|
460
|
submitNew(formName) {
|
|
461
|
+
|
466
|
462
|
this.$refs[formName].validate(valid => {
|
467
|
463
|
if (valid) {
|
468
|
464
|
this.formLoading = true
|
|
@@ -474,6 +470,10 @@ export default {
|
474
|
470
|
this.form.formItem[index].value =
|
475
|
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
|
477
|
CreatePatientInspection(
|
478
|
478
|
this.patientID,
|
479
|
479
|
this.form,
|
|
@@ -494,11 +494,12 @@ export default {
|
494
|
494
|
|
495
|
495
|
this.itemDate = this.form.inspect_date
|
496
|
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
|
504
|
this.total += 1
|
504
|
505
|
var inspections = response.data.data.inspections
|
|
@@ -515,7 +516,7 @@ export default {
|
515
|
516
|
this.inspectionsMap[inspections[index].item_id] =
|
516
|
517
|
inspections[index]
|
517
|
518
|
}
|
518
|
|
- var items = this.project.inspection_reference
|
|
519
|
+ var items = this.project
|
519
|
520
|
for (var index in items) {
|
520
|
521
|
if (items[index].id in inspectionsMap) {
|
521
|
522
|
var item = {}
|
|
@@ -542,7 +543,7 @@ export default {
|
542
|
543
|
this.dialogFormVisible = false
|
543
|
544
|
|
544
|
545
|
this.queryParams.patient = this.patientID
|
545
|
|
- this.queryParams.project_id = this.project.project_id
|
|
546
|
+ this.queryParams.project_id = 14
|
546
|
547
|
this.queryParams.page = 1
|
547
|
548
|
this.total = 0
|
548
|
549
|
this.fetchPatientInspections(this.queryParams)
|
|
@@ -566,21 +567,21 @@ export default {
|
566
|
567
|
fetchInspectionReference(this.patientID)
|
567
|
568
|
.then(response => {
|
568
|
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
|
574
|
var patient_info = response.data.data.patient_info
|
573
|
|
- this.projects = reference
|
|
575
|
+ this.projects = list
|
574
|
576
|
this.patient_info = patient_info
|
575
|
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
|
586
|
this.queryParams.patient = this.patientID
|
586
|
587
|
this.queryParams.project_id = project_id
|
|
@@ -631,7 +632,7 @@ export default {
|
631
|
632
|
inspectionsMap[inspections[index].item_id] = inspections[index]
|
632
|
633
|
this.inspectionsMap[inspections[index].item_id] = inspections[index]
|
633
|
634
|
}
|
634
|
|
- var items = this.project.inspection_reference
|
|
635
|
+ var items = this.project
|
635
|
636
|
console.log("items222222222",items)
|
636
|
637
|
for (var index in items) {
|
637
|
638
|
if (items[index].id in inspectionsMap || items[index].item_id in inspectionsMap) {
|