huangyw 2 年 前
コミット
47acc091bf
共有2 個のファイルを変更した222 個の追加168 個の削除を含む
  1. 97 66
      src/xt_pages/Pharmacy/DrugDispensing.vue
  2. 125 102
      src/xt_pages/Pharmacy/PatientDispensing.vue

+ 97 - 66
src/xt_pages/Pharmacy/DrugDispensing.vue ファイルの表示

@@ -114,68 +114,75 @@
114 114
       </div>
115 115
       <div class="mainRight">
116 116
         <div class="titlelist">
117
-          <!-- 班次:
118
-          <el-select
119
-            v-model="shift"
120
-            placeholder="请选择"
121
-            @change="getdrugsdetails"
122
-          >
123
-            <el-option
124
-              v-for="item in banshift"
125
-              :key="item.value"
126
-              :label="item.text"
127
-              :value="item.value"
117
+          <div>
118
+            班次:
119
+            <el-select
120
+              v-model="shift"
121
+              placeholder="请选择"
122
+              @change="getdrugsdetails"
128 123
             >
129
-            </el-option>
130
-          </el-select>
131
-          分区:
132
-          <el-select
133
-            v-model="partition"
134
-            placeholder="请选择"
135
-            @change="getdrugsdetails"
136
-          >
137
-            <el-option
138
-              v-for="item in fen"
139
-              :key="item.id"
140
-              :label="item.name"
141
-              :value="item.id"
124
+              <el-option
125
+                v-for="item in banshift"
126
+                :key="item.value"
127
+                :label="item.text"
128
+                :value="item.value"
129
+              >
130
+              </el-option>
131
+            </el-select>
132
+            分区:
133
+            <el-select
134
+              v-model="partition"
135
+              placeholder="请选择"
136
+              @change="getdrugsdetails"
142 137
             >
143
-            </el-option>
144
-          </el-select>
145
-          给药途径:
146
-          <el-select
147
-            v-model="deliveryway"
148
-            placeholder="请选择"
149
-            @change="getdruglist02"
150
-          >
151
-            <el-option
152
-              v-for="item in routeofadministration"
153
-              :key="item.name"
154
-              :label="item.name"
155
-              :value="item.name"
138
+              <el-option
139
+                v-for="item in fen"
140
+                :key="item.id"
141
+                :label="item.name"
142
+                :value="item.id"
143
+              >
144
+              </el-option>
145
+            </el-select>
146
+            给药途径:
147
+            <el-select
148
+              v-model="deliveryway"
149
+              placeholder="请选择"
150
+              @change="getdruglist02"
156 151
             >
157
-            </el-option>
158
-          </el-select> -->
159
-          <!-- <el-button type="primary" @click="toExport" v-if="state == 2"
160
-            >导出</el-button
161
-          > -->
162
-          <!--          <el-button type="primary" @click="tt">调试</el-button>-->
163
-          <el-button type="primary" @click="dispense" v-if="state == 1"
164
-            >发药</el-button
165
-          >
166
-          <el-button type="primary" @click="toPrint">打印</el-button>
167
-          <!--                    <el-button @click="tt">调试</el-button>-->
152
+              <el-option
153
+                v-for="item in routeofadministration"
154
+                :key="item.name"
155
+                :label="item.name"
156
+                :value="item.name"
157
+              >
158
+              </el-option>
159
+            </el-select>
160
+          </div>
161
+          <div>
162
+            <el-button type="primary" @click="toExport" v-if="state == 2"
163
+              >导出</el-button
164
+            >
165
+            <!-- <el-button type="primary" @click="tt">调试</el-button>-->
166
+            <el-button type="primary" @click="dispense" v-if="state == 1"
167
+              >发药</el-button
168
+            >
169
+            <el-button type="primary" @click="toPrint">打印</el-button>
170
+            <!--                    <el-button @click="tt">调试</el-button>-->
171
+          </div>
168 172
         </div>
173
+
169 174
         <el-divider></el-divider>
170 175
         <div class="right_table">
176
+          <!-- :summary-method="getSummaries"
177
+            show-summary -->
171 178
           <el-table
179
+            ref="table_01"
172 180
             :height="tableHeight"
173 181
             :data="tableData"
174
-            :summary-method="getSummaries"
175
-            show-summary
182
+            
176 183
             border
177 184
             highlight-current-row
178
-            style="width: 1328px"
185
+            style="width: 100%"
179 186
             :row-style="{ color: '#303133' }"
180 187
             :header-cell-style="{
181 188
               backgroundColor: 'rgb(245, 247, 250)',
@@ -266,14 +273,26 @@
266 273
           </el-table>
267 274
         </div>
268 275
         <div>
276
+          <!-- :summary-method="getSummaries"
277
+            show-summarys -->
269 278
           <el-table
279
+            ref="table_01"
280
+            v-if="state == 2"
270 281
             :height="tableHeight"
271 282
             :data="tableData"
283
+            
272 284
             border
273
-            style="width: 1328px"
274
-            v-if="state == 2"
285
+            highlight-current-row
286
+            style="width: 100%"
287
+            :row-style="{ color: '#303133' }"
288
+            :header-cell-style="{
289
+              backgroundColor: 'rgb(245, 247, 250)',
290
+              color: '#606266',
291
+            }"
292
+            @selection-change="handleSelectionChange"
293
+            
275 294
           >
276
-            <!--            <el-table-column type="selection" width="55"> </el-table-column>-->
295
+            <!-- <el-table-column type="selection" width="55"> </el-table-column>-->
277 296
             <el-table-column
278 297
               type="index"
279 298
               label="序号"
@@ -519,6 +538,7 @@ export default {
519 538
       });
520 539
     },
521 540
     getSummaries(param) {
541
+      console.log(param, "pram");
522 542
       const { columns, data } = param;
523 543
       const sums = [];
524 544
       columns.forEach((column, index) => {
@@ -526,7 +546,7 @@ export default {
526 546
           sums[index] = "合计";
527 547
           return;
528 548
         }
529
-       if (index === 7) {
549
+        if (index === 7) {
530 550
           sums[index] = this.total;
531 551
           return;
532 552
         }
@@ -833,7 +853,7 @@ export default {
833 853
       if (this.state == 2) {
834 854
         this.handleCurrentChange(this.currentRow);
835 855
         // this.fun5(tps);
836
-      }else{
856
+      } else {
837 857
         this.handleCurrentChange(this.currentRow);
838 858
         // this.fun4(tps);
839 859
       }
@@ -920,10 +940,10 @@ export default {
920 940
       }
921 941
     },
922 942
     getdrugsdetails(val) {
923
-      if(this.state == 1){
924
-        val = 0
925
-      }else{
926
-        val = 1
943
+      if (this.state == 1) {
944
+        val = 0;
945
+      } else {
946
+        val = 1;
927 947
       }
928 948
       var params = {
929 949
         drug_id: this.currentRow.id,
@@ -1011,6 +1031,11 @@ export default {
1011 1031
     this.getrouteofadministration();
1012 1032
     this.getgetpartitionlist();
1013 1033
   },
1034
+  updated() {
1035
+    this.$nextTick(() => {
1036
+      this.$refs["table_01"].doLayout();
1037
+    });
1038
+  },
1014 1039
 };
1015 1040
 </script>
1016 1041
 
@@ -1044,10 +1069,13 @@ export default {
1044 1069
   height: 100%;
1045 1070
   display: flex;
1046 1071
   flex-direction: column;
1047
-  overflow-y: auto;
1072
+  overflow-y: hidden;
1048 1073
   .titlelist {
1049 1074
     display: flex;
1050
-    justify-content: flex-end;
1075
+    justify-content: space-between;
1076
+    white-space: nowrap;
1077
+    color: #909399;
1078
+    font-size: 14px;
1051 1079
   }
1052 1080
   .el-button {
1053 1081
     height: 34px;
@@ -1066,11 +1094,14 @@ export default {
1066 1094
   overflow-y: auto;
1067 1095
   overflow-x: hidden;
1068 1096
 }
1069
-.right_table{
1097
+.right_table {
1070 1098
   /deep/ .el-table--scrollable-x .el-table__body-wrapper {
1071
-  overflow-y: auto;
1072
-  overflow-x: scroll;
1073
-}
1099
+    overflow-y: auto;
1100
+    overflow-x: scroll;
1101
+  }
1102
+  // /deep/ .el-table__footer-wrapper {
1103
+  //   margin-top: -2px !important;
1104
+  // }
1074 1105
 }
1075 1106
 /deep/ .gutter {
1076 1107
   width: 15px !important;

+ 125 - 102
src/xt_pages/Pharmacy/PatientDispensing.vue ファイルの表示

@@ -61,7 +61,7 @@
61 61
             border
62 62
             style="width: 100%"
63 63
             v-if="state == 1"
64
-             :row-style="{ color: '#303133' }"
64
+            :row-style="{ color: '#303133' }"
65 65
             :header-cell-style="{
66 66
               backgroundColor: 'rgb(245, 247, 250)',
67 67
               color: '#606266',
@@ -87,7 +87,7 @@
87 87
             highlight-current-row
88 88
             @current-change="handleCurrentChange"
89 89
             border
90
-             :row-style="{ color: '#303133' }"
90
+            :row-style="{ color: '#303133' }"
91 91
             :header-cell-style="{
92 92
               backgroundColor: 'rgb(245, 247, 250)',
93 93
               color: '#606266',
@@ -112,36 +112,54 @@
112 112
       </div>
113 113
       <div class="mainRight">
114 114
         <div class="titlelist">
115
-          班次:
116
-          <el-select v-model="shift" placeholder="请选择" @change="searchAction">
117
-            <el-option
118
-              v-for="item in banshift"
119
-              :key="item.value"
120
-              :label="item.text"
121
-              :value="item.value">
122
-            </el-option>
123
-          </el-select>
124
-          分区:
125
-          <el-select v-model="partition" placeholder="请选择" @change="searchAction">
126
-            <el-option
127
-              v-for="item in fen"
128
-              :key="item.id"
129
-              :label="item.name"
130
-              :value="item.id">
131
-            </el-option>
132
-          </el-select>
133
-          <el-button type="primary" @click="toExport" v-if="state == 2">导出</el-button>
134
-          <el-button type="primary" @click="dispense" v-if="state == 1"
135
-            >发药</el-button
136
-          >
137
-          <el-button type="primary" @click="endispense" v-if="state == 2"
138
-            >退药</el-button
139
-          >
140
-          <el-button type="primary" @click="toPrint">打印</el-button>
141
-<!--                    <el-button @click="tiaoshi">调试</el-button>-->
142
-          <el-button type="primary" v-if="state == 1" @click="toSetting"
143
-            >设置</el-button
144
-          >
115
+          <div>
116
+            班次:
117
+            <el-select
118
+              v-model="shift"
119
+              placeholder="请选择"
120
+              @change="searchAction"
121
+            >
122
+              <el-option
123
+                v-for="item in banshift"
124
+                :key="item.value"
125
+                :label="item.text"
126
+                :value="item.value"
127
+              >
128
+              </el-option>
129
+            </el-select>
130
+            分区:
131
+            <el-select
132
+              v-model="partition"
133
+              placeholder="请选择"
134
+              @change="searchAction"
135
+            >
136
+              <el-option
137
+                v-for="item in fen"
138
+                :key="item.id"
139
+                :label="item.name"
140
+                :value="item.id"
141
+              >
142
+              </el-option>
143
+            </el-select>
144
+          </div>
145
+
146
+          <div>
147
+            <el-button type="primary" @click="toExport" v-if="state == 2"
148
+              >导出</el-button
149
+            >
150
+
151
+            <el-button type="primary" @click="dispense" v-if="state == 1"
152
+              >发药</el-button
153
+            >
154
+            <el-button type="primary" @click="endispense" v-if="state == 2"
155
+              >退药</el-button
156
+            >
157
+            <el-button type="primary" @click="toPrint">打印</el-button>
158
+            <!--                    <el-button @click="tiaoshi">调试</el-button>-->
159
+            <el-button type="primary" v-if="state == 1" @click="toSetting"
160
+              >设置</el-button
161
+            >
162
+          </div>
145 163
         </div>
146 164
         <el-divider style="margin-top: 10px"></el-divider>
147 165
         <div>
@@ -292,15 +310,15 @@ export default {
292 310
       currentRow: null,
293 311
       dialogVisible: false,
294 312
       is_open: "2",
295
-      banshift:[
296
-        {value:0,text:'全部班'},
297
-        {value:1,text:'上午'},
298
-        {value:2,text: '下午'},
299
-        {value:3,text: '晚上'}
300
-        ],
301
-      shift:0,//班次
302
-      fen:[],
303
-      partition:0,//分区
313
+      banshift: [
314
+        { value: 0, text: "全部班" },
315
+        { value: 1, text: "上午" },
316
+        { value: 2, text: "下午" },
317
+        { value: 3, text: "晚上" },
318
+      ],
319
+      shift: 0, //班次
320
+      fen: [],
321
+      partition: 0, //分区
304 322
     };
305 323
   },
306 324
   watch: {},
@@ -313,13 +331,13 @@ export default {
313 331
     // this.selectedbydefault();
314 332
   },
315 333
   methods: {
316
-    getgetpartitionlist(){
317
-      var params = {}
318
-      getpartitionlist(params).then((res) =>{
319
-        if(res.data.state == 1){
320
-          this.fen = res.data.data.list
334
+    getgetpartitionlist() {
335
+      var params = {};
336
+      getpartitionlist(params).then((res) => {
337
+        if (res.data.state == 1) {
338
+          this.fen = res.data.data.list;
321 339
         }
322
-      })
340
+      });
323 341
     },
324 342
     tiaoshi() {
325 343
       console.log("this.shift", this.shift);
@@ -448,11 +466,11 @@ export default {
448 466
       waitingdrug(params).then((res) => {
449 467
         if (res.data.state == 1) {
450 468
           this.waitmount_data = res.data.data.list;
451
-          if(this.shift != 0 || this.partition != 0){
452
-            if(this.waitmount_data == null){
453
-              this.waitmount = 0
454
-            }else{
455
-              this.waitmount = this.waitmount_data.length
469
+          if (this.shift != 0 || this.partition != 0) {
470
+            if (this.waitmount_data == null) {
471
+              this.waitmount = 0;
472
+            } else {
473
+              this.waitmount = this.waitmount_data.length;
456 474
             }
457 475
           }
458 476
         }
@@ -460,11 +478,11 @@ export default {
460 478
       issueddrugs(params).then((res) => {
461 479
         if (res.data.state == 1) {
462 480
           this.alreadmount_data = res.data.data.list;
463
-          if(this.shift != 0 || this.partition != 0){
464
-            if (this.alreadmount_data == null){
465
-              this.alreadmount = 0
466
-            }else{
467
-              this.alreadmount = this.alreadmount_data.length
481
+          if (this.shift != 0 || this.partition != 0) {
482
+            if (this.alreadmount_data == null) {
483
+              this.alreadmount = 0;
484
+            } else {
485
+              this.alreadmount = this.alreadmount_data.length;
468 486
             }
469 487
           }
470 488
         }
@@ -524,52 +542,50 @@ export default {
524 542
       );
525 543
     },
526 544
     toExport() {
527
-
528 545
       import("@/vendor/Export2Excel").then((excel) => {
529
-          for (let i = 0; i < this.tableData.length; i++) {
530
-            this.tableData[i].index = i + 1;
531
-            this.tableData[i].time = this.start_time
532
-            this.tableData[i].uname = this.currentRow.Name
533
-          }
546
+        for (let i = 0; i < this.tableData.length; i++) {
547
+          this.tableData[i].index = i + 1;
548
+          this.tableData[i].time = this.start_time;
549
+          this.tableData[i].uname = this.currentRow.Name;
550
+        }
534 551
 
535
-          const tHeader = [
536
-            "序号",
537
-            "日期",
538
-            "患者名称",
539
-            "名称",
540
-            "单次用量",
541
-            "用法",
542
-            "频率",
543
-            "天数",
544
-            "总量",
545
-            "开立医生",
546
-            "数据来源",
547
-            "备注",
548
-          ];
549
-          const filterVal = [
550
-            "index",
551
-            "time",
552
-            "uname",
553
-            "Name",
554
-            "SingleDosage",
555
-            "Usage",
556
-            "Frequency",
557
-            "Days",
558
-            "Total",
559
-            "Doctor",
560
-            "DataSources",
561
-            "Remarks",
562
-          ];
552
+        const tHeader = [
553
+          "序号",
554
+          "日期",
555
+          "患者名称",
556
+          "名称",
557
+          "单次用量",
558
+          "用法",
559
+          "频率",
560
+          "天数",
561
+          "总量",
562
+          "开立医生",
563
+          "数据来源",
564
+          "备注",
565
+        ];
566
+        const filterVal = [
567
+          "index",
568
+          "time",
569
+          "uname",
570
+          "Name",
571
+          "SingleDosage",
572
+          "Usage",
573
+          "Frequency",
574
+          "Days",
575
+          "Total",
576
+          "Doctor",
577
+          "DataSources",
578
+          "Remarks",
579
+        ];
563 580
 
564
-          const data = this.formatJson(filterVal, this.tableData);
565
-          excel.export_json_to_excel({
566
-            header: tHeader,
567
-            data,
568
-            filename: "领药单",
569
-          });
570
-          this.downloadLoading = false;
581
+        const data = this.formatJson(filterVal, this.tableData);
582
+        excel.export_json_to_excel({
583
+          header: tHeader,
584
+          data,
585
+          filename: "领药单",
571 586
         });
572
-
587
+        this.downloadLoading = false;
588
+      });
573 589
     },
574 590
     formatJson(filterVal, jsonData) {
575 591
       return jsonData.map((v) => filterVal.map((j) => v[j]));
@@ -579,8 +595,8 @@ export default {
579 595
     searchAction() {
580 596
       this.tableData = null;
581 597
       this.getwaitmount();
582
-      if(this.shift != 0 || this.partition != 0){
583
-      }else{
598
+      if (this.shift != 0 || this.partition != 0) {
599
+      } else {
584 600
         this.gettodaynumber();
585 601
       }
586 602
     },
@@ -709,7 +725,10 @@ export default {
709 725
   overflow-y: auto;
710 726
   .titlelist {
711 727
     display: flex;
712
-    justify-content: flex-end;
728
+    justify-content: space-between;
729
+    white-space: nowrap;
730
+    color: #909399;
731
+    font-size: 14px;
713 732
   }
714 733
   .el-table {
715 734
     margin-top: -13px;
@@ -722,6 +741,10 @@ export default {
722 741
     height: 2px;
723 742
     margin-top: 10px;
724 743
   }
744
+
745
+  /deep/ .el-table__body-wrapper {
746
+    overflow-x: scroll !important;
747
+  }
725 748
 }
726 749
 
727 750
 /deep/ .el-input__inner {