发票订单修改

This commit is contained in:
xixi 2024-10-08 15:09:37 +08:00
parent aa778a985e
commit f44996f355

View File

@ -4,19 +4,19 @@ import {useEffect, useRef, useState} from "react";
import {get} from "../../../util/AjaxUtils.ts";
import {IListPage} from "../../../interfaces/listpage/IListPage.ts";
type DetailDataType = {
type DetailDataType = [{
productType: string;
quantity: number;
unitPrice: number;
notes: string;
productDescription: string;
}
}]
type DataType = {
orderId: string;
orderNo: string;
totalAmount: number;
detail: DetailDataType;
orderDetails: DetailDataType;
orderStatus: string;
gmtCreate: string;
}
@ -75,17 +75,17 @@ export default function InvoiceInfoList(props: ListProps) {
},
{
title: '产品类型',
dataIndex: 'detail.productType',
dataIndex: 'orderDetails.productType',
align: 'center',
width: 100,
render: (_value, record) => {
if(record.detail.productType === 'PROJ') {
if(record.orderDetails[0].productType === 'PROJ') {
return '项目创建'
}
if(record.detail.productType === 'AGENT') {
if(record.orderDetails[0].productType === 'AGENT') {
return '项目代理'
}
return record.detail.productType
return record.orderDetails[0].productType
}
},
{
@ -94,7 +94,7 @@ export default function InvoiceInfoList(props: ListProps) {
align: 'center',
width: 100,
render: (_value, record) => {
return record.detail.quantity
return record.orderDetails[0].quantity
}
},
{
@ -103,28 +103,28 @@ export default function InvoiceInfoList(props: ListProps) {
align: 'center',
width: 100,
render: (_value, record) => {
return (record.detail.unitPrice / 100).toFixed(2)
return (record.orderDetails[0].unitPrice / 100).toFixed(2)
}
},
{
title: '订单备注',
dataIndex: 'detail.notes',
align: 'center',
width: 120,
width: 300,
render: (_value, record) => {
return record.detail.notes
return record.orderDetails[0].notes
}
},
{
title: '描述',
dataIndex: 'detail.productDescription',
align: 'center',
width: 200,
width: 300,
ellipsis: {
showTitle: false,
},
render: (_value, record) => {
return <Tooltip placement="top" title={record.detail.productDescription}>{record.detail.productDescription}</Tooltip>
return <Tooltip placement="top" title={record.orderDetails[0].productDescription}>{record.orderDetails[0].productDescription}</Tooltip>
}
},
]
@ -140,6 +140,8 @@ export default function InvoiceInfoList(props: ListProps) {
}
},
onSuccess({data}) {
console.log('数据',data.rows);
setPage(data.page);
setTotal(data.total);
setDataArray(data.rows);