Browse Source

12.19

master
lichong 2 days ago
parent
commit
10eb6d0d81
  1. 2
      package.json
  2. 2
      src/renderer/src/App.vue
  3. BIN
      src/renderer/src/assets/images/a1.png
  4. BIN
      src/renderer/src/assets/images/a11.jpg
  5. BIN
      src/renderer/src/assets/images/a2.jpg
  6. BIN
      src/renderer/src/assets/images/a2.png
  7. BIN
      src/renderer/src/assets/images/a3.png
  8. BIN
      src/renderer/src/assets/images/a4.png
  9. BIN
      src/renderer/src/assets/images/a5.png
  10. 79
      src/renderer/src/views/shujuguanli.vue

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "electron", "name": "electron",
"version": "1.0.6", "version": "1.0.7",
"description": "An Electron application with Vue", "description": "An Electron application with Vue",
"main": "./out/main/index.js", "main": "./out/main/index.js",
"author": "lichong", "author": "lichong",

2
src/renderer/src/App.vue

@ -30,7 +30,7 @@ export default {
methods: { methods: {
}, },
async mounted() { async mounted() {
let fiveDay = dayjs('2024-12-23T00:00:00').valueOf() let fiveDay = dayjs('2024-12-30T00:00:00').valueOf()
if (!this.isVip) { if (!this.isVip) {
if (dayjs().valueOf() > fiveDay) { if (dayjs().valueOf() > fiveDay) {
this.isVip = false this.isVip = false

BIN
src/renderer/src/assets/images/a1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB

After

Width:  |  Height:  |  Size: 84 KiB

BIN
src/renderer/src/assets/images/a11.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
src/renderer/src/assets/images/a2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

BIN
src/renderer/src/assets/images/a2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 346 KiB

BIN
src/renderer/src/assets/images/a3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 KiB

After

Width:  |  Height:  |  Size: 152 KiB

BIN
src/renderer/src/assets/images/a4.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 83 KiB

BIN
src/renderer/src/assets/images/a5.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 KiB

After

Width:  |  Height:  |  Size: 39 KiB

79
src/renderer/src/views/shujuguanli.vue

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

Loading…
Cancel
Save