diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-03-12 14:30:25 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-03-12 14:30:25 +0700 |
| commit | 6a682891b755a6f8d91edafe54a62047afcb5492 (patch) | |
| tree | f8fee880ed7129093f21dc069074767eafce261f | |
| parent | f4adb008ae55e4b340c58c32d45af6d0eaf6eb57 (diff) | |
| parent | d36a21cb0a6e95323fa9dd868a79bf1a318968e3 (diff) | |
Merge branch 'new-release' into CR/repeat-order
| -rw-r--r-- | src-migrate/modules/product-detail/components/PriceAction.tsx | 2 | ||||
| -rw-r--r-- | src-migrate/modules/register/stores/usePengajuanTempoStore.ts | 14 | ||||
| -rw-r--r-- | src-migrate/types/tempo.ts | 3 | ||||
| -rw-r--r-- | src-migrate/validations/tempo.ts | 110 | ||||
| -rw-r--r-- | src/lib/checkout/components/Checkout.jsx | 14 | ||||
| -rw-r--r-- | src/lib/pengajuan-tempo/component/Dokumen.jsx | 4 | ||||
| -rw-r--r-- | src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx | 4 | ||||
| -rw-r--r-- | src/lib/pengajuan-tempo/component/PengajuanTempo.jsx | 20 | ||||
| -rw-r--r-- | src/lib/pengajuan-tempo/component/Pengiriman.jsx | 273 | ||||
| -rw-r--r-- | src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx | 8 | ||||
| -rw-r--r-- | src/lib/transaction/components/Transaction.jsx | 2 | ||||
| -rw-r--r-- | src/lib/variant/components/VariantCard.jsx | 12 | ||||
| -rw-r--r-- | src/pages/index.jsx | 14 |
13 files changed, 420 insertions, 60 deletions
diff --git a/src-migrate/modules/product-detail/components/PriceAction.tsx b/src-migrate/modules/product-detail/components/PriceAction.tsx index 9348bbfb..850c2d9d 100644 --- a/src-migrate/modules/product-detail/components/PriceAction.tsx +++ b/src-migrate/modules/product-detail/components/PriceAction.tsx @@ -163,7 +163,7 @@ const PriceAction = ({ product }: Props) => { </span> */} </div> <div> - {selectedVariant?.is_in_bu && ( + {qtyPickUp > 0 && ( <Link href='/panduan-pick-up-service' className='group'> <Image src='/images/PICKUP-NOW.png' diff --git a/src-migrate/modules/register/stores/usePengajuanTempoStore.ts b/src-migrate/modules/register/stores/usePengajuanTempoStore.ts index 1e086c06..79ab3612 100644 --- a/src-migrate/modules/register/stores/usePengajuanTempoStore.ts +++ b/src-migrate/modules/register/stores/usePengajuanTempoStore.ts @@ -171,7 +171,7 @@ type StatePengiriman = { }; type ActionPengiriman = { updateFormPengiriman: (name: string, value: string) => void; - + updateDokumenProsedur: (name: string, format: string, base64: string) => void; validatePengiriman: () => void; }; export const usePengajuanTempoStorePengiriman = create< @@ -186,6 +186,8 @@ export const usePengajuanTempoStorePengiriman = create< districtPengiriman: '', subDistrictPengiriman: '', zipPengiriman: '', + PICBarangMobile: '', + invoicePicMobile: '', invoicePicTittle: '', invoicePic: '', isSameAddrees: '', @@ -202,12 +204,21 @@ export const usePengajuanTempoStorePengiriman = create< dokumenPengirimanInput: '', dokumenKirimInput: '', dokumenPengirimanInvoice: '', + dokumenProsedur: { name: '', format: '', base64: '' }, }, updateFormPengiriman: (name, value) => set((state) => ({ formPengiriman: { ...state.formPengiriman, [name]: value }, })), + updateDokumenProsedur: (name, format, base64) => + set((state) => ({ + formPengiriman: { + ...state.formPengiriman, + dokumenProsedur: { name, format, base64 }, + }, + })), + errorsPengiriman: {}, validatePengiriman: () => { try { @@ -260,6 +271,7 @@ export const usePengajuanTempoStoreDokumen = create< dokumenLaporanKeuangan: { name: '', format: '', base64: '' }, dokumenFotoKantor: { name: '', format: '', base64: '' }, dokumenTempatBekerja: { name: '', format: '', base64: '' }, + dokumenProsedur: { name: '', format: '', base64: '' }, }, // Memperbarui dokumen dengan name, format, dan base64 diff --git a/src-migrate/types/tempo.ts b/src-migrate/types/tempo.ts index d043e2d6..27b0c67e 100644 --- a/src-migrate/types/tempo.ts +++ b/src-migrate/types/tempo.ts @@ -42,6 +42,8 @@ export type tempoPropsPengiriman = { cityPengiriman: string; streetInvoice: string; zip: string; + PICBarangMobile: string; + invoicePicMobile: string; invoicePic: string; isSameAddrees: string; stateInvoice: string; @@ -52,6 +54,7 @@ export type tempoPropsPengiriman = { dokumenPengirimanInput: string; dokumenPengirimanInvoice: string; dokumenPengirimanInvoiceInput: string; + dokumenProsedur: string; }; export type tempoPropsSupplier = { supplier: string; diff --git a/src-migrate/validations/tempo.ts b/src-migrate/validations/tempo.ts index f019275c..e39f0f8b 100644 --- a/src-migrate/validations/tempo.ts +++ b/src-migrate/validations/tempo.ts @@ -8,7 +8,7 @@ export const TempoSchema = z.object({ state: z.string().min(1, { message: 'Provinsi harus dipilih' }), city: z.string().min(1, { message: 'Kota harus dipilih' }), district: z.string().min(1, { message: 'Kecamatan harus dipilih' }), - subDistrict: z.string().min(1, { message: 'Kelurahan harus dipilih' }), + subDistrict: z.string().optional(), mobile: z .string() .min(1, { message: 'Nomor telepon harus diisi' }) @@ -33,50 +33,81 @@ export const TempoSchema = z.object({ .min(1, { message: 'Category produk harus dipilih' }), }); -export const TempoSchemaKontakPerson = z.object({ - direkturName: z.string().min(1, { message: 'Nama harus diisi' }), - direkturTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), - financeName: z.string().min(1, { message: 'Nama harus diisi' }), - direkturMobile: z.string().optional(), - financeMobile: z +export const TempoSchemaKontakPerson = z + .object({ + direkturName: z.string().min(1, { message: 'Nama harus diisi' }), + direkturTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), + financeName: z.string().min(1, { message: 'Nama harus diisi' }), + direkturMobile: z.string().optional(), + financeMobile: z + .string() + .min(1, { message: 'Nomor telepon harus diisi' }) + .refine((val) => /^\d{10,12}$/.test(val), { + message: 'Format nomor telepon tidak valid, contoh: 081234567890', + }), + purchasingTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), + financeTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), + purchasingMobile: z + .string() + .min(1, { message: 'Nomor telepon harus diisi' }) + .refine((val) => /^\d{10,12}$/.test(val), { + message: 'Format nomor telepon tidak valid, contoh: 081234567890', + }), + direkturEmail: z + .string() + .min(1, { message: 'Email harus diisi' }) + .email({ message: 'Email harus menggunakan format example@mail.com' }), + purchasingEmail: z + .string() + .min(1, { message: 'Email harus diisi' }) + .email({ message: 'Email harus menggunakan format example@mail.com' }), + financeEmail: z + .string() + .min(1, { message: 'Email harus diisi' }) + .email({ message: 'Email harus menggunakan format example@mail.com' }), + purchasingName: z.string().min(1, { message: 'Nama harus diisi' }), + }) + .refine( + (data) => + !data.financeEmail || // Jika financeEmail kosong, tidak perlu validasi + data.financeEmail !== data.purchasingEmail, // Validasi jika financeEmail ada + { + message: 'Email Finance tidak boleh sama dengan Email Purchasing', + path: ['financeEmail'], + } + ) + .refine( + (data) => + !data.direkturEmail || + (data.direkturEmail !== data.financeEmail && + data.direkturEmail !== data.purchasingEmail), + { + message: + 'Email Direktur tidak boleh sama dengan Email Finance atau Purchasing', + path: ['direkturEmail'], + } + ); +export const TempoSchemaPengiriman = z.object({ + PICTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), + PICName: z.string().min(1, { message: 'Nama harus diisi' }), + streetPengiriman: z.string().min(1, { message: 'Alamat harus diisi' }), + statePengiriman: z.string().min(1, { message: 'Provinsi harus dipilih' }), + cityPengiriman: z.string().min(1, { message: 'Kota harus dipilih' }), + districtPengiriman: z.string().min(1, { message: 'Kecamatan harus dipilih' }), + subDistrictPengiriman: z.string().optional(), + zipPengiriman: z.string().min(1, { message: 'Kode pos harus diisi' }), + PICBarangMobile: z .string() .min(1, { message: 'Nomor telepon harus diisi' }) .refine((val) => /^\d{10,12}$/.test(val), { message: 'Format nomor telepon tidak valid, contoh: 081234567890', }), - purchasingTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), - financeTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), - purchasingMobile: z + invoicePicMobile: z .string() .min(1, { message: 'Nomor telepon harus diisi' }) .refine((val) => /^\d{10,12}$/.test(val), { message: 'Format nomor telepon tidak valid, contoh: 081234567890', }), - direkturEmail: z - .string() - .min(1, { message: 'Email harus diisi' }) - .email({ message: 'Email harus menggunakan format example@mail.com' }), - purchasingEmail: z - .string() - .min(1, { message: 'Email harus diisi' }) - .email({ message: 'Email harus menggunakan format example@mail.com' }), - financeEmail: z - .string() - .min(1, { message: 'Email harus diisi' }) - .email({ message: 'Email harus menggunakan format example@mail.com' }), - purchasingName: z.string().min(1, { message: 'Nama harus diisi' }), -}); -export const TempoSchemaPengiriman = z.object({ - PICTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), - PICName: z.string().min(1, { message: 'Nama harus diisi' }), - streetPengiriman: z.string().min(1, { message: 'Alamat harus diisi' }), - statePengiriman: z.string().min(1, { message: 'Provinsi harus dipilih' }), - cityPengiriman: z.string().min(1, { message: 'Kota harus dipilih' }), - districtPengiriman: z.string().min(1, { message: 'Kecamatan harus dipilih' }), - subDistrictPengiriman: z - .string() - .min(1, { message: 'Kelurahan harus dipilih' }), - zipPengiriman: z.string().min(1, { message: 'Kode pos harus diisi' }), invoicePicTittle: z.string().min(1, { message: 'Tittle harus dipilih' }), invoicePic: z.string().min(1, { message: 'Nama pic invoice harus diisi' }), streetInvoice: z.string().min(1, { message: 'Alamat invoice harus diisi' }), @@ -87,9 +118,7 @@ export const TempoSchemaPengiriman = z.object({ districtInvoice: z .string() .min(1, { message: 'Kecamatan invoice harus dipilih' }), - subDistrictInvoice: z - .string() - .min(1, { message: 'Kelurahan invoice harus dipilih' }), + subDistrictInvoice: z.string().optional(), zipInvoice: z.string().min(1, { message: 'Kode pos harus diisi' }), isSameAddrees: z.string(), isSameAddreesStreet: z.string(), @@ -99,6 +128,11 @@ export const TempoSchemaPengiriman = z.object({ dokumenPengirimanInput: z.string().optional(), dokumenKirimInput: z.string().optional(), dokumenPengirimanInvoiceInput: z.string().optional(), + dokumenProsedur: z.object({ + name: z.string().min(1, { message: 'Nama file harus diisi' }), + format: z.string().optional(), + base64: z.string().optional(), + }), }); export const TempoSchemaSupplier = z.object({ supplier: z.string().min(1, { message: 'Nama supplier harus diisi' }), diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index a9495a74..a8b31ece 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -483,13 +483,25 @@ const Checkout = () => { if (query) { data.source = 'buy'; } - if (poNumber.current.value) data.po_number = poNumber.current.value; + if (poNumber.current.value) { + if (typeof file == 'undefined') { + toast.error( + 'Nomor PO ' + + poNumber.current.value + + ' telah dimasukkan, Harap upload file PO yang dimaksud' + ); + setIsLoading(false); + return; + } + data.po_number = poNumber.current.value; + } if (typeof file !== 'undefined') data.po_file = await getFileBase64(file); const isCheckouted = await checkoutApi({ data }); if (!isCheckouted?.id) { toast.error('Gagal melakukan transaksi, terjadi kesalahan internal'); + setIsLoading(false); return; } else { gtagPurchase(products, biayaKirim, isCheckouted.name); diff --git a/src/lib/pengajuan-tempo/component/Dokumen.jsx b/src/lib/pengajuan-tempo/component/Dokumen.jsx index f986d47a..aedb9016 100644 --- a/src/lib/pengajuan-tempo/component/Dokumen.jsx +++ b/src/lib/pengajuan-tempo/component/Dokumen.jsx @@ -566,7 +566,7 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { > <div> <label className='form-label text-nowrap'> - Foto tempat kerja + Foto Ruangan Tempat Kerja </label> <span className='text-xs opacity-60 text-red-500'> Format: pdf, jpeg, jpg, png. max file size 2MB @@ -1144,7 +1144,7 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { ref={dokumenTempatBekerjaRef} > <label className='form-label text-nowrap'> - Foto tempat kerja + Foto Ruangan Tempat Kerja </label> <div className='flex flex-row gap-2'> <label diff --git a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx index 66d33b43..7c10f80c 100644 --- a/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx +++ b/src/lib/pengajuan-tempo/component/KonfirmasiDokumen.jsx @@ -646,7 +646,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { <div className='w-full flex flex-row items-center '> <div className='w-2/5'> <label className='form-label text-nowrap'> - Foto tempat kerja + Foto Ruangan Tempat Kerja </label> </div> <div className='w-3/5'> @@ -1492,7 +1492,7 @@ const KonfirmasiDokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { <div className='w-full flex flex-row items-center '> <div className='w-2/5'> <label className='form-label text-wrap'> - Foto tempat kerja + Foto Ruangan Tempat Kerja </label> </div> <div className='w-3/5'> diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx index c577aa41..7cf201b7 100644 --- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx +++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx @@ -191,7 +191,6 @@ const PengajuanTempo = () => { useEffect(() => { const cachedData = bigData; - const loadBigData = async () => { if (cachedData) { // Ambil kunci-kunci yang relevan berdasarkan currentStep dari stepDivsForm @@ -218,6 +217,10 @@ const PengajuanTempo = () => { : String(bigData[key]); // Untuk tipe primitif // Kirim data yang sudah diubah ke string ke stepDivsUpdateForm stepDivsUpdateForm[currentStep](key, stringData); + if (key == 'dokumenProsedur') { + const stringData = bigData[key]; + stepDivsUpdateForm[currentStep](key, stringData); + } } }); } @@ -298,6 +301,9 @@ const PengajuanTempo = () => { section: label, tempo_request: tempoRequest, ...formData, + formDokumenProsedur: formData.dokumenProsedur + ? JSON.stringify(formData.dokumenProsedur) + : false, }); if (address.id) { setIdTempo(address.id); @@ -466,6 +472,9 @@ const PengajuanTempo = () => { user_id: address2.userId, tempo_request: false, ...formPengiriman, + formDokumenProsedur: formPengiriman.dokumenProsedur + ? JSON.stringify(formPengiriman.dokumenProsedur) + : false, }); if (address3.id && formattedDokumen.length > 0) { // Kirim dokumen yang sudah difilter @@ -518,7 +527,7 @@ const PengajuanTempo = () => { toast.dismiss(toastId); setIsLoading(false); - toast.error('Terjadi kesalahan dalam pengiriman formulir'); + toast.error('Terjadi kesalahan dalam pengiriman formulir hehehehe'); console.error(error); } }; @@ -647,11 +656,14 @@ const PengajuanTempo = () => { <TempoTermCondition onCheckChange={handleCheckChange} /> <Button colorScheme='red' - w={`${isMobile ? 'full' : '36'}`} + w={`${isMobile ? 'full' : '48'}`} isDisabled={!isCheckedTNC || isLoading} onClick={handleDaftarTempo} > - Daftar Tempo {<ChevronRightIcon className='w-5' />} + {isLoading + ? 'Loading...' + : 'Daftar Tempo'} + {!isLoading && <ChevronRightIcon className='w-5' />} </Button> </div> )} diff --git a/src/lib/pengajuan-tempo/component/Pengiriman.jsx b/src/lib/pengajuan-tempo/component/Pengiriman.jsx index 755cf45d..fcfa7e1e 100644 --- a/src/lib/pengajuan-tempo/component/Pengiriman.jsx +++ b/src/lib/pengajuan-tempo/component/Pengiriman.jsx @@ -13,6 +13,7 @@ import { } from '../../../../src-migrate/modules/register/stores/usePengajuanTempoStore'; import { toast } from 'react-hot-toast'; import useDevice from '@/core/hooks/useDevice'; +import getFileBase64 from '@/core/utils/getFileBase64'; const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { const { control, watch, setValue } = useForm(); const { isDesktop, isMobile } = useDevice(); @@ -21,6 +22,7 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { errorsPengiriman, validatePengiriman, updateFormPengiriman, + updateDokumenProsedur, } = usePengajuanTempoStorePengiriman(); const { form } = usePengajuanTempoStore(); const [states, setState] = useState([]); @@ -34,6 +36,7 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { const [zipsInvoice, setZipsInvoice] = useState([]); const [sameAddress, setSameAddress] = useState(false); const [sameAddressStreet, setSameAddressStreet] = useState(false); + const [nameFile, setNameFile] = useState(); const [selectedIds, setSelectedIds] = useState( formPengiriman.dokumenPengiriman @@ -299,6 +302,59 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { validatePengiriman(); }; + const handleInputChangeFile = async (event) => { + let fileBase64 = ''; + const { name } = event.target; + const file = event.target.files?.[0]; + // Allowed file extensions + const allowedExtensions = ['pdf', 'png', 'jpg', 'jpeg']; + let fileExtension = ''; + if (file) { + fileExtension = file.name.split('.').pop()?.toLowerCase(); // Extract file extension + + // Check if the file extension is allowed + if (!fileExtension || !allowedExtensions.includes(fileExtension)) { + toast.error( + 'Format file yang diijinkan adalah .pdf, .png, .jpg, atau .jpeg', + { duration: 4000 } + ); + + event.target.value = ''; + return; + } + + // Check for file size + if (file.size > 2000000) { + // try { + // const toastId = toast.loading('mencoba mengompresi file...'); + // // Compress image file + // const options = { + // maxSizeMB: 0.5, // Target size in MB + // maxWidthOrHeight: 1920, // Adjust as needed + // useWebWorker: true, + // }; + // const compressedFile = await imageCompression(file, options); + // toast.success('berhasil mengompresi file', { duration: 4000 }); + // // Convert compressed file to Base64 + // fileBase64 = await getFileBase64(compressedFile); + // updateFormDokumen( + // name, + // compressedFile.name, + // fileExtension, + // fileBase64 + // ); + // } catch (error) { + // toast.error('Gagal mengompresi file', { duration: 4000 }); + // } + toast.error('Max File Upload 2MB', { duration: 4000 }); + } else { + // Convert file to Base64 + fileBase64 = await getFileBase64(file); + updateDokumenProsedur(file.name, fileExtension, fileBase64); + } + validatePengiriman(); + } + }; const isFormValid = useMemo( () => Object.keys(errorsPengiriman).length === 0, [errorsPengiriman] @@ -311,7 +367,9 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { const districtPengirimanRef = useRef(null); const subDistrictPengirimanRef = useRef(null); const zipRef = useRef(null); + const PICBarangMobileRef = useRef(null); const invoicePicRef = useRef(null); + const invoicePicMobileRef = useRef(null); const streetInvoiceRef = useRef(null); const stateInvoiceRef = useRef(null); const cityInvoiceRef = useRef(null); @@ -366,10 +424,18 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { zipRef.current.scrollIntoView(options); return; } + if (errorsPengiriman.PICBarangMobile && PICBarangMobileRef.current) { + PICBarangMobileRef.current.scrollIntoView(options); + return; + } if (errorsPengiriman.invoicePic && invoicePicRef.current) { invoicePicRef.current.scrollIntoView(options); return; } + if (errorsPengiriman.invoicePicMobile && invoicePicMobileRef.current) { + invoicePicMobileRef.current.scrollIntoView(options); + return; + } if (errorsPengiriman.streetInvoice && streetInvoiceRef.current) { streetInvoiceRef.current.scrollIntoView(options); return; @@ -803,6 +869,38 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { <div className='flex flex-row justify-between items-start'> <div className='w-2/5'> <label className='form-label text-nowrap'> + No. HP PIC Penerimaan Barang + </label> + {!isKonfirmasi && ( + <span className='text-xs opacity-60'> + isi nomor PIC penerimaan barang yang bertanggung jawab di + perusahaan anda + </span> + )} + </div> + <div className='w-3/5'> + <input + id='PICBarangMobile' + name='PICBarangMobile' + ref={PICBarangMobileRef} + placeholder='Masukkan nomor PIC penerimaan barang' + value={formPengiriman.PICBarangMobile} + type='tel' + className='form-input' + aria-invalid={errorsPengiriman.PICBarangMobile} + onChange={handleInputChange} + /> + {chekValid && ( + <div className='text-caption-2 text-danger-500 mt-1'> + {errorsPengiriman.PICBarangMobile} + </div> + )} + </div> + </div> + + <div className='flex flex-row justify-between items-start'> + <div className='w-2/5'> + <label className='form-label text-nowrap'> Alamat Pengiriman Barang </label> {!isKonfirmasi && ( @@ -955,7 +1053,7 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { {...props} options={zips} disabled={ - !watchsubDistrict || sameAddressStreet + sameAddressStreet } placeholder='Zip' /> @@ -968,7 +1066,7 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { placeholder='Kode Pos' type='number' disabled={ - !watchsubDistrict || sameAddressStreet + sameAddressStreet } value={formPengiriman.zipPengiriman} className='form-input' @@ -1035,6 +1133,38 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { <div className='flex flex-row justify-between items-start'> <div className='w-2/5'> + <label className='form-label text-nowrap'> + No. HP PIC Penerimaan Invoice + </label> + {!isKonfirmasi && ( + <span className='text-xs opacity-60'> + isi nomor PIC penerimaan invoice yang bertanggung jawab di + perusahaan anda + </span> + )} + </div> + <div className='w-3/5'> + <input + id='invoicePicMobile' + name='invoicePicMobile' + ref={invoicePicMobileRef} + placeholder='Masukkan nomor PIC Penerimaan Invoice' + value={formPengiriman.invoicePicMobile} + type='tel' + className='form-input' + aria-invalid={errorsPengiriman.invoicePicMobile} + onChange={handleInputChange} + /> + {chekValid && ( + <div className='text-caption-2 text-danger-500 mt-1'> + {errorsPengiriman.invoicePicMobile} + </div> + )} + </div> + </div> + + <div className='flex flex-row justify-between items-start'> + <div className='w-2/5'> <label className='form-label text-nowrap'> Alamat Pengiriman Invoice </label> @@ -1193,7 +1323,7 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { {...props} options={zipsInvoice} disabled={ - !watchsubDistrictInvoice || sameAddress + sameAddress } placeholder='Zip' /> @@ -1205,7 +1335,7 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { placeholder='Kode Pos' type='number' disabled={ - !watchsubDistrictInvoice || sameAddress + sameAddress } value={formPengiriman.zipInvoice} className='form-input' @@ -1280,6 +1410,48 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { </div> </div> + <div className='w-full flex flex-row justify-between items-start'> + <div className='w-2/5'> + <label className='form-label text-nowrap'> + Prosedur Pengiriman{' '} + <span className=' opacity-60'>(Opsional)</span> + </label> + <span className='text-xs opacity-60 text-red-500'> + Format: pdf, jpeg, jpg, png. max file size 2MB + </span> + </div> + <div className='w-3/5'> + <div className='flex flex-row items-start gap-2'> + <label + htmlFor='dokumenProsedur' + className='cursor-pointer min-w-40 text-center bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded' + > + {formPengiriman?.dokumenProsedur?.name + ? 'Ubah Dokumen' + : 'Upload Dokumen'} + </label> + <input + id='dokumenProsedur' + name='dokumenProsedur' + type='file' + title=' ' + className='hidden' + aria-invalid={formPengiriman.dokumenProsedur} + onChange={handleInputChangeFile} + accept='.pdf,.png,.jpg,.jpeg' + /> + <span className='text-gray-600 line-clamp-2'> + {formPengiriman?.dokumenProsedur?.name} + </span> + </div> + {chekValid && ( + <div className='text-caption-2 text-danger-500 mt-1'> + {errorsPengiriman.dokumenProsedur} + </div> + )} + </div> + </div> + <div className='flex flex-row justify-between items-start'> <div className='w-2/5'> <label className='form-label text-wrap'> @@ -1429,6 +1601,7 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { )} </div> </div> + </div> </form> </div> @@ -1483,6 +1656,30 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { </div> <div className='flex flex-col gap-2 justify-between items-start'> + <label className='form-label text-nowrap'> + No. HP PIC Penerimaan Barang + </label> + <div className='flex items-center border border-gray-300 rounded-md w-full'> + <input + id='PICBarangMobile' + name='PICBarangMobile' + ref={PICBarangMobileRef} + value={formPengiriman.PICBarangMobile} + placeholder='Masukkan nomor PIC penerimaan barang' + type='tel' + className='form-input' + aria-invalid={errorsPengiriman.PICBarangMobile} + onChange={handleInputChange} + /> + </div> + {chekValid && ( + <div className='text-caption-2 text-danger-500 mt-1'> + {errorsPengiriman.PICBarangMobile} + </div> + )} + </div> + + <div className='flex flex-col gap-2 justify-between items-start'> <label className='form-label text-nowrap'> Alamat Pengiriman Barang </label> @@ -1701,6 +1898,30 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { </div> <div className='flex flex-col gap-2 justify-between items-start'> + <label className='form-label text-nowrap'> + No. HP PIC Penerimaan Invoice + </label> + <div className='flex items-center border border-gray-300 rounded-md w-full'> + <input + id='invoicePicMobile' + name='invoicePicMobile' + ref={invoicePicMobileRef} + value={formPengiriman.invoicePicMobile} + placeholder='Masukkan nomor PIC Penerimaan Invoice' + type='tel' + className='form-input' + aria-invalid={errorsPengiriman.invoicePicMobile} + onChange={handleInputChange} + /> + </div> + {chekValid && ( + <div className='text-caption-2 text-danger-500 mt-1'> + {errorsPengiriman.PICBarangMobile} + </div> + )} + </div> + + <div className='flex flex-col gap-2 justify-between items-start'> <label className='form-label text-nowrap'> Alamat Pengiriman Invoice </label> @@ -1920,6 +2141,48 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { </div> </div> + <div className='w-full flex flex-col justify-between items-start gap-2'> + <div className=''> + <label className='form-label text-nowrap'> + Prosedur Pengiriman{' '} + <span className=' opacity-60'>(Opsional)</span> + </label> + </div> + <div className='flex flex-col gap-2'> + <div className='flex flex-row items-start gap-2'> + <label + htmlFor='dokumenProsedur' + className='cursor-pointer min-w-40 text-center bg-gray-200 hover:bg-gray-300 text-gray-700 py-2 px-4 rounded' + > + {formPengiriman?.dokumenProsedur?.name + ? 'Ubah Dokumen' + : 'Upload Dokumen'} + </label> + <input + id='dokumenProsedur' + name='dokumenProsedur' + type='file' + title=' ' + className='hidden' + aria-invalid={errorsPengiriman.dokumenProsedur} + onChange={handleInputChangeFile} + accept='.pdf,.png,.jpg,.jpeg' + /> + <span className='mt-2 text-gray-600 line-clamp-2'> + {formPengiriman?.dokumenProsedur?.name} + </span> + </div> + {chekValid && ( + <div className='text-caption-2 text-danger-500 mt-1'> + {errorsPengiriman.dokumenProsedur} + </div> + )} + <span className='text-xs opacity-60 text-red-500'> + Format: pdf, jpeg, jpg, png. max file size 2MB + </span> + </div> + </div> + <div className='flex flex-col gap-2 justify-between items-start'> <label className='form-label text-wrap'> Apakah ada dokumen tanda terima yang diberikan pada saat @@ -2067,6 +2330,8 @@ const Pengiriman = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => { </div> <div className='w-2/5'></div> </div> + + </div> </form> </div> diff --git a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx index 4e99f9f5..4898a3f8 100644 --- a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx +++ b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx @@ -782,7 +782,7 @@ const InformasiPerusahaan = ({ <HookFormSelect {...props} options={zips} - disabled={!watchsubDistrict} + // disabled={!watchsubDistrict} placeholder='Zip' /> ) : ( @@ -793,7 +793,7 @@ const InformasiPerusahaan = ({ ref={zipRef} placeholder='Kode Pos' type='number' - disabled={!watchsubDistrict} + // disabled={!watchsubDistrict} value={form.zip} className='form-input' onChange={handleInputChange} @@ -1333,7 +1333,7 @@ const InformasiPerusahaan = ({ <HookFormSelect {...props} options={zips} - disabled={!watchsubDistrict} + // disabled={!watchsubDistrict} placeholder='Zip' /> ) : ( @@ -1344,7 +1344,7 @@ const InformasiPerusahaan = ({ ref={zipRef} placeholder='Kode Pos' type='number' - disabled={!watchsubDistrict} + // disabled={!watchsubDistrict} value={form.zip} className='form-input' onChange={handleInputChange} diff --git a/src/lib/transaction/components/Transaction.jsx b/src/lib/transaction/components/Transaction.jsx index 32416bc0..07f9573d 100644 --- a/src/lib/transaction/components/Transaction.jsx +++ b/src/lib/transaction/components/Transaction.jsx @@ -1125,7 +1125,7 @@ const Transaction = ({ id }) => { ? `| ${product?.attributes.join(', ')}` : ''} </div> - {product.soQty && product.reservedStockQty && ( + {product.soQty && ( <div className='text-[10px] text-red-500 italic mt-2'> {product.soQty !== product.reservedStockQty ? 'Barang sedang disiapkan' diff --git a/src/lib/variant/components/VariantCard.jsx b/src/lib/variant/components/VariantCard.jsx index d8cd5c93..79746995 100644 --- a/src/lib/variant/components/VariantCard.jsx +++ b/src/lib/variant/components/VariantCard.jsx @@ -128,10 +128,18 @@ const VariantCard = ({ product, openOnClick = true, buyMore = false }) => { <p className='text-caption-2 text-gray_r-11 mt-1'> Berat Item : {product?.weight} Kg x {product?.quantity} Barang </p> - <p className='text-[10px] text-red-500 italic mt-2'> + {product.soQty && ( + <div className='text-[10px] text-red-500 italic mt-2'> + {product.soQty !== product.reservedStockQty + ? 'Barang sedang disiapkan' + : `${product.reservedStockQty} barang bisa di + kirim/pickup`} + </div> + )} + {/* <p className='text-[10px] text-red-500 italic mt-2'> {qtyPickUp} barang ini bisa di pickup maksimal pukul 16.00 - </p> + </p> */} <div className='flex flex-wrap gap-x-1 items-center mt-auto'> {product.hasFlashsale && ( <> diff --git a/src/pages/index.jsx b/src/pages/index.jsx index fce2202a..df5047a3 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -97,6 +97,20 @@ export default function Home({ categoryId }) { 'indoteknik, indoteknik.com, toko teknik, toko perkakas, jual genset, jual fogging, jual krisbow, harga krisbow, harga alat safety, harga pompa air', }, ]} + openGraph={ + { + title : 'Indoteknik.com: B2B Industrial Supply & Solution', + description : 'Temukan pilihan produk B2B Industri & Alat Teknik untuk Perusahaan, UMKM & Pemerintah dengan lengkap, mudah dan transparan.', + images: [ + { + url: 'https://indoteknik.com/icon.jpg', + width: 800, + height: 600, + alt: 'indoteknik.com', + }, + ], + } + } /> <PagePopupIformation /> |
