|  |  | 
 |  |  |     DeleteButton, | 
 |  |  |     useNotify, | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { useWatch, useFormContext } from "react-hook-form"; | 
 |  |  | import { Stack, Grid, Box, Typography } from '@mui/material'; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; | 
 |  |  | import EditBaseAside from "../components/EditBaseAside"; | 
 |  |  | import CustomerTopToolBar from "../components/EditTopToolBar"; | 
 |  |  | import MemoInput from "../components/MemoInput"; | 
 |  |  | import StatusSelectInput from "../components/StatusSelectInput"; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  | import DictionarySelect from "../components/DictionarySelect"; | 
 |  |  | import CustomerTopToolBar from "../components/EditTopToolBar"; | 
 |  |  | import { Stack, Grid, Box, Typography } from '@mui/material'; | 
 |  |  | import { useWatch, useFormContext } from "react-hook-form"; | 
 |  |  | import EditBaseAside from "../components/EditBaseAside"; | 
 |  |  | import MemoInput from "../components/MemoInput"; | 
 |  |  | import LocQueryList from "./LocQueryList"; | 
 |  |  | import * as Common from '@/utils/common'; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  |  | 
 |  |  | const FormToolbar = () => { | 
 |  |  |     const { getValues } = useFormContext(); | 
 |  |  | 
 |  |  |         <> | 
 |  |  |             <Edit | 
 |  |  |                 redirect="list" | 
 |  |  |                 resource="locItem" | 
 |  |  |                 mutationMode={EDIT_MODE} | 
 |  |  |                 actions={<CustomerTopToolBar />} | 
 |  |  |                 aside={<EditBaseAside />} | 
 |  |  | 
 |  |  |                                 </Grid> | 
 |  |  |                             </Grid> | 
 |  |  |                         </Grid> | 
 |  |  |                         {/* <Grid item xs={12} md={2}> | 
 |  |  |                             <Typography variant="h6" gutterBottom> | 
 |  |  |                                 {translate('common.edit.title.common')} | 
 |  |  |                             </Typography> | 
 |  |  |                             <StatusSelectInput readOnly /> | 
 |  |  |                             <Box mt="2em" /> | 
 |  |  |                             <MemoInput /> | 
 |  |  |                         </Grid> */} | 
 |  |  |                     </Grid> | 
 |  |  |                 </SimpleForm> | 
 |  |  |             </Edit > | 
 
 |  |  | 
 |  |  |     Button, | 
 |  |  |     useList, | 
 |  |  | } from 'react-admin'; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | import MyCreateButton from "../components/MyCreateButton"; | 
 |  |  | import MyExportButton from '../components/MyExportButton'; | 
 |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
 |  |  | import { styled } from '@mui/material/styles'; | 
 |  |  | import LocListAside from "./LocListAside"; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  | 
 |  |  |   } | 
 |  |  | })); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | const LocItemList = () => { | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_use_stas')) || []; | 
 |  |  |     const locType = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || []; | 
 |  |  |     const [createDialog, setCreateDialog] = useState(false); | 
 |  |  |     const [drawerVal, setDrawerVal] = useState(false); | 
 |  |  |     const [initDialog, setInitDialog] = useState(false); | 
 |  |  |     const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_use_stas')) || []; | 
 |  |  |     const locType = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_loc_type')) || []; | 
 |  |  |  | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |  | 
 |  |  |     const filters = [ | 
 |  |  |         <SearchInput source="condition" alwaysOn />, | 
 |  |  | 
 |  |  |             source="type" | 
 |  |  |             optionValue="value" | 
 |  |  |             parse={v => v} | 
 |  |  |         />, <TextInput source="name" label="table.field.loc.name" />, | 
 |  |  |         />, | 
 |  |  |         <TextInput source="name" label="table.field.loc.name" />, | 
 |  |  |         <NumberInput source="flagLogic" label="table.field.loc.flagLogic" />, | 
 |  |  |         <TextInput source="fucAtrrs" label="table.field.loc.fucAtrrs" />, | 
 |  |  |         <TextInput source="barcode" label="table.field.loc.barcode" />, | 
 |  |  | 
 |  |  |         />, | 
 |  |  |     ] | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <Box display="flex"> | 
 |  |  |             <List | 
 |  |  | 
 |  |  |                     marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, | 
 |  |  |                 }} | 
 |  |  |                 storeKey="locItem" | 
 |  |  |                 resource="loc" | 
 |  |  |                 resource="loc/items" | 
 |  |  |                 title={"menu.locItem"} | 
 |  |  |                 empty={false} | 
 |  |  |                 filters={filters} | 
 |  |  |                 filter={{ useStatus: 'F' }}                 | 
 |  |  |                 sort={{ field: "create_time", order: "desc" }} | 
 |  |  |                 actions={( | 
 |  |  |                     <TopToolbar> | 
 
 |  |  | 
 |  |  |                 batch: el.batch, | 
 |  |  |                 spec: el.spec, | 
 |  |  |                 model: el.model, | 
 |  |  |                 fieldsIndex: el.fieldsIndex, | 
 |  |  |                 stockUnit: el.unit || '', | 
 |  |  |                 ...dynamicFields | 
 |  |  |             } | 
 |  |  | 
 |  |  |             const { data } = res.data; | 
 |  |  |             setTableData(data?.records); | 
 |  |  |             setRowCount(data?.total); | 
 |  |  |  | 
 |  |  |         } else { | 
 |  |  |             notify(res.data.msg); | 
 |  |  |         } | 
 |  |  | 
 |  |  |     const [columns, setColumns] = useState([ | 
 |  |  |         { field: 'maktx', headerName: translate('table.field.matnr.name'), width: 300 }, | 
 |  |  |         { field: 'matnrCode', headerName: translate('table.field.matnr.code'), width: 200 }, | 
 |  |  |         // { field: 'groupId$', headerName: translate('table.field.matnr.groupId'), width: 100 }, | 
 |  |  |         { field: 'locCode', headerName: translate('table.field.locItem.locCode'), width: 100 }, | 
 |  |  |         { field: 'spec', headerName: translate('table.field.matnr.spec'), width: 100 }, | 
 |  |  |         { field: 'batch', headerName: translate('table.field.locItem.batch'), width: 100 }, | 
 |  |  |         { field: 'model', headerName: translate('table.field.matnr.model'), width: 100 }, | 
 |  |  | 
 |  |  |         { field: 'unit', headerName: translate('table.field.matnr.unit'), width: 100 }, | 
 |  |  |         { field: 'wareArea', headerName: translate('table.field.locItem.wareArea'), width: 100, sortable: false }, | 
 |  |  |     ]) | 
 |  |  |  | 
 |  |  |     const getData = async () => { | 
 |  |  |         const res = await request.post(`/matnr/page`, { | 
 |  |  |             // const res = await request.post(`/transfer/locs/items`, { | 
 |  |  |             ...formData, | 
 |  |  |             current: page, | 
 |  |  |             pageSize: pageSize, | 
 |  |  |             orderBy: "create_time desc" | 
 |  |  |         }); | 
 |  |  |         if (res?.data?.code === 200) { | 
 |  |  |             const { data } = res.data; | 
 |  |  |             setTableData(data?.records); | 
 |  |  |             setRowCount(data?.total); | 
 |  |  |  | 
 |  |  |         } else { | 
 |  |  |             notify(res.data.msg); | 
 |  |  |         } | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     const handleSelectionChange = (ids) => { | 
 |  |  |         setSelectedRows(ids) | 
 
 |  |  | 
 |  |  |                 WkOrderItem orderItem = outStockItemService.getOne(new LambdaQueryWrapper<WkOrderItem>() | 
 |  |  |                         .eq(WkOrderItem::getOrderId, outId) | 
 |  |  |                         .eq(StringUtils.isNotBlank(locItem.getBatch()), WkOrderItem::getSplrBatch, locItem.getBatch()) | 
 |  |  | //                        .eq(StringUtils.isNotBlank(locItem.getFieldsIndex()), WkOrderItem::getFieldsIndex, locItem.getFieldsIndex()) | 
 |  |  |                         .eq(StringUtils.isNotBlank(locItem.getFieldsIndex()), WkOrderItem::getFieldsIndex, locItem.getFieldsIndex()) | 
 |  |  |                         .eq(WkOrderItem::getMatnrId, locItem.getMatnrId())); | 
 |  |  |  | 
 |  |  |                 if (Objects.isNull(orderItem)) { | 
 
 |  |  | 
 |  |  |         if (!locs.isEmpty()) { | 
 |  |  |             Page<LocItem> page = new Page<>(params.getCurrent(), params.getPageSize()); | 
 |  |  |             QueryWrapper<LocItem> wrapper = new QueryWrapper<>(); | 
 |  |  |             wrapper.select("id, matnr_id, maktx, matnr_code, SUM(anfme) anfme, SUM(work_qty) work_qty, SUM(qty) qty, batch, unit, fields_index, model, spec, loc_id ") | 
 |  |  |             wrapper.select("id, matnr_id, maktx, matnr_code, SUM(anfme) anfme, SUM(work_qty) work_qty, SUM(qty) qty, batch, unit, fields_index, model, spec, loc_id, loc_code ") | 
 |  |  |                     .lambda() | 
 |  |  |                     .eq(StringUtils.isNotBlank(params.getMatnrCode()), LocItem::getMatnrCode, params.getMatnrCode()) | 
 |  |  |                     .like(StringUtils.isNotBlank(params.getMaktx()), LocItem::getMaktx, params.getMaktx()); |