huangyw 2 years ago
parent
commit
04f16663e9

+ 125 - 16
src/xt_pages/Pharmacy/DrugDispensing.vue View File

177
             ref="table_01"
177
             ref="table_01"
178
             :height="tableHeight"
178
             :height="tableHeight"
179
             :data="tableData"
179
             :data="tableData"
180
-            
180
+            :summary-method="getSummaries_t1"
181
+            show-summary
181
             border
182
             border
182
             highlight-current-row
183
             highlight-current-row
183
             style="width: 100%"
184
             style="width: 100%"
275
             ref="table_01"
276
             ref="table_01"
276
             :height="tableHeight"
277
             :height="tableHeight"
277
             :data="tableData"
278
             :data="tableData"
278
-           
279
+            :summary-method="getSummaries_t2"
280
+            show-summary
279
             border
281
             border
280
             highlight-current-row
282
             highlight-current-row
281
             style="width: 100%"
283
             style="width: 100%"
377
             </el-table-column>
379
             </el-table-column>
378
           </el-table>
380
           </el-table>
379
         </div>
381
         </div>
382
+
380
         <!-- <div style="background-color: #f5f7fa;display:flex;padding: 10px;justify-content:space-around;position:absolute;width:75.6%;margin-top: 27.5%;
383
         <!-- <div style="background-color: #f5f7fa;display:flex;padding: 10px;justify-content:space-around;position:absolute;width:75.6%;margin-top: 27.5%;
381
 "><div style="width: 40%;padding-left:3%">合计 </div> <div style="width: 40%;display: flex;justify-content:center;padding-left: 37%">{{total}}</div></div> -->
384
 "><div style="width: 40%;padding-left:3%">合计 </div> <div style="width: 40%;display: flex;justify-content:center;padding-left: 37%">{{total}}</div></div> -->
382
-        <div style="margin-top: 25px" v-if="state == 1">
383
-          领药人:
385
+        <div style="margin-top: 25px; display: flex" v-if="state == 1">
386
+          <span style="line-height: 36px;">领药人:</span> 
384
           <el-select v-model="admin_user_id" placeholder="请选择">
387
           <el-select v-model="admin_user_id" placeholder="请选择">
385
             <el-option
388
             <el-option
386
               v-for="item in doctorList"
389
               v-for="item in doctorList"
390
             >
393
             >
391
             </el-option>
394
             </el-option>
392
           </el-select>
395
           </el-select>
396
+
397
+          <span
398
+            style="display: inline-block;padding-left: 30px;line-height: 36px;}"
399
+            >选中: {{ select_total }}</span
400
+          >
393
         </div>
401
         </div>
394
       </div>
402
       </div>
395
 
403
 
493
       routeofadministration: [],
501
       routeofadministration: [],
494
       deliveryway: "全部", //给药途径
502
       deliveryway: "全部", //给药途径
495
       total: "", //合计
503
       total: "", //合计
504
+      select_total: "",
496
     };
505
     };
497
   },
506
   },
498
 
507
 
524
         }
533
         }
525
       });
534
       });
526
     },
535
     },
536
+
537
+    // 单位去重
538
+    unique_unit(arr) {
539
+      return arr.filter(function (item, index, arr) {
540
+        //当前元素,在原始数组中的第一个索引==当前索引值,否则返回当前元素
541
+        return arr.indexOf(item, 0) === index;
542
+      });
543
+    },
544
+
527
     getSummaries_t1(param) {
545
     getSummaries_t1(param) {
528
       const { columns, data } = param;
546
       const { columns, data } = param;
529
       const sums = [];
547
       const sums = [];
548
+      let dose_unit = [];
549
+      let unit_1 = [];
550
+      let unit_2 = [];
530
       columns.forEach((column, index) => {
551
       columns.forEach((column, index) => {
531
         if (index === 0) {
552
         if (index === 0) {
532
           sums[index] = "合计";
553
           sums[index] = "合计";
533
           return;
554
           return;
534
         }
555
         }
535
         if (index === 7) {
556
         if (index === 7) {
536
-          sums[index] = this.total;
557
+          // 单位裁切
558
+          data.forEach((el, index) => {
559
+            dose_unit.push(el.total.substr(el.total.length - 1, 1));
560
+          });
561
+          dose_unit = this.unique_unit(dose_unit);
562
+          // 数据合计
563
+          data.forEach((el, index) => {
564
+            if (el.total.substr(el.total.length - 1, 1) === dose_unit[0]) {
565
+              unit_1.push(el.total.substr(0, el.total.length - 1));
566
+            }
567
+            if (el.total.substr(el.total.length - 1, 1) === dose_unit[1]) {
568
+              unit_2.push(el.total.substr(0, el.total.length - 1));
569
+            }
570
+          });
571
+          unit_1 = eval(unit_1.join("+"));
572
+          unit_2 = eval(unit_2.join("+"));
573
+
574
+          if (dose_unit[0] == undefined) {
575
+            sums[index] = "";
576
+          } else if (dose_unit[1] == undefined || unit_2 == undefined) {
577
+            sums[index] = `${unit_1}${dose_unit[0]}`;
578
+          } else {
579
+            sums[index] = `${unit_1}${dose_unit[0]}+${unit_2}${dose_unit[1]}`;
580
+          }
537
           return;
581
           return;
538
         }
582
         }
539
       });
583
       });
544
     getSummaries_t2(param) {
588
     getSummaries_t2(param) {
545
       const { columns, data } = param;
589
       const { columns, data } = param;
546
       const sums = [];
590
       const sums = [];
591
+      let dose_unit = [];
592
+      let unit_1 = [];
593
+      let unit_2 = [];
547
       columns.forEach((column, index) => {
594
       columns.forEach((column, index) => {
548
         if (index === 0) {
595
         if (index === 0) {
549
           sums[index] = "合计";
596
           sums[index] = "合计";
550
           return;
597
           return;
551
         }
598
         }
552
         if (index === 6) {
599
         if (index === 6) {
553
-          sums[index] = this.total;
600
+          // 单位裁切
601
+          data.forEach((el, index) => {
602
+            dose_unit.push(el.total.substr(el.total.length - 1, 1));
603
+          });
604
+          dose_unit = this.unique_unit(dose_unit);
605
+          // 数据合计
606
+          data.forEach((el, index) => {
607
+            if (el.total.substr(el.total.length - 1, 1) === dose_unit[0]) {
608
+              unit_1.push(el.total.substr(0, el.total.length - 1));
609
+            }
610
+            if (el.total.substr(el.total.length - 1, 1) === dose_unit[1]) {
611
+              unit_2.push(el.total.substr(0, el.total.length - 1));
612
+            }
613
+          });
614
+          unit_1 = eval(unit_1.join("+"));
615
+          unit_2 = eval(unit_2.join("+"));
616
+
617
+          // sums[index] = unit_1+dose_unit[0]+ "+" +unit_2+dose_unit[1];
618
+          if (dose_unit[0] == undefined) {
619
+            sums[index] = "";
620
+          } else if (dose_unit[1] == undefined || unit_2 == undefined) {
621
+            sums[index] = `${unit_1}${dose_unit[0]}`;
622
+          } else {
623
+            sums[index] = `${unit_1}${dose_unit[0]}+${unit_2}${dose_unit[1]}`;
624
+          }
554
           return;
625
           return;
555
         }
626
         }
556
       });
627
       });
765
     formatJson(filterVal, jsonData) {
836
     formatJson(filterVal, jsonData) {
766
       return jsonData.map((v) => filterVal.map((j) => v[j]));
837
       return jsonData.map((v) => filterVal.map((j) => v[j]));
767
     },
838
     },
768
-    //列表选择
839
+    //列表选择与合计
769
     handleSelectionChange(val) {
840
     handleSelectionChange(val) {
770
       this.multipleSelection = val;
841
       this.multipleSelection = val;
842
+
843
+      let coculate = val;
844
+      let sums = "";
845
+      let dose_unit = [];
846
+      let unit_1 = [];
847
+      let unit_2 = [];
848
+
849
+      coculate.forEach((el, index) => {
850
+        dose_unit.push(el.total.substr(el.total.length - 1, 1));
851
+      });
852
+      dose_unit = this.unique_unit(dose_unit);
853
+
854
+      // 数据合计
855
+      coculate.forEach((el, index) => {
856
+        if (el.total.substr(el.total.length - 1, 1) === dose_unit[0]) {
857
+          unit_1.push(el.total.substr(0, el.total.length - 1));
858
+        }
859
+      });
860
+
861
+      coculate.forEach((el, index) => {
862
+        if (el.total.substr(el.total.length - 1, 1) === dose_unit[1]) {
863
+          console.log(el, "oooel");
864
+          unit_2.push(el.total.substr(0, el.total.length - 1));
865
+        }
866
+      });
867
+
868
+      unit_1 = eval(unit_1.join("+"));
869
+      unit_2 = eval(unit_2.join("+"));
870
+
871
+      if (dose_unit[0] == undefined) {
872
+        sums = "";
873
+      } else if (dose_unit[1] == undefined) {
874
+        sums = `${unit_1}${dose_unit[0]}`;
875
+      } else {
876
+        sums = `${unit_1}${dose_unit[0]}+${unit_2}${dose_unit[1]}`;
877
+      }
878
+      // sums = `${unit_1}${dose_unit[0]}+${unit_2}${dose_unit[1]}`;
879
+      this.select_total = sums;
771
     },
880
     },
772
     //默认选中
881
     //默认选中
773
     selectedbydefault() {
882
     selectedbydefault() {
1033
     this.getrouteofadministration();
1142
     this.getrouteofadministration();
1034
     this.getgetpartitionlist();
1143
     this.getgetpartitionlist();
1035
   },
1144
   },
1036
-  // updated() {
1037
-  //   this.$nextTick(() => {
1038
-  //     if (this.$refs["table_01"]) {
1039
-  //       this.$refs["table_01"].doLayout();
1040
-  //     } else if (this.$refs["table_02"]) {
1041
-  //       this.$refs["table_02"].doLayout();
1042
-  //     }
1043
-  //   });
1044
-  // },
1145
+  updated() {
1146
+    this.$nextTick(() => {
1147
+      if (this.$refs["table_01"]) {
1148
+        this.$refs["table_01"].doLayout();
1149
+      } else if (this.$refs["table_02"]) {
1150
+        this.$refs["table_02"].doLayout();
1151
+      }
1152
+    });
1153
+  },
1045
 };
1154
 };
1046
 </script>
1155
 </script>
1047
 
1156
 

+ 2 - 2
src/xt_pages/dialysis/template/DialysisPrintOrderSix.vue View File

1188
                         </td>
1188
                         </td>
1189
                       </tr>
1189
                       </tr>
1190
                       <tr>
1190
                       <tr>
1191
-                        <td width="60">时间</td>
1192
-                        <td width="60">血压<br />(mmHg)</td>
1191
+                        <td width="50">时间</td>
1192
+                        <td width="65">血压<br />(mmHg)</td>
1193
                         <td width="50">脉搏<br />(次/分)</td>
1193
                         <td width="50">脉搏<br />(次/分)</td>
1194
                         <td width="50">呼吸<br />(次/分)</td>
1194
                         <td width="50">呼吸<br />(次/分)</td>
1195
                         <td width="50">血流量<br />(ml/min)</td>
1195
                         <td width="50">血流量<br />(ml/min)</td>