diff --git a/src/components/pages/purchase/form/request/PurchaseRequestForm.tsx b/src/components/pages/purchase/form/request/PurchaseRequestForm.tsx index abdeaf92..d039c1c9 100644 --- a/src/components/pages/purchase/form/request/PurchaseRequestForm.tsx +++ b/src/components/pages/purchase/form/request/PurchaseRequestForm.tsx @@ -712,9 +712,17 @@ const PurchaseRequestForm = ({ errorMessage={ isRepeaterInputError(idx, 'product_id').errorMessage } - isDisabled={type === 'detail'} - isClearable={type !== 'detail'} - placeholder='Pilih Produk' + isDisabled={ + type === 'detail' || !formik.values.supplier_id + } + isClearable={ + type !== 'detail' && !!formik.values.supplier_id + } + placeholder={ + !formik.values.supplier_id + ? 'Pilih Vendor terlebih dahulu' + : 'Pilih Produk' + } className={{ wrapper: 'w-full min-w-52 md:min-w-72 lg:min-w-80', }} @@ -729,8 +737,17 @@ const PurchaseRequestForm = ({ handlePurchaseItemChange(idx, 'qty', e.target.value) } onBlur={formik.handleBlur} - placeholder='Masukkan kuantitas' - readOnly={type === 'detail'} + placeholder={ + !formik.values.supplier_id + ? 'Pilih Vendor terlebih dahulu' + : 'Masukkan kuantitas' + } + readOnly={ + type === 'detail' || !formik.values.supplier_id + } + disabled={ + type === 'detail' || !formik.values.supplier_id + } allowNegative={false} decimalScale={0} isError={isRepeaterInputError(idx, 'qty').isError}