|  |  |  | 
|---|
|  |  |  | ReferenceArrayInput, | 
|---|
|  |  |  | AutocompleteInput, | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | useRedirect, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting.js'; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack, } from '@mui/material'; | 
|---|
|  |  |  | 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 ConfirmButton from '../../components/ConfirmButton'; | 
|---|
|  |  |  | import PageDrawer from "../../components/PageDrawer.jsx"; | 
|---|
|  |  |  | import EmptyData from "../../components/EmptyData.jsx"; | 
|---|
|  |  |  | import AddTaskIcon from '@mui/icons-material/AddTask'; | 
|---|
|  |  |  | import MyField from "../../components/MyField.jsx"; | 
|---|
|  |  |  | import TransferOrders from "./TransferOrders.jsx"; | 
|---|
|  |  |  | import TransferCreate from "./TransferCreate.jsx"; | 
|---|
|  |  |  | import ManualCreate from "./ManualCreate.jsx"; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import * as Common from '@/utils/common.js'; | 
|---|
|  |  |  | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='transfer' | 
|---|
|  |  |  | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
|---|
|  |  |  | bulkActionButtons={false} | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | expand={() => <TransferOrders />} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <ConfirmButton label={"toolbar.publicWorking"} startIcon={<AddTaskIcon />} onConfirm={taskEvent} size={"small"} /> | 
|---|
|  |  |  | record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.publicWorking"} startIcon={<AddTaskIcon />} onConfirm={taskEvent} size={"small"} /> : <></> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|