everything updated 23.04

main
Abdujamol 7 months ago
parent 1f82cbd187
commit 797c942269

@ -237,7 +237,7 @@ const CompanyEdit = () => {
</Col> </Col>
</Row> </Row>
<Form.Item> <Form.Item>
{role === "Owner" && ( {role !== "Checker" && (
<Button <Button
onClick={() => ClickDelete()} onClick={() => ClickDelete()}
type="primary" type="primary"
@ -247,7 +247,7 @@ const CompanyEdit = () => {
Delete Delete
</Button> </Button>
)} )}
{role === "Owner" && ( {role !== "Checker" && (
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
Submit Submit
</Button> </Button>

@ -146,13 +146,13 @@ function CompanyTable({
return ( return (
<Space> <Space>
<Link to={`${id}`}> <Link to={`${id}`}>
{role === "Owner" && <Button type="primary">Edit</Button>} {role !== "Checker" && <Button type="primary">Edit</Button>}
{role !== "Owner" && ( {role === "Checker" && (
<Button type="primary" icon={<EyeOutlined />}></Button> <Button type="primary" icon={<EyeOutlined />}></Button>
)} )}
</Link> </Link>
{role === "Owner" && ( {role !== "Checker" && (
<Button <Button
type="primary" type="primary"
icon={<SyncOutlined />} icon={<SyncOutlined />}

@ -35,6 +35,7 @@ const Requests = () => {
<div> <div>
{modalOpen && ( {modalOpen && (
<RequestsEdit <RequestsEdit
refetch={refetch}
modalOpen={modalOpen} modalOpen={modalOpen}
setModalOpen={setModalOpen} setModalOpen={setModalOpen}
requestData={requestData} requestData={requestData}

@ -5,11 +5,20 @@ import { useCustomerData } from "../../Hooks/Customers";
import { requestsController } from "../../API/LayoutApi/requests"; import { requestsController } from "../../API/LayoutApi/requests";
// @ts-ignore // @ts-ignore
import plus from "../../assets/add-icon.png"; import plus from "../../assets/add-icon.png";
import {
QueryObserverResult,
RefetchOptions,
RefetchQueryFilters,
} from "react-query";
const RequestsEdit = ({ const RequestsEdit = ({
modalOpen, modalOpen,
setModalOpen, setModalOpen,
requestData, requestData,
refetch,
}: { }: {
refetch: <TPageData>(
options?: (RefetchOptions & RefetchQueryFilters<TPageData>) | undefined
) => Promise<QueryObserverResult<TRequests[], unknown>>;
modalOpen: any; modalOpen: any;
setModalOpen: any; setModalOpen: any;
requestData: TRequests | undefined; requestData: TRequests | undefined;
@ -25,13 +34,21 @@ const RequestsEdit = ({
name: customerName, name: customerName,
}); });
const optionClick = (value: number) => {
setDriverId(value);
};
const assignClick = () => { const assignClick = () => {
const value = { const value = {
...requestData, ...requestData,
status: "Assigned", status: "Assigned",
customer_id: driverId, customer_id: driverId,
}; };
requestsController.requestPatch(value, requestData?.id); requestsController.requestPatch(value, requestData?.id).then(() => {
refetch();
setModalOpen(false);
});
// console.log(value);
}; };
return ( return (
<div> <div>
@ -127,13 +144,12 @@ const RequestsEdit = ({
showSearch showSearch
style={{ width: 325 }} style={{ width: 325 }}
placeholder="Search Driver" placeholder="Search Driver"
onSearch={(value: any) => setCustomerName(value)} onSearch={(value) => setCustomerName(value)}
onChange={(e: any) => setDriverId(e)} onChange={(value: number) => optionClick(value)}
options={customerData?.data?.map((item) => ({ options={customerData?.data?.map((item) => ({
label: item?.name, label: item?.name,
value: item?.id, value: item?.id,
}))} }))}
value={customerName}
filterOption={false} filterOption={false}
autoClearSearchValue={false} autoClearSearchValue={false}
allowClear allowClear

@ -26,7 +26,10 @@ import ontime from "../../assets/ontimeicon.svg";
import tt from "../../assets/tticon.svg"; import tt from "../../assets/tticon.svg";
// @ts-ignore // @ts-ignore
import tagIcon from "../../assets/tagIcon.png"; import tagIcon from "../../assets/tagIcon.png";
// @ts-ignore
import tgIcon from "../../assets/telegram.png";
import { role } from "../../App"; import { role } from "../../App";
import { render } from "@testing-library/react";
const admin_id = localStorage.getItem("admin_id"); const admin_id = localStorage.getItem("admin_id");
const TaskTable = ({ const TaskTable = ({
@ -132,9 +135,50 @@ const TaskTable = ({
const columns = useMemo(() => { const columns = useMemo(() => {
const columns = [ const columns = [
{ {
title: <img src={tagIcon} alt="" />, title: "",
dataIndex: "no",
width: "4%",
render: (text: any, record: TTask) => (
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "space-around",
}}
>
{record.via_telegram && (
<Tooltip placement="topLeft" title={"Created via Telegram"}>
<img src={tgIcon} alt="" style={{ width: 20, height: 20 }} />
</Tooltip>
)}
</div>
),
},
{
title: (
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "space-around",
}}
>
<img src={tagIcon} alt="" />
</div>
),
dataIndex: "no", dataIndex: "no",
width: "5%", width: "5%",
render: (text: any, record: TTask) => (
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "space-around",
}}
>
{text}
</div>
),
}, },
{ {
title: "Company", title: "Company",
@ -179,7 +223,7 @@ const TaskTable = ({
ellipsis: { ellipsis: {
showTitle: false, showTitle: false,
}, },
render: (item: { title: string; id: number }) => ( render: (item: { title: string; id: number }, record: TTask) => (
<Tooltip placement="topLeft" title={item?.title}> <Tooltip placement="topLeft" title={item?.title}>
{item.title} {item.title}
</Tooltip> </Tooltip>

@ -112,7 +112,7 @@ const UpdateTable = ({
{ {
title: <img src={tagIcon} alt="" />, title: <img src={tagIcon} alt="" />,
dataIndex: "no", dataIndex: "no",
width: "5%", width: "4%",
}, },
{ {
title: "Company", title: "Company",
@ -164,7 +164,7 @@ const UpdateTable = ({
), ),
}, },
{ {
title: "Complited by", title: "Completed by",
dataIndex: "executor", dataIndex: "executor",
ellipsis: { ellipsis: {
showTitle: false, showTitle: false,

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

@ -12,6 +12,7 @@ export type TTask = {
is_active: boolean; is_active: boolean;
pti: boolean; pti: boolean;
created_at: string; created_at: string;
via_telegram: boolean;
updated_at: string; updated_at: string;
business: AssignedTo; business: AssignedTo;
company: Company; company: Company;

Loading…
Cancel
Save