diff --git a/public/js/temuSeller.js b/public/js/temuSeller.js
index 0d5ea95..76b6abf 100644
--- a/public/js/temuSeller.js
+++ b/public/js/temuSeller.js
@@ -84,9 +84,9 @@ function init() {
}
}
- /*let models2 = document.querySelectorAll('div[class^="price-adjust-confirm-system_contentWrp"]')
+ let models2 = document.querySelectorAll('div[class^="modal-content_platBanner"]')
for (let i = 0; i < models2.length; i++) {
- let tipsObj = models2[i].querySelector('div[class^="price-adjust-confirm-system_tips"]')
+ let tipsObj = models2[i].parentElement.querySelector('div[class^="modal-content_content"]')
let spanObj = tipsObj.querySelector('div span:last-child')
if (spanObj) {
const popup = document.createElement("div")
@@ -105,12 +105,12 @@ function init() {
spanObj.appendChild(popup)
popup.addEventListener('click', async () => {
- let tbodyObj = models2[i].querySelector('tbody')
+ let tbodyObj = models2[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")) {
+ if (firstLabelObj && firstLabelObj.getAttribute("data-checked")) {
let labelObj = tdObj.querySelector('div label:nth-child(2)')
let radioObj = labelObj.querySelector('div[class^="RD_radioWrapper"]')
// await sleepSync(50)
@@ -122,7 +122,45 @@ function init() {
}
}
- let models3 = document.querySelectorAll('div[class^="price-adjust-confirm-new_content"]')
+ let models3 = document.querySelectorAll('div[class^="modal-content_content"]')
+ for (let i = 0; i < models2.length; i++) {
+ let tipsObj = models2[i].parentElement.querySelector('div[class^="modal-content_content"]')
+ 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].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 && 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')
diff --git a/public/rules_11.json b/public/rules_11.json
new file mode 100644
index 0000000..48fb418
--- /dev/null
+++ b/public/rules_11.json
@@ -0,0 +1,24 @@
+[
+ {
+ "id": 22,
+ "priority": 1,
+ "action": {
+ "type": "modifyHeaders",
+ "requestHeaders": [
+ {
+ "header": "Origin",
+ "operation": "set",
+ "value": "https://sellerhub.shein.com/"
+ },
+ {
+ "header": "Referer",
+ "operation": "set",
+ "value": "https://sellerhub.shein.com/"
+ }
+ ]
+ },
+ "condition": {
+ "urlFilter": "||sellerhub.shein.com"
+ }
+ }
+]
\ No newline at end of file
diff --git a/src/api/index.js b/src/api/index.js
index 964b0be..dae2761 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -4,7 +4,7 @@ import store from '@/store'
var instance = axios.create({
- baseURL: process.env.NODE_ENV === 'production' ? 'http://temu.jjcp52.com' : 'http://temu.jjcp52.com',
+ baseURL: process.env.NODE_ENV === 'production' ? 'http://124.71.2.127:8888' : 'http://124.71.2.127:8888',
timeout: 50000,
validateStatus: function (status) {
return status < 500
diff --git a/src/components/AiCopyFromTemu.vue b/src/components/AiCopyFromTemu.vue
index 5e20e2b..59168bd 100644
--- a/src/components/AiCopyFromTemu.vue
+++ b/src/components/AiCopyFromTemu.vue
@@ -9,10 +9,19 @@
+
+
+ 否
+ 是
+
+
-
+
@@ -136,6 +145,15 @@ export default {
siteList: []
}
},
+ computed: {
+ mallList () {
+ const filteredData = this.$store.state.mallList.filter(item => {
+ return item.isSemiManagedMall == this.form.isSemi
+ })
+
+ return filteredData
+ }
+ },
created () {
this.getSiteList()
if (this.params?.url) {
@@ -143,21 +161,6 @@ export default {
}
},
methods: {
- onMallChange() {
- if (!this.form.targetMallId) {
- Message.error("请先选择店铺")
- return
- }
- let tempMall = this.$store.state.mallList.filter(item => {
- return item.mallId == this.form.targetMallId
- })
- if (null == tempMall || tempMall.length == 0) {
- Message.error("请先选择店铺")
- return
- } else {
- this.form.isSemi = tempMall[0].isSemiManagedMall
- }
- },
getSiteList() {
sendChromeAPIMessage({
url: 'bg-visage-mms/config/common/site/query',
@@ -250,7 +253,7 @@ export default {
})
})
- Promise.all(specIds.map(item => this.getSpecIdNew(item).then(res => {
+ /*Promise.all(specIds.map(item => this.getSpecIdNew(item).then(res => {
this.sku.forEach(item1 => {
item1.specs.forEach(item2 => {
if (item2.spec_value == item.spec_value) {
@@ -265,7 +268,8 @@ export default {
this.createDraft(res.data)
}
})
- })
+ })*/
+ this.toCreateDraftNew(specIds)
})
},
async addToDraft() {
@@ -319,7 +323,7 @@ export default {
})
})
- Promise.all(specIds.map(item => this.getSpecId(item).then(res => {
+ /*Promise.all(specIds.map(item => this.getSpecId(item).then(res => {
this.sku.forEach(item1 => {
item1.specs.forEach(item2 => {
if (item2.specValue == item.specValue) {
@@ -334,9 +338,9 @@ export default {
this.createDraft(res.data)
}
})
- })
+ })*/
+ this.toCreateDraft(specIds)
} else if (this.form.type == '2') {
- console.log(1)
}
})
} else {
@@ -344,7 +348,45 @@ export default {
}
})
},
- async createDraft(data) {
+ async toCreateDraft(specIds) {
+ for (let kk = 0; kk < this.form.targetMallId.length; kk++) {
+ await Promise.all(specIds.map(item => this.getSpecId(item, this.form.targetMallId[kk]).then(res => {
+ this.sku.forEach(item1 => {
+ item1.specs.forEach(item2 => {
+ if (item2.specValue == item.specValue) {
+ item2.specValueId = res.result.specId
+ }
+ })
+ })
+ return 0
+ })))
+ let res = await this.$http.post('/api/copyProduct/translate',{type: 1, goods: this.goods, sku: this.sku, productDetail: this.productDetail})
+ if (res.code == 0) {
+ await this.createDraft(res.data, this.form.targetMallId[kk])
+ }
+ await this.$sleepSync(500)
+ }
+ },
+ async toCreateDraftNew(specIds) {
+ for (let kk = 0; kk < this.form.targetMallId.length; kk++) {
+ await Promise.all(specIds.map(item => this.getSpecIdNew(item, this.form.targetMallId[kk]).then(res => {
+ this.sku.forEach(item1 => {
+ item1.specs.forEach(item2 => {
+ if (item2.spec_value == item.spec_value) {
+ item2.spec_value_id = res.result.specId
+ }
+ })
+ })
+ return 0
+ })))
+ let res = await this.$http.post('/api/copyProduct/translateNew',{type: 1, goods: this.goods, sku: this.sku, productDetail: this.productDetail})
+ if (res.code == 0) {
+ await this.createDraft(res.data, this.form.targetMallId[kk])
+ }
+ await this.$sleepSync(500)
+ }
+ },
+ async createDraft(data, mallId) {
let reqData = {}
let catId = null;
if (this.form.isSameCategory) {
@@ -360,7 +402,7 @@ export default {
let res = await sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/add',
needMallId: true,
- mallId: this.form.targetMallId,
+ mallId: mallId,
data: reqData})
if (res.errorCode == 1000000) {
@@ -384,7 +426,7 @@ export default {
let res3 = await sendChromeAPIMessage({
url: 'bg-anniston-mms/category/template/query',
needMallId: true,
- mallId: this.form.targetMallId,
+ mallId: mallId,
data: {
catId: reqData.catId,
productCreateTime: null,
@@ -436,50 +478,44 @@ export default {
content.personalizationSwitch = 0
content.productDraftId = draftId
- this.createProduct(content)
- } else {
- setTimeout(() => {
- this.createDraft(data)
- }, 500)
+ await this.createProduct(content, mallId)
}
},
- createProduct(content) {
+ async createProduct(content, mallId) {
if (this.form.isSemi) {
content.productSemiManagedReq = {
bindSiteIds: this.form.siteId
}
}
- sendChromeAPIMessage({
+ let res = await sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/save',
needMallId: true,
- mallId: this.form.targetMallId,
+ mallId: mallId,
data: {
...content
- }}).then((res) => {
- if (res.errorCode == 1000000) {
- this.successList.push(this.currentUrl)
- this.saveInfo()
- if (this.isMultiCopy) {
- this.currentIndex ++
- if (this.currentIndex == this.params.urlList.length) {
- this.isCopying = false
- this.$emit('onSuccess')
- MessageBox.alert(`成功添加${this.successList.length}个商品进入草稿箱`)
- } else {
- this.currentUrl = this.params.urlList[this.currentIndex]
- this.execAddToDraft()
- }
- } else {
+ }})
+ if (res.errorCode == 1000000) {
+ this.successList.push(this.currentUrl)
+ this.saveInfo(mallId)
+ if (this.isMultiCopy) {
+ this.currentIndex ++
+ if (this.currentIndex == this.params.urlList.length) {
this.isCopying = false
- Message.success("成功添加到草稿箱")
+ this.$emit('onSuccess')
+ MessageBox.alert(`成功添加${this.successList.length}个商品进入草稿箱`)
+ } else {
+ this.currentUrl = this.params.urlList[this.currentIndex]
+ this.execAddToDraft()
}
-
} else {
- setTimeout(() => {
- this.createProduct(content)
- }, 500)
+ this.isCopying = false
+ Message.success("成功添加到草稿箱")
}
- })
+
+ } else {
+ await this.$sleepSync(1000)
+ this.createProduct(content)
+ }
},
getSpecIdNew(data) {
return sendChromeAPIMessage({
@@ -497,11 +533,11 @@ export default {
}
})
},
- getSpecId(data) {
+ getSpecId(data, mallId) {
return sendChromeAPIMessage({
url: 'bg-anniston-mms/sku/spec/byName/queryOrAdd',
needMallId: true,
- mallId: this.form.targetMallId,
+ mallId: mallId,
data: {
parentSpecId: data.specKeyId,
specName: data.specValue
@@ -509,13 +545,13 @@ export default {
if (res.errorCode == 1000000) {
return res
} else {
- this.getSpecId(data)
+ this.getSpecId(data, mallId)
}
})
},
- saveInfo() {
+ saveInfo(mallId) {
let mallInfo = this.$store.state.mallList.filter(item => {
- return item.mallId == this.form.targetMallId
+ return item.mallId == mallId
})
this.$http.post('/api/copyProduct/add', {
mallId: mallInfo[0].mallId,
diff --git a/src/manifest.development.json b/src/manifest.development.json
index 0b1d3dd..0d9ed90 100644
--- a/src/manifest.development.json
+++ b/src/manifest.development.json
@@ -69,6 +69,10 @@
"id": "10",
"enabled": true,
"path": "rules_10.json"
+ },{
+ "id": "11",
+ "enabled": true,
+ "path": "rules_11.json"
}]
},
"content_scripts": [
diff --git a/src/manifest.production.json b/src/manifest.production.json
index da4aded..61ad9a9 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.12",
+ "version": "3.3.0",
"background": {
"service_worker": "/background.js"
},
@@ -14,7 +14,7 @@
"action": {
},
"host_permissions": [
- "*://*.jjcp52.com/",
+ "*://124.71.2.127:8888/",
"*://*.kuajingmaihuo.com/",
"*://*.temu.com/",
"*://*.aliexpress.com/",
@@ -68,6 +68,10 @@
"id": "9",
"enabled": true,
"path": "rules_9.json"
+ },{
+ "id": "11",
+ "enabled": true,
+ "path": "rules_11.json"
}]
},
"content_scripts": [
diff --git a/src/router/index.js b/src/router/index.js
index bc41083..6ffd597 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -217,6 +217,11 @@ const router = new VueRouter({
name: 'priceAdjustment',
component: () => import('../view/sale/PriceAdjustment.vue')
},
+ {
+ path: 'logisticFee',
+ name: 'logisticFee',
+ component: () => import('../view/sale/LogisticFee.vue')
+ },
{
path: 'costManageShein',
name: 'costManageShein',
@@ -247,6 +252,11 @@ const router = new VueRouter({
name: 'orderListShein',
component: () => import('../view/shein/OrderListShein.vue')
},
+ {
+ path: 'productListOdm',
+ name: 'productListOdm',
+ component: () => import('../view/shein/ProductListOdm.vue')
+ },
{
path: 'returnRecordShein',
name: 'returnRecordShein',
diff --git a/src/view/Home.vue b/src/view/Home.vue
index 4e90783..2756a8c 100644
--- a/src/view/Home.vue
+++ b/src/view/Home.vue
@@ -137,6 +137,7 @@
售后统计
售后赔付统计
调价管理
+ 物流统计
@@ -148,7 +149,8 @@
证书中心
商品复制
发货订单
- 退货与报废单列表
+ 商品列表(ODM)
+ 退货与报废单列表
标签管理
diff --git a/src/view/Welcome.vue b/src/view/Welcome.vue
index 05cfe93..6056c60 100644
--- a/src/view/Welcome.vue
+++ b/src/view/Welcome.vue
@@ -227,6 +227,11 @@ import BiVueMindmap from "bi-vue-mindmap";
parentId: "01010104",
title: "售后赔付统计:对应“结算管理”->“对账中心”->“扣款详情”,统计过去一段时间内店铺的扣款总金额/次数,支持导出"
},
+ {
+ id: "0101010407",
+ parentId: "01010104",
+ title: "物流统计:对应“履约服务账单->明细->缴费记录”,以及“发货单列表->物流计费重核实”,统计一段时期内物流费用,以及货物重量,物流费用分布"
+ },
{
id: "01010105",
parentId: "010101",
diff --git a/src/view/product/CopyProduct.vue b/src/view/product/CopyProduct.vue
index ec29c3d..09c8f10 100644
--- a/src/view/product/CopyProduct.vue
+++ b/src/view/product/CopyProduct.vue
@@ -116,10 +116,19 @@
customFooter
@close="handleClose">
+
+
+ 否
+ 是
+
+
-
+
@@ -264,6 +273,15 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
siteList: []
}
},
+ computed: {
+ mallList () {
+ const filteredData = this.$store.state.mallList.filter(item => {
+ return item.isSemiManagedMall == this.form.isSemi
+ })
+
+ return filteredData
+ }
+ },
created () {
this.getList()
@@ -297,21 +315,6 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
}
})
},
- onMallChange() {
- if (!this.form.targetMallId) {
- Message.error("请先选择店铺")
- return
- }
- let tempMall = this.$store.state.mallList.filter(item => {
- return item.mallId == this.form.targetMallId
- })
- if (null == tempMall || tempMall.length == 0) {
- Message.error("请先选择店铺")
- return
- } else {
- this.form.isSemi = tempMall[0].isSemiManagedMall
- }
- },
remove () {
if (this.ids.length <= 0) {
alert('请选择要删除的商品');
@@ -522,76 +525,82 @@ import AiLazyCascader from "@/components/AiLazyCascader.vue"
addToDraft() {
this.$refs.form.validate((valid) => {
if (valid) {
- this.ids.map((id, index) => {
- let product = this.tableData.filter((item) => {
- return item.id == id
- })
- let content = JSON.parse(product[0].content)
- let category = null
- if (this.form.isSameCategory) {
- let i = 1
- while(true) {
- if (!content['cat'+i+'Id']) {
- break
- }
- i++
- }
- category = content['cat'+(i-1)+'Id']
- } else {
- category = this.form.targetCatId[this.form.targetCatId.length - 1]
- }
- let data = {catId: category}
- if (this.form.isSemi) {
- data.productSemiManagedReq = {
- bindSiteIds: this.form.siteId
- }
- }
- content.personalizationSwitch = content.personalizationSwitch || 0
- setTimeout(() => {
- sendChromeAPIMessage({
- url: 'bg-visage-mms/product/draft/add',
- needMallId: true,
- mallId: this.form.targetMallId,
- data: data}).then((res) => {
- if (res.errorCode == 1000000) {
- let draftId = res.result.productDraftId
- if (!this.form.isSameCategory) {
- let i = 0
- for (; i < this.form.targetCatId.length; i++) {
- content['cat' + (i+1) + 'Id'] = this.form.targetCatId[i]
- }
- for (; i < 10; i++) {
- content['cat' + (i+1) + 'Id'] = ''
- }
- }
- content.productDraftId = draftId
- if (this.form.isSemi) {
- content.productSemiManagedReq = {
- bindSiteIds: this.form.siteId
- }
- }
- sendChromeAPIMessage({
- url: 'bg-visage-mms/product/draft/save',
- needMallId: true,
- mallId: this.form.targetMallId,
- data: {
- ...content
- }}).then((res) => {
- if (res.errorCode == 1000000) {
- Message.success("商品【" + product[0].productName + "】成功添加到草稿箱")
- } else {
- Message.error(res.errorMsg)
- }
- })
- } else {
- Message.error("【拼多多】" + res.errorMsg)
- }
- })
- }, 1000*index)
- })
+ this.beginAddToDraft()
+
this.mallDlgShow = false
}
})
+ },
+ async beginAddToDraft() {
+ for (let xx = 0 ; xx < this.ids.length; xx++) {
+ let id = this.ids[xx]
+ let product = this.tableData.filter((item) => {
+ return item.id == id
+ })
+ let content = JSON.parse(product[0].content)
+ let category = null
+ if (this.form.isSameCategory) {
+ let i = 1
+ while(true) {
+ if (!content['cat'+i+'Id']) {
+ break
+ }
+ i++
+ }
+ category = content['cat'+(i-1)+'Id']
+ } else {
+ category = this.form.targetCatId[this.form.targetCatId.length - 1]
+ }
+ let data = {catId: category}
+ if (this.form.isSemi) {
+ data.productSemiManagedReq = {
+ bindSiteIds: this.form.siteId
+ }
+ }
+ content.personalizationSwitch = content.personalizationSwitch || 0
+
+ for (let kk = 0; kk < this.form.targetMallId.length; kk++) {
+ let res = await sendChromeAPIMessage({
+ url: 'bg-visage-mms/product/draft/add',
+ needMallId: true,
+ mallId: this.form.targetMallId[kk],
+ data: data})
+ if (res.errorCode == 1000000) {
+ let draftId = res.result.productDraftId
+ if (!this.form.isSameCategory) {
+ let i = 0
+ for (; i < this.form.targetCatId.length; i++) {
+ content['cat' + (i+1) + 'Id'] = this.form.targetCatId[i]
+ }
+ for (; i < 10; i++) {
+ content['cat' + (i+1) + 'Id'] = ''
+ }
+ }
+ content.productDraftId = draftId
+ if (this.form.isSemi) {
+ content.productSemiManagedReq = {
+ bindSiteIds: this.form.siteId
+ }
+ }
+ let res1 = await sendChromeAPIMessage({
+ url: 'bg-visage-mms/product/draft/save',
+ needMallId: true,
+ mallId: this.form.targetMallId[kk],
+ data: {
+ ...content
+ }})
+ if (res1.errorCode == 1000000) {
+ Message.success("商品【" + product[0].productName + "】成功添加到草稿箱")
+ } else {
+ Message.error(res1.errorMsg)
+ }
+ } else {
+ Message.error("【拼多多】" + res.errorMsg)
+ }
+
+ await this.$sleepSync(500)
+ }
+ }
}
}
}
diff --git a/src/view/sale/ExportSaleData.vue b/src/view/sale/ExportSaleData.vue
index 1bcf22b..50fc134 100644
--- a/src/view/sale/ExportSaleData.vue
+++ b/src/view/sale/ExportSaleData.vue
@@ -110,15 +110,7 @@
只显示今日有销量
-
- 导出数据
-
+ 导出数据
{
- return value /100;
- }
- },
- "开款核价状态": {
- "field": "isVerifyPrice",
- callback: (value) => {
- return value ? '核价通过': '核价未通过 / 无法备货';
- }
- },
- "缺货数量": "lackQuantity",
- "建议备货量": "adviceQuantity",
- "可售天数": "availableSaleDays",
- "库存可售天数": "availableSaleDaysFromInventory",
- "仓内库存可售天数": "warehouseAvailableSaleDays",
- "近7日用户加购数量": "inCartNumber7d",
- "用户累计加购数量": "inCardNumber",
- "已订阅待提醒到货": "nomsgSubsCntCntSth",
- "销售数据 - 今日": "todaySaleVolume",
- "销售数据 - 今日销售额": "saleMoney",
- "销售数据 - 利润": "profitMoney",
- "销售数据 - 利润率": "profitPercent",
- "销售数据 - 近7日": "lastSevenDaysSaleVolume",
- "销售数据 - 近30天": "lastThirtyDaysSaleVolume",
- "库存数据 - 仓内可用库存": "inventoryNumInfo.warehouseInventoryNum",
- "库存数据 - 仓内暂不可用库存": "inventoryNumInfo.waitOnShelfNum",
- "库存数据 - 已发货库存": "inventoryNumInfo.waitReceiveNum",
- "库存数据 - 已下单待发货库存": "inventoryNumInfo.waitDeliveryInventoryNum",
- "库存数据 - 待审核备货库存": "inventoryNumInfo.waitApproveInventoryNum",
- "VMI备货单数 - 待发货": "vmiOrderInfo.waitDeliveryNum",
- "VMI备货单数 - 在途单数": "vmiOrderInfo.transportationNum",
- "VMI备货单数 - 发货延迟": "vmiOrderInfo.deliveryDelayNum",
- "VMI备货单数 - 到货延迟": "vmiOrderInfo.arrivalDelayNum",
- "非VMI备货单数 - 待发货": "notVmiOrderInfo.waitDeliveryNum",
- "非VMI备货单数 - 在途单数": "notVmiOrderInfo.transportationNum",
- "非VMI备货单数 - 发货延迟": "notVmiOrderInfo.deliveryDelayNum",
- "非VMI备货单数 - 到货延迟": "notVmiOrderInfo.arrivalDelayNum",
- "备货逻辑": "purchaseConfig",
- "可用库存货值(CNY)": "productTotalPrice",
- "在途库存货值(CNY)": "inroadTotalPrice",
- "店铺名称": "mallName",
- "评分": "mark",
- "是否热销": 'hotTag',
- "生产建议信息 - 建议生产数": 'adviceProduceNum',
- "生产建议信息 - 剩余件数": 'availableProduceNum',
- "类目": 'category'
- },
-
+
skuSaleNumberFields: {},
skuSaleNumberList: [],
downloadSkuSaleNumberDlg: false,
@@ -382,6 +318,26 @@ import { Message } from 'element-ui'
return a.todaySaleVolume - b.todaySaleVolume
}
},
+ {
+ prop: 'lastSevenDaysSaleVolume',
+ label: '近7天',
+ width: '120px',
+ align: 'center',
+ sortable: true,
+ 'sort-method': (a, b) => {
+ return a.lastSevenDaysSaleVolume - b.lastSevenDaysSaleVolume
+ }
+ },
+ {
+ prop: 'lastThirtyDaysSaleVolume',
+ label: '近30天',
+ width: '120px',
+ align: 'center',
+ sortable: true,
+ 'sort-method': (a, b) => {
+ return a.lastThirtyDaysSaleVolume - b.lastThirtyDaysSaleVolume
+ }
+ },
{
prop: 'saleMoney',
label: '销售额',
@@ -1032,6 +988,58 @@ import { Message } from 'element-ui'
}
}
return 0
+ },
+ async downloadSaleData() {
+ let res = await this.$http.post('/api/malluser/info')
+ if (res.code == 0) {
+ this.$store.commit('setUserInfo', res.data)
+ if (res.data.flag != 1) {
+ Message.error('您的账号未激活或已失效,请激活后使用')
+ this.$store.commit('setActiveDlgShow', true)
+ return;
+ }
+ }
+
+ // 假设你有一个表格数据的数组
+ const data = [
+ ["商品名称", "SPU", "SKC", "SKU ID", "SKU属性", "SKU货号", "加入站点时长", "图片链接", "申报价格(CNY)", "开款核价状态", "缺货数量",
+ "建议备货量", "可售天数", "库存可售天数", "仓内库存可售天数","近7日用户加购数量", "用户累计加购数量", "已订阅待提醒到货", "销售数据 - 今日",
+ "销售数据 - 近7天", "销售数据 - 近30天", "销售数据 - 今日销售额", "销售数据 - 利润", "销售数据 - 利润率", "库存数据 - 仓内可用库存",
+ "库存数据 - 仓内暂不可用库存", "库存数据 - 已发货库存", "库存数据 - 已下单待发货库存", "库存数据 - 待审核备货库存", "VMI备货单数 - 待发货",
+ "VMI备货单数 - 在途单数", "VMI备货单数 - 发货延迟", "VMI备货单数 - 到货延迟", "非VMI备货单数 - 待发货", "非VMI备货单数 - 在途单数",
+ "非VMI备货单数 - 发货延迟", "非VMI备货单数 - 到货延迟", "备货逻辑", "可用库存货值(CNY)", "在途库存货值(CNY)", "店铺名称", "评分",
+ "是否热销", "生产建议信息 - 建议生产数", "生产建议信息 - 剩余件数", "类目"]
+ ]
+
+ this.list.map(item => {
+ data.push([item.productName, item.productId, item.productSkcId, item.productSkuId, item.className, item.skuExtCode, item.onSalesDurationOffline, item.productSkcPicture, item.supplierPrice/ 100, item.isVerifyPrice? '核价通过': '核价未通过 / 无法备货', item.lackQuantity,
+ item.adviceQuantity, item.availableSaleDays, item.availableSaleDaysFromInventory, item.warehouseAvailableSaleDays, item.inCartNumber7d, item.inCardNumber, item.nomsgSubsCntCntSth, item.todaySaleVolume,
+ item.lastSevenDaysSaleVolume, item.lastThirtyDaysSaleVolume, item.saleMoney, item.profitMoney, item.profitPercent, item.inventoryNumInfo?.warehouseInventoryNum,
+ item.inventoryNumInfo?.waitOnShelfNum, item.inventoryNumInfo?.waitReceiveNum, item.inventoryNumInfo?.waitDeliveryInventoryNum, item.inventoryNumInfo?.waitApproveInventoryNum, item.vmiOrderInfo?.waitDeliveryNum,
+ item.vmiOrderInfo?.transportationNum, item.vmiOrderInfo?.deliveryDelayNum, item.vmiOrderInfo?.arrivalDelayNum, item.notVmiOrderInfo?.waitDeliveryNum, item.notVmiOrderInfo?.transportationNum,
+ item.notVmiOrderInfo?.deliveryDelayNum, item.notVmiOrderInfo?.arrivalDelayNum, item.purchaseConfig, item.productTotalPrice, item.inroadTotalPrice, item.mallName, item.mark,
+ item.hotTag, item.adviceProduceNum, item.availableProduceNum, item.category])
+ })
+
+ // 将数据转换为工作表
+ const worksheet = XLSX.utils.aoa_to_sheet(data);
+
+ // 创建工作簿并添加工作表
+ const workbook = XLSX.utils.book_new();
+ XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+
+ // 生成Excel文件
+ const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
+
+ // 使用blob和FileReader创建一个Blob URL
+ const dataBlob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' });
+ const blobUrl = window.URL.createObjectURL(dataBlob);
+
+ // 使用saveAs下载文件
+ saveAs(dataBlob, '销售数据.xlsx');
+
+ // 清理
+ window.URL.revokeObjectURL(blobUrl);
}
}
}
diff --git a/src/view/sale/LogisticFee.vue b/src/view/sale/LogisticFee.vue
new file mode 100644
index 0000000..df122d8
--- /dev/null
+++ b/src/view/sale/LogisticFee.vue
@@ -0,0 +1,418 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 加载
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {}">
+
+
+
+ {}">
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/view/shein/CostManageShein.vue b/src/view/shein/CostManageShein.vue
index 16579fc..6c54a2e 100644
--- a/src/view/shein/CostManageShein.vue
+++ b/src/view/shein/CostManageShein.vue
@@ -189,7 +189,6 @@ import { saveAs } from 'file-saver'
}
this.getUserInfo()
this.isLoading = true
- this.getList()
}
})
},
@@ -202,12 +201,13 @@ import { saveAs } from 'file-saver'
})
if (res.code == '0' && res.msg == "OK") {
this.mallId = res.info.merchantCode
+ this.getList([])
} else if (res.code == 100004 || res.code == 20302) {
this.isLoading = false
this.$store.commit("setSheinAlertShow", true)
}
},
- async getList () {
+ async getList (skcList) {
let res = await sendGeiwohuoAPIMessage({
url: `idms/goods-skc/list`,
method: 'POST',
@@ -222,6 +222,8 @@ import { saveAs } from 'file-saver'
let data = {skc: item.skc,
skcCode: item.supplierCode
}
+
+ skcList.push(item.skc)
for (let j = 0; j < item.skuList.length; j++) {
let sku = item.skuList[j]
@@ -229,7 +231,7 @@ import { saveAs } from 'file-saver'
data = {...data, sku: sku.skuCode,
skuAttr: sku.attr,
skuCode: sku.supplierSku,
- price: sku.price,
+ price: null,
costPrice: '',
profitPercent: null,
edit: false,
@@ -242,8 +244,9 @@ import { saveAs } from 'file-saver'
if (res.info.list.length == 100 && (res.info.count > 100*this.currentPage)) {
this.currentPage++
await this.sleepSync(200)
- await this.getList()
+ await this.getList(skcList)
} else {
+ await this.getPriceInfo(skcList)
this.getSkuCostList()
}
} else if (res.code == 100004 || res.code == 20302) {
@@ -251,6 +254,22 @@ import { saveAs } from 'file-saver'
this.$store.commit("setSheinAlertShow", true)
}
},
+ 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
+ }
+ }
+ }
+ }
+ },
sleepSync(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
},
diff --git a/src/view/shein/ExportSaleDataShein.vue b/src/view/shein/ExportSaleDataShein.vue
index 5d79718..1776571 100644
--- a/src/view/shein/ExportSaleDataShein.vue
+++ b/src/view/shein/ExportSaleDataShein.vue
@@ -217,10 +217,10 @@ import { saveAs } from 'file-saver'
await this.getSkuCostList()
this.isLoading = true
- this.getList()
+ this.getList([])
},
- getList () {
- sendGeiwohuoAPIMessage({
+ async getList (skcList) {
+ let res = await sendGeiwohuoAPIMessage({
url: 'idms/goods-skc/list',
method: 'POST',
data: {
@@ -251,7 +251,7 @@ import { saveAs } from 'file-saver'
"labelFakeIdList": [],
"tspIdList": [],
"sortBy7dSaleCnt": 2
- }}).then((res) => {
+ }})
if (res.code == '0' && res.msg == "OK") {
for(let i = 0;i < res.info.list.length; i++) {
let item = res.info.list[i];
@@ -262,6 +262,8 @@ import { saveAs } from 'file-saver'
data.supplierCode = item.supplierCode
data.skc = item.skc
+ skcList.push(item.skc)
+
for(let j = 0;j < item.skuList.length; j++) {
let sku = item.skuList[j]
if (sku.attr == '合计') continue
@@ -278,18 +280,18 @@ import { saveAs } from 'file-saver'
ivtNum: sku.stock,
costPrice: null,
todayProfit: null,
- productTotalPrice: Math.round((sku.price * sku.stock)*100)/100,
- inroadTotalPrice: Math.round((sku.price * sku.transit)*100)/100}
+ productTotalPrice: null,
+ inroadTotalPrice: null}
this.todayTotal += temp.todaySale
- this.todayMoney += Math.round((temp.cost * temp.todaySale)*100)/100
- this.todayMoney = Math.round(this.todayMoney * 100) / 100
+ // this.todayMoney += Math.round((temp.cost * temp.todaySale)*100)/100
+ // this.todayMoney = Math.round(this.todayMoney * 100) / 100
this.inventoryTotal += temp.ivtNum
- this.inventoryMoney += Math.round((temp.cost * temp.ivtNum)*100)/100
- this.inventoryMoney = Math.round(this.inventoryMoney*100)/100
+ // this.inventoryMoney += Math.round((temp.cost * temp.ivtNum)*100)/100
+ // this.inventoryMoney = Math.round(this.inventoryMoney*100)/100
this.inroadTotal += temp.onWayNum
- this.inroadTotalMoney += Math.round((temp.cost * temp.onWayNum)*100)/100
- this.inroadTotalMoney = Math.round(this.inroadTotalMoney*100)/100
+ // this.inroadTotalMoney += Math.round((temp.cost * temp.onWayNum)*100)/100
+ // this.inroadTotalMoney = Math.round(this.inroadTotalMoney*100)/100
this.list.push(temp);
}
@@ -297,12 +299,36 @@ import { saveAs } from 'file-saver'
if (this.pageSize == res.info.list.length) {
this.currentPage ++
setTimeout(() => {
- this.getList()
+ this.getList(skcList)
}, 1500)
} else {
+ let res1 = await sendGeiwohuoAPIMessage({
+ url: `idms/goods-skc/price`,
+ method: 'POST',
+ data: skcList})
+ if (res1.code == '0') {
+ for (let key in res1.info) {
+ for (let i = 0; i < this.list.length; i++) {
+ if (key == this.list[i].skuCode) {
+ this.list[i].cost = res1.info[key]
+ break
+ }
+ }
+ }
+ }
for (let i = 0; i < this.list.length; i++) {
+ this.list[i].productTotalPrice = Math.round((this.list[i].cost * this.list[i].ivtNum)*100)/100
+ this.list[i].inroadTotalPrice = Math.round((this.list[i].cost * this.list[i].onWayNum)*100)/100
+ this.todayMoney += Math.round((this.list[i].cost * this.list[i].todaySale)*100)/100
+ this.todayMoney = Math.round(this.todayMoney * 100) / 100
+ this.inventoryMoney += Math.round((this.list[i].cost * this.list[i].ivtNum)*100)/100
+ this.inventoryMoney = Math.round(this.inventoryMoney*100)/100
+ this.inroadTotalMoney += Math.round((this.list[i].cost * this.list[i].onWayNum)*100)/100
+ this.inroadTotalMoney = Math.round(this.inroadTotalMoney*100)/100
+
for (let j = 0; j < this.costList.length; j++) {
if (this.list[i].skuCode == this.costList[j].sku) {
+
this.list[i].costPrice = this.costList[j].costPrice
this.list[i].todayProfit = Math.round((this.list[i].cost - this.costList[j].costPrice) * this.list[i].todaySale * 100) / 100
break
@@ -323,9 +349,6 @@ import { saveAs } from 'file-saver'
this.getList()
}, 1500)
}
- }).catch(() => {
- this.isLoading = false
- })
},
async getSkuCostList() {
let res = await this.$http.post(`/api/skuCost/listAll`, null, {
diff --git a/src/view/shein/OrderListShein.vue b/src/view/shein/OrderListShein.vue
index 63bcc9a..5e81842 100644
--- a/src/view/shein/OrderListShein.vue
+++ b/src/view/shein/OrderListShein.vue
@@ -275,7 +275,7 @@ import { saveAs } from 'file-saver'
]
this.tableData.map(item => {
- data.push([item.orderNo, item.skc, item.skuCode, item.imgPath, item.supplierCode, item.supplierSku, item.suffixZh, item.price, item.costPrice, item.orderQuantity, item.needQuantity, item.deliveryQuantity, item.certifiedQuantity, item.defectiveQuantity, item.addTime])
+ data.push([item.orderNo, item.skc, item.skuCode, item.imgPath, item.supplierCode, item.supplierSku, item.suffixZh, item.price, item.costPrice, item.orderQuantity, item.needQuantity, item.deliveryQuantity, item.groundingQuantity, item.defectiveQuantity, item.addTime])
})
// 将数据转换为工作表
diff --git a/src/view/shein/ProductListOdm.vue b/src/view/shein/ProductListOdm.vue
new file mode 100644
index 0000000..6f2133d
--- /dev/null
+++ b/src/view/shein/ProductListOdm.vue
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 导出
+
+ {}">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/view/shein/PurchaseOrderListShein.vue b/src/view/shein/PurchaseOrderListShein.vue
index d7508cd..5fe7935 100644
--- a/src/view/shein/PurchaseOrderListShein.vue
+++ b/src/view/shein/PurchaseOrderListShein.vue
@@ -177,7 +177,7 @@ import { saveAs } from 'file-saver'
let successList = res1.info.sucessList
for (let i = 0; i < successList.length; i++) {
for (let j = 0; j < params.length; j++) {
- if (successList[i].skuCode == params[j].skuCode) {
+ if ((successList[i].skuCode == params[j].skuCode) && (successList[i].orderNo == params[j].orderNo)) {
successList[i].skc = params[j].skc
successList[i].printNumber = params[j].printNumber
successList[i].subSuffixZh = params[j].subSuffixZh
diff --git a/src/view/shipping/MyNormalOrder.vue b/src/view/shipping/MyNormalOrder.vue
index e43332b..76b0e8e 100644
--- a/src/view/shipping/MyNormalOrder.vue
+++ b/src/view/shipping/MyNormalOrder.vue
@@ -223,7 +223,7 @@ import JsonExcel from 'vue-json-excel'
this.form.mallId = ''
})
},
- toLoad() {
+ async toLoad() {
if (!this.form.mallId) {
Message.error("请选择店铺")
return
@@ -232,7 +232,7 @@ import JsonExcel from 'vue-json-excel'
Message.error("请选择时间")
return
}
- this.getSkuCostList()
+ await this.getSkuCostList()
this.reqData.purchaseTimeFrom = this.form.date[0].getTime()
this.reqData.purchaseTimeTo = this.form.date[1].getTime() + 86400 * 1000
this.reqData.pageNo = 1
@@ -241,9 +241,8 @@ import JsonExcel from 'vue-json-excel'
this.sumTableData = []
this.packageNumber = 0
this.currentIndex = 0
- this.costList = []
this.isLoading = true
- this.load()
+ await this.load()
},
async load() {
let res = await sendChromeAPIMessage({
@@ -287,7 +286,7 @@ import JsonExcel from 'vue-json-excel'
}
else if (res.result.subOrderForSupplierList.length == 100) {
this.reqData.pageNo ++
- this.load()
+ await this.load()
} else {
this.tableData.map(item => {
for (let i = 0; i < this.costList.length; i++) {
@@ -338,6 +337,9 @@ import JsonExcel from 'vue-json-excel'
})
this.isLoading = false
}
+ } else {
+ await this.$sleepSync(500)
+ await this.load()
}
},
async getSkuCostList() {
diff --git a/src/view/shipping/MyUrgencyOrder.vue b/src/view/shipping/MyUrgencyOrder.vue
index 550a7bb..747d7cb 100644
--- a/src/view/shipping/MyUrgencyOrder.vue
+++ b/src/view/shipping/MyUrgencyOrder.vue
@@ -147,6 +147,7 @@ import JsonExcel from 'vue-json-excel'
{ prop: 'extCode', label: 'SKU货号', width: '160px', align: 'left' },
{ prop: 'specName', label: 'SKU属性', width: '100px', align: 'left' },
{ prop: 'supplierPrice', label: '申报价格(CNY)', width: '180px', align: 'left' },
+ { prop: 'cost', label: '成本价格(CNY)', width: '180px', align: 'left', sortable: true, 'sort-method': (a, b) => a.cost - b.cost },
{ prop: 'xiadan', label: '送货数量', width: '100px', align: 'left' },
{ prop: 'skuNum', label: '入库数量', width: '100px', align: 'left' },
{ prop: 'deliveryOrderSn', label: '发货单号', width: '140px', align: 'left' },
@@ -183,6 +184,7 @@ import JsonExcel from 'vue-json-excel'
"SKU货号": "extCode",
"SKU属性": "specName",
"申报价格(CNY)": "supplierPrice",
+ "成本价格(CNY)": "cost",
"下单数量": "xiadan",
"实际入库数量": "skuNum",
"发货单号": "deliveryOrderSn",
@@ -218,7 +220,7 @@ import JsonExcel from 'vue-json-excel'
this.form.mallId = ''
})
},
- toLoad() {
+ async toLoad() {
if (!this.form.mallId) {
Message.error("请选择店铺")
return
@@ -227,103 +229,113 @@ import JsonExcel from 'vue-json-excel'
Message.error("请选择时间")
return
}
- this.getSkuCostList()
+ await this.getSkuCostList()
this.reqData.purchaseTimeFrom = this.form.date[0].getTime()
this.reqData.purchaseTimeTo = this.form.date[1].getTime() + 86400 * 1000
this.reqData.pageNo = 1
this.reqData.statusList = this.form.status
this.tableData = []
- this.costList = []
+ this.sumTableData = []
this.packageNumber = 0
this.currentIndex = 0
this.isLoading = true
- this.load()
+ await this.load()
},
- load() {
- sendChromeAPIMessage({
+ async load() {
+ let res = await sendChromeAPIMessage({
url: 'oms/bg/venom/api/supplier/purchase/manager/querySubOrderList',
needMallId: true,
mallId: this.form.mallId,
anti: true,
- data: this.reqData}).then((res) => {
- if (res.errorCode == 1000000) {
- for(let i = 0;i < res.result.subOrderForSupplierList.length; i++) {
- let item = res.result.subOrderForSupplierList[i];
- let data = {};
- data.purchaseTime = timestampToTime(item.purchaseTime)
- data.subPurchaseOrderSn = item.subPurchaseOrderSn
- data.productName = item.productName
- data.productSkcPicture = item.productSkcPicture
- data.productSkcId = item.productSkcId
- data.skcExtCode = item.productSn
- data.status = this.options.filter(i => {return i.value == item.status})[0].label
- data.deliveryOrderSn = item.deliverInfo.deliveryOrderSn
- data.deliverTime = timestampToTime(item.deliverInfo.deliverTime)
- data.receiveTime = timestampToTime(item.deliverInfo.receiveTime)
-
- for(let k = 0; k < item.skuQuantityDetailList.length; k++) {
- data = {...data,
- productSkuId: item.skuQuantityDetailList[k].productSkuId,
- specName: item.skuQuantityDetailList[k].className,
- extCode: item.skuQuantityDetailList[k].extCode,
- supplierPrice: item.skuQuantityDetailList[k].supplierPrice / 100,
- xiadan: item.skuQuantityDetailList[k].deliverQuantity,
- skuNum: item.skuQuantityDetailList[k].realReceiveAuthenticQuantity}
+ data: this.reqData})
+ if (res.errorCode == 1000000) {
+ for(let i = 0;i < res.result.subOrderForSupplierList.length; i++) {
+ let item = res.result.subOrderForSupplierList[i];
+ let data = {};
+ data.purchaseTime = timestampToTime(item.purchaseTime)
+ data.subPurchaseOrderSn = item.subPurchaseOrderSn
+ data.productName = item.productName
+ data.productSkcPicture = item.productSkcPicture
+ data.productSkcId = item.productSkcId
+ data.skcExtCode = item.productSn
+ data.status = this.options.filter(i => {return i.value == item.status})[0].label
+ data.deliveryOrderSn = item.deliverInfo.deliveryOrderSn
+ data.deliverTime = timestampToTime(item.deliverInfo.deliverTime)
+ data.receiveTime = timestampToTime(item.deliverInfo.receiveTime)
+
+ for(let k = 0; k < item.skuQuantityDetailList.length; k++) {
+ data = {...data,
+ productSkuId: item.skuQuantityDetailList[k].productSkuId,
+ specName: item.skuQuantityDetailList[k].className,
+ extCode: item.skuQuantityDetailList[k].extCode,
+ supplierPrice: item.skuQuantityDetailList[k].supplierPrice / 100,
+ xiadan: item.skuQuantityDetailList[k].deliverQuantity,
+ skuNum: item.skuQuantityDetailList[k].realReceiveAuthenticQuantity,
+ cost: null}
- this.tableData.push(data)
- }
-
- }
- if (this.reqData.pageNo == 1 && res.result.subOrderForSupplierList.length == 0) {
- this.isLoading = false
- }
- else if (res.result.subOrderForSupplierList.length == 100) {
- this.reqData.pageNo ++
- this.load()
- } else {
- this.tableData.map(item => {
- let flag = false
- for (let i = 0; i < this.sumTableData.length; i++) {
- if (this.sumTableData[i].productSkuId == item.productSkuId) {
- this.sumTableData[i].xiadan += item.xiadan
- this.sumTableData[i].purchaseQuantity += item.purchaseQuantity
- this.sumTableData[i].skuNum += item.skuNum
- flag = true
- break
- }
- }
- if (!flag) {
- this.sumTableData.push({
- productName: item.productName,
- productSkcPicture: item.productSkcPicture,
- productSkcId: item.productSkcId,
- productSkuId: item.productSkuId,
- xiadan: item.xiadan,
- skuNum: item.skuNum,
- skcExtCode: item.skcExtCode,
- extCode: item.extCode,
- supplierPrice: item.supplierPrice,
- specName: item.specName,
- cost: null,
- costAmount: null,
- profit: null
- })
- }
- })
- this.sumTableData.map(item => {
- for (let i = 0; i < this.costList.length; i++) {
- if (this.costList[i].sku == item.productSkuId) {
- item.cost = this.costList[i].costPrice
- item.costAmount = Math.round(this.costList[i].costPrice * item.skuNum * 100) / 100
- item.profit = Math.round((item.supplierPrice - item.cost) * item.skuNum * 100) / 100
- break
- }
- }
- })
- this.isLoading = false
- }
+ this.tableData.push(data)
}
- })
+
+ }
+ if (this.reqData.pageNo == 1 && res.result.subOrderForSupplierList.length == 0) {
+ this.isLoading = false
+ }
+ else if (res.result.subOrderForSupplierList.length == 100) {
+ this.reqData.pageNo ++
+ await this.load()
+ } else {
+ this.tableData.map(item => {
+ for (let i = 0; i < this.costList.length; i++) {
+ if (this.costList[i].sku == item.productSkuId) {
+ item.cost = this.costList[i].costPrice
+ break
+ }
+ }
+
+ let flag = false
+ for (let i = 0; i < this.sumTableData.length; i++) {
+ if (this.sumTableData[i].productSkuId == item.productSkuId) {
+ this.sumTableData[i].xiadan += item.xiadan
+ this.sumTableData[i].purchaseQuantity += item.purchaseQuantity
+ this.sumTableData[i].skuNum += item.skuNum
+ flag = true
+ break
+ }
+ }
+ if (!flag) {
+ this.sumTableData.push({
+ productName: item.productName,
+ productSkcPicture: item.productSkcPicture,
+ productSkcId: item.productSkcId,
+ productSkuId: item.productSkuId,
+ xiadan: item.xiadan,
+ skuNum: item.skuNum,
+ skcExtCode: item.skcExtCode,
+ extCode: item.extCode,
+ supplierPrice: item.supplierPrice,
+ specName: item.specName,
+ cost: null,
+ costAmount: null,
+ profit: null
+ })
+ }
+ })
+ this.sumTableData.map(item => {
+ for (let i = 0; i < this.costList.length; i++) {
+ if (this.costList[i].sku == item.productSkuId) {
+ item.cost = this.costList[i].costPrice
+ item.costAmount = Math.round(this.costList[i].costPrice * item.skuNum * 100) / 100
+ item.profit = Math.round((item.supplierPrice - item.cost) * item.skuNum * 100) / 100
+ break
+ }
+ }
+ })
+ this.isLoading = false
+ }
+ } else {
+ await this.$sleepSync(500)
+ await this.load()
+ }
},
async getSkuCostList() {
let res = await this.$http.post(`/api/skuCost/listAll`, null, {
diff --git a/src/view/shipping/NormalSendGoods.vue b/src/view/shipping/NormalSendGoods.vue
index 7e6dca2..78ab7ef 100644
--- a/src/view/shipping/NormalSendGoods.vue
+++ b/src/view/shipping/NormalSendGoods.vue
@@ -286,6 +286,17 @@
是
+
+
+
+ 否
+ 是
+
+
+
加载
@@ -40,7 +44,8 @@
- 导出
+ 导出当前
+ 导出所有店铺
import { Message } from 'element-ui'
import {sendChromeAPIMessage} from '@/api/chromeApi'
-import {timestampToTime} from '@/utils/date'
import * as XLSX from 'xlsx'
import { saveAs } from 'file-saver'
@@ -83,6 +87,7 @@ import { saveAs } from 'file-saver'
},
startPage: 1,
endPage: 10,
+ skcs: null,
reqData: {
page: 1,
pageSize: 100
@@ -130,6 +135,9 @@ import { saveAs } from 'file-saver'
Message.error("起始页不能大于结束页")
return
}
+ if (this.skcs) {
+ this.reqData.productSkcIdList = this.skcs.split(',')
+ }
this.$userCheck(this.form.mallId).then(() => {
this.reqData.page = this.startPage
this.tableData = []
@@ -182,6 +190,91 @@ import { saveAs } from 'file-saver'
}
})
},
+ async exportAllToExcel() {
+ this.isLoading = true
+ let list = []
+ for (let j = 0; j < this.$store.state.mallList.length; j++) {
+ let page = 1
+ while(true) {
+ let res = await sendChromeAPIMessage({
+ url: 'bg-visage-mms/labelcode/pageQuery',
+ needMallId: true,
+ mallId: this.$store.state.mallList[j].mallId,
+ anti: true,
+ data: {
+ page: page,
+ pageSize: 100
+ }})
+ if (res.errorCode == 1000000) {
+ for(let i = 0;i < res.result.pageItems.length; i++) {
+ let item = res.result.pageItems[i];
+ let data = {};
+ data.productName = item.productName
+ data.mainImageUrl = item.displayImage
+ data.productSkcId = item.labelCodeVO.productSkcId
+ data.productSkuId = item.labelCodeVO.productSkuId
+ data.labelCode = item.labelCodeVO.labelCode
+ data.extCode = item.labelCodeVO.skcExtCode
+ data.skuExtCode = item.labelCodeVO.skuExtCode
+ data.category = item.leafCat.catName
+ data.displayImage = item.displayImage
+ data.mallName = this.$store.state.mallList[j].mallName
+
+ let temp = item.productSkcSpecList.map(item2 => {
+ return item2.specName
+ })
+ data.skcSpecName = temp.join(',')
+
+ temp = item.productSkuSpecList.map(item2 => {
+ return item2.specName
+ })
+ data.skuSpecName = temp.join(',')
+
+ list.push(data)
+ }
+
+ if (res.result.pageItems.length == 100) {
+ page ++
+ } else {
+ break
+ }
+ }
+ await this.$sleepSync(200)
+ }
+ }
+
+ // 假设你有一个表格数据的数组
+ const data = [
+ ["商品名称", "分类", "条码编码", "SKC","SKU", "SKC货号", "SKU货号", "主销售属性", "次销售属性", "模板名称", "店铺名称", "图片"]
+ ]
+
+ list.map(item => {
+ data.push([item.productName, item.category, item.labelCode, item.productSkcId, item.productSkuId, item.extCode, item.skuExtCode, item.skcSpecName, item.skuSpecName, "", item.mallName, item.displayImage])
+ })
+
+ // 将数据转换为工作表
+ const worksheet = XLSX.utils.aoa_to_sheet(data);
+
+ // 创建工作簿并添加工作表
+ const workbook = XLSX.utils.book_new();
+ XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
+
+ // 生成Excel文件
+ const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
+
+ // 使用blob和FileReader创建一个Blob URL
+ const dataBlob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' });
+ const blobUrl = window.URL.createObjectURL(dataBlob);
+
+ // 使用saveAs下载文件
+ saveAs(dataBlob, '商品条码列表.xlsx');
+
+ // 清理
+ window.URL.revokeObjectURL(blobUrl);
+
+ this.isLoading = false
+
+ },
exportWaitUploadToExcel() {
// 假设你有一个表格数据的数组
const data = [
diff --git a/src/view/shipping/ShippingDesk.vue b/src/view/shipping/ShippingDesk.vue
index fb2b1b8..d5d3641 100644
--- a/src/view/shipping/ShippingDesk.vue
+++ b/src/view/shipping/ShippingDesk.vue
@@ -167,7 +167,17 @@
-
+
+
+
+ 否
+ 是
+
+
+