Commit 5d3c8ca3 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理价格策略商城显示异常,所有类型下单添加街道字段,处理下单更新地址时街道字段选择异常。

parent d16fb273
......@@ -135,9 +135,7 @@ export const transformDataForNiceForm = (value: any, ctx: ISchemaFormActions | I
roleId: item.memberRoleId,
roleName: item.memberRoleName,
}))
let shopInfo = GlobalConfig.web.shopInfo.filter(item => item["type"] === value["type"] && item["environment"] === value["environment"])
initValue["shopId"] = shopInfo[0]["id"]
initValue["shopId"] = value["shopId"]
// Edit使用
initValue["memberUnitPriceList"] = value["memberUnitPriceList"]
......
import React, { useCallback, useState } from 'react'
import { Button, message, Card, } from 'antd'
import { Button, Card, } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { history } from "umi"
import ReutrnEle from '@/components/ReturnEle'
......
......@@ -61,13 +61,13 @@ export const baseOrderListColumns: any = () => {
dataIndex: 'orderTypeName',
key: 'orderTypeName',
},
{
title: '送货地址',
dataIndex: 'deliverAddress',
key: 'deliverAddress',
width: 164,
ellipsis: true,
},
// {
// title: '送货地址',
// dataIndex: 'deliverAddress',
// key: 'deliverAddress',
// width: 164,
// ellipsis: true,
// },
{
title: '外部状态',
align: 'center',
......
......@@ -175,6 +175,13 @@ const PurchaseOrder: React.FC<PurchaseOrderProps> = (props) => {
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
alreadyColumns.splice(6, 0, {
title: '送货地址',
dataIndex: 'deliverAddress',
key: 'deliverAddress',
width: 164,
ellipsis: true,
});
return alreadyColumns.concat([
{
title: '操作',
......
......@@ -46,10 +46,10 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
}
const handleSubmit = async (value) => {
const provinceName = addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const provinceName = value?.provinceName ? value.provinceName : addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = value?.cityName ? value.cityName : addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = value?.districtName ? value.districtName : addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value?.streetName ? value.streetName : value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const params = {
...value,
......@@ -84,6 +84,12 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
const useChainEffects = ($, ctx) => {
// 初始省份选择
renderSelectOption('provinceCode', ctx)
if (selfInitValue) {
const { provinceCode, cityCode, districtCode } = selfInitValue
renderSelectOption('cityCode', ctx, { pcode: provinceCode })
renderSelectOption('districtCode', ctx, { pcode: cityCode })
districtCode && renderSelectOption('streetCode', ctx, { pcode: districtCode })
}
// 市
$('onFieldValueChange', 'provinceCode').subscribe(({value}) => {
if(value) {
......
......@@ -310,6 +310,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = () => {
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
streetCode: addressDetail.streetCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: addressDetail.areaCode,
......
......@@ -8,7 +8,7 @@ import { getTransactionEnquiryProductAll, getTransactionProductQuotationList } f
export const fetchOrderApi = {
/** 弹窗获取商品列表 */
async getProductList(params) {
const { data } = await getProductCommodityCommonGetCommodityListByBuyer(params, { useCache: true, ttl: 10 * 1000 })
const { data } = await getProductCommodityCommonGetCommodityListByBuyer(params)
return data
},
......
......@@ -47,10 +47,10 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
}
const handleSubmit = async (value) => {
const provinceName = addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const provinceName = value?.provinceName ? value.provinceName : addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = value?.cityName ? value.cityName : addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = value?.districtName ? value.districtName : addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value?.streetName ? value.streetName : value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const params = {
...value,
......@@ -85,6 +85,12 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
const useChainEffects = ($, ctx) => {
// 初始省份选择
renderSelectOption('provinceCode', ctx)
if (selfInitValue) {
const { provinceCode, cityCode, districtCode } = selfInitValue
renderSelectOption('cityCode', ctx, { pcode: provinceCode })
renderSelectOption('districtCode', ctx, { pcode: cityCode })
districtCode && renderSelectOption('streetCode', ctx, { pcode: districtCode })
}
// 市
$('onFieldValueChange', 'provinceCode').subscribe(({value}) => {
if(value) {
......
......@@ -103,7 +103,7 @@ export const procurementProcessField = (value) => {
weight: item.logistics.weight,
stock: item.stockCount,
discount: item.isMemberPrice ? item.memberPrice : 1, // 字段需求 无折扣为1
price: item.isMemberPrice ? item.money / item.purchaseCount / item.memberPrice : item.money / item.purchaseCount,
price: item.isMemberPrice ? Number((item.money / item.purchaseCount / item.memberPrice).toFixed(2)) : Number((item.money / item.purchaseCoun).toFixed(2)),
tax: item.taxRate > 0,
vendorMemberId: item.memberId,
vendorRoleId: item.memberRoleId,
......
......@@ -270,6 +270,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = () => {
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
streetCode: addressDetail.streetCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: addressDetail.areaCode,
......
......@@ -46,10 +46,10 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
}
const handleSubmit = async (value) => {
const provinceName = addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const provinceName = value?.provinceName ? value.provinceName : addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = value?.cityName ? value.cityName : addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = value?.districtName ? value.districtName : addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value?.streetName ? value.streetName : value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const params = {
...value,
......@@ -84,6 +84,12 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
const useChainEffects = ($, ctx) => {
// 初始省份选择
renderSelectOption('provinceCode', ctx)
if (selfInitValue) {
const { provinceCode, cityCode, districtCode } = selfInitValue
renderSelectOption('cityCode', ctx, { pcode: provinceCode })
renderSelectOption('districtCode', ctx, { pcode: cityCode })
districtCode && renderSelectOption('streetCode', ctx, { pcode: districtCode })
}
// 市
$('onFieldValueChange', 'provinceCode').subscribe(({value}) => {
if(value) {
......
......@@ -235,6 +235,7 @@ const AddRequisitionOrder:React.FC<AddRequisitionOrderProps> = (props) => {
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
streetCode: addressDetail.streetCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: addressDetail.areaCode,
......
......@@ -46,10 +46,10 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
}
const handleSubmit = async (value) => {
const provinceName = addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const provinceName = value?.provinceName ? value.provinceName : addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = value?.cityName ? value.cityName : addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = value?.districtName ? value.districtName : addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value?.streetName ? value.streetName : value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const params = {
...value,
......@@ -84,6 +84,12 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
const useChainEffects = ($, ctx) => {
// 初始省份选择
renderSelectOption('provinceCode', ctx)
if (selfInitValue) {
const { provinceCode, cityCode, districtCode } = selfInitValue
renderSelectOption('cityCode', ctx, { pcode: provinceCode })
renderSelectOption('districtCode', ctx, { pcode: cityCode })
districtCode && renderSelectOption('streetCode', ctx, { pcode: districtCode })
}
// 市
$('onFieldValueChange', 'provinceCode').subscribe(({value}) => {
if(value) {
......
......@@ -212,6 +212,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
streetCode: addressDetail.streetCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: addressDetail.areaCode,
......
......@@ -8,7 +8,7 @@ import { getTransactionEnquiryProductAll, getTransactionProductQuotationList } f
export const fetchOrderApi = {
/** 弹窗获取商品列表 */
async getProductList(params) {
const { data } = await getProductCommodityCommonGetCommodityListByBuyer(params, { useCache: true, ttl: 10 * 1000 })
const { data } = await getProductCommodityCommonGetCommodityListByBuyer(params)
return data
},
......
......@@ -49,10 +49,10 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
}
const handleSubmit = async (value) => {
const provinceName = addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const provinceName = value?.provinceName ? value.provinceName : addressSchemaAction.getFieldState('provinceCode')['values'][1]['title']
const cityName = value?.cityName ? value.cityName : addressSchemaAction.getFieldState('cityCode')['values'][1]['title']
const districtName = value?.districtName ? value.districtName : addressSchemaAction.getFieldState('districtCode')['values'][1]['title']
const streetName = value?.streetName ? value.streetName : value['streetCode'] ? addressSchemaAction.getFieldState('streetCode')['values'][1]['title'] : null
const roleId = ctx.getFieldValue('buyerRoleId')
const memberId = ctx.getFieldValue('buyerMemberId')
......@@ -96,9 +96,16 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
const useChainEffects = ($, ctx) => {
// 初始省份选择
renderSelectOption('provinceCode', ctx)
if (selfInitValue) {
const { provinceCode, cityCode, districtCode } = selfInitValue
renderSelectOption('cityCode', ctx, { pcode: provinceCode })
renderSelectOption('districtCode', ctx, { pcode: cityCode })
districtCode && renderSelectOption('streetCode', ctx, { pcode: districtCode })
}
// 市
$('onFieldValueChange', 'provinceCode').subscribe(({value}) => {
if(value) {
console.log(value)
ctx.setFieldValue('cityCode', null)
ctx.setFieldValue('districtCode', null)
ctx.setFieldValue('streetCode', null)
......@@ -108,6 +115,7 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
// 区/县
$('onFieldValueChange', 'cityCode').subscribe(({value}) => {
if(value) {
console.log(value)
ctx.setFieldValue('districtCode', null)
ctx.setFieldValue('streetCode', null)
renderSelectOption('districtCode', ctx, { pcode: value })
......@@ -116,6 +124,7 @@ const AddressModal:React.FC<AddressModalProps> = (props) => {
// 街道/乡/镇
$('onFieldValueChange', 'districtCode').subscribe(({value}) => {
if(value) {
console.log(value)
ctx.setFieldValue('streetCode', null)
renderSelectOption('streetCode', ctx, { pcode: value })
}
......
......@@ -22,7 +22,7 @@ export const PriceComp = (props) => {
</div>
}
/** 修改b2b询价报价下单 初始值转换 */
/**代客下单 初始值转换 */
export const procurmentRenderInit = (initValue: any) => {
return {
......@@ -48,7 +48,7 @@ export const procurmentRenderInit = (initValue: any) => {
}
}
/** 修改b2b询价报价下单 回显商品字段转换 */
/** 代客下单 回显商品字段转换 */
export const procurementRenderField = (data) => {
const _orderProductRequests = data.product.products
return _orderProductRequests.map(item => {
......@@ -94,7 +94,7 @@ export const procurementProcessField = (value) => {
weight: item.logistics.weight,
stock: item.stockCount,
discount: item.isMemberPrice ? item.memberPrice : 1, // 字段需求 无折扣为1
price: item.isMemberPrice ? item.money / item.purchaseCount / item.memberPrice : item.money / item.purchaseCount,
price: item.isMemberPrice ? Number((item.money / item.purchaseCount / item.memberPrice).toFixed(2)) : Number((item.money / item.purchaseCount).toFixed(2)),
tax: item.taxRate > 0,
vendorMemberId: item.memberId,
vendorRoleId: item.memberRoleId,
......
......@@ -273,6 +273,7 @@ const AgentOrderDetail:React.FC<AgentOrderDetailProps> = (props) => {
provinceCode: addressDetail.provinceCode,
cityCode: addressDetail.cityCode,
districtCode: addressDetail.districtCode,
streetCode: addressDetail.streetCode,
address: addressDetail.address,
postalCode: addressDetail.postalCode,
countryCode: addressDetail.areaCode,
......
......@@ -120,11 +120,11 @@ export const baseOrderListColumns: any = () => {
key: 'amount',
render: (t, r) => (r.orderType === ORDER_TYPE_POINTS || r.orderType === ORDER_TYPE_CHANNEL_POINTS) ? t : `¥${t}`
},
{
title: '订单类型',
dataIndex: 'orderTypeName',
key: 'orderTypeName',
},
// {
// title: '订单类型',
// dataIndex: 'orderTypeName',
// key: 'orderTypeName',
// },
{
title: '送货地址',
dataIndex: 'deliverAddress',
......
......@@ -199,6 +199,13 @@ const SaleOrder: React.FC<SaleOrderProps> = () => {
const secondColumns = () => {
const alreadyColumns = baseOrderListColumns()
if(alreadyColumns) {
alreadyColumns.splice(6, 0, {
title: '送货地址',
dataIndex: 'deliverAddress',
key: 'deliverAddress',
width: 164,
ellipsis: true,
})
return alreadyColumns.concat([
{
title: '操作',
......
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