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

fix: 处理编辑采购订单发票回显问题

parent cd4421e9
...@@ -37,24 +37,25 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => { ...@@ -37,24 +37,25 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
}) })
} }
} else if(pageStatus === PageStatus.EDIT){ } else if(pageStatus === PageStatus.EDIT){
// console.log(value, mode, dataSource, 'vvv') // @bug todo 编辑情况下 默认显示有问题 固定第一个
// console.log(value, mode, dataSource, 'EDIT')
if(typeof value === 'object') { if(typeof value === 'object') {
// console.log('o')
let target = (mode === 'add' || mode === 'delete') ? dataSource[0] : value let target = (mode === 'add' || mode === 'delete') ? dataSource[0] : value
setFieldState({ setFieldState({
dataSource, dataSource,
showMore, showMore,
useValue: target useValue: target
}) })
// console.log('isObject', target)
mutators.change(target) mutators.change(target)
} else { } else {
let target = dataSource.find(v => v.id === value) let target = dataSource.length ? dataSource.find(v => v.id === value) : value
// console.log(target, 'target')
setFieldState({ setFieldState({
dataSource, dataSource,
showMore, showMore,
useValue: target useValue: target
}) })
// console.log('notObject', target)
mutators.change(target) mutators.change(target)
} }
} }
...@@ -89,9 +90,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => { ...@@ -89,9 +90,7 @@ const TheInvoiceList = (props: ISchemaFieldComponentProps) => {
form.setFieldValue("needTheInvoice", 0) form.setFieldValue("needTheInvoice", 0)
} }
// 订单新增 重载全部置为第一个 // 订单新增 重载全部置为第一个
// console.log(value, '-2')
if(pageStatus === PageStatus.ADD) { if(pageStatus === PageStatus.ADD) {
// console.log(value, '-1')
setFieldState({ setFieldState({
dataSource: data, dataSource: data,
showMore, showMore,
......
...@@ -290,7 +290,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -290,7 +290,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
if(pageStatus === PageStatus.EDIT){ if(pageStatus === PageStatus.EDIT){
if(state?.dataSource?.length && state.loading) { if(state?.dataSource?.length && state.loading) {
ctx.submit((values) => { ctx.submit((values) => {
console.log(values, value, path, '发票id') // console.log(values, value, path, '发票id')
if(values){ if(values){
PublicApi.postOrderProcurementOrderUpdate({ PublicApi.postOrderProcurementOrderUpdate({
...values, ...values,
...@@ -313,7 +313,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA ...@@ -313,7 +313,7 @@ export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormA
if(pageStatus === PageStatus.EDIT){ if(pageStatus === PageStatus.EDIT){
if(state?.dataSource?.length && state.loading) { if(state?.dataSource?.length && state.loading) {
ctx.submit((values) => { ctx.submit((values) => {
console.log(values, value, path, '发货地址id') // console.log(values, value, path, '发货地址id')
if(values){ if(values){
PublicApi.postOrderProcurementOrderUpdate({ PublicApi.postOrderProcurementOrderUpdate({
...values, ...values,
......
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