This commit is contained in:
刘仕伟
2024-01-26 00:20:31 +08:00
parent 7eec4b50ce
commit cd08530b62
3 changed files with 72 additions and 42 deletions

View File

@@ -449,20 +449,21 @@
},
toGetAddressInfo() {
this.addressList = []
this.getAddressInfo(0)
this.getAddressInfo()
},
getAddressInfo(index) {
async getAddressInfo() {
if (!this.mallList) {
Message.error('获取默认发货地址失败,请刷新重试')
return
}
if (index == this.mallList.length) return
let mallInfo = this.mallList[index]
sendChromeAPIMessage({
url: 'bgSongbird-api/supplier/address/queryDeliveryAddressInfo',
needMallId: true,
mallId: mallInfo.mallId,
data: {}}).then((res) => {
for (let index = 0; index < this.mallList.length; index++) {
let mallInfo = this.mallList[index]
while(true) {
let res = await sendChromeAPIMessage({
url: 'bgSongbird-api/supplier/address/queryDeliveryAddressInfo',
needMallId: true,
mallId: mallInfo.mallId,
data: {}})
if (res.errorCode == 1000000) {
let addressArr = res.result.deliveryAddressInfoList.filter(i => {
return i.isDefault
@@ -475,11 +476,10 @@
} else {
Message.error("店铺【" + mallInfo.mallName + "】未设置默认发货地址,将无法自动创建发货单")
}
this.getAddressInfo(index + 1)
} else {
Message.error("店铺【" + mallInfo.mallName + "】获取默认发货址失败,将无法自动创建发货单")
break
}
})
}
}
},
onConfirm () {
if (this.arr.length == 0) {