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

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

parent 8982efb4
......@@ -35,7 +35,7 @@ width: 100%;
const { Option } = Select
const MultAddress = (props) => {
const { value, mutators } = props
const { value: _v, mutators } = props
const {
placeholder = [],
......@@ -43,6 +43,16 @@ const MultAddress = (props) => {
...rest
} = 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 [province, setprovince] = useState<any>([]); // 省列表
const [city, setcity] = useState<any>([]); // 市列表
......
......@@ -282,6 +282,7 @@ const AddProducts: React.FC<{}> = (props) => {
_params.minOrder = productInfoByEdit.minOrder
_params.priceType = productInfoByEdit.priceType
_params.isMemberPrice = productInfoByEdit.isMemberPrice
_params.taxRate = productInfoByEdit.taxRate
}
if (clickTabIndex.indexOf("6") === -1) // 商品描述
_params.commodityRemark = productInfoByEdit.commodityRemark
......
......@@ -18,8 +18,8 @@ export const fieldTransformRender = (params) => {
result['submitTenderOutStatus'] = params.submitTenderOutStatusValue
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
}
......
......@@ -45,11 +45,14 @@ const AddBidRegister:React.FC<AddBidRegisterProps> = (props) => {
}, [id])
const handleSubmit = async (value) => {
setBtnLoading(true)
const result = formDataTransformParams(value)
PublicApi.postPurchaseSubmitTenderSubmitTenderRegister(result).then(res => {
if(res.code === 1000) {
history.goBack()
}
}).finally(() => {
setBtnLoading(false)
})
}
......
......@@ -240,7 +240,7 @@ export const formSchema: ISchema = {
placeholder: '选择单位地址',
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,
},
address: {
......
......@@ -50,6 +50,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const { run, loading } = useHttpRequest(PublicApi.postOrderBuyerValidatePay)
const [settleAccountsError, setSettleAccountsError] = useState<boolean>(true)
const [paymentAmount ,setPaymentAmount] = useState<string>()
const [tradeNo, setTradeNo] = useState<string>() // 需要轮询支付结果的交易号
useEffect(() => {
if (currentRef) {
......@@ -105,7 +106,7 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
const pollPayResult = () => {
if(qrCodeInfo.qrUrl) {
// @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
if(code === 1000) {
if(data && data.paySuccess) {
......@@ -297,7 +298,8 @@ const OrderPayModal: React.FC<OrderPayModalProps> = (props) => {
if(mobilePayFlag.current !== 4) { // 非微信
history.goBack()
} else {
setQrCodeInfo({ ...qrCodeInfo, generateCharacter: res.data })
setQrCodeInfo({ ...qrCodeInfo, generateCharacter: res.data.codeUrl })
setTradeNo(res.data.tradeNo)
setQrLoading(false)
}
} else {
......
......@@ -110,7 +110,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
let free = modalPriceActions.getFieldValue('freePrice')
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) {
modelRef.current.setVisible(false)
reloadFormData()
......@@ -307,7 +307,8 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const warehouseRef = useRef<any>({})
// 判断是否可操作当前表格
const isEditData = false
const isEditData = true
const productComponents = {
body: {
row: EditableRow,
......@@ -357,7 +358,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
...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) {
reloadFormData()
}
......
......@@ -73,6 +73,10 @@ export const procurementRenderField = (data) => {
// 冗余shopId orderMode查询支付方式使用
shopId: data.shopId,
orderMode: data.orderMode,
// 转换上游字段
upperMemberId: item.supplyMemberId,
upperMemberName: item.supplyMemberName,
upperMemberRoleId: item.supplyRoleId,
}
})
}
......@@ -90,6 +94,10 @@ export const procurementProcessField = (value) => {
logisticsTemplateId: item.logistics.templateId,
weight: item.logistics.weight,
stockId: item.upperCommoditySkuId,
// 上游字段
supplyMemberId: item.upperMemberId,
supplyRoleId: item.upperMemberRoleId,
supplyMemberName: item.upperMemberName,
}
})
return value
......
......@@ -263,7 +263,15 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
addSchemaAction.setFieldValue('baseProcessId', data.baseProcessId)
addSchemaAction.setFieldValue('allProducts', data.allProducts)
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) {
addSchemaAction.setFieldState('expireHours', state => {
......
......@@ -45,12 +45,14 @@ export const usePaymentTable = (ctx: ISchemaFormActions | ISchemaFormAsyncAction
const handleSave = row => {
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 )
console.log(paymentIndex)
const nodeItem = newData[paymentIndex]['nodes']
console.log(nodeItem)
const nodeIndex = nodeItem.findIndex(item => row.batchNo === item.batchNo)
console.log(nodeIndex)
nodeItem.splice(nodeIndex, 1, {
...nodeItem[nodeIndex],
...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