添加:特殊商品增加默认发货门店 当选中的门店无货源时,使用默认门店发货
This commit is contained in:
parent
2bc862e0c1
commit
eb852c8d17
|
|
@ -440,11 +440,6 @@
|
|||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -649,9 +644,11 @@
|
|||
intervalId: '',
|
||||
// 特殊商品处理
|
||||
agent_two_ids: [],
|
||||
agent_two_mer_id: 0,// 默认发货门店
|
||||
province_list: [],// 地区列表
|
||||
province_has_list: [],// 存在货源的地区ids
|
||||
province_has_info_list: [],// 存在货源的地区信息列表
|
||||
province_default: {},// 默认发货地区信息
|
||||
current_province_info: [],// 所在地区
|
||||
send_province_info: [],// 发货地区
|
||||
|
||||
|
|
@ -1147,6 +1144,7 @@
|
|||
that.$set(that, 'svipPrice', res.data.show_svip_info && res.data.show_svip_info.show_svip_price || false);
|
||||
// 省公司门店特殊商品处理
|
||||
that.$set(that, 'agent_two_ids', res.data.agent_two_ids || [])
|
||||
that.$set(that, 'agent_two_mer_id', res.data.agent_two_mer_id || [])
|
||||
that.$set(that, 'province_list', res.data.province_list || [])
|
||||
that.$set(that, 'province_has_list', res.data.province_has_list || [])
|
||||
|
||||
|
|
@ -1866,17 +1864,25 @@
|
|||
// console.log('当前选中地区 无货源')
|
||||
_this.getProvinceHasList();// 获取有货源的列表
|
||||
if (Object.values(_this.province_has_info_list).length >= 2) {
|
||||
// 有货源的地区大于二
|
||||
// console.log('有货源的地区大于二')
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '本地区暂无库存,请选择发货地区!',
|
||||
confirmText: '去选择',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
_this.$refs.sendProvincePopup.open('bottom');
|
||||
}
|
||||
});
|
||||
// 有货源的地区大于二 判断:默认发货门店是否有货源;有货源的直接使用默认门店,无货源则选择
|
||||
// console.log('有货源的门店列表', Object.values(_this.province_has_list))
|
||||
// console.log("默认发货门店id", _this.agent_two_mer_id)
|
||||
if(Object.values(_this.province_has_list).includes(Number(_this.agent_two_mer_id))){
|
||||
// 默认发货门店存在货源
|
||||
// console.log("默认发货门店", _this.province_default)
|
||||
_this.send_province_info = _this.province_default;
|
||||
} else{
|
||||
// 默认发货门店不存在货源
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '本地区暂无库存,请选择发货地区!',
|
||||
confirmText: '去选择',
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
_this.$refs.sendProvincePopup.open('bottom');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (Object.values(_this.province_has_info_list).length == 1) {
|
||||
// 有货源的地区等于1
|
||||
|
|
@ -1908,9 +1914,14 @@
|
|||
let _this = this;
|
||||
let list = [];
|
||||
Object.values(_this.province_list).forEach((item) => {
|
||||
// 获取存在货源列表
|
||||
if(Object.values(_this.province_has_list).includes(Number(item.mer_id))){
|
||||
list[Object.values(list).length] = Object.assign({}, item);
|
||||
}
|
||||
// 默认发货地区信息
|
||||
if(_this.agent_two_mer_id > 0 && Number(_this.agent_two_mer_id) === Number(item.mer_id)){
|
||||
_this.province_default = Object.assign({}, item);
|
||||
}
|
||||
})
|
||||
|
||||
_this.province_has_info_list = Object.values(list);
|
||||
|
|
@ -1921,12 +1932,6 @@
|
|||
this.$refs.sendProvincePopup.close();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -2008,9 +2013,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.ml8{
|
||||
top:2rpx
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue