调整
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "TEMU助手",
|
"name": "TEMU助手",
|
||||||
"description": "TEMU助手 - 自动化提高生产效率",
|
"description": "TEMU助手 - 自动化提高生产效率",
|
||||||
"version": "2.2.3",
|
"version": "2.2.4",
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "/background.js"
|
"service_worker": "/background.js"
|
||||||
},
|
},
|
||||||
@@ -19,10 +19,13 @@
|
|||||||
"permissions": [
|
"permissions": [
|
||||||
"cookies",
|
"cookies",
|
||||||
"notifications",
|
"notifications",
|
||||||
|
"tabs",
|
||||||
|
"scripting",
|
||||||
|
"webRequest",
|
||||||
"declarativeNetRequest",
|
"declarativeNetRequest",
|
||||||
"declarativeNetRequestWithHostAccess",
|
"declarativeNetRequestWithHostAccess",
|
||||||
"declarativeNetRequestFeedback",
|
"declarativeNetRequestFeedback",
|
||||||
"webRequest"
|
"activeTab"
|
||||||
],
|
],
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<ai-list class="list" v-loading="isLoading">
|
<ai-list class="list" v-loading="isLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
|
||||||
<ai-title
|
<ai-title
|
||||||
slot="title"
|
slot="title"
|
||||||
title="销售数据"
|
title="销售数据"
|
||||||
@@ -290,6 +290,23 @@ import { Message } from 'element-ui'
|
|||||||
return a.productTotalPrice - b.productTotalPrice
|
return a.productTotalPrice - b.productTotalPrice
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'purchaseConfig',
|
||||||
|
label: '备货逻辑',
|
||||||
|
align: 'center',
|
||||||
|
fixed: "right",
|
||||||
|
sortable: true,
|
||||||
|
'sort-method': (a, b) => {
|
||||||
|
if (a.purchaseConfig > b.purchaseConfig) {
|
||||||
|
return 1
|
||||||
|
} else if (a.purchaseConfig == b.purchaseConfig) {
|
||||||
|
return 0
|
||||||
|
} else {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -338,7 +355,13 @@ import { Message } from 'element-ui'
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
'sort-method': (a, b) => {
|
'sort-method': (a, b) => {
|
||||||
return new Number(a[dateStr]) - new Number(b[dateStr])
|
if (a > b) {
|
||||||
|
return 1
|
||||||
|
} else if (a == b) {
|
||||||
|
return 0
|
||||||
|
} else {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,7 +445,13 @@ import { Message } from 'element-ui'
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
'sort-method': (a, b) => {
|
'sort-method': (a, b) => {
|
||||||
return new Number(a[dateStr]) - new Number(b[dateStr])
|
if (a > b) {
|
||||||
|
return 1
|
||||||
|
} else if (a == b) {
|
||||||
|
return 0
|
||||||
|
} else {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<ai-list class="list">
|
<ai-list class="list" v-loading="isLoading">
|
||||||
<ai-title
|
<ai-title
|
||||||
slot="title"
|
slot="title"
|
||||||
title="抢仓发货"
|
title="抢仓发货"
|
||||||
@@ -20,15 +20,7 @@
|
|||||||
<el-button type="primary" :disabled="isBegin" @click="loadAll">一键加载全部</el-button>-->
|
<el-button type="primary" :disabled="isBegin" @click="loadAll">一键加载全部</el-button>-->
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
<el-button v-if="!isBegin" type="button" :class="'el-button el-button--primary'" @click="beginRobConfirm">开始抢仓</el-button>
|
<el-button v-if="!isBegin" type="button" :class="'el-button el-button--primary'" @click="beginRobConfirm">开始抢仓</el-button>
|
||||||
<!--<el-dropdown @command="handleRobClick" v-if="!isBegin">
|
|
||||||
<el-button type="button" :class="'el-button el-button--primary'">开始抢仓</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item :disabled="isBegin" command="normal">普通抢仓</el-dropdown-item>
|
|
||||||
<el-dropdown-item :disabled="isBegin" command="faster">极速抢仓</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>-->
|
|
||||||
<el-button v-else type="button" :icon="isBegin? 'el-icon-loading': ''" :class="isBegin ? 'el-button el-button--danger': 'el-button el-button--primary'" @click="beginRob()">{{ `结束抢仓(${choosedList.length}/${robTotal})` }}</el-button>
|
<el-button v-else type="button" :icon="isBegin? 'el-icon-loading': ''" :class="isBegin ? 'el-button el-button--danger': 'el-button el-button--primary'" @click="beginRob()">{{ `结束抢仓(${choosedList.length}/${robTotal})` }}</el-button>
|
||||||
<!--<el-checkbox :disabled="isBegin" v-model="isCreateDeliveryBill">立即创建发货单</el-checkbox>-->
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
@@ -125,6 +117,7 @@
|
|||||||
:total="total"
|
:total="total"
|
||||||
:isShowPagination="false"
|
:isShowPagination="false"
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
|
v-loading="isDlgLoading"
|
||||||
@selection-change="onChooseChange">
|
@selection-change="onChooseChange">
|
||||||
<el-table-column slot="productName" width="400px" label="商品信息" align="center">
|
<el-table-column slot="productName" width="400px" label="商品信息" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -293,15 +286,13 @@
|
|||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
robForm: {
|
robForm: {
|
||||||
step: "1000",
|
step: "500",
|
||||||
randomValue: 1000,
|
randomValue: 500,
|
||||||
isCreateDeliveryBill: false,
|
isCreateDeliveryBill: false,
|
||||||
isModifyMaxNum: false
|
isModifyMaxNum: false
|
||||||
},
|
},
|
||||||
timer: [],
|
|
||||||
loadMallIndex: 0,
|
loadMallIndex: 0,
|
||||||
loadMode: 0, // 加载模式,0表示单个店铺加载,1表示一键加载
|
loadMode: 0, // 加载模式,0表示单个店铺加载,1表示一键加载
|
||||||
robMode: 0, // 抢仓模式,0表示普通抢仓,1表示极速抢仓
|
|
||||||
|
|
||||||
// 网络超时次数
|
// 网络超时次数
|
||||||
networkErrorCount: 0,
|
networkErrorCount: 0,
|
||||||
@@ -310,6 +301,10 @@
|
|||||||
successMallId: '',
|
successMallId: '',
|
||||||
successList: [],
|
successList: [],
|
||||||
|
|
||||||
|
// 加载数据
|
||||||
|
isLoading: false,
|
||||||
|
isDlgLoading: false,
|
||||||
|
|
||||||
robDlgShow: false,
|
robDlgShow: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -345,6 +340,7 @@
|
|||||||
this.loadMode = 0
|
this.loadMode = 0
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.currentPage = 1
|
this.currentPage = 1
|
||||||
|
this.isDlgLoading = true
|
||||||
this.getList(this.tableData, this.mallId, this.mallName, 1)
|
this.getList(this.tableData, this.mallId, this.mallName, 1)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
@@ -370,6 +366,7 @@
|
|||||||
this.choosedList = []
|
this.choosedList = []
|
||||||
this.loadMallIndex = 0
|
this.loadMallIndex = 0
|
||||||
this.loadMode = 1
|
this.loadMode = 1
|
||||||
|
this.isLoading = true
|
||||||
this.getList(this.choosedList, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
this.getList(this.choosedList, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -391,22 +388,12 @@
|
|||||||
beforeBegin() {
|
beforeBegin() {
|
||||||
this.$refs.robForm.validate((valid) => {
|
this.$refs.robForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.handleRobClick('normal')
|
this.networkErrorCount = 0
|
||||||
this.robDlgShow = false
|
this.robDlgShow = false
|
||||||
|
this.beginRob()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
handleRobClick (e) {
|
|
||||||
this.networkErrorCount = 0
|
|
||||||
if (e === 'normal') {
|
|
||||||
this.robMode = 0
|
|
||||||
} else if (e === 'faster') {
|
|
||||||
this.robMode = 1
|
|
||||||
}
|
|
||||||
this.beginRob()
|
|
||||||
},
|
|
||||||
|
|
||||||
getList (data, mallId, mallName, currentPage) {
|
getList (data, mallId, mallName, currentPage) {
|
||||||
sendChromeAPIMessage({
|
sendChromeAPIMessage({
|
||||||
url: 'oms/bg/venom/api/supplier/purchase/manager/querySubOrderList',
|
url: 'oms/bg/venom/api/supplier/purchase/manager/querySubOrderList',
|
||||||
@@ -452,12 +439,15 @@
|
|||||||
if (this.loadMallIndex < this.mallList.length) {
|
if (this.loadMallIndex < this.mallList.length) {
|
||||||
this.getList(data, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
this.getList(data, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
||||||
} else {
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
Message.success("所有店铺备货单已加载完成")
|
Message.success("所有店铺备货单已加载完成")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.isDlgLoading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Message.error("【拼多多】" + res.errorMsg)
|
this.getList(data, mallId, mallName, currentPage)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -475,9 +465,6 @@
|
|||||||
beginRob() {
|
beginRob() {
|
||||||
if (this.isBegin) {
|
if (this.isBegin) {
|
||||||
this.isBegin = false;
|
this.isBegin = false;
|
||||||
for (let i = 0;i < this.timer.length; i++) {
|
|
||||||
clearInterval(this.timer[i].timer);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,24 +474,8 @@
|
|||||||
|
|
||||||
this.robTotal = this.choosedList.length
|
this.robTotal = this.choosedList.length
|
||||||
this.isBegin = true;
|
this.isBegin = true;
|
||||||
this.timer = [];
|
|
||||||
|
|
||||||
if (0 == this.robMode) {
|
this.rob()
|
||||||
this.rob()
|
|
||||||
}
|
|
||||||
|
|
||||||
/*for (let i = 0;i < this.choosedList.length; i++) {
|
|
||||||
if (0 == this.robMode) {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.rob(this.choosedList[i].subPurchaseOrderSn, this.choosedList[i].mallId)
|
|
||||||
}, this.step * i)
|
|
||||||
} else {
|
|
||||||
setTimeout(() => {
|
|
||||||
let t = setInterval(this.robFunc(this.choosedList[i].subPurchaseOrderSn, this.choosedList[i].mallId), 1000);
|
|
||||||
this.timer.push({id: this.choosedList[i].subPurchaseOrderSn, timer: t})
|
|
||||||
}, 100 * i)
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
let _this = this;
|
let _this = this;
|
||||||
let tt = setInterval(function() {
|
let tt = setInterval(function() {
|
||||||
@@ -536,15 +507,6 @@
|
|||||||
"subPurchaseOrderSn": sn
|
"subPurchaseOrderSn": sn
|
||||||
}}).then((res) => {
|
}}).then((res) => {
|
||||||
if (res.errorCode == 1000000) {
|
if (res.errorCode == 1000000) {
|
||||||
if (1 == this.robMode) {
|
|
||||||
let t = this.timer.filter((item) => {
|
|
||||||
return item.id == sn;
|
|
||||||
})
|
|
||||||
if (t.length > 0) {
|
|
||||||
clearInterval(t[0].timer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let j = 0; j < this.choosedList.length; j++) {
|
for (let j = 0; j < this.choosedList.length; j++) {
|
||||||
if (this.choosedList[j].subPurchaseOrderSn == sn) {
|
if (this.choosedList[j].subPurchaseOrderSn == sn) {
|
||||||
this.successList.push(this.choosedList[j])
|
this.successList.push(this.choosedList[j])
|
||||||
@@ -567,23 +529,14 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if (0 == this.robMode) {
|
|
||||||
if (this.isBegin) {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.rob(sn, mallId)
|
|
||||||
}, this.choosedList.length * this.step)
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
if (!res.errorCode && res.error_code && (res.error_code == 40001)) {
|
if (!res.errorCode && res.error_code && (res.error_code == 40001)) {
|
||||||
this.networkErrorCount ++
|
this.networkErrorCount ++
|
||||||
}
|
}
|
||||||
if (0 == this.robMode) {
|
// 继续抢
|
||||||
// 继续抢
|
setTimeout(() => {
|
||||||
setTimeout(() => {
|
this.rob()
|
||||||
this.rob()
|
}, parseInt(this.robForm.step) + Math.floor(Math.random() * parseInt(this.robForm.randomValue)))
|
||||||
}, parseInt(this.robForm.step) + Math.floor(Math.random() * parseInt(this.robForm.randomValue)))
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
createDeliveryBill(sn, mallId) {
|
createDeliveryBill(sn, mallId) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<ai-list class="list" v-loading="isLoading">
|
<ai-list class="list" v-loading="isLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
|
||||||
<ai-title
|
<ai-title
|
||||||
slot="title"
|
slot="title"
|
||||||
title="已收货发货单列表"
|
title="已收货发货单列表"
|
||||||
@@ -148,6 +148,10 @@ import { Message } from 'element-ui'
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
beginSync() {
|
beginSync() {
|
||||||
|
if (!this.search.mallId) {
|
||||||
|
Message.error("请先选择店铺")
|
||||||
|
return
|
||||||
|
}
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
this.currentPage = 1
|
this.currentPage = 1
|
||||||
this.packageNumber = 0
|
this.packageNumber = 0
|
||||||
@@ -184,8 +188,8 @@ import { Message } from 'element-ui'
|
|||||||
"status": 2
|
"status": 2
|
||||||
}
|
}
|
||||||
if (this.lastDeliveryTimestamp) {
|
if (this.lastDeliveryTimestamp) {
|
||||||
data.deliverTimeFrom = this.lastDeliveryTimestamp
|
data.deliverTimeFrom = this.lastDeliveryTimestamp * 1000
|
||||||
data.deliverTimeTo = Date.now() / 1000
|
data.deliverTimeTo = Date.now()
|
||||||
}
|
}
|
||||||
sendChromeAPIMessage({
|
sendChromeAPIMessage({
|
||||||
url: 'bgSongbird-api/supplier/deliverGoods/management/pageQueryDeliveryOrders',
|
url: 'bgSongbird-api/supplier/deliverGoods/management/pageQueryDeliveryOrders',
|
||||||
@@ -237,6 +241,7 @@ import { Message } from 'element-ui'
|
|||||||
}, 1500)
|
}, 1500)
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
Message.error("同步发货单失败")
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -260,8 +265,12 @@ import { Message } from 'element-ui'
|
|||||||
list.push(data)
|
list.push(data)
|
||||||
}
|
}
|
||||||
this.packageNumber = this.packageNumber - res.result.deliveryOrderDetails.length
|
this.packageNumber = this.packageNumber - res.result.deliveryOrderDetails.length
|
||||||
|
console.log(this.packageNumber)
|
||||||
|
|
||||||
if (this.packageNumber < 5) this.isLoading = false
|
if (this.packageNumber < 10) {
|
||||||
|
this.isLoading = false
|
||||||
|
this.getInfo()
|
||||||
|
}
|
||||||
this.$http.post('/api/deliveryOrderDetail/add',list)
|
this.$http.post('/api/deliveryOrderDetail/add',list)
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user