|
@@ -75,13 +75,10 @@ const budgetAndPracticalByDept = async () => {
|
|
|
const getTableData = (res)=>{
|
|
|
let tablearr = []
|
|
|
res.forEach((ele)=>{
|
|
|
- // tablearr.push(getBlist(ele.budgetList))
|
|
|
- let Blist = getBlist(ele.budgetList)
|
|
|
+ let Blist = getBlist(ele.budgetList)
|
|
|
let Plist = getPlist(ele.costList)
|
|
|
let allList = Object.assign(Blist, Plist)
|
|
|
tablearr.push(allList)
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
// return tablearr
|
|
|
res.forEach((item, index)=>{
|
|
@@ -98,10 +95,13 @@ const getTableData = (res)=>{
|
|
|
|
|
|
const getBlist = (arr)=>{
|
|
|
let a = {}
|
|
|
- arr.forEach((ele)=>{
|
|
|
+ arr.forEach((ele, index)=>{
|
|
|
for (let i = 0;i < arr.length;i++) {
|
|
|
let b = 'budget' + i//每个属性的属性名,不一样
|
|
|
- a[b] = ele
|
|
|
+ if (index === i) {
|
|
|
+ a[b] = ele
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
})
|
|
@@ -109,10 +109,12 @@ const getTableData = (res)=>{
|
|
|
}
|
|
|
const getPlist = (arr)=>{
|
|
|
let a = {}
|
|
|
- arr.forEach((ele)=>{
|
|
|
+ arr.forEach((ele, index)=>{
|
|
|
for (let i = 0;i < arr.length;i++) {
|
|
|
let b = 'practical' + i//每个属性的属性名,不一样
|
|
|
- a[b] = ele
|
|
|
+ if (index === i) {
|
|
|
+ a[b] = ele
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
})
|