浏览代码

契約識別子対応

develop
sosuke.iwabuchi 2 年前
父节点
当前提交
c8416ef97c
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. +1
    -0
      src/api/contract.ts
  2. +11
    -0
      src/pages/dashboard/contract/create.tsx

+ 1
- 0
src/api/contract.ts 查看文件

@@ -33,6 +33,7 @@ export const getContracts = async (data: ContractsRequest) => {
export type ContractCreateRequest = { export type ContractCreateRequest = {
name: string; name: string;
custom?: string; custom?: string;
contract_code?: string;
}; };


export const createContract = async (data: ContractCreateRequest) => { export const createContract = async (data: ContractCreateRequest) => {


+ 11
- 0
src/pages/dashboard/contract/create.tsx 查看文件

@@ -36,6 +36,7 @@ function AreaBox({ title, children }: AreaBoxProps) {
type FormProps = { type FormProps = {
name: string; name: string;
custom: string; custom: string;
contract_code: string;
}; };


export default function ContractCreate() { export default function ContractCreate() {
@@ -59,18 +60,21 @@ export default function ContractCreate() {
defaultValues: { defaultValues: {
name: "", name: "",
custom: "", custom: "",
contract_code: "",
}, },
}); });


const { callAPI } = useAPICall({ const { callAPI } = useAPICall({
apiMethod: createContract, apiMethod: createContract,
backDrop: true, backDrop: true,
form,
onSuccess: () => { onSuccess: () => {
success("登録しました"); success("登録しました");
setMode("done"); setMode("done");
}, },
onFailed: () => { onFailed: () => {
error("失敗しました"); error("失敗しました");
setMode("input");
}, },
}); });


@@ -109,6 +113,9 @@ export default function ContractCreate() {
<AreaBox title="契約者名"> <AreaBox title="契約者名">
<RHFTextField name="name" size="small" /> <RHFTextField name="name" size="small" />
</AreaBox> </AreaBox>
<AreaBox title="契約識別子">
<RHFTextField name="contract_code" size="small" />
</AreaBox>
<AreaBox title="カスタム識別子"> <AreaBox title="カスタム識別子">
<RHFTextField name="custom" size="small" /> <RHFTextField name="custom" size="small" />
</AreaBox> </AreaBox>
@@ -131,6 +138,10 @@ export default function ContractCreate() {
<TableCell>契約者名</TableCell> <TableCell>契約者名</TableCell>
<TableCell>{form.getValues("name")}</TableCell> <TableCell>{form.getValues("name")}</TableCell>
</TableRow> </TableRow>
<TableRow>
<TableCell>契約識別子</TableCell>
<TableCell>{form.getValues("contract_code")}</TableCell>
</TableRow>
<TableRow> <TableRow>
<TableCell>カスタム識別子</TableCell> <TableCell>カスタム識別子</TableCell>
<TableCell>{form.getValues("custom")}</TableCell> <TableCell>{form.getValues("custom")}</TableCell>


正在加载...
取消
保存