From aea914d21c16f53a1c28122b9b9a135439443ba6 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 17 Dec 2024 11:38:03 +0700 Subject: update pengajuan tempo --- .../component/KonfirmasiDokumen.jsx | 41 +- .../pengajuan-tempo/component/PengajuanTempo.jsx | 29 +- src/lib/pengajuan-tempo/component/Pengiriman.jsx | 426 +++++++++++---------- 3 files changed, 271 insertions(+), 225 deletions(-) (limited to 'src/lib') diff --git a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx index a6f25d5e..f8f1cc17 100644 --- a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx +++ b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx @@ -30,11 +30,10 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { const handleConfirmSubmit = (format, base64) => { if (format == 'pdf') { setFormat(`application/${format}`); - } else if (format == undefined) { - setFormat(null); - setUrl(`${process.env.NEXT_PUBLIC_ODOO_API_HOST}` + base64); - } else { + } else if (format == 'png' || format == 'jpg' || format == 'jpeg') { setFormat(`image/${format}`); + } else { + setFormat(format); } setBase64( base64.trim().replace(/^"+/, '').replace(/"+$/, '').replaceAll('\\', '') @@ -171,6 +170,8 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { useEffect(() => { validateDokumen(); }, [buttonSubmitClick]); + console.log('formDokumen', formDokumen); + console.log('format', format); return ( <> {isDesktop && ( @@ -1562,23 +1563,21 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { close={() => setIsExample(false)} >
- {/* */} - + {/* + /> */}
)} @@ -1591,19 +1590,17 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { >
{/* */} diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx index f5cad812..ccd63856 100644 --- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx +++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx @@ -33,7 +33,7 @@ const PengajuanTempo = () => { const { isDesktop, isMobile } = useDevice(); const [currentStep, setCurrentStep] = React.useState(0); const NUMBER_OF_STEPS = 6; - const [isLoading, setIsLoading] = useState(false); + const [isLoading, setIsLoading] = useState(true); const [bigData, setBigData] = useState(); const [idTempo, setIdTempo] = useState(0); const { form, errors, validate, updateForm } = usePengajuanTempoStore(); @@ -547,22 +547,31 @@ const PengajuanTempo = () => { const handleCheckChange = (checked) => { setIsCheckedTNC(checked); }; + if (isLoading && !bigData) { + return; + } + console.log('bigData', bigData); return ( <>

Form Pengajuan Tempo

-

- Lorem ipsum dolor sit amet consectetur. Commodo suspendisse at enim - magnis ut quisque rhoncus. Felis volutpat fringilla sollicitudin - ultricies. Enim non eget in lorem netus. Nisl pharetra accumsan diam - suspendisse. +

+ Pembayaran tempo adalah layanan pembayaran berjangka yang difasilitasi + indoteknik.com untuk konsumen akun bisnis yang terdaftar dengan waktu + pembayaran mulai dari 7, 14, 21 hingga 30 Hari.

-
+
-
+
@@ -595,7 +604,7 @@ const PengajuanTempo = () => { onClick={goPrevStep} > {} - + Langkah Sebelumnya @@ -674,7 +683,7 @@ const TempoTermCondition = ({ onCheckChange }) => { isChecked={isCheckedTNC} onChange={toggleCheckTNC} /> -
+
{' '} diff --git a/src/lib/pengajuan-tempo/component/Pengiriman.jsx b/src/lib/pengajuan-tempo/component/Pengiriman.jsx index 497c86a9..068cf73c 100644 --- a/src/lib/pengajuan-tempo/component/Pengiriman.jsx +++ b/src/lib/pengajuan-tempo/component/Pengiriman.jsx @@ -889,109 +889,129 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
)}
-
+
- ( - +
+ ( + + )} + /> + {chekValid && ( +
+ {errorsPengiriman.statePengiriman} +
)} - /> - {chekValid && ( -
- {errorsPengiriman.statePengiriman} -
- )} -
-
- ( - +
+
+ ( + + )} + /> + {chekValid && ( +
+ {errorsPengiriman.cityPengiriman} +
)} - /> - {chekValid && ( -
- {errorsPengiriman.cityPengiriman} -
- )} +
-
- ( - +
+
+ ( + + )} + /> + {chekValid && ( +
+ {errors.subDistrictPengiriman} +
)} - /> - {chekValid && ( -
- {errors.subDistrictPengiriman} -
- )} -
-
- ( - +
+
+ ( + + )} + /> + {chekValid && ( +
+ {errors.subDistrictPengiriman} +
)} - /> - {chekValid && ( -
- {errors.subDistrictPengiriman} -
- )} -
-
- ( - +
+
+ ( + + )} + /> + {chekValid && ( +
+ {errors.zipPengiriman} +
)} - /> - {chekValid && ( -
- {errors.zipPengiriman} -
- )} +
@@ -1083,113 +1103,133 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
)}
-
+
- ( - +
+ ( + + )} + /> + {chekValid && ( +
+ {errorsPengiriman.stateInvoice} +
)} - /> - {chekValid && ( -
- {errorsPengiriman.stateInvoice} -
- )} +
+
+ ( + + )} + /> + {chekValid && ( +
+ {errorsPengiriman.cityInvoice} +
+ )} +
- ( - - )} - /> - {chekValid && ( -
- {errorsPengiriman.cityInvoice} -
- )} -
-
- ( - +
+ ( + + )} + /> + {chekValid && ( +
+ {errors.districtInvoice} +
)} - /> - {chekValid && ( -
- {errors.districtInvoice} -
- )} -
-
- ( - +
+
+ ( + + )} + /> + {chekValid && ( +
+ {errors.subDistrictsInvoice} +
)} - /> - {chekValid && ( -
- {errors.subDistrictsInvoice} -
- )} -
-
- ( - +
+
+ ( + + )} + /> + {chekValid && ( +
+ {errors.zipInvoice} +
)} - /> - {chekValid && ( -
- {errors.zipInvoice} -
- )} +
-- cgit v1.2.3