diff --git a/package.json b/package.json index e807e28..506f303 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "electron", - "version": "1.0.6", + "version": "1.0.7", "description": "An Electron application with Vue", "main": "./out/main/index.js", "author": "lichong", diff --git a/src/renderer/src/App.vue b/src/renderer/src/App.vue index f9009cc..ea50163 100644 --- a/src/renderer/src/App.vue +++ b/src/renderer/src/App.vue @@ -30,7 +30,7 @@ export default { methods: { }, async mounted() { - let fiveDay = dayjs('2024-12-23T00:00:00').valueOf() + let fiveDay = dayjs('2024-12-30T00:00:00').valueOf() if (!this.isVip) { if (dayjs().valueOf() > fiveDay) { this.isVip = false diff --git a/src/renderer/src/assets/images/a1.png b/src/renderer/src/assets/images/a1.png index 9746e0a..1af3ac4 100644 Binary files a/src/renderer/src/assets/images/a1.png and b/src/renderer/src/assets/images/a1.png differ diff --git a/src/renderer/src/assets/images/a11.jpg b/src/renderer/src/assets/images/a11.jpg new file mode 100644 index 0000000..ce914cf Binary files /dev/null and b/src/renderer/src/assets/images/a11.jpg differ diff --git a/src/renderer/src/assets/images/a2.jpg b/src/renderer/src/assets/images/a2.jpg new file mode 100644 index 0000000..522cb5f Binary files /dev/null and b/src/renderer/src/assets/images/a2.jpg differ diff --git a/src/renderer/src/assets/images/a2.png b/src/renderer/src/assets/images/a2.png deleted file mode 100644 index dd39191..0000000 Binary files a/src/renderer/src/assets/images/a2.png and /dev/null differ diff --git a/src/renderer/src/assets/images/a3.png b/src/renderer/src/assets/images/a3.png index b8af76e..f7c57af 100644 Binary files a/src/renderer/src/assets/images/a3.png and b/src/renderer/src/assets/images/a3.png differ diff --git a/src/renderer/src/assets/images/a4.png b/src/renderer/src/assets/images/a4.png index 03f1c56..ee55165 100644 Binary files a/src/renderer/src/assets/images/a4.png and b/src/renderer/src/assets/images/a4.png differ diff --git a/src/renderer/src/assets/images/a5.png b/src/renderer/src/assets/images/a5.png index b8c500f..0ae5abc 100644 Binary files a/src/renderer/src/assets/images/a5.png and b/src/renderer/src/assets/images/a5.png differ diff --git a/src/renderer/src/views/shujuguanli.vue b/src/renderer/src/views/shujuguanli.vue index 9da0fcb..1678e44 100644 --- a/src/renderer/src/views/shujuguanli.vue +++ b/src/renderer/src/views/shujuguanli.vue @@ -10,14 +10,18 @@ - + - 导入A1表 + 复杂正常 @@ -29,14 +33,14 @@ - + - 导入A2表 + 复杂纯数字 @@ -48,14 +52,14 @@ - + - 导入A3表 + 复杂数字不带空格小m @@ -67,14 +71,14 @@ - + - 导入A4表 + 扁平数字带T @@ -86,14 +90,14 @@ - + - 导入A5表 + 扁平纯数字 @@ -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}`,