Merge pull request 'Fix #31: Add Supplier Product Mapping model Add button , All Product Mapping in the table' (#32) from purchase-Delivery-address into main
Reviewed-on: Pozomind/pozo-retail-app#32
This commit is contained in:
commit
3aa0e13b7a
|
|
@ -36,18 +36,18 @@ const SupplierProductMappingForm = ({
|
|||
const [modalSelectedProduct, setModalSelectedProduct] = useState(null);
|
||||
const [tabledata, setTabledata] = useState([]);
|
||||
const [filteredTableData, setFilteredTableData] = useState([]);
|
||||
const details = {
|
||||
name :"tamil",
|
||||
address : {
|
||||
city : "hosur"
|
||||
const details = {
|
||||
name: "tamil",
|
||||
address: {
|
||||
city: "hosur"
|
||||
}
|
||||
}
|
||||
}
|
||||
const {address : {city}} = details
|
||||
const { address: { city } } = details
|
||||
|
||||
// Fetch suppliers function
|
||||
const fetchSypplaiers = async () => {
|
||||
try {
|
||||
const response = await dispatch(getsupplierBasedOnCmpIdBrId({cmpId : CompId,BranchId,AppId}))?.unwrap();
|
||||
const response = await dispatch(getsupplierBasedOnCmpIdBrId({ cmpId: CompId, BranchId, AppId }))?.unwrap();
|
||||
if (response?.data?.statusCode === 1) {
|
||||
const filteredData = response?.data?.data?.filter(filter => filter.ActiveStatus === 'A');
|
||||
setSupplierOptions(filteredData);
|
||||
|
|
@ -220,6 +220,14 @@ const {address : {city}} = details
|
|||
}
|
||||
];
|
||||
|
||||
const allProductMap = () => {
|
||||
const allProducts = productOptions;
|
||||
const newTableData = [...modelTableData, ...allProducts];
|
||||
setModelTableData(newTableData);
|
||||
setProductOptions([]);
|
||||
setMessage({ type: "success", data: "All Products Added Successfully" });
|
||||
}
|
||||
|
||||
return (
|
||||
<DefaultModal
|
||||
open={isModalOpen}
|
||||
|
|
@ -253,12 +261,12 @@ const {address : {city}} = details
|
|||
<DropDowns
|
||||
key={`product-dropdown-${dropdownKey}`}
|
||||
label={<label className='required'>Product Name</label>}
|
||||
options={productOptions.map(item => {
|
||||
options={productOptions.map(item => {
|
||||
const size = (item.Size === null ? "" : " (" + item.Size + " " + (item.UomName === null ? "" : item.UomName) + ") ")
|
||||
const brand = item.BrandName === null ? "" : item.BrandName
|
||||
return {
|
||||
value: item.ProdId,
|
||||
label: item.ProdName + size + brand
|
||||
value: item.ProdId,
|
||||
label: item.ProdName + size + brand
|
||||
}
|
||||
})}
|
||||
valueData={modalSelectedProduct}
|
||||
|
|
@ -266,6 +274,9 @@ const {address : {city}} = details
|
|||
isOnchanges={false}
|
||||
alphabetfilter="Yes"
|
||||
/>
|
||||
<button style={{ padding: '10px 10px', margin: '0px 15px', borderRadius: '6px',fontFamily:'poppins', background: '#901D77', color: 'white', border: 'none', cursor: 'pointer' }}
|
||||
onClick={allProductMap}>Add All</button>
|
||||
|
||||
<div style={{ position: "absolute", left: "16rem", top: "1px" }}>
|
||||
<Tooltip title={"Add Product"} placement={"top"}>
|
||||
<PlusCircleOutlined
|
||||
|
|
|
|||
Loading…
Reference in New Issue