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

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

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