Pārlūkot izejas kodu

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 gadus atpakaļ
vecāks
revīzija
426341095d

+ 116 - 18
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Parādīt failu

@@ -18,11 +18,11 @@
18 18
           <el-form-item label="证件号: " prop="name">
19 19
             <el-input v-model="patientInfo.id_card_no" placeholder="" readonly></el-input>
20 20
           </el-form-item>
21
+          <!--<el-form-item label="挂号类型: " prop="name">-->
22
+            <!--<el-input v-model="hisPatientInfo.register_type" placeholder="" readonly></el-input>-->
23
+          <!--</el-form-item>-->
21 24
           <el-form-item label="挂号类型: " prop="name">
22
-            <el-input v-model="hisPatientInfo.register_type" placeholder="" readonly></el-input>
23
-          </el-form-item>
24
-          <el-form-item label="挂号类型: " prop="name">
25
-            <el-select style="margin-right:5px;" v-model="doctorValue" placeholder="">
25
+            <el-select style="margin-right:5px;" v-model="register_type" placeholder="">
26 26
               <el-option
27 27
                 v-for="(item,index) in doctors"
28 28
                 :key="index"
@@ -223,7 +223,8 @@
223 223
     delHisPrescription,
224 224
     getInitData,
225 225
     getPatientInfo,
226
-    getSchedulePatientList
226
+    getSchedulePatientList,
227
+
227 228
   } from '@/api/his/his'
228 229
   import { getDictionaryDataConfig } from '@/utils/data'
229 230
   import prescriptionTable from './prescriptionTable'
@@ -238,6 +239,7 @@
238 239
       hisPatientInfo: Object,
239 240
       prescriptions: Array,
240 241
       record_date: String,
242
+
241 243
       other_sick: {
242 244
         type: Array,
243 245
         default: []
@@ -255,6 +257,7 @@
255 257
     },
256 258
     data() {
257 259
       return {
260
+        register_type:"",
258 261
         value: '',
259 262
         form: {
260 263
           name: ''
@@ -378,35 +381,57 @@
378 381
           console.log(this.prescriptions[i].name)
379 382
           if (this.prescriptions[i].name == val.name) {
380 383
             this.curPrescriptions = this.prescriptions[i]
384
+            this.teamList = []
385
+            this.curDrugs = []
386
+            this.$refs.multipleTable.clearSelection()
387
+            this.$refs.tables.clearSelection()
381 388
 
382 389
             //用来区分处方属于项目还是药品
383 390
             if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
384 391
               this.customTabIndex = 1
385 392
               this.curStatus = 1
393
+              this.rightTab = 1
394
+              this.showOne = true
395
+              this.showTwo = false
386 396
             }
387 397
             if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
388 398
 
389 399
               this.customTabIndex = 2
390 400
               this.curStatus = 2
401
+              this.rightTab = 2
402
+
403
+              this.showTwo = true
404
+              this.showOne = false
391 405
             }
392 406
 
393 407
             if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
394 408
               this.customTabIndex = this.rightTab
409
+              this.curStatus = 0
410
+
395 411
             }
396 412
 
397 413
           }
398 414
 
399 415
         }
400 416
       }, clearData() {
401
-
417
+        console.log("111111")
402 418
         this.curPrescriptions = []
419
+        this.curStatus = 0
420
+        this.curDrugs = []
421
+        this.preDrugs = []
422
+        this.teamList = []
423
+
424
+
403 425
       },
404 426
       setData(data) {
427
+        this.curStatus = 0
428
+
405 429
         this.prescriptions = data
430
+        this.curPrescriptions = this.prescriptions[0]
406 431
         console.log(this.$refs)
407
-        this.$nextTick(() => {
408
-          this.$refs.prescription_tables.setNewData(this.prescriptions[0])
409
-        })
432
+        // this.$nextTick(() => {
433
+        //   this.$refs.prescription_tables.setNewData(this.prescriptions[0])
434
+        // })
410 435
       },
411 436
       moreState(tab, event) {
412 437
         if (tab == 'more') {
@@ -420,7 +445,7 @@
420 445
             diagnose: this.state1,
421 446
             sick_history: this.state2,
422 447
             doctor: this.doctorValue,
423
-            department: this.departmentValue,
448
+               department: this.departmentValue,
424 449
             record_date: this.record_date,
425 450
             his_patient_id: this.hisPatientInfo.id
426 451
           }
@@ -444,7 +469,7 @@
444 469
           }
445 470
           createHisPrescription(data, params).then(response => {
446 471
             if (response.data.state == 1) {
447
-              this.prescriptions = []
472
+              // this.prescriptions = []
448 473
               this.$message.success('保存成功')
449 474
             }
450 475
           })
@@ -518,6 +543,37 @@
518 543
           delHisPrescription(params).then(response => {
519 544
             if (response.data.state == 1) {
520 545
               this.$message.success('删除成功')
546
+              let tabs = this.prescriptions
547
+              let activeName = this.editableTabsValue
548
+              if (activeName === targetName) {
549
+                tabs.forEach((tab, index) => {
550
+                  if (tab.name === targetName) {
551
+                    let nextTab = tabs[index + 1] || tabs[index - 1]
552
+                    if (nextTab) {
553
+                      activeName = nextTab.name
554
+
555
+                    }
556
+                  }
557
+                })
558
+              }
559
+              this.editableTabsValue = activeName
560
+              this.prescriptions = tabs.filter(tab => tab.name !== targetName)
561
+
562
+              for (let i = 0; i < this.prescriptions.length; i++) {
563
+                if (activeName == this.prescriptions[i].name) {
564
+                  this.curPrescriptions = this.prescriptions[i]
565
+                  if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
566
+                    this.curStatus = 1
567
+                  }
568
+                  if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0){
569
+                    this.curStatus = 2
570
+                  }
571
+                }
572
+              }
573
+              if (this.prescriptions.length == 0) {
574
+                this.curPrescriptions = []
575
+                this.curStatus = 0
576
+              }
521 577
             } else {
522 578
               this.$message.success(response.data.msg)
523 579
             }
@@ -525,7 +581,25 @@
525 581
         }
526 582
       },
527 583
       clickTab(index) {
584
+        if (index == 1){
585
+          if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
586
+            this.$message.error("当前处方为项目,无法切换为药品,需要新开处方")
587
+            return
588
+          }
589
+        }else{
590
+          if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
591
+            this.$message.error("当前处方为药品,无法切换为项目,需要新开处方")
592
+            return
593
+          }
594
+
595
+
596
+        }
597
+
528 598
         if (index == 1) {
599
+
600
+            this.teamList = []
601
+          this.$refs.tables.clearSelection()
602
+
529 603
           this.showOne = true
530 604
           this.showTwo = false
531 605
           this.$nextTick(() => {
@@ -534,6 +608,9 @@
534 608
           this.customTabIndex = 1
535 609
         }
536 610
         if (index == 2) {
611
+          this.curDrugs = []
612
+          this.$refs.multipleTable.clearSelection()
613
+
537 614
           this.showTwo = true
538 615
           this.showOne = false
539 616
           this.$nextTick(() => {
@@ -545,17 +622,22 @@
545 622
 
546 623
         //用来区分处方属于项目还是药品
547 624
         if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
548
-
549 625
           this.customTabIndex = 1
626
+          this.curStatus =1
627
+
550 628
         }
551 629
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length > 0) {
552
-
553 630
           this.customTabIndex = 2
631
+          this.curStatus =2
554 632
         }
555 633
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
556 634
           // this.customTabIndex = this.rightTab
557 635
           this.customTabIndex = index
636
+          this.curStatus =0
637
+
558 638
         }
639
+
640
+
559 641
       }, changeAllGoodInfoTableData: function(selection) {
560 642
         this.curDrugs = selection
561 643
       }, addCharges() {
@@ -565,9 +647,7 @@
565 647
         this.curDrugs = selection
566 648
       },
567 649
       comfirm() {
568
-        console.log(this.curStatus)
569
-        console.log(this.rightTab)
570
-        console.log(this.curPrescriptions)
650
+
571 651
 
572 652
 
573 653
         if (this.curStatus == 1  && this.rightTab == 2) {
@@ -589,6 +669,7 @@
589 669
             var temp = this.deepClone(this.curDrugs)
590 670
             var temp2 = this.deepClone(this.teamList)
591 671
 
672
+            console.log(temp2)
592 673
             if (temp.length > 0) {
593 674
               for (let b = 0; b < temp.length; b++) {
594 675
                 let obj = {
@@ -602,7 +683,8 @@
602 683
                   prescribing_number: temp[b].prescribing_number,
603 684
                   single_dose_unit: temp[b].min_unit,
604 685
                   prescribing_number_unit: temp[b].min_unit,
605
-                  min_unit: temp[b].min_unit
686
+                  min_unit: temp[b].min_unit,
687
+                  medical_insurance_number:temp[b].medical_insurance_number,
606 688
 
607 689
                 }
608 690
                 this.prescriptions[i].advices.push(obj)
@@ -612,10 +694,26 @@
612 694
 
613 695
             if (temp2.length > 0) {
614 696
               for (let b = 0; b < temp2.length; b++) {
615
-                this.prescriptions[i].project.push(temp2[b])
697
+                let obj = {
698
+                  id: 0,
699
+                  project_id: temp2[b].id,
700
+                  project_name: temp2[b].project_name,
701
+                  statistical_classification: temp2[b].statistical_classification,
702
+                  single_dose: temp2[b].single_dose,
703
+                  delivery_way: temp2[b].delivery_way,
704
+                  execution_frequency: temp2[b].execution_frequency,
705
+                  number_days: temp2[b].number_days,
706
+                  total:temp2[b].total,
707
+                  price:temp2[b].price,
708
+                  remark:"",
709
+                  medical_code:temp2[b].medical_code,
710
+                }
711
+                console.log(obj)
712
+                this.prescriptions[i].project.push(obj)
616 713
               }
617 714
               this.curStatus = 2
618 715
             }
716
+
619 717
             this.curPrescriptions = this.prescriptions[i]
620 718
             this.$refs.multipleTable.clearSelection()
621 719
             this.$refs.tables.clearSelection()

+ 3 - 2
src/xt_pages/outpatientDoctorStation/components/medicalRecord.vue Parādīt failu

@@ -51,7 +51,7 @@
51 51
                                 <el-button type="primary" size="mini" @click="toHistoryDetail">详情</el-button>
52 52
                             </template>
53 53
                         </el-table-column>
54
-                    </el-table> 
54
+                    </el-table>
55 55
                 </el-tab-pane>
56 56
                 <el-tab-pane label="病历模板" name="second">
57 57
                     <div style="display:flex;align-items: center;margin-bottom:10px;">
@@ -106,7 +106,7 @@
106 106
             <el-button @click="hide">取 消</el-button>
107 107
             <el-button type="primary" :loading="submitLoading" @click="submitAction()">保 存</el-button>
108 108
         </div>
109
-    </el-dialog>         
109
+    </el-dialog>
110 110
 </template>
111 111
 
112 112
 <script>
@@ -119,6 +119,7 @@ export default {
119 119
     },
120 120
     data(){
121 121
         return{
122
+          submitLoading:false,
122 123
             visible:false,
123 124
             activeName:'first',
124 125
             form:{

+ 30 - 27
src/xt_pages/outpatientDoctorStation/components/prescriptionTable.vue Parādīt failu

@@ -2,17 +2,17 @@
2 2
   <div class="prescriptionTable">
3 3
     <el-table v-if="activeType  == 1" :data="prescription.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
4 4
               :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
5
-      <el-table-column align="center" prop="name" label="名称">
5
+      <el-table-column align="center" prop="drug_name" label="名称">
6 6
         <template slot-scope="scope">{{ scope.row.drug_name }}</template>
7 7
       </el-table-column>
8 8
 
9
-      <el-table-column align="center" prop="name" width="50" :label="'单次\n用量'">
9
+      <el-table-column align="center" prop="single_dose" width="50" :label="'单次\n用量'">
10 10
         <template slot-scope="scope">
11 11
           <el-input  v-model="scope.row.single_dose"></el-input>
12 12
           <div> {{scope.row.min_unit}}</div>
13 13
         </template>
14 14
       </el-table-column>
15
-      <el-table-column align="center" prop="name" width="50" label="用法">
15
+      <el-table-column align="center" prop="delivery_way" width="50" label="用法">
16 16
         <template slot-scope="scope">
17 17
           <el-select v-model="scope.row.delivery_way" placeholder="请选择">
18 18
             <el-option
@@ -24,7 +24,7 @@
24 24
           </el-select>
25 25
         </template>
26 26
       </el-table-column>
27
-      <el-table-column align="center" prop="name" width="50" label="频率">
27
+      <el-table-column align="center" prop="execution_frequency" width="50" label="频率">
28 28
         <template slot-scope="scope">
29 29
           <el-select v-model="scope.row.execution_frequency" placehold er="请选择">
30 30
             <el-option
@@ -37,7 +37,7 @@
37 37
         </template>
38 38
       </el-table-column>
39 39
 
40
-      <el-table-column align="center" prop="name" width="100" label="总量">
40
+      <el-table-column align="center" prop="prescribing_number" width="100" label="总量">
41 41
         <template slot-scope="scope">
42 42
           <div style="display:flex;">
43 43
             <el-input v-model="scope.row.prescribing_number" style="width:50%" placeholder=""></el-input>
@@ -45,12 +45,12 @@
45 45
           </div>
46 46
         </template>
47 47
       </el-table-column>
48
-      <el-table-column align="center" prop="name" width="50" label="单价">
48
+      <el-table-column align="center" prop="retail_price" width="50" label="单价">
49 49
         <template slot-scope="scope">
50 50
           <el-input v-model="scope.row.retail_price" placeholder=""></el-input>
51 51
         </template>
52 52
       </el-table-column>
53
-      <el-table-column align="center" prop="name" width="50" label="备注">
53
+      <el-table-column align="center" prop="remark" width="50" label="备注">
54 54
         <template slot-scope="scope">
55 55
           <el-input v-model="scope.row.remark" style="width:50%" placeholder=""></el-input>
56 56
         </template>
@@ -196,29 +196,32 @@
196 196
         })
197 197
 
198 198
       },deleteDrug:function(index, row){
199
-        console.log(row)
200
-       console.log(index)
201 199
 
202
-       if(row.advice_id == 0){
203
-          this.prescription.advices.splice(index, 1)
204
-        }else{
205
-          let params = {
206
-            'id': row.advice_id,
207
-          }
208
-          delHisAdvice(params).then(response => {
209
-            if (response.data.state == 0) {
210
-              this.$message.error(response.data.msg)
211
-              return false
212
-            } else {
213
-              var temp2 = this.deepClone(this.prescription.advices)
214
-              temp2.splice(index, 1)
215
-              this.prescription.advices = temp2
216
-              this.$message.success(response.data.data.msg)
217
-            }
218
-          })
200
+       this.$nextTick(function(){
201
+         this.prescription.advices.splice(index, 1)
202
+         // if(row.advice_id == 0){
203
+         // }else{
204
+         //   let params = {
205
+         //     'id': row.advice_id,
206
+         //   }
207
+         //   delHisAdvice(params).then(response => {
208
+         //     if (response.data.state == 0) {
209
+         //       this.$message.error(response.data.msg)
210
+         //       return false
211
+         //     } else {
212
+         //       var temp2 = this.deepClone(this.prescription.advices)
213
+         //       temp2.splice(index, 1)
214
+         //       this.prescription.advices = temp2
215
+         //       this.$message.success(response.data.data.msg)
216
+         //     }
217
+         //   })
218
+         //
219
+         //
220
+         // }
221
+
222
+       });
219 223
 
220 224
 
221
-        }
222 225
 
223 226
       },deepClone(source) {
224 227
        if (!source && typeof source !== 'object') {

+ 30 - 4
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Parādīt failu

@@ -155,7 +155,6 @@
155 155
           'record_date': this.record_date,
156 156
           'patient_id': val.patients.id
157 157
         }
158
-        console.log("-------")
159 158
         getPatientInfo(params).then(response => {
160 159
           if (response.data.state == 0) {
161 160
             this.$message.error(response.data.msg)
@@ -203,6 +202,8 @@
203 202
               for (let i = 0; i < response.data.data.prescription.length; i++) {
204 203
                 var prescription = response.data.data.prescription[i]
205 204
                 let tempAdvice = []
205
+                let tempProject = []
206
+
206 207
                 for (let b = 0; b < prescription.advices.length; b++) {
207 208
                   let obj = {
208 209
                     advice_id: prescription.advices[b].id,
@@ -212,20 +213,45 @@
212 213
                     execution_frequency: prescription.advices[b].execution_frequency,
213 214
                     retail_price: prescription.advices[b].price.toString(),
214 215
                     remark: prescription.advices[b].remark,
215
-                    prescribing_number:prescription.advices[b].prescribing_number,
216
+                    prescribing_number:prescription.advices[b].prescribing_number.toString(),
216 217
                     single_dose_unit:prescription.advices[b].single_dose_unit,
217 218
                     prescribing_number_unit:prescription.advices[b].prescribing_number_unit,
218
-                    min_unit:prescription.advices[b].single_dose_unit
219
+                    min_unit:prescription.advices[b].single_dose_unit,
220
+                    medical_insurance_number:prescription.advices[b].med_list_codg,
219 221
 
220 222
                   }
221 223
                   tempAdvice.push(obj)
222 224
                 }
225
+
226
+
227
+                for (let b = 0; b < prescription.project.length; b++) {
228
+                  console.log(prescription.project[b])
229
+                  console.log(prescription.project[b].project)
230
+                  let obj = {
231
+                    id: prescription.project[b].id,
232
+                    project_id: prescription.project[b].project.id,
233
+                    project_name: prescription.project[b].project.project_name,
234
+                    statistical_classification: prescription.project[b].project.statistical_classification,
235
+                    single_dose: prescription.project[b].project.single_dose,
236
+                    delivery_way: prescription.project[b].project.delivery_way,
237
+                    execution_frequency: prescription.project[b].project.execution_frequency,
238
+                    number_days: prescription.project[b].project.number_days,
239
+                    total:prescription.project[b].count.toString(),
240
+                    price:prescription.project[b].price,
241
+                    remark:prescription.project[b].remark,
242
+                    medical_code:prescription.project[b].project.medical_code,
243
+                  }
244
+                  tempProject.push(obj)
245
+                }
246
+
247
+
248
+
223 249
                 let index = i + 1
224 250
                 let obj = {
225 251
                   id: prescription.id,
226 252
                   name: '处方' + index,
227 253
                   advices: tempAdvice,
228
-                  project: prescription.project
254
+                  project: tempProject
229 255
                 }
230 256
                 this.prescriptions.push(obj)
231 257
               }