|  |  |  | 
|---|
|  |  |  | TextField, | 
|---|
|  |  |  | NumberField, | 
|---|
|  |  |  | DateField, | 
|---|
|  |  |  | useRefresh, | 
|---|
|  |  |  | BooleanField, | 
|---|
|  |  |  | ReferenceField, | 
|---|
|  |  |  | TextInput, | 
|---|
|  |  |  | Button, | 
|---|
|  |  |  | DateTimeInput, | 
|---|
|  |  |  | DateInput, | 
|---|
|  |  |  | SelectInput, | 
|---|
|  |  |  | 
|---|
|  |  |  | ReferenceArrayInput, | 
|---|
|  |  |  | AutocompleteInput, | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | useRedirect, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting.js'; | 
|---|
|  |  |  | import MyCreateButton from "../../components/MyCreateButton.jsx"; | 
|---|
|  |  |  | import MyExportButton from '../../components/MyExportButton.jsx'; | 
|---|
|  |  |  | import BillStatusField from '../../components/BillStatusField'; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack, } from '@mui/material'; | 
|---|
|  |  |  | import PageEditDrawer from "../../components/PageEditDrawer"; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
|---|
|  |  |  | import PageDrawer from "../../components/PageDrawer.jsx"; | 
|---|
|  |  |  | import EmptyData from "../../components/EmptyData.jsx"; | 
|---|
|  |  |  | import MyField from "../../components/MyField.jsx"; | 
|---|
|  |  |  | import TransferCreate from "./TransferCreate.jsx"; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import TransferPanel from "./TransferPanel.jsx"; | 
|---|
|  |  |  | import * as Common from '@/utils/common.js'; | 
|---|
|  |  |  | import ConfirmButton from '../../components/ConfirmButton'; | 
|---|
|  |  |  | import AddTaskIcon from '@mui/icons-material/AddTask'; | 
|---|
|  |  |  | import TransferOrders from "./TransferOrders.jsx"; | 
|---|
|  |  |  | import ManualCreate from "./ManualCreate.jsx"; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import * as Common from '@/utils/common.js'; | 
|---|
|  |  |  | import request from '@/utils/request'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
|---|
|  |  |  | '& .css-1vooibu-MuiSvgIcon-root': { | 
|---|
|  |  |  | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  | const [drawerVal, setDrawerVal] = useState(false); | 
|---|
|  |  |  | const [select, setSelect] = useState({}); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Box display="flex"> | 
|---|
|  |  |  | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='transfer' | 
|---|
|  |  |  | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
|---|
|  |  |  | bulkActionButtons={false} | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | expand={() => <TransferPanel />} | 
|---|
|  |  |  | expand={() => <TransferOrders />} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy$', 'memo', 'orgWareId', 'tarWareId', 'orgAreaId', 'tarAreaId']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextField source="orgAreaName" label="table.field.transfer.orgAreaName" /> | 
|---|
|  |  |  | <NumberField source="tarAreaId" label="table.field.transfer.tarAreaId" /> | 
|---|
|  |  |  | <TextField source="tarAreaName" label="table.field.transfer.tarAreaName" /> | 
|---|
|  |  |  | <TextField source="exceStatus$" label="table.field.transfer.exceStatus" sortable={false} /> | 
|---|
|  |  |  | <BillStatusField source="exceStatus$" cellClassName="status" label="table.field.transfer.exceStatus" sortable={false} /> | 
|---|
|  |  |  | <TextField source="updateBy$" label="common.field.updateBy" /> | 
|---|
|  |  |  | <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|---|
|  |  |  | <TextField source="createBy$" label="common.field.createBy" /> | 
|---|
|  |  |  | <DateField source="createTime" label="common.field.createTime" showTime /> | 
|---|
|  |  |  | <TextField source="memo" label="common.field.memo" sortable={false} /> | 
|---|
|  |  |  | <WrapperField cellClassName="opt" label="common.field.opt"> | 
|---|
|  |  |  | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> | 
|---|
|  |  |  | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} label="toolbar.detail"/> | 
|---|
|  |  |  | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> | 
|---|
|  |  |  | <PublicButton setDrawerVal={setDrawerVal} drawerVal={drawerVal} setSelect={setSelect} /> | 
|---|
|  |  |  | </WrapperField> | 
|---|
|  |  |  | </StyledDatagrid> | 
|---|
|  |  |  | </List> | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default TransferList; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //下发执行 | 
|---|
|  |  |  | const PublicButton = ({ setDrawerVal, setSelect }) => { | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  | const refresh = useRefresh(); | 
|---|
|  |  |  | const redirct = useRedirect(); | 
|---|
|  |  |  | const taskEvent = async () => { | 
|---|
|  |  |  | const { data: { code, data, msg } } = await request.post(`/transfer/pub/outStock`, record); | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | notify(msg); | 
|---|
|  |  |  | redirct("/outStock"); | 
|---|
|  |  |  | refresh() | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | notify(msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | refresh(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.publicWorking"} startIcon={<AddTaskIcon />} onConfirm={taskEvent} size={"small"} /> : <></> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|