|
@ -488,7 +488,20 @@ export default { |
|
|
type: 'success', |
|
|
type: 'success', |
|
|
duration: 500, |
|
|
duration: 500, |
|
|
}) |
|
|
}) |
|
|
this.fileData1 = _.cloneDeep(sheetDataTemp) |
|
|
let newSheetData = [] |
|
|
|
|
|
for (let index = 0; index < sheetDataTemp.length; index++) { |
|
|
|
|
|
let element = sheetDataTemp[index]; |
|
|
|
|
|
if (index !== 0) { |
|
|
|
|
|
let pre = sheetDataTemp[index - 1] |
|
|
|
|
|
for (let key in pre) { |
|
|
|
|
|
if (element[key] === undefined) { |
|
|
|
|
|
element[key] = pre[key] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
newSheetData.push({ ...element }) |
|
|
|
|
|
} |
|
|
|
|
|
this.fileData1 = _.cloneDeep(newSheetData) |
|
|
}, |
|
|
}, |
|
|
// 处理第五类表 |
|
|
// 处理第五类表 |
|
|
async a5(sheetData) { |
|
|
async a5(sheetData) { |
|
@ -526,7 +539,20 @@ export default { |
|
|
type: 'success', |
|
|
type: 'success', |
|
|
duration: 500, |
|
|
duration: 500, |
|
|
}) |
|
|
}) |
|
|
this.fileData1 = _.cloneDeep(sheetDataTemp) |
|
|
let newSheetData = [] |
|
|
|
|
|
for (let index = 0; index < sheetDataTemp.length; index++) { |
|
|
|
|
|
let element = sheetDataTemp[index]; |
|
|
|
|
|
if (index !== 0) { |
|
|
|
|
|
let pre = sheetDataTemp[index - 1] |
|
|
|
|
|
for (let key in pre) { |
|
|
|
|
|
if (element[key] === undefined) { |
|
|
|
|
|
element[key] = pre[key] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
newSheetData.push({ ...element }) |
|
|
|
|
|
} |
|
|
|
|
|
this.fileData1 = _.cloneDeep(newSheetData) |
|
|
}, |
|
|
}, |
|
|
//表格B增加数据 |
|
|
//表格B增加数据 |
|
|
async successSubmit2(opts) { |
|
|
async successSubmit2(opts) { |
|
@ -809,7 +835,19 @@ export default { |
|
|
cell.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'EEEEEE' }, }; |
|
|
cell.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb: 'EEEEEE' }, }; |
|
|
cell.alignment = { horizontal: 'center', vertical: 'top' }; |
|
|
cell.alignment = { horizontal: 'center', vertical: 'top' }; |
|
|
}); |
|
|
}); |
|
|
|
|
|
let groupObj = _.groupBy(lilstLocalTemp, o => `${o["Store"]}_${o["Description"]}`) |
|
|
|
|
|
let lilstLocalTempCopy = _.cloneDeep(lilstLocalTemp) |
|
|
|
|
|
for (let i = 0; i < lilstLocalTemp.length; i++) { |
|
|
|
|
|
let element = lilstLocalTemp[i]; |
|
|
|
|
|
let findIndex = _.findIndex(lilstLocalTempCopy, o => o["Store"] === element["Store"] && o["Description"] === element["Description"]) |
|
|
|
|
|
if (findIndex === i) { |
|
|
|
|
|
let listTemp = groupObj[`${element["Store"]}_${element["Description"]}`] |
|
|
|
|
|
let total = _.sumBy(listTemp, o => o["Quantity of containers"]) |
|
|
|
|
|
element["Quantity of containers"] = total |
|
|
|
|
|
} else if (findIndex < i) { |
|
|
|
|
|
element["Quantity of containers"] = "" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 设置数据行样式 |
|
|
// 设置数据行样式 |
|
|
lilstLocalTemp.forEach((row, rowIndex) => { |
|
|
lilstLocalTemp.forEach((row, rowIndex) => { |
|
|
let rowKeys = Object.keys(row); |
|
|
let rowKeys = Object.keys(row); |
|
|