Parcourir la source

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

csx il y a 3 ans
Parent
révision
1c3a2f46e6

+ 1 - 1
src/xt_pages/data/components/editInspection.vue Voir le fichier

@@ -45,7 +45,7 @@
45 45
                     <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="form.remark"></el-input>
46 46
                 </el-form-item>
47 47
                 <el-form-item label="组套明细" style="width:50%;">
48
-                    <el-select v-model="form.project_detail" placeholder="请选择">
48
+                    <el-select v-model="form.project_detail" filterable placeholder="请选择">
49 49
                         <el-option
50 50
                                 v-for="item,index in projectList"
51 51
                                 :key="index"

+ 2 - 4
src/xt_pages/outpatientDoctorStation/components/additionalCharges.vue Voir le fichier

@@ -58,7 +58,7 @@
58 58
       },
59 59
       show() {
60 60
         this.chargeTable = []
61
-       
61
+
62 62
         this.visible = true
63 63
         for (let i = 0; i < this.additions.length; i++) {
64 64
           let obj = {
@@ -83,9 +83,7 @@
83 83
       }
84 84
     },
85 85
     watch: {
86
-      hisPatientInfo: function(val) {
87
-        console.log('患者ID', this)
88
-      }
86
+
89 87
     }
90 88
   }
91 89
 </script>

+ 76 - 78
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Voir le fichier

@@ -271,18 +271,18 @@
271 271
                                             <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
272 272
                                         </el-table-column>
273 273
                                         <el-table-column label="库存" width="60">
274
-                                            <template slot-scope="scope">{{
275
-                                                stockInCount(scope.row) -
276
-                                                salesReturnCount(scope.row) -
277
-                                                stockOutCount(scope.row) +
278
-                                                cancelStockCount(scope.row)
279
-                                                }}
274
+                                            <template slot-scope="scope">
275
+                                                {{scope.row.total}}{{scope.row.total?scope.row.min_unit:''}} / {{
276
+                                                scope.row.total * (scope.row.dose / scope.row.min_number)}}
277
+                                                {{(scope.row.total * (scope.row.dose /
278
+                                                scope.row.min_number))?scope.row.max_unit:''}}
280 279
                                             </template>
281 280
                                         </el-table-column>
282 281
                                         <el-table-column label="单价" width="40">
283 282
                                             <template slot-scope="scope">{{ scope.row.retail_price }}</template>
284 283
                                         </el-table-column>
285 284
                                     </el-table>
285
+                                    <div>{{3*(2/3)}}</div>
286 286
                                 </div>
287 287
 
288 288
                             </el-tab-pane>
@@ -420,11 +420,10 @@
420 420
                                    v-on:cancel="cancel"></next-or-last-prescription>
421 421
 
422 422
 
423
-
424 423
         <!--<next-or-last-prescription ref='next_or_last_prescription' v-on:save="setValue" v-on:cancel="cancel"></next-or-last-prescription>-->
425 424
         <call-prescription ref='call_prescription' v-on:call="call" v-on:call-cancel="callCancel"></call-prescription>
426 425
 
427
-        <
426
+
428 427
     </div>
429 428
 </template>
430 429
 
@@ -432,6 +431,7 @@
432 431
 <script>
433 432
   import MonthPrescriptionTable from '../../outpatientCharges/components/monthPrescriptionTable'
434 433
   import {
434
+    createdTemplate,
435 435
     createHisPrescription,
436 436
     delHisPrescription,
437 437
     editHisPrescription,
@@ -440,8 +440,7 @@
440 440
     getInitData,
441 441
     getNextOrLastHisPrescription,
442 442
     getPatientInfo,
443
-    getSchedulePatientList,
444
-    createdTemplate
443
+    getSchedulePatientList
445 444
   } from '@/api/his/his'
446 445
   import { getDictionaryDataConfig } from '@/utils/data'
447 446
   import prescriptionTable from './prescriptionTable'
@@ -505,7 +504,7 @@
505 504
         ],
506 505
         isLastOrNextVisible: false,
507 506
         multipleTableHeight: '',
508
-        register_type: 1,
507
+        register_type: '',
509 508
         value: '0',
510 509
         search_project_keyword: '',
511 510
         form: {
@@ -573,7 +572,7 @@
573 572
         sick: [],
574 573
         diagnoses: [],
575 574
         diagnose: 1,
576
-        state1: 1,
575
+        state1: '',
577 576
         curTotal: 0,
578 577
         prescription_id: 0,
579 578
         tempDrugs: [],
@@ -685,12 +684,6 @@
685 684
           return cur
686 685
         }, []) // 设置cur默认类型为数组,并且初始值为空的数组
687 686
 
688
-        console.log(drug_ids)
689
-        console.log(project_ids)
690
-        console.log(additions_ids)
691
-
692
-        console.log(additions_ids)
693
-
694 687
         let drugs = []
695 688
         let projects = []
696 689
         let additions = []
@@ -761,7 +754,6 @@
761 754
         for (let i = 0; i < additions_ids.length; i++) {
762 755
           let obj = {}
763 756
           let count = 0
764
-          console.log(addition_month_prescriptions.addition)
765 757
           if (addition_month_prescriptions.addition) {
766 758
             for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
767 759
               if (additions_ids[i].price == addition_month_prescriptions.addition[a].price) {
@@ -777,14 +769,13 @@
777 769
           }
778 770
         }
779 771
 
780
-
781 772
         let p1 = {
782 773
           name: '处方' + 1,
783 774
           advices: drugs,
784 775
           project: [],
785 776
           type: 1,
786 777
           addition: additions
787
-        };
778
+        }
788 779
         let p2 = {
789 780
           name: '处方' + 2,
790 781
           type: 2,
@@ -792,12 +783,10 @@
792 783
           advices: [],
793 784
           addition: []
794 785
 
795
-        };
796
-        console.log(this.month_prescriptions);
797
-        console.log(this.curMonthPrescriptions);
786
+        }
798 787
 
799
-        this.month_prescriptions.push(p1);
800
-        this.month_prescriptions.push(p2);
788
+        this.month_prescriptions.push(p1)
789
+        this.month_prescriptions.push(p2)
801 790
 
802 791
         this.curMonthPrescriptions = this.month_prescriptions[0]
803 792
 
@@ -1034,7 +1023,7 @@
1034 1023
                       prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1035 1024
                       medical_insurance_number: prescription.advices[b].med_list_codg,
1036 1025
                       id: prescription.advices[b].drug_id,
1037
-                      drug:prescription.advices[b].drug,
1026
+                      drug: prescription.advices[b].drug
1038 1027
                     }
1039 1028
                     tempAdvice.push(obj)
1040 1029
                   }
@@ -1123,8 +1112,6 @@
1123 1112
         }
1124 1113
         getDayOrMonthHisPrescription(params).then(response => {
1125 1114
           if (response.data.state == 1) {
1126
-            console.log(val)
1127
-            console.log(this.end_time)
1128 1115
             this.month_prescriptions = []
1129 1116
             if (val == this.start_time) {
1130 1117
               var day_prescription = response.data.data.day_prescription
@@ -1153,7 +1140,7 @@
1153 1140
                       prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
1154 1141
                       medical_insurance_number: prescription.advices[b].med_list_codg,
1155 1142
                       id: prescription.advices[b].drug_id,
1156
-                      drug:prescription.advices[b].drug,
1143
+                      drug: prescription.advices[b].drug
1157 1144
                     }
1158 1145
                     tempAdvice.push(obj)
1159 1146
                   }
@@ -1226,28 +1213,25 @@
1226 1213
           }
1227 1214
         })
1228 1215
 
1229
-      },saveTemplate(val){
1230
-        let params ={
1231
-          name:val.name,
1232
-          mode:val.mode,
1233
-          patient_id:this.patientInfo.id
1216
+      }, saveTemplate(val) {
1217
+        let params = {
1218
+          name: val.name,
1219
+          mode: val.mode,
1220
+          patient_id: this.patientInfo.id
1234 1221
         }
1235 1222
         let data = {
1236
-          "prescriptions":val.prescriptions,
1223
+          'prescriptions': val.prescriptions
1237 1224
         }
1238
-
1239
-        createdTemplate(params,data).then(response => {
1225
+        createdTemplate(params, data).then(response => {
1240 1226
           if (response.data.state == 1) {
1241 1227
             this.$refs.saveTemplate.hide()
1242 1228
 
1243
-            this.$message.success("保存成功")
1229
+            this.$message.success('保存成功')
1244 1230
           } else {
1245 1231
             this.$message.error(response.data.msg)
1246 1232
           }
1247 1233
         })
1248 1234
 
1249
-
1250
-
1251 1235
       },
1252 1236
       call(val) {
1253 1237
         this.prescriptions = []
@@ -1704,15 +1688,12 @@
1704 1688
 
1705 1689
       },
1706 1690
       monthTabclickEvent(val) {
1707
-        console.log(val)
1708
-        console.log(this.month_prescriptions)
1709 1691
 
1710 1692
         for (let i = 0; i < this.month_prescriptions.length; i++) {
1711 1693
           if (this.month_prescriptions[i].name == val.name) {
1712 1694
             if (this.dayorMonth == 'month') {
1713 1695
               if (this.isShowDayPrescription) {
1714 1696
                 this.curDayPrescriptions = this.month_prescriptions[i]
1715
-                console.log(this.curDayPrescriptions)
1716 1697
                 //用来区分处方属于项目还是药品
1717 1698
                 if (this.curDayPrescriptions.advices.length > 0 && this.curDayPrescriptions.project.length == 0) {
1718 1699
                   this.monthCustomTabIndex = 1
@@ -1807,23 +1788,21 @@
1807 1788
 
1808 1789
       },
1809 1790
       setData(data, info, admin_info, doctors, department, hisPatientInfo, month_data) {
1791
+        this.curMonthPrescriptions = {}
1792
+        this.curPrescriptions = {}
1810 1793
 
1794
+        console.log(doctors)
1811 1795
         for (let i = 0; i < doctors.length; i++) {
1812 1796
           if (doctors[i].user_type == 1) {
1813 1797
             doctors.splice(i, 1)
1814 1798
           }
1815 1799
         }
1816 1800
 
1817
-        this.curMonthPrescriptions = {}
1818
-        this.curPrescriptions = {}
1819
-
1820 1801
         this.prescription_id = data[0].id
1821 1802
         this.editableTabsValue = '处方1'
1822 1803
         this.dayorMonth = 'day'
1823 1804
         this.$emit('event1', this.prescription_id)
1824 1805
         this.curStatus = 0
1825
-        this.curPrescriptions = {}
1826
-        this.curMonthPrescriptions = {}
1827 1806
         if (month_data && month_data.length > 0) {
1828 1807
 
1829 1808
           this.curMonthPrescriptions = month_data[0]
@@ -1925,6 +1904,7 @@
1925 1904
             }
1926 1905
           }
1927 1906
         }
1907
+        console.log(info.register_type)
1928 1908
         if (info.register_type == 0) {
1929 1909
           for (let i = 0; i < this.register.length; i++) {
1930 1910
             this.register_type = this.register[0].value
@@ -1937,8 +1917,24 @@
1937 1917
         if (tab == 'more') {
1938 1918
           return false
1939 1919
         }
1940
-      },open_three(){
1941
-       this.$refs.saveTemplate.show(this.prescriptions)
1920
+      }, open_three() {
1921
+        for (let i = 0; i < this.prescriptions.length; i++) {
1922
+          for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
1923
+            if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
1924
+              this.$message.error('药品处方总量不能为0')
1925
+              return
1926
+            }
1927
+          }
1928
+        }
1929
+        for (let i = 0; i < this.prescriptions.length; i++) {
1930
+          for (let b = 0; b < this.prescriptions[i].project.length; b++) {
1931
+            if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
1932
+              this.$message.error('项目处方总量不能为0')
1933
+              return
1934
+            }
1935
+          }
1936
+        }
1937
+        this.$refs.saveTemplate.show(this.prescriptions)
1942 1938
       }, open_two() {
1943 1939
         if (this.dayorMonth == 'day') {
1944 1940
           if (this.patientInfo == null || this.patientInfo.id == 0) {
@@ -1968,34 +1964,48 @@
1968 1964
         if (this.dayorMonth == 'day') {
1969 1965
 
1970 1966
           if (this.prescriptions[0].advices.length == 0 && this.prescriptions[0].project.length == 0) {
1971
-            this.$message.error('请先开处方');
1967
+            this.$message.error('请先开处方')
1972 1968
             return
1973 1969
           }
1974 1970
         }
1975 1971
 
1976 1972
         if (this.dayorMonth == 'day') {
1977 1973
           if (this.curPrescriptions.order_status == 2) {
1978
-            this.$message.error('当前处方已经结算,无法保存');
1974
+            this.$message.error('当前处方已经结算,无法保存')
1979 1975
             return
1980 1976
           }
1981 1977
           if (this.doctorValue.length <= 0) {
1982
-            this.$message.error('医生不能为空');
1978
+            this.$message.error('医生不能为空')
1983 1979
             return
1984 1980
           }
1985 1981
 
1986 1982
           if (this.departmentValue.length <= 0) {
1987
-            this.$message.error('科室不能为空');
1983
+            this.$message.error('科室不能为空')
1988 1984
             return
1989 1985
           }
1990
-
1991
-          if (this.state1  <= 0) {
1992
-            this.$message.error('疾病类型不能为空');
1986
+          if (this.state1 <= 0) {
1987
+            this.$message.error('疾病类型不能为空')
1993 1988
             return
1994 1989
           }
1995
-
1990
+          for (let i = 0; i < this.prescriptions.length; i++) {
1991
+            for (let b = 0; b < this.prescriptions[i].advices.length; b++) {
1992
+              if (this.prescriptions[i].advices[b].prescribing_number == 0 || this.prescriptions[i].advices[b].prescribing_number == '') {
1993
+                this.$message.error('药品处方总量不能为0')
1994
+                return
1995
+              }
1996
+            }
1997
+          }
1998
+          for (let i = 0; i < this.prescriptions.length; i++) {
1999
+            for (let b = 0; b < this.prescriptions[i].project.length; b++) {
2000
+              if (this.prescriptions[i].project[b].total == 0 || this.prescriptions[i].project[b].total == '') {
2001
+                this.$message.error('项目处方总量不能为0')
2002
+                return
2003
+              }
2004
+            }
2005
+          }
1996 2006
           if (index == 1) {
1997 2007
             let params = {
1998
-              p_type:2,
2008
+              p_type: 2,
1999 2009
               patient_id: this.patientInfo.id,
2000 2010
               diagnose: this.diagnose,
2001 2011
               sick_type: this.state1,
@@ -2046,7 +2056,7 @@
2046 2056
               if (response.data.state == 1) {
2047 2057
                 this.$emit('change', this.patientInfo.id)
2048 2058
                 this.$message.success('保存成功')
2049
-              }else{
2059
+              } else {
2050 2060
                 this.$message.error(response.data.msg)
2051 2061
               }
2052 2062
             })
@@ -2106,7 +2116,6 @@
2106 2116
                 }
2107 2117
 
2108 2118
                 for (let b = 0; b < month_prescriptions[i].project.length; b++) {
2109
-                  console.log('~~~~~~~')
2110 2119
                   month_prescriptions[i].project[b].price = month_prescriptions[i].project[b].price.toString()
2111 2120
                   month_prescriptions[i].project[b].total = month_prescriptions[i].project[b].total.toString()
2112 2121
                   month_prescriptions[i].project[b].delivery_way = month_prescriptions[i].project[b].delivery_way.toString()
@@ -2378,7 +2387,6 @@
2378 2387
       },
2379 2388
 
2380 2389
       comfirm() {
2381
-        console.log('222222222222', this.curPrescriptions)
2382 2390
 
2383 2391
         // if (this.curPrescriptions.order_status == 2) {
2384 2392
         //   this.$message.error('该处方已经结算,无法继续添加药品或者项目')
@@ -2418,9 +2426,6 @@
2418 2426
           }
2419 2427
         }
2420 2428
 
2421
-        console.log(this.curDrugs)
2422
-        console.log(this.curPrescriptions.advices)
2423
-
2424 2429
         for (let i = 0; i < this.curDrugs.length; i++) {
2425 2430
           for (let a = 0; a < this.curPrescriptions.advices.length; a++) {
2426 2431
             if (this.curDrugs[i].id == this.curPrescriptions.advices[a].id) {
@@ -2497,8 +2502,8 @@
2497 2502
                   single_dose_unit: temp[b].min_unit,
2498 2503
                   prescribing_number_unit: temp[b].max_unit,
2499 2504
                   medical_insurance_number: temp[b].medical_insurance_number,
2500
-                  drug: temp[b],
2501
-                };
2505
+                  drug: temp[b]
2506
+                }
2502 2507
 
2503 2508
                 if (obj.prescribing_number == 0 || obj.prescribing_number.length == 0) {
2504 2509
                   obj.prescribing_number = 1
@@ -2520,7 +2525,6 @@
2520 2525
             //  }
2521 2526
 
2522 2527
             if (temp2.length > 0) {
2523
-              console.log('temp2222222222', temp2)
2524 2528
               for (let b = 0; b < temp2.length; b++) {
2525 2529
                 let obj = {
2526 2530
                   id: 0,
@@ -2538,14 +2542,13 @@
2538 2542
                   unit: temp2[b].unit,
2539 2543
                   type: temp2[b].type
2540 2544
                 }
2541
-                if (obj.total == 0) {
2545
+                if (obj.total == 0 || obj.total == undefined) {
2542 2546
                   obj.total = 1
2543 2547
                 }
2544 2548
                 if (obj.type == 3) {
2545 2549
                   obj.single_dose = 1
2546 2550
                 }
2547 2551
 
2548
-                console.log(obj)
2549 2552
                 this.prescriptions[i].project.push(obj)
2550 2553
               }
2551 2554
               this.curStatus = 2
@@ -2639,14 +2642,12 @@
2639 2642
         getAllProjectTeam().then(response => {
2640 2643
           if (response.data.state == 1) {
2641 2644
             var team = response.data.data.team
2642
-            console.log('team2222', team)
2643 2645
             this.tabPrjectTeam = team
2644 2646
             this.projectList = team
2645 2647
           }
2646 2648
         })
2647 2649
       },
2648 2650
       selectTeam(row) {
2649
-        console.log('row', row)
2650 2651
         var arr = []
2651 2652
         for (let i = 0; i < row.length; i++) {
2652 2653
           arr.push(row[i].item_id)
@@ -2694,7 +2695,7 @@
2694 2695
                   unit: project[i].project.unit,
2695 2696
                   type: project[i].type
2696 2697
                 }
2697
-                if (obj.total == 0) {
2698
+                if (obj.total == 0 || obj.total == undefined) {
2698 2699
                   obj.total = 1
2699 2700
                 }
2700 2701
 
@@ -2715,13 +2716,11 @@
2715 2716
                   unit: project[i].good_info.unit,
2716 2717
                   type: project[i].type
2717 2718
                 }
2718
-                if (obj.total == 0) {
2719
+                if (obj.total == 0 || obj.total == undefined) {
2719 2720
                   obj.total = 1
2720 2721
                 }
2721 2722
                 this.teamList.push(obj)
2722 2723
 
2723
-                console.log(this.teamList)
2724
-
2725 2724
               }
2726 2725
             }
2727 2726
 
@@ -2751,7 +2750,6 @@
2751 2750
         getAllProjectList().then(response => {
2752 2751
           if (response.data.state == 1) {
2753 2752
             var hisprojectlist = response.data.data.hisprojectlist
2754
-            console.log('hisprojectlist', hisprojectlist)
2755 2753
             this.hisList = hisprojectlist
2756 2754
           }
2757 2755
         })

+ 43 - 65
src/xt_pages/outpatientDoctorStation/components/saveTemplate.vue Voir le fichier

@@ -6,17 +6,14 @@
6 6
             :before-close="_close"
7 7
     >
8 8
         <div>
9
-            <el-form :model="form" class="adviceForm" ref="form" label-width="100px"
10
-                     style="display: flex;flex-wrap: wrap;justify-content: space-between;">
9
+            <el-form :model="form" class="adviceForm" :rules="rules" ref="form" label-width="100px"
10
+                     >
11 11
 
12
-                <!--<el-form-item label="处方模板类别 : " style="width: 100%;margin-bottom:0;">-->
13
-                <!--<el-radio v-model="radio" label="1">临时</el-radio>-->
14
-                <!--<el-radio v-model="radio" label="2">长期</el-radio>-->
15
-                <!--</el-form-item>-->
16
-                <el-form-item label="处方模板名称:" style="width: 60%;margin-bottom:0;">
17
-                    <el-input v-model="form.name" placeholder=""></el-input>
12
+                <el-form-item label="模板名称:"  prop="name" style="width: 100%;margin-bottom:0;">
13
+                    <el-input v-model="form.name"  placeholder=""></el-input>
18 14
                 </el-form-item>
19
-                <el-form-item label="透析模式 : " style="width: 60%;">
15
+
16
+                <el-form-item label="透析模式 : " style="width: 100%;margin-top: 20px" prop="mode">
20 17
                     <el-select v-model="form.mode" style="width:100%;" placeholder="请选择">
21 18
                         <el-option
22 19
                                 v-for="item in modeOptions"
@@ -30,9 +27,7 @@
30 27
 
31 28
 
32 29
             <div v-for="(item,index) in allPrescription" :key="index">
33
-                <el-checkbox-group v-model="item.check_group">
34 30
                     <div v-for="(subItem,index2) in item.prescriptions" :key="index2">
35
-                        <el-checkbox style="margin:10px 0;" :label="subItem.id">{{'处方' + (index2+ 1)}}</el-checkbox>
36 31
                         <el-table v-if="subItem.advices.length > 0" :data="subItem.advices" border style="width: 99%;"
37 32
                                   :row-style="{ color: '#303133' }"
38 33
                                   :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
@@ -146,14 +141,13 @@
146 141
                             </el-table-column>
147 142
                         </el-table>
148 143
                     </div>
149
-                </el-checkbox-group>
150 144
             </div>
151 145
 
152 146
 
153 147
         </div>
154 148
         <div slot="footer" class="dialog-footer">
155 149
             <el-button @click="hide">取 消</el-button>
156
-            <el-button type="primary" @click="submitAction()">保 存</el-button>
150
+            <el-button type="primary" @click="submitAction('form')">保 存</el-button>
157 151
         </div>
158 152
     </el-dialog>
159 153
 </template>
@@ -164,6 +158,10 @@
164 158
   export default {
165 159
     data() {
166 160
       return {
161
+        rules: {
162
+          name: [{required: true, message: "模版名字不能为空", trigger: 'blur'}],
163
+          mode: [{required: true, message: "请选择透析模式", trigger: 'blur'}],
164
+        },
167 165
         visible: false,
168 166
         modeOptions: {},
169 167
         allPrescription: [],
@@ -197,65 +195,45 @@
197 195
         this.form.name = ''
198 196
         this.form.intro = ''
199 197
       }, submitAction() {
200
-
201
-        let checkGroup = []
202
-        let allPrescriptions = []
203
-        let targetPrescriptions = []
204
-        let prescriptions = []
205
-        for (let i = 0; i < this.allPrescription.length; i++) {
206
-          for (let a = 0; a < this.allPrescription[i].check_group.length; a++) {
207
-            checkGroup.push(this.allPrescription[i].check_group[a])
208
-          }
209
-          for (let a = 0; a < this.allPrescription[i].prescriptions.length; a++) {
210
-            allPrescriptions.push(this.allPrescription[i].prescriptions[a])
211
-          }
212
-        }
213
-        for (let i = 0; i < allPrescriptions.length; i++) {
214
-          for (let a = 0; a < checkGroup.length; a++) {
215
-            if (allPrescriptions[i].id == checkGroup[a]) {
216
-              targetPrescriptions.push(allPrescriptions[i])
198
+        this.$refs['form'].validate((valid) => {
199
+          if (valid) {
200
+            let checkGroup = []
201
+            let allPrescriptions = []
202
+            let targetPrescriptions = []
203
+            for (let i = 0; i < allPrescriptions.length; i++) {
204
+                  targetPrescriptions.push(allPrescriptions[i])
217 205
             }
206
+            for(let i = 0; i < targetPrescriptions.length; i++){
207
+              if(targetPrescriptions[i].advices.length > 0 && targetPrescriptions[i].project.length == 0){
208
+                targetPrescriptions[i]["type"] = 1
209
+              } else if(targetPrescriptions[i].advices.length == 0 && targetPrescriptions[i].project.length > 0){
210
+                targetPrescriptions[i]["type"] = 2
211
+              }
212
+              for (let b = 0; b < targetPrescriptions[i].advices.length; b++) {
213
+                targetPrescriptions[i].advices[b].single_dose = targetPrescriptions[i].advices[b].single_dose.toString()
214
+                targetPrescriptions[i].advices[b].prescribing_number =targetPrescriptions[i].advices[b].prescribing_number.toString()
215
+                targetPrescriptions[i].advices[b].retail_price = targetPrescriptions[i].advices[b].retail_price.toString()
216
+                targetPrescriptions[i].advices[b].day = parseInt(targetPrescriptions[i].advices[b].day)
217
+              }
218
+              for (let b = 0; b < targetPrescriptions[i].project.length; b++) {
219
+                targetPrescriptions[i].project[b].price =targetPrescriptions[i].project[b].price.toString()
220
+                targetPrescriptions[i].project[b].total =targetPrescriptions[i].project[b].total.toString()
221
+                targetPrescriptions[i].project[b].delivery_way =targetPrescriptions[i].project[b].delivery_way.toString()
222
+              }
223
+            }
224
+            let params = {
225
+              name: this.form.name,
226
+              mode: this.form.mode,
227
+              prescriptions: targetPrescriptions,
228
+            }
229
+            this.$emit('save_template', params)
218 230
           }
219
-        }
220
-
221
-
222
-        for(let i = 0; i < targetPrescriptions.length; i++){
223
-          if(targetPrescriptions[i].advices.length > 0 && targetPrescriptions[i].project.length == 0){
224
-            targetPrescriptions[i]["type"] = 1
225
-          } else if(targetPrescriptions[i].advices.length == 0 && targetPrescriptions[i].project.length > 0){
226
-            targetPrescriptions[i]["type"] = 2
227
-          }
228
-          for (let b = 0; b < targetPrescriptions[i].advices.length; b++) {
229
-            targetPrescriptions[i].advices[b].single_dose = targetPrescriptions[i].advices[b].single_dose.toString()
230
-            targetPrescriptions[i].advices[b].prescribing_number =targetPrescriptions[i].advices[b].prescribing_number.toString()
231
-            targetPrescriptions[i].advices[b].retail_price = targetPrescriptions[i].advices[b].retail_price.toString()
232
-            targetPrescriptions[i].advices[b].day = parseInt(targetPrescriptions[i].advices[b].day)
233
-          }
234
-          for (let b = 0; b < targetPrescriptions[i].project.length; b++) {
235
-            targetPrescriptions[i].project[b].price =targetPrescriptions[i].project[b].price.toString()
236
-            targetPrescriptions[i].project[b].total =targetPrescriptions[i].project[b].total.toString()
237
-            targetPrescriptions[i].project[b].delivery_way =targetPrescriptions[i].project[b].delivery_way.toString()
238
-          }
239
-        }
240
-
241
-        let params = {
242
-          name: this.form.name,
243
-          mode: this.form.mode,
244
-          prescriptions: targetPrescriptions,
245
-        }
246
-        this.$emit('save_template', params)
231
+        })
247 232
       },
248 233
       show(prescriptions) {
249
-        for (let i = 0; i < prescriptions.length; i++) {
250
-          if (prescriptions[i].id == 0) {
251
-            prescriptions[i].id = Math.floor((Math.random() + Math.floor(Math.random() * 9 + 1)) * Math.pow(10, 10 - 1))
252
-          }
253
-        }
254
-
255 234
         this.allPrescription = []
256 235
         this.modeOptions = this.$store.getters.treatment_mode
257 236
         let obj = {
258
-          check_group: [],
259 237
           prescriptions: prescriptions
260 238
         }
261 239
         this.allPrescription.push(obj)

+ 98 - 51
src/xt_pages/outpatientDoctorStation/doctorDesk.vue Voir le fichier

@@ -341,8 +341,6 @@
341 341
                 }
342 342
               }
343 343
             }
344
-            console.log(this.un_cure_data)
345
-            console.log(this.cure_data)
346 344
             //排班
347 345
             for (let i = 0; i < response.data.data.list_two.length; i++) {
348 346
               //未就诊
@@ -584,31 +582,97 @@
584 582
           'record_date': this.record_date,
585 583
           'type': this.radio,
586 584
           'sch_type':this.schedule_type,
587
-        };
588
-        this.patientTableData = [];
585
+        }
586
+        this.un_cure_data = []
587
+        this.cure_data = []
588
+        this.all_data = []
589 589
 
590 590
         getSchedulePatientList(params).then(response => {
591 591
           if (response.data.state == 0) {
592 592
             this.$message.error(response.data.msg);
593 593
             return false
594 594
           } else {
595
-            this.patientTableData = response.data.data.list;
596
-            this.patientTableDataTwo = response.data.data.list;
597
-            this.cal_one = response.data.data.total_one;
598
-            this.cal_two = response.data.data.total_two;
599
-            this.admin_info = response.data.data.info;
595
+            //挂号
596
+            for (let i = 0; i < response.data.data.list.length; i++) {
597
+              for (let b = 0; b < response.data.data.list[i].his_patient.length; b++) {
598
+                //未就诊
599
+                if (response.data.data.list[i].his_patient[b].prescription.length == 0) {
600
+                  let obj = {
601
+                    name: response.data.data.list[i].his_patient[b].name,
602
+                    number: response.data.data.list[i].his_patient[b].number,
603
+                    id: response.data.data.list[i].id,
604
+                    his_patient_id: response.data.data.list[i].his_patient[b].id
605
+                  }
606
+                  this.un_cure_data.push(obj)
607
+                }
608
+                //已就诊
609
+                if (response.data.data.list[i].his_patient[b].prescription.length > 0) {
610
+                  let obj = {
611
+                    name: response.data.data.list[i].his_patient[b].name,
612
+                    number: response.data.data.list[i].his_patient[b].number,
613
+                    id: response.data.data.list[i].id,
614
+                    his_patient_id: response.data.data.list[i].his_patient[b].id
615
+                  }
616
+                  this.cure_data.push(obj)
617
+                }
618
+              }
619
+            }
600 620
 
601
-            if (this.patientTableData.length > 0) {
602
-              this.$refs.tab.setCurrentRow(this.patientTableData[0]);
603
-              this.oldCurrentRow = this.patientTableData[0];
621
+            //排班
622
+            for (let i = 0; i < response.data.data.list_two.length; i++) {
623
+              //未就诊
624
+              if (response.data.data.list_two[i].prescription.length == 0 && response.data.data.list_two[i].his_patient.id == 0) {
625
+                let obj = {
626
+                  name: response.data.data.list_two[i].name,
627
+                  number: response.data.data.list_two[i].his_patient.number,
628
+                  id: response.data.data.list_two[i].id,
629
+                  his_patient_id: response.data.data.list_two[i].his_patient.id
630
+                }
631
+                this.un_cure_data.push(obj)
632
+              }
604 633
 
605
-              this.getPatientInfo(this.patientTableData[0])
634
+              //已就诊
635
+              if (response.data.data.list_two[i].prescription.length > 0 && response.data.data.list_two[i].his_patient.id == 0) {
636
+                let obj = {
637
+                  name: response.data.data.list_two[i].name,
638
+                  number: response.data.data.list_two[i].his_patient.number,
639
+                  id: response.data.data.list_two[i].id,
640
+                  his_patient_id: response.data.data.list_two[i].his_patient.id
641
+                }
642
+                this.cure_data.push(obj)
643
+              }
606 644
             }
607 645
 
608
-            this.prescriptionList = response.data.data.list.prescription
646
+            this.all_data = this.all_data.concat(this.cure_data)
647
+            this.all_data = this.all_data.concat(this.un_cure_data)
609 648
 
610
-            // this.patientid = this.patientTableData[0].patient_id
649
+            this.cure_data_two = this.cure_data
650
+            this.un_cure_data_two =this.un_cure_data
651
+            this.all_data_two = this.all_data
611 652
 
653
+            this.cal_one = this.un_cure_data.length
654
+            this.cal_two = this.cure_data.length
655
+            this.admin_info = response.data.data.info
656
+            if (this.un_cure_data.length > 0) {
657
+              if(this.radio == 0){
658
+                this.$refs.tab.setCurrentRow(this.all_data[0])
659
+                this.oldCurrentRow = this.all_data[0]
660
+                this.getPatientInfo(this.all_data[0])
661
+              }else if(this.radio == 1){
662
+
663
+                this.$refs.tab.setCurrentRow(this.un_cure_data[0])
664
+                this.oldCurrentRow = this.un_cure_data[0]
665
+                this.getPatientInfo(this.un_cure_data[0])
666
+
667
+              }else if(this.radio == 2){
668
+
669
+                this.$refs.tab.setCurrentRow(this.cure_data[0])
670
+                this.oldCurrentRow = this.cure_data[0]
671
+                this.getPatientInfo(this.cure_data[0])
672
+
673
+              }
674
+
675
+            }
612 676
           }
613 677
         })
614 678
       },
@@ -761,7 +825,6 @@
761 825
         for (let i = 0; i < additions_ids.length; i++) {
762 826
           let obj = {}
763 827
           let count = 0
764
-          console.log(addition_month_prescriptions.addition)
765 828
           if (addition_month_prescriptions.addition) {
766 829
             for (let a = 0; a < addition_month_prescriptions.addition.length; a++) {
767 830
               if (project_ids[i].price == addition_month_prescriptions.addition[a].price) {
@@ -777,9 +840,6 @@
777 840
           }
778 841
         }
779 842
 
780
-        console.log(drugs)
781
-        console.log(projects)
782
-        console.log(additions)
783 843
 
784 844
         let p1 = {
785 845
           name: '处方' + 1,
@@ -1004,8 +1064,6 @@
1004 1064
                 }
1005 1065
               }
1006 1066
             }
1007
-            console.log(this.un_cure_data)
1008
-            console.log(this.cure_data)
1009 1067
 
1010 1068
 
1011 1069
             //排班
@@ -1091,7 +1149,6 @@
1091 1149
             this.patientInfo = response.data.data.xt_info
1092 1150
             this.hisPatientInfo = response.data.data.his_info
1093 1151
             this.case_history = response.data.data.case_history
1094
-            console.log('病历222222', this.case_history)
1095 1152
             this.info = response.data.data.info
1096 1153
             this.doctors = response.data.data.doctors
1097 1154
             this.department = response.data.data.department
@@ -1451,9 +1508,7 @@
1451 1508
       },
1452 1509
 
1453 1510
       choosePatient(val) {
1454
-        console.log(111111,val);
1455 1511
         if(this.titleType == '电子病历'){
1456
-          console.log('this.$refs.child.watchSign',this.$refs.child.watchSign);
1457 1512
           if(this.$refs.child.watchSign > 2){
1458 1513
             this.$confirm('是否保存当前病例', '保存', {
1459 1514
               confirmButtonText: '确 定',
@@ -1488,7 +1543,6 @@
1488 1543
                   this.patientInfo = response.data.data.xt_info;
1489 1544
                   this.hisPatientInfo = response.data.data.his_info;
1490 1545
                   this.case_history = response.data.data.case_history;
1491
-                  console.log("数据是22222多少",this.case_history);
1492 1546
                   this.info = response.data.data.info;
1493 1547
                   this.doctors = response.data.data.doctors;
1494 1548
                   this.department = response.data.data.department;
@@ -1868,7 +1922,6 @@
1868 1922
                   this.patientInfo = response.data.data.xt_info;
1869 1923
                   this.hisPatientInfo = response.data.data.his_info;
1870 1924
                   this.case_history = response.data.data.case_history;
1871
-                  console.log("数据是22222多少",this.case_history);
1872 1925
                   this.info = response.data.data.info;
1873 1926
                   this.doctors = response.data.data.doctors;
1874 1927
                   this.department = response.data.data.department;
@@ -2249,7 +2302,6 @@
2249 2302
                   this.patientInfo = response.data.data.xt_info;
2250 2303
                   this.hisPatientInfo = response.data.data.his_info;
2251 2304
                   this.case_history = response.data.data.case_history;
2252
-                  console.log("数据是22222多少",this.case_history);
2253 2305
                   this.info = response.data.data.info;
2254 2306
                   this.doctors = response.data.data.doctors;
2255 2307
                   this.department = response.data.data.department;
@@ -2603,7 +2655,8 @@
2603 2655
               });
2604 2656
             this.$refs.child.watchSign = 0
2605 2657
           }
2606
-        }else{
2658
+        }
2659
+        else{
2607 2660
         var nowDate = new Date();
2608 2661
         var nowYear = nowDate.getFullYear();
2609 2662
         var nowMonth = nowDate.getMonth() + 1;
@@ -2638,9 +2691,9 @@
2638 2691
         }
2639 2692
 
2640 2693
         if (isShowDailog) {
2641
-          this.patientTableData.map((item, index) => {
2642
-            if (item.patient_id == this.oldCurrentRow.patient_id) {
2643
-              this.$refs.tab.setCurrentRow(this.patientTableData[index])
2694
+          this.all_data.map((item, index) => {
2695
+            if (item.id == this.oldCurrentRow.id) {
2696
+              this.$refs.tab.setCurrentRow(this.all_data[index])
2644 2697
               return
2645 2698
             }
2646 2699
           })
@@ -2651,11 +2704,12 @@
2651 2704
           }).then(() => {
2652 2705
             this.open(1)
2653 2706
           }).catch(() => {
2654
-            this.patientTableData.map((item, index) => {
2655
-              if (item.patient_id == val.patient_id) {
2656
-                this.$refs.tab.setCurrentRow(this.patientTableData[index])
2707
+
2708
+            for(let i = 0; i < this.all_data.length; i++){
2709
+              if(this.all_data[i].id == val.id){
2710
+                this.$refs.tab.setCurrentRow(this.all_data[i])
2657 2711
               }
2658
-            })
2712
+            }
2659 2713
 
2660 2714
             this.patientid = val.id
2661 2715
             let params = {
@@ -2671,12 +2725,16 @@
2671 2725
                 this.$message.error(response.data.msg)
2672 2726
                 return false
2673 2727
               } else {
2728
+                for(let i = 0;i < this.all_data.length; i++){
2729
+                  if(this.all_data[i].id == val.id){
2730
+                    this.oldCurrentRow =  this.all_data[i]
2731
+                  }
2732
+                }
2674 2733
 
2675 2734
                 this.prescriptions = []
2676 2735
                 this.patientInfo = response.data.data.xt_info
2677 2736
                 this.hisPatientInfo = response.data.data.his_info
2678 2737
                 this.case_history = response.data.data.case_history
2679
-                console.log('数据列表是多少', this.case_history)
2680 2738
                 var month_prescriptions = response.data.data.month_prescriptions
2681 2739
                 this.setMonthPrescription(month_prescriptions)
2682 2740
                 this.doctors = response.data.data.doctors
@@ -2688,7 +2746,7 @@
2688 2746
                   }
2689 2747
                 }
2690 2748
 
2691
-                this.case_history = case_history
2749
+                this.case_history = response.data.data.case_history
2692 2750
                 this.info = response.data.data.info
2693 2751
                 this.patientInfo.birth = uParseTime(this.patientInfo.birthday, '{y}-{m}-{d}')
2694 2752
                 if (this.case_history.breathing <= 0) {
@@ -3059,7 +3117,6 @@
3059 3117
               this.patientInfo = response.data.data.xt_info
3060 3118
               this.hisPatientInfo = response.data.data.his_info
3061 3119
               this.case_history = response.data.data.case_history
3062
-              console.log('数据是22222多少', this.case_history)
3063 3120
               this.info = response.data.data.info
3064 3121
               this.doctors = response.data.data.doctors
3065 3122
               this.department = response.data.data.department
@@ -3413,17 +3470,10 @@
3413 3470
 
3414 3471
         }
3415 3472
         }
3416
-
3417
-
3418
-
3419
-
3420
-
3421 3473
       },
3422 3474
       currentChange(currentRow, oldCurrentRow) {
3423 3475
         this.newPatientId = oldCurrentRow.id;
3424
-        console.log('老数据',oldCurrentRow.id);
3425 3476
         this.patientid = oldCurrentRow.id;
3426
-
3427 3477
         let isShowDailog = false
3428 3478
         for (let i = 0; i < this.prescriptions.length; i++) {
3429 3479
           if ((this.prescriptions[i].id == 0 && this.prescriptions[i].advices.length > 0) || (this.prescriptions[i].id == 0 && this.prescriptions[i].project.length > 0)) {
@@ -3434,14 +3484,10 @@
3434 3484
           this.oldCurrentRow = currentRow
3435 3485
           return
3436 3486
         }
3437
-
3438
-
3439 3487
       }, open_two() {
3440 3488
         this.$refs.prescriptions.open_two()
3441 3489
       },open_three(){
3442 3490
         this.$refs.prescriptions.open_three()
3443
-
3444
-
3445 3491
       },
3446 3492
       open(index) {
3447 3493
 
@@ -3504,7 +3550,6 @@
3504 3550
           if (response.data.state == 1) {
3505 3551
             this.centerDialogVisible = true
3506 3552
             var list = response.data.data.list
3507
-            console.log('list2222222', list)
3508 3553
             for (let i = 0; i < list.length; i++) {
3509 3554
               list[i].prescription_number = list[i].prescription_number + i
3510 3555
             }
@@ -3514,9 +3559,11 @@
3514 3559
       },
3515 3560
       handleSelectionChange(val) {
3516 3561
         this.selecting_schs = val
3517
-        // console.log("99999",this.selecting_schs)
3518 3562
       },
3519 3563
       handleClick() {
3564
+        if(this.titleType == "电子处方"){
3565
+          this.getPatientInfo()
3566
+        }
3520 3567
 
3521 3568
       },
3522 3569
       savePrint() {

+ 22 - 5
src/xt_pages/outpatientDoctorStation/prescriptionTemplate.vue Voir le fichier

@@ -7,15 +7,15 @@
7 7
         </div>
8 8
         <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
9 9
             <div class="mainLeft">
10
-                <!--<div class="mainCell" style="margin-bottom:10px;">-->
11
-                    <!--<el-input size="small" placeholder="请输入姓名" @input="searchAction"-->
12
-                              <!--@keyup.enter.native='searchAction'-->
13
-                              <!--v-model="search_input" class="filter-item"/>-->
10
+                <div class="mainCell" style="margin-bottom:10px;">
11
+                    <el-input size="small" placeholder="请输入姓名或者透析号"
12
+                              v-model="search_input" class="filter-item" @input="searchAction"
13
+                              @keyup.enter.native='searchAction'/>
14 14
                     <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
15 15
                                <!--@click="searchAction">-->
16 16
                         <!--搜索-->
17 17
                     <!--</el-button>-->
18
-                <!--</div>-->
18
+                </div>
19 19
                 <div>
20 20
                     <el-table :data="data" :height="tableHeight" @row-click='choosePatient'
21 21
                                border style="width: 100%;"
@@ -91,6 +91,7 @@
91 91
         fullHeight: document.documentElement.clientHeight,
92 92
         isloading: false,
93 93
         data: [],
94
+        all_data:[],
94 95
         page: 1,
95 96
         limit: 10,
96 97
         patient_id: 0,
@@ -98,6 +99,20 @@
98 99
       }
99 100
     },
100 101
     methods: {
102
+      searchAction() {
103
+        this.data = []
104
+        if (this.search_input.length == 0) {
105
+          this.data = this.all_data
106
+        } else {
107
+
108
+          for(let i = 0; i < this.all_data.length; i++){
109
+            if(this.all_data[i].name.indexOf(this.search_input)  != -1 || this.all_data[i].dialysis_no.indexOf(this.search_input)  != -1){
110
+              this.data.push(this.all_data[i])
111
+            }
112
+          }
113
+        }
114
+      },
115
+
101 116
       deleteTemplate(row) {
102 117
         this.$confirm('处方模版删除后不可恢复,是否确认删除', '删除', {
103 118
           confirmButtonText: '确 定',
@@ -172,6 +187,8 @@
172 187
         getPatientList().then(response => {
173 188
           if (response.data.state == 1) {
174 189
             this.data = response.data.data.list
190
+            this.all_data = response.data.data.list
191
+
175 192
             this.$refs.tab.setCurrentRow(this.data[0])
176 193
             // this.patient_id = this.data[0].id
177 194
             // this.GetPrescriptionTemplateList()

+ 7 - 4
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue Voir le fichier

@@ -175,8 +175,11 @@
175 175
                                 </el-tab-pane>
176 176
                             </el-tabs>
177 177
                         </div>
178
+                        </div>
178 179
                     </el-tabs>
179
-                    <template>
180
+
181
+
182
+                <template>
180 183
 
181 184
 
182 185
                         <div class="comfirmBox">
@@ -1351,7 +1354,7 @@
1351 1354
                   unit: temp2[b].unit,
1352 1355
                   type: temp2[b].type
1353 1356
                 }
1354
-                if (obj.total == 0) {
1357
+                if (obj.total == 0 || obj.total == undefined) {
1355 1358
                   obj.total = 1
1356 1359
                 }
1357 1360
                 if (obj.type == 3) {
@@ -1619,7 +1622,7 @@
1619 1622
                   unit: project[i].project.unit,
1620 1623
                   type: project[i].type
1621 1624
                 }
1622
-                if (obj.total == 0) {
1625
+                if (obj.total == 0 || obj.total == undefined) {
1623 1626
                   obj.total = 1
1624 1627
                 }
1625 1628
 
@@ -1640,7 +1643,7 @@
1640 1643
                   unit: project[i].good_info.unit,
1641 1644
                   type: project[i].type
1642 1645
                 }
1643
-                if (obj.total == 0) {
1646
+                if (obj.total == 0 || obj.total == undefined) {
1644 1647
                   obj.total = 1
1645 1648
                 }
1646 1649
                 this.teamList.push(obj)