everything updated 23.04

main
Abdujamol 7 months ago
parent 1f82cbd187
commit 797c942269

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

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

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

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

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

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

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

Loading…
Cancel
Save