fixed build error
This commit is contained in:
parent
3878c2e0f4
commit
0047563204
@ -1,13 +1,13 @@
|
||||
import {Button, Form, Space, Toast} from "@douyinfe/semi-ui";
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {useEffect, useRef, useState} from "react";
|
||||
import {useRef, useState} from "react";
|
||||
|
||||
import {Card} from "@/components/card";
|
||||
import {BillTypes} from "@/service/bill-types.ts";
|
||||
import {BillDetailItems, useBillQRCode} from "@/components/bill";
|
||||
|
||||
import styles from './manual.module.less'
|
||||
import {createManualBill, getBillDetail} from "@/service/api/bill.ts";
|
||||
import {createManualBill,} from "@/service/api/bill.ts";
|
||||
import {useSetState} from "ahooks";
|
||||
import {BizError} from "@/service/types.ts";
|
||||
import {IconAlertTriangle} from "@douyinfe/semi-icons";
|
||||
@ -15,7 +15,6 @@ import dayjs from "dayjs";
|
||||
import * as Sentry from '@sentry/react'
|
||||
|
||||
|
||||
|
||||
export default function Index() {
|
||||
const {t} = useTranslation()
|
||||
const frm = useRef<Form<ManualCreateBillParam>>(null)
|
||||
@ -27,7 +26,7 @@ export default function Index() {
|
||||
})
|
||||
|
||||
const handleSubmit = (values: ManualCreateBillParam) => {
|
||||
setState({loading: true,errorMessage:''})
|
||||
setState({loading: true, errorMessage: ''})
|
||||
createManualBill(values).then((ret) => {
|
||||
console.log(ret)
|
||||
frm.current?.formApi.reset();
|
||||
@ -37,11 +36,11 @@ export default function Index() {
|
||||
setBillInfo(ret)
|
||||
//getBillDetail(ret.id).then(setBillInfo);
|
||||
}).catch((e: BizError) => {
|
||||
Sentry.captureMessage('Error: create manual bill error',{
|
||||
Sentry.captureMessage('Error: create manual bill error', {
|
||||
level: 'error',
|
||||
extra: {
|
||||
message:e.message,
|
||||
request_id:e.request_id,
|
||||
message: e.message,
|
||||
request_id: e.request_id,
|
||||
...values
|
||||
}
|
||||
});
|
||||
@ -57,7 +56,7 @@ export default function Index() {
|
||||
const BillInfo = ({bill}: { bill?: BillModel }) => {
|
||||
if (!bill) return null;
|
||||
return (<>
|
||||
<BillDetailItems bill={bill} />
|
||||
<BillDetailItems bill={bill}/>
|
||||
<Button onClick={exportQRCode} style={{marginTop: 20}} theme={'solid'} type={'primary'}>Download QR
|
||||
code</Button>
|
||||
</>)
|
||||
@ -85,10 +84,10 @@ export default function Index() {
|
||||
rules={[
|
||||
{required: true, message: t('manual.amount_required')},
|
||||
{
|
||||
type:'number',
|
||||
validator:(_,v)=>{
|
||||
console.log(_,v)
|
||||
return !isNaN(v) && Number(v)>0;
|
||||
type: 'number',
|
||||
validator: (_, v) => {
|
||||
console.log(_, v)
|
||||
return !isNaN(v) && Number(v) > 0;
|
||||
},
|
||||
message: t('manual.amount_gt0')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user