-
¥{(props.invoice.invoiceAmount / 100.0).toFixed(2)}
-
{invoiceTypeNameMap.get(props.invoice.invoiceKind)}
+
+ ¥{(props.invoice.invoiceAmount / 100.0).toFixed(2)}
+ {props.showUploader ? props.invoice.invoiceUploader.staffName : ''}
+
+
+ {invoiceTypeNameMap.get(props.invoice.invoiceKind)}
+ {props.showUploader ? props.invoice.invoiceUploader.staffId : ''}
+
{props.invoice.invoiceNo}
{props.invoice.invoiceDate}
@@ -271,7 +326,7 @@ function InvoiceItem(props: { invoice: Invoice, onClick(invoice: Invoice): void
}
-function InvoiceListView(props: {}) {
+function InvoiceListView(props: { isManagement: boolean }) {
const [totalNum, setTotalNum] = useState(0)
const [invoices, setInvoices] = useState([] as any[])
const [search, setSearch] = useSearchParams()
@@ -300,9 +355,8 @@ function InvoiceListView(props: {}) {
params.pageSize = Number(search.get('pageSize'))
else
params.pageSize = 10
-
- params.invoiceUploaderId = store.getState().token.staffId
-
+ if (!props.isManagement)
+ params.invoiceUploaderId = store.getState().token.staffId
axiosInstance({
url: 'common/invoice?' + qs.stringify(params, {skipNulls: true, arrayFormat: 'indices'}),
method: 'get',
@@ -316,7 +370,7 @@ function InvoiceListView(props: {}) {
}
const onChange = (pageCurrentNum: Number, pageCurrentSize: Number) => {
console.log(pageCurrentNum, pageCurrentSize)
- navigate('/invoice/mine?currentPage=' + pageCurrentNum + '&pageSize=' + pageCurrentSize)
+ navigate('?currentPage=' + pageCurrentNum + '&pageSize=' + pageCurrentSize)
}
const onItemClick = (invoice: Invoice) => {
@@ -333,7 +387,6 @@ function InvoiceListView(props: {}) {
}).catch(function (error) {
console.log(error)
})
-
}
useEffect(() => {
@@ -345,11 +398,12 @@ function InvoiceListView(props: {}) {
console.log(invoices)
return (