Commit c02efe35 authored by 前端-许佳敏's avatar 前端-许佳敏

Merge branch 'v2-220318' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into v2-220318

parents 48514db7 9fd8a0b9
......@@ -274,6 +274,26 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = () => {
throw new Error(intl.formatMessage({id: 'purchaseOrder.orderCollect.error5'}))
}
// 校验配送区域范围
const { commodityAreaList, isAllArea } = value['products'][0]
const { provinceCode, cityCode, districtCode, streetCode } = value['deliveryAddresId']
if(!isAllArea && commodityAreaList.length > 0) {
const ressult = commodityAreaList.some(item => {
if(item['provinceCode'] === provinceCode && item['isAllCity']) { // 省内配送
return true
} else if(item['provinceCode'] === provinceCode && !item['isAllCity'] && item['cityCode'] === cityCode && item['isAllRegion']) { // 省内市际配送
return true
} if(item['provinceCode'] === provinceCode && !item['isAllCity'] && item['cityCode'] === cityCode && !item['isAllRegion'] && item['regionCode'] === districtCode) { // 省内市际区域配送
return true
} else {
return false
}
})
if(!ressult) {
throw new Error('当前订单不在配送范围内')
}
}
setBtnLoading(true)
/** 字段转换 */
......@@ -482,7 +502,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = () => {
$('onFieldValueChange', 'vendorMemberId').subscribe(async state => {
const role = ctx.getFieldValue('vendorRoleId') || jumpFormValueRef.current.vendorRoleId
const data = await fectchShopListsSource({
environment: 1,
// environment: 1,
hasMemberType: 1,
memberId: state.value,
roleId: role
......
......@@ -75,7 +75,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
if(pageStatus === PageStatus.ADD) { // 新增下 需要支付信息生成支付次数
ctx.setFieldValue('payments', []) // 变动后先 清空支付信息
const shopId = ctx.getFieldValue('shopId')
const products = value.map(item => ({ productId: item.commodityId, skuId: item.id }))
const products = value.map(item => ({ productId: item.commodityId, skuId: item.id, crossBorder: item.isCrossBorder }))
if(shopId && products?.length) {
// 判断不存在物流 隐藏交付地址
if(!value.some(item => item.logistics.deliveryType === 1)) {
......
......@@ -44,7 +44,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
roleId: memberRoleId,
shopId: products[0]['shopId'],
orderMode: products[0]['orderMode'],
products: products.map(item => ({ productId: item.commodityId, skuId: item.id }))
products: products.map(item => ({ productId: item.commodityId, skuId: item.id, crossBorder: item.isCrossBorder }))
}, { ctlType: 'none' }).then(res => {
const { code, data } = res
if (code === 1000) {
......
......@@ -75,7 +75,7 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
if(pageStatus === PageStatus.ADD) { // 新增下 需要支付信息生成支付次数
ctx.setFieldValue('payments', []) // 变动后先 清空支付信息
const shopId = ctx.getFieldValue('shopId')
const products = value.map(item => ({ productId: item.commodityId, skuId: item.id }))
const products = value.map(item => ({ productId: item.commodityId, skuId: item.id, crossBorder: item.isCrossBorder }))
if(shopId && products?.length) {
// 判断不存在物流 隐藏交付地址
if(!value.some(item => item.logistics.deliveryType === 1)) {
......
......@@ -42,7 +42,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
const getPayLists = (memberId, memberRoleId) => {
postOrderVendorCreateAgentPaymentFind({
shopId: products[0]['shopId'],
products: products.map(item => ({ productId: item.commodityId, skuId: item.id }))
products: products.map(item => ({ productId: item.commodityId, skuId: item.id, crossBorder: item.isCrossBorder }))
}, { ctlType: 'none' }).then(res => {
const { code, data } = res
if (code === 1000) {
......
......@@ -60,6 +60,13 @@ export const useSelfTable = () => {
key: 'orderTypeName',
},
{
title: intl.formatMessage({ id: 'saleOrder.songhuodizhi', defaultMessage: '送货地址' }),
dataIndex: 'deliverAddress',
key: 'deliverAddress',
width: 164,
ellipsis: true,
},
{
title: intl.formatMessage({ id: 'saleOrder.waibuzhuangtai', defaultMessage: '外部状态' }),
dataIndex: 'outerStatusName',
key: 'outerStatusName',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment