取消报销资产事前批准强制(08-30-reimbursement-assets-prior-approval-correction)
这个提交包含在:
@@ -89,7 +89,6 @@ type ItemFormState = {
|
||||
expenseDate: string;
|
||||
amount: string;
|
||||
description: string;
|
||||
assetPriorApprovalBasis: string;
|
||||
};
|
||||
|
||||
type SelectedInvoiceMap = Record<string, string>;
|
||||
@@ -331,7 +330,6 @@ export function MobileReimbursementDetailPage() {
|
||||
expenseDate: detail?.reimbursementDate ?? todayDate(),
|
||||
amount: "",
|
||||
description: "",
|
||||
assetPriorApprovalBasis: "",
|
||||
});
|
||||
setItemError("");
|
||||
};
|
||||
@@ -344,7 +342,6 @@ export function MobileReimbursementDetailPage() {
|
||||
expenseDate: item.expenseDate ?? detail?.reimbursementDate ?? todayDate(),
|
||||
amount: item.amount,
|
||||
description: item.description ?? "",
|
||||
assetPriorApprovalBasis: item.assetPriorApprovalBasis ?? "",
|
||||
});
|
||||
setItemError("");
|
||||
};
|
||||
@@ -360,7 +357,6 @@ export function MobileReimbursementDetailPage() {
|
||||
expenseDate: form.expenseDate,
|
||||
amount: form.amount,
|
||||
description: form.description.trim() || undefined,
|
||||
assetPriorApprovalBasis: form.assetPriorApprovalBasis.trim() || null,
|
||||
};
|
||||
|
||||
if (form.mode === "edit" && form.itemId) {
|
||||
@@ -1093,29 +1089,17 @@ export function MobileReimbursementDetailPage() {
|
||||
onChange={(event) => setItemForm((current) => current ? { ...current, description: event.target.value } : current)}
|
||||
/>
|
||||
</label>
|
||||
{expenseTypes.find((type) => type.id === itemForm.expenseTypeId)?.category === "assets" ? (
|
||||
<label className="col-span-2 block space-y-1 text-sm text-zinc-700">
|
||||
<span>事前批准依据</span>
|
||||
<Textarea
|
||||
disabled={itemSaveMutation.isPending}
|
||||
placeholder="填写批准人、批准时间和简短依据"
|
||||
rows={2}
|
||||
value={itemForm.assetPriorApprovalBasis}
|
||||
onChange={(event) => setItemForm((current) => current ? { ...current, assetPriorApprovalBasis: event.target.value } : current)}
|
||||
/>
|
||||
</label>
|
||||
) : null}
|
||||
{shouldShowOfficeElectronicsHint(
|
||||
expenseTypes.find((type) => type.id === itemForm.expenseTypeId)?.code,
|
||||
itemForm.amount,
|
||||
) ? (
|
||||
<p className="col-span-2 text-xs text-amber-600">该金额通常应选择办公电子设备并填写事前批准依据。</p>
|
||||
<p className="col-span-2 text-xs text-amber-600">该金额通常应选择办公电子设备。</p>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="mobile-two-action-grid">
|
||||
<Button
|
||||
type="button"
|
||||
disabled={!itemForm.expenseTypeId || !itemForm.expenseDate || !Number.isFinite(Number(itemForm.amount)) || Number(itemForm.amount) <= 0 || (expenseTypes.find((type) => type.id === itemForm.expenseTypeId)?.category === "assets" && !itemForm.assetPriorApprovalBasis.trim()) || itemSaveMutation.isPending}
|
||||
disabled={!itemForm.expenseTypeId || !itemForm.expenseDate || !Number.isFinite(Number(itemForm.amount)) || Number(itemForm.amount) <= 0 || itemSaveMutation.isPending}
|
||||
onClick={() => itemSaveMutation.mutate(itemForm)}
|
||||
>
|
||||
{itemSaveMutation.isPending ? "保存中..." : "保存"}
|
||||
@@ -1140,10 +1124,7 @@ export function MobileReimbursementDetailPage() {
|
||||
</div>
|
||||
{item.description ? <p className="mt-2 text-sm leading-5 text-zinc-600">{item.description}</p> : null}
|
||||
{shouldShowOfficeElectronicsHint(item.expenseType?.code, item.amount) ? (
|
||||
<p className="mt-2 text-xs text-amber-600">该金额通常应选择办公电子设备并填写事前批准依据。</p>
|
||||
) : null}
|
||||
{item.assetPriorApprovalBasis ? (
|
||||
<p className="mt-2 text-xs text-zinc-500">事前批准依据:{item.assetPriorApprovalBasis}</p>
|
||||
<p className="mt-2 text-xs text-amber-600">该金额通常应选择办公电子设备。</p>
|
||||
) : null}
|
||||
{canMaintainReimbursement ? (
|
||||
<div className="mobile-two-action-grid mt-3">
|
||||
|
||||
在新工单中引用
屏蔽一个用户