R109/A2,A3,A4 改进移动报销和发票上传体验
这个提交包含在:
@@ -8,6 +8,7 @@ import { PageHeader } from "../components/common/PageHeader";
|
||||
import { PageScaffold } from "../components/patterns/PageScaffold";
|
||||
import { Button } from "../components/ui/button";
|
||||
import { Spinner } from "../components/ui/spinner";
|
||||
import { withUploadTimeout } from "../lib/uploadTimeout";
|
||||
import {
|
||||
enqueueInvoiceUpload,
|
||||
listQueuedInvoiceUploads,
|
||||
@@ -58,7 +59,7 @@ export function MobileCapturePage() {
|
||||
|
||||
for (const [index, file] of files.entries()) {
|
||||
try {
|
||||
await uploadInvoice(file, "vat");
|
||||
await withUploadTimeout((signal) => uploadInvoice(file, "vat", undefined, { signal }));
|
||||
result.succeeded += 1;
|
||||
} catch (err) {
|
||||
if (isLikelyNetworkError(err)) {
|
||||
@@ -118,7 +119,7 @@ export function MobileCapturePage() {
|
||||
for (const item of items) {
|
||||
try {
|
||||
const file = queuedItemToFile(item);
|
||||
await uploadInvoice(file, "vat");
|
||||
await withUploadTimeout((signal) => uploadInvoice(file, "vat", undefined, { signal }));
|
||||
await removeQueuedInvoiceUpload(item.id);
|
||||
succeeded += 1;
|
||||
} catch {
|
||||
|
||||
文件差异内容过多而无法显示
加载差异
@@ -76,7 +76,7 @@ function ReimbursementCard({ item }: { item: ReimbursementListItem }) {
|
||||
{item.description ? <p className="mt-3 line-clamp-2 text-sm text-zinc-500">{item.description}</p> : null}
|
||||
|
||||
<Button asChild className="mt-4 w-full" type="button">
|
||||
<Link to={`/reimbursements/${item.id}`}>{actionLabel}</Link>
|
||||
<Link to={`/mobile/reimbursements/${item.id}`}>{actionLabel}</Link>
|
||||
</Button>
|
||||
</article>
|
||||
);
|
||||
@@ -99,7 +99,7 @@ export function MobileReimbursementsPage() {
|
||||
onSuccess: async (response) => {
|
||||
await queryClient.invalidateQueries({ queryKey: ["mobile", "reimbursements"] });
|
||||
await queryClient.invalidateQueries({ queryKey: ["reimbursements"] });
|
||||
navigate(`/reimbursements/${response.id}`);
|
||||
navigate(`/mobile/reimbursements/${response.id}`);
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error(resolveErrorMessage(error));
|
||||
|
||||
在新工单中引用
屏蔽一个用户