From c414ff69c66e9b82871f6fbd9bbc7bf49431731f Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 19 五月 2025 20:16:46 +0800
Subject: [PATCH] 新增客户单号, 工单号,项目号 工作档新增仓库类型,添加仓库类型搜索

---
 rsf-admin/src/page/task/TaskPanel.jsx |   94 +++++++++++------------------------------------
 1 files changed, 22 insertions(+), 72 deletions(-)

diff --git a/rsf-admin/src/page/task/TaskPanel.jsx b/rsf-admin/src/page/task/TaskPanel.jsx
index bac8c60..6207229 100644
--- a/rsf-admin/src/page/task/TaskPanel.jsx
+++ b/rsf-admin/src/page/task/TaskPanel.jsx
@@ -1,40 +1,15 @@
 import React, { useState, useRef, useEffect, useMemo } from "react";
-import { Box, Card, CardContent, Grid, Typography, Tooltip, Pagination } from '@mui/material';
+import { Box } from '@mui/material';
 import {
     List,
     DatagridConfigurable,
-    SearchInput,
-    TopToolbar,
-    SelectColumnsButton,
-    EditButton,
-    FilterButton,
-    CreateButton,
-    ExportButton,
-    BulkDeleteButton,
-    useDataProvider,
-    WrapperField,
-    useGetList,
     useRecordContext,
     useTranslate,
-    useNotify,
-    useListContext,
-    FunctionField,
     TextField,
     NumberField,
     DateField,
     BooleanField,
     ReferenceField,
-    TextInput,
-    DateTimeInput,
-    DateInput,
-    SelectInput,
-    NumberInput,
-    ReferenceInput,
-    ReferenceArrayInput,
-    AutocompleteInput,
-    DeleteButton,
-    useList,
-    ReferenceManyField,
 } from 'react-admin';
 import { styled } from '@mui/material/styles';
 import PageDrawer from "../components/PageDrawer";
@@ -55,54 +30,34 @@
     },
 }));
 
-const filters = [
-    <SearchInput source="condition" alwaysOn />,
-    <DateInput label='common.time.after' source="timeStart"  />,
-    <DateInput label='common.time.before' source="timeEnd" />,
-    <NumberInput source="taskId" label="table.field.taskItem.taskId" />,
-    <NumberInput source="orderId" label="table.field.taskItem.orderId" />,
-    <NumberInput source="orderType" label="table.field.taskItem.orderType" />,
-    <NumberInput source="orderItemId" label="table.field.taskItem.orderItemId" />,
-    <NumberInput source="matnrId" label="table.field.taskItem.matnrId" />,
-    <TextInput source="maktx" label="table.field.taskItem.maktx" />,
-    <TextInput source="matnrCode" label="table.field.taskItem.matnrCode" />,
-    <TextInput source="unit" label="table.field.taskItem.unit" />,
-    <NumberInput source="anfme" label="table.field.taskItem.anfme" />,
-    <TextInput source="batch" label="table.field.taskItem.batch" />,
-    <TextInput source="spec" label="table.field.taskItem.spec" />,
-    <TextInput source="model" label="table.field.taskItem.model" />,
-    <TextInput label="common.field.memo" source="memo" />,
-    <SelectInput
-        label="common.field.status"
-        source="status"
-        choices={[
-            { id: '1', name: 'common.enums.statusTrue' },
-            { id: '0', name: 'common.enums.statusFalse' },
-        ]}
-        resettable
-    />,
-]
-
 const TaskPanel = () => {
+    const record = useRecordContext();
     const translate = useTranslate();
     const [createDialog, setCreateDialog] = useState(false);
     const [drawerVal, setDrawerVal] = useState(false);
-    // const { data, isPending, error } = useGetList('taskItem', { pagination: { page: 1, perPage: 10 } });
-    // const listContext = useList({
-    //     data, 
-    //     isPending,
-    //     perPage: 10,
-    //     sort: {field: 'create_time', order: 'DESC'}
-    // })
     return (
         <>
             <Box display="flex">
-                <ReferenceManyField pagination={<Pagination />} reference="taskItem" target="task_id">
+                <List resource="taskItem"
+                    sx={{
+                        flexGrow: 1,
+                        transition: (theme) =>
+                            theme.transitions.create(['all'], {
+                                duration: theme.transitions.duration.enteringScreen,
+                            }),
+                        marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
+                    }}
+                    filter={{ taskId: record.id }}
+                    // title={"menu.taskItem"}
+                    pagination={false}
+                    empty={false}
+                    actions={false}
+                >
                     <StyledDatagrid
                         preferenceKey='taskItem'
                         bulkActionButtons={false}
-                        rowClick={(id, resource, record) => false}
-                        expandSingle={true}
+                        rowClick={false}
+                        expandSingle
                         omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']}
                     >
                         <NumberField source="id" />
@@ -118,18 +73,13 @@
                         <TextField source="batch" label="table.field.taskItem.batch" />
                         <TextField source="spec" label="table.field.taskItem.spec" />
                         <TextField source="model" label="table.field.taskItem.model" />
-                        <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}>
-                            <TextField source="nickname" />
-                        </ReferenceField>
+                        <TextField source="updateBy$" label="common.field.updateBy"/>
+                        <TextField source="createBy$" label="common.field.createBy"/>
                         <DateField source="updateTime" label="common.field.updateTime" showTime />
-                        <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}>
-                            <TextField source="nickname" />
-                        </ReferenceField>
                         <DateField source="createTime" label="common.field.createTime" showTime />
-                        <BooleanField source="statusBool" label="common.field.status" sortable={false} />
                         <TextField source="memo" label="common.field.memo" sortable={false} />
                     </StyledDatagrid>
-                </ReferenceManyField>
+                </List>
             </Box>
         </>
     );

--
Gitblit v1.9.1