|
|
@ -10,14 +10,18 @@ |
|
|
|
<el-icon> |
|
|
|
<Upload /> |
|
|
|
</el-icon> |
|
|
|
<el-tooltip> |
|
|
|
<el-tooltip placement="bottom-end"> |
|
|
|
<template #content> |
|
|
|
<div> |
|
|
|
<el-image style="width: 100px; height: 100px" :preview-src-list="[url1]" :src="url1" |
|
|
|
<div style="width: 800px;"> |
|
|
|
<el-carousel height="400px"> |
|
|
|
<el-carousel-item v-for="item in [url1, url11]" :key="item"> |
|
|
|
<el-image style="width: 800px; height: 400px" :preview-src-list="[item]" :src="item" |
|
|
|
fit="scale-down" /> |
|
|
|
</el-carousel-item> |
|
|
|
</el-carousel> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<span>导入A1表</span> |
|
|
|
<span>复杂正常</span> |
|
|
|
</el-tooltip> |
|
|
|
</el-button> |
|
|
|
</el-upload> |
|
|
@ -29,14 +33,14 @@ |
|
|
|
<el-icon> |
|
|
|
<Upload /> |
|
|
|
</el-icon> |
|
|
|
<el-tooltip> |
|
|
|
<el-tooltip placement="bottom-end"> |
|
|
|
<template #content> |
|
|
|
<div> |
|
|
|
<el-image style="width: 100px; height: 100px" :preview-src-list="[url2]" :src="url2" |
|
|
|
<el-image style="width: 800px; height: 400px" :preview-src-list="[url2]" :src="url2" |
|
|
|
fit="scale-down" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<span>导入A2表</span> |
|
|
|
<span>复杂纯数字</span> |
|
|
|
</el-tooltip> |
|
|
|
</el-button> |
|
|
|
</el-upload> |
|
|
@ -48,14 +52,14 @@ |
|
|
|
<el-icon> |
|
|
|
<Upload /> |
|
|
|
</el-icon> |
|
|
|
<el-tooltip> |
|
|
|
<el-tooltip placement="bottom-end"> |
|
|
|
<template #content> |
|
|
|
<div> |
|
|
|
<el-image style="width: 100px; height: 100px" :preview-src-list="[url3]" :src="url3" |
|
|
|
<el-image style="width: 800px; height: 400px" :preview-src-list="[url3]" :src="url3" |
|
|
|
fit="scale-down" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<span>导入A3表</span> |
|
|
|
<span>复杂数字不带空格小m</span> |
|
|
|
</el-tooltip> |
|
|
|
</el-button> |
|
|
|
</el-upload> |
|
|
@ -67,14 +71,14 @@ |
|
|
|
<el-icon> |
|
|
|
<Upload /> |
|
|
|
</el-icon> |
|
|
|
<el-tooltip> |
|
|
|
<el-tooltip placement="bottom-end"> |
|
|
|
<template #content> |
|
|
|
<div> |
|
|
|
<el-image style="width: 100px; height: 100px" :preview-src-list="[url4]" :src="url4" |
|
|
|
<el-image style="width: 800px; height: 400px" :preview-src-list="[url4]" :src="url4" |
|
|
|
fit="scale-down" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<span>导入A4表</span> |
|
|
|
<span>扁平数字带T</span> |
|
|
|
</el-tooltip> |
|
|
|
</el-button> |
|
|
|
</el-upload> |
|
|
@ -86,14 +90,14 @@ |
|
|
|
<el-icon> |
|
|
|
<Upload /> |
|
|
|
</el-icon> |
|
|
|
<el-tooltip> |
|
|
|
<el-tooltip placement="bottom-end"> |
|
|
|
<template #content> |
|
|
|
<div> |
|
|
|
<el-image style="width: 100px; height: 100px" :preview-src-list="[url5]" :src="url5" |
|
|
|
<el-image style="width: 1200px; height: 400px" :preview-src-list="[url5]" :src="url5" |
|
|
|
fit="scale-down" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<span>导入A5表</span> |
|
|
|
<span>扁平纯数字</span> |
|
|
|
</el-tooltip> |
|
|
|
</el-button> |
|
|
|
</el-upload> |
|
|
@ -141,7 +145,8 @@ |
|
|
|
import _ from 'lodash' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import urla1 from "../assets/images/a1.png" |
|
|
|
import urla2 from "../assets/images/a2.png" |
|
|
|
import urla11 from "../assets/images/a11.jpg" |
|
|
|
import urla2 from "../assets/images/a2.jpg" |
|
|
|
import urla3 from "../assets/images/a3.png" |
|
|
|
import urla4 from "../assets/images/a4.png" |
|
|
|
import urla5 from "../assets/images/a5.png" |
|
|
@ -158,6 +163,7 @@ export default { |
|
|
|
return { |
|
|
|
_: _, |
|
|
|
url1: urla1, |
|
|
|
url11: urla11, |
|
|
|
url2: urla2, |
|
|
|
url3: urla3, |
|
|
|
url4: urla4, |
|
|
@ -558,7 +564,7 @@ export default { |
|
|
|
let tmt = ""//条码贴 |
|
|
|
for (let i = 0; i < this.otherChangeList.length; i++) { |
|
|
|
let element = this.otherChangeList[i]; |
|
|
|
if (element.value === "商店名称") { |
|
|
|
if (["商店名称", "商店"].includes(element.value)) { |
|
|
|
sdmc = element.key |
|
|
|
} else if (["店铺箱数", "箱数"].includes(element.value)) { |
|
|
|
xs = element.key |
|
|
@ -595,21 +601,21 @@ export default { |
|
|
|
let hasBarcodeIndex |
|
|
|
let noBarcodeIndex |
|
|
|
if (this.atype === "a1") { |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}, `) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}, `) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type}, `) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode) && _.trim(o.Barcode) === _.trim(firstItem[tmt])) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type}, `) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a2") { |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type} M`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode) && _.trim(o.Barcode) === _.trim(firstItem[tmt])) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type} M`) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a3") { |
|
|
|
let typeTemp = firstItem.type.replace(/([0-9])([a-zA-Z])/g, '$1 $2').replace(/([a-zA-Z])([0-9])/g, '$1 $2') |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(typeTemp)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(typeTemp)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode) && _.trim(o.Barcode) === _.trim(firstItem[tmt])) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(typeTemp)}`) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a4") { |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode) && _.trim(o.Barcode) === _.trim(firstItem[tmt])) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type}`) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a5") { |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
hasBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode) && _.trim(o.Barcode) === _.trim(firstItem[tmt])) |
|
|
|
noBarcodeIndex = _.findIndex(sheetData, o => o.Description.includes(`, ${firstItem.type}`) && Number(o.Store) === Number(firstItem[sdmc]) && !_.trim(o.Barcode)) |
|
|
|
} |
|
|
|
if (hasBarcodeIndex !== -1) { |
|
|
|
let hasBarcode = sheetData[hasBarcodeIndex] |
|
|
@ -618,24 +624,24 @@ export default { |
|
|
|
hasBarcode["Quantity of containers"] += Number(firstItem[xs]) |
|
|
|
hasBarcode["Quantity to deliver"] += firstItem[firstItem.typeKey] |
|
|
|
hasBarcode["Quantity per container"] = firstItem[firstItem.typeKey] |
|
|
|
hasBarcode["_ishas_"] = true |
|
|
|
let newItem = "" |
|
|
|
if (this.atype === "a1") { |
|
|
|
newItem = _.find(newData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}, `) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
newItem = _.find(newData, o => o.Description.includes(`, ${firstItem.type}, `) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a2") { |
|
|
|
newItem = _.find(newData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)} M`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
newItem = _.find(newData, o => o.Description.includes(`, ${firstItem.type} M`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a3") { |
|
|
|
let typeTemp = firstItem.type.replace(/([0-9])([a-zA-Z])/g, '$1 $2').replace(/([a-zA-Z])([0-9])/g, '$1 $2') |
|
|
|
newItem = _.find(newData, o => _.toLower(o.Description).includes(`, ${_.toLower(typeTemp)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a4") { |
|
|
|
newItem = _.find(newData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
newItem = _.find(newData, o => o.Description.includes(`, ${firstItem.type}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
} else if (this.atype === "a5") { |
|
|
|
newItem = _.find(newData, o => _.toLower(o.Description).includes(`, ${_.toLower(firstItem.type)}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
newItem = _.find(newData, o => o.Description.includes(`, ${firstItem.type}`) && Number(o.Store) === Number(firstItem[sdmc]) && _.trim(o.Barcode)) |
|
|
|
} |
|
|
|
if (newItem) { |
|
|
|
// 修改新添加的值 |
|
|
|
newItem["Quantity of containers"] += Number(firstItem[xs]) |
|
|
|
// newItem["Quantity to deliver"] += firstItem[firstItem.typeKey] |
|
|
|
// 再新增一条数据 |
|
|
|
} else { |
|
|
|
newData.push({ |
|
|
|
...hasBarcode, |
|
|
|
"Barcode": firstItem[tmt], |
|
|
@ -646,6 +652,7 @@ export default { |
|
|
|
} |
|
|
|
} else if (noBarcodeIndex !== -1) { |
|
|
|
let noBarcode = sheetData[noBarcodeIndex] |
|
|
|
noBarcode["_ishas_"] = true |
|
|
|
// 修改原有的值 |
|
|
|
noBarcode["Barcode"] = firstItem[tmt] |
|
|
|
noBarcode["Quantity of containers"] = Number(firstItem[xs]) |
|
|
@ -656,7 +663,9 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
this.fileData2 = _.cloneDeep(newData) |
|
|
|
let noData = _.filter(sheetData, o => !o._ishas_) |
|
|
|
console.log(662, noData, newData); |
|
|
|
this.fileData2 = _.cloneDeep(_.concat(newData, noData)) |
|
|
|
} catch (error) { |
|
|
|
ElMessage({ |
|
|
|
message: `表格处理出错:, ${error}`, |
|
|
|