Browse Source

プラン変更の名称を修正

develop
sosuke.iwabuchi 2 years ago
parent
commit
02eafaa559
2 changed files with 8 additions and 7 deletions
  1. +3
    -2
      src/api/season-ticket-contract.ts
  2. +5
    -5
      src/pages/dashboard/contract/change-plan-order.tsx

+ 3
- 2
src/api/season-ticket-contract.ts View File

@@ -7,6 +7,7 @@ import {
request, request,
} from "api"; } from "api";
import { getUrl } from "./url"; import { getUrl } from "./url";
import { Dictionary } from "@types";


export type SeasonTicketContract = { export type SeasonTicketContract = {
season_ticekt_contract_record_no: string | null; season_ticekt_contract_record_no: string | null;
@@ -186,12 +187,12 @@ export const orderUpdateVehicleInfo = async (
return res; return res;
}; };


// -------プラン変更依頼------------------
// -------プラン変更依頼 変更可能先プラン名取得------------------
type GetChangePlanOrderParamsRequest = { type GetChangePlanOrderParamsRequest = {
season_ticket_contract_record_no: string; season_ticket_contract_record_no: string;
}; };
type GetChangePlanOrderParamsResponse = { type GetChangePlanOrderParamsResponse = {
data: string[];
data: Dictionary;
} & APICommonResponse; } & APICommonResponse;
export const getChangePlanOrderParams = async ( export const getChangePlanOrderParams = async (
data: GetChangePlanOrderParamsRequest data: GetChangePlanOrderParamsRequest


+ 5
- 5
src/pages/dashboard/contract/change-plan-order.tsx View File

@@ -8,7 +8,7 @@ import {
TableRow, TableRow,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import { HasChildren } from "@types";
import { Dictionary, HasChildren } from "@types";
import { import {
getChangePlanOrderParams, getChangePlanOrderParams,
orderChangePlan, orderChangePlan,
@@ -66,12 +66,12 @@ export default function ChangPaymentIntervalOrder() {


const [mode, setMode] = useState<"input" | "confirm" | "done">("input"); const [mode, setMode] = useState<"input" | "confirm" | "done">("input");


const [plans, setPlans] = useState<string[]>([]);
const [plans, setPlans] = useState<Dictionary>({});


const planOptions: SelectOptionProps[] = useMemo(() => { const planOptions: SelectOptionProps[] = useMemo(() => {
return plans.map((planName) => ({
return Object.keys(plans).map((planName) => ({
value: planName, value: planName,
label: planName,
label: plans[planName],
})); }));
}, [plans]); }, [plans]);


@@ -155,7 +155,7 @@ export default function ChangPaymentIntervalOrder() {
<TableCell> <TableCell>
<TextFieldEx <TextFieldEx
multiline multiline
value={form.getValues("plan_name")}
value={plans[form.getValues("plan_name")]}
readOnly readOnly
fullWidth fullWidth
/> />


Loading…
Cancel
Save