| | |
| | | |
| | | export const DEFAULT_PAGE_SIZE = 25; |
| | | |
| | | export const DEFAULT_START_PAGE = 1; |
| | | |
| | | export const DEFAULT_ITEM_PAGE_SIZE = 10; |
| | | |
| | | export const PAGE_DRAWER_WIDTH = 400; |
| | |
| | | Paper, |
| | | styled |
| | | } from '@mui/material'; |
| | | import { EDIT_MODE, DEFAULT_START_PAGE, DEFAULT_PAGE_SIZE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import { useTranslate, useNotify, useRefresh } from 'react-admin'; |
| | | import request from '@/utils/request'; |
| | |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | const [page, setPage] = useState({ page: DEFAULT_START_PAGE, pageSize: DEFAULT_PAGE_SIZE }); |
| | | const [rowCount, setRowCount] = useState(0); |
| | | const [isLoading, setIsLoading] = useState(false); |
| | | const [formData, setFormData] = useState({}); |
| | | const [tableData, setTableData] = useState([]); |
| | | const [dyFields, setDyFields] = useState([]); |
| | |
| | | }; |
| | | |
| | | const getData = async () => { |
| | | setIsLoading(true) |
| | | const res = await request.post(`/matnr/page`, { |
| | | ...formData, |
| | | current: 1, |
| | | pageSize: 100, |
| | | current: page?.page, |
| | | pageSize: page?.pageSize, |
| | | orderBy: "create_time desc" |
| | | }); |
| | | if (res?.data?.code === 200) { |
| | | setTableData(res.data.data.records); |
| | | console.log(res.data); |
| | | setRowCount(res.data?.data.total) |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | setIsLoading(false) |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | getData(); |
| | | }, [open]); |
| | | }, [open, page]); |
| | | |
| | | const handleSearch = () => { |
| | | getData() |
| | |
| | | <AsnWareModalTable |
| | | tableData={tableData} |
| | | setTableData={setTableData} |
| | | page={page} |
| | | rowCount={rowCount} |
| | | setPage={setPage} |
| | | isLoading={isLoading} |
| | | dyFields={dyFields} |
| | | setDyFields={setDyFields} |
| | | selectedRows={selectedRows} |
| | |
| | | }; |
| | | |
| | | export default AsnWareModal; |
| | | const AsnWareModalTable = ({ tableData, setTableData, selectedRows, setSelectedRows, dyFields, setDyFields }) => { |
| | | const AsnWareModalTable = ({ tableData, isLoading, page, setPage, rowCount, setTableData, selectedRows, setSelectedRows, dyFields, setDyFields }) => { |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [columns, setColumns] = useState([ |
| | |
| | | disableColumnMenu={true} |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | rowCount={rowCount} |
| | | paginationMode="server" |
| | | paginationModel={page} |
| | | onPaginationModelChange={setPage} |
| | | loading={isLoading} |
| | | slotProps={{ |
| | | loadingOverlay: { |
| | | variant: 'linear-progress', |
| | | noRowsVariant: 'linear-progress', |
| | | }, |
| | | }} |
| | | /> |
| | | </div> |
| | | ); |
| | |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | toolbar={false} |
| | | mode="onTouched" |
| | | sx={{ |
| | | "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": { |
| | | bgcolor: 'white', |
| | | WebkitTextFillColor: "rgba(0, 0, 0)" |
| | | }, |
| | | |
| | | "& .MuiInputBase-input.MuiFilledInput-input.Mui-disabled": { |
| | | bgcolor: 'white', |
| | | WebkitTextFillColor: "rgba(0, 0, 0)" |
| | | }, |
| | | "& .MuiFilledInput-root.MuiInputBase-sizeSmall": { |
| | | bgcolor: 'white', |
| | | } |
| | | }} |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}> |
| | |
| | | label="table.field.delivery.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | readOnly |
| | | |
| | | /> |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | |
| | | source="wkType" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.delivery.source" |
| | | source="source" |
| | | parse={v => v} |
| | | validate={required()} |
| | | readOnly |
| | | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | |
| | | label="table.field.delivery.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | readOnly |
| | | /> |
| | | <NumberInput |
| | | label="table.field.delivery.qty" |
| | | source="qty" |
| | | readOnly |
| | | /> |
| | | <NumberInput |
| | | label="table.field.delivery.workQty" |
| | | source="workQty" |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.delivery.platId" |
| | | source="platId" |
| | | parse={v => v} |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.delivery.platCode" |
| | | source="platCode" |
| | | parse={v => v} |
| | | readOnly |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.delivery.startTime" |
| | | source="startTime" |
| | | readOnly |
| | | /> |
| | | <DateInput |
| | | label="table.field.delivery.endTime" |
| | | source="endTime" |
| | | readOnly |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | {/* <Grid item xs={8} md={2}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> */} |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Stack, Grid, Box, Typography, Dialog, DialogTitle, DialogContent, TextField, Button, DialogActions } from '@mui/material'; |
| | | import { EDIT_MODE, DEFAULT_START_PAGE, DEFAULT_PAGE_SIZE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton.jsx"; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import TreeSelectInput from "@/page/components/TreeSelectInput"; |
| | |
| | | |
| | | const CreateBySelectMats = (props) => { |
| | | const { open, setOpen, data, setData } = props; |
| | | const [page, setPage] = useState(0); |
| | | const [page, setPage] = useState({ page: DEFAULT_START_PAGE, pageSize: DEFAULT_PAGE_SIZE }); |
| | | const [rowCount, setRowCount] = useState(0); |
| | | const [isLoading, setIsLoading] = useState(false); |
| | | const [formData, setFormData] = useState({}); |
| | | const [tableData, setTableData] = useState([]); |
| | | const [dyFields, setDyFields] = useState([]); |
| | |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | |
| | | const handleChange = (e) => { |
| | | const { name, value } = e.target; |
| | |
| | | } |
| | | })); |
| | | setData([...data, ...value]); |
| | | |
| | | console.log(data); |
| | | setOpen(false); |
| | | reset(); |
| | | }; |
| | | |
| | | const getData = async () => { |
| | | setIsLoading(true) |
| | | const res = await request.post(`/transfer/locs/items`, { |
| | | ...formData, |
| | | current: page, |
| | | pageSize: pageSize, |
| | | current: page?.page, |
| | | pageSize: page?.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); |
| | | } |
| | | setIsLoading(false) |
| | | }; |
| | | |
| | | useEffect(() => { |
| | |
| | | rowCount={rowCount} |
| | | pageSize={pageSize} |
| | | setPage={setPage} |
| | | isLoading={isLoading} |
| | | setPageSize={setPageSize} |
| | | dyFields={dyFields} |
| | | setDyFields={setDyFields} |
| | |
| | | export default CreateBySelectMats; |
| | | |
| | | |
| | | const SelectMatsTableView = ({ tableData, page, pageSize, setPage, setPageSize, rowCount, setTableData, selectedRows, setSelectedRows, dyFields, setDyFields }) => { |
| | | const SelectMatsTableView = ({ tableData, page, isLoading, pageSize, setPage, setPageSize, rowCount, setTableData, selectedRows, setSelectedRows, dyFields, setDyFields }) => { |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [extendColumns, setExtendColumns] = useState([]); |
| | |
| | | { 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; |
| | | console.log('====-->'); |
| | | console.log(data); |
| | | setTableData(data?.records); |
| | | setRowCount(data?.total); |
| | | |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | }; |
| | | |
| | | const handleSelectionChange = (ids) => { |
| | | setSelectedRows(ids) |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | console.log('------->'); |
| | | console.log(page); |
| | | }, [page]) |
| | | |
| | | useEffect(() => { |
| | | if (extendColumns == undefined || extendColumns.length < 1) { |
| | |
| | | |
| | | return ( |
| | | <div style={{ height: 400, width: '100%' }}> |
| | | |
| | | <DataGrid |
| | | size="small" |
| | | rows={tableData} |
| | | page={page} |
| | | pageSize={pageSize} |
| | | columns={columns} |
| | | pagination |
| | | checkboxSelection |
| | | rowCount={rowCount} |
| | | onRowSelectionModelChange={handleSelectionChange} |
| | | onPageChange={(newPage) => setPage(newPage)} |
| | | onPageSizeChange={(newPageSize) => setPageSize(newPageSize)} |
| | | selectionModel={selectedRows} |
| | | columns={columns} |
| | | paginationMode="server" |
| | | disableColumnMenu={true} |
| | | initialState={{ |
| | | pagination: { |
| | | paginationModel: { |
| | | pageSize: 25, |
| | | }, |
| | | paginationModel={page} |
| | | onPaginationModelChange={setPage} |
| | | loading={isLoading} |
| | | slotProps={{ |
| | | loadingOverlay: { |
| | | variant: 'linear-progress', |
| | | noRowsVariant: 'linear-progress', |
| | | }, |
| | | }} |
| | | pageSizeOptions={[15, 25, 50, 100]} |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | /> |
| | | </div> |
| | | ); |
| | |
| | | import ConfirmationNumberIcon from '@mui/icons-material/ConfirmationNumber'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton.jsx"; |
| | | import WarehouseSelect from "../../components/WarehouseSelect.jsx"; |
| | | import { useFormContext, useWatch } from "react-hook-form"; |
| | | import { DataGrid, useGridApiRef } from '@mui/x-data-grid'; |
| | | import ConfirmButton from "../../components/ConfirmButton"; |
| | | import CreateBySelectMats from "./CreateBySelectMats.jsx"; |
| | | import { Add, Edit, Delete } from '@mui/icons-material'; |
| | | import DictSelect from "../../components/DictSelect"; |
| | | import { useFormContext, useWatch } from "react-hook-form"; |
| | | import { minHeight, padding } from "@mui/system"; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | import request from '@/utils/request'; |
| | |
| | | |
| | | @ApiModelProperty("出站口") |
| | | @TableField(exist = false) |
| | | private String siteNo; |
| | | private String site; |
| | | |
| | | |
| | | /** |
| | |
| | | throw new CoolException("库口不为空!!"); |
| | | } |
| | | locItems.forEach(locItem -> { |
| | | locItem.setSiteNo(deviceSite.getSite()); |
| | | locItem.setSite(deviceSite.getSite()); |
| | | }); |
| | | } |
| | | return R.ok().add(locItems); |
| | |
| | | @Override |
| | | public IPage<LocItem> getLocsItems(OrgLocParams params, Long loginUserId) { |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type) |
| | | .eq(!Objects.isNull(params.getOrgAreaId()), Loc::getAreaId, params.getOrgAreaId())); |
| | | |
| | | Page<LocItem> page = new Page<>(params.getCurrent(), params.getPageSize()); |
| | |
| | | } |
| | | } |
| | | items.add(pakinItem); |
| | | |
| | | } |
| | | |
| | | Double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |