调整
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.0",
|
"version": "2.0.1",
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "/background.js"
|
"service_worker": "/background.js"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -99,7 +99,11 @@ const userCheck = (mallId) => {
|
|||||||
reject('您的账号未激活或已失效,请激活后使用')
|
reject('您的账号未激活或已失效,请激活后使用')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if (res.type != 4 && mallId != store.state.userInfo.mallId) {
|
let tempMallId = mallId
|
||||||
|
if (!tempMallId) {
|
||||||
|
tempMallId = store.state.mallId
|
||||||
|
}
|
||||||
|
if (res.type != 4 && tempMallId != store.state.userInfo.mallId) {
|
||||||
Message.error('您当前登录的TEMU账号与会员绑定账号不一致')
|
Message.error('您当前登录的TEMU账号与会员绑定账号不一致')
|
||||||
reject('您当前登录的TEMU账号与会员绑定账号不一致')
|
reject('您当前登录的TEMU账号与会员绑定账号不一致')
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -10,8 +10,25 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-button type="primary" :disabled="isBegin" @click="isShow = true">添加备货单</el-button>
|
<el-dropdown @command="handleClick">
|
||||||
<el-button type="button" :icon="isBegin? 'el-icon-loading': ''" :class="isBegin ? 'el-button el-button--danger': 'el-button el-button--primary'" @click="beginRob()">{{isBegin ? `结束抢仓(${choosedList.length}/${robTotal})`: '开始抢仓'}}</el-button>
|
<el-button type="primary" :disabled="isBegin">添加备货单</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="byStore">按店铺添加</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="loadAll">一键添加所有</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
<!--<el-button type="primary" :disabled="isBegin" @click="isShow = true">添加备货单</el-button>
|
||||||
|
<el-button type="primary" :disabled="isBegin" @click="loadAll">一键加载全部</el-button>-->
|
||||||
|
</el-dropdown>
|
||||||
|
<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-checkbox :disabled="isBegin" v-model="isCreateDeliveryBill">立即创建发货单</el-checkbox>-->
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
</template>
|
</template>
|
||||||
@@ -21,8 +38,7 @@
|
|||||||
:col-configs="robColConfigs"
|
:col-configs="robColConfigs"
|
||||||
:total="total"
|
:total="total"
|
||||||
:isShowPagination="false"
|
:isShowPagination="false"
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;">
|
||||||
@getList="getList">
|
|
||||||
<el-table-column slot="productName" width="480px" label="商品信息" align="center">
|
<el-table-column slot="productName" width="480px" label="商品信息" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div class="product">
|
<div class="product">
|
||||||
@@ -100,8 +116,7 @@
|
|||||||
:total="total"
|
:total="total"
|
||||||
:isShowPagination="false"
|
:isShowPagination="false"
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
@selection-change="onChooseChange"
|
@selection-change="onChooseChange">
|
||||||
@getList="getList">
|
|
||||||
<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">
|
||||||
<div class="product">
|
<div class="product">
|
||||||
@@ -148,7 +163,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import {sendChromeAPIMessage, sendChromeNotification} from '@/api/chromeApi'
|
import {sendChromeAPIMessage, sendChromeNotification} from '@/api/chromeApi'
|
||||||
import { Message } from 'element-ui'
|
import { Message, TimeSelect } from 'element-ui'
|
||||||
export default {
|
export default {
|
||||||
name: 'NormalSendGoods',
|
name: 'NormalSendGoods',
|
||||||
|
|
||||||
@@ -181,7 +196,12 @@
|
|||||||
robTotal: 0,
|
robTotal: 0,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
step: 400
|
step: 400,
|
||||||
|
timer: [],
|
||||||
|
loadMallIndex: 0,
|
||||||
|
loadMode: 0, // 加载模式,0表示单个店铺加载,1表示一键加载
|
||||||
|
robMode: 0, // 抢仓模式,0表示普通抢仓,1表示极速抢仓
|
||||||
|
isCreateDeliveryBill: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -204,9 +224,10 @@
|
|||||||
this.mallName = mallInfo[0].mallName
|
this.mallName = mallInfo[0].mallName
|
||||||
|
|
||||||
// 下载数据
|
// 下载数据
|
||||||
|
this.loadMode = 0
|
||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.currentPage = 1
|
this.currentPage = 1
|
||||||
this.getList()
|
this.getList(this.tableData, this.mallId, this.mallName, 1)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
})
|
})
|
||||||
@@ -226,14 +247,39 @@
|
|||||||
})
|
})
|
||||||
Message.success("添加成功,可继续添加")
|
Message.success("添加成功,可继续添加")
|
||||||
},
|
},
|
||||||
|
loadAll() {
|
||||||
|
this.$userCheck().then(() => {
|
||||||
|
this.choosedList = []
|
||||||
|
this.loadMallIndex = 0
|
||||||
|
this.loadMode = 1
|
||||||
|
this.getList(this.choosedList, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
getList () {
|
handleClick (e) {
|
||||||
|
if (e === 'byStore') {
|
||||||
|
this.isShow = true
|
||||||
|
} else if (e === 'loadAll') {
|
||||||
|
this.loadAll()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleRobClick (e) {
|
||||||
|
if (e === 'normal') {
|
||||||
|
this.robMode = 0
|
||||||
|
} else if (e === 'faster') {
|
||||||
|
this.robMode = 1
|
||||||
|
}
|
||||||
|
this.beginRob()
|
||||||
|
},
|
||||||
|
|
||||||
|
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',
|
||||||
needMallId: true,
|
needMallId: true,
|
||||||
mallId: this.mallId,
|
mallId: mallId,
|
||||||
data: {
|
data: {
|
||||||
"pageNo": this.currentPage,
|
"pageNo": currentPage,
|
||||||
"pageSize": this.pageSize,
|
"pageSize": this.pageSize,
|
||||||
"urgencyType": 0,
|
"urgencyType": 0,
|
||||||
"isCustomGoods": false,
|
"isCustomGoods": false,
|
||||||
@@ -247,7 +293,7 @@
|
|||||||
return item.isCanJoinDeliverPlatform;
|
return item.isCanJoinDeliverPlatform;
|
||||||
})
|
})
|
||||||
res.result.subOrderForSupplierList.map((item) => {
|
res.result.subOrderForSupplierList.map((item) => {
|
||||||
this.tableData.push({
|
data.push({
|
||||||
robTotal: 0,
|
robTotal: 0,
|
||||||
subPurchaseOrderSn: item.subPurchaseOrderSn,
|
subPurchaseOrderSn: item.subPurchaseOrderSn,
|
||||||
originalPurchaseOrderSn: item.originalPurchaseOrderSn,
|
originalPurchaseOrderSn: item.originalPurchaseOrderSn,
|
||||||
@@ -258,14 +304,23 @@
|
|||||||
status: item.status,
|
status: item.status,
|
||||||
detailList: item.skuQuantityDetailList,
|
detailList: item.skuQuantityDetailList,
|
||||||
category: item.category,
|
category: item.category,
|
||||||
mallId: this.mallId,
|
mallId: mallId,
|
||||||
mallName: this.mallName
|
mallName: mallName
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.pageSize == length) {
|
if (this.pageSize == length) {
|
||||||
this.currentPage ++
|
currentPage ++
|
||||||
this.getList()
|
this.getList(data, mallId, mallName, currentPage)
|
||||||
|
} else {
|
||||||
|
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 {
|
||||||
|
Message.success("所有店铺备货单已加载完成")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Message.error("【拼多多】" + res.errorMsg)
|
Message.error("【拼多多】" + res.errorMsg)
|
||||||
@@ -286,25 +341,32 @@
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.choosedList.length <= 0) {
|
if (this.choosedList.length <= 0) {
|
||||||
Message.error('请选择备货单');
|
Message.error('请添加备货单');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.robTotal = this.choosedList.length
|
this.robTotal = this.choosedList.length
|
||||||
this.isBegin = true;
|
this.isBegin = true;
|
||||||
|
this.timer = [];
|
||||||
|
|
||||||
for (let i = 0;i < this.choosedList.length; i++) {
|
for (let i = 0;i < this.choosedList.length; i++) {
|
||||||
/*setTimeout(() => {
|
if (0 == this.robMode) {
|
||||||
let t = setInterval(this.robFunc(this.choosedList[i].subPurchaseOrderSn, this.choosedList[i].mallId), 1000);
|
setTimeout(() => {
|
||||||
this.timer.push({id: this.choosedList[i].subPurchaseOrderSn, timer: t})
|
this.rob(this.choosedList[i].subPurchaseOrderSn, this.choosedList[i].mallId)
|
||||||
}, 100 * i)*/
|
}, this.step * i)
|
||||||
setTimeout(() => {
|
} else {
|
||||||
this.rob(this.choosedList[i].subPurchaseOrderSn, this.choosedList[i].mallId)
|
setTimeout(() => {
|
||||||
}, this.step * i)
|
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;
|
||||||
@@ -314,23 +376,6 @@
|
|||||||
clearInterval(tt);
|
clearInterval(tt);
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
// this.$http.post('/api/malluser/info').then(res => {
|
|
||||||
// if (res.code == 0) {
|
|
||||||
// this.$store.commit('setUserInfo', res.data)
|
|
||||||
// if (res.data.flag != 1) {
|
|
||||||
// Message.error('您的账号未激活或已失效,请激活后使用')
|
|
||||||
// this.$store.commit('setActiveDlgShow', true)
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (res.data.type != 4 && this.$store.state.mallId != this.$store.state.userInfo.mallId) {
|
|
||||||
// Message.error('您当前登录的TEMU账号与会员绑定账号不一致')
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// console.log("获取用户信息失败")
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
robFunc(sn, mallId) {
|
robFunc(sn, mallId) {
|
||||||
let _this = this;
|
let _this = this;
|
||||||
@@ -347,6 +392,16 @@
|
|||||||
"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.addSuccessInfo(this.choosedList[j]);
|
this.addSuccessInfo(this.choosedList[j]);
|
||||||
@@ -355,6 +410,11 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果需要创建发货单
|
||||||
|
if (this.isCreateDeliveryBill) {
|
||||||
|
this.createDeliveryBill(sn, mallId)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
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) {
|
||||||
@@ -362,14 +422,71 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.isBegin) {
|
if (0 == this.robMode) {
|
||||||
setTimeout(() => {
|
if (this.isBegin) {
|
||||||
this.rob(sn, mallId)
|
setTimeout(() => {
|
||||||
}, this.choosedList.length * this.step)
|
this.rob(sn, mallId)
|
||||||
|
}, this.choosedList.length * this.step)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
createDeliveryBill(sn, mallId) {
|
||||||
|
sendChromeAPIMessage({
|
||||||
|
url: 'bgSongbird-api/supplier/deliverGoods/platform/pageQuerySubPurchaseOrder',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: mallId,
|
||||||
|
data: {
|
||||||
|
"pageNo": 1,
|
||||||
|
"pageSize": 10,
|
||||||
|
"subPurchaseOrderSnList": [
|
||||||
|
sn
|
||||||
|
]
|
||||||
|
}}).then((res) => {
|
||||||
|
if (res.errorCode == 1000000) {
|
||||||
|
let data = res.result.list[0]
|
||||||
|
let deliverOrderDetailInfos = data.orderDetailVOList.map(item => {
|
||||||
|
return {
|
||||||
|
productSkuId: item.productSkuId,
|
||||||
|
deliverSkuNum: item.productSkuPurchaseQuantity
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let packageDetailSaveInfos = data.orderDetailVOList.map(item => {
|
||||||
|
return {
|
||||||
|
productSkuId: item.productSkuId,
|
||||||
|
skuNum: item.productSkuPurchaseQuantity
|
||||||
|
}
|
||||||
|
})
|
||||||
|
let packageInfos = []
|
||||||
|
packageInfos.push({packageDetailSaveInfos: packageDetailSaveInfos})
|
||||||
|
|
||||||
|
let deliveryOrderCreateInfos = []
|
||||||
|
deliveryOrderCreateInfos.push({
|
||||||
|
deliverOrderDetailInfos: deliverOrderDetailInfos,
|
||||||
|
subPurchaseOrderSn: data.subPurchaseOrderBasicVO.subPurchaseOrderSn,
|
||||||
|
packageInfos: packageInfos
|
||||||
|
})
|
||||||
|
|
||||||
|
let deliveryOrderCreateGroupList = []
|
||||||
|
deliveryOrderCreateGroupList.push({
|
||||||
|
deliveryOrderCreateInfos: deliveryOrderCreateInfos,
|
||||||
|
receiveAddressInfo: data.subPurchaseOrderBasicVO.receiveAddressInfo,
|
||||||
|
subWarehouseId: data.subPurchaseOrderBasicVO.subWarehouseId
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(deliveryOrderCreateGroupList)
|
||||||
|
} else {
|
||||||
|
setTimeout(this.createDeliveryBillFun(sn, mallId), 1000)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
createDeliveryBillFun(sn, mallId) {
|
||||||
|
let _this = this;
|
||||||
|
return function() {
|
||||||
|
_this.createDeliveryBill(sn, mallId);
|
||||||
|
}
|
||||||
|
},
|
||||||
addSuccessInfo(obj) {
|
addSuccessInfo(obj) {
|
||||||
this.$http.post(`/api/successInfo/add`, {
|
this.$http.post(`/api/successInfo/add`, {
|
||||||
productName: obj.productName,
|
productName: obj.productName,
|
||||||
|
|||||||
Reference in New Issue
Block a user