This commit is contained in:
liushiwei
2023-11-08 13:39:21 +08:00
parent 66c89f71e1
commit 0e9d59b1eb
18 changed files with 939 additions and 443 deletions

View File

@@ -346,7 +346,7 @@
},
activated () {
this.addressList = []
this.getAddressInfo();
this.toGetAddressInfo();
},
methods: {
@@ -370,25 +370,39 @@
console.log(err)
})
},
getAddressInfo() {
this.mallList.map(item => {
sendChromeAPIMessage({
url: 'bgSongbird-api/supplier/address/queryDeliveryAddressInfo',
needMallId: true,
mallId: item.mallId,
data: {}}).then((res) => {
if (res.errorCode == 1000000) {
let addressArr = res.result.deliveryAddressInfoList.filter(i => {
return i.isDefault
})
toGetAddressInfo() {
this.addressList = []
this.getAddressInfo(0)
},
getAddressInfo(index) {
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) => {
if (res.errorCode == 1000000) {
let addressArr = res.result.deliveryAddressInfoList.filter(i => {
return i.isDefault
})
if (addressArr.length > 0) {
this.addressList.push({
mallId: item.mallId,
mallId: mallInfo.mallId,
addressId: addressArr[0].id
})
} else {
Message.error("店铺【" + mallInfo.name + "】未设置默认发货地址,将无法自动创建发货单")
}
})
this.getAddressInfo(index + 1)
} else {
this.getAddressInfo(index)
}
})
},
onConfirm () {
if (this.arr.length == 0) {