| | |
| | | result: 'Contacts import complete. Imported %{success} success, with %{error} errors', |
| | | }, |
| | | loadMore: 'Load More Data', |
| | | updateSucc: 'Update Success', |
| | | updateFaild: 'Update Failed', |
| | | complete: 'Complete', |
| | | deprecate: 'Deprecate', |
| | | stockError: 'Empty', |
| | |
| | | result: '导入完成。已导入 %{success} 成功, 和 %{error} 失败', |
| | | }, |
| | | loadMore: '加载更多', |
| | | updateSucc: '更新成功', |
| | | updateFaild: '更新失败', |
| | | complete: '完成', |
| | | deprecate: '废弃', |
| | | stockError: '没有库存', |
| | |
| | | Button, |
| | | useRedirect, |
| | | useUnselectAll, |
| | | useRecordSelection, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | import AddTaskIcon from '@mui/icons-material/AddTask'; |
| | | import PageEditDrawer from "../../components/PageEditDrawer"; |
| | | import OutStockPublic from "./OutStockPublic"; |
| | | import OutOrderPreview from "./OutOrderPreview"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [manualDialog, setManualDialog] = useState(false); |
| | | const [preview, setPreview] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const [select, setSelect] = useState(0); |
| | |
| | | <OutOrderModal |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | preview={preview} |
| | | setPreview={setPreview} |
| | | /> |
| | | <OutOrderPreview open={preview} setOpen={setPreview} /> |
| | | <PageEditDrawer |
| | | title={"toolbar.publicWorking"} |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | <OutStockPublic record={select} open={drawerVal} setOpen={setDrawerVal}/> |
| | | <OutStockPublic record={select} open={drawerVal} setOpen={setDrawerVal} /> |
| | | </PageEditDrawer> |
| | | </Box > |
| | | ) |
| | |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const createByOrder = async (event) => { |
| | | event.stopPropagation(); |
| | | setCreateDialog(true); |
| | |
| | | import request from '@/utils/request'; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | import CheckCircleIcon from '@mui/icons-material/CheckCircle'; |
| | | import EditableTextField from "../../components/EditableTextField"; |
| | | import OutOrderPreview from "./OutOrderPreview"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | ] |
| | | |
| | | const OutOrderModal = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const { open, setOpen, preview, setPreview, record } = props; |
| | | const translate = useTranslate(); |
| | | const [params, setParams] = useState({}); |
| | | const [select, setSelect] = useState([]); |
| | | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const refresh = useRefresh(); |
| | | |
| | |
| | | /> |
| | | <StyledDatagrid |
| | | preferenceKey='deliveryItem' |
| | | bulkActionButtons={<AddOutStockButton setOpen={setOpen} />} |
| | | bulkActionButtons={<AddOutStockButton setOpen={setOpen} setPreview={setPreview} setSelect={setSelect}/>} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={false} |
| | | expandSingle={true} |
| | |
| | | </Grid> |
| | | </DialogContent> |
| | | </Grid> |
| | | <Grid> |
| | | <OutOrderPreview open={preview} setOpen={setPreview} selectedIds={select} /> |
| | | </Grid> |
| | | </Dialog > |
| | | ) |
| | | } |
| | |
| | | export default OutOrderModal; |
| | | |
| | | const AddOutStockButton = (props) => { |
| | | const { setOpen } = props; |
| | | const { setOpen, setPreview, setSelect } = props; |
| | | const { selectedIds, onUnselectItems } = useListContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | refresh(); |
| | | setPreview(true) |
| | | setSelect(selectedIds); |
| | | onUnselectItems(); |
| | | setOpen(false); |
| | | // refresh(); |
| | | } |
| | | |
| | | return ( |
| | |
| | | const notify = useNotify(); |
| | | const gridRef = useGridApiRef(); |
| | | const [rows, setRows] = useState([]); |
| | | const [fetchRows, setFetchRows] = useState([]); |
| | | const translate = useTranslate(); |
| | | const [rowSelectedIds, setRowSelectedIds] = useState([]); |
| | | const [selectedMatnr, setSelectedMatnr] = useState([]); |
| | | const [selectedIds, setSelectedIds] = useState([]); |
| | | const [formData, setFormData] = useState({ |
| | | orderId: record?.id, |
| | | waveId: DEFAULT_TYPE |
| | | }); |
| | | const [formData, setFormData] = useState({ orderId: record?.id, waveId: DEFAULT_TYPE }); |
| | | const [dialog, setDialog] = useState(false); |
| | | const [selectedValue, setSelectedValue] = useState({}); |
| | | |
| | | useEffect(() => { |
| | | if (selectedMatnr.length < 1) { |
| | | setRows(fetchRows) |
| | | } else { |
| | | const mas = fetchRows.filter(item => selectedMatnr.includes(item.matnrCode)); |
| | | setRows(mas) |
| | | } |
| | | }, [selectedMatnr]) |
| | | |
| | | |
| | | const handleRowClick = (id, resource, record) => { |
| | | setRowSelectedIds(prev => |
| | | prev.includes(id) |
| | | ? prev.filter(item => item !== id) // 取消选择 |
| | | : [...prev, id] // 添加选择 |
| | | ); |
| | | |
| | | //设置库位信息筛选条件 |
| | | setSelectedMatnr(prev => |
| | | prev.includes(record?.matnrCode) |
| | | ? prev.filter(item => item !== record?.matnrCode) // 取消选择 |
| | | : [...prev, record?.matnrCode] // 添加选择 |
| | | ); |
| | | }; |
| | | |
| | | const handleClickOpen = () => { |
| | | setDialog(true); |
| | |
| | | const handleClose = (value) => { |
| | | setDialog(false); |
| | | setSelectedValue(value); |
| | | const newRows = rows.map(item => { |
| | | return selectedIds.includes(item?.id) ? { |
| | | ...item, |
| | | siteNo: value?.site |
| | | } : item |
| | | }) |
| | | setRows(newRows); |
| | | if (selectedIds.length == 0) { |
| | | const newRows = rows.map(item => { |
| | | return { |
| | | ...item, |
| | | siteNo: value?.site |
| | | } |
| | | }) |
| | | setRows(newRows); |
| | | } else { |
| | | const newRows = rows.map(item => { |
| | | return selectedIds.includes(item?.id) ? { |
| | | ...item, |
| | | siteNo: value?.site |
| | | } : item |
| | | }) |
| | | setRows(newRows); |
| | | } |
| | | }; |
| | | |
| | | useEffect(() => { |
| | |
| | | const { data: { code, data, msg } } = await request.post('/outStock/order/getOutTaskItems', { ...formData }); |
| | | if (code === 200) { |
| | | setRows(data) |
| | | setFetchRows(data) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | sx={{ height: "2px", position: 'absolute', top: 0, left: 0, right: 0, }} |
| | | /> |
| | | <StyledDatagrid |
| | | storeKey={"outStockPublic"} |
| | | preferenceKey='outStockItem' |
| | | bulkActionButtons={<></>} |
| | | rowClick={false} |
| | | rowClick={handleRowClick} |
| | | selectedIds={rowSelectedIds} |
| | | omit={['id', 'splrName', 'qty', 'poCode', 'workQty']} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | </Card> |
| | | </Grid> |
| | | <Grid item xl={6.3} gap={2}> |
| | | <Card> |
| | | <Box sx={{ height: 500, width: '100%' }}> |
| | | <Card sx={{ minHeight: 1050, height: 'calc(100% - 10px)', width: '100%' }}> |
| | | <Box> |
| | | <PreviewTable |
| | | rows={rows} |
| | | gridRef={gridRef} |
| | |
| | | } |
| | | }, [selectedIds]) |
| | | |
| | | |
| | | const baseColumns = [ |
| | | // { field: 'id', headerName: 'ID', width: 40 }, |
| | | { field: 'locCode', headerName: '库位', width: 110 }, |
| | |
| | | { field: 'batch', headerName: '批次', width: 90 }, |
| | | { field: 'unit', headerName: '单位', width: 60 }, |
| | | { field: 'outQty', headerName: '出库数量', width: 110, }, |
| | | { |
| | | field: 'anfme', headerName: '库存数量', width: 110, |
| | | { field: 'anfme', headerName: '库存数量', width: 110, |
| | | renderCell: (params) => ( |
| | | <OutStockAnfme value={params.value} /> |
| | | ) |
| | |
| | | |
| | | return ( |
| | | <DataGrid |
| | | storeKey={"locItemPreview"} |
| | | rows={rows} |
| | | columns={columns} |
| | | slots={{ toolbar: CustomToolBar }} |
| | |
| | | /> |
| | | ) |
| | | } |
| | | |
| | | |
| | | |
| | | //提交按钮 |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:list')") |
| | | @PostMapping("/outStock/dialog/page") |
| | | public R dialogPage(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<AsnOrder, BaseParam> pageParam = new PageParam<>(baseParam, AsnOrder.class); |
| | | QueryWrapper<AsnOrder> queryWrapper = pageParam.buildWrapper(true); |
| | | List<String> list = Arrays.asList(OrderType.ORDER_OUT.type); |
| | | queryWrapper.in("type", list); |
| | | return R.ok().add(outStockService.page(pageParam, queryWrapper)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStock:list')") |
| | | @PostMapping("/outStock/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(outStockService.list(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getType, OrderType.ORDER_OUT.type))); |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<AsnOrderItem, BaseParam> pageParam = new PageParam<>(baseParam, AsnOrderItem.class); |
| | | return R.ok().add(outStockItemService.listByAsnId(pageParam, pageParam.buildWrapper(true))); |
| | | QueryWrapper<AsnOrderItem> queryWrapper = pageParam.buildWrapper(true); |
| | | if (!Objects.isNull(map.get("poDetlId"))) { |
| | | queryWrapper.in("po_detl_id", JSONArray.parseArray(JSONArray.toJSONString(map.get("poDetlId")), Long.class)); |
| | | } |
| | | return R.ok().add(outStockItemService.listByAsnId(pageParam, queryWrapper)); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStockItem:list')") |
| | | @ApiOperation("分页获取列表") |
| | | @PostMapping("/outStockItem/edit/page") |
| | | public R byPoIdspage(@RequestBody Map<String, Object> map) { |
| | | List<Long> poDetlIds = new ArrayList<>(); |
| | | if (!Objects.isNull(map.get("poDetlId"))) { |
| | | poDetlIds = JSONArray.parseArray(JSONArray.toJSONString(map.get("poDetlId")), Long.class); |
| | | map.remove("poDetlId"); |
| | | } |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<AsnOrderItem, BaseParam> pageParam = new PageParam<>(baseParam, AsnOrderItem.class); |
| | | QueryWrapper<AsnOrderItem> queryWrapper = pageParam.buildWrapper(true); |
| | | if (!poDetlIds.isEmpty()) { |
| | | queryWrapper.in("po_detl_id", poDetlIds); |
| | | } else { |
| | | return R.ok(); |
| | | } |
| | | return R.ok().add(outStockItemService.listByAsnId(pageParam, queryWrapper)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStockItem:list')") |
| | |
| | | return R.ok("Update Success").add(asnOrderItem); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:outStockItem:remove')") |
| | | @OperationLog("Delete 出库单明细") |
| | | @PostMapping("/outStockItem/remove/{ids}") |
| | |
| | | } |
| | | |
| | | Double orgQty = locItems.stream().mapToDouble(LocItem::getAnfme).sum(); |
| | | Double workQty = locItems.stream().mapToDouble(LocItem::getWorkQty).sum(); |
| | | List<LocItem> locItemList = listMap.get(key); |
| | | Double outQty = locItemList.stream().mapToDouble(LocItem::getOutQty).sum(); |
| | | |
| | | // Task serviceOne = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, loc.getBarcode())); |
| | | // if (!Objects.isNull(serviceOne)) { |
| | | // throw new CoolException("托盘任务执行中,不能重复创建!"); |
| | | // } |
| | | |
| | | if (map.getType().equals(Constants.TASK_TYPE_OUT_STOCK) || map.getType().equals(Constants.TASK_TYPE_ORDER_OUT_STOCK)) { |
| | | Double useQty = Math.round((outQty + workQty) * 10000) / 10000.0; |
| | | if (orgQty.compareTo(useQty) > 0) { |
| | | if (orgQty.compareTo(outQty) > 0) { |
| | | //拣料出库 |
| | | DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() |
| | | .eq(DeviceSite::getSite, siteNo) |
| | |
| | | if (Objects.isNull(param)) { |
| | | continue; |
| | | } |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, param.getBarcode())); |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, param.getLocCode()).eq(Loc::getBarcode, param.getBarcode())); |
| | | if (!Objects.isNull(loc)) { |
| | | List<LocItem> locItems = new ArrayList<>(); |
| | | LocItem locItem = locItemService.getById(param.getId()); |
| | |
| | | # global-config:
|
| | | # field-strategy: 0
|
| | | configuration:
|
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | map-underscore-to-camel-case: true
|
| | | cache-enabled: true
|
| | | call-setters-on-nulls: true
|