Commit 0619d24d authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 新增b2b订单和订单支付涉及接口字段变更

parent 8982efb4
...@@ -35,7 +35,7 @@ width: 100%; ...@@ -35,7 +35,7 @@ width: 100%;
const { Option } = Select const { Option } = Select
const MultAddress = (props) => { const MultAddress = (props) => {
const { value, mutators } = props const { value: _v, mutators } = props
const { const {
placeholder = [], placeholder = [],
...@@ -43,6 +43,16 @@ const MultAddress = (props) => { ...@@ -43,6 +43,16 @@ const MultAddress = (props) => {
...rest ...rest
} = props.props["x-component-props"] || {} } = props.props["x-component-props"] || {}
// 处理表单提交置空触发错误角标提示
let value = null
if(!_v || !_v.length) {
value = [{ provinceCode: null, province: null, cityCode: null, city: null, areaCode: null, area: null }]
} else if(value?.length && !value[0]['provinceCode'] && !value[0]['province'] && !value[0]['cityCode'] && !value[0]['city'] && !value[0]['areaCode'] && !value[0]['area']) {
mutators.change([])
} else {
value = _v
}
const [code, setcode] = useState<any>([]); const [code, setcode] = useState<any>([]);
const [province, setprovince] = useState<any>([]); // 省列表 const [province, setprovince] = useState<any>([]); // 省列表
const [city, setcity] = useState<any>([]); // 市列表 const [city, setcity] = useState<any>([]); // 市列表
......
...@@ -282,6 +282,7 @@ const AddProducts: React.FC<{}> = (props) => { ...@@ -282,6 +282,7 @@ const AddProducts: React.FC<{}> = (props) => {
_params.minOrder = productInfoByEdit.minOrder _params.minOrder = productInfoByEdit.minOrder
_params.priceType = productInfoByEdit.priceType _params.priceType = productInfoByEdit.priceType
_params.isMemberPrice = productInfoByEdit.isMemberPrice _params.isMemberPrice = productInfoByEdit.isMemberPrice
_params.taxRate = productInfoByEdit.taxRate
} }
if (clickTabIndex.indexOf("6") === -1) // 商品描述 if (clickTabIndex.indexOf("6") === -1) // 商品描述
_params.commodityRemark = productInfoByEdit.commodityRemark _params.commodityRemark = productInfoByEdit.commodityRemark
......
...@@ -18,8 +18,8 @@ export const fieldTransformRender = (params) => { ...@@ -18,8 +18,8 @@ export const fieldTransformRender = (params) => {
result['submitTenderOutStatus'] = params.submitTenderOutStatusValue result['submitTenderOutStatus'] = params.submitTenderOutStatusValue
result['submitTenderInStatus'] = params.submitTenderInStatusValue result['submitTenderInStatus'] = params.submitTenderInStatusValue
// 给地址控件赋初值 // // 给地址控件赋初值
result['tenderAddress'] = [{ provinceCode: null, province: null, cityCode: null, city: null, areaCode: null, area: null }] // result['tenderAddress'] = [{ provinceCode: null, province: null, cityCode: null, city: null, areaCode: null, area: null }]
return result return result
} }
......
...@@ -45,11 +45,14 @@ const AddBidRegister:React.FC<AddBidRegisterProps> = (props) => { ...@@ -45,11 +45,14 @@ const AddBidRegister:React.FC<AddBidRegisterProps> = (props) => {
}, [id]) }, [id])
const handleSubmit = async (value) => { const handleSubmit = async (value) => {
setBtnLoading(true)
const result = formDataTransformParams(value) const result = formDataTransformParams(value)
PublicApi.postPurchaseSubmitTenderSubmitTenderRegister(result).then(res => { PublicApi.postPurchaseSubmitTenderSubmitTenderRegister(result).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
history.goBack() history.goBack()
} }
}).finally(() => {
setBtnLoading(false)
}) })
} }
......
...@@ -240,7 +240,7 @@ export const formSchema: ISchema = { ...@@ -240,7 +240,7 @@ export const formSchema: ISchema = {
placeholder: '选择单位地址', placeholder: '选择单位地址',
warningText: '请完善所在地区', warningText: '请完善所在地区',
}, },
default: [{ provinceCode: null, province: null, cityCode: null, city: null, areaCode: null, area: null }], // default: [{ provinceCode: null, province: null, cityCode: null, city: null, areaCode: null, area: null }],
required: true, required: true,
}, },
address: { address: {
......
...@@ -50,6 +50,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -50,6 +50,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidatePay) const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidatePay)
const [settleAccountsError, setSettleAccountsError] = useState<boolean>(true) const [settleAccountsError, setSettleAccountsError] = useState<boolean>(true)
const [paymentAmount ,setPaymentAmount] = useState<string>() const [paymentAmount ,setPaymentAmount] = useState<string>()
const [tradeNo, setTradeNo] = useState<string>() // 需要轮询支付结果的交易号
useEffect(() => { useEffect(() => {
if (currentRef) { if (currentRef) {
...@@ -105,7 +106,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -105,7 +106,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const pollPayResult = () => { const pollPayResult = () => {
if(qrCodeInfo.qrUrl) { if(qrCodeInfo.qrUrl) {
// @ts-ignore // @ts-ignore
PublicApi.getOrderBuyerValidatePayResult({orderId: id, batchNo: currentPaymentInfo.batchNo}).then(res => { PublicApi.getOrderBuyerValidatePayResult({orderId: id, batchNo: currentPaymentInfo.batchNo, tradeNo}).then(res => {
const { code, data } = res const { code, data } = res
if(code === 1000) { if(code === 1000) {
if(data && data.paySuccess) { if(data && data.paySuccess) {
...@@ -297,7 +298,8 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => { ...@@ -297,7 +298,8 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(mobilePayFlag.current !== 4) { // 非微信 if(mobilePayFlag.current !== 4) { // 非微信
history.goBack() history.goBack()
} else { } else {
setQrCodeInfo({ ...qrCodeInfo, generateCharacter: res.data }) setQrCodeInfo({ ...qrCodeInfo, generateCharacter: res.data.codeUrl })
setTradeNo(res.data.tradeNo)
setQrLoading(false) setQrLoading(false)
} }
} else { } else {
......
...@@ -110,7 +110,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => { ...@@ -110,7 +110,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
let free = modalPriceActions.getFieldValue('freePrice') let free = modalPriceActions.getFieldValue('freePrice')
setFreePrice(Number(free || 0)) setFreePrice(Number(free || 0))
// 执行修改订单运费 // 执行修改订单运费
PublicApi.postOrderProductPriceUpdate({orderId: dataSource.id, price: free, type: 2}).then(res => { PublicApi.postOrderProductPriceUpdate({orderId: dataSource.orderId, price: free, type: 2}).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
modelRef.current.setVisible(false) modelRef.current.setVisible(false)
reloadFormData() reloadFormData()
...@@ -307,7 +307,8 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => { ...@@ -307,7 +307,8 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const warehouseRef = useRef<any>({}) const warehouseRef = useRef<any>({})
// 判断是否可操作当前表格 // 判断是否可操作当前表格
const isEditData = false const isEditData = true
const productComponents = { const productComponents = {
body: { body: {
row: EditableRow, row: EditableRow,
...@@ -357,7 +358,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => { ...@@ -357,7 +358,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
...row, ...row,
}); });
// 执行修改订单价格 // 执行修改订单价格
PublicApi.postOrderProductPriceUpdate({orderId: data.id, orderDetailsId: row.id, price: row.price, type: 1}).then(res => { PublicApi.postOrderProductPriceUpdate({orderId: data.orderId, orderDetailsId: row.id, price: row.price, type: 1}).then(res => {
if(res.code === 1000) { if(res.code === 1000) {
reloadFormData() reloadFormData()
} }
......
...@@ -73,6 +73,10 @@ export const procurementRenderField = (data) => { ...@@ -73,6 +73,10 @@ export const procurementRenderField = (data) => {
// 冗余shopId orderMode查询支付方式使用 // 冗余shopId orderMode查询支付方式使用
shopId: data.shopId, shopId: data.shopId,
orderMode: data.orderMode, orderMode: data.orderMode,
// 转换上游字段
upperMemberId: item.supplyMemberId,
upperMemberName: item.supplyMemberName,
upperMemberRoleId: item.supplyRoleId,
} }
}) })
} }
...@@ -90,6 +94,10 @@ export const procurementProcessField = (value) => { ...@@ -90,6 +94,10 @@ export const procurementProcessField = (value) => {
logisticsTemplateId: item.logistics.templateId, logisticsTemplateId: item.logistics.templateId,
weight: item.logistics.weight, weight: item.logistics.weight,
stockId: item.upperCommoditySkuId, stockId: item.upperCommoditySkuId,
// 上游字段
supplyMemberId: item.upperMemberId,
supplyRoleId: item.upperMemberRoleId,
supplyMemberName: item.upperMemberName,
} }
}) })
return value return value
......
...@@ -263,7 +263,15 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => { ...@@ -263,7 +263,15 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
addSchemaAction.setFieldValue('baseProcessId', data.baseProcessId) addSchemaAction.setFieldValue('baseProcessId', data.baseProcessId)
addSchemaAction.setFieldValue('allProducts', data.allProducts) addSchemaAction.setFieldValue('allProducts', data.allProducts)
if(data.payments.length) { if(data.payments.length) {
addSchemaAction.setFieldValue('payments', [...data.payments]) const { payments } = data
const source = payments.map(item => ({
...item,
nodes: item.nodes.map(_item => ({
..._item,
serialNo: item.serialNo
}))
}))
addSchemaAction.setFieldValue('payments', source)
} }
if(data.processType === 1) { if(data.processType === 1) {
addSchemaAction.setFieldState('expireHours', state => { addSchemaAction.setFieldState('expireHours', state => {
......
...@@ -45,12 +45,14 @@ export const usePaymentTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction ...@@ -45,12 +45,14 @@ export const usePaymentTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const handleSave = row => { const handleSave = row => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('payments')]; const newData = [...ctx.getFieldValue('payments')]
console.log(newData, row)
const paymentIndex = newData.findIndex(item => row.serialNo === item.serialNo ) const paymentIndex = newData.findIndex(item => row.serialNo === item.serialNo )
console.log(paymentIndex)
const nodeItem = newData[paymentIndex]['nodes'] const nodeItem = newData[paymentIndex]['nodes']
console.log(nodeItem)
const nodeIndex = nodeItem.findIndex(item => row.batchNo === item.batchNo) const nodeIndex = nodeItem.findIndex(item => row.batchNo === item.batchNo)
console.log(nodeIndex)
nodeItem.splice(nodeIndex, 1, { nodeItem.splice(nodeIndex, 1, {
...nodeItem[nodeIndex], ...nodeItem[nodeIndex],
...row, ...row,
......
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