|
@@ -252,54 +252,54 @@ export default {
|
252
|
252
|
time_way:this.date_mode,
|
253
|
253
|
}
|
254
|
254
|
Getdialysisdetail(params).then(response =>{
|
255
|
|
- console.log('00000',response);
|
|
255
|
+ console.log('00000透析总量分析',response.data.data.list);
|
256
|
256
|
if(response.data.state == 1){
|
257
|
257
|
const list = response.data.data.list
|
258
|
258
|
this.patientTableData = list
|
259
|
|
- // this.tableData = list
|
260
|
259
|
var column = []
|
261
|
|
- column = Object.keys(response.data.data.list[0]).map(key => ({
|
262
|
|
- prop: key,
|
263
|
|
- label: key // 可以自定义表头名称
|
264
|
|
- }));
|
265
|
|
- // this.tableData = response.data.data.list
|
266
|
|
- for(let i in column){
|
267
|
|
- if(column[i].label == '日期'){
|
268
|
|
- column.splice(i,1)
|
269
|
|
- }
|
270
|
|
-
|
271
|
|
- }
|
272
|
|
- const arr={
|
273
|
|
- label:'日期',
|
274
|
|
- prop:'日期'
|
275
|
|
- }
|
276
|
|
- for(let i in column){
|
277
|
|
- if(column[i].label == '合计'){
|
278
|
|
- column.splice(i,1)
|
279
|
|
- }
|
|
260
|
+ var column2 = []
|
|
261
|
+ list.forEach((v,i)=>{
|
|
262
|
+ Object.keys(v).forEach(v=>{
|
|
263
|
+ column2.push(v)
|
|
264
|
+ })
|
|
265
|
+ })
|
|
266
|
+ column2= [...new Set(column2)]
|
|
267
|
+ for(let i in column2){
|
|
268
|
+ let obj ={
|
|
269
|
+ prop:column2[i],
|
|
270
|
+ label:column2[i]
|
280
|
271
|
}
|
281
|
|
- const arr1={
|
282
|
|
- label:'合计',
|
283
|
|
- prop:'合计'
|
|
272
|
+ column.push(obj)
|
|
273
|
+ }
|
|
274
|
+ for(let i in column){
|
|
275
|
+ if(column[i].label == '日期'){
|
|
276
|
+ column.splice(i,1)
|
284
|
277
|
}
|
285
|
|
- column.unshift(arr)
|
286
|
|
- column.push(arr1)
|
287
|
|
- this.columns = column
|
288
|
278
|
|
289
|
|
- const detil = []
|
290
|
|
- for(let i in this.columns){
|
291
|
|
- detil.push(this.columns[i].label)
|
|
279
|
+ }
|
|
280
|
+ const arr={
|
|
281
|
+ label:'日期',
|
|
282
|
+ prop:'日期'
|
|
283
|
+ }
|
|
284
|
+ for(let i in column){
|
|
285
|
+ if(column[i].label == '合计'){
|
|
286
|
+ column.splice(i,1)
|
292
|
287
|
}
|
293
|
|
- this.detilarr = detil
|
294
|
|
- // this.tableData = response.data.data.list.map(row => {
|
295
|
|
- // let newRow = {};
|
296
|
|
- // for (let key in row) {
|
297
|
|
- // newRow[key] = row[key] === 0 ? '' : row[key];
|
298
|
|
- // }
|
299
|
|
- // return newRow;
|
300
|
|
- // });
|
301
|
|
- // console.log('tttt',this.tableData);
|
302
|
|
- console.log('hhhhh',this.columns);
|
|
288
|
+ }
|
|
289
|
+ const arr1={
|
|
290
|
+ label:'合计',
|
|
291
|
+ prop:'合计'
|
|
292
|
+ }
|
|
293
|
+ column.unshift(arr)
|
|
294
|
+ column.push(arr1)
|
|
295
|
+ this.columns = column
|
|
296
|
+
|
|
297
|
+ const detil = []
|
|
298
|
+ for(let i in this.columns){
|
|
299
|
+ detil.push(this.columns[i].label)
|
|
300
|
+ }
|
|
301
|
+ this.detilarr = detil
|
|
302
|
+ console.log('hhhhh',this.columns);
|
303
|
303
|
}
|
304
|
304
|
|
305
|
305
|
})
|