fixed some ui, upgrade functionalitym added permission to operator
This commit is contained in:
1 parent
25c104ad8c
commit
5ed4c9a8ec
46 files changed
+1058
-1401
No files matched your search
@@ -279,14 +279,14 @@ function StepLoan({ form, errors, set, t, initialData }: StepContentProps & { in
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.loanCardInfo") || "Karz karty maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Loan card number") || "Karz kart belgisi"}
|
||||
value={form.loanCardNumber}
|
||||
onChange={(v) => set("loanCardNumber", v)}
|
||||
placeholder={t("Loan card number") || "Karz kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Loan card name") || "Karz kartdaky ady"}
|
||||
value={form.loanCardName}
|
||||
onChange={(v) => set("loanCardName", v)}
|
||||
@@ -538,16 +538,16 @@ function StepCard({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
required
|
||||
value={form.cardNumber}
|
||||
onChange={(v) => set("cardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.cardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
required
|
||||
value={form.cardName}
|
||||
@@ -601,12 +601,12 @@ function StepPassport({ form, errors, set, t, mode }: StepContentProps & { mode:
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
required
|
||||
value={form.passportId}
|
||||
onChange={(v) => set("passportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.passportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -721,11 +721,11 @@ function StepContact({ form, errors, set, t }: StepContentProps) {
|
||||
error={errors.phoneAdditional}
|
||||
/>
|
||||
<FormInput
|
||||
type="phone"
|
||||
type="digits"
|
||||
label={t("Home phone") || "Öý telefony"}
|
||||
value={form.phoneHome}
|
||||
onChange={(v) => set("phoneHome", v)}
|
||||
placeholder={t("loanOrderForm.placeholders.phone") || "61 097 651"}
|
||||
placeholder={t("Home phone") || "Öý telefony"}
|
||||
error={errors.phoneHome}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -890,12 +890,12 @@ function StepGuarantor({ form, errors, set, t }: StepContentProps) {
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
required
|
||||
value={form.guarantorPassportId}
|
||||
onChange={(v) => set("guarantorPassportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.guarantorPassportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -904,16 +904,16 @@ function StepGuarantor({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
required
|
||||
value={form.guarantorCardNumber}
|
||||
onChange={(v) => set("guarantorCardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.guarantorCardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
required
|
||||
value={form.guarantorCardName}
|
||||
@@ -1009,11 +1009,11 @@ function StepGuarantor2({ form, errors, set, t }: StepContentProps) {
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
value={form.guarantor2PassportId}
|
||||
onChange={(v) => set("guarantor2PassportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.guarantor2PassportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -1022,15 +1022,15 @@ function StepGuarantor2({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
value={form.guarantor2CardNumber}
|
||||
onChange={(v) => set("guarantor2CardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.guarantor2CardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
value={form.guarantor2CardName}
|
||||
onChange={(v) => set("guarantor2CardName", v)}
|
||||
@@ -1270,7 +1270,8 @@ export function LoanOrderForm({ mode, initialData }: LoanOrderFormProps) {
|
||||
onPrev={currentStep > 0 ? handleBack : undefined}
|
||||
onNext={!isLastStep ? handleNext : undefined}
|
||||
showSubmit={isLastStep}
|
||||
onSubmit={isLastStep ? doSubmit : undefined}
|
||||
saveOnEveryStep={mode === "edit"}
|
||||
onSubmit={doSubmit}
|
||||
submitLabel={mode === "create" ? t("loanOrders.create") || "Karz sargyt döredüň" : t("common.save") || "Ýatda sakla"}
|
||||
loadingLabel={t("common.loading") || "Ýüklenilýär..."}
|
||||
cancelLabel={t("common.cancel") || "Ýatyr"}
|
||||
@@ -1325,7 +1326,7 @@ function mapInitial(order: LoanOrder): Partial<LoanOrderFormData> {
|
||||
passportFour: order.passportFour ?? order.passportPage32Url ?? "",
|
||||
phone: formatFromApiPhone(order.phone),
|
||||
phoneAdditional: formatFromApiPhone(order.phoneAdditional),
|
||||
phoneHome: formatFromApiPhone(order.phoneHome ?? order.homePhone),
|
||||
phoneHome: (order.phoneHome ?? order.homePhone ?? "").replace(/\D/g, ""),
|
||||
email: order.email ?? "",
|
||||
workCompany: order.workCompany ?? "",
|
||||
workCompanyAccountantNumber: formatFromApiPhone(order.workCompanyAccountantNumber ?? order.workHrPhone),
|
||||
|
||||
Reference in new issue
Block a user