瀏覽代碼

Merge branch '20201109_pc_vue_new_branch' of http://git.shengws.com/csx/Vue_New into 20201109_pc_vue_new_branch

csx 3 年之前
父節點
當前提交
2d73ef15da

+ 1 - 1
src/api/his/his.js 查看文件

@@ -528,7 +528,7 @@ export function getPrivateExpensesOrder(params) {
528 528
 }
529 529
 
530 530
 
531
-
531
+//
532 532
 export function getMonthCharge(params) {
533 533
   return request({
534 534
     url: "/api/monthcharge/info",

+ 317 - 191
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue 查看文件

@@ -510,7 +510,8 @@
510 510
     refunddetail,
511 511
     refundNumber,
512 512
     register,
513
-    upload
513
+    upload,
514
+    getMonthCharge
514 515
   } from '@/api/his/his'
515 516
   import RegisterDialog from './components/registerDialog'
516 517
   import treatPrint from './treatPrint'
@@ -1637,7 +1638,79 @@
1637 1638
         if (this.activeName == 'first') {
1638 1639
           this.getPatientList()
1639 1640
         } else if (this.activeName == 'second') {
1640
-          this.getMonthPatientList()
1641
+          // this.getMonthPatientList()
1642
+          const params = {
1643
+            'record_date': this.record_date,
1644
+            'patient_id': this.patientInfo.id,
1645
+            'his_patient_id': this.hisPatientInfo.id,
1646
+            'start_time': this.other_start_time,
1647
+            'end_time': this.other_end_time,
1648
+            'type': this.radio,
1649
+            'p_type': 2,
1650
+            'order_id': this.order.id
1651
+          }
1652
+
1653
+          getMonthCharge(params).then(response => {
1654
+            if (response.data.state == 0) {
1655
+              this.loading = false
1656
+
1657
+              this.$message.error(response.data.msg)
1658
+              return false
1659
+            } else {
1660
+              this.prescriptions = []
1661
+              this.month_prescriptions = []
1662
+              this.big_month_prescriptions = []
1663
+              this.big_prescriptions = []
1664
+              this.curPrescriptions = {}
1665
+              this.curMonthPrescriptions = {}
1666
+              this.loading = false
1667
+              this.patientInfo = response.data.data.xt_info
1668
+              this.hisPatientInfo = response.data.data.his_info
1669
+              this.info = response.data.data.info
1670
+              this.order = response.data.data.order
1671
+              this.p_type = ''
1672
+              this.sick_type = ''
1673
+              this.diagnosis = []
1674
+              this.sick_history = ''
1675
+              this.form.diagnosis = []
1676
+              if (this.info.id > 0) {
1677
+                this.form.p_type = response.data.data.info.register_type
1678
+                this.form.sick_type = response.data.data.info.sick_type
1679
+                if (response.data.data.info.diagnosis.length == 0) {
1680
+                  this.form.diagnosis = []
1681
+                } else {
1682
+                  for (let i = 0; i < response.data.data.info.diagnosis.split(',').length; i++) {
1683
+                    this.form.diagnosis.push(parseInt(response.data.data.info.diagnosis.split(',')[i]))
1684
+                  }
1685
+                }
1686
+                this.sick_history = this.info.sick_history
1687
+                if (this.info.register_type == 0) {
1688
+                  this.form.p_type = ''
1689
+                }
1690
+
1691
+                if (this.info.sick_type == 0) {
1692
+                  this.form.sick_type = ''
1693
+                }
1694
+              } else {
1695
+                this.form.p_type = 14
1696
+                this.form.sick_type = this.sick[0].id
1697
+                if (response.data.data.last_info.diagnoses.length == 0) {
1698
+                  this.form.diagnosis = []
1699
+                } else {
1700
+                  for (let i = 0; i < response.data.data.last_info.diagnosis.split(',').length; i++) {
1701
+                    this.form.diagnosis.push(parseInt(response.data.data.last_info.diagnosis.split(',')[i]))
1702
+                  }
1703
+                }
1704
+
1705
+                this.sick_history = ''
1706
+              }
1707
+              this.addtions_charge = response.data.data.addtions_charge
1708
+              this.setMonthPrescription(response.data.data.month_prescriptions)
1709
+
1710
+            }
1711
+          })
1712
+
1713
+
1641 1714
         }
1642 1715
       },
1643 1716
       searchAction() {
@@ -3258,237 +3331,290 @@
3258 3331
 
3259 3332
         }
3260 3333
         this.loading = true
3261
-        getChargeHisPatientInfo(params).then(response => {
3262
-          if (response.data.state == 0) {
3263
-            this.loading = false
3334
+        if(this.activeName == 'first'){
3264 3335
 
3265
-            this.$message.error(response.data.msg)
3266
-            return false
3267
-          } else {
3268
-            this.prescriptions = []
3269
-            this.month_prescriptions = []
3270
-            this.big_month_prescriptions = []
3271
-            this.big_prescriptions = []
3272
-            this.curPrescriptions = {}
3273
-            this.curMonthPrescriptions = {}
3274
-            this.loading = false
3275
-            this.patientInfo = response.data.data.xt_info
3276
-            this.hisPatientInfo = response.data.data.his_info
3277
-            this.info = response.data.data.info
3278
-            this.order = response.data.data.order
3279
-            this.p_type = ''
3280
-            this.sick_type = ''
3281
-            this.diagnosis = []
3282
-            this.sick_history = ''
3283
-            this.form.diagnosis = []
3284
-            if (this.info.id > 0) {
3285
-              this.form.p_type = response.data.data.info.register_type
3286
-              this.form.sick_type = response.data.data.info.sick_type
3287
-              if (response.data.data.info.diagnosis.length == 0) {
3288
-                this.form.diagnosis = []
3336
+          getChargeHisPatientInfo(params).then(response => {
3337
+            if (response.data.state == 0) {
3338
+              this.loading = false
3339
+
3340
+              this.$message.error(response.data.msg)
3341
+              return false
3342
+            } else {
3343
+              this.prescriptions = []
3344
+              this.month_prescriptions = []
3345
+              this.big_month_prescriptions = []
3346
+              this.big_prescriptions = []
3347
+              this.curPrescriptions = {}
3348
+              this.curMonthPrescriptions = {}
3349
+              this.loading = false
3350
+              this.patientInfo = response.data.data.xt_info
3351
+              this.hisPatientInfo = response.data.data.his_info
3352
+              this.info = response.data.data.info
3353
+              this.order = response.data.data.order
3354
+              this.p_type = ''
3355
+              this.sick_type = ''
3356
+              this.diagnosis = []
3357
+              this.sick_history = ''
3358
+              this.form.diagnosis = []
3359
+              if (this.info.id > 0) {
3360
+                this.form.p_type = response.data.data.info.register_type
3361
+                this.form.sick_type = response.data.data.info.sick_type
3362
+                if (response.data.data.info.diagnosis.length == 0) {
3363
+                  this.form.diagnosis = []
3364
+                } else {
3365
+                  for (let i = 0; i < response.data.data.info.diagnosis.split(',').length; i++) {
3366
+                    this.form.diagnosis.push(parseInt(response.data.data.info.diagnosis.split(',')[i]))
3367
+                  }
3368
+                }
3369
+                this.sick_history = this.info.sick_history
3370
+                if (this.info.register_type == 0) {
3371
+                  this.form.p_type = ''
3372
+                }
3373
+
3374
+                if (this.info.sick_type == 0) {
3375
+                  this.form.sick_type = ''
3376
+                }
3289 3377
               } else {
3290
-                for (let i = 0; i < response.data.data.info.diagnosis.split(',').length; i++) {
3291
-                  this.form.diagnosis.push(parseInt(response.data.data.info.diagnosis.split(',')[i]))
3378
+                this.form.p_type = 14
3379
+                this.form.sick_type = this.sick[0].id
3380
+                if (response.data.data.last_info.diagnoses.length == 0) {
3381
+                  this.form.diagnosis = []
3382
+                } else {
3383
+                  for (let i = 0; i < response.data.data.last_info.diagnosis.split(',').length; i++) {
3384
+                    this.form.diagnosis.push(parseInt(response.data.data.last_info.diagnosis.split(',')[i]))
3385
+                  }
3292 3386
                 }
3293
-              }
3294
-              this.sick_history = this.info.sick_history
3295
-              if (this.info.register_type == 0) {
3296
-                this.form.p_type = ''
3297
-              }
3298 3387
 
3299
-              if (this.info.sick_type == 0) {
3300
-                this.form.sick_type = ''
3388
+                this.sick_history = ''
3301 3389
               }
3302
-            } else {
3303
-              this.form.p_type = 14
3304
-              this.form.sick_type = this.sick[0].id
3305
-              if (response.data.data.last_info.diagnoses.length == 0) {
3306
-                this.form.diagnosis = []
3390
+              this.addtions_charge = response.data.data.addtions_charge
3391
+              // this.setMonthPrescription(response.data.data.month_prescriptions)
3392
+
3393
+              if (response.data.data.prescription.length > 0 && response.data.data.prescription[0].advices.length > 0) {
3394
+                this.prescription_id = response.data.data.prescription[0].advices[0].prescription_id
3307 3395
               } else {
3308
-                for (let i = 0; i < response.data.data.last_info.diagnosis.split(',').length; i++) {
3309
-                  this.form.diagnosis.push(parseInt(response.data.data.last_info.diagnosis.split(',')[i]))
3396
+                this.prescription_id = 0
3397
+              }
3398
+
3399
+              const big_prescriptions = []
3400
+
3401
+              for (let i = 0; i < this.unique_three(response.data.data.prescription).length; i++) {
3402
+                const obj = {
3403
+                  med_type: this.unique_three(response.data.data.prescription)[i].med_type,
3404
+                  prescriptions: []
3310 3405
                 }
3406
+                big_prescriptions.push(obj)
3311 3407
               }
3312 3408
 
3313
-              this.sick_history = ''
3314
-            }
3315
-            this.addtions_charge = response.data.data.addtions_charge
3316
-            this.setMonthPrescription(response.data.data.month_prescriptions)
3409
+              for (let c = 0; c < big_prescriptions.length; c++) {
3410
+                const inner_prescription = []
3411
+                for (let i = 0; i < response.data.data.prescription.length; i++) {
3412
+                  var prescription = response.data.data.prescription[i]
3413
+
3414
+                  if (big_prescriptions[c].med_type == prescription.med_type) {
3415
+                    const tempAdvice = []
3416
+                    const tempProject = []
3417
+                    const tempAddition = []
3418
+                    for (let b = 0; b < prescription.advices.length; b++) {
3419
+                      const obj = {
3420
+                        advice_id: prescription.advices[b].id,
3421
+                        drug_name: prescription.advices[b].advice_name,
3422
+                        single_dose: prescription.advices[b].single_dose,
3423
+                        delivery_way: prescription.advices[b].delivery_way,
3424
+                        execution_frequency: prescription.advices[b].execution_frequency,
3425
+                        retail_price: prescription.advices[b].price.toString(),
3426
+                        remark: prescription.advices[b].remark,
3427
+                        day: prescription.advices[b].day,
3428
+                        prescribing_number: prescription.advices[b].prescribing_number.toString(),
3429
+                        single_dose_unit: prescription.advices[b].single_dose_unit,
3430
+                        prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
3431
+                        medical_insurance_number: prescription.advices[b].med_list_codg
3317 3432
 
3318
-            if (response.data.data.prescription.length > 0 && response.data.data.prescription[0].advices.length > 0) {
3319
-              this.prescription_id = response.data.data.prescription[0].advices[0].prescription_id
3320
-            } else {
3321
-              this.prescription_id = 0
3322
-            }
3433
+                      }
3434
+                      tempAdvice.push(obj)
3435
+                    }
3323 3436
 
3324
-            const big_prescriptions = []
3437
+                    for (let b = 0; b < prescription.project.length; b++) {
3438
+                      const obj = {
3439
+                        id: prescription.project[b].id,
3440
+                        project_id: prescription.project[b].project.id,
3441
+                        // project_name: prescription.project[b].project.project_name,
3442
+                        // statistical_classification: prescription.project[b].project.statistical_classification,
3443
+                        single_dose: prescription.project[b].single_dose,
3444
+                        delivery_way: prescription.project[b].delivery_way,
3445
+                        execution_frequency: prescription.project[b].execution_frequency,
3446
+                        number_days: prescription.project[b].day,
3447
+                        total: prescription.project[b].count.toString(),
3448
+                        price: prescription.project[b].price,
3449
+                        remark: prescription.project[b].remark,
3450
+                        // medical_code: prescription.project[b].project.medical_code,
3451
+                        unit: prescription.project[b].unit,
3452
+                        type: prescription.project[b].type
3453
+                      }
3325 3454
 
3326
-            for (let i = 0; i < this.unique_three(response.data.data.prescription).length; i++) {
3327
-              const obj = {
3328
-                med_type: this.unique_three(response.data.data.prescription)[i].med_type,
3329
-                prescriptions: []
3330
-              }
3331
-              big_prescriptions.push(obj)
3332
-            }
3455
+                      if (prescription.project[b].type == 2) {
3456
+                        obj['statistical_classification'] = prescription.project[b].project.statistical_classification
3457
+                        obj['medical_code'] = prescription.project[b].project.medical_code
3458
+                        obj['project_name'] = prescription.project[b].project.project_name
3333 3459
 
3334
-            for (let c = 0; c < big_prescriptions.length; c++) {
3335
-              const inner_prescription = []
3336
-              for (let i = 0; i < response.data.data.prescription.length; i++) {
3337
-                var prescription = response.data.data.prescription[i]
3460
+                      } else if (prescription.project[b].type == 3) {
3461
+                        obj['statistical_classification'] = ''
3462
+                        obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
3463
+                        obj['project_name'] = prescription.project[b].good_info.good_name
3464
+                      }
3338 3465
 
3339
-                if (big_prescriptions[c].med_type == prescription.med_type) {
3340
-                  const tempAdvice = []
3341
-                  const tempProject = []
3342
-                  const tempAddition = []
3343
-                  for (let b = 0; b < prescription.advices.length; b++) {
3344
-                    const obj = {
3345
-                      advice_id: prescription.advices[b].id,
3346
-                      drug_name: prescription.advices[b].advice_name,
3347
-                      single_dose: prescription.advices[b].single_dose,
3348
-                      delivery_way: prescription.advices[b].delivery_way,
3349
-                      execution_frequency: prescription.advices[b].execution_frequency,
3350
-                      retail_price: prescription.advices[b].price.toString(),
3351
-                      remark: prescription.advices[b].remark,
3352
-                      day: prescription.advices[b].day,
3353
-                      prescribing_number: prescription.advices[b].prescribing_number.toString(),
3354
-                      single_dose_unit: prescription.advices[b].single_dose_unit,
3355
-                      prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
3356
-                      medical_insurance_number: prescription.advices[b].med_list_codg
3466
+                      tempProject.push(obj)
3467
+                    }
3357 3468
 
3469
+                    for (let b = 0; b < prescription.addition.length; b++) {
3470
+                      const obj = {
3471
+                        id: prescription.addition[b].id,
3472
+                        item_name: prescription.addition[b].item_name,
3473
+                        price: prescription.addition[b].price,
3474
+                        count: prescription.addition[b].count,
3475
+                        item_id: prescription.addition[b].item_id
3476
+                      }
3477
+                      tempAddition.push(obj)
3358 3478
                     }
3359
-                    tempAdvice.push(obj)
3360
-                  }
3479
+                    const index = i + 1
3480
+                    console.log('~~~~~~~~')
3481
+                    console.log(prescription.order)
3482
+                    prescription.order.order_status = prescription.order.order_status.toString()
3483
+                    prescription.order.order_status = parseInt(prescription.order.order_status)
3361 3484
 
3362
-                  for (let b = 0; b < prescription.project.length; b++) {
3363 3485
                     const obj = {
3364
-                      id: prescription.project[b].id,
3365
-                      project_id: prescription.project[b].project.id,
3366
-                      // project_name: prescription.project[b].project.project_name,
3367
-                      // statistical_classification: prescription.project[b].project.statistical_classification,
3368
-                      single_dose: prescription.project[b].single_dose,
3369
-                      delivery_way: prescription.project[b].delivery_way,
3370
-                      execution_frequency: prescription.project[b].execution_frequency,
3371
-                      number_days: prescription.project[b].day,
3372
-                      total: prescription.project[b].count.toString(),
3373
-                      price: prescription.project[b].price,
3374
-                      remark: prescription.project[b].remark,
3375
-                      // medical_code: prescription.project[b].project.medical_code,
3376
-                      unit: prescription.project[b].unit,
3377
-                      type: prescription.project[b].type
3486
+                      id: prescription.id,
3487
+                      name: this.getPName(prescription.med_type, index),
3488
+                      advices: tempAdvice,
3489
+                      project: tempProject,
3490
+                      addition: tempAddition,
3491
+                      order_status: prescription.order_status,
3492
+                      type: prescription.type,
3493
+                      med_type: prescription.med_type,
3494
+                      order: prescription.order
3378 3495
                     }
3496
+                    // inner_prescription.push(obj)
3497
+                    big_prescriptions[c].prescriptions.push(obj)
3379 3498
 
3380
-                    if (prescription.project[b].type == 2) {
3381
-                      obj['statistical_classification'] = prescription.project[b].project.statistical_classification
3382
-                      obj['medical_code'] = prescription.project[b].project.medical_code
3383
-                      obj['project_name'] = prescription.project[b].project.project_name
3499
+                    this.prescriptions.push(obj)
3500
+                  }
3501
+                }
3502
+              }
3384 3503
 
3385
-                    } else if (prescription.project[b].type == 3) {
3386
-                      obj['statistical_classification'] = ''
3387
-                      obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
3388
-                      obj['project_name'] = prescription.project[b].good_info.good_name
3389
-                    }
3504
+              this.big_prescriptions = JSON.parse(JSON.stringify(big_prescriptions))
3390 3505
 
3391
-                    tempProject.push(obj)
3392
-                  }
3506
+              for (let i = 0; i < this.big_prescriptions.length; i++) {
3507
+                if (this.big_prescriptions[i].med_type == '11') {
3508
+                  this.big_prescriptions[i]['is_true'] = 1
3509
+                }
3510
+              }
3393 3511
 
3394
-                  for (let b = 0; b < prescription.addition.length; b++) {
3512
+              for (let i = 0; i < this.big_prescriptions.length; i++) {
3513
+                if (this.big_prescriptions[i].is_true == 1) {
3514
+                  for (let b = 0; b < this.big_prescriptions[i].prescriptions.length; b++) {
3395 3515
                     const obj = {
3396
-                      id: prescription.addition[b].id,
3397
-                      item_name: prescription.addition[b].item_name,
3398
-                      price: prescription.addition[b].price,
3399
-                      count: prescription.addition[b].count,
3400
-                      item_id: prescription.addition[b].item_id
3516
+                      med_type: '11',
3517
+                      prescriptions: []
3401 3518
                     }
3402
-                    tempAddition.push(obj)
3519
+                    const arr = []
3520
+                    arr.push(this.big_prescriptions[i].prescriptions[b])
3521
+                    obj.prescriptions = arr
3522
+                    this.big_prescriptions.push(obj)
3403 3523
                   }
3404
-                  const index = i + 1
3405
-                  console.log('~~~~~~~~')
3406
-                  console.log(prescription.order)
3407
-                  prescription.order.order_status = prescription.order.order_status.toString()
3408
-                  prescription.order.order_status = parseInt(prescription.order.order_status)
3409
-
3410
-                  const obj = {
3411
-                    id: prescription.id,
3412
-                    name: this.getPName(prescription.med_type, index),
3413
-                    advices: tempAdvice,
3414
-                    project: tempProject,
3415
-                    addition: tempAddition,
3416
-                    order_status: prescription.order_status,
3417
-                    type: prescription.type,
3418
-                    med_type: prescription.med_type,
3419
-                    order: prescription.order
3420
-                  }
3421
-                  // inner_prescription.push(obj)
3422
-                  big_prescriptions[c].prescriptions.push(obj)
3423
-
3424
-                  this.prescriptions.push(obj)
3425 3524
                 }
3426 3525
               }
3427
-            }
3428
-
3429
-            this.big_prescriptions = JSON.parse(JSON.stringify(big_prescriptions))
3430 3526
 
3431
-            for (let i = 0; i < this.big_prescriptions.length; i++) {
3432
-              if (this.big_prescriptions[i].med_type == '11') {
3433
-                this.big_prescriptions[i]['is_true'] = 1
3527
+              console.log(this.big_prescriptions)
3528
+              //
3529
+              for (let i = 0; i < this.big_prescriptions.length; i++) {
3530
+                if (this.big_prescriptions[i].is_true == 1) {
3531
+                  this.big_prescriptions.splice(i, 1)
3532
+                }
3434 3533
               }
3435
-            }
3534
+              // console.log(this.big_prescriptions)
3436 3535
 
3437
-            for (let i = 0; i < this.big_prescriptions.length; i++) {
3438
-              if (this.big_prescriptions[i].is_true == 1) {
3439
-                for (let b = 0; b < this.big_prescriptions[i].prescriptions.length; b++) {
3440
-                  const obj = {
3441
-                    med_type: '11',
3442
-                    prescriptions: []
3443
-                  }
3444
-                  const arr = []
3445
-                  arr.push(this.big_prescriptions[i].prescriptions[b])
3446
-                  obj.prescriptions = arr
3447
-                  this.big_prescriptions.push(obj)
3536
+              for (let i = 0; i < this.big_prescriptions.length; i++) {
3537
+                if (this.big_prescriptions[i].prescriptions.length > 0) {
3538
+                  this.big_prescriptions[i]['curPrescriptions'] = JSON.parse(JSON.stringify(this.big_prescriptions[i].prescriptions[0]))
3539
+                } else {
3540
+                  this.big_prescriptions[i]['curPrescriptions'] = {}
3448 3541
                 }
3542
+                this.big_prescriptions[i]['total'] = this.getTotalThree(this.big_prescriptions[i])
3449 3543
               }
3450
-            }
3451 3544
 
3452
-            console.log(this.big_prescriptions)
3453
-            //
3454
-            for (let i = 0; i < this.big_prescriptions.length; i++) {
3455
-              if (this.big_prescriptions[i].is_true == 1) {
3456
-                this.big_prescriptions.splice(i, 1)
3545
+              if (this.big_prescriptions.length > 0) {
3546
+                this.editableTabsValue = this.getPName(this.big_prescriptions[0].med_type, 1)
3457 3547
               }
3548
+
3549
+
3458 3550
             }
3459
-            // console.log(this.big_prescriptions)
3551
+          })
3552
+
3460 3553
 
3461
-            for (let i = 0; i < this.big_prescriptions.length; i++) {
3462
-              if (this.big_prescriptions[i].prescriptions.length > 0) {
3463
-                this.big_prescriptions[i]['curPrescriptions'] = JSON.parse(JSON.stringify(this.big_prescriptions[i].prescriptions[0]))
3554
+        }else{
3555
+
3556
+          getMonthCharge(params).then(response => {
3557
+            if (response.data.state == 0) {
3558
+              this.loading = false
3559
+
3560
+              this.$message.error(response.data.msg)
3561
+              return false
3562
+            } else {
3563
+              this.prescriptions = []
3564
+              this.month_prescriptions = []
3565
+              this.big_month_prescriptions = []
3566
+              this.big_prescriptions = []
3567
+              this.curPrescriptions = {}
3568
+              this.curMonthPrescriptions = {}
3569
+              this.loading = false
3570
+              this.patientInfo = response.data.data.xt_info
3571
+              this.hisPatientInfo = response.data.data.his_info
3572
+              this.info = response.data.data.info
3573
+              this.order = response.data.data.order
3574
+              this.p_type = ''
3575
+              this.sick_type = ''
3576
+              this.diagnosis = []
3577
+              this.sick_history = ''
3578
+              this.form.diagnosis = []
3579
+              if (this.info.id > 0) {
3580
+                this.form.p_type = response.data.data.info.register_type
3581
+                this.form.sick_type = response.data.data.info.sick_type
3582
+                if (response.data.data.info.diagnosis.length == 0) {
3583
+                  this.form.diagnosis = []
3584
+                } else {
3585
+                  for (let i = 0; i < response.data.data.info.diagnosis.split(',').length; i++) {
3586
+                    this.form.diagnosis.push(parseInt(response.data.data.info.diagnosis.split(',')[i]))
3587
+                  }
3588
+                }
3589
+                this.sick_history = this.info.sick_history
3590
+                if (this.info.register_type == 0) {
3591
+                  this.form.p_type = ''
3592
+                }
3593
+
3594
+                if (this.info.sick_type == 0) {
3595
+                  this.form.sick_type = ''
3596
+                }
3464 3597
               } else {
3465
-                this.big_prescriptions[i]['curPrescriptions'] = {}
3598
+                this.form.p_type = 14
3599
+                this.form.sick_type = this.sick[0].id
3600
+                if (response.data.data.last_info.diagnoses.length == 0) {
3601
+                  this.form.diagnosis = []
3602
+                } else {
3603
+                  for (let i = 0; i < response.data.data.last_info.diagnosis.split(',').length; i++) {
3604
+                    this.form.diagnosis.push(parseInt(response.data.data.last_info.diagnosis.split(',')[i]))
3605
+                  }
3606
+                }
3607
+
3608
+                this.sick_history = ''
3466 3609
               }
3467
-              this.big_prescriptions[i]['total'] = this.getTotalThree(this.big_prescriptions[i])
3468
-            }
3610
+              this.addtions_charge = response.data.data.addtions_charge
3611
+              this.setMonthPrescription(response.data.data.month_prescriptions)
3469 3612
 
3470
-            if (this.big_prescriptions.length > 0) {
3471
-              this.editableTabsValue = this.getPName(this.big_prescriptions[0].med_type, 1)
3472 3613
             }
3614
+          })
3473 3615
 
3474
-            console.log(this.big_prescriptions)
3475
-            console.log(this.big_prescriptions[0].curPrescriptions.order_status)
3476
-
3477
-            //
3478
-            // if (this.prescriptions.length > 0) {
3479
-            //   this.curPrescriptions = this.prescriptions[0]
3480
-            // } else {
3481
-            //   this.curPrescriptions = {}
3482
-            // }
3483
-            // if (this.month_prescriptions.length > 0) {
3484
-            //   this.curMonthPrescriptions = this.month_prescriptions[0]
3485
-            // } else {
3486
-            //   this.curMonthPrescriptions = {}
3487
-            // }
3488
-
3489
-            // this.month_total = this.getMonthTotalOne()
3490
-          }
3491
-        })
3616
+
3617
+        }
3492 3618
       }
3493 3619
       // sz_open(index, med_type, order, prescriptions) {
3494 3620
       //   switch (index) {

+ 293 - 92
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue 查看文件

@@ -1358,7 +1358,10 @@
1358 1358
           this.prescriptions[i].name = '处方' + (i + 1)
1359 1359
           this.prescriptions[i]['pre_time'] = nowTime
1360 1360
 
1361
-          this.prescriptions[i]['med_type'] = 14
1361
+
1362
+
1363
+            this.prescriptions[i]['med_type'] = 14
1364
+
1362 1365
 
1363 1366
           if (i == 0) {
1364 1367
             if (this.prescriptions[0].advices.length > 0 && this.prescriptions[0].project.length == 0) {
@@ -1522,7 +1525,7 @@
1522 1525
         this.$refs.additionalCharges.hide()
1523 1526
 
1524 1527
       }, searchProjectAction() {
1525
-        console.log('~~~~')
1528
+        console.log("~~~~")
1526 1529
         console.log(this.allProject)
1527 1530
 
1528 1531
         if (this.search_project_keyword.length == 0) {
@@ -1539,7 +1542,7 @@
1539 1542
 
1540 1543
         }
1541 1544
 
1542
-      }, searchProjectTeamAction() {
1545
+      },searchProjectTeamAction(){
1543 1546
         if (this.search_project_team_keyword.length == 0) {
1544 1547
           this.tabPrjectTeam = this.allTabPrjectTeam
1545 1548
 
@@ -1910,103 +1913,288 @@
1910 1913
           this.order_status = '已退费'
1911 1914
         }
1912 1915
 
1913
-        getInitData().then(response => {
1914
-          if (response.data.state == 0) {
1915
-            this.$message.error(response.data.msg)
1916
-            return false
1917
-          } else {
1918
-            this.drugs = response.data.data.drugs
1919
-            this.allDrugs = response.data.data.drugs
1920
-            this.advices_template = response.data.data.advices_template
1921
-            this.doctors = response.data.data.doctors
1922
-            for (let i = 0; i < this.doctors.length; i++) {
1923
-              if (this.doctors[i].user_type == 1) {
1924
-                this.doctors.splice(i, 1)
1925
-              }
1926
-            }
1927
-            this.department = response.data.data.department
1928
-            this.sick = response.data.data.sick
1929
-            this.diagnoses = response.data.data.diagnose
1930
-            this.additions = response.data.data.additions
1916
+        if (info.id > 0) {
1917
+          this.doctorValue = info.doctor_id
1918
+          this.departmentValue = info.departments
1919
+        } else {
1920
+          if(admin_info.id > 0 && admin_info.user_type == 2){
1921
+            this.doctorValue = admin_info.admin_user_id
1922
+            this.departmentValue = this.department[0].id
1931 1923
 
1932
-            if (info.id > 0) {
1933
-              this.doctorValue = info.doctor_id
1934
-              this.departmentValue = info.departments
1935
-            } else {
1936
-              if (admin_info.id > 0 && admin_info.user_type == 2) {
1937
-                this.doctorValue = admin_info.admin_user_id
1938
-                this.departmentValue = this.department[0].id
1924
+          }else{
1939 1925
 
1940
-              } else {
1926
+            this.doctorValue = this.doctors[0].admin_user_id
1927
+            this.departmentValue = this.department[0].id
1941 1928
 
1942
-                this.doctorValue = this.doctors[0].admin_user_id
1943
-                this.departmentValue = this.department[0].id
1929
+          }
1944 1930
 
1945
-              }
1946 1931
 
1947
-            }
1932
+        }
1933
+
1934
+        if (info.register_type == 0) {
1935
+          for (let i = 0; i < this.register.length; i++) {
1936
+            this.register_type = this.register[0].value
1937
+          }
1938
+        } else {
1939
+          this.register_type = info.register_type
1940
+        }
1941
+        this.diagnose = []
1942
+
1943
+        if(info.id == 0){
1944
+          if(last_info.diagnosis.length == 0){
1945
+            this.diagnose = []
1946
+          }else{
1947
+            for(let i = 0; i < last_info.diagnosis.split(",").length;i++){
1948
+              this.diagnose.push(parseInt(last_info.diagnosis.split(",")[i]))
1948 1949
 
1949
-            if (info.register_type == 0) {
1950
-              for (let i = 0; i < this.register.length; i++) {
1951
-                this.register_type = this.register[0].value
1952
-              }
1953
-            } else {
1954
-              this.register_type = info.register_type
1955 1950
             }
1951
+          }
1952
+
1953
+          if(last_info.sick_history == 0){
1954
+            this.state2 = ''
1955
+          }else{
1956
+            this.state2 = last_info.sick_history
1957
+          }
1958
+
1959
+
1960
+        }else{
1961
+          this.state2 = info.sick_history
1962
+          if (this.state2 == 0) {
1963
+            this.state2 = ''
1964
+          }
1965
+          if(info.diagnosis.length == 0){
1956 1966
             this.diagnose = []
1967
+          }else{
1968
+            for(let i = 0; i < info.diagnosis.split(",").length;i++){
1969
+              this.diagnose.push(parseInt(info.diagnosis.split(",")[i]))
1957 1970
 
1958
-            if (info.id == 0) {
1959
-              if (last_info.diagnosis.length == 0) {
1960
-                this.diagnose = []
1961
-              } else {
1962
-                for (let i = 0; i < last_info.diagnosis.split(",").length; i++) {
1963
-                  this.diagnose.push(parseInt(last_info.diagnosis.split(',')[i]))
1971
+            }
1964 1972
 
1965
-                }
1966
-              }
1973
+          }
1967 1974
 
1968
-              if (last_info.sick_history == 0) {
1969
-                this.state2 = ''
1970
-              } else {
1971
-                this.state2 = last_info.sick_history
1972
-              }
1975
+        }
1973 1976
 
1974
-            } else {
1975
-              this.state2 = info.sick_history
1976
-              if (this.state2 == 0) {
1977
-                this.state2 = ''
1978
-              }
1979
-              if (info.diagnosis.length == 0) {
1980
-                this.diagnose = []
1981
-              } else {
1982
-                for (let i = 0; i < info.diagnosis.split(",").length; i++) {
1983
-                  this.diagnose.push(parseInt(info.diagnosis.split(',')[i]))
1984 1977
 
1985
-                }
1986 1978
 
1987
-              }
1979
+        this.state1 = info.sick_type
1980
+        if (this.state1 == 0 || this.state1 == "") {
1981
+          this.state1 = ''
1982
+          for (let i = 0; i < this.sick.length; i++) {
1983
+            this.state1 = this.sick[0].id
1984
+          }
1985
+        }
1988 1986
 
1989
-            }
1987
+        if(this.departmentValue == "" || this.departmentValue == 0){
1988
+          if(this.department.length > 0){
1989
+            this.departmentValue = this.department[0].id
1990
+
1991
+          }
1992
+        }
1993
+
1994
+
1995
+          // getInitData().then(response => {
1996
+          //   if (response.data.state == 0) {
1997
+          //     this.$message.error(response.data.msg)
1998
+          //     return false
1999
+          //   } else {
2000
+          //     this.onceTime = false
2001
+          //     this.drugs = response.data.data.drugs
2002
+          //     this.allDrugs = response.data.data.drugs
2003
+          //     this.advices_template = response.data.data.advices_template
2004
+          //     this.doctors = response.data.data.doctors
2005
+          //     for (let i = 0; i < this.doctors.length; i++) {
2006
+          //       if (this.doctors[i].user_type == 1) {
2007
+          //         this.doctors.splice(i, 1)
2008
+          //       }
2009
+          //     }
2010
+          //     this.department = response.data.data.department
2011
+          //     this.sick = response.data.data.sick
2012
+          //     this.diagnoses = response.data.data.diagnose
2013
+          //     this.additions = response.data.data.additions
2014
+
2015
+
2016
+
2017
+
2018
+
2019
+          //     if (info.id > 0) {
2020
+          //       this.doctorValue = info.doctor_id
2021
+          //       this.departmentValue = info.departments
2022
+          //     } else {
2023
+          //       if(admin_info.id > 0 && admin_info.user_type == 2){
2024
+          //         this.doctorValue = admin_info.admin_user_id
2025
+          //         this.departmentValue = this.department[0].id
2026
+
2027
+          //       }else{
2028
+
2029
+          //         this.doctorValue = this.doctors[0].admin_user_id
2030
+          //         this.departmentValue = this.department[0].id
2031
+
2032
+          //       }
2033
+
2034
+
2035
+          //     }
2036
+
2037
+          //     if (info.register_type == 0) {
2038
+          //       for (let i = 0; i < this.register.length; i++) {
2039
+          //         this.register_type = this.register[0].value
2040
+          //       }
2041
+          //     } else {
2042
+          //       this.register_type = info.register_type
2043
+          //     }
2044
+          //     this.diagnose = []
2045
+
2046
+          //     if(info.id == 0){
2047
+          //       if(last_info.diagnosis.length == 0){
2048
+          //         this.diagnose = []
2049
+          //       }else{
2050
+          //         for(let i = 0; i < last_info.diagnosis.split(",").length;i++){
2051
+          //           this.diagnose.push(parseInt(last_info.diagnosis.split(",")[i]))
2052
+
2053
+          //         }
2054
+          //       }
2055
+
2056
+          //       if(last_info.sick_history == 0){
2057
+          //         this.state2 = ''
2058
+          //       }else{
2059
+          //         this.state2 = last_info.sick_history
2060
+          //       }
2061
+
2062
+
2063
+          //     }else{
2064
+          //       this.state2 = info.sick_history
2065
+          //       if (this.state2 == 0) {
2066
+          //         this.state2 = ''
2067
+          //       }
2068
+          //       if(info.diagnosis.length == 0){
2069
+          //         this.diagnose = []
2070
+          //       }else{
2071
+          //         for(let i = 0; i < info.diagnosis.split(",").length;i++){
2072
+          //           this.diagnose.push(parseInt(info.diagnosis.split(",")[i]))
2073
+
2074
+          //         }
2075
+
2076
+          //       }
2077
+
2078
+          //     }
2079
+
2080
+
2081
+
2082
+          //     this.state1 = info.sick_type
2083
+          //     if (this.state1 == 0 || this.state1 == "") {
2084
+          //       this.state1 = ''
2085
+          //       for (let i = 0; i < this.sick.length; i++) {
2086
+          //         this.state1 = this.sick[0].id
2087
+          //       }
2088
+          //     }
2089
+
2090
+          //     if(this.departmentValue == "" || this.departmentValue == 0){
2091
+          //       if(this.department.length > 0){
2092
+          //         this.departmentValue = this.department[0].id
2093
+
2094
+          //       }
2095
+          //     }
2096
+
2097
+          //   }
2098
+          // })
2099
+
2100
+      },
2101
+      setMonthData(info, admin_info, doctors, department, hisPatientInfo, month_data, last_info) {
2102
+        this.curMonthPrescriptions = {}
2103
+        this.curPrescriptions = {}
2104
+        // this.$refs.tabProjectTeam.clearSelection()
2105
+
2106
+        for (let i = 0; i < doctors.length; i++) {
2107
+          if (doctors[i].user_type == 1) {
2108
+            doctors.splice(i, 1)
2109
+          }
2110
+        }
2111
+
2112
+        this.editableTabsValue = '处方1'
2113
+        this.curStatus = 0
2114
+        if (month_data && month_data.length > 0) {
2115
+          this.curMonthPrescriptions = month_data[0]
2116
+        } else {
2117
+          this.curMonthPrescriptions = {}
2118
+        }
2119
+
2120
+        if (info.prescription_status == 0) {
2121
+          this.order_status = ''
2122
+        }
2123
+
2124
+        if (info.id > 0) {
2125
+          this.doctorValue = info.doctor_id
2126
+          this.departmentValue = info.departments
2127
+        } else {
2128
+          if(admin_info.id > 0 && admin_info.user_type == 2){
2129
+            this.doctorValue = admin_info.admin_user_id
2130
+            this.departmentValue = this.department[0].id
2131
+
2132
+          }else{
2133
+
2134
+            this.doctorValue = this.doctors[0].admin_user_id
2135
+            this.departmentValue = this.department[0].id
2136
+
2137
+          }
2138
+
2139
+
2140
+        }
2141
+
2142
+        if (info.register_type == 0) {
2143
+          for (let i = 0; i < this.register.length; i++) {
2144
+            this.register_type = this.register[0].value
2145
+          }
2146
+        } else {
2147
+          this.register_type = info.register_type
2148
+        }
2149
+        this.diagnose = []
2150
+
2151
+        if(info.id == 0){
2152
+          if(last_info.diagnosis.length == 0){
2153
+            this.diagnose = []
2154
+          }else{
2155
+            for(let i = 0; i < last_info.diagnosis.split(",").length;i++){
2156
+              this.diagnose.push(parseInt(last_info.diagnosis.split(",")[i]))
1990 2157
 
1991
-            this.state1 = info.sick_type
1992
-            if (this.state1 == 0 || this.state1 == '') {
1993
-              this.state1 = ''
1994
-              for (let i = 0; i < this.sick.length; i++) {
1995
-                this.state1 = this.sick[0].id
1996
-              }
1997 2158
             }
2159
+          }
1998 2160
 
1999
-            if (this.departmentValue == '' || this.departmentValue == 0) {
2000
-              if (this.department.length > 0) {
2001
-                this.departmentValue = this.department[0].id
2161
+          if(last_info.sick_history == 0){
2162
+            this.state2 = ''
2163
+          }else{
2164
+            this.state2 = last_info.sick_history
2165
+          }
2002 2166
 
2003
-              }
2167
+
2168
+        }else{
2169
+          this.state2 = info.sick_history
2170
+          if (this.state2 == 0) {
2171
+            this.state2 = ''
2172
+          }
2173
+          if(info.diagnosis.length == 0){
2174
+            this.diagnose = []
2175
+          }else{
2176
+            for(let i = 0; i < info.diagnosis.split(",").length;i++){
2177
+              this.diagnose.push(parseInt(info.diagnosis.split(",")[i]))
2004 2178
             }
2179
+          }
2180
+        }
2181
+        this.state1 = info.sick_type
2182
+        if (this.state1 == 0 || this.state1 == "") {
2183
+          this.state1 = ''
2184
+          for (let i = 0; i < this.sick.length; i++) {
2185
+            this.state1 = this.sick[0].id
2186
+          }
2187
+        }
2188
+
2189
+        if(this.departmentValue == "" || this.departmentValue == 0){
2190
+          if(this.department.length > 0){
2191
+            this.departmentValue = this.department[0].id
2005 2192
 
2006 2193
           }
2007
-        })
2194
+        }
2008 2195
 
2009 2196
       },
2197
+
2010 2198
       moreState(tab, event) {
2011 2199
         if (tab == 'more') {
2012 2200
           return false
@@ -2099,16 +2287,16 @@
2099 2287
             }
2100 2288
           }
2101 2289
           for (let i = 0; i < this.prescriptions.length; i++) {
2102
-            if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
2103
-              this.$message.error('处方医疗类型不能为空')
2104
-              return
2105
-            }
2290
+              if (this.prescriptions[i].med_type == 0 || this.prescriptions[i].med_type == '') {
2291
+                this.$message.error('处方医疗类型不能为空')
2292
+                return
2293
+              }
2106 2294
           }
2107 2295
           if (index == 1) {
2108 2296
             let params = {
2109 2297
               p_type: 2,
2110 2298
               patient_id: this.patientInfo.id,
2111
-              diagnose: this.diagnose.join(','),
2299
+              diagnose: this.diagnose.join(","),
2112 2300
               sick_type: this.state1,
2113 2301
               sick_history: this.state2,
2114 2302
               doctor: this.doctorValue,
@@ -2133,6 +2321,7 @@
2133 2321
                 this.prescriptions[i].advices[b].day = parseInt(this.prescriptions[i].advices[b].day)
2134 2322
                 this.prescriptions[i].advices[b].groupno = parseInt(this.prescriptions[i].advices[b].groupno)
2135 2323
 
2324
+
2136 2325
               }
2137 2326
 
2138 2327
               for (let b = 0; b < this.prescriptions[i].project.length; b++) {
@@ -2744,18 +2933,21 @@
2744 2933
         this.teamList = row
2745 2934
       },
2746 2935
       selectChange(selection, row) {
2747
-        if (row.total <= 0) {
2748
-          if (selection) {
2749
-            selection.forEach(row => {
2750
-              if (row.total <= 0) {
2751
-                this.$refs.tables.toggleRowSelection(row)
2752
-              }
2753
-            })
2754
-          } else {
2755
-            this.$refs.tables.clearSelection()
2936
+        console.log('row',row)
2937
+        if(row.total <= 0){
2938
+          if(row.type == 3){
2939
+            if (selection) {
2940
+              selection.forEach(row => {
2941
+                if(row.total <= 0){
2942
+                  this.$refs.tables.toggleRowSelection(row);
2943
+                }
2944
+              });
2945
+            } else {
2946
+              this.$refs.tables.clearSelection();
2947
+            }
2948
+            this.$message.error(row.project_name + '库存不足')
2949
+            return
2756 2950
           }
2757
-          this.$message.error(row.project_name + '库存不足')
2758
-          return
2759 2951
         }
2760 2952
         this.teamList.push(row)
2761 2953
       },
@@ -2877,6 +3069,7 @@
2877 3069
           if (response.data.state == 1) {
2878 3070
             this.teamList = []
2879 3071
             var project = response.data.data.project
3072
+            let num = 0
2880 3073
             for (let i = 0; i < project.length; i++) {
2881 3074
               if (project[i].type == 2 && project[i].status == 1) {
2882 3075
 
@@ -2901,6 +3094,14 @@
2901 3094
 
2902 3095
                 this.teamList.push(obj)
2903 3096
               } else if (project[i].type == 3 && project[i].status == 1) {
3097
+                if(project[i].good_info.total <= 0){
3098
+                  num++
3099
+                  this.$refs.tabProjectTeam.toggleRowSelection(row);
3100
+                  this.$message.error(project[i].good_info.good_name + '库存不足')
3101
+                }
3102
+                if(num > 0){
3103
+                  this.$refs.tabProjectTeam.clearSelection();
3104
+                }
2904 3105
                 let obj = {
2905 3106
                   id: project[i].project_id,
2906 3107
                   project_name: project[i].good_info.good_name,

+ 3 - 3
src/xt_pages/outpatientDoctorStation/doctorDesk.vue 查看文件

@@ -3507,7 +3507,7 @@
3507 3507
                   } else {
3508 3508
                     this.case_history.is_infect = false
3509 3509
                   }
3510
-                  this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
3510
+                  this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
3511 3511
                 }
3512 3512
               })
3513 3513
             }
@@ -3908,7 +3908,7 @@
3908 3908
                   } else {
3909 3909
                     this.case_history.is_infect = false
3910 3910
                   }
3911
-                  this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
3911
+                  this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
3912 3912
                 }
3913 3913
               })
3914 3914
 
@@ -4275,7 +4275,7 @@
4275 4275
               this.case_history.is_infect = false
4276 4276
             }
4277 4277
 
4278
-            this.$refs.prescriptions.setData(this.prescriptions, this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
4278
+            this.$refs.prescriptions.setMonthData(this.info, this.admin_info, this.doctors, this.department, this.hisPatientInfo, this.month_prescriptions, this.last_info)
4279 4279
           }
4280 4280
         })
4281 4281
 

+ 1 - 1
src/xt_pages/outpatientRegistration/registrationHistory.vue 查看文件

@@ -228,7 +228,7 @@
228 228
             <!--</el-dialog>-->
229 229
         <!--</div>-->
230 230
 
231
-        <div ]class="app-container">
231
+        <div class="app-container">
232 232
             <div class="cell clearfix">
233 233
                 <!-- <el-input style="width: 180px;" v-model.trim="search_input" class="filter-item"/> -->
234 234
                 <el-autocomplete