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

111

parent d917c071
......@@ -131,6 +131,7 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
// 从商城跳转, 需回显数据
if (initValue) {
const fn = async () => {
const productInfo = initValue.orderList[0].orderList
ctx.setFieldValue('supplyMembersId', initValue.supplyMembersId)
ctx.setFieldValue('supplyMembersName', initValue.supplyMembersName)
......@@ -150,6 +151,14 @@ export const useOrderFormInitEffect = (ctx: ISchemaFormActions | ISchemaFormAsyn
})))
}
// 回显的数据保存在表单中, 当切换下单模式时,可以再次回显
ctx.setFormState(state => {
state.remoteDataFn = fn
})
fn()
}
// 写入收货地址数据
useProductAddress(ctx)
})
......
......@@ -278,7 +278,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
<NiceForm
loading={formLoading}
previewPlaceholder=' '
editable={pageStatus !== PageStatus.PREVIEW}
// editable={pageStatus !== PageStatus.PREVIEW}
value={initFormValue}
actions={addSchemaAction}
schema={mergeAllSchemas[page_type]}
......@@ -293,9 +293,14 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
setProductSumPrice(payload)
})
$('onFieldInputChange', 'orderModel').subscribe(state => {
const { editable } = state
const { editable, value } = state
// 手动切换过下单模式, 需重置受下单模式影响的字段
if (editable) {
if (value === OrderModalType.PURCHASE_ORDER) {
// 进货单下单,尝试回显保存的数据
console.log(state)
return ;
}
ctx.reset({
validate: false,
selector: '*(quotationNo,supplyMembersName,orderProductRequests)'
......
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