From 0808f42ce709529b98462a98ec9cd669a7931fbd Mon Sep 17 00:00:00 2001 From: liushiwei <499672082@qq.com> Date: Thu, 18 Jul 2024 14:48:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + public/js/temuSeller.js | 274 ++++++++ public/js/temuSellerContent.js | 8 + src/components/AiCopyFromTemu.vue | 3 +- src/entry/content.js | 1 + src/manifest.development.json | 12 + src/manifest.production.json | 14 +- src/router/index.js | 10 + src/utils/product.js | 12 +- src/view/Home.vue | 2 + src/view/PriceFollow.vue | 13 +- src/view/Welcome.vue | 266 +++++++- src/view/login/Register.vue | 5 +- src/view/product/CopyProduct.vue | 2 + src/view/product/ProductList.vue | 3 +- src/view/sale/AfterSaleDeductStat.vue | 19 - src/view/sale/AfterSaleStat.vue | 25 +- src/view/sale/CostManageTemu.vue | 1 + src/view/sale/ExportSaleData.vue | 4 +- src/view/sale/ExportSaleOutData.vue | 3 +- src/view/sale/ExportSaleStatTemu.vue | 888 +++++++++++++++++++++++++ src/view/shein/CertCenterShein.vue | 204 +++++- src/view/shein/CopyProductShein.vue | 13 +- src/view/shein/CostManageShein.vue | 16 +- src/view/shein/ExportSaleDataShein.vue | 6 +- src/view/shein/ExportSaleStatShein.vue | 12 +- src/view/shipping/MyNormalOrder.vue | 245 +++++-- src/view/shipping/MyUrgencyOrder.vue | 150 ++++- src/view/shipping/NormalSendGoods.vue | 19 +- src/view/shipping/ProductLabel.vue | 237 +++++++ src/view/shipping/ShippingDesk.vue | 1 + src/view/shipping/WaitCreate.vue | 1 + src/view/shipping/WaitPackageList.vue | 1 + src/view/shipping/WaitShippingList.vue | 1 + src/view/stock/ReturnDetail.vue | 101 ++- src/view/stock/ReturnPackage.vue | 2 +- yarn.lock | 39 ++ 37 files changed, 2456 insertions(+), 158 deletions(-) create mode 100644 public/js/temuSeller.js create mode 100644 public/js/temuSellerContent.js create mode 100644 src/view/sale/ExportSaleStatTemu.vue create mode 100644 src/view/shipping/ProductLabel.vue diff --git a/package.json b/package.json index dc30477..397afd1 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "dependencies": { "@antv/g2plot": "^2.4.25", "axios": "^1.4.0", + "bi-vue-mindmap": "^0.6.12", "core-js": "^3.8.3", "crypto-js": "^4.0.0", "dayjs": "^1.11.9", diff --git a/public/js/temuSeller.js b/public/js/temuSeller.js new file mode 100644 index 0000000..1ccfa80 --- /dev/null +++ b/public/js/temuSeller.js @@ -0,0 +1,274 @@ +function matchTemuDomain(url) { + const urlPattern = /https:\/\/([\da-z\.-]+)\.kuajingmaihuo\.com\// + return urlPattern.test(url); +} + +function init() { + if (matchTemuDomain(window.location.href)) { + let j = 0 + let timer = setInterval(() => { + let models = document.querySelectorAll('div[class^="MDL_header"]') + let flag = false + for (let i = 0; i < models.length; i++) { + if (models[i].textContent.includes("商品降价提醒") || models[i].textContent.includes("降价,提升竞争力,避免限制备货")) { + const popup = document.createElement("div") + popup.innerText = "拒绝调价" + const styles = { + padding: "8px", + background: "#fb7701", + color: "#fff", + display: 'inline', + borderRadius: "8px", + cursor: "pointer" + } + for (const e in styles) { + popup.style[e] = styles[e] + } + models[i].appendChild(popup) + popup.addEventListener('click', async () => { + let tbodyObj = models[i].parentElement.querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let firstLabelObj = tdObj.querySelector('div label:first-child') + if (firstLabelObj.getAttribute("data-checked")) { + let labelObj = tdObj.querySelector('div label:nth-child(2)') + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + // await sleepSync(50) + radioObj.click() + } + } + }) + flag = true + } + } + + let models2 = document.querySelectorAll('div[class^="price-adjust-confirm-system_contentWrp"]') + for (let i = 0; i < models2.length; i++) { + let tipsObj = models2[i].querySelector('div[class^="price-adjust-confirm-system_tips"]') + let spanObj = tipsObj.querySelector('div span:last-child') + if (spanObj) { + const popup = document.createElement("div") + popup.innerText = "拒绝调价" + const styles = { + padding: "8px", + background: "#fb7701", + color: "#fff", + display: 'inline', + borderRadius: "8px", + cursor: "pointer" + } + for (const e in styles) { + popup.style[e] = styles[e] + } + spanObj.appendChild(popup) + + popup.addEventListener('click', async () => { + let tbodyObj = models2[i].querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let firstLabelObj = tdObj.querySelector('div label:first-child') + if (firstLabelObj.getAttribute("data-checked")) { + let labelObj = tdObj.querySelector('div label:nth-child(2)') + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + // await sleepSync(50) + radioObj.click() + } + } + }) + flag = true + } + } + + let models3 = document.querySelectorAll('div[class^="price-adjust-confirm-new_content"]') + for (let i = 0; i < models3.length; i++) { + let tipsObj = models3[i].querySelector('div[class^="price-adjust-confirm-new_tips"]') + let spanObj = tipsObj.querySelector('div span:last-child') + if (spanObj) { + const popup = document.createElement("div") + popup.innerText = "拒绝调价" + const styles = { + padding: "8px", + background: "#fb7701", + color: "#fff", + display: 'inline', + borderRadius: "8px", + cursor: "pointer" + } + for (const e in styles) { + popup.style[e] = styles[e] + } + spanObj.appendChild(popup) + + popup.addEventListener('click', async () => { + let tbodyObj = models3[i].querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let firstLabelObj = tdObj.querySelector('div label:first-child') + if (firstLabelObj.getAttribute("data-checked")) { + let labelObj = tdObj.querySelector('div label:nth-child(2)') + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + // await sleepSync(50) + radioObj.click() + } + } + }) + flag = true + } + } + + let models4 = document.querySelectorAll('div[class^="price-adjust-confirm-system-old_contentWrp"]') + for (let i = 0; i < models4.length; i++) { + let tipsObj = models4[i].querySelector('div[class^="price-adjust-confirm-system-old_tips"]') + let spanObj = tipsObj.querySelector('div span:last-child') + if (spanObj) { + const popup = document.createElement("div") + popup.innerText = "拒绝调价" + const styles = { + padding: "8px", + background: "#fb7701", + color: "#fff", + display: 'inline', + borderRadius: "8px", + cursor: "pointer" + } + for (const e in styles) { + popup.style[e] = styles[e] + } + spanObj.appendChild(popup) + + popup.addEventListener('click', async () => { + let tbodyObj = models4[i].querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let firstLabelObj = tdObj.querySelector('div label:first-child') + if (firstLabelObj.getAttribute("data-checked")) { + let labelObj = tdObj.querySelector('div label:nth-child(2)') + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + // await sleepSync(50) + radioObj.click() + } + } + }) + flag = true + } + } + + let models5 = document.querySelectorAll('div[class^="new-price-adjust-confirm_content"]') + for (let i = 0; i < models5.length; i++) { + let tipsObj = models5[i].querySelector('div[class^="new-price-adjust-confirm_tips"]') + let spanObj = tipsObj.querySelector('div span:last-child') + if (spanObj) { + const popup = document.createElement("div") + popup.innerText = "拒绝调价" + const styles = { + padding: "8px", + background: "#fb7701", + color: "#fff", + display: 'inline', + borderRadius: "8px", + cursor: "pointer" + } + for (const e in styles) { + popup.style[e] = styles[e] + } + spanObj.appendChild(popup) + + popup.addEventListener('click', async () => { + let tbodyObj = models5[i].querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let firstLabelObj = tdObj.querySelector('div label:first-child') + if (firstLabelObj.getAttribute("data-checked")) { + let labelObj = tdObj.querySelector('div label:nth-child(2)') + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + // await sleepSync(50) + radioObj.click() + } + } + }) + flag = true + } + } + if (flag) { + clearInterval(timer) + } else { + j++ + if (j == 10) { + clearInterval(timer) + } + } + }, 3000) + + // document.body.appendChild(popup) + } +} +/* +function createElement() { + const popup = document.createElement("div") + popup.innerText = "拒绝调价" + const styles = { + position: "fixed", + right: '10px', + top: '60px', + zIndex: 999999, + padding: "8px", + background: "#409EFF", + color: "#fff", + borderRadius: "8px", + cursor: "pointer" + } + for (const e in styles) { + popup.style[e] = styles[e] + } + popup.addEventListener('click', async () => { + let divObj1 = document.querySelector('div[class^="price-adjust-confirm-system_contentWrp"]') + if (divObj1) { + let tbodyObj = divObj1.querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let labelObj = tdObj.querySelector('div label:last-child') + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + // await sleepSync(50) + radioObj.click() + } + } + let divObj2 = document.querySelector('div[class^="price-adjust-confirm_header"]') + if (divObj2) { + let divObj = divObj2.nextElementSibling + let tbodyObj = divObj.querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let labelObj = tdObj.querySelector('div label:last-child') + //let radioObj = labelObj.querySelector("[type='radio']") + // await sleepSync(50) + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + radioObj.click() + } + } + let divObj3 = document.querySelector('div[class^="price-adjust-confirm-new_banner"]') + if (divObj3) { + let divObj = divObj3.nextElementSibling + let tbodyObj = divObj.querySelector('tbody') + let trList = tbodyObj.querySelectorAll('tr') + for (let i = 0; i < trList.length; i++) { + let tdObj = trList[i].querySelector('td:last-child') + let labelObj = tdObj.querySelector('div label:last-child') + //let radioObj = labelObj.querySelector("[type='radio']") + // await sleepSync(50) + let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]') + radioObj.click() + } + } + }) + + return popup +} +*/ +init() \ No newline at end of file diff --git a/public/js/temuSellerContent.js b/public/js/temuSellerContent.js new file mode 100644 index 0000000..5707ee3 --- /dev/null +++ b/public/js/temuSellerContent.js @@ -0,0 +1,8 @@ +function injectScript(file, node) { + var th = document.getElementsByTagName(node)[0]; + var s = document.createElement('script'); + s.setAttribute('type', 'text/javascript'); + s.setAttribute('src', file); + th.appendChild(s); +} +injectScript( chrome.runtime.getURL('/js/temuSeller.js'), 'body'); diff --git a/src/components/AiCopyFromTemu.vue b/src/components/AiCopyFromTemu.vue index cdba9a2..5e20e2b 100644 --- a/src/components/AiCopyFromTemu.vue +++ b/src/components/AiCopyFromTemu.vue @@ -426,13 +426,14 @@ export default { content['cat' + (i+1) + 'Id'] = this.form.targetCatId[i] } } - if (content['cat'+(i+1)+'Id'] != reqData.catId) { + if (content['cat'+(i)+'Id'] != reqData.catId) { content['cat'+(++i)+'Id'] = reqData.catId } for (; i < 10; i++) { content['cat' + (i+1) + 'Id'] = '' } + content.personalizationSwitch = 0 content.productDraftId = draftId this.createProduct(content) diff --git a/src/entry/content.js b/src/entry/content.js index 82e1373..5ad02c8 100644 --- a/src/entry/content.js +++ b/src/entry/content.js @@ -8,3 +8,4 @@ function injectScript(file, node) { injectScript( chrome.runtime.getURL('/js/jszip.min.js'), 'body'); injectScript( chrome.runtime.getURL('/js/FileSaver.js'), 'body'); injectScript( chrome.runtime.getURL('/js/download.js'), 'body'); +injectScript( chrome.runtime.getURL('/js/temuSeller.js'), 'body'); diff --git a/src/manifest.development.json b/src/manifest.development.json index 9788813..e4ec88e 100644 --- a/src/manifest.development.json +++ b/src/manifest.development.json @@ -76,12 +76,24 @@ "js": [ "/content.js" ] + }, + { + "matches": [ + "*://*.kuajingmaihuo.com/*" + ], + "js": [ + "/js/temuSellerContent.js" + ] } ], "web_accessible_resources": [ { "resources": [ "js/download.js","js/jszip.min.js","js/FileSaver.js" ], "matches": [ "*://*.aliexpress.com/*", "*://*.amazon.com/*", "*://*.shein.com/*" ] + }, + { + "resources": [ "js/temuSeller.js" ], + "matches": [ "*://*.kuajingmaihuo.com/*" ] } ] } diff --git a/src/manifest.production.json b/src/manifest.production.json index 7299469..58bd0bc 100644 --- a/src/manifest.production.json +++ b/src/manifest.production.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "TEMU助手", "description": "TEMU助手 - 自动化提高生产效率", - "version": "3.2.3", + "version": "3.2.8", "background": { "service_worker": "/background.js" }, @@ -80,12 +80,24 @@ "js": [ "/content.js" ] + }, + { + "matches": [ + "*://*.kuajingmaihuo.com/*" + ], + "js": [ + "/js/temuSellerContent.js" + ] } ], "web_accessible_resources": [ { "resources": [ "js/download.js","js/jszip.min.js","js/FileSaver.js" ], "matches": [ "*://*.aliexpress.com/*", "*://*.amazon.com/*", "*://*.shein.com/*" ] + }, + { + "resources": [ "js/temuSeller.js" ], + "matches": [ "*://*.kuajingmaihuo.com/*" ] } ] } diff --git a/src/router/index.js b/src/router/index.js index c4accf1..ec7ce2e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -65,6 +65,11 @@ const router = new VueRouter({ name: 'myUrgencyOrder', component: () => import('../view/shipping/MyUrgencyOrder.vue') }, + { + path: 'productLabel', + name: 'productLabel', + component: () => import('../view/shipping/ProductLabel.vue') + }, { path: 'returnPackage', name: 'returnPackage', @@ -202,6 +207,11 @@ const router = new VueRouter({ name: 'afterSaleDeductStat', component: () => import('../view/sale/AfterSaleDeductStat.vue') }, + { + path: 'saleStatTemu', + name: 'saleStatTemu', + component: () => import('../view/sale/ExportSaleStatTemu.vue') + }, { path: 'costManageShein', name: 'costManageShein', diff --git a/src/utils/product.js b/src/utils/product.js index 9a2e6f6..30bddbd 100644 --- a/src/utils/product.js +++ b/src/utils/product.js @@ -135,6 +135,7 @@ export function transform(leftData) { countryShortName: leftData.productWhExtAttr.productOrigin ? leftData.productWhExtAttr.productOrigin.countryShortName: 'CN' } }; + rightData.personalizationSwitch = leftData.productWhExtAttr.personalizationSwitch || "0" rightData.productCarouseVideoReqList = leftData.carouseVideoVOList; rightData.goodsAdvantageLabelTypes = leftData.goodsAdvantageLabelVOList; rightData.productDetailVideoReqList = leftData.detailVideoVOList; @@ -297,6 +298,7 @@ export function transformSubmitForHalf(leftData, config, draftId) { countryShortName: leftData.productWhExtAttr.productOrigin ? leftData.productWhExtAttr.productOrigin.countryShortName: 'CN' } }; + rightData.personalizationSwitch = leftData.productWhExtAttr.personalizationSwitch || 0 rightData.productCarouseVideoReqList = leftData.carouseVideoVOList; rightData.goodsAdvantageLabelTypes = leftData.goodsAdvantageLabelVOList; rightData.productDetailVideoReqList = leftData.detailVideoVOList; @@ -323,14 +325,20 @@ export function transformSubmitForHalf(leftData, config, draftId) { freightTemplateId: config.freightTemplateId, shipmentLimitSecond: config.sendGoodsSecond } + let bindSiteIds = [] + if (leftData.productSaleExtAttr?.productSemiManaged?.bindSites) { + leftData.productSaleExtAttr?.productSemiManaged?.bindSites.map(ii => { + bindSiteIds.push(ii.siteId) + }) + } rightData.productSemiManagedReq = { - bindSiteIds: config.siteList + bindSiteIds: bindSiteIds } let targetRouteList = [] for (let m = 0; m < config.wareHouseList.length; m++) { targetRouteList.push({ warehouseId: config.wareHouseList[m], - siteIdList: config.siteList + siteIdList: bindSiteIds }) } rightData.productWarehouseRouteReq = { diff --git a/src/view/Home.vue b/src/view/Home.vue index fb6d18a..8defa4e 100644 --- a/src/view/Home.vue +++ b/src/view/Home.vue @@ -61,6 +61,7 @@ 已收货发货单 普通备货单 紧急备货单 + 商品条码管理 @@ -131,6 +132,7 @@ 成本管理 销售管理 + 销售统计 售罄看板 售后统计 售后赔付统计 diff --git a/src/view/PriceFollow.vue b/src/view/PriceFollow.vue index 661ed08..675915d 100644 --- a/src/view/PriceFollow.vue +++ b/src/view/PriceFollow.vue @@ -106,6 +106,7 @@ productName: item.productName, skcId: item.skcId, popUpType: 1, + createTime: res.result.createTime, versionId: res.result.popUpAutoPass12.versionId, newSupplyPrice: item.newSupplyPrice / 100, } @@ -119,6 +120,7 @@ productName: item.productName, skcId: item.skcId, popUpType: 2, + createTime: res.result.createTime, versionId: res.result.popUpAutoPass24.versionId, newSupplyPrice: item.newSupplyPrice / 100, } @@ -132,6 +134,7 @@ productName: item.productName, skcId: item.skcId, popUpType: 3, + createTime: res.result.createTime, versionId: res.result.popUpOthers.versionId, newSupplyPrice: item.newSupplyPrice / 100, } @@ -166,10 +169,12 @@ let popUpType1VersionId = '' let popUpType2VersionId = '' let popUpType3VersionId = '' + let createTime = null let ids = [] this.priceList.map(item => { if (item.popUpType == 1) { popUpType1VersionId = item.versionId + createTime = item.createTime ids.push(item.id) } }) @@ -183,12 +188,13 @@ "rejectOrderIdList": ids, "maxOrderId": popUpType1VersionId, "popUpType": 1, - "createTime": new Date().getTime() + "createTime": createTime }}) } ids = [] this.priceList.map(item => { if (item.popUpType == 2) { + createTime = item.createTime popUpType2VersionId = item.versionId ids.push(item.id) } @@ -202,12 +208,13 @@ "rejectOrderIdList": ids, "maxOrderId": popUpType2VersionId, "popUpType": 2, - "createTime": new Date().getTime() + "createTime": createTime }}) } ids = [] this.priceList.map(item => { if (item.popUpType == 3) { + createTime = item.createTime popUpType3VersionId = item.versionId ids.push(item.id) } @@ -221,7 +228,7 @@ "rejectOrderIdList": ids, "maxOrderId": popUpType3VersionId, "popUpType": 3, - "createTime": new Date().getTime() + "createTime": createTime }}) } if (res.success && res.errorCode == 1000000) { diff --git a/src/view/Welcome.vue b/src/view/Welcome.vue index 9295fdb..a277dc8 100644 --- a/src/view/Welcome.vue +++ b/src/view/Welcome.vue @@ -32,9 +32,12 @@ - -
- dsad + + +
+
diff --git a/src/view/sale/AfterSaleStat.vue b/src/view/sale/AfterSaleStat.vue index 6469b2e..db94e34 100644 --- a/src/view/sale/AfterSaleStat.vue +++ b/src/view/sale/AfterSaleStat.vue @@ -3,6 +3,7 @@ + + + + +
@@ -98,8 +119,18 @@ import { Message } from 'element-ui' { prop: 'orderTypeDesc', label: '退货原因',width: '220px', align: 'left' }, { prop: 'packageSn', label: '退货包裹号', width: '200px',align: 'left' }, { prop: 'quantity', label: 'SKU件数',width: '100px', }, + { prop: 'cost', label: '成本单价' }, { prop: 'outboundTime', label: '出库时间', width: '160px'} ], + sumColConfigs: [ + { prop: 'productSkcId', label: 'SKC', align: 'left', fixed: 'left' }, + { prop: 'productSkuId', label: 'SKU', align: 'left', fixed: 'left' }, + { prop: 'skuExtCode', label: 'SKU属性', align: 'left', fixed: 'left' }, + { prop: 'secondarySaleSpec', label: '属性集', align: 'left', fixed: 'left' }, + { prop: 'quantity', label: 'SKU总件数', sortable: true, 'sort-method': (a, b) => a.quantity - b.quantity }, + { prop: 'costPrice', label: '成本价', sortable: true, 'sort-method': (a, b) => a.costPrice - b.costPrice}, + { prop: 'costAmount', label: '成本总额', sortable: true, 'sort-method': (a, b) => a.costAmount - b.costAmount} + ], jsonFields: { "SPU": "productSpuId", "SKC": "productSkcId", @@ -112,8 +143,19 @@ import { Message } from 'element-ui' "退货原因": "orderTypeDesc", "退货包裹号": "packageSn", "SKU件数": "quantity", + "成本单价": "cost", "出库时间": "outboundTime" }, + sumJsonFields: { + "SKC": "productSkcId", + "SKU": "productSkuId", + "SKU属性": "skuExtCode", + "图片地址": "thumbUrl", + "属性集": "secondarySaleSpec", + "SKU总件数": "quantity", + "成本价": "costPrice", + "成本总额": "costAmount" + }, form: { mallId: '', date: '' @@ -122,6 +164,8 @@ import { Message } from 'element-ui' pageSize: 100, tableData: [], + sumTableData: [], + costList: [], total: 0, search: { current: 1, @@ -163,6 +207,7 @@ import { Message } from 'element-ui' } this.currentPage = 1 this.tableData = [] + this.sumTableData = [] let startTime = this.form.date[1].getTime() - 30 * 24 * 60 * 60 * 1000 if (startTime < this.form.date[0].getTime()) { @@ -196,6 +241,7 @@ import { Message } from 'element-ui' data.packageSn = item.packageSn data.quantity = item.quantity data.outboundTime = timestampToTime(item.outboundTime) + data.cost = null this.tableData.push(data) } @@ -215,7 +261,8 @@ import { Message } from 'element-ui' this.getList(startTimeTemp, endTimeTemp) } else { this.getDeliverySn(1) - this.getSkuExtCode(1) + + this.getSkuCostList() this.isLoading = false } } @@ -288,6 +335,58 @@ import { Message } from 'element-ui' await getSkuExtCode(pageNo + 1) } }, + calcAmount() { + this.tableData.map(item => { + for (let i = 0; i < this.costList.length; i++) { + if (item.productSkuId == this.costList[i].sku) { + item.cost = this.costList[i].costPrice + break + } + } + + let flag = false + for (let i = 0; i < this.sumTableData.length; i++) { + if (item.productSkuId == this.sumTableData[i].productSkuId) { + this.sumTableData[i].quantity += item.quantity + flag = true + break + } + } + if (!flag) { + this.sumTableData.push({ + productSkcId: item.productSkcId, + productSkuId: item.productSkuId, + skuExtCode: item.skuExtCode, + secondarySaleSpec: item.secondarySaleSpec, + thumbUrl: item.thumbUrl, + quantity: item.quantity, + costPrice: null, + costAmount: null + }) + } + }) + this.sumTableData.map(item => { + for (let i = 0; i < this.costList.length; i++) { + if (this.costList[i].sku == item.productSkuId) { + item.costPrice = this.costList[i].costPrice + item.costAmount = Math.round(this.costList[i].costPrice * item.quantity * 100) / 100 + break + } + } + }) + }, + async getSkuCostList() { + await this.getSkuExtCode(1) + let res = await this.$http.post(`/api/skuCost/listAll`, null, { + params: { + mallId: this.form.mallId + } + }) + if (res.code == 0) { + this.costList = res.data + this.calcAmount() + } + }, startDownload() { this.$http.post('/api/malluser/info').then(res => { if (res.code == 0) { diff --git a/src/view/stock/ReturnPackage.vue b/src/view/stock/ReturnPackage.vue index 2abd08d..fb34182 100644 --- a/src/view/stock/ReturnPackage.vue +++ b/src/view/stock/ReturnPackage.vue @@ -54,7 +54,7 @@ :tableData="tableData" :col-configs="colConfigs" :total="total" - height="500" + height="700" style="margin-top: 8px;" @getList="getList"> diff --git a/yarn.lock b/yarn.lock index efac6ff..5736183 100644 --- a/yarn.lock +++ b/yarn.lock @@ -492,6 +492,11 @@ resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.10.tgz" integrity sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ== +"@babel/parser@^7.23.5": + version "7.24.8" + resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.8.tgz#58a4dbbcad7eb1d48930524a3fd93d93e9084c6f" + integrity sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": version "7.22.5" resolved "https://registry.npmmirror.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz" @@ -1848,6 +1853,17 @@ postcss "^8.4.14" source-map "^0.6.1" +"@vue/compiler-sfc@2.7.16": + version "2.7.16" + resolved "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.16.tgz#ff81711a0fac9c68683d8bb00b63f857de77dc83" + integrity sha512-KWhJ9k5nXuNtygPU7+t1rX6baZeqOYLEforUPjgNDBnLicfHCoi48H87Q8XyLZOrNNsmhuwKqtpDQWjEFe6Ekg== + dependencies: + "@babel/parser" "^7.23.5" + postcss "^8.4.14" + source-map "^0.6.1" + optionalDependencies: + prettier "^1.18.2 || ^2.0.0" + "@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.3.0": version "3.3.0" resolved "https://registry.npmmirror.com/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz" @@ -2378,6 +2394,16 @@ batch@0.6.1: resolved "https://registry.npmmirror.com/batch/-/batch-0.6.1.tgz" integrity sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw== +bi-vue-mindmap@^0.6.12: + version "0.6.12" + resolved "https://registry.npmmirror.com/bi-vue-mindmap/-/bi-vue-mindmap-0.6.12.tgz#092202bd224ed49dd133a1c6490fe7330848a280" + integrity sha512-cKfKB5rm3L+391iV9RPkfC8lIKx9xAhW6shpGnXHPwZcboIpW+ZjPpq2vaJ0qlXH96i4VMW2Xk6StBMVRQ2GDw== + dependencies: + core-js "^3.6.5" + vue "^2.6.11" + vue-router "^3.2.0" + vuex "^3.4.0" + big.js@^5.2.2: version "5.2.2" resolved "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz" @@ -2955,6 +2981,11 @@ core-js@^2.4.0: resolved "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== +core-js@^3.6.5: + version "3.37.1" + resolved "https://registry.npmmirror.com/core-js/-/core-js-3.37.1.tgz#d21751ddb756518ac5a00e4d66499df981a62db9" + integrity sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw== + core-js@^3.8.3: version "3.32.0" resolved "https://registry.npmmirror.com/core-js/-/core-js-3.32.0.tgz" @@ -7536,6 +7567,14 @@ vue-template-es2015-compiler@^1.9.0: resolved "https://registry.npmmirror.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz" integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw== +vue@^2.6.11: + version "2.7.16" + resolved "https://registry.npmmirror.com/vue/-/vue-2.7.16.tgz#98c60de9def99c0e3da8dae59b304ead43b967c9" + integrity sha512-4gCtFXaAA3zYZdTp5s4Hl2sozuySsgz4jy1EnpBHNfpMa9dK1ZCG7viqBPCwXtmgc8nHqUsAu3G4gtmXkkY3Sw== + dependencies: + "@vue/compiler-sfc" "2.7.16" + csstype "^3.1.0" + vue@^2.6.14: version "2.7.14" resolved "https://registry.npmmirror.com/vue/-/vue-2.7.14.tgz"