瀏覽代碼

契約識別子対応

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 = {
name: string;
custom?: string;
contract_code?: string;
};

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 = {
name: string;
custom: string;
contract_code: string;
};

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

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

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


Loading…
取消
儲存