ソースを参照

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

XMLWAN 3 年 前
コミット
79f8f6a915

+ 1 - 1
src/lang/zh.js ファイルの表示

@@ -229,7 +229,7 @@ export default {
229 229
     outpatientRecord: '住院工作站',
230 230
     advancePayment: '预交金',
231 231
     labelPrinting: '标签打印',
232
-    summary: '项目消费明细汇总',
232
+    summary: '收费列表',
233 233
     outpatientPharmacy: '门诊药房',
234 234
     pharmacyFormula: '药房配发药',
235 235
     prescriptionDrugReturn: '处方退药',

+ 91 - 0
src/vendor/Export2Excel.js ファイルの表示

@@ -219,3 +219,94 @@ export function export_json_to_excel({
219 219
     type: "application/octet-stream"
220 220
   }), `${filename}.${bookType}`);
221 221
 }
222
+
223
+export function export_json_to_excel1({
224
+  multiHeader = [],
225
+  header,
226
+  data,
227
+  filename,
228
+  ref,
229
+  merges = [],
230
+  autoWidth = true,
231
+  bookType = 'xlsx'
232
+} = {}) {
233
+  /* original data */
234
+  filename = filename || 'excel-list'
235
+  data = [...data]
236
+  data.unshift(header);
237
+
238
+  for (let i = multiHeader.length - 1; i > -1; i--) {
239
+    data.unshift(multiHeader[i])
240
+  }
241
+
242
+  var ws_name = "SheetJS";
243
+  var wb = new Workbook(),
244
+    ws = sheet_from_array_of_arrays(data);
245
+
246
+  if (merges.length > 0) {
247
+    if (!ws['!merges']) ws['!merges'] = [];
248
+    merges.forEach(item => {
249
+      console.log(XLSX.utils.decode_range(item))
250
+      ws['!merges'].push(XLSX.utils.decode_range(item))
251
+    })
252
+  }
253
+
254
+  if (autoWidth) {
255
+    /*设置worksheet每列的最大宽度*/
256
+    const colWidth = data.map(row => row.map(val => {
257
+      /*先判断是否为null/undefined*/
258
+      if (val == null) {
259
+        return {
260
+          'wch': 10
261
+        };
262
+      }
263
+      /*再判断是否为中文*/
264
+      else if (val.toString().charCodeAt(0) > 255) {
265
+        return {
266
+          'wch': val.toString().length * 2
267
+        };
268
+      } else {
269
+        return {
270
+          'wch': val.toString().length
271
+        };
272
+      }
273
+    }))
274
+    /*以第一行为初始值*/
275
+    let result = colWidth[0];
276
+    for (let i = 1; i < colWidth.length; i++) {
277
+      for (let j = 0; j < colWidth[i].length; j++) {
278
+        if (result[j]['wch'] < colWidth[i][j]['wch']) {
279
+          result[j]['wch'] = colWidth[i][j]['wch'];
280
+        }
281
+      }
282
+    }
283
+    ws['!cols'] = result;
284
+  }
285
+
286
+  /* add worksheet to workbook */
287
+  wb.SheetNames.push(ws_name);
288
+  wb.Sheets[ws_name] = ws;
289
+
290
+
291
+  try {
292
+    const $e = ref
293
+    let $table = $e.querySelector('.el-table__fixed')
294
+    if(!$table) {
295
+      $table = $e
296
+    }
297
+
298
+    const wb = XLSX.utils.table_to_book($table, {raw:true})
299
+    const wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST:true, type: 'array'})
300
+    var wbout = XLSX.write(wb, {
301
+      bookType: bookType,
302
+      bookSST: false,
303
+      type: 'binary'
304
+    });
305
+    saveAs(new Blob([s2ab(wbout)], {
306
+      type: "application/octet-stream"
307
+    }), `${filename}.${bookType}`);
308
+  } catch (e) {
309
+    if (typeof console !== 'undefined') console.error(e)
310
+  }
311
+  
312
+}

+ 11 - 3
src/xt_pages/dialysis/template/DialysisPrintOrderFortyOne.vue ファイルの表示

@@ -636,7 +636,7 @@
636 636
                       <td style="line-height:16px;padding:0px;">
637 637
                         <div style="min-height:20px;line-height:20px; overflow:hidden;">
638 638
                           <span v-if="getTime(monitor.operate_time, '{h}:{i}')" style="word-break: break-all;margin:0;line-height:16px;-webkit-line-clamp:3;overflow:visible;display:inline-block;vertical-align:middle;height:auto;">
639
-                            <template v-if="(dialysisOrder && monitor.operate_time == dialysisOrder.start_time)">【开始透析】引血100ml/min</template>
639
+                            <template v-if="(dialysisOrder && monitor.operate_time == dialysisOrder.start_time)">【开始透析】 <span v-if="org_id != 10233">引血100ml/min</span></template>
640 640
                             <span v-if="dialysisOrder && monitor.operate_time == dialysisOrder.end_time">{{ monitor.end }}</span>
641 641
                             {{ monitor.symptom }} &nbsp;{{ monitor.dispose }} &nbsp;{{ monitor.result }}
642 642
                           </span>
@@ -1224,11 +1224,19 @@ export default {
1224 1224
           this.monitors[index].end = ''
1225 1225
           if (Object.keys(monitor).length > 0 && index > 1) {
1226 1226
             if (this.dialysisOrder && monitor.operate_time == this.dialysisOrder.end_time) {
1227
-              this.monitors[index].end = '【结束透析】回血100ml/min'
1227
+              if(this.org_id != 10233){
1228
+                this.monitors[index].end = '【结束透析】回血100ml/min'
1229
+              }else{
1230
+                this.monitors[index].end = '【结束透析】'
1231
+              }
1228 1232
               tempmonitorflag = false
1229 1233
             }
1230 1234
             if (tempmonitorflag && index == this.monitors.length - 1) {
1231
-              this.monitors[index].end = '【结束透析】回血100ml/min'
1235
+              if(this.org_id != 10233){
1236
+                this.monitors[index].end = '【结束透析】回血100ml/min'
1237
+              }else{
1238
+                this.monitors[index].end = '【结束透析】'
1239
+              }
1232 1240
             }
1233 1241
           }
1234 1242
         }

File diff suppressed because it is too large
+ 567 - 469
src/xt_pages/dialysis/template/DialysisPrintOrderThirty.vue


File diff suppressed because it is too large
+ 714 - 606
src/xt_pages/dialysis/template/DialysisPrintOrderThirtyOne.vue


File diff suppressed because it is too large
+ 1468 - 1373
src/xt_pages/dialysis/template/DialysisPrintOrderTwentyEight.vue


+ 118 - 1
src/xt_pages/dialysis/template/DialysisPrintOrderTwentyFive.vue ファイルの表示

@@ -1126,7 +1126,123 @@ export default {
1126 1126
   },
1127 1127
     methods: {
1128 1128
       checkData(){
1129
-
1129
+        if(this.predialysis.dialysis_count == 0){
1130
+          this.$message.error('透析频率未填')
1131
+        }else if(this.receiverTreatmentAccess.way == 0){
1132
+          this.$message.error('入科方式未填')
1133
+        }else if(this.receiverTreatmentAccess.consciousness == 0){
1134
+          this.$message.error('意识未填')
1135
+        }else if(this.predialysis.is_infect == 0){
1136
+          this.$message.error('感染未填')
1137
+        }else if(this.predialysis.temperature == ""){
1138
+          this.$message.error('透前体温未填')
1139
+        }else if(this.predialysis.pulse_frequency == ""){
1140
+          this.$message.error('透前脉搏未填')
1141
+        }else if(this.predialysis.systolic_blood_pressure == 0 || this.predialysis.diastolic_blood_pressure == 0){
1142
+          this.$message.error('透前血压未填完整')
1143
+        }else if(this.predialysis.catheter == ''){
1144
+          this.$message.error('导管口未填')
1145
+        }else if(this.predialysis.catheter_bend == 0){
1146
+          this.$message.error('打折未填')
1147
+        }else if(this.predialysis.urine_volume == 0){
1148
+          this.$message.error('尿量未填')
1149
+        }else if(this.predialysis.internal_fistula == ''){
1150
+          this.$message.error('内瘘评估震颤未填')
1151
+        }else if(this.predialysis.exposed == 0){
1152
+          this.$message.error('外露未填')
1153
+        }else if(this.predialysis.internal_fistula_skin == ''){
1154
+          this.$message.error('内瘘皮肤情况未填')
1155
+        }else if(this.predialysis.is_hemorrhage == 0){
1156
+          this.$message.error('活动性出血未填')
1157
+        }else if(this.predialysis.is_hemorrhage == 1 && this.predialysis.hemorrhage == ""){
1158
+          this.$message.error('活动性出血选项未填')
1159
+        }else if(this.predialysis.blood_access_part_opera_name == ''){
1160
+          this.$message.error('血管通路未填')
1161
+        }else if(this.predialysis.weight_before == 0){
1162
+          this.$message.error('透前体重未填')
1163
+        }else if(this.predialysis.dry_weight == 0){
1164
+          this.$message.error('干体重未填')
1165
+        }else if(this.predialysis.additional_weight == 0){
1166
+          this.$message.error('衣物重未填')
1167
+        }else if(this.prescription.dialysis_duration_hour == 0 && this.prescription.dialysis_duration_minute == 0){
1168
+          this.$message.error('计划治疗时间未填')
1169
+        }else if(this.prescription.blood_flow_volume == 0){
1170
+          this.$message.error('血流量未填')
1171
+        }else if(this.prescription.target_ultrafiltration == 0){
1172
+          this.$message.error('计划超滤总量未填')
1173
+        }else if(this.prescription.displace_liqui_part == 0 && (prescription.mode_id == 2 || prescription.mode_id == 5 || prescription.mode_id == 12)){
1174
+          this.$message.error('置换方式未填')
1175
+        }else if(this.prescription.replacement_total == 0 && (prescription.mode_id == 2 || prescription.mode_id == 5 || prescription.mode_id == 12)){
1176
+          this.$message.error('置换量未填')
1177
+        }else if(this.prescription.mode_id == ""){
1178
+          this.$message.error('透析方式未填')
1179
+        }else if(this.prescription.anticoagulant == 0){
1180
+          this.$message.error('治疗抗凝未填')
1181
+        }else if(this.prescription.dialysate_formulation_name == ""){
1182
+          this.$message.error('透析液配方未填')
1183
+        }else if(this.prescription.dialyzer_perfusion_apparatus == ""){
1184
+          this.$message.error('透析器型号未填')
1185
+        }else if(this.afterdialysis.internal_fistula == ''){
1186
+          this.$message.error('透后内瘘震颤未填')
1187
+        }else if(this.afterdialysis.catheter == ''){
1188
+          this.$message.error('透后导管未填')
1189
+        }else if(this.afterdialysis.puncture_point_oozing_blood == 0){
1190
+          this.$message.error('拔针后穿刺点渗血未填')
1191
+        }else if(this.afterdialysis.puncture_point_haematoma == 0){
1192
+          this.$message.error('穿刺处血肿未填')
1193
+        }else if(this.afterdialysis.cvc_a == 0){
1194
+          this.$message.error('A端未填')
1195
+        }else if(this.afterdialysis.cvc_v == 0){
1196
+          this.$message.error('V端未填')
1197
+        }else if(this.afterdialysis.complication == ""){
1198
+          this.$message.error('透后并发症未填')
1199
+        }else if(this.afterdialysis.cruor == ""){
1200
+          this.$message.error('透析器凝血未填')
1201
+        }else if(this.afterdialysis.arterial_tube == 0){
1202
+          this.$message.error('动脉管道未填')
1203
+        }else if(this.afterdialysis.intravenous_tube == 0){
1204
+          this.$message.error('静脉管道未填')
1205
+        }else if(this.afterdialysis.weight_after == 0){
1206
+          this.$message.error('透后体重未填')
1207
+        }else if(this.afterdialysis.actual_ultrafiltration == 0){
1208
+          this.$message.error('实际超滤量未填')
1209
+        }else if(this.afterdialysis.actual_treatment_hour == 0 && this.afterdialysis.actual_treatment_minute == 0){
1210
+          this.$message.error('实际治疗时间未填')
1211
+        }else if(this.summary.dialysis_summary == ""){
1212
+          this.$message.error('透析小结未填')
1213
+        }else if(this.prescription.creater == 0){
1214
+          this.$message.error('医生签名未填')
1215
+        }else if(this.dialysisOrder.puncture_nurse == 0){
1216
+          this.$message.error('穿刺护士未填')
1217
+        }else if(this.dialysisOrder != null && this.dialysisOrder.start_nurse == this.check.modifier && this.check.creater == 0){
1218
+          this.$message.error('核对护士未填')
1219
+        }else if(this.dialysisOrder != null && this.dialysisOrder.start_nurse == this.check.creater && this.check.modifier == 0){
1220
+          this.$message.error('核对护士未填')
1221
+        }else if(this.dialysisOrder.start_nurse == 0){
1222
+          this.$message.error('看机护士未填')
1223
+        }else if(this.dialysisOrder.finish_nurse == 0){
1224
+          this.$message.error('下机护士未填')
1225
+        }else if(this.tableAdvice.length > 0){
1226
+          this.tableAdvice.map(item => {
1227
+            if(item.id > 0 && item.created_time){
1228
+              this.users.map(it => {
1229
+                if(it.id == item.advice_doctor){
1230
+                  if(it.type != 2){
1231
+                    this.$message.error('存在不是医生保存的医嘱')
1232
+                  }
1233
+                }else if(it.id == item.execution_staff && item.execution_staff > 0){
1234
+                  if(it.type != 3){
1235
+                    this.$message.error('存在不是护士执行的医嘱')
1236
+                  }
1237
+                }else if(it.id == item.checker && item.checker > 0){
1238
+                  if(it.type != 3){
1239
+                    this.$message.error('存在不是护士核对的医嘱')
1240
+                  }
1241
+                }
1242
+              })
1243
+            }
1244
+          })
1245
+        }
1130 1246
       },
1131 1247
       getComplication(complication){
1132 1248
         if(complication.indexOf(',') == -1){
@@ -1393,6 +1509,7 @@ export default {
1393 1509
             }
1394 1510
 
1395 1511
             this.advices = response.data.data.advices
1512
+            this.tableAdvice = response.data.data.advices;
1396 1513
             console.log('hhhhhhhhhhhh', this.advices)
1397 1514
             this.monitors = response.data.data.monitors
1398 1515
             console.log('哈哈哈哈哈哈哈', this.monitors)

File diff suppressed because it is too large
+ 623 - 537
src/xt_pages/dialysis/template/DialysisPrintOrderTwentyNine.vue


File diff suppressed because it is too large
+ 1238 - 1098
src/xt_pages/dialysis/template/DialysisPrintOrderTwentySeven.vue


File diff suppressed because it is too large
+ 1134 - 1044
src/xt_pages/dialysis/template/DialysisPrintOrderTwentySix.vue


+ 2 - 3
src/xt_pages/hospitalStation/doctorDesk.vue ファイルの表示

@@ -127,7 +127,6 @@
127 127
                 <desk-record :record_date="record_date" :case_history="case_history" :patientInfo="patientInfo"
128 128
                              :hisPatientInfo="hisPatientInfo" v-if="titleType == '电子病历'" :detalid="detalid"
129 129
                              ref="child"></desk-record>
130
-                c
131 130
                 <medicalRecord ref='medicalRecord' @func="getMsgFormSon"></medicalRecord>
132 131
                 <saveRecordTemplate ref='saveRecordTemplate'></saveRecordTemplate>
133 132
                 <!--<dialysis-index v-if="titleType == '透析记录'" :record_date="record_date" :patientid='patientid'></dialysis-index>-->
@@ -4179,7 +4178,7 @@
4179 4178
 
4180 4179
       // this.diagnoses = this.getDictionaryDataConfig('system', 'diagnose')
4181 4180
       // this.other_sick = this.getDictionaryDataConfig('system', 'other_sick_history')
4182
-      let tableHeight = document.body.clientHeight - 263
4181
+      let tableHeight = document.body.clientHeight - 323
4183 4182
       this.tableHeight = tableHeight
4184 4183
 
4185 4184
     },
@@ -4197,7 +4196,7 @@
4197 4196
       fullHeight(val) {
4198 4197
         if (!this.timer) {
4199 4198
           this.fullHeight = val
4200
-          let tableHeight = val - 263
4199
+          let tableHeight = val - 323
4201 4200
           this.tableHeight = tableHeight
4202 4201
           this.timer = true
4203 4202
           let that = this

+ 24 - 24
src/xt_pages/hospitalStation/outpatientChargesManagement.vue ファイルの表示

@@ -61,7 +61,7 @@
61 61
                             <template slot-scope="scope">{{scope.row.name}}</template>
62 62
                         </el-table-column>
63 63
                         <el-table-column align="center" prop="name" label="就诊号" width="110">
64
-                            <template slot-scope="scope">{{ scope.row.his_patient ?scope.row.his_patient.number:''}}
64
+                            <template slot-scope="scope">{{ scope.row ?scope.row.number:''}}
65 65
                             </template>
66 66
                         </el-table-column>
67 67
                     </el-table>
@@ -869,11 +869,11 @@
869 869
             let three_count = 0
870 870
             for (let i = 0; i < response.data.data.list.length; i++) {
871 871
               this.all_table_data.push(response.data.data.list[i])
872
-              if (response.data.data.list[i].his_patient.order.order_status == 0 || response.data.data.list[i].his_patient.order.order_status == 1 || response.data.data.list[i].his_patient.order.order_status == 3) {
872
+              if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
873 873
                 one_count = one_count + 1
874 874
               }
875 875
 
876
-              if (response.data.data.list[i].his_patient.order.order_status == 2) {
876
+              if (response.data.data.list[i].order.order_status == 2) {
877 877
                 two_count = two_count + 1
878 878
               }
879 879
 
@@ -895,16 +895,16 @@
895 895
                 this.patientTableData = []
896 896
 
897 897
                 for (let i = 0; i < this.all_table_data.length; i++) {
898
-                  if (this.all_table_data[i].his_patient.order.order_status == 0 || this.all_table_data[i].his_patient.order.order_status == 1) {
898
+                  if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
899 899
                     this.patientTableData.push(this.all_table_data[i])
900 900
                   }
901 901
 
902 902
                 }
903 903
                 if (this.patientTableData.length > 0) {
904 904
                   for (let i = 0; i < this.patientTableData.length; i++) {
905
-                    if (this.patientTableData[i].id == this.patientInfo.id) {
905
+                    if (this.patientTableData[i].patient_id == this.patientInfo.id) {
906 906
                       this.$refs.tab.setCurrentRow(this.patientTableData[i])
907
-                      this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order.number, this.patientTableData[i].his_patient.id)
907
+                      this.getPatientInformation(this.patientTableData[i].patient_id, this.patientTableData[i].order.number, this.patientTableData[i].id)
908 908
                     }
909 909
                   }
910 910
                 }
@@ -986,11 +986,11 @@
986 986
 
987 987
             for (let i = 0; i < response.data.data.list_two.length; i++) {
988 988
               this.hisPatientDatas.push(response.data.data.list_two[i])
989
-              if (response.data.data.list_two[i].his_patient.order.order_status == 0 || response.data.data.list_two[i].his_patient.order.order_status == 1 || response.data.data.list_two[i].his_patient.order.order_status == 3) {
989
+              if (response.data.data.list_two[i].order.order_status == 0 || response.data.data.list_two[i].order.order_status == 1 || response.data.data.list_two[i].order.order_status == 3) {
990 990
                 one_count = one_count + 1
991 991
               }
992 992
 
993
-              if (response.data.data.list_two[i].his_patient.order.order_status == 2) {
993
+              if (response.data.data.list_two[i].order.order_status == 2) {
994 994
                 two_count = two_count + 1
995 995
               }
996 996
 
@@ -1010,16 +1010,16 @@
1010 1010
                 this.patientTableData = []
1011 1011
 
1012 1012
                 for (let i = 0; i < this.hisPatientDatas.length; i++) {
1013
-                  if (this.hisPatientDatas[i].his_patient.order.order_status == 0 || this.hisPatientDatas[i].his_patient.order.order_status == 1 || this.hisPatientDatas[i].his_patient.order.order_status == 3) {
1013
+                  if (this.hisPatientDatas[i].order.order_status == 0 || this.hisPatientDatas[i].order.order_status == 1 || this.hisPatientDatas[i].order.order_status == 3) {
1014 1014
                     this.patientTableData.push(this.hisPatientDatas[i])
1015 1015
                   }
1016 1016
 
1017 1017
                 }
1018 1018
                 if (this.patientTableData.length > 0) {
1019 1019
                   for (let i = 0; i < this.patientTableData.length; i++) {
1020
-                    if (this.patientTableData[i].id == this.patientInfo.id) {
1020
+                    if (this.patientTableData[i].patient_id == this.patientInfo.id) {
1021 1021
                       this.$refs.tab.setCurrentRow(this.patientTableData[i])
1022
-                      this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].order.number, this.patientTableData[i].his_patient.id)
1022
+                      this.getPatientInformation(this.patientTableData[i].patient_id, this.patientTableData[i].order.number, this.patientTableData[i].id)
1023 1023
                     }
1024 1024
                   }
1025 1025
                 }
@@ -2069,7 +2069,7 @@
2069 2069
 
2070 2070
             for (let i = 0; i < response.data.data.list.length; i++) {
2071 2071
               this.all_table_data.push(response.data.data.list[i])
2072
-              if (response.data.data.list[i].his_patient.order.order_status == 0 || response.data.data.list[i].his_patient.order.order_status == 1 || response.data.data.list[i].his_patient.order.order_status == 3) {
2072
+              if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
2073 2073
                 one_count = one_count + 1
2074 2074
               }
2075 2075
 
@@ -2085,16 +2085,16 @@
2085 2085
               case 1:
2086 2086
                 this.patientTableData = []
2087 2087
                 for (let i = 0; i < this.all_table_data.length; i++) {
2088
-                  if (this.all_table_data[i].his_patient.order.order_status == 0 || this.all_table_data[i].his_patient.order.order_status == 1) {
2088
+                  if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
2089 2089
                     this.patientTableData.push(this.all_table_data[i])
2090 2090
                   }
2091 2091
 
2092 2092
                 }
2093 2093
                 for (let i = 0; i < this.patientTableData.length; i++) {
2094
-                  if (this.patientInfo.id == this.patientTableData[i].id) {
2094
+                  if (this.patientInfo.id == this.patientTableData[i].patient_id) {
2095 2095
                     this.current_index = i
2096 2096
                     this.$refs.tab.setCurrentRow(this.patientTableData[i])
2097
-                    this.getPatientInformation(this.patientTableData[i].id, this.patientTableData[i].his_patient.order.number, this.patientTableData[i].his_patient.id)
2097
+                    this.getPatientInformation(this.patientTableData[i].patient_id, this.patientTableData[i].order.number, this.patientTableData[i].id)
2098 2098
 
2099 2099
                   }
2100 2100
                 }
@@ -2199,7 +2199,7 @@
2199 2199
 
2200 2200
               for (let i = 0; i < response.data.data.list.length; i++) {
2201 2201
                 this.all_table_data.push(response.data.data.list[i])
2202
-                if (response.data.data.list[i].his_patient.order.order_status == 0 || response.data.data.list[i].his_patient.order.order_status == 1 || response.data.data.list[i].his_patient.order.order_status == 3) {
2202
+                if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
2203 2203
                   one_count = one_count + 1
2204 2204
                 }
2205 2205
 
@@ -2216,7 +2216,7 @@
2216 2216
 
2217 2217
               for (let i = 0; i < response.data.data.list_two.length; i++) {
2218 2218
                 this.hisPatientDatas.push(response.data.data.list_two[i])
2219
-                if (response.data.data.list_two[i].his_patient.order.order_status == 0 || response.data.data.list_two[i].his_patient.order.order_status == 1) {
2219
+                if (response.data.data.list_two[i].order.order_status == 0 || response.data.data.list_two[i].order.order_status == 1) {
2220 2220
                   one_count = one_count + 1
2221 2221
                 }
2222 2222
 
@@ -2243,7 +2243,7 @@
2243 2243
                 if (this.activeName == 'first') {
2244 2244
 
2245 2245
                   for (let i = 0; i < this.all_table_data.length; i++) {
2246
-                    if (this.all_table_data[i].his_patient.order.order_status == 0 || this.all_table_data[i].his_patient.order.order_status == 1) {
2246
+                    if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1) {
2247 2247
                       this.patientTableData.push(this.all_table_data[i])
2248 2248
                     }
2249 2249
 
@@ -2251,7 +2251,7 @@
2251 2251
 
2252 2252
                 } else {
2253 2253
                   for (let i = 0; i < this.hisPatientDatas.length; i++) {
2254
-                    if (this.hisPatientDatas[i].his_patient.order.order_status == 0 || this.hisPatientDatas[i].his_patient.order.order_status == 1) {
2254
+                    if (this.hisPatientDatas[i].order.order_status == 0 || this.hisPatientDatas[i].order.order_status == 1) {
2255 2255
                       this.patientTableData.push(this.hisPatientDatas[i])
2256 2256
                     }
2257 2257
 
@@ -2261,7 +2261,7 @@
2261 2261
 
2262 2262
                 this.current_index = 0
2263 2263
                 this.$refs.tab.setCurrentRow(this.patientTableData[0])
2264
-                this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].his_patient.order.number, this.patientTableData[0].his_patient.id)
2264
+                this.getPatientInformation(this.patientTableData[0].patient_id, this.patientTableData[0].order.number, this.patientTableData[0].id)
2265 2265
 
2266 2266
                 break
2267 2267
               case 2:
@@ -2363,7 +2363,7 @@
2363 2363
             let three_count = 0
2364 2364
             for (let i = 0; i < response.data.data.list.length; i++) {
2365 2365
               this.all_table_data.push(response.data.data.list[i])
2366
-              if (response.data.data.list[i].his_patient.order.order_status == 0 || response.data.data.list[i].his_patient.order.order_status == 1 || response.data.data.list[i].his_patient.order.order_status == 3) {
2366
+              if (response.data.data.list[i].order.order_status == 0 || response.data.data.list[i].order.order_status == 1 || response.data.data.list[i].order.order_status == 3) {
2367 2367
                 one_count = one_count + 1
2368 2368
               }
2369 2369
 
@@ -2379,13 +2379,13 @@
2379 2379
               case 1:
2380 2380
                 this.patientTableData = []
2381 2381
                 for (let i = 0; i < this.all_table_data.length; i++) {
2382
-                  if (this.all_table_data[i].his_patient.order.order_status == 0 || this.all_table_data[i].his_patient.order.order_status == 1 || this.all_table_data[i].his_patient.order.order_status == 3) {
2382
+                  if (this.all_table_data[i].order.order_status == 0 || this.all_table_data[i].order.order_status == 1 || this.all_table_data[i].order.order_status == 3) {
2383 2383
                     this.patientTableData.push(this.all_table_data[i])
2384 2384
                   }
2385 2385
                 }
2386 2386
 
2387 2387
                 this.$refs.tab.setCurrentRow(this.patientTableData[0])
2388
-                this.getPatientInformation(this.patientTableData[0].id, this.patientTableData[0].his_patient.order.number, this.patientTableData[0].his_patient.id)
2388
+                this.getPatientInformation(this.patientTableData[0].patient_id, this.patientTableData[0].order.number, this.patientTableData[0].id)
2389 2389
 
2390 2390
                 break
2391 2391
               case 2:
@@ -2620,7 +2620,7 @@
2620 2620
         this.prescriptions = []
2621 2621
         this.month_prescriptions = []
2622 2622
         if(this.radio == 1){
2623
-          this.getPatientInformation(val.id, val.his_patient.order.number, val.his_patient.id)
2623
+          this.getPatientInformation(val.patient_id, val.order.number, val.id)
2624 2624
         }else{
2625 2625
           this.getPatientInformation(val.id, val.number, val.his_patient_id)
2626 2626
 

+ 126 - 15
src/xt_pages/outpatientTool/components/detail.vue ファイルの表示

@@ -1,9 +1,9 @@
1 1
 <template>
2
-    <div class="main-contain outpatientChargesManagement">
2
+    <!-- <div class="main-contain outpatientChargesManagement">
3 3
         <div class="position">
4 4
             <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-        </div>
6
-        <div class="app-container">
5
+        </div> -->
6
+        <div>
7 7
             <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8 8
                 <div>
9 9
                     <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
@@ -12,6 +12,7 @@
12 12
                     <!--</el-button>-->
13 13
                     <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14 14
                               @keyup.enter.native='searchAction'
15
+                              placeholder="请输入患者姓名"
15 16
                               class="filter-item"/>
16 17
                     <el-select size="small" v-model="item_type" placeholder="请选择"
17 18
                                style="width:150px;margin-left:10px;" @change="changeItem">
@@ -48,12 +49,17 @@
48 49
                       <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
49 50
 
50 51
                     </el-popover> -->
51
-                    <!--<el-button size="small" type="primary" @click="export_detail">报表下载</el-button>-->
52
+                    <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
52 53
                 </div>
53 54
             </div>
54
-            <el-table :data="tableData" border :row-style="{ color: '#303133' }"
55
+            <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="table"
55 56
                       :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
56 57
                       :span-method="merge"
58
+                      show-summary
59
+                      :summary-method="getTotal"
60
+                      max-height="600"
61
+
62
+                      v-loading="detail_loading"
57 63
                       highlight-current-row>
58 64
 
59 65
                 <el-table-column align="center" prop="name" label="患者名字">
@@ -78,7 +84,7 @@
78 84
                     </template>
79 85
                 </el-table-column>
80 86
 
81
-                <el-table-column align="center" prop="name" label="费用总额">
87
+                <el-table-column align="center" prop="total" label="费用总额">
82 88
                     <template slot-scope="scope">
83 89
                         <div>{{scope.row.total.toFixed(2)}}</div>
84 90
                     </template>
@@ -87,7 +93,7 @@
87 93
             </el-table>
88 94
         </div>
89 95
 
90
-    </div>
96
+    <!-- </div> -->
91 97
 </template>
92 98
 
93 99
 
@@ -104,7 +110,10 @@
104 110
     },
105 111
     data() {
106 112
       return {
113
+        detail_loading:false,
107 114
         tempArr: [],
115
+        pos:0,
116
+
108 117
         sameRowArr: [],
109 118
         keywords: '',
110 119
         tableData: [],
@@ -151,6 +160,7 @@
151 160
 
152 161
       },
153 162
       getSummaryDetailList() {
163
+        this.detail_loading = true
154 164
         let start_time = this.chargeDate[0]
155 165
         let end_time = this.chargeDate[1]
156 166
         let params = {
@@ -161,9 +171,13 @@
161 171
         }
162 172
         GetSummaryDetail(params).then(response => {
163 173
           if (response.data.state == 0) {
174
+            this.detail_loading = false
175
+
164 176
             this.$message.error(response.data.msg)
165 177
             return false
166 178
           } else {
179
+            this.detail_loading = false
180
+
167 181
             this.tableData = []
168 182
             let tempPatients = []
169 183
             let tempPatientsTwo = []
@@ -200,9 +214,17 @@
200 214
                   newObj['price'] = orders[b].order_info[c].pric
201 215
                   if (orders[b].order_info[c].advice_id > 0 && orders[b].order_info[c].project_id == 0) {
202 216
                     newObj['type'] = 1
203
-                    newObj['item_name'] = orders[b].order_info[c].advice.advice_name
217
+                    // newObj['item_name'] = orders[b].order_info[c].advice.advice_name
204 218
                     newObj['item_id'] = orders[b].order_info[c].advice.drug_id
205 219
 
220
+                    if(orders[b].order_info[c].advice.drug.min_unit != orders[b].order_info[c].advice.drug.dose_unit) {
221
+                      newObj['item_name'] = orders[b].order_info[c].advice.advice_name + "( " + orders[b].order_info[c].advice.drug.dose + orders[b].order_info[c].advice.drug.dose_unit + "*" + orders[b].order_info[c].advice.drug.min_number + orders[b].order_info[c].advice.drug.min_unit + "/" + orders[b].order_info[c].advice.drug.max_unit + " )"
222
+                    }else{
223
+
224
+                      newObj['item_name'] = ""
225
+                    }
226
+
227
+
206 228
                   }
207 229
                   if (orders[b].order_info[c].advice_id == 0 && orders[b].order_info[c].project_id > 0) {
208 230
                     newObj['type'] = 2
@@ -210,8 +232,12 @@
210 232
 
211 233
                     if (orders[b].order_info[c].project.type == 2) {
212 234
                       newObj['item_name'] = orders[b].order_info[c].project.project.project_name
235
+
236
+
213 237
                     } else if (orders[b].order_info[c].project.type == 3) {
214 238
                       newObj['item_name'] = orders[b].order_info[c].project.good_info.good_name + "( "+ orders[b].order_info[c].project.good_info.specification_name+" )"
239
+
240
+
215 241
                     }
216 242
                   }
217 243
                   obj.order_info.push(newObj)
@@ -219,7 +245,7 @@
219 245
               }
220 246
               tempPatientsTwo.push(obj)
221 247
             }
222
-            console.log(tempPatientsTwo)
248
+
223 249
 
224 250
             for (let d = 0; d < tempPatientsTwo.length; d++) {
225 251
               tempPatientsTwo[d]['new_order_info'] = []
@@ -276,17 +302,27 @@
276 302
             for (let i = 0; i < tempPatientsTwo.length; i++) {
277 303
               let total = 0
278 304
               for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
279
-                if (tempPatientsTwo[i].new_order_info[b].item_name.length != 0) {
305
+                let new_name = tempPatientsTwo[i].new_order_info[b].item_name
306
+                new_name=new_name.replace("( ","");
307
+                new_name=new_name.replace(" )","");
308
+                if (new_name.length != 0) {
280 309
                   total = parseFloat(total) + parseFloat((parseFloat(tempPatientsTwo[i].new_order_info[b].count.toString()) * parseFloat(tempPatientsTwo[i].new_order_info[b].price.toString().toString())).toFixed(2))
281 310
                 }
282 311
               }
283 312
               tempPatientsTwo[i]['total'] = total
284 313
             }
285
-
314
+            console.log('tempPatientsTwo',tempPatientsTwo)
286 315
             for (let i = 0; i < tempPatientsTwo.length; i++) {
287
-              console.log(tempPatientsTwo[i].total)
316
+              // console.log(111,tempPatientsTwo[i].total)
317
+              if(tempPatientsTwo[i].new_order_info.length > 0){
318
+
319
+              
288 320
               for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
289
-                if (tempPatientsTwo[i].new_order_info[b].item_name.length != 0) {
321
+                let new_name = tempPatientsTwo[i].new_order_info[b].item_name
322
+                new_name=new_name.replace("( ","");
323
+                new_name=new_name.replace(" )","");
324
+
325
+                if (new_name.length != 0) {
290 326
                   let obj = {
291 327
                     name: tempPatientsTwo[i].name,
292 328
                     patient_id: tempPatientsTwo[i].patient_id,
@@ -295,12 +331,19 @@
295 331
                     item_name: tempPatientsTwo[i].new_order_info[b].item_name,
296 332
                     item_id: tempPatientsTwo[i].new_order_info[b].item_id,
297 333
                     count: tempPatientsTwo[i].new_order_info[b].count,
298
-                    total: tempPatientsTwo[i].total
334
+
299 335
                   }
336
+
337
+                  // if(b == 0){
338
+                    obj['total'] =  tempPatientsTwo[i].total
339
+                  // }else{
340
+                  //   obj['total'] = 0
341
+                  // }
300 342
                   this.tableData.push(obj)
301 343
                 }
302 344
 
303 345
               }
346
+              }
304 347
             }
305 348
             this.handleSpanTempArr()
306 349
             // this.tableData = tempPatientsTwo
@@ -435,7 +478,75 @@
435 478
             colspan: _col
436 479
           }
437 480
         }
438
-      }
481
+      }, export_detail() {
482
+
483
+        let list = []
484
+        for (let i = 0; i < this.tableData.length; i++) {
485
+          let order = this.tableData[i]
486
+          let name = order.name
487
+          let item_name = order.item_name
488
+          let count = order.count
489
+          let price = order.price.toFixed(2)
490
+          let pay_sumamt = (order.price.toFixed(2)*order.count).toFixed(2)
491
+          let total = order.total.toFixed(2)
492
+
493
+
494
+          let obj = {
495
+            '患者姓名': name,
496
+            '项目名称': item_name,
497
+            '数量': count,
498
+            '单价': price,
499
+            '费用': pay_sumamt,
500
+            '费用总额':total,
501
+          }
502
+          list.push(obj)
503
+        }
504
+        import('@/vendor/Export2Excel').then(excel => {
505
+          const tHeader = [ '患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
506
+          const filterVal = [ '患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
507
+          const data = this.formatJson(filterVal, list)
508
+          excel.export_json_to_excel1({
509
+            header: tHeader,
510
+            data,
511
+            filename: '明细',
512
+            ref:this.$refs['table'].$el
513
+          })
514
+        })
515
+
516
+      }, formatJson(filterVal, jsonData) {
517
+        return jsonData.map(v => filterVal.map(j => v[j]))
518
+      }, getTotal(param) {
519
+        const { columns, data } = param
520
+        const sums = []
521
+        columns.forEach((column, index) => {
522
+          if (index === 0) {
523
+            sums[index] = '合计'
524
+            return
525
+          }
526
+          console.log(data)
527
+          const values = data.map(item => Number(item[column.property]))
528
+          if (column.property === 'total') {
529
+            // sums[index] = values.reduce((prev, curr) => {
530
+            //   const value = Number(curr)
531
+            //   if (!isNaN(value)) {
532
+            //     return prev + curr
533
+            //   } else {
534
+            //     return prev
535
+            //   }
536
+            // }, 0)
537
+            // sums[index] = sums[index].toFixed(2)
538
+            let num = 0
539
+            data.map(item => {
540
+              num += item.price.toFixed(2)*item.count
541
+            })
542
+            sums[index] = num.toFixed(2)
543
+          } else {
544
+            sums[index] = ''
545
+          }
546
+        })
547
+
548
+        return sums
549
+      },
439 550
     },
440 551
     created() {
441 552
       this.getSummaryDetailList()

+ 125 - 87
src/xt_pages/outpatientTool/components/gather.vue ファイルの表示

@@ -1,87 +1,84 @@
1 1
 <template>
2
-    <div class="main-contain outpatientChargesManagement">
3
-        <div class="position">
4
-            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-        </div>
6
-        <div class="app-container">
7
-            <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8
-                <div>
9
-                    <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
10
-                    <!--@click="Action">-->
11
-                    <!--导出-->
12
-                    <!--</el-button>-->
13
-                    <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14
-                              @keyup.enter.native='searchAction'
15
-                              class="filter-item"/>
16
-                    <el-select size="small" v-model="item_type" placeholder="请选择"
17
-                               style="width:150px;margin-left:10px;" @change="changeItem">
18
-                        <el-option
19
-                                label="全部"
20
-                                value="0">
21
-                        </el-option>
22
-                        <el-option
23
-                                v-for="item,index in items"
24
-                                :key="index"
25
-                                :label="item.name"
26
-                                :value="item.id">
27
-                        </el-option>
28
-                    </el-select>
29
-                    <el-date-picker
30
-                            v-model="chargeDate"
31
-                            type="daterange"
32
-                            value-format="yyyy-MM-dd"
33
-                            range-separator="至"
34
-                            start-placeholder="开始日期"
35
-                            @change="changeDate"
36
-                            end-placeholder="结束日期">
37
-                    </el-date-picker>
38
-                    <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
39
-                    <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
40
-                </div>
41
-                <div>
42
-                    <!-- <el-popover
43
-                      placement="bottom"
44
-                      width="210"
45
-                      trigger="click">
46
-                      <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
47
-                      <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
48
-                      <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
49
-
50
-                    </el-popover> -->
51
-                    <!--<el-button size="small" type="primary" @click="export_detail">报表下载</el-button>-->
52
-                </div>
53
-            </div>
54
-            <el-table :data="tableData" border :row-style="{ color: '#303133' }"
55
-                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
56
-                      show-summary
57
-                      max-height="600"
58
-                      :span-method="merge"
59
-                      :summary-method="getTotal"
60
-                      highlight-current-row>
61
-
62
-                <el-table-column align="center" prop="name" label="患者名字">
63
-                    <template slot-scope="scope">{{ scope.row.name }}</template>
64
-                </el-table-column>
65
-                <!--<el-table-column align="center" prop="name" label="患者类型">-->
66
-                <!--<template slot-scope="scope"></template>-->
67
-                <!--</el-table-column>-->
68
-
69
-                <el-table-column align="center" prop="item_name" label="项目类别">
70
-                    <template slot-scope="scope">{{scope.row.item_name}}</template>
71
-                </el-table-column>
72
-                <el-table-column align="center" prop="price" label="费用">
73
-                    <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
74
-                </el-table-column>
75
-                <el-table-column align="center" prop="sum" label="费用总额">
76
-                    <template slot-scope="scope">
77
-                        <div>{{scope.row.sum.toFixed(2)}}</div>
78
-                    </template>
79
-                </el-table-column>
80
-
81
-            </el-table>
82
-        </div>
83
-
84
-    </div>
2
+  <div>
3
+      <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
4
+          <div>
5
+              <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
6
+              <!--@click="Action">-->
7
+              <!--导出-->
8
+              <!--</el-button>-->
9
+              <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
10
+                        @keyup.enter.native='searchAction'
11
+                        placeholder="请输入患者姓名"
12
+
13
+                        class="filter-item"/>
14
+              <el-select size="small" v-model="item_type" placeholder="请选择"
15
+                          style="width:150px;margin-left:10px;" @change="changeItem">
16
+                  <el-option
17
+                          label="全部"
18
+                          value="0">
19
+                  </el-option>
20
+                  <el-option
21
+                          v-for="item,index in items"
22
+                          :key="index"
23
+                          :label="item.name"
24
+                          :value="item.id">
25
+                  </el-option>
26
+              </el-select>
27
+              <el-date-picker
28
+                      v-model="chargeDate"
29
+                      type="daterange"
30
+                      value-format="yyyy-MM-dd"
31
+                      range-separator="至"
32
+                      start-placeholder="开始日期"
33
+                      @change="changeDate"
34
+                      end-placeholder="结束日期">
35
+              </el-date-picker>
36
+              <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
37
+              <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
38
+          </div>
39
+          <div>
40
+              <!-- <el-popover
41
+                placement="bottom"
42
+                width="210"
43
+                trigger="click">
44
+                <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
45
+                <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
46
+                <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
47
+
48
+              </el-popover> -->
49
+              <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
50
+          </div>
51
+      </div>
52
+      <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="tables"
53
+                :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
54
+                v-loading="gather_loading"
55
+                show-summary
56
+                max-height="600"
57
+                :span-method="merge"
58
+                :summary-method="getTotal"
59
+                highlight-current-row>
60
+
61
+          <el-table-column align="center" prop="name" label="患者名字">
62
+              <template slot-scope="scope">{{ scope.row.name }}</template>
63
+          </el-table-column>
64
+          <!--<el-table-column align="center" prop="name" label="患者类型">-->
65
+          <!--<template slot-scope="scope"></template>-->
66
+          <!--</el-table-column>-->
67
+
68
+          <el-table-column align="center" prop="item_name" label="项目类别">
69
+              <template slot-scope="scope">{{scope.row.item_name}}</template>
70
+          </el-table-column>
71
+          <el-table-column align="center" prop="price" label="费用">
72
+              <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
73
+          </el-table-column>
74
+          <el-table-column align="center" prop="sum" label="费用总额">
75
+              <template slot-scope="scope">
76
+                  <div>{{scope.row.sum.toFixed(2)}}</div>
77
+              </template>
78
+          </el-table-column>
79
+
80
+      </el-table>
81
+  </div>
85 82
 </template>
86 83
 
87 84
 
@@ -98,10 +95,12 @@
98 95
     },
99 96
     data() {
100 97
       return {
98
+        gather_loading:false,
101 99
         crumbs: [],
102 100
         tempArr: [],
103 101
         sameRowArr: [],
104 102
         keywords: '',
103
+        pos:0,
105 104
 
106 105
         tableData: [],
107 106
         chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
@@ -148,6 +147,7 @@
148 147
         this.getSummaryDetailList()
149 148
       },
150 149
       getSummaryDetailList() {
150
+        this.gather_loading = true
151 151
         let start_time = this.chargeDate[0]
152 152
         let end_time = this.chargeDate[1]
153 153
         let params = {
@@ -158,9 +158,13 @@
158 158
         }
159 159
         GetSummaryDetail(params).then(response => {
160 160
           if (response.data.state == 0) {
161
+            this.gather_loading = false
162
+
161 163
             this.$message.error(response.data.msg)
162 164
             return false
163 165
           } else {
166
+            this.gather_loading = false
167
+
164 168
             let tempPatients = []
165 169
             let tempPatientsTwo = []
166 170
             this.tableData = []
@@ -264,14 +268,14 @@
264 268
                   obj['patient_id'] = tempPatientsTwo[d].patient_id
265 269
                   this.tableData.push(obj)
266 270
 
267
-                  obj2['sum'] = price + price2 + price3
271
+                  obj2['sum'] = 0
268 272
                   obj2['price'] = price2
269 273
                   obj2['item_name'] = '药品'
270 274
                   obj2['name'] = tempPatientsTwo[d].name
271 275
                   obj2['patient_id'] = tempPatientsTwo[d].patient_id
272 276
                   this.tableData.push(obj2)
273 277
 
274
-                  obj3['sum'] = price + price2 + price3
278
+                  obj3['sum'] = 0
275 279
                   obj3['price'] = price3
276 280
                   obj3['item_name'] = '耗材'
277 281
                   obj3['name'] = tempPatientsTwo[d].name
@@ -451,23 +455,57 @@
451 455
             sums[index] = '合计'
452 456
             return
453 457
           }
458
+          console.log(data)
454 459
           const values = data.map(item => Number(item[column.property]))
455 460
           if (column.property === 'sum') {
456 461
             sums[index] = values.reduce((prev, curr) => {
457 462
               const value = Number(curr)
458 463
               if (!isNaN(value)) {
459
-                return prev+ curr
464
+                return prev + curr
460 465
               } else {
461 466
                 return prev
462 467
               }
463 468
             }, 0)
464 469
             sums[index] = sums[index].toFixed(2)
465 470
           } else {
466
-            sums[index] = '--'
471
+            sums[index] = ''
467 472
           }
468 473
         })
469 474
 
470 475
         return sums
476
+      }, export_detail() {
477
+
478
+        let list = []
479
+        for (let i = 0; i < this.tableData.length; i++) {
480
+          let order = this.tableData[i]
481
+          let name = order.name
482
+          let item_name = order.item_name
483
+          let pay_sumamt = order.price.toFixed(2)
484
+          let total = order.sum.toFixed(2)
485
+
486
+
487
+          let obj = {
488
+            '患者姓名': name,
489
+            '项目类别': item_name,
490
+            '费用': pay_sumamt,
491
+            '费用总额':total,
492
+          }
493
+          list.push(obj)
494
+        }
495
+        import('@/vendor/Export2Excel').then(excel => {
496
+          const tHeader = [ '患者姓名', '项目名称', '费用', '费用总额']
497
+          const filterVal = [ '患者姓名', '项目名称', '费用', '费用总额']
498
+          const data = this.formatJson(filterVal, list)
499
+          excel.export_json_to_excel1({
500
+            header: tHeader,
501
+            data,
502
+            filename: '汇总',
503
+            ref:this.$refs['tables'].$el
504
+          })
505
+        })
506
+
507
+      }, formatJson(filterVal, jsonData) {
508
+        return jsonData.map(v => filterVal.map(j => v[j]))
471 509
       }
472 510
     },
473 511
     created() {

+ 151 - 226
src/xt_pages/outpatientTool/components/settle.vue ファイルの表示

@@ -1,107 +1,104 @@
1 1
 <template>
2
-    <div class="main-contain outpatientChargesManagement">
3
-        <div class="position">
4
-            <bread-crumb :crumbs='crumbs'></bread-crumb>
5
-        </div>
6
-        <div class="app-container">
7
-            <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
8
-                <div>
9
-                    <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
10
-                    <!--@click="Action">-->
11
-                    <!--导出-->
12
-                    <!--</el-button>-->
13
-                    <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
14
-                              @keyup.enter.native='searchAction'
15
-                              class="filter-item"/>
16
-                    <el-select size="small" v-model="item_type" placeholder="请选择"
17
-                               style="width:150px;margin-left:10px;" @change="changeItem">
18
-                        <el-option
19
-                                label="全部"
20
-                                value="0">
21
-                        </el-option>
22
-                        <el-option
23
-                                v-for="item,index in items"
24
-                                :key="index"
25
-                                :label="item.name"
26
-                                :value="item.id">
27
-                        </el-option>
28
-                    </el-select>
29
-                    <el-date-picker
30
-                            v-model="chargeDate"
31
-                            type="daterange"
32
-                            value-format="yyyy-MM-dd"
33
-                            range-separator="至"
34
-                            start-placeholder="开始日期"
35
-                            @change="changeDate"
36
-                            end-placeholder="结束日期">
37
-                    </el-date-picker>
38
-                    <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
39
-                    <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
40
-                </div>
41
-                <div>
42
-                    <!-- <el-popover
43
-                      placement="bottom"
44
-                      width="210"
45
-                      trigger="click">
46
-                      <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
47
-                      <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
48
-                      <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
49
-
50
-                    </el-popover> -->
51
-                    <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
52
-                </div>
53
-            </div>
54
-            <el-table :data="tableData" border :row-style="{ color: '#303133' }"
55
-                      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
56
-                      show-summary
57
-                      max-height="600"
58
-                      :span-method="merge"
59
-                      :summary-method="getTotal"
60
-                      highlight-current-row>
61
-
62
-                <el-table-column align="center" prop="name" label="患者名字">
63
-                    <template slot-scope="scope">{{ scope.row.other_name }}</template>
64
-                </el-table-column>
65
-                <el-table-column align="center" prop="item_name" label="结算日期">
66
-                    <template slot-scope="scope">
67
-                        {{scope.row.setl_time?scope.row.setl_time:getTimes(scope.row.settle_accounts_date)}}
68
-                    </template>
69
-                </el-table-column>
70
-
71
-                <el-table-column align="center" prop="item_name" label="结算类型">
72
-                    <template slot-scope="scope">
73
-                        <div v-if="scope.row.is_medicine_insurance == 0">自费</div>
74
-                        <div v-if="scope.row.is_medicine_insurance == 1">医保</div>
75
-                    </template>
76
-                </el-table-column>
77
-                <el-table-column align="center" prop="item_name" label="处方类型">
78
-                    <template slot-scope="scope">
79
-                        <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
80
-                        <div v-if="scope.row.med_type == '11'">普通门诊</div>
81
-                    </template>
82
-                </el-table-column>
83
-                <el-table-column align="center" prop="item_name" label="医疗费总额">
84
-                    <template slot-scope="scope">{{scope.row.medfee_sumamt}}</template>
85
-                </el-table-column>
86
-                <el-table-column align="center" prop="item_name" label="基金支付金额">
87
-                    <template slot-scope="scope">{{scope.row.fund_pay_sumamt}}</template>
88
-                </el-table-column>
89
-                <el-table-column align="center" prop="item_name" label="个人账户支付金额">
90
-                    <template slot-scope="scope">{{scope.row.acct_pay}}</template>
91
-                </el-table-column>
92
-                <el-table-column align="center" prop="item_name" label="个人支付金额">
93
-                    <template slot-scope="scope">{{scope.row.psn_cash_pay}}</template>
94
-                </el-table-column>
95
-                <el-table-column align="center" prop="total" label="费用总额">
96
-                    <template slot-scope="scope">
97
-                        <div>{{scope.row.total.toFixed(2)}}</div>
98
-                    </template>
99
-                </el-table-column>
100
-
101
-            </el-table>
102
-        </div>
103
-
104
-    </div>
2
+  <div>
3
+      <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
4
+          <div>
5
+              <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
6
+              <!--@click="Action">-->
7
+              <!--导出-->
8
+              <!--</el-button>-->
9
+              <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
10
+                        @keyup.enter.native='searchAction'
11
+                        placeholder="请输入患者姓名"
12
+
13
+                        class="filter-item"/>
14
+              <el-select size="small" v-model="item_type" placeholder="请选择"
15
+                          style="width:150px;margin-left:10px;" @change="changeItem">
16
+                  <el-option
17
+                          label="全部"
18
+                          value="0">
19
+                  </el-option>
20
+                  <el-option
21
+                          v-for="item,index in items"
22
+                          :key="index"
23
+                          :label="item.name"
24
+                          :value="item.id">
25
+                  </el-option>
26
+              </el-select>
27
+              <el-date-picker
28
+                      v-model="chargeDate"
29
+                      type="daterange"
30
+                      value-format="yyyy-MM-dd"
31
+                      range-separator="至"
32
+                      start-placeholder="开始日期"
33
+                      @change="changeDate"
34
+                      end-placeholder="结束日期">
35
+              </el-date-picker>
36
+              <!--<el-radio v-model="radio" label="1">明细</el-radio>-->
37
+              <!--<el-radio v-model="radio" label="2">汇总</el-radio>-->
38
+          </div>
39
+          <div>
40
+              <!-- <el-popover
41
+                placement="bottom"
42
+                width="210"
43
+                trigger="click">
44
+                <el-button size="small" ref="button_two" @click="open(1)">打印清单</el-button>
45
+                <el-button size="small" ref="button_six" @click="open(2)">打印汇总</el-button>
46
+                <el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
47
+
48
+              </el-popover> -->
49
+              <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
50
+          </div>
51
+      </div>
52
+      <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="report-table"
53
+                :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
54
+                show-summary
55
+                v-loading="settle_loading"
56
+                max-height="600"
57
+                :span-method="merge"
58
+                :summary-method="getTotal"
59
+                highlight-current-row>
60
+
61
+          <el-table-column align="center" prop="name" label="患者名字">
62
+              <template slot-scope="scope">{{ scope.row.other_name }}</template>
63
+          </el-table-column>
64
+          <el-table-column align="center" prop="item_name" label="结算日期">
65
+              <template slot-scope="scope">
66
+                  {{scope.row.setl_time?scope.row.setl_time.split(" ")[0]:getTimes(scope.row.settle_accounts_date)}}
67
+              </template>
68
+          </el-table-column>
69
+
70
+          <el-table-column align="center" prop="item_name" label="结算类型">
71
+              <template slot-scope="scope">
72
+                  <div v-if="scope.row.is_medicine_insurance == 0">自费</div>
73
+                  <div v-if="scope.row.is_medicine_insurance == 1">医保</div>
74
+              </template>
75
+          </el-table-column>
76
+          <el-table-column align="center" prop="item_name" label="处方类型">
77
+              <template slot-scope="scope">
78
+                  <div v-if="scope.row.med_type == '14'">门诊特殊病</div>
79
+                  <div v-if="scope.row.med_type == '11'">普通门诊</div>
80
+              </template>
81
+          </el-table-column>
82
+          <el-table-column align="center" prop="item_name" label="医疗费总额">
83
+              <template slot-scope="scope">{{scope.row.medfee_sumamt}}</template>
84
+          </el-table-column>
85
+          <el-table-column align="center" prop="item_name" label="基金支付金额">
86
+              <template slot-scope="scope">{{scope.row.fund_pay_sumamt}}</template>
87
+          </el-table-column>
88
+          <el-table-column align="center" prop="item_name" label="个人账户支付金额">
89
+              <template slot-scope="scope">{{scope.row.acct_pay}}</template>
90
+          </el-table-column>
91
+          <el-table-column align="center" prop="item_name" label="个人支付金额">
92
+              <template slot-scope="scope">{{scope.row.psn_cash_pay}}</template>
93
+          </el-table-column>
94
+          <el-table-column align="center" prop="total" label="费用总额">
95
+              <template slot-scope="scope">
96
+                  <div>{{scope.row.total.toFixed(2)}}</div>
97
+              </template>
98
+          </el-table-column>
99
+
100
+      </el-table>
101
+  </div>
105 102
 </template>
106 103
 
107 104
 
@@ -118,6 +115,7 @@
118 115
     },
119 116
     data() {
120 117
       return {
118
+        settle_loading:false,
121 119
         crumbs: [],
122 120
         tempArr: [],
123 121
         sameRowArr: [],
@@ -179,11 +177,15 @@
179 177
           type: this.item_type,
180 178
           keyword: this.keywords
181 179
         }
180
+        this.settle_loading = true
182 181
         GetSummarySettle(params).then(response => {
183 182
           if (response.data.state == 0) {
183
+            this.settle_loading = false
184
+
184 185
             this.$message.error(response.data.msg)
185 186
             return false
186 187
           } else {
188
+            this.settle_loading = false
187 189
             this.tableData = []
188 190
             let data = response.data.data.patients
189 191
 
@@ -202,7 +204,15 @@
202 204
             for (let i = 0; i < data.length; i++) {
203 205
               for (let b = 0; b < data[i].orders.length; b++) {
204 206
                 let order = data[i].orders[b]
205
-                order['total'] = data[i].total
207
+
208
+                if(b == 0){
209
+                  order['total'] = data[i].total
210
+
211
+                }else{
212
+                  order['total'] = 0
213
+
214
+                }
215
+
206 216
                 this.tableData.push(order)
207 217
 
208 218
               }
@@ -282,7 +292,8 @@
282 292
             colspan: _col
283 293
           }
284 294
         }
285
-      }, getTotal(param) {
295
+      },
296
+      getTotal(param) {
286 297
         const { columns, data } = param
287 298
         const sums = []
288 299
         columns.forEach((column, index) => {
@@ -290,6 +301,7 @@
290 301
             sums[index] = '合计'
291 302
             return
292 303
           }
304
+          console.log(data)
293 305
           const values = data.map(item => Number(item[column.property]))
294 306
           if (column.property === 'total') {
295 307
             sums[index] = values.reduce((prev, curr) => {
@@ -302,7 +314,7 @@
302 314
             }, 0)
303 315
             sums[index] = sums[index].toFixed(2)
304 316
           } else {
305
-            sums[index] = '--'
317
+            sums[index] = ''
306 318
           }
307 319
         })
308 320
 
@@ -312,10 +324,24 @@
312 324
         let list = []
313 325
         for (let i = 0; i < this.tableData.length; i++) {
314 326
           let order = this.tableData[i]
315
-          let name = ''
327
+          let name = order.other_name
316 328
           let time = ''
317 329
           let balance_accounts = ""
318 330
           let med_type = ""
331
+          let medfee_sumamt = ""
332
+          let fund_pay_sumamt = ""
333
+          let acct_pay = ""
334
+          let psn_cash_pay = ""
335
+          let total = ""
336
+          if(order.setl_time.length == 0){
337
+
338
+            time = this.getTimes(order.settle_accounts_date)
339
+
340
+          }else {
341
+
342
+            time = order.setl_time.split(" ")[0]
343
+
344
+          }
319 345
 
320 346
           if (order.is_medicine_insurance == 0) {
321 347
             balance_accounts = '自费'
@@ -333,136 +359,35 @@
333 359
             med_type = '普通门诊'
334 360
           }
335 361
 
336
-          let number = ''
337
-
338
-          let department = ''
339
-          let doctor_name = ''
340
-          let order_status = ''
341
-          let charge_name = ''
342
-          let insutypeName = ''
343
-
344
-
345
-
346
-
347
-
348
-          if (order.patient != null && order.patient.name.length > 0) {
349
-            name = order.patient.name
350
-
351
-          }
352
-
353
-          if (order.p_info != null && order.p_info.department != null && order.p_info.department.name.length > 0) {
354
-            department = order.p_info.department.name
355
-
356
-          }
357
-
358
-          if (order.p_info != null && order.p_info.doctor.length > 0) {
359
-            doctor_name = order.p_info.doctor
360
-          }
361
-
362
-          if (order.creator != null) {
363
-            charge_name = this.getName(order.creator)
364
-          }
365
-          if (order.insutype == '390') {
362
+          medfee_sumamt = order.medfee_sumamt
363
+          fund_pay_sumamt = order.fund_pay_sumamt
364
+          acct_pay = order.acct_pay
365
+          psn_cash_pay = order.psn_cash_pay
366
+          total = order.total
366 367
 
367
-            insutypeName = '城乡居民基本医疗保险'
368
-          } else if (order.insutype == '310') {
369
-            insutypeName = '职工基本医疗保险'
370
-
371
-          }
372
-
373
-          if (order.order_status == 1) {
374
-            order_status = '待结算'
375
-          }
376
-
377
-          if (order.order_status == 2) {
378
-            order_status = '已结算'
379
-          }
380
-
381
-          if (order.order_status == 3) {
382
-            order_status = '已退费'
383
-          }
384
-
385
-          if (order.settle_type == 2) {
386
-            time = this.getTimes(order.settle_start_time)
387
-          } else {
388
-            time = this.getTimes(order.settle_accounts_date)
389
-          }
390
-
391
-          var hifmi_pay = 0.00
392
-
393
-          if (order.setl_detail.length > 0) {
394
-            var jsonObj = JSON.parse(order.setl_detail)
395
-            for (let i = 0; i < jsonObj.length; i++) {
396
-              if (order.insutype == '310') {
397
-                if (jsonObj[i].fund_pay_type == '310300') {
398
-                  hifmi_pay = jsonObj[i].fund_payamt
399
-                }
400
-
401
-              } else if (order.insutype == '390') {
402
-                if (order.fund_pay_type == '390200') {
403
-                  hifmi_pay = jsonObj[i].fund_payamt
404
-                }
405
-              }
406
-            }
407
-          }
408
-          var hifmi_pay = 0.00
409
-
410
-          if (order.setl_detail.length > 0) {
411
-            var jsonObj = JSON.parse(order.setl_detail)
412
-            for (let i = 0; i < jsonObj.length; i++) {
413
-              if (order.insutype == '310') {
414
-                if (jsonObj[i].fund_pay_type == '310300') {
415
-                  hifmi_pay = jsonObj[i].fund_payamt
416
-                }
417
-              }
418
-              if (order.insutype == '390') {
419
-                if (jsonObj[i].fund_pay_type == '390200') {
420
-                  hifmi_pay = jsonObj[i].fund_payamt
421
-                }
422
-              }
423
-            }
424
-          }
425 368
 
426 369
           let obj = {
427
-            '就诊号': order.mdtrt_id,
428 370
             '患者姓名': name,
429
-            '开处时间': time,
430
-            '险种类型': insutypeName,
431
-            '应收金额': order.medfee_sumamt,
432
-            '实收金额': order.medfee_sumamt,
433
-            '医保统筹金额': order.hifp_pay,
434
-            '大额基金金额': order.hifob_pay,
435
-            '大病基金金额': hifmi_pay,
436
-            '补充保险基金金额': order.hifes_pay,
437
-            '医疗救助基金金额': order.maf_pay,
438
-            '公务员基金': order.cvlserv_pay,
439
-            '个人支付基金': order.psn_cash_pay,
440
-            '个人账户支付金额': order.acct_pay,
441
-            '科室': department,
442
-            '医生姓名': doctor_name,
443
-            '收费类别': balance_accounts,
444
-            '收费者姓名': charge_name,
445
-            '总金额': order.medfee_sumamt,
446
-            '现金支付': '',
447
-            '账户支付': '',
448
-            '支付宝支付': '',
449
-            '微信支付': '',
450
-            '其他支付': '',
451
-            '收费时间': order.setl_time,
452
-            '收费状态': order_status,
453
-            '退费日期': ''
371
+            '结算日期': time,
372
+            '结算类型': balance_accounts,
373
+            '处方类型': med_type,
374
+            '医疗费总额': medfee_sumamt,
375
+            '基金支付金额': fund_pay_sumamt,
376
+            '个人账户支付金额': acct_pay,
377
+            '个人支付基金': psn_cash_pay,
378
+            '费用总额':total,
454 379
           }
455
-
456 380
           list.push(obj)
457 381
         }
458 382
         import('@/vendor/Export2Excel').then(excel => {
459
-          const tHeader = ['就诊号', '患者姓名', '开处时间', '险种类型', '应收金额', '实收金额', '医保统筹金额', '大额基金金额', '大病基金金额', '补充保险基金金额', '医疗救助基金金额', '公务员基金', '个人支付基金', '个人账户支付金额', '科室', '医生姓名', '收费类别', '收费者姓名', '总金额', '现金支付', '账户支付', '支付宝支付', '微信支付', '其他支付', '收费时间', '收费状态', '退费日期']
460
-          const filterVal = ['就诊号', '患者姓名', '开处时间', '险种类型', '应收金额', '实收金额', '医保统筹金额', '大额基金金额', '大病基金金额', '补充保险基金金额', '医疗救助基金金额', '公务员基金', '个人支付基金', '个人账户支付金额', '科室', '医生姓名', '收费类别', '收费者姓名', '总金额', '现金支付', '账户支付', '支付宝支付', '微信支付', '其他支付', '收费时间', '收费状态', '退费日期']
383
+          const tHeader = [ '患者姓名', '结算日期', '结算类型', '处方类型', '医疗费总额', '基金支付金额', '个人账户支付金额', '个人支付基金', '费用总额']
384
+          const filterVal = [ '患者姓名', '结算日期', '结算类型', '处方类型', '医疗费总额', '基金支付金额', '个人账户支付金额', '个人支付基金', '费用总额']
461 385
           const data = this.formatJson(filterVal, list)
462
-          excel.export_json_to_excel({
386
+          excel.export_json_to_excel1({
463 387
             header: tHeader,
464 388
             data,
465
-            filename: '消费明细'
389
+            filename: '结算明细',
390
+            ref:this.$refs['report-table'].$el
466 391
           })
467 392
         })
468 393
 

+ 5 - 9
src/xt_pages/outpatientTool/summary.vue ファイルの表示

@@ -6,15 +6,11 @@
6 6
         <div class="app-container" style="display:flex;flex: 1;padding: 10px 20px 0px 20px;">
7 7
 
8 8
             <div class="mainRight">
9
-                <div class="mainHeader">
10
-                    <el-tabs v-model="titleType" @tab-click="handleClick"
11
-                             style="position: fixed;width: calc(100% - 490px);background:#fff;">
12
-                        <el-tab-pane label="明细" name="明细"></el-tab-pane>
13
-                        <el-tab-pane label="汇总" name="汇总"></el-tab-pane>
14
-                        <el-tab-pane label="结算" name="结算"></el-tab-pane>
15
-                    </el-tabs>
16
-
17
-                </div>
9
+                <el-tabs v-model="titleType" @tab-click="handleClick">
10
+                    <el-tab-pane label="明细" name="明细"></el-tab-pane>
11
+                    <el-tab-pane label="汇总" name="汇总"></el-tab-pane>
12
+                    <el-tab-pane label="结算" name="结算"></el-tab-pane>
13
+                </el-tabs>
18 14
                 <detail v-if="titleType == '明细'"></detail>
19 15
                 <gather v-if="titleType == '汇总'"></gather>
20 16
                 <settle v-if="titleType == '结算'"></settle>