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

fix:修改订单-修改商品价格时无法修改支付信息

parent 96ee62f7
......@@ -87,6 +87,7 @@ export const useEditHideField = () => {
export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, update) => {
FormEffectHooks.onFieldValueChange$('orderProductRequests').subscribe(state => {
const { value } = state
console.log(value)
const payInfoData = ctx.getFieldValue('paymentInformationResponses')
// 强制渲染一次, 用于触发金额总数
update()
......
......@@ -300,15 +300,25 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
TheInvoiceList
}}
effects={($, ctx) => {
if (id) {
ctx.setFieldState('orderModel', state => {
state.props["x-component-props"] = {
disabled: true
}
})
}
$('onFormMount').subscribe(() => {
if (id) {
ctx.setFieldState('orderModel', state => {
state.props["x-component-props"] = {
disabled: true
}
})
}
})
// 监听商品总价的变更, 此处逻辑需优化
$('sumPrice').subscribe(payload => {
const oldData = [...addSchemaAction.getFieldValue('paymentInformationResponses')];
if (oldData && oldData.length > 0) {
const newData = oldData.map(v => {
v.payPrice = (v.payRatio / 100 * payload).toFixed(2)
return v
})
addSchemaAction.setFieldValue('paymentInformationResponses', newData)
}
setProductSumPrice(payload)
})
$('onFieldInputChange', 'orderModel').subscribe(state => {
......
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