diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-25 17:04:51 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-25 17:04:51 +0700 |
| commit | 494909f40b918e4273d6258a74f12ac42253a4a7 (patch) | |
| tree | 08b3bfa4a60f318c71980f3a26d4d86da996f8d9 /src/lib/pengajuan-tempo/component/PengajuanTempo.jsx | |
| parent | b94c0181d2e8b3b1f8a48879a059813d213b09d5 (diff) | |
<iman> pengajuan tempo
Diffstat (limited to 'src/lib/pengajuan-tempo/component/PengajuanTempo.jsx')
| -rw-r--r-- | src/lib/pengajuan-tempo/component/PengajuanTempo.jsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx index 952c4244..ab66f94f 100644 --- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx +++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx @@ -79,6 +79,7 @@ const PengajuanTempo = () => { key='referensi' chekValid={notValid} buttonSubmitClick={buttonSubmitClick} + data={bigData?.supplierIds} />, <Dokumen key='dokumen' @@ -192,7 +193,6 @@ const PengajuanTempo = () => { useEffect(() => { const cachedData = bigData; console.log('data_lama', getFromLocalStorage(stepLabels[currentStep])); - console.log('cachedData', cachedData); if (cachedData) { // Ambil kunci-kunci yang relevan berdasarkan currentStep dari stepDivsForm @@ -201,7 +201,8 @@ const PengajuanTempo = () => { : []; console.log('formKeys', formKeys); if (currentStep === 3) { - stepDivsUpdateForm[currentStep](cachedData); + console.log('cachedData', cachedData.supplierIds[0]); + stepDivsUpdateForm[currentStep](cachedData.supplierIds); } else if (currentStep === 4) { formKeys.forEach((key) => { if (cachedData[key]) { @@ -230,6 +231,7 @@ const PengajuanTempo = () => { validateKontakPerson(); validatePengiriman(); validateDokumen(); + validateSupplier(); updateHasSave(false); }, [currentStep, bigData]); @@ -292,6 +294,7 @@ const PengajuanTempo = () => { const handleDaftarTempoDokumen = async () => { for (const error of stepDivsError) { if (error.length > 0) { + console.log('iman_erro', error); return; } } @@ -337,6 +340,7 @@ const PengajuanTempo = () => { durasiTempo: product.durasiTempo, creditLimit: product.creditLimit, })); + console.log('productOrder', productOrder); const toastId = toast.loading('Mengirimkan formulir pengajuan tempo...'); setIsLoading(true); try { @@ -344,6 +348,7 @@ const PengajuanTempo = () => { id: idTempo, user_id: auth.parentId, formSupplier: JSON.stringify(productOrder), + section, }); if (address.id) { setIdTempo(address.id); @@ -380,11 +385,6 @@ const PengajuanTempo = () => { base64: doc.base64, }, })); - if (currentStep == 3) { - formData = JSON.stringify(productOrder); - } else if (currentStep == 4) { - formData = JSON.stringify(formattedDokumen); - } const data2 = { user_id: auth.id, @@ -401,10 +401,10 @@ const PengajuanTempo = () => { const address = await createPengajuanTempoApi({ id: 0, user_id: auth.parentId, - section: label, tempo_request: tempoRequest, ...form, }); + console.log('address', address); if (address.id) { const address2 = await createPengajuanTempoApi({ id: address.id, |
