summaryrefslogtreecommitdiff
path: root/src/lib/pengajuan-tempo/component
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-12-16 17:42:31 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-12-16 17:42:31 +0700
commit0178a1f88d7d34824562e1413be073c0795a47cf (patch)
tree20a26bd36d2c8e0c3e09681836eea9f403519f70 /src/lib/pengajuan-tempo/component
parent4711fff3bf3b07c50f353a7c5956055a37a5e4d2 (diff)
<iman> update code
Diffstat (limited to 'src/lib/pengajuan-tempo/component')
-rw-r--r--src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx13
-rw-r--r--src/lib/pengajuan-tempo/component/KontakPerusahaan.jsx14
-rw-r--r--src/lib/pengajuan-tempo/component/PengajuanTempo.jsx95
-rw-r--r--src/lib/pengajuan-tempo/component/Pengiriman.jsx5
-rw-r--r--src/lib/pengajuan-tempo/component/Referensi.jsx6
-rw-r--r--src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx310
6 files changed, 283 insertions, 160 deletions
diff --git a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
index ca571167..a6f25d5e 100644
--- a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
+++ b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx
@@ -32,7 +32,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
setFormat(`application/${format}`);
} else if (format == undefined) {
setFormat(null);
- setUrl(`http://192.168.23.244:8069` + base64);
+ setUrl(`${process.env.NEXT_PUBLIC_ODOO_API_HOST}` + base64);
} else {
setFormat(`image/${format}`);
}
@@ -1562,7 +1562,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
close={() => setIsExample(false)}
>
<div className='flex justify-center items-center p-2'>
- <iframe
+ {/* <iframe
src={`${
format == null ? url : `data:${format};base64,${base64}`
}`}
@@ -1571,7 +1571,14 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
width='800px'
height='600px'
title='Document'
- ></iframe>
+ ></iframe> */}
+ <embed
+ src={`${
+ format == null ? url : `data:${format};base64,${base64}`
+ }`}
+ width='100%'
+ height='600px'
+ />
</div>
</BottomPopup>
)}
diff --git a/src/lib/pengajuan-tempo/component/KontakPerusahaan.jsx b/src/lib/pengajuan-tempo/component/KontakPerusahaan.jsx
index 1ea2223e..b3d5bce7 100644
--- a/src/lib/pengajuan-tempo/component/KontakPerusahaan.jsx
+++ b/src/lib/pengajuan-tempo/component/KontakPerusahaan.jsx
@@ -143,11 +143,6 @@ const KontakPerusahaan = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
No. HP Direktur{' '}
<span className=' opacity-60'>(Opsional)</span>
</label>
- {!isKonfirmasi && (
- <span className='text-xs opacity-60'>
- isi nomor telpon direktur di perusahaan kamu
- </span>
- )}
</div>
<div className='w-3/5'>
<input
@@ -174,11 +169,6 @@ const KontakPerusahaan = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
<label className='form-label text-nowrap'>
Email Direktur
</label>
- {!isKonfirmasi && (
- <span className='text-xs opacity-60'>
- isi email Direktur yang sesuai
- </span>
- )}
</div>
<div className='w-3/5'>
<input
@@ -254,7 +244,7 @@ const KontakPerusahaan = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
</label>
{!isKonfirmasi && (
<span className='text-xs opacity-60'>
- isi nomor purchasing yang bertanggung jawab di perusahaan
+ isi email purchasing yang bertanggung jawab diperusahaan
anda
</span>
)}
@@ -394,7 +384,7 @@ const KontakPerusahaan = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
</label>
{!isKonfirmasi && (
<span className='text-xs opacity-60'>
- isi email finance dengan benar
+ isi email finance yang bertanggung jawab diperusahaan anda
</span>
)}
</div>
diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
index b4f4ac9b..f5cad812 100644
--- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
+++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
@@ -253,6 +253,29 @@ const PengajuanTempo = () => {
setCurrentStep((prev) => (prev === NUMBER_OF_STEPS - 1 ? prev : prev + 1));
};
+ const goPrevStep = () => {
+ // if (!isFormValid) {
+ // setNotValid(true);
+ // setButtonSubmitClick(!buttonSubmitClick);
+ // return;
+ // } else {
+ // // saveToLocalStorage(stepLabels[currentStep], stepDivsForm[currentStep]);
+ // if (currentStep == 3) {
+ // handleDaftarTempoSupplier();
+ // } else if (currentStep == 4) {
+ // handleDaftarTempoDokumen();
+ // } else {
+ // handleDaftarTempoPerPage(
+ // stepLabels[currentStep],
+ // stepDivsForm[currentStep]
+ // );
+ // }
+ // setButtonSubmitClick(!buttonSubmitClick);
+ // setNotValid(false);
+ // }
+ setCurrentStep((prev) => (prev === NUMBER_OF_STEPS - 1 ? prev : prev - 1));
+ };
+
const handleDaftarTempoPerPage = async (
label,
formData,
@@ -558,30 +581,57 @@ const PengajuanTempo = () => {
<span className='text-xs opacity-60'>
*Pastikan data yang anda masukan sudah benar dan sesuai
</span>
- {currentStep < 5 && (
- <>
- <Tooltip
- label={clsxm({
- 'Klik simpan data terlebih dahulu':
- currentStep === 3 && !hasSavedata,
- })}
+ <div
+ className={` flex flex-row ${
+ currentStep > 0 && currentStep < 5
+ ? 'justify-between'
+ : 'justify-end'
+ } items-center w-full ${isMobile ? 'gap-x-4 ' : ''}`}
+ >
+ {currentStep < 5 && currentStep > 0 && (
+ <Button
+ colorScheme='yellow'
+ w={`${isMobile ? 'full' : 'fit'}`}
+ onClick={goPrevStep}
>
- <Button
- colorScheme='red'
- w={`${isMobile ? 'full' : 'fit'}`}
- isDisabled={
- (currentStep === 3 && !hasSavedata) ||
- currentStep === NUMBER_OF_STEPS - 1
- }
- onClick={goToNextStep}
+ {<ChevronLeftIcon className='w-5' />}
+ <span className={`${isMobile ? 'text-xs' : ''} `}>
+ Langkah Sebelumnya
+ </span>
+ </Button>
+ )}
+ {currentStep < 5 && (
+ <>
+ <Tooltip
+ label={clsxm({
+ 'Klik simpan data terlebih dahulu':
+ currentStep === 3 && !hasSavedata,
+ })}
>
- Langkah Selanjutnya {<ChevronRightIcon className='w-5' />}
- </Button>
- </Tooltip>
- </>
- )}
+ <Button
+ colorScheme='red'
+ w={`${isMobile ? 'full' : 'fit'}`}
+ isDisabled={
+ (currentStep === 3 && !hasSavedata) ||
+ currentStep === NUMBER_OF_STEPS - 1
+ }
+ onClick={goToNextStep}
+ >
+ <span className={`${isMobile ? 'text-xs' : ''} `}>
+ Langkah Selanjutnya
+ </span>
+ {<ChevronRightIcon className='w-5' />}
+ </Button>
+ </Tooltip>
+ </>
+ )}
+ </div>
{currentStep == 5 && (
- <div className='flex flex-col items-end justify-start gap-4'>
+ <div
+ className={`flex flex-col ${
+ isMobile ? 'items-start' : 'items-end'
+ } w-full justify-start gap-4`}
+ >
<TempoTermCondition onCheckChange={handleCheckChange} />
<Button
colorScheme='red'
@@ -601,6 +651,7 @@ const PengajuanTempo = () => {
const TempoTermCondition = ({ onCheckChange }) => {
const [isCheckedTNC, SetIsCheckedTNC] = useState(false);
const [openTNC, SetOpenTNC] = useState(false);
+ const { isDesktop, isMobile } = useDevice();
const openTNCHandle = () => {
SetOpenTNC(!openTNC);
@@ -623,7 +674,7 @@ const TempoTermCondition = ({ onCheckChange }) => {
isChecked={isCheckedTNC}
onChange={toggleCheckTNC}
/>
- <div>
+ <div className={`text-center ${isMobile ? 'text-sm' : ''}`}>
<label htmlFor='tnc' className='cursor-pointer'>
Dengan ini saya menyetujui
</label>{' '}
diff --git a/src/lib/pengajuan-tempo/component/Pengiriman.jsx b/src/lib/pengajuan-tempo/component/Pengiriman.jsx
index cfc8aeb5..497c86a9 100644
--- a/src/lib/pengajuan-tempo/component/Pengiriman.jsx
+++ b/src/lib/pengajuan-tempo/component/Pengiriman.jsx
@@ -1937,11 +1937,12 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
</div>
<div className='flex flex-col gap-2 justify-between items-start'>
<label className='form-label text-wrap'>
- Dokumen saat Pengiriman Barang
+ Dokumen yang dibawa saat pengiriman barang
+ <span className=' opacity-60'>(Opsional)</span>
</label>
{!isKonfirmasi && (
<span className='text-xs opacity-60'>
- Dokumen lampiran saat pengiriman barang
+ Dokumen lampiran yang dibawa saat pengiriman barang
</span>
)}
<div className='flex gap-3 flex-col w-full'>
diff --git a/src/lib/pengajuan-tempo/component/Referensi.jsx b/src/lib/pengajuan-tempo/component/Referensi.jsx
index 9e154166..38693d18 100644
--- a/src/lib/pengajuan-tempo/component/Referensi.jsx
+++ b/src/lib/pengajuan-tempo/component/Referensi.jsx
@@ -501,11 +501,11 @@ const Referensi = ({ chekValid, buttonSubmitClick, data }) => {
</div>
))}
</div>
- <div className='h-[2px] bg-gray-300 w-[120%] inset-0 relative transform -translate-x-5'></div>
- <h2 className='py-2 font-semibold text-base text-red-500 flex flex-row'>
+ {/* <div className='h-[2px] bg-gray-300 w-[120%] inset-0 relative transform -translate-x-5'></div> */}
+ {/* <h2 className='py-2 font-semibold text-base text-red-500 flex flex-row'>
<PlusCircleIcon className='w-5 mr-2' />
Tambah Data Baru
- </h2>
+ </h2> */}
<div className='h-[2px] bg-gray-300 w-[120%] inset-0 relative transform -translate-x-5'></div>
<form className='flex flex-col w-full'>
<div className='w-full grid grid-row-2 gap-2'>
diff --git a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
index f8a0bc55..9850e927 100644
--- a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
+++ b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx
@@ -640,100 +640,124 @@ const InformasiPerusahaan = ({
</div>
)}
</div>
- <div className='sub-alamat flex flex-row w-full gap-3'>
- <div className='w-2/5' ref={stateRef}>
- <Controller
- name='state'
- control={control}
- render={(props) => (
- <HookFormSelect
- {...props}
- options={states}
- placeholder='Provinsi'
- />
+ <div
+ className={` sub-alamat flex ${
+ isKonfirmasi ? 'flex-col' : 'flex-row'
+ } w-full gap-3`}
+ >
+ <div
+ className={`flex ${
+ isKonfirmasi
+ ? ' flex-row gap-3 w-full'
+ : 'flex-row gap-3 w-2/5'
+ }`}
+ >
+ <div
+ className={`${isKonfirmasi ? 'w-full' : 'w-full'}`}
+ ref={stateRef}
+ >
+ <Controller
+ name='state'
+ control={control}
+ render={(props) => (
+ <HookFormSelect
+ {...props}
+ options={states}
+ placeholder='Provinsi'
+ />
+ )}
+ />
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.state}
+ </div>
)}
- />
- {chekValid && (
- <div className='text-caption-2 text-danger-500 mt-1'>
- {errors.state}
- </div>
- )}
- </div>
- <div className='w-1/3' ref={cityRef}>
- <Controller
- name='city'
- control={control}
- render={(props) => (
- <HookFormSelect
- {...props}
- options={cities}
- disabled={!watchState}
- placeholder='Kota'
- />
+ </div>
+ <div
+ className={`${isKonfirmasi ? 'w-full' : 'w-full'}`}
+ ref={cityRef}
+ >
+ <Controller
+ name='city'
+ control={control}
+ render={(props) => (
+ <HookFormSelect
+ {...props}
+ options={cities}
+ disabled={!watchState}
+ placeholder='Kota'
+ />
+ )}
+ />
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.city}
+ </div>
)}
- />
- {chekValid && (
- <div className='text-caption-2 text-danger-500 mt-1'>
- {errors.city}
- </div>
- )}
+ </div>
</div>
- <div className='w-1/3' ref={districtRef}>
- <Controller
- name='district'
- control={control}
- render={(props) => (
- <HookFormSelect
- {...props}
- options={districts}
- disabled={!watchState || !watchCity}
- placeholder='Kecamatan'
- />
+ <div
+ className={`flex-row flex gap-2 justify-between ${
+ isKonfirmasi ? 'w-full' : 'w-3/5'
+ }`}
+ >
+ <div className='w-full' ref={districtRef}>
+ <Controller
+ name='district'
+ control={control}
+ render={(props) => (
+ <HookFormSelect
+ {...props}
+ options={districts}
+ disabled={!watchState || !watchCity}
+ placeholder='Kecamatan'
+ />
+ )}
+ />
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.district}
+ </div>
)}
- />
- {chekValid && (
- <div className='text-caption-2 text-danger-500 mt-1'>
- {errors.district}
- </div>
- )}
- </div>
- <div className='w-1/3' ref={subDistrictRef}>
- <Controller
- name='subDistrict'
- control={control}
- render={(props) => (
- <HookFormSelect
- {...props}
- options={subDistricts}
- disabled={!watchDistrict}
- placeholder='Kelurahan'
- />
+ </div>
+ <div className='w-full' ref={subDistrictRef}>
+ <Controller
+ name='subDistrict'
+ control={control}
+ render={(props) => (
+ <HookFormSelect
+ {...props}
+ options={subDistricts}
+ disabled={!watchDistrict}
+ placeholder='Kelurahan'
+ />
+ )}
+ />
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.district}
+ </div>
)}
- />
- {chekValid && (
- <div className='text-caption-2 text-danger-500 mt-1'>
- {errors.district}
- </div>
- )}
- </div>
- <div className='w-1/3' ref={zipRef}>
- <Controller
- name='zip'
- control={control}
- render={(props) => (
- <HookFormSelect
- {...props}
- options={zips}
- disabled={!watchsubDistrict}
- placeholder='Zip'
- />
+ </div>
+ <div className='w-full' ref={zipRef}>
+ <Controller
+ name='zip'
+ control={control}
+ render={(props) => (
+ <HookFormSelect
+ {...props}
+ options={zips}
+ disabled={!watchsubDistrict}
+ placeholder='Zip'
+ />
+ )}
+ />
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.zip}
+ </div>
)}
- />
- {chekValid && (
- <div className='text-caption-2 text-danger-500 mt-1'>
- {errors.district}
- </div>
- )}
+ </div>
</div>
{/* <div className='w-1/3'>
<input
@@ -1163,9 +1187,14 @@ const InformasiPerusahaan = ({
className='form-input'
onChange={handleInputChange}
/>
- <div className='w-full text-nowrap'>
- <div className='sub-alamat flex flex-row w-full gap-3'>
- <div className='w-2/5' ref={stateRef}>
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.street}
+ </div>
+ )}
+ <div className='w-full text-warp gap-3 flex flex-col'>
+ <div className='sub-alamat flex flex-row w-full gap-3 '>
+ <div className='w-full' ref={stateRef}>
<Controller
name='state'
control={control}
@@ -1183,7 +1212,7 @@ const InformasiPerusahaan = ({
</div>
)}
</div>
- <div className='w-1/3' ref={cityRef}>
+ <div className='w-full' ref={cityRef}>
<Controller
name='city'
control={control}
@@ -1202,7 +1231,9 @@ const InformasiPerusahaan = ({
</div>
)}
</div>
- <div className='w-1/3' ref={districtRef}>
+ </div>
+ <div className='flex flex-row gap-3'>
+ <div className='w-full' ref={districtRef}>
<Controller
name='district'
control={control}
@@ -1221,16 +1252,37 @@ const InformasiPerusahaan = ({
</div>
)}
</div>
- <div className='w-1/3'>
- <input
- id='zip'
+ <div className='w-full' ref={subDistrictRef}>
+ <Controller
+ name='subDistrict'
+ control={control}
+ render={(props) => (
+ <HookFormSelect
+ {...props}
+ options={subDistricts}
+ disabled={!watchDistrict}
+ placeholder='Kelurahan'
+ />
+ )}
+ />
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.district}
+ </div>
+ )}
+ </div>
+ <div className='w-full'>
+ <Controller
name='zip'
- ref={zipRef}
- placeholder='Kode Pos'
- type='number'
- value={form.zip}
- className='form-input'
- onChange={handleInputChange}
+ control={control}
+ render={(props) => (
+ <HookFormSelect
+ {...props}
+ options={zips}
+ disabled={!watchsubDistrict}
+ placeholder='Zip'
+ />
+ )}
/>
{chekValid && (
<div className='text-caption-2 text-danger-500 mt-1'>
@@ -1245,11 +1297,6 @@ const InformasiPerusahaan = ({
Isi detail alamat sesuai dengan yang terdaftar
</span>
)}
- {chekValid && (
- <div className='text-caption-2 text-danger-500 mt-1'>
- {errors.street}
- </div>
- )}
</div>
<div className='flex flex-col gap-2 justify-between items-start'>
@@ -1279,6 +1326,11 @@ const InformasiPerusahaan = ({
<div className='flex flex-col gap-2 justify-between items-start'>
<label className='form-label'>Data Bank</label>
+ {!isKonfirmasi && (
+ <span className='text-xs opacity-60'>
+ Isi data bank perusahaan sesuai dengan yang terdaftar
+ </span>
+ )}
<div className='flex gap-3 flex-row'>
<div>
<input
@@ -1291,6 +1343,11 @@ const InformasiPerusahaan = ({
className='form-input'
onChange={handleInputChange}
/>
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.bankName}
+ </div>
+ )}
</div>
<div>
<input
@@ -1327,16 +1384,6 @@ const InformasiPerusahaan = ({
)}
</div>
</div>
- {!isKonfirmasi && (
- <span className='text-xs opacity-60'>
- Isi data bank perusahaan sesuai dengan yang terdaftar
- </span>
- )}
- {chekValid && (
- <div className='text-caption-2 text-danger-500 mt-1'>
- {errors.bankName}
- </div>
- )}
</div>
<div className='flex flex-col gap-2 justify-between items-start'>
@@ -1406,6 +1453,33 @@ const InformasiPerusahaan = ({
indoteknik.com
</div>
<div className='h-[2px] bg-gray-300 w-[120%] inset-0 relative transform -translate-x-5'></div>
+
+ <div className='flex flex-col gap justify-between items-start'>
+ <label className='form-label text-wrap '>
+ Apakah terdapat vendor portal pada perusahaan anda?
+ </label>
+ <div className='flex gap-x-4' ref={bersediaRef}>
+ <RadioGroup
+ size='sm'
+ onChange={handleCheckboxPortalChange}
+ value={form.portal}
+ >
+ <Stack direction='col'>
+ <Radio colorScheme='red' value='ada'>
+ Ya, ada
+ </Radio>
+ <Radio colorScheme='red' value='tidak'>
+ Tidak ada
+ </Radio>
+ </Stack>
+ </RadioGroup>
+ </div>
+ {chekValid && (
+ <div className='text-caption-2 text-danger-500 mt-1'>
+ {errors.portal}
+ </div>
+ )}
+ </div>
<div className='flex flex-col gap justify-between items-start'>
<label className='form-label text-wrap '>
Apakah bersedia transaksi via website?
@@ -1428,7 +1502,7 @@ const InformasiPerusahaan = ({
</div>
{chekValid && (
<div className='text-caption-2 text-danger-500 mt-1'>
- {errors.estimasi}
+ {errors.bersedia}
</div>
)}
</div>