|
@@ -311,9 +311,12 @@
|
311
|
311
|
}
|
312
|
312
|
tempPatientsTwo[i]['total'] = total
|
313
|
313
|
}
|
314
|
|
-
|
|
314
|
+ console.log('tempPatientsTwo',tempPatientsTwo)
|
315
|
315
|
for (let i = 0; i < tempPatientsTwo.length; i++) {
|
316
|
|
- console.log(tempPatientsTwo[i].total)
|
|
316
|
+ // console.log(111,tempPatientsTwo[i].total)
|
|
317
|
+ if(tempPatientsTwo[i].new_order_info.length > 0){
|
|
318
|
+
|
|
319
|
+
|
317
|
320
|
for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
|
318
|
321
|
let new_name = tempPatientsTwo[i].new_order_info[b].item_name
|
319
|
322
|
new_name=new_name.replace("( ","");
|
|
@@ -330,15 +333,17 @@
|
330
|
333
|
count: tempPatientsTwo[i].new_order_info[b].count,
|
331
|
334
|
|
332
|
335
|
}
|
333
|
|
- if(b == 0){
|
|
336
|
+
|
|
337
|
+ // if(b == 0){
|
334
|
338
|
obj['total'] = tempPatientsTwo[i].total
|
335
|
|
- }else{
|
336
|
|
- obj['total'] = 0
|
337
|
|
- }
|
|
339
|
+ // }else{
|
|
340
|
+ // obj['total'] = 0
|
|
341
|
+ // }
|
338
|
342
|
this.tableData.push(obj)
|
339
|
343
|
}
|
340
|
344
|
|
341
|
345
|
}
|
|
346
|
+ }
|
342
|
347
|
}
|
343
|
348
|
this.handleSpanTempArr()
|
344
|
349
|
// this.tableData = tempPatientsTwo
|
|
@@ -521,22 +526,27 @@
|
521
|
526
|
console.log(data)
|
522
|
527
|
const values = data.map(item => Number(item[column.property]))
|
523
|
528
|
if (column.property === 'total') {
|
524
|
|
- sums[index] = values.reduce((prev, curr) => {
|
525
|
|
- const value = Number(curr)
|
526
|
|
- if (!isNaN(value)) {
|
527
|
|
- return prev + curr
|
528
|
|
- } else {
|
529
|
|
- return prev
|
530
|
|
- }
|
531
|
|
- }, 0)
|
532
|
|
- sums[index] = sums[index].toFixed(2)
|
|
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)
|
533
|
543
|
} else {
|
534
|
544
|
sums[index] = ''
|
535
|
545
|
}
|
536
|
546
|
})
|
537
|
547
|
|
538
|
548
|
return sums
|
539
|
|
- }
|
|
549
|
+ },
|
540
|
550
|
},
|
541
|
551
|
created() {
|
542
|
552
|
this.getSummaryDetailList()
|