Browse Source

12.26

master
lichong 3 months ago
parent
commit
040a22fc1c
  1. 37
      src/renderer/src/views/shujuguanli.vue

37
src/renderer/src/views/shujuguanli.vue

@ -770,6 +770,41 @@ export default {
'Quantity to deliver': item["Quantity to deliver"] ? item["Quantity to deliver"].toFixed(3) : ""
})
}
let lilstLocalTemp = []
for (let index = 0; index < this.fileData2Local.length; index++) {
let element = this.fileData2Local[index];
let findIndex = []
let findAllIndex = []
for (let j = 0; j < lilstLocal.length; j++) {
let item = lilstLocal[j];
if (!item["isFind"]) {
if (item["Store"] === element["Store"] && item["Sku"] === element["Sku"] && item["Description"] === element["Description"] && item["Quantity to deliver"] === element["Quantity to deliver"]) {
findIndex.push(j)
}
if (item["Store"] === element["Store"] && item["Sku"] === element["Sku"] && item["Description"] === element["Description"]) {
findAllIndex.push(j)
}
}
}
findIndex = _.uniq(findIndex)
findAllIndex = _.uniq(findAllIndex)
let exList = _.difference(findAllIndex, findIndex)
for (let j = 0; j < findIndex.length; j++) {
let item = lilstLocal[findIndex[j]];
lilstLocalTemp.push({ ...item })
item["isFind"] = true
}
for (let j = 0; j < exList.length; j++) {
let item = lilstLocal[exList[j]];
lilstLocalTemp.push({ ...item })
item["isFind"] = true
}
}
let extraList = _.filter(lilstLocal, o => !o["isFind"])
for (let i = 0; i < extraList.length; i++) {
let element = extraList[i];
lilstLocalTemp.push({ ...element })
}
// 簿
let workbook = new ExcelJS.Workbook();
let worksheet = workbook.addWorksheet('Sheet1');
@ -784,7 +819,7 @@ export default {
});
//
lilstLocal.forEach((row, rowIndex) => {
lilstLocalTemp.forEach((row, rowIndex) => {
let rowKeys = Object.keys(row);
for (let colIndex = 0; colIndex < rowKeys.length; colIndex++) {
let key = rowKeys[colIndex];

Loading…
Cancel
Save