customers
This commit is contained in:
2
src/components/third-party/ReactTable.js
vendored
2
src/components/third-party/ReactTable.js
vendored
@@ -496,7 +496,7 @@ SortingSelect.propTypes = {
|
||||
export const CSVExport = ({ data, filename, headers }) => {
|
||||
return (
|
||||
<CSVLink data={data} filename={filename} headers={headers}>
|
||||
<Tooltip title="CSV Export">
|
||||
<Tooltip title="Download CSV">
|
||||
<DownloadOutlined style={{ fontSize: '24px', color: 'gray', marginTop: 4, marginRight: 4, marginLeft: 4 }} />
|
||||
</Tooltip>
|
||||
</CSVLink>
|
||||
|
||||
@@ -525,7 +525,8 @@ const Customers = () => {
|
||||
try {
|
||||
// await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenants/?partnerid=${tid}&status=active`)
|
||||
await axios
|
||||
.get(`${process.env.REACT_APP_URL}/customers/getbytid/?tenantid=${tid}`)
|
||||
// .get(`${process.env.REACT_APP_URL}/customers/gettenantcustomers/?tenantid=${tid}`)
|
||||
.get(`${process.env.REACT_APP_URL}/customers/gettenantcustomers/?tenantid=${tid}&pageno=1&pagesize=20`)
|
||||
|
||||
.then((res) => {
|
||||
if (res.data.message === 'Success') {
|
||||
|
||||
@@ -433,6 +433,11 @@ const Createorder1 = () => {
|
||||
const [appLocaLat, setAppLocaLat] = useState();
|
||||
const [appLocaLng, setAppLocaLng] = useState();
|
||||
const [appLocaRadius, setAppLocaRadius] = useState();
|
||||
const [isSms, setIsSms] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(isSms);
|
||||
}, [isSms]);
|
||||
|
||||
const handleChipClick = (chipLabel) => {
|
||||
setSelectedCatChip(chipLabel);
|
||||
@@ -840,7 +845,7 @@ const Createorder1 = () => {
|
||||
processing: '',
|
||||
ready: '',
|
||||
remarks: '',
|
||||
smsdelivery: 1,
|
||||
smsdelivery: isSms,
|
||||
subcategoryid: +subCatId,
|
||||
taxamount: 0.0,
|
||||
tenantid: tenant.tenantid,
|
||||
@@ -978,7 +983,8 @@ const Createorder1 = () => {
|
||||
try {
|
||||
let url =
|
||||
searchCustList == ''
|
||||
? `${process.env.REACT_APP_URL}/customers/getbytid/?tenantid=${tid}&pageno=1&pagesize=1`
|
||||
? // ? `${process.env.REACT_APP_URL}/customers/getbytid/?tenantid=${tid}&pageno=1&pagesize=1`
|
||||
`${process.env.REACT_APP_URL}/customers/gettenantcustomers/?tenantid=${tid}&pageno=1&pagesize=20`
|
||||
: `${process.env.REACT_APP_URL}/customers/search/?tenantid=${tid}&keyword=${searchCustList}`;
|
||||
|
||||
await axios
|
||||
@@ -1517,7 +1523,6 @@ const Createorder1 = () => {
|
||||
label="Address"
|
||||
disabled={!isLocation}
|
||||
id="addressAuto1"
|
||||
placeholder="Search"
|
||||
fullWidth
|
||||
value={inputValue2}
|
||||
onChange={(e) => setInputValue2(e.target.value)}
|
||||
@@ -1878,7 +1883,7 @@ const Createorder1 = () => {
|
||||
<TextField
|
||||
id="addressAuto2"
|
||||
disabled={!isLocation}
|
||||
placeholder="Search"
|
||||
label="Address"
|
||||
fullWidth
|
||||
value={inputValue3}
|
||||
onChange={(e) => setInputValue3(e.target.value)}
|
||||
@@ -2194,6 +2199,15 @@ const Createorder1 = () => {
|
||||
</Stack>
|
||||
</Stack>
|
||||
)}
|
||||
<Stack direction={'row'} justifyContent={'space-between'}>
|
||||
<Typography variant="h5">SMS Delivery</Typography>
|
||||
<Switch
|
||||
checked={isSms === 1}
|
||||
onChange={(e) => {
|
||||
setIsSms(e.target.checked ? 1 : 0);
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
<Typography variant="h5">Category</Typography>
|
||||
<Autocomplete
|
||||
disablePortal
|
||||
|
||||
@@ -329,6 +329,47 @@ export default function ordersDetails() {
|
||||
row.deliverylocation.toLowerCase().includes(searchword.toLowerCase()) ||
|
||||
row.ridername.toLowerCase().includes(searchword.toLowerCase())
|
||||
);
|
||||
// to download ex format filtered data
|
||||
const csvData = filteredOrders.map((order) => ({
|
||||
tenantname: order.tenantname,
|
||||
tenantcity: order.tenantcity,
|
||||
tenantcontactno: order.tenantcontactno,
|
||||
rider: order.rider,
|
||||
orderid: order.orderid,
|
||||
orderdate: order.orderdate,
|
||||
deliverydate: order.deliverydate,
|
||||
orderstatus: order.orderstatus,
|
||||
deliverystatus: order.deliverystatus,
|
||||
ordernotes: order.ordernotes,
|
||||
kms: order.kms,
|
||||
actualkms: order.actualkms,
|
||||
assigntime: order.assigntime,
|
||||
starttime: order.starttime,
|
||||
arrivaltime: order.arrivaltime,
|
||||
pickuptime: order.pickuptime,
|
||||
deliverytime: order.deliverytime,
|
||||
canceltime: order.canceltime,
|
||||
deliverycharge: order.deliverycharge,
|
||||
deliveryamt: order.deliveryamt,
|
||||
pickupcustomer: order.pickupcustomer,
|
||||
pickupcontactno: order.pickupcontactno,
|
||||
pickupaddress: order.pickupaddress,
|
||||
pickupsuburb: order.pickupsuburb,
|
||||
pickupcity: order.pickupcity,
|
||||
pickuplat: order.pickuplat,
|
||||
pickuplong: order.pickuplong,
|
||||
deliverycustomer: order.deliverycustomer,
|
||||
deliverycontactno: order.deliverycontactno,
|
||||
deliveryaddress: order.deliveryaddress,
|
||||
deliverysuburb: order.deliverysuburb,
|
||||
deliverylat: order.deliverylat,
|
||||
deliverylong: order.deliverylong,
|
||||
locationname: order.locationname,
|
||||
locationsuburb: order.locationsuburb,
|
||||
locationcity: order.locationcity,
|
||||
locationcontactno: order.locationcontactno
|
||||
}));
|
||||
|
||||
const handleSelectAllClick = (event) => {
|
||||
if (event.target.checked) {
|
||||
const newSelectedId = rows.map((n) => n.name);
|
||||
@@ -426,17 +467,16 @@ export default function ordersDetails() {
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={8}>
|
||||
{' '}
|
||||
<div
|
||||
style={{
|
||||
<Stack
|
||||
sx={{
|
||||
display: 'flex',
|
||||
flexDirection: 'row',
|
||||
flexDirection: { md: 'row', xs: 'column' },
|
||||
justifyContent: 'end',
|
||||
|
||||
alignItems: 'center',
|
||||
marginRight: '25px'
|
||||
}}
|
||||
>
|
||||
<FormControl sx={{ width: 250, display: { xs: 'none', md: 'flex' } }}>
|
||||
<FormControl sx={{ width: 250 }}>
|
||||
<OutlinedInput
|
||||
inputRef={textFieldRef}
|
||||
aria-describedby="header-search-text"
|
||||
@@ -476,28 +516,22 @@ export default function ordersDetails() {
|
||||
|
||||
<Tooltip title="Order Filter">
|
||||
<IconButton
|
||||
// size='large'
|
||||
|
||||
color="secondary"
|
||||
variant="light"
|
||||
sx={{
|
||||
color: 'text.primary',
|
||||
bgcolor: 'grey.200',
|
||||
display: { xs: 'none', md: 'flex' },
|
||||
ml: 2
|
||||
mx: 2
|
||||
}}
|
||||
// aria-label="open profile"
|
||||
// ref={anchorRef}
|
||||
// aria-controls={open ? 'profile-grow' : undefined}
|
||||
aria-haspopup="true"
|
||||
// onClick={handleToggle}
|
||||
|
||||
onClick={() => setOpen(true)}
|
||||
>
|
||||
<FilterList />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
<CSVExport data={csvData} filename={`Orders_Detail_${dayjs().format('YYYY-MM-DD_HHmmss')}.csv`} />
|
||||
</Stack>
|
||||
</Grid>
|
||||
</Grid>
|
||||
{/* <Box sx={{ bgcolor: "#eeeeee" }}>
|
||||
|
||||
Reference in New Issue
Block a user