|
|
|
@ -507,10 +507,18 @@ export default { |
|
|
|
let list = await this.getListData(this.reportId); |
|
|
|
let newArrar = luckysheet.getAllSheets(); |
|
|
|
this.currentTable = newArrar.filter(item => item.status == '1'); |
|
|
|
if(this.currentTable[0].data.length <= list.length){ |
|
|
|
if(list){ |
|
|
|
if(this.currentTable[0].data.length <= list.length){ |
|
|
|
luckysheet.insertRow(this.currentTable[0].data.length, { number: list.length - this.currentTable[0].data.length + 5 }); |
|
|
|
}else if(list.length !== 0 && this.currentTable[0].data.length !== 1){ |
|
|
|
luckysheet.deleteRow(list.length, this.currentTable[0].data.length ) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
luckysheet.deleteRow(list.length, this.currentTable[0].data.length ) |
|
|
|
if(this.currentTable[0].data.length !== 1){ |
|
|
|
luckysheet.deleteRow(1, this.currentTable[0].data.length) |
|
|
|
}else{ |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
await nextTick(500) |
|
|
|
let newArray = list.map(obj => { |
|
|
|
@ -1142,8 +1150,12 @@ export default { |
|
|
|
this.luckysheetLoading = true; |
|
|
|
const listData = await this.getListData(val.id) |
|
|
|
luckysheet.insertRow(this.currentTable[0].data.length, 1) |
|
|
|
luckysheet.insertRow(this.currentTable[0].data.length, { number: listData.length }); |
|
|
|
this.showUploadData = false; |
|
|
|
if (!listData) { |
|
|
|
this.luckysheetLoading = false; |
|
|
|
return; |
|
|
|
} |
|
|
|
luckysheet.insertRow(this.currentTable[0].data.length, { number: listData.length }); |
|
|
|
await nextTick(500) |
|
|
|
let newArray = listData.map(obj => { |
|
|
|
return Object.keys(obj).map(key => { |
|
|
|
@ -1189,7 +1201,7 @@ export default { |
|
|
|
}, |
|
|
|
async getListData(id) { |
|
|
|
const { data, code } = await requestGet('/actual/base/intellgentizeReport/listDatasById', { id }) |
|
|
|
if (code === 0) { |
|
|
|
if (code === 0 && data.length>0) { |
|
|
|
return data |
|
|
|
}else{ |
|
|
|
this.luckysheetLoading = false; |
|
|
|
|