diff --git a/nearlexpressbuild b/nearlexpressbuild index 97d9155..c178408 160000 --- a/nearlexpressbuild +++ b/nearlexpressbuild @@ -1 +1 @@ -Subproject commit 97d9155b79317a1cef6ddd1e7dfc0b566371aec8 +Subproject commit c178408d139a244d63b6414235b538b1582acd39 diff --git a/src/assets/images/logo-nearle1.png b/src/assets/images/logo-nearle1.png index 5c95583..87ca867 100644 Binary files a/src/assets/images/logo-nearle1.png and b/src/assets/images/logo-nearle1.png differ diff --git a/src/assets/images/logo-nearle2.png b/src/assets/images/logo-nearle2.png deleted file mode 100644 index 87ca867..0000000 Binary files a/src/assets/images/logo-nearle2.png and /dev/null differ diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index c8fe4e9..f06d4d6 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -47,7 +47,7 @@ const Header = () => { // variant="light" // sx={{ color: 'text.primary', bgcolor: drawerOpen ? iconBackColorOpen : iconBackColor, ml: { xs: 0, lg: -2 } }} sx={{ color: '#fff', bgcolor: 'transparent', ml: { xs: 0, lg: -2 }, - fontSize:'20px', + fontSize:'25px', ':hover':{ color: '#fff', bgcolor: 'transparent' } }} diff --git a/src/pages/nearle/accountsettings.js b/src/pages/nearle/accountsettings.js index 608ff29..4e963ec 100644 --- a/src/pages/nearle/accountsettings.js +++ b/src/pages/nearle/accountsettings.js @@ -88,20 +88,17 @@ const Accountsettings = () => { - + {/* - {/* */} {info.companyname || ''} @@ -109,27 +106,7 @@ const Accountsettings = () => { - {/* - - - - - - 86 - Post - - - - 40 - Project - - - - 4.5K - Members - - - */} + @@ -149,7 +126,6 @@ const Accountsettings = () => { - {/* (+1-876) 8654 239 581 */} {info.primarycontact || ''} @@ -160,7 +136,6 @@ const Accountsettings = () => { - {/* New York */} {info.city} @@ -170,9 +145,7 @@ const Accountsettings = () => { - {/* - https://anshan.dh.url - */} + {info.state} @@ -181,55 +154,41 @@ const Accountsettings = () => { - {/* - - - - Junior - - - - - - UX Reseacher - - - - - - Wordpress - - - - - - HTML - - - - - - Graphic Design - - - - - - Code Style - - - - - - - */} + - - + */} + - + + + + + + {info.companyname} + {/* + + {info.registrationno} + */} + + } + > @@ -253,7 +212,6 @@ const Accountsettings = () => { Phone - {/* (+1-876) */} {info.primarycontact || ''} @@ -315,101 +273,7 @@ const Accountsettings = () => { - {/* - - - - - - - Master Degree (Year) - 2014-2017 - - - - - Institute - - - - - - - - - - - Bachelor (Year) - 2011-2013 - - - - - Institute - Imperial College London - - - - - - - - - School (Year) - 2009-2011 - - - - - Institute - School of London, England - - - - - - - */} - {/* - - - - - - - Senior - Senior UI/UX designer (Year) - - - - - Job Responsibility - - Perform task related to project manager with the 100+ team under my observation. Team management is key role in - this company. - - - - f - - - - - - Trainee cum Project Manager (Year) - 2017-2019 - - - - - Job Responsibility - Team management is key role in this company. - - - - - - - */} + diff --git a/src/pages/nearle/clients/createclient.js b/src/pages/nearle/clients/createclient.js index 77c485d..6156607 100644 --- a/src/pages/nearle/clients/createclient.js +++ b/src/pages/nearle/clients/createclient.js @@ -65,7 +65,10 @@ const Createclient = () => { const [primarycontact,setPrimarycontact]=useState('') const [firstname,setFirstname]=useState(''); const [doorno,setDoorno]=useState(''); - const [landmark,setLandmark]=useState('') + const [landmark,setLandmark]=useState(''); + const [tenantinfo, setTenantinfo] = useState({}); + + const navigate = useNavigate(); @@ -78,7 +81,9 @@ const Createclient = () => { useEffect(() => { // fetchprofiledetails(localStorage.getItem('appuserid')); // fetchprofiledetails(181); - + if(localStorage.getItem('tenantid')){ + fetchtenantinfo(localStorage.getItem('tenantid')) + } }, []) useEffect(() => { @@ -158,6 +163,21 @@ const Createclient = () => { } } + const fetchtenantinfo = async (tid) => { + setLoading(true) + await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`) + .then((res) => { + console.log(res) + if (res.data.status) { + setTenantinfo(res.data.details); + } + setLoading(false) + }).catch((err) => { + console.log(err) + setLoading(false) + }) + } + useEffect(() => { if (selectedImage) { setAvatar(URL.createObjectURL(selectedImage)); @@ -241,7 +261,7 @@ const Createclient = () => { "customerid":0, "configid":1, "firstname":firstname, - "applocationid":3, + "applocationid":tenantinfo.applolcationid, "profileimage":"", "dialcode":"+91", "contactno":mobilenumber, diff --git a/src/pages/nearle/orders/createorder.js b/src/pages/nearle/orders/createorder.js index ab127a1..4ec7e17 100644 --- a/src/pages/nearle/orders/createorder.js +++ b/src/pages/nearle/orders/createorder.js @@ -59,6 +59,7 @@ import Geocode from "react-geocode"; // import {setApi} from "react-geocode"; import Autocomplete1 from "react-google-autocomplete"; // import logo from 'assets/images/location.png' +import Loader from 'components/Loader' import { // EditOutlined, @@ -141,7 +142,7 @@ const Createorder = () => { const [stafflist, setStafflist] = useState([]); const [loading2, setLoading2] = useState(false); - + const [loading,setLoading]=useState(false) const [shiftarr, setShiftarr] = useState([]); @@ -163,12 +164,12 @@ const Createorder = () => { sno: 1, address: '', "customerid": '', - "deliverytime": "", + "deliverytime": dayjs(), "deliverylocationid": '', "clientname": '', "contactno": '' }]) - console.log(orderarr) + // console.log(dayjs()) } }, []) @@ -195,14 +196,17 @@ const Createorder = () => { }, [searchword]) const fetchtenantinfo = async (tid) => { + setLoading(true) await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`) .then((res) => { console.log(res) if (res.data.status) { setTenantinfo(res.data.details); } + setLoading(false) }).catch((err) => { console.log(err) + setLoading(false) }) } @@ -223,7 +227,7 @@ const Createorder = () => { - const createsubmitobj1 = () => { + const createsubmitobj1 = async() => { let arr = [] let timecheck = false; let addresscheck = false; @@ -243,7 +247,7 @@ const Createorder = () => { "moduleid": tenantinfo.moduleid, "configid": 7, "orderid": "", - "customerid": val.customerid, // + "customerid": val.customerid, "orderdate": dayjs().format('YYYY-MM-DD HH:mm:ss'), "orderstatus": "created", "pending": "", @@ -266,13 +270,16 @@ const Createorder = () => { "deliverycharge": 0, "deliverytime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.deliverytime.$d).format('HH:mm:ss')}`, "deliverylocationid": val.deliverylocationid, // - "delivceryaddress": val.address, + "deliveryaddress": val.address, "pickupaddress": tenantinfo.address, "pickuplat": tenantinfo.latitude, "pickuplong": tenantinfo.longitude, "ordernotes": otherinstructions, "remarks": "", - "tenantuserid": parseInt(localStorage.getItem('tenantid')) + "tenantuserid": parseInt(localStorage.getItem('tenantid')), + "categoryid":tenantinfo.categoryid, + "subcategoryid":tenantinfo.subcategoryid, + "partnerid":tenantinfo.partnerid }) }) @@ -283,7 +290,28 @@ const Createorder = () => { opentoast('Choose Client') } else { - opentoast('success') + setLoading(true) + await axios.post(`${process.env.REACT_APP_URL}/orders/createorders`,arr) + .then((res) => { + if (res.data.status) { + enqueueSnackbar('Order Created Successfully', { + variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' }, + autoHideDuration: 2000 + }) + navigate('/orders') + }else{ + opentoast(res.data.message) + } + setLoading(false) + console.log(res) + + }).catch((err) => { + console.log(err) + opentoast(err.data.message) + setLoading(false) + + }) + // opentoast('success') } console.log(arr) @@ -433,6 +461,11 @@ const Createorder = () => { return <> + {(loading) && + + + + } { sno: 1, address: '', "customerid": '', - "deliverytime": "", + "deliverytime":dayjs(), "deliverylocationid": '', "clientname": '', "contactno": '' @@ -475,7 +508,7 @@ const Createorder = () => { sno: 1, address: '', "customerid": '', - "deliverytime": "", + "deliverytime": dayjs(), "deliverylocationid": '', "clientname": '', "contactno": '' @@ -785,17 +818,18 @@ const Createorder = () => { setOrderarr([{ sno: 1, address: address.address, - "customerid": '', - "deliverytime": "", - "deliverylocationid": '', + "customerid": address.customerid, + "deliverytime": dayjs(), + "deliverylocationid": address.deliverylocationid, "clientname": address.firstname, "contactno": address.contactno }]) } else { - if (orderarr.find((val2) => val2.address == address.address)) { + if (orderarr.find((val2) => val2.customerid == address.customerid)) { if (orderarr.length > 1) { let arr = orderarr; - arr.splice(address.sno - 1, 1); + let res = orderarr.find((val2) => val2.customerid == address.customerid) + arr.splice(res.sno - 1, 1); let arr1 = [] arr.map((val2, k) => { arr1.push({ @@ -814,7 +848,7 @@ const Createorder = () => { sno: 1, address: '', "customerid": '', - "deliverytime": "", + "deliverytime": dayjs(), "deliverylocationid": '', "clientname": '', "contactno": '' @@ -827,7 +861,7 @@ const Createorder = () => { sno: arr.length + 1, 'address': address.address, "customerid": address.customerid, - "deliverytime": "", + "deliverytime": dayjs(), "deliverylocationid": address.deliverylocationid, "clientname":address.firstname, "contactno": address.contactno @@ -844,7 +878,7 @@ const Createorder = () => { sno: 1, address: address.address, "customerid": address.customerid, - "deliverytime": "", + "deliverytime": dayjs(), "deliverylocationid": address.deliverylocationid, "clientname":address.firstname, "contactno": address.contactno @@ -869,10 +903,11 @@ const Createorder = () => { cursor: 'pointer', p: 1.25, '&:hover': { - bgcolor: theme.palette.primary.lighter, - borderColor: theme.palette.primary.lighter + // bgcolor: theme.palette.primary.lighter, + // borderColor: theme.palette.primary.lighter + bgcolor:(orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : '' }, - bgcolor: (orderarr.find((val2) => val2.address == address.address)) ? '#e1bee7' : '' + bgcolor: (orderarr.find((val2) => val2.customerid == address.customerid)) ? '#e1bee7' : '' }} > @@ -880,7 +915,7 @@ const Createorder = () => { {address.firstname} {(orderarr.find((val2) => val2.address == address.address)) && - + } diff --git a/src/pages/nearle/orders/orders.js b/src/pages/nearle/orders/orders.js index ccbf3fa..8aa872b 100644 --- a/src/pages/nearle/orders/orders.js +++ b/src/pages/nearle/orders/orders.js @@ -517,9 +517,9 @@ import { {row.orderid} - {dayjs(row.orderdate).utc().format('MM/DD/YYYY')} + {dayjs(row.deliverydate).utc().format('MM/DD/YYYY hh:mm A')} - + @@ -536,7 +536,7 @@ import { {/* {row.eventname} */} - + {row.deliveryaddress.slice(0,20)} @@ -1065,6 +1065,8 @@ import { let [orderarrmodified, setArrmodified] = useState([]); let [orderarrclosed, setArrclosed] = useState([]); let [orderarrpicked, setArrpicked] = useState([]); + let [orderarrcreated, setArrcreated] = useState([]); + @@ -1108,8 +1110,9 @@ import { setTabvalue(i); if (i === 0) setTabstatus('All orders') - if (i === 1) setTabstatus('Pending') + // if (i === 1) setTabstatus('Created') // if (i === 2) setTabstatus('Modified') + if (i === 1) setTabstatus('Pending') if (i === 2) setTabstatus('Assigned') if (i === 3) setTabstatus('Picked') @@ -1147,6 +1150,7 @@ import { fetchtablecancelled(val); fetchtableassigned(val); fetchtablepicked(val); + fetchtablecreated(val); // fetchtableconfirmed(val); // fetchtablemodified(val); // fetchtableclosed(val) @@ -1175,6 +1179,7 @@ import { // fetchtablemodified(val); // fetchtableclosed(val) fetchtable(val) + fetchtablecreated(val) console.log(activeorders); } @@ -1186,7 +1191,7 @@ import { // if (tabstatus === 'All orders') setRows(orderarr) // if (tabstatus === 'Completed') setRows(orderarrcovered) // if (tabstatus === 'Active') setRows(orderarractive) - if (tabstatus === 'Pending') setRows(orderarruncovered) + // if (tabstatus === 'Pending') setRows(orderarruncovered) // if (tabstatus === 'Cancelled') setRows(orderarrcancelled) // if (tabstatus === 'Assigned') setRows(orderarrassigned) // if (tabstatus === 'Confirmed') setRows(orderarrconfirmed) @@ -1194,6 +1199,8 @@ import { if (tabstatus === 'All orders') setRows(orderarr) if (tabstatus === 'Delivered') setRows(orderarrcovered) + if (tabstatus === 'Pending') setRows(orderarrcreated) + // if (tabstatus === 'Active') setRows(orderarractive) // if (tabstatus === 'Pending') setRows(orderarruncovered) if (tabstatus === 'Cancelled') setRows(orderarrcancelled) @@ -1434,8 +1441,8 @@ import { const fetchtable = async (tid) => { try { - // await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}`) - await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}`) + // await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}`) + await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}`) .then((res) => { if (res.data.status) { let arr = [] @@ -1463,7 +1470,7 @@ import { try { // await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`) - await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=delivered`) + await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=delivered`) .then((res) => { // if (res.data.message === "Success") { let arr = [] @@ -1481,6 +1488,29 @@ import { } } + + const fetchtablecreated = async (tid) => { + + try { + // await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`) + await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=created`) + .then((res) => { + // if (res.data.message === "Success") { + let arr = [] + res.data.details.map((val, i) => { + arr = [...arr, { ...val, sno: i + 1 }]; + }) + setArrcreated(arr) + // } + }).catch((err) => { + console.log(err) + }) + + } catch (err) { + console.log(err); + } + + } const fetchtableactive = async () => { @@ -1509,7 +1539,7 @@ import { const fetchtableuncovered = async (tid) => { try { - await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=pending`) + await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=pending`) .then((res) => { if (res.data.message === "Success") { let arr = [] @@ -1532,7 +1562,7 @@ import { const fetchtablecancelled = async (tid) => { try { - await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=cancelled`) + await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=cancelled`) // await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`) .then((res) => { @@ -1558,7 +1588,7 @@ import { const fetchtableassigned = async (tid) => { try { - await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=accepted`) + await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=accepted`) .then((res) => { // if (res.data.message === "Success") { let arr = []; @@ -1582,7 +1612,7 @@ import { const fetchtablepicked = async (tid) => { try { - await axios.get(`${process.env.REACT_APP_URL}/orders/tenantorders/?tenantid=${tid}&status=picked`) + await axios.get(`${process.env.REACT_APP_URL}/orders/tenant/getorders/?tenantid=${tid}&status=picked`) .then((res) => { // if (res.data.message === "Success") { let arr = []; @@ -1909,7 +1939,10 @@ import { iconPosition="end" icon={} /> - + {/* } + iconPosition="end" + /> */} } iconPosition="end"