|
@@ -112,6 +112,8 @@
|
112
|
112
|
<!-- >报表下载2-->
|
113
|
113
|
<!-- </el-button-->
|
114
|
114
|
<!-- >-->
|
|
115
|
+
|
|
116
|
+ <el-button size="small" type="primary" @click="export_detail_three">报表下载2</el-button>
|
115
|
117
|
</div>
|
116
|
118
|
</div>
|
117
|
119
|
<el-table
|
|
@@ -343,6 +345,8 @@ import axios from "axios";
|
343
|
345
|
import invoicePrint from "./invoicePrint";
|
344
|
346
|
import settlementPrint from "./settlementPrint";
|
345
|
347
|
import {getHisDataTwo} from "../../api/his/his";
|
|
348
|
+import {getHisDataThree} from "../../api/his/his";
|
|
349
|
+
|
346
|
350
|
|
347
|
351
|
export default {
|
348
|
352
|
name: "OutpatientChargesSummary",
|
|
@@ -669,7 +673,8 @@ export default {
|
669
|
673
|
order_id: row.id,
|
670
|
674
|
};
|
671
|
675
|
this.settlementObj = obj;
|
672
|
|
- }, export_detail_two() {
|
|
676
|
+ },
|
|
677
|
+ export_detail_two() {
|
673
|
678
|
let params = {};
|
674
|
679
|
getHisDataTwo(params).then((response) => {
|
675
|
680
|
if (response.data.state == 0) {
|
|
@@ -807,7 +812,100 @@ export default {
|
807
|
812
|
});
|
808
|
813
|
}
|
809
|
814
|
});
|
810
|
|
- }, unique_two(array) {
|
|
815
|
+ },
|
|
816
|
+ export_detail_three() {
|
|
817
|
+ let params = {};
|
|
818
|
+ getHisDataThree(params).then((response) => {
|
|
819
|
+ if (response.data.state == 0) {
|
|
820
|
+ this.$message.error(response.data.msg);
|
|
821
|
+ return false;
|
|
822
|
+ } else {
|
|
823
|
+ let list = [];
|
|
824
|
+ for (let i = 0; i < response.data.data.order.length; i++) {
|
|
825
|
+ let order = response.data.data.order[i];
|
|
826
|
+ let data = this.setMonthPrescription(order.info)
|
|
827
|
+ // console.log(data)
|
|
828
|
+ for(let b= 0; b < data.length; b++){
|
|
829
|
+ let obj = {
|
|
830
|
+ name: order.patient.name,
|
|
831
|
+ id_card_no: order.patient.id_card_no,
|
|
832
|
+ year: "2022",
|
|
833
|
+ month:"8",
|
|
834
|
+ code: data[b].code,
|
|
835
|
+ pric: data[b].count * data[b].price,
|
|
836
|
+ item_name:data[b].name,
|
|
837
|
+ unit:data[b].unit,
|
|
838
|
+ count:data[b].count,
|
|
839
|
+
|
|
840
|
+ }
|
|
841
|
+ if (order.insutype == "310") {
|
|
842
|
+ obj["insutype"] = "职工"
|
|
843
|
+ } else if (order.insutype == "390") {
|
|
844
|
+ obj["insutype"] = "城乡"
|
|
845
|
+ }
|
|
846
|
+ list.push(obj)
|
|
847
|
+ }
|
|
848
|
+
|
|
849
|
+ }
|
|
850
|
+
|
|
851
|
+ var tarList = []
|
|
852
|
+ for (let i = 0; i < list.length; i++) {
|
|
853
|
+ if(list[i].pric > 0) {
|
|
854
|
+ let obj = {
|
|
855
|
+ "姓名": list[i].name,
|
|
856
|
+ "身份证号": list[i].id_card_no,
|
|
857
|
+ "医保类型": list[i].insutype,
|
|
858
|
+ "年": list[i].year,
|
|
859
|
+ "月": list[i].month,
|
|
860
|
+ "药品编码": list[i].code,
|
|
861
|
+ "名称": list[i].item_name,
|
|
862
|
+ "单位": list[i].unit,
|
|
863
|
+ "数量": list[i].count,
|
|
864
|
+ "金额": list[i].pric,
|
|
865
|
+ }
|
|
866
|
+ tarList.push(obj)
|
|
867
|
+ }
|
|
868
|
+ }
|
|
869
|
+
|
|
870
|
+ import("@/vendor/Export2Excel").then((excel) => {
|
|
871
|
+ const tHeader = [
|
|
872
|
+ "姓名",
|
|
873
|
+ "身份证号",
|
|
874
|
+ "医保类型",
|
|
875
|
+ "年",
|
|
876
|
+ "月",
|
|
877
|
+ "药品编码",
|
|
878
|
+ "名称",
|
|
879
|
+ "单位",
|
|
880
|
+ "数量",
|
|
881
|
+ "金额",
|
|
882
|
+
|
|
883
|
+ ];
|
|
884
|
+ const filterVal = [
|
|
885
|
+ "姓名",
|
|
886
|
+ "身份证号",
|
|
887
|
+ "医保类型",
|
|
888
|
+ "年",
|
|
889
|
+ "月",
|
|
890
|
+ "药品编码",
|
|
891
|
+ "名称",
|
|
892
|
+ "单位",
|
|
893
|
+ "数量",
|
|
894
|
+ "金额",
|
|
895
|
+
|
|
896
|
+ ];
|
|
897
|
+ const data = this.formatJson(filterVal, tarList);
|
|
898
|
+ excel.export_json_to_excel({
|
|
899
|
+ header: tHeader,
|
|
900
|
+ data,
|
|
901
|
+ filename: "消费明细",
|
|
902
|
+ });
|
|
903
|
+ });
|
|
904
|
+ }
|
|
905
|
+ });
|
|
906
|
+ },
|
|
907
|
+
|
|
908
|
+ unique_two(array) {
|
811
|
909
|
// res用来存储结果
|
812
|
910
|
var res = []
|
813
|
911
|
for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
|
|
@@ -1079,6 +1177,106 @@ export default {
|
1079
|
1177
|
this.keywords = "";
|
1080
|
1178
|
this.getHisOrderList();
|
1081
|
1179
|
},
|
|
1180
|
+ setMonthPrescription(month_prescriptions) {
|
|
1181
|
+ let tableData = []
|
|
1182
|
+ let drug_month_prescriptions = {
|
|
1183
|
+ advices: []
|
|
1184
|
+ }
|
|
1185
|
+ let drug_ids = []
|
|
1186
|
+ let project_month_prescriptions = {
|
|
1187
|
+ project: []
|
|
1188
|
+
|
|
1189
|
+ }
|
|
1190
|
+ let project_ids = []
|
|
1191
|
+
|
|
1192
|
+ // let addition_month_prescriptions = {
|
|
1193
|
+ // addition: []
|
|
1194
|
+ //
|
|
1195
|
+ // }
|
|
1196
|
+ // let additions_ids = []
|
|
1197
|
+ for (let i = 0; i < month_prescriptions.length; i++) {
|
|
1198
|
+ if (month_prescriptions[i].type == 1) { //药品
|
|
1199
|
+ for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
|
|
1200
|
+ let obj = {
|
|
1201
|
+ id: month_prescriptions[i].advices[a].drug_id,
|
|
1202
|
+ price: month_prescriptions[i].advices[a].price
|
|
1203
|
+
|
|
1204
|
+ }
|
|
1205
|
+ drug_ids.push(obj)
|
|
1206
|
+ drug_month_prescriptions.advices.push(month_prescriptions[i].advices[a])
|
|
1207
|
+ }
|
|
1208
|
+
|
|
1209
|
+ } else if (month_prescriptions[i].type == 2) { //项目
|
|
1210
|
+ for (let a = 0; a < month_prescriptions[i].project.length; a++) {
|
|
1211
|
+ let obj = {
|
|
1212
|
+ id: month_prescriptions[i].project[a].project_id,
|
|
1213
|
+ price: month_prescriptions[i].project[a].price
|
|
1214
|
+
|
|
1215
|
+ }
|
|
1216
|
+ project_ids.push(obj)
|
|
1217
|
+ project_month_prescriptions.project.push(month_prescriptions[i].project[a])
|
|
1218
|
+ }
|
|
1219
|
+ }
|
|
1220
|
+
|
|
1221
|
+ }
|
|
1222
|
+
|
|
1223
|
+ drug_ids = this.unique(drug_ids)
|
|
1224
|
+ project_ids= this.unique(project_ids)
|
|
1225
|
+
|
|
1226
|
+ // additions_ids= this.unique(additions_ids)
|
|
1227
|
+
|
|
1228
|
+
|
|
1229
|
+ for (let i = 0; i < drug_ids.length; i++) {
|
|
1230
|
+ let obj = {}
|
|
1231
|
+ let count = 0
|
|
1232
|
+ for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
|
|
1233
|
+ if (drug_ids[i].price == drug_month_prescriptions.advices[a].price && drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id) {
|
|
1234
|
+ obj['name'] = drug_month_prescriptions.advices[a].advice_name
|
|
1235
|
+ obj['code'] = drug_month_prescriptions.advices[a].id
|
|
1236
|
+ obj['unit'] = drug_month_prescriptions.advices[a].drug.min_unit
|
|
1237
|
+ obj['price'] = parseFloat(drug_month_prescriptions.advices[a].price)
|
|
1238
|
+ count = count + drug_month_prescriptions.advices[a].prescribing_number
|
|
1239
|
+ }
|
|
1240
|
+ }
|
|
1241
|
+ obj['count'] = count
|
|
1242
|
+ tableData.push(obj)
|
|
1243
|
+ }
|
|
1244
|
+
|
|
1245
|
+ for (let i = 0; i < project_ids.length; i++) {
|
|
1246
|
+ let obj = {}
|
|
1247
|
+ let count = 0
|
|
1248
|
+ for (let a = 0; a < project_month_prescriptions.project.length; a++) {
|
|
1249
|
+ if (project_ids[i].price == project_month_prescriptions.project[a].price &&project_ids[i].id == project_month_prescriptions.project[a].project_id ) {
|
|
1250
|
+
|
|
1251
|
+ if(project_month_prescriptions.project[a].type == 2){
|
|
1252
|
+ obj['name'] = project_month_prescriptions.project[a].project.project_name
|
|
1253
|
+ obj['code'] = project_month_prescriptions.project[a].id
|
|
1254
|
+ obj['unit'] = project_month_prescriptions.project[a].project.unit
|
|
1255
|
+ obj['type'] = 2
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+ }else if (project_month_prescriptions.project[a].type == 3){
|
|
1259
|
+ obj['name'] = project_month_prescriptions.project[a].good_info.good_name
|
|
1260
|
+ obj['code'] = project_month_prescriptions.project[a].id
|
|
1261
|
+ obj['unit'] = project_month_prescriptions.project[a].good_info.packing_unit
|
|
1262
|
+ obj['type'] = 3
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+ }
|
|
1266
|
+ count = count + parseFloat(project_month_prescriptions.project[a].count)
|
|
1267
|
+ obj['price'] = parseFloat(project_month_prescriptions.project[a].price)
|
|
1268
|
+ obj['type'] = 1
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+ }
|
|
1272
|
+ }
|
|
1273
|
+ obj['count'] = count
|
|
1274
|
+ tableData.push(obj)
|
|
1275
|
+
|
|
1276
|
+ }
|
|
1277
|
+ return tableData
|
|
1278
|
+ },
|
|
1279
|
+
|
1082
|
1280
|
Action() {
|
1083
|
1281
|
getAllOrders().then((response) => {
|
1084
|
1282
|
if (response.data.state == 0) {
|
|
@@ -1225,7 +1423,23 @@ export default {
|
1225
|
1423
|
} else if (index == 2) {
|
1226
|
1424
|
this.allListVisible = true;
|
1227
|
1425
|
}
|
|
1426
|
+ }, unique(array) {
|
|
1427
|
+ // res用来存储结果
|
|
1428
|
+ var res = []
|
|
1429
|
+ for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
|
|
1430
|
+ for (var j = 0, resLen = res.length; j < resLen; j++) {
|
|
1431
|
+ if (array[i].id === res[j].id && array[i].price === res[j].price) {
|
|
1432
|
+ break
|
|
1433
|
+ }
|
|
1434
|
+ }
|
|
1435
|
+ // 如果array[i]是唯一的,那么执行完循环,j等于resLen
|
|
1436
|
+ if (j === resLen) {
|
|
1437
|
+ res.push(array[i])
|
|
1438
|
+ }
|
|
1439
|
+ }
|
|
1440
|
+ return res
|
1228
|
1441
|
},
|
|
1442
|
+
|
1229
|
1443
|
invoicePrint(obj) {
|
1230
|
1444
|
console.log(obj);
|
1231
|
1445
|
let paramsObj = {
|