rd to retailer changed naming

This commit is contained in:
Sibunnayak 2024-11-05 10:04:18 +05:30
parent d18abb7c72
commit aef4fa2fad
9 changed files with 73 additions and 87 deletions

View File

@ -39,7 +39,7 @@ const Inventory = () => {
id: entry._id, id: entry._id,
uniqueId: entry.uniqueId, uniqueId: entry.uniqueId,
tradeName: entry.tradeName || "N/A", tradeName: entry.tradeName || "N/A",
designation: entry.addedFor === "PrincipalDistributor" ? "PD" : "RD", designation: entry.addedFor === "PrincipalDistributor" ? "PD" : "Retailer",
products: entry.products.map((product) => ({ products: entry.products.map((product) => ({
SKU: product.SKU, SKU: product.SKU,
ProductName: product.ProductName, ProductName: product.ProductName,
@ -203,7 +203,7 @@ const Inventory = () => {
className="text-start" className="text-start"
style={{ border: "1px solid" }} style={{ border: "1px solid" }}
> >
PD/RD PD/Retailer
</th> </th>
<th <th
className="text-start" className="text-start"
@ -253,7 +253,7 @@ const Inventory = () => {
inventoryData.map((entry, i) => inventoryData.map((entry, i) =>
entry.products.map((product, j) => ( entry.products.map((product, j) => (
<tr key={`${i}-${j}`}> <tr key={`${i}-${j}`}>
{/* Only show ID, Date, Time, Trade Name, PD/RD, and Actions on the first row of each entry */} {/* Only show ID, Date, Time, Trade Name, PD/Retailer, and Actions on the first row of each entry */}
{j === 0 && ( {j === 0 && (
<> <>
<td <td

View File

@ -125,7 +125,7 @@ const SingleInventory = () => {
<Grid container spacing={2}> <Grid container spacing={2}>
<Grid item xs={6}> <Grid item xs={6}>
<Typography> <Typography>
<strong>PD or RD:</strong>{" "} <strong>PD or Retailer:</strong>{" "}
{inventoryDetails.addedFor} {inventoryDetails.addedFor}
</Typography> </Typography>
<Typography> <Typography>

View File

@ -316,7 +316,7 @@ const principalDistributor = () => {
type="button" type="button"
className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-2"
> >
RD Retailer
</button> </button>
</Link> </Link>
</td> </td>

View File

@ -514,7 +514,7 @@ const SingleRetailDistributor = () => {
<tr> <tr>
<th style={{ width: "5%" }}>SL No.</th> <th style={{ width: "5%" }}>SL No.</th>
<th style={{ width: "20%" }}>Trade Name</th> <th style={{ width: "20%" }}>Trade Name</th>
<th style={{ width: "15%" }}>RD Name</th> <th style={{ width: "15%" }}>Retailer Name</th>
<th style={{ width: "40%" }}>Address</th> <th style={{ width: "40%" }}>Address</th>
<th style={{ width: "7%" }}>Default</th> <th style={{ width: "7%" }}>Default</th>
<th style={{ width: "13%" }}>Action</th> <th style={{ width: "13%" }}>Action</th>
@ -535,7 +535,7 @@ const SingleRetailDistributor = () => {
</td> </td>
<td className="text-start"> <td className="text-start">
<strong> <strong>
{address?.Name ? `${address.Name}` : "No RD Name"} {address?.Name ? `${address.Name}` : "No Retailer Name"}
</strong> </strong>
</td> </td>
<td className="text-start"> <td className="text-start">

View File

@ -39,7 +39,7 @@ const Sales = () => {
id: entry._id, id: entry._id,
uniqueId: entry.uniqueId, uniqueId: entry.uniqueId,
tradeName: entry.tradeName || "N/A", tradeName: entry.tradeName || "N/A",
designation: entry.addedFor === "PrincipalDistributor" ? "PD" : "RD", designation: entry.addedFor === "PrincipalDistributor" ? "PD" : "Retailer",
products: entry.products.map((product) => ({ products: entry.products.map((product) => ({
SKU: product.SKU, SKU: product.SKU,
ProductName: product.ProductName, ProductName: product.ProductName,
@ -203,7 +203,7 @@ const Sales = () => {
className="text-start" className="text-start"
style={{ border: "1px solid" }} style={{ border: "1px solid" }}
> >
PD/RD PD/Retailer
</th> </th>
<th <th
className="text-start" className="text-start"
@ -253,7 +253,7 @@ const Sales = () => {
SalesData.map((entry, i) => SalesData.map((entry, i) =>
entry.products.map((product, j) => ( entry.products.map((product, j) => (
<tr key={`${i}-${j}`}> <tr key={`${i}-${j}`}>
{/* Only show ID, Date, Time, Trade Name, PD/RD, and Actions on the first row of each entry */} {/* Only show ID, Date, Time, Trade Name, PD/Retailer, and Actions on the first row of each entry */}
{j === 0 && ( {j === 0 && (
<> <>
<td <td

View File

@ -125,7 +125,7 @@ const SingleSales = () => {
<Grid container spacing={2}> <Grid container spacing={2}>
<Grid item xs={6}> <Grid item xs={6}>
<Typography> <Typography>
<strong>PD or RD:</strong>{" "} <strong>PD or Retailer:</strong>{" "}
{SalesDetails.addedFor} {SalesDetails.addedFor}
</Typography> </Typography>
<Typography> <Typography>

View File

@ -5,7 +5,7 @@ import Button from "@material-ui/core/Button";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { isAutheticated } from "src/auth"; import { isAutheticated } from "src/auth";
import swal from "sweetalert"; import swal from "sweetalert";
import debounce from 'lodash.debounce'; import debounce from "lodash.debounce";
const SalesCoOrdinator = () => { const SalesCoOrdinator = () => {
const token = isAutheticated(); const token = isAutheticated();
@ -57,10 +57,13 @@ const SalesCoOrdinator = () => {
getSalesCoOrdinatorsData(); getSalesCoOrdinatorsData();
}, [success, itemPerPage, currentPage]); }, [success, itemPerPage, currentPage]);
const debouncedSearch = useCallback(debounce(() => { const debouncedSearch = useCallback(
debounce(() => {
setCurrentPage(1); setCurrentPage(1);
getSalesCoOrdinatorsData(); getSalesCoOrdinatorsData();
}, 500), []); }, 500),
[]
);
const handleSearchChange = () => { const handleSearchChange = () => {
debouncedSearch(); debouncedSearch();
@ -216,21 +219,25 @@ const SalesCoOrdinator = () => {
style={{ background: "#ecdddd" }} style={{ background: "#ecdddd" }}
> >
<tr> <tr>
<th>Unique Id </th> <th style={{ width: "9%" }}>Unique Id </th>
<th className="text-start">Name</th> <th style={{ width: "18%" }}>Name</th>
<th className="text-start">Mobile No.</th> <th style={{ width: "12%" }}>Mobile No.</th>
<th className="text-start">Email</th> <th style={{ width: "18%" }}>Email</th>
<th className="text-start">Verify</th> <th style={{ width: "7%" }}>Verify</th>
<th className="text-start">Register On</th> <th style={{ width: "10%" }}>Register On</th>
<th className="text-start">Mapping</th> <th className="text-center" style={{ width: "13%" }}>
<th className="text-start">Action</th> Mapping
</th>
<th className="text-center" style={{ width: "13%" }}>
Action
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{loading ? ( {loading ? (
<tr> <tr>
<td className="text-center" colSpan="6"> <td className="text-center" colSpan="8">
Loading... Loading...
</td> </td>
</tr> </tr>
@ -287,12 +294,8 @@ const SalesCoOrdinator = () => {
to={`/view/SCprincipaldistributor/${salescoordinator._id}`} to={`/view/SCprincipaldistributor/${salescoordinator._id}`}
> >
<button <button
style={{
color: "white",
marginRight: "1rem",
}}
type="button" type="button"
className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-primary btn-sm waves-effect waves-light btn-table"
> >
PD PD
</button> </button>
@ -301,14 +304,10 @@ const SalesCoOrdinator = () => {
to={`/view/SCretaildistributor/${salescoordinator._id}`} to={`/view/SCretaildistributor/${salescoordinator._id}`}
> >
<button <button
style={{
color: "white",
marginRight: "1rem",
}}
type="button" type="button"
className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-1 md-mt-1 md-ml-0"
> >
RD Retailer
</button> </button>
</Link> </Link>
</td> </td>
@ -317,12 +316,8 @@ const SalesCoOrdinator = () => {
to={`/salescoordinator/edit/${salescoordinator._id}`} to={`/salescoordinator/edit/${salescoordinator._id}`}
> >
<button <button
style={{
color: "white",
marginRight: "1rem",
}}
type="button" type="button"
className="btn btn-info btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-info btn-sm waves-effect waves-light btn-table"
> >
Edit Edit
</button> </button>
@ -331,8 +326,10 @@ const SalesCoOrdinator = () => {
<button <button
type="button" type="button"
style={{ color: "white" }} style={{ color: "white" }}
className="btn btn-danger btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-danger btn-sm waves-effect waves-light btn-table ml-1 md-mt-1 md-ml-0"
onClick={() => handleDelete(salescoordinator._id)} onClick={() =>
handleDelete(salescoordinator._id)
}
> >
Delete Delete
</button> </button>
@ -342,7 +339,7 @@ const SalesCoOrdinator = () => {
}) })
) : ( ) : (
<tr> <tr>
<td className="text-center" colSpan="6"> <td className="text-center" colSpan="8">
No Sales Coordinator found! No Sales Coordinator found!
</td> </td>
</tr> </tr>
@ -352,7 +349,8 @@ const SalesCoOrdinator = () => {
</div> </div>
<div className="d-flex justify-content-between"> <div className="d-flex justify-content-between">
<div> <div>
Showing {salescoordinatorsData?.length} of {totalData} entries Showing {salescoordinatorsData?.length} of {totalData}{" "}
entries
</div> </div>
<div> <div>
<button <button
@ -364,7 +362,9 @@ const SalesCoOrdinator = () => {
</button> </button>
<button <button
onClick={() => setCurrentPage(currentPage + 1)} onClick={() => setCurrentPage(currentPage + 1)}
disabled={salescoordinatorsData?.length < itemPerPage || loading} disabled={
salescoordinatorsData?.length < itemPerPage || loading
}
className="btn btn-primary ml-2" className="btn btn-primary ml-2"
> >
Next Next

View File

@ -219,21 +219,23 @@ const TerritoryManager = () => {
style={{ background: "#ecdddd" }} style={{ background: "#ecdddd" }}
> >
<tr> <tr>
<th>Unique Id </th> <th style={{ width: "9%" }}>Unique Id </th>
<th className="text-start">Name</th> <th style={{ width: "17%" }}>Name</th>
<th className="text-start">Mobile No.</th> <th style={{ width: "11%" }}>Mobile No.</th>
<th className="text-start">Email</th> <th style={{ width: "17%" }}>Email</th>
<th className="text-start">Verify</th> <th style={{ width: "6%" }}>Verify</th>
<th className="text-start">Register On</th> <th style={{ width: "10%" }}>Register On</th>
<th className="text-start">Mapping</th> <th className="text-center" style={{ width: "17%" }}>Mapping</th>
<th className="text-start">Action</th> <th className="text-center" style={{ width: "13%" }}>
Action
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{loading ? ( {loading ? (
<tr> <tr>
<td className="text-center" colSpan="6"> <td className="text-center" colSpan="8">
Loading... Loading...
</td> </td>
</tr> </tr>
@ -290,12 +292,8 @@ const TerritoryManager = () => {
to={`/view/salescoordinator/${territorymanager._id}`} to={`/view/salescoordinator/${territorymanager._id}`}
> >
<button <button
style={{
color: "white",
marginRight: "1rem",
}}
type="button" type="button"
className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-primary btn-sm waves-effect waves-light btn-table"
> >
SC SC
</button> </button>
@ -304,12 +302,8 @@ const TerritoryManager = () => {
to={`/view/principaldistributor/${territorymanager._id}`} to={`/view/principaldistributor/${territorymanager._id}`}
> >
<button <button
style={{
color: "white",
marginRight: "1rem",
}}
type="button" type="button"
className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-1 md-mt-1 md-ml-0"
> >
PD PD
</button> </button>
@ -318,28 +312,20 @@ const TerritoryManager = () => {
to={`/view/retaildistributor/${territorymanager._id}`} to={`/view/retaildistributor/${territorymanager._id}`}
> >
<button <button
style={{
color: "white",
marginRight: "1rem",
}}
type="button" type="button"
className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-primary btn-sm waves-effect waves-light btn-table ml-1 md-mt-1 md-ml-0"
> >
RD Retailer
</button> </button>
</Link> </Link>
</td> </td>
<td className="text-start"> <td className="text-end">
<Link <Link
to={`/territorymanager/edit/${territorymanager._id}`} to={`/territorymanager/edit/${territorymanager._id}`}
> >
<button <button
style={{
color: "white",
marginRight: "1rem",
}}
type="button" type="button"
className="btn btn-info btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-info btn-sm waves-effect waves-light btn-table"
> >
Edit Edit
</button> </button>
@ -348,7 +334,7 @@ const TerritoryManager = () => {
<button <button
type="button" type="button"
style={{ color: "white" }} style={{ color: "white" }}
className="btn btn-danger btn-sm waves-effect waves-light btn-table ml-2" className="btn btn-danger btn-sm waves-effect waves-light btn-table ml-1 md-mt-1 md-ml-0"
onClick={() => onClick={() =>
handleDelete(territorymanager._id) handleDelete(territorymanager._id)
} }
@ -361,7 +347,7 @@ const TerritoryManager = () => {
}) })
) : ( ) : (
<tr> <tr>
<td className="text-center" colSpan="6"> <td className="text-center" colSpan="8">
No Territory Manager found! No Territory Manager found!
</td> </td>
</tr> </tr>

View File

@ -207,7 +207,7 @@
// className="label-100 mt-2 row ms-1" // className="label-100 mt-2 row ms-1"
// style={{ fontWeight: "bold" }} // style={{ fontWeight: "bold" }}
// > // >
// RD Mobile Application // Retailer Mobile Application
// <br /> // <br />
// </label> // </label>
// <input // <input
@ -385,7 +385,7 @@ function MobileApp() {
</div> </div>
<div className="form-group"> <div className="form-group">
<label className="label-100 mt-3" style={{ fontWeight: "bold" }}> <label className="label-100 mt-3" style={{ fontWeight: "bold" }}>
RD Mobile Application Retailer Mobile Application
</label> </label>
<input <input
type="file" type="file"
@ -394,7 +394,7 @@ function MobileApp() {
/> />
{RDAppUrl && ( {RDAppUrl && (
<a href={RDAppUrl} download className="btn btn-link"> <a href={RDAppUrl} download className="btn btn-link">
Download RD App Download Retailer App
</a> </a>
)} )}
</div> </div>