diff --git a/src/entry/background.js b/src/entry/background.js index 3938a6c..b41b85d 100644 --- a/src/entry/background.js +++ b/src/entry/background.js @@ -55,7 +55,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { headers['Content-Type'] = 'application/json'; data = JSON.stringify(request.data) } else { - console.log(request.data) const formData = new FormData(); Object.keys(request.data).forEach(key => { const value = request.data[key] diff --git a/src/manifest.development.json b/src/manifest.development.json index 0d9ed90..98c2b57 100644 --- a/src/manifest.development.json +++ b/src/manifest.development.json @@ -34,7 +34,8 @@ "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "declarativeNetRequestFeedback", - "activeTab" + "activeTab", + "fileSystemProvider" ], "declarative_net_request": { "rule_resources": [{ diff --git a/src/manifest.production.json b/src/manifest.production.json index 61ad9a9..8149555 100644 --- a/src/manifest.production.json +++ b/src/manifest.production.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "TEMU助手", "description": "TEMU助手 - 自动化提高生产效率", - "version": "3.3.0", + "version": "3.3.1", "background": { "service_worker": "/background.js" }, @@ -33,7 +33,8 @@ "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "declarativeNetRequestFeedback", - "activeTab" + "activeTab", + "fileSystemProvider" ], "declarative_net_request": { "rule_resources": [{ diff --git a/src/router/index.js b/src/router/index.js index 6ffd597..b2ab0b9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -110,6 +110,11 @@ const router = new VueRouter({ name: 'copyProductAliExpress', component: () => import('../view/product/CopyProductAliExpress.vue') }, + { + path: 'batchUpload', + name: 'batchUpload', + component: () => import('../view/product/BatchUpload.vue') + }, { path: 'niubiCopy', name: 'niubiCopy', @@ -222,6 +227,11 @@ const router = new VueRouter({ name: 'logisticFee', component: () => import('../view/sale/LogisticFee.vue') }, + { + path: 'billStat', + name: 'billStat', + component: () => import('../view/sale/ExportBillStatTemu.vue') + }, { path: 'costManageShein', name: 'costManageShein', @@ -272,6 +282,11 @@ const router = new VueRouter({ name: 'purchaseOrderListShein', component: () => import('../view/shein/PurchaseOrderListShein.vue') }, + { + path: 'syncDataTemu', + name: 'syncDataTemu', + component: () => import('../view/data/SyncDataTemu.vue') + }, // { // path: 'statistics', @@ -313,6 +328,14 @@ const router = new VueRouter({ title: '注册' }, component: () => import('../view/login/Register.vue') + }, + { + path: '/forget', + name: 'forget', + meta: { + title: '注册' + }, + component: () => import('../view/login/Forget.vue') } ], scrollBehavior (to, from, savedPosition) { diff --git a/src/utils/image.js b/src/utils/image.js index d7d2d50..ae4a5d0 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -19,8 +19,29 @@ export function getImageMd5(imageUrl) { }); } -export async function uploadImage(folderId, imageUrl, mallId) { - let res1 = await getImageMd5(imageUrl) +export function getImageMd5Local(file) { + return new Promise((resolve) => { + var reader = new FileReader() + // 读取Blob对象的内容 + reader.onloadend = function () { + /*const spark = new SparkMd5.ArrayBuffer() + console.log(reader.result) + spark.append(reader.result);*/ + const md5 = SparkMd5.hash(reader.result) + resolve({md5, fileName: file.name}); + }; + reader.readAsDataURL(file); + }) +} + +export async function uploadImage(folderId, imageUrl, mallId, local = false) { + let res1 + if (local) { + res1 = await getImageMd5Local(imageUrl) + imageUrl = URL.createObjectURL(imageUrl) + } else { + res1 = await getImageMd5(imageUrl) + } let detailList = [] detailList.push({ materialMd5: res1.md5, @@ -35,6 +56,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { createDetailList: detailList, folderId: folderId }}) + await sleepSync(200) if (res2.success) { if (res2.result.responseDetailList[0].alreadyExists) { @@ -48,6 +70,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { bucket_tag: "product-material-tag" } }) + await sleepSync(200) let res4 = await sendChromeAPIMessage({ url: 'https://file.kuajingmaihuo.com/api/galerie/v3/store_image?sdk_version=js-0.0.16-alpha.0&tag_name=product-material-tag', @@ -58,6 +81,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { upload_sign: res3.result.signature } }) + await sleepSync(200) let res5 = await sendChromeAPIMessage({ url: 'marvel-mms/cn/api/kiana/gmp/bg/phoenix/api/material/edit', @@ -76,3 +100,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { } } + +function sleepSync(milliseconds) { + return new Promise(resolve => setTimeout(resolve, milliseconds)); +} \ No newline at end of file diff --git a/src/utils/product.js b/src/utils/product.js index 30bddbd..99a5bc9 100644 --- a/src/utils/product.js +++ b/src/utils/product.js @@ -26,7 +26,8 @@ export function transform(leftData) { propName: leftData.productPropertyList[i].propName, refPid: leftData.productPropertyList[i].refPid, vid: leftData.productPropertyList[i].vid, - controlType: 1, + controlType: leftData.productPropertyList[i].controlType || 1, + numberInputValue: leftData.productPropertyList[i].numberInputValue || "", pid: leftData.productPropertyList[i].pid, templatePid: leftData.productPropertyList[i].templatePid, valueExtendInfo: leftData.productPropertyList[i].valueExtendInfo @@ -65,7 +66,7 @@ export function transform(leftData) { rightSkcItem.previewImgUrls = leftSkc[i].previewImgUrls; rightSkcItem.productSkcCarouselImageI18nReqs = leftSkc[i].productSkcCarouselImageI18nVOList; rightSkcItem.extCode = leftSkc[i].extCode; - rightSkcItem.mainProductSkuSpecReqs = [ + rightSkcItem.mainProductSkuSpecReqs = leftSkc[i].mainProductSkuSpec || [ { "parentSpecId": 0, "parentSpecName": "", @@ -83,6 +84,12 @@ export function transform(leftData) { rightSkuItem.extCode = leftSkuItem.extCode; rightSkuItem.supplierPrice = leftSkuItem.supplierPrice; rightSkuItem.currencyType = leftSkuItem.currencyType; + rightSkuItem.productSkuSuggestedPriceReq = leftSkuItem.productSkuSuggestedPrice; + rightSkuItem.productSkuMultiPackReq = leftSkuItem.productSkuMultiPack; + if (rightSkuItem.productSkuMultiPackReq) { + delete rightSkuItem.productSkuMultiPackReq.productSkuNetContent + } + rightSkuItem.productSkuMultiPackReq.productSkuNetContentReq = {} rightSkuItem.productSkuSpecReqs = leftSkuItem.productSkuSpecList; productSpecPropertyReqs.push({ "parentSpecId": leftSkuItem.productSkuSpecList[0].parentSpecId, @@ -127,6 +134,7 @@ export function transform(leftData) { rightData.materialImgUrl = leftData.materialImgUrl; rightData.goodsLayerDecorationReqs = leftData.goodsLayerDecorationVOList; rightData.sizeTemplateIds = !leftData.sizeTemplateIds ? []: leftData.sizeTemplateIds; + rightData.sizeTemplateId = leftData.sizeTemplateId || 0; rightData.showSizeTemplateIds = !leftData.showSizeTemplateIds ? []: leftData.showSizeTemplateIds; rightData.goodsModelReqs = !leftData.goodsModelList ? []: leftData.goodsModelList; rightData.productWhExtAttrReq = { @@ -139,6 +147,9 @@ export function transform(leftData) { rightData.productCarouseVideoReqList = leftData.carouseVideoVOList; rightData.goodsAdvantageLabelTypes = leftData.goodsAdvantageLabelVOList; rightData.productDetailVideoReqList = leftData.detailVideoVOList; + if (leftData.productSpecPropertyVOS) { + rightData.productSpecPropertyReqs = leftData.productSpecPropertyVOS + } rightData.productOuterPackageImageReqs = []; for (let i = 0;i < leftData.outerPackageImages.length; i++) { rightData.productOuterPackageImageReqs.push({ diff --git a/src/view/Home.vue b/src/view/Home.vue index 2756a8c..a451ad8 100644 --- a/src/view/Home.vue +++ b/src/view/Home.vue @@ -13,6 +13,7 @@ 签到 + 会员信息: @@ -72,6 +73,7 @@ 商品列表 商品复制 查找买手 + 草稿箱管理 @@ -138,6 +140,7 @@ 售后赔付统计 调价管理 物流统计 + 账务明细统计 @@ -159,6 +162,13 @@ 商家账单统计 + + + + 数据管理 + + 数据同步(TEMU) + 弹窗消息 @@ -341,6 +351,30 @@ export default { } }) }, + async openFolder() { + console.log(22) + let fileList = [] + const res = await window.showDirectoryPicker({}) + const detalAction = async (obj) => { + if (obj.entries) { + const dirs = obj.entries() + for await (const entry of dirs) { + if (entry[1].entries) { + detalAction(entry[1]) + } else { + fileList.push({ + name: entry[0], + path: obj.name, + fileHandle: entry[1], + file: await entry[1].getFile() + }) + } + } + } + } + await detalAction(res); + console.log("--fileList--", fileList) + }, gotoKefu() { window.open('https://work.weixin.qq.com/kfid/kfcaa4208f661131eba', '_blank') }, diff --git a/src/view/Welcome.vue b/src/view/Welcome.vue index 6056c60..8a65651 100644 --- a/src/view/Welcome.vue +++ b/src/view/Welcome.vue @@ -232,6 +232,11 @@ import BiVueMindmap from "bi-vue-mindmap"; parentId: "01010104", title: "物流统计:对应“履约服务账单->明细->缴费记录”,以及“发货单列表->物流计费重核实”,统计一段时期内物流费用,以及货物重量,物流费用分布" }, + { + id: "0101010408", + parentId: "01010104", + title: "账务明细统计:对应“账户资金->对账中心->账务明细”,真实统计一段时间内的实际收入,以及各种类型的支出,汇总统计" + }, { id: "01010105", parentId: "010101", diff --git a/src/view/data/SyncDataTemu.vue b/src/view/data/SyncDataTemu.vue new file mode 100644 index 0000000..f6614ab --- /dev/null +++ b/src/view/data/SyncDataTemu.vue @@ -0,0 +1,359 @@ + + + + + + + + + 店铺列表 + + + 全选 + + + {{mall.isSemiManagedMall ? mall.mallName + '(半托管)': mall.mallName}} + + + + + + 同步操作 + + + + 时间范围: + + + + + 全选 + + + {{option.label}} + + + + + 同步 + + + + + 日志输出 + + + + + + + + + + \ No newline at end of file diff --git a/src/view/login/Forget.vue b/src/view/login/Forget.vue new file mode 100644 index 0000000..70cf9a0 --- /dev/null +++ b/src/view/login/Forget.vue @@ -0,0 +1,380 @@ + + + + + + + 找回密码 + + + + + + + + + + + + + + + {{ isStart ? time + ' S' : '发送验证码' }} + + + 重置设置 + + + + + + + + + + + diff --git a/src/view/login/Login.vue b/src/view/login/Login.vue index 9fd4e3e..829fbc6 100644 --- a/src/view/login/Login.vue +++ b/src/view/login/Login.vue @@ -24,9 +24,16 @@ 没有账号? 立即注册 + + 忘记密码? + 找回密码 + + + + @@ -139,6 +146,9 @@ onChange (e) { this.$emit('change', e) + }, + gotoKefu() { + window.open('https://work.weixin.qq.com/kfid/kfcaa4208f661131eba', '_blank') } } } @@ -348,4 +358,30 @@ } } } + +#kefu { + position: fixed; + right: 20px; + bottom: 40px; + z-index: 999; + width: 60px; + height: 60px; +} + +#kefu .topBtn { + width: 60px; + height: 60px; + background-color: #fff; + position: absolute; + left: 0; + top: 0; + border-radius: 50%; + cursor: pointer; + background-position: center center; + background-repeat: no-repeat; + background-size: 40px 40px; + -webkit-animation: wobble 250ms infinite; + animation: wobble 250ms infinite; + background-image: url('data:image/svg+xml;%20charset=utf8,%3Csvg%20t%3D%221575450105478%22%20class%3D%22icon%22%20viewBox%3D%220%200%201220%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20p-id%3D%222883%22%20width%3D%2248%22%20height%3D%2248%22%3E%3Cpath%20d%3D%22M609.524%20103.522c-222.89%200-403.712%20178.472-403.712%20398.78%200%20220.31%20180.823%20398.782%20403.712%20398.782%20222.889%200%20403.712-178.473%20403.712-398.781%200-220.309-180.823-398.781-403.712-398.781v48.762c196.1%200%20354.95%20156.785%20354.95%20350.019s-158.85%20350.019-354.95%20350.019-354.95-156.785-354.95-350.02c0-193.233%20158.85-350.018%20354.95-350.018v-48.762z%22%20fill%3D%22%231296db%22%20p-id%3D%222884%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M786.578%20916.34c166.45-69.217%20278.408-231.055%20278.408-414.035%200-248.026-203.847-449.219-455.457-449.219-251.619%200-455.457%20201.188-455.457%20449.22%200%2055.397%2010.152%20109.367%2029.718%20159.975%204.855%2012.56-1.39%2026.677-13.949%2031.533-12.56%204.855-26.677-1.39-31.532-13.949a490.396%20490.396%200%200%201-3.042-8.078c-1.85%200.077-3.711%200.116-5.581%200.116C58.06%20671.903%200%20614.597%200%20543.903c0-65.005%2049.09-118.69%20112.68-126.91C153.65%20182.56%20360.56%204.324%20609.528%204.324c248.962%200%20455.877%20178.24%20496.85%20412.67%2063.583%208.225%20112.669%2061.907%20112.669%20126.909%200%2070.694-58.06%20128-129.686%20128-1.89%200-3.771-0.04-5.642-0.119-47.536%20129.702-148.34%20235.841-279.493%20290.027-1.161%2033.464-29.012%2060.24-63.2%2060.24-34.925%200-63.237-27.944-63.237-62.416%200-34.471%2028.312-62.415%2063.237-62.415%2017.892%200%2034.048%207.333%2045.551%2019.12z%22%20fill%3D%22%231296db%22%20p-id%3D%222885%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M609.528%20611.405c-58.933%200-112.056-10.644-158.472-28.342-16.123-6.147-30.211-12.702-42.138-19.208-6.926-3.777-11.447-6.59-13.437-7.972-19.24-13.373-44.428%205.446-37.059%2027.688%2035.296%20106.527%20136.054%20179.913%20251.106%20179.913%20115.05%200%20215.796-73.384%20251.092-179.913%207.37-22.243-17.82-41.062-37.06-27.687-1.99%201.383-6.51%204.195-13.434%207.972-11.926%206.505-26.012%2013.06-42.133%2019.207-46.413%2017.698-99.533%2028.342-158.465%2028.342z%22%20fill%3D%22%231296db%22%20p-id%3D%222886%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E'); +} diff --git a/src/view/product/BatchUpload.vue b/src/view/product/BatchUpload.vue new file mode 100644 index 0000000..41b4f5e --- /dev/null +++ b/src/view/product/BatchUpload.vue @@ -0,0 +1,305 @@ + + + + + + + 模板来源 + + + + + + + + + + 目标店铺 + + + + + + + 选择文件夹 + + + + + + + + \ No newline at end of file diff --git a/src/view/sale/CostManageTemu.vue b/src/view/sale/CostManageTemu.vue index 6ef70e2..77e4884 100644 --- a/src/view/sale/CostManageTemu.vue +++ b/src/view/sale/CostManageTemu.vue @@ -295,14 +295,18 @@ import { saveAs } from 'file-saver' this.costDlgShow = true }, importConfirm() { + this.isLoading = true this.$refs.costForm.validate((valid) => { const data = new FormData() data.append('file', this.costForm.file[0].raw); this.$http.post(`/api/skuCost/importStock`, data).then(res => { if (res.code === 0) { this.costDlgShow = false + this.isLoading = false this.$message.success('导入成功') this.getList() + } else { + this.isLoading = false } }) }) diff --git a/src/view/sale/ExportBillStatTemu.vue b/src/view/sale/ExportBillStatTemu.vue new file mode 100644 index 0000000..5a904fa --- /dev/null +++ b/src/view/sale/ExportBillStatTemu.vue @@ -0,0 +1,428 @@ + + + + + + + 时间选择: + + + + + 店铺: + + + + + + 开始统计 + 下载图片 + + + + + + + 收入概览 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 支出概览 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 卖家中心出现图形验证码,请前往卖家中心“账户资金->对账中心->账务明细”,随机选择一条数据,点击“查看详情”,处理验证码 + + + + + + + + + + + diff --git a/src/view/sale/ExportSaleStatTemu.vue b/src/view/sale/ExportSaleStatTemu.vue index e3b7b27..72c7cf2 100644 --- a/src/view/sale/ExportSaleStatTemu.vue +++ b/src/view/sale/ExportSaleStatTemu.vue @@ -376,7 +376,7 @@ import { DualAxes } from '@antv/g2plot' computed: { topSaleAmountSkcList() { const list = Object.assign([], this.skcList) - list.sort((a, b) => b.amount - a.amount) + list.sort((a, b) => b.saleAmount - a.saleAmount) return list.slice(0, 10) }, topSaleProfitSkcList() { @@ -805,7 +805,7 @@ import { DualAxes } from '@antv/g2plot' const a = document.createElement('a'); a.style.display = 'none' a.href = img.src; - a.download = '近60天销售统计.png'; + a.download = '销售统计.png'; a.click(); document.body.removeChild(img); } catch (error) { diff --git a/src/view/sale/LogisticFee.vue b/src/view/sale/LogisticFee.vue index df122d8..b6b625e 100644 --- a/src/view/sale/LogisticFee.vue +++ b/src/view/sale/LogisticFee.vue @@ -3,7 +3,7 @@ diff --git a/src/view/shein/CostManageShein.vue b/src/view/shein/CostManageShein.vue index 6c54a2e..3bbceb6 100644 --- a/src/view/shein/CostManageShein.vue +++ b/src/view/shein/CostManageShein.vue @@ -255,16 +255,26 @@ import { saveAs } from 'file-saver' } }, async getPriceInfo(skcList) { - let res = await sendGeiwohuoAPIMessage({ - url: `idms/goods-skc/price`, - method: 'POST', - data: skcList}) - if (res.code == '0') { - for (let key in res.info) { - for (let i = 0; i < this.list.length; i++) { - if (key == this.list[i].sku) { - this.list[i].price = res.info[key] - break + let i = 0, len = 100 + while(i < skcList.length) { + let tempSkcList = [] + for (; i < skcList.length; i++) { + tempSkcList.push(skcList[i]) + if (tempSkcList.length % len == 0) { + break + } + } + let res = await sendGeiwohuoAPIMessage({ + url: `idms/goods-skc/price`, + method: 'POST', + data: tempSkcList}) + if (res.code == '0') { + for (let key in res.info) { + for (let i = 0; i < this.list.length; i++) { + if (key == this.list[i].sku) { + this.list[i].price = res.info[key] + break + } } } } @@ -313,6 +323,7 @@ import { saveAs } from 'file-saver' this.costDlgShow = true }, importConfirm() { + this.isLoading = true this.$refs.costForm.validate((valid) => { const data = new FormData() data.append('file', this.costForm.file[0].raw); @@ -322,8 +333,10 @@ import { saveAs } from 'file-saver' this.$message.success('导入成功') this.currentPage = 1 this.list = [] - this.isLoading = true + this.isLoading = false this.getList() + } else { + this.isLoading = false } }) }) diff --git a/src/view/shein/OrderListShein.vue b/src/view/shein/OrderListShein.vue index 5e81842..02e1b64 100644 --- a/src/view/shein/OrderListShein.vue +++ b/src/view/shein/OrderListShein.vue @@ -199,7 +199,7 @@ import { saveAs } from 'file-saver' for(let i = 0;i < res.info.data.length; i++) { let item = res.info.data[i]; let data = { - orderNo: item.orderId, + orderNo: item.sellerOrderNo, supplierCode: item.goods.supplierCode, statusName: item.statusName, skc: item.goods.skcName, diff --git a/src/view/shipping/NormalSendGoods.vue b/src/view/shipping/NormalSendGoods.vue index 78ab7ef..faaa8cb 100644 --- a/src/view/shipping/NormalSendGoods.vue +++ b/src/view/shipping/NormalSendGoods.vue @@ -490,6 +490,8 @@ Message.error("店铺【" + mallInfo.mallName + "】未设置默认发货地址,将无法自动创建发货单") } break + } else if (res.error_msg == '没权限访问') { + break } } } @@ -612,7 +614,23 @@ } } } else { - this.getList(data, mallId, mallName, currentPage) + if (res.error_msg == '没权限访问') { + if (this.loadMode == 1) { + this.loadMallIndex ++ + if (this.loadMallIndex < this.mallList.length) { + this.getList(data, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1) + } else { + this.isLoading = false + this.isDlgLoading = false + Message.success("所有店铺备货单已加载完成") + } + } else { + this.isLoading = false + this.isDlgLoading = false + } + } else { + this.getList(data, mallId, mallName, currentPage) + } } }, remove(sn) { diff --git a/src/view/shipping/ProductLabel.vue b/src/view/shipping/ProductLabel.vue index 8c10366..2af9a46 100644 --- a/src/view/shipping/ProductLabel.vue +++ b/src/view/shipping/ProductLabel.vue @@ -153,7 +153,6 @@ import { saveAs } from 'file-saver' url: 'bg-visage-mms/labelcode/pageQuery', needMallId: true, mallId: this.form.mallId, - anti: true, data: this.reqData}).then((res) => { if (res.errorCode == 1000000) { for(let i = 0;i < res.result.pageItems.length; i++) { diff --git a/src/view/shipping/WaitShippingList.vue b/src/view/shipping/WaitShippingList.vue index cba2bab..9bcb50d 100644 --- a/src/view/shipping/WaitShippingList.vue +++ b/src/view/shipping/WaitShippingList.vue @@ -194,14 +194,16 @@ import { saveAs } from 'file-saver' for(let i = 0;i < res.result.deliveryOrderDetails.length; i++) { let item = res.result.deliveryOrderDetails[i] - let specArr = item.secondarySpecVOList.map(item => { - return item.specName - }) - let spec = specArr.join(',') - - for(let j = 0; j < this.list.length; j++) { - if (this.list[j].productSkuId == item.productSkuId) { - this.list[j].specName = spec + if (item.secondarySpecVOList) { + let specArr = item.secondarySpecVOList.map(item => { + return item.specName + }) + let spec = specArr.join(',') + + for(let j = 0; j < this.list.length; j++) { + if (this.list[j].productSkuId == item.productSkuId) { + this.list[j].specName = spec + } } } }