| | |
| | | basContainer: 'BasContainer', |
| | | waveRule: 'Wave Rules', |
| | | checkDiff: 'Check Diff', |
| | | transfer: 'Transfer', |
| | | |
| | | }, |
| | | table: { |
| | |
| | | checkQty: "Check Qty", |
| | | exceStatus: "Exce Status", |
| | | }, |
| | | transfer: { |
| | | code: "code", |
| | | type: "type", |
| | | source: "source", |
| | | exceStatus: "exceStatus", |
| | | orgWareId: "orgWareId", |
| | | orgWareName: "orgWareName", |
| | | tarWareId: "tarWareId", |
| | | tarWareName: "tarWareName", |
| | | orgAreaId: "orgAreaId", |
| | | orgAreaName: "orgAreaName", |
| | | tarAreaId: "tarAreaId", |
| | | tarAreaName: "tarAreaName", |
| | | }, |
| | | |
| | | checkDiffItem: { |
| | | checkId: "checkId", |
| | | orderCode: "orderCode", |
| | |
| | | waveRule: '波次策略', |
| | | checkOrder: '盘点单', |
| | | checkDiff: '盘点差异单', |
| | | transfer: '调拔单', |
| | | }, |
| | | table: { |
| | | field: { |
| | |
| | | checkQty: "盘点数量", |
| | | exceStatus: "执行状态", |
| | | }, |
| | | transfer: { |
| | | code: "调拔单", |
| | | type: "调拔类型", |
| | | source: "单据来源", |
| | | exceStatus: "执行状态", |
| | | orgWareId: "原仓库ID", |
| | | orgWareName: "原仓库", |
| | | tarWareId: "目标仓库ID", |
| | | tarWareName: "目标仓库", |
| | | orgAreaId: "原库区ID", |
| | | orgAreaName: "原库区", |
| | | tarAreaId: "目标库区", |
| | | tarAreaName: "目标库区", |
| | | }, |
| | | checkDiffItem: { |
| | | checkId: "盘点单ID", |
| | | orderCode: "盘点单号", |
| | |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser |
| | | } from "react-admin"; |
| | | |
| | | import host from "./system/host"; |
| | | import config from './system/config'; |
| | | import tenant from './system/tenant'; |
| | | import role from './system/role'; |
| | | import userLogin from './system/userLogin'; |
| | | import config from "./system/config"; |
| | | import tenant from "./system/tenant"; |
| | | import role from "./system/role"; |
| | | import userLogin from "./system/userLogin"; |
| | | import dept from "./system/dept"; |
| | | import menu from './system/menu' |
| | | import user from './system/user'; |
| | | import operationRecord from './system/operationRecord'; |
| | | import matnr from './basicInfo/matnr'; |
| | | import matnrGroup from './basicInfo/matnrGroup'; |
| | | import warehouse from './basicInfo/warehouse'; |
| | | import warehouseAreas from './warehouseAreas'; |
| | | import loc from './basicInfo/loc'; |
| | | import container from './container'; |
| | | import contract from './contract'; |
| | | import qlyInspect from './orders/qlyInspect'; |
| | | import dictType from './system/dicts/dictType'; |
| | | import companys from './basicInfo/companys'; |
| | | import locType from './basicInfo/locType'; |
| | | import locArea from './basicInfo//locArea'; |
| | | import locAreaMatRela from './basicInfo/locAreaMatRela'; |
| | | import locAreaMat from './basicInfo/locAreaMat'; |
| | | import serialRule from './system/serialRule'; |
| | | import whMat from './basicInfo/whMat'; |
| | | import asnOrder from './orders/asnOrder'; |
| | | import purchase from './orders/purchase'; |
| | | import fields from './fields'; |
| | | import fieldsItem from './fieldsItem'; |
| | | import warehouseAreasItem from './warehouseAreasItem'; |
| | | import deviceSite from './basicInfo/deviceSite'; |
| | | import waitPakin from './waitPakin'; |
| | | import waitPakinLog from './histories/waitPakinLog'; |
| | | import asnOrderLog from './histories/asnOrderLog'; |
| | | import task from './task'; |
| | | import taskLog from './histories/taskLog'; |
| | | import stock from './orders/stock'; |
| | | import delivery from './orders/delivery'; |
| | | import outStock from './orders/outStock'; |
| | | import deviceBind from './deviceBind'; |
| | | import wave from './orders/wave'; |
| | | import locItem from './locItem'; |
| | | import basStation from './basicInfo/basStation'; |
| | | import warehouseStock from './statistics/stockManage'; |
| | | import basContainer from './basicInfo/basContainer'; |
| | | import menu from "./system/menu"; |
| | | import user from "./system/user"; |
| | | import operationRecord from "./system/operationRecord"; |
| | | import matnr from "./basicInfo/matnr"; |
| | | import matnrGroup from "./basicInfo/matnrGroup"; |
| | | import warehouse from "./basicInfo/warehouse"; |
| | | import warehouseAreas from "./warehouseAreas"; |
| | | import loc from "./basicInfo/loc"; |
| | | import container from "./container"; |
| | | import contract from "./contract"; |
| | | import qlyInspect from "./orders/qlyInspect"; |
| | | import dictType from "./system/dicts/dictType"; |
| | | import companys from "./basicInfo/companys"; |
| | | import locType from "./basicInfo/locType"; |
| | | import locArea from "./basicInfo//locArea"; |
| | | import locAreaMatRela from "./basicInfo/locAreaMatRela"; |
| | | import locAreaMat from "./basicInfo/locAreaMat"; |
| | | import serialRule from "./system/serialRule"; |
| | | import whMat from "./basicInfo/whMat"; |
| | | import asnOrder from "./orders/asnOrder"; |
| | | import purchase from "./orders/purchase"; |
| | | import fields from "./fields"; |
| | | import fieldsItem from "./fieldsItem"; |
| | | import warehouseAreasItem from "./warehouseAreasItem"; |
| | | import deviceSite from "./basicInfo/deviceSite"; |
| | | import waitPakin from "./waitPakin"; |
| | | import waitPakinLog from "./histories/waitPakinLog"; |
| | | import asnOrderLog from "./histories/asnOrderLog"; |
| | | import task from "./task"; |
| | | import taskLog from "./histories/taskLog"; |
| | | import stock from "./orders/stock"; |
| | | import delivery from "./orders/delivery"; |
| | | import outStock from "./orders/outStock"; |
| | | import deviceBind from "./deviceBind"; |
| | | import wave from "./orders/wave"; |
| | | import locItem from "./locItem"; |
| | | import basStation from "./basicInfo/basStation"; |
| | | import warehouseStock from "./statistics/stockManage"; |
| | | import basContainer from "./basicInfo/basContainer"; |
| | | import outBound from "./work/outBound"; |
| | | import checkOutBound from "./work/checkOutBound"; |
| | | import stockTransfer from "./work/stockTransfer"; |
| | | import waveRule from './waveRule'; |
| | | import check from './orders/check'; |
| | | import checkDiff from './orders/check/checkDiff'; |
| | | import waveRule from "./waveRule"; |
| | | import check from "./orders/check"; |
| | | import checkDiff from "./orders/check/checkDiff"; |
| | | import transfer from "./orders/transfer"; |
| | | |
| | | |
| | | const ResourceContent = (node) => { |
| | | switch (node.component) { |
| | | case 'host': |
| | | return host; |
| | | case 'config': |
| | | return config; |
| | | case 'tenant': |
| | | return tenant; |
| | | case 'role': |
| | | return role; |
| | | case 'userLogin': |
| | | return userLogin; |
| | | case 'dept': |
| | | return dept; |
| | | case 'menu': |
| | | return menu; |
| | | case 'user': |
| | | return user; |
| | | case 'operationRecord': |
| | | return operationRecord; |
| | | case 'matnr': |
| | | return matnr; |
| | | case 'matnrGroup': |
| | | return matnrGroup; |
| | | case 'warehouse': |
| | | return warehouse; |
| | | case 'warehouseAreas': |
| | | return warehouseAreas; |
| | | case 'warehouseAreasItem': |
| | | return warehouseAreasItem; |
| | | case 'warehouseStock': |
| | | return warehouseStock; |
| | | case 'loc': |
| | | return loc; |
| | | case 'container': |
| | | return container; |
| | | case 'contract': |
| | | return contract; |
| | | case 'qlyInspect': |
| | | return qlyInspect; |
| | | case 'dictType': |
| | | return dictType; |
| | | case 'companys': |
| | | return companys; |
| | | case 'serialRule': |
| | | return serialRule; |
| | | case 'whMat': |
| | | return whMat; |
| | | case 'asnOrder': |
| | | return asnOrder; |
| | | case 'asnOrderLog': |
| | | return asnOrderLog; |
| | | case 'purchase': |
| | | return purchase; |
| | | case 'fields': |
| | | return fields; |
| | | case 'fieldsItem': |
| | | return fieldsItem; |
| | | case 'locType': |
| | | return locType; |
| | | case 'locArea': |
| | | return locArea; |
| | | case 'locAreaMatRela': |
| | | return locAreaMatRela; |
| | | case 'locAreaMat': |
| | | return locAreaMat; |
| | | case 'deviceSite': |
| | | return deviceSite; |
| | | case 'waitPakin': |
| | | return waitPakin; |
| | | case 'waitPakinLog': |
| | | return waitPakinLog; |
| | | case 'task': |
| | | return task; |
| | | case 'taskLog': |
| | | return taskLog; |
| | | case 'stock': |
| | | return stock; |
| | | case 'delivery': |
| | | return delivery; |
| | | case 'outStock': |
| | | return outStock; |
| | | case 'deviceBind': |
| | | return deviceBind; |
| | | case 'wave': |
| | | return wave; |
| | | case 'locItem': |
| | | return locItem; |
| | | case 'basStation': |
| | | return basStation; |
| | | case 'basContainer': |
| | | return basContainer; |
| | | case 'outBound': |
| | | return outBound; |
| | | case 'checkOutBound': |
| | | return checkOutBound; |
| | | case 'stockTransfer': |
| | | return stockTransfer; |
| | | case 'waveRule': |
| | | return waveRule; |
| | | case 'check': |
| | | return check; |
| | | case 'checkDiff': |
| | | return checkDiff; |
| | | default: |
| | | return { |
| | | list: ListGuesser, |
| | | edit: EditGuesser, |
| | | show: ShowGuesser, |
| | | } |
| | | } |
| | | } |
| | | switch (node.component) { |
| | | case "host": |
| | | return host; |
| | | case "config": |
| | | return config; |
| | | case "tenant": |
| | | return tenant; |
| | | case "role": |
| | | return role; |
| | | case "userLogin": |
| | | return userLogin; |
| | | case "dept": |
| | | return dept; |
| | | case "menu": |
| | | return menu; |
| | | case "user": |
| | | return user; |
| | | case "operationRecord": |
| | | return operationRecord; |
| | | case "matnr": |
| | | return matnr; |
| | | case "matnrGroup": |
| | | return matnrGroup; |
| | | case "warehouse": |
| | | return warehouse; |
| | | case "warehouseAreas": |
| | | return warehouseAreas; |
| | | case "warehouseAreasItem": |
| | | return warehouseAreasItem; |
| | | case "warehouseStock": |
| | | return warehouseStock; |
| | | case "loc": |
| | | return loc; |
| | | case "container": |
| | | return container; |
| | | case "contract": |
| | | return contract; |
| | | case "qlyInspect": |
| | | return qlyInspect; |
| | | case "dictType": |
| | | return dictType; |
| | | case "companys": |
| | | return companys; |
| | | case "serialRule": |
| | | return serialRule; |
| | | case "whMat": |
| | | return whMat; |
| | | case "asnOrder": |
| | | return asnOrder; |
| | | case "asnOrderLog": |
| | | return asnOrderLog; |
| | | case "purchase": |
| | | return purchase; |
| | | case "fields": |
| | | return fields; |
| | | case "fieldsItem": |
| | | return fieldsItem; |
| | | case "locType": |
| | | return locType; |
| | | case "locArea": |
| | | return locArea; |
| | | case "locAreaMatRela": |
| | | return locAreaMatRela; |
| | | case "locAreaMat": |
| | | return locAreaMat; |
| | | case "deviceSite": |
| | | return deviceSite; |
| | | case "waitPakin": |
| | | return waitPakin; |
| | | case "waitPakinLog": |
| | | return waitPakinLog; |
| | | case "task": |
| | | return task; |
| | | case "taskLog": |
| | | return taskLog; |
| | | case "stock": |
| | | return stock; |
| | | case "delivery": |
| | | return delivery; |
| | | case "outStock": |
| | | return outStock; |
| | | case "deviceBind": |
| | | return deviceBind; |
| | | case "wave": |
| | | return wave; |
| | | case "locItem": |
| | | return locItem; |
| | | case "basStation": |
| | | return basStation; |
| | | case "basContainer": |
| | | return basContainer; |
| | | case "outBound": |
| | | return outBound; |
| | | case "checkOutBound": |
| | | return checkOutBound; |
| | | case "stockTransfer": |
| | | return stockTransfer; |
| | | case "waveRule": |
| | | return waveRule; |
| | | case "check": |
| | | return check; |
| | | case "checkDiff": |
| | | return checkDiff; |
| | | case "transfer": |
| | | return transfer; |
| | | default: |
| | | return { |
| | | list: ListGuesser, |
| | | edit: EditGuesser, |
| | | show: ShowGuesser |
| | | }; |
| | | } |
| | | }; |
| | | |
| | | export default ResourceContent; |
| | |
| | | NumberField, |
| | | ReferenceInput, |
| | | AutocompleteInput, |
| | | useRecordSelection, |
| | | required, |
| | | Form, |
| | | useRefresh, |
| | |
| | | TextInput, |
| | | } from 'react-admin'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE, DEFAULT_TYPE } from '@/config/setting'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import { DataGrid, useGridApiContext, GridActionsCellItem, useGridApiRef } from '@mui/x-data-grid'; |
| | | import request from '@/utils/request'; |
| | | import ConfirmationNumberOutlinedIcon from '@mui/icons-material/ConfirmationNumberOutlined'; |
| | | import CloseSharpIcon from '@mui/icons-material/CloseSharp'; |
| | | import ConfirmButton from '../../components/ConfirmButton'; |
| | | import { Delete, Edit, Add } from '@mui/icons-material'; |
| | | import CheckOrderSiteDialog from "./CheckOrderSiteDialog"; |
| | | import CheckPreviewTable from "./CheckPreviewTable"; |
| | | import { styled } from '@mui/material/styles'; |
| | | import request from '@/utils/request'; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | const CheckOrderPub = (props) => { |
| | | const { record, open, setOpen, setManualDialog } = props; |
| | | const notify = useNotify(); |
| | | const translate = useTranslate(); |
| | | const gridRef = useGridApiRef(); |
| | | const [rows, setRows] = useState([]); |
| | | const [fetchRows, setFetchRows] = useState([]); |
| | | const translate = useTranslate(); |
| | | const [selectItem, setSelectItem] = useState({}); |
| | | const [rowSelectedIds, setRowSelectedIds] = useState([]); |
| | | const [selectedMatnr, setSelectedMatnr] = useState([]); |
| | | const [selectedIds, setSelectedIds] = useState([]); |
| | | const [leftSelectedIds, setLeftSelectedIds] = useState([]); |
| | | const [formData, setFormData] = useState({ orderId: record?.id, waveId: DEFAULT_TYPE }); |
| | | const [dialog, setDialog] = useState(false); |
| | | const [selectedValue, setSelectedValue] = useState({}); |
| | |
| | | |
| | | |
| | | const getLocs = async (ids) => { |
| | | let params = {matnrCode: ids} |
| | | const { data: { code, data, msg } } = await request.post('/check/locs/', params); |
| | | let params = { matnrCode: ids } |
| | | const { data: { code, data, msg } } = await request.post('/check/locs/', params); |
| | | if (code === 200) { |
| | | setRows(data) |
| | | const matnrs = selectedMatnr.filter(item => data.some(bigData => bigData.matnrCode === item)); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | const ComfirmButton = () => { |
| | | const { selectedIds, data, onUnselectItems } = useListContext(); |
| | | const { selectedIds, data, onUnselectItems, } = useListContext(); |
| | | const handleRowClick = () => { |
| | | const ids = data.filter(item => selectedIds.includes(item.id)); |
| | | setRowSelectedIds(ids); |
| | | const mas = data.filter(item => selectedIds.includes(item.id)).map(item => item.matnrCode); |
| | | //设置库位信息筛选条件 |
| | | setSelectedMatnr(mas); |
| | | onUnselectItems() |
| | | onUnselectItems(); |
| | | } |
| | | return ( |
| | | record.exceStatus != 3 ? <><Button label="toolbar.confirm" size="medium" onClick={handleRowClick} /></> : <></> |
| | |
| | | record={record} |
| | | formData={formData} |
| | | selectedMatnr={selectedMatnr} |
| | | selectedIds={selectedIds} |
| | | leftSelectedIds={leftSelectedIds} |
| | | setDialog={setDialog} |
| | | setSelectedIds={setSelectedIds} |
| | | setLeftSelectedIds={setLeftSelectedIds} |
| | | /> |
| | | </Box> |
| | | <Box sx={{ textAlign: 'center' }}> |
| | | <CloseButton setOpen={setOpen} /> |
| | | <SubmitButton selectedIds={selectedIds} setOpen={setOpen} setSelectedIds={setSelectedIds} selectedMatnr={selectedMatnr} rowSelectedIds={rowSelectedIds} gridRef={gridRef} record={record} /> |
| | | <SubmitButton |
| | | leftSelectedIds={leftSelectedIds} |
| | | setOpen={setOpen} |
| | | setLeftSelectedIds={setLeftSelectedIds} |
| | | selectItem={selectItem} |
| | | selectedMatnr={selectedMatnr} |
| | | rowSelectedIds={rowSelectedIds} |
| | | gridRef={gridRef} |
| | | record={record} /> |
| | | </Box> |
| | | </Card> |
| | | </Grid> |
| | |
| | | } |
| | | |
| | | //提交按钮 |
| | | const SubmitButton = ({ selectedIds, setSelectedIds, rowSelectedIds, gridRef, record, setOpen, selectedMatnr }) => { |
| | | const SubmitButton = ({ leftSelectedIds, setLeftSelectedIds, rowSelectedIds, selectItem, gridRef, record, setOpen, selectedMatnr }) => { |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | const redirect = useRedirect(); |
| | | const submit = async () => { |
| | | const items = gridRef.current?.getSortedRows(); |
| | | let selctRecord = items.filter(item => selectedIds.includes(item?.id)); |
| | | let selctRecord = items.filter(item => leftSelectedIds.includes(item?.id)); |
| | | |
| | | if (selctRecord == undefined || selctRecord.length < 1) { |
| | | notify(translate('common.msg.locEmpty'), { type: 'error' }); |
| | | return |
| | |
| | | |
| | | let params = records.filter(record => record?.items.length > 0); |
| | | |
| | | const { data: { code, data, msg } } = await request.post('/check/generate/tasks', params); |
| | | if (code == 200) { |
| | | refresh(); |
| | | setOpen(false) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | redirect("/task") |
| | | |
| | | |
| | | // const { data: { code, data, msg } } = await request.post('/check/generate/tasks', params); |
| | | // if (code == 200) { |
| | | // refresh(); |
| | | // redirect("/task") |
| | | // setOpen(false) |
| | | // } else { |
| | | // notify(msg); |
| | | // } |
| | | } |
| | | return ( |
| | | <ConfirmButton |
| | |
| | | } from 'react-admin'; |
| | | |
| | | const CheckPreviewTable = (props) => { |
| | | const { rows, gridRef, setRows, record, selectedIds, setSelectedIds, selectedMatnr, setDialog, formData } = props; |
| | | const { rows, gridRef, setRows, record, lefSelectedIds, setLeftSelectedIds, selectedMatnr, setDialog, formData } = props; |
| | | // const translate = useTranslate(); |
| | | // const refresh = useRefresh(); |
| | | // const notify = useNotify(); |
| | | gridRef.current = useGridApiRef(); |
| | | const translate = useTranslate(); |
| | | |
| | | useEffect(() => { |
| | | if (selectedIds.length > 0) { |
| | | console.log(selectedIds); |
| | | } |
| | | }, [selectedIds]) |
| | | // useEffect(() => { |
| | | // if (lefSelectedIds.length > 0) { |
| | | // console.log(lefSelectedIds); |
| | | // } |
| | | // }, [lefSelectedIds]) |
| | | |
| | | const baseColumns = [ |
| | | { field: 'locCode', headerName: '库位', width: 110 }, |
| | |
| | | const [queryParams, setQueryParams] = useState({ locCode: null, channel: null, matnrCode: selectedMatnr }); |
| | | const notify = useNotify(); |
| | | const queryClick = async () => { |
| | | console.log(queryParams); |
| | | console.log(rows); |
| | | const { data: { code, data, msg } } = await request.post('/check/locs/', queryParams); |
| | | if (code === 200) { |
| | | setRows(data) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | const OutStockSite = (params) => { |
| | | const { id, field, siteNo, row: { staNos } } = params; |
| | | const apiRef = useGridApiContext(); |
| | |
| | | hideFooterPagination={true} // 隐藏分页控件 |
| | | hideFooter={false} |
| | | onRowSelectionModelChange={(ids) => { |
| | | setSelectedIds(ids) |
| | | setLeftSelectedIds(ids) |
| | | }} |
| | | /> |
| | | </Box> |
| | |
| | | Form, |
| | | useRefresh, |
| | | useRedirect, |
| | | useRecordSelection, |
| | | } from 'react-admin'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE, DEFAULT_TYPE } from '@/config/setting'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | |
| | | |
| | | const ComfirmButton = () => { |
| | | const { selectedIds, data } = useListContext(); |
| | | const { data } = useListContext(); |
| | | const [selectedIds, selectionModifiers] = useRecordSelection(); |
| | | |
| | | const handleRowClick = () => { |
| | | console.log(selectedIds); |
| | | |
| | | const ids = data.filter(item => selectedIds.includes(item.id)).map(item => item.id); |
| | | setRowSelectedIds(ids); |
| | | const mas = data.filter(item => selectedIds.includes(item.id)).map(item => item.matnrCode); |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | CreateBase, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SaveButton, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | Toolbar, |
| | | required, |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | | DialogActions, |
| | | DialogContent, |
| | | DialogTitle, |
| | | Stack, |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton.jsx"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput.jsx"; |
| | | import MemoInput from "../../components/MemoInput.jsx"; |
| | | |
| | | const TransferCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | const handleSuccess = async (data) => { |
| | | setOpen(false); |
| | | notify('common.response.success'); |
| | | }; |
| | | |
| | | const handleError = async (error) => { |
| | | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); |
| | | }; |
| | | |
| | | return ( |
| | | <> |
| | | <CreateBase |
| | | record={{}} |
| | | transform={(data) => { |
| | | return data; |
| | | }} |
| | | mutationOptions={{ onSuccess: handleSuccess, onError: handleError }} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" // 'xs' | 'sm' | 'md' | 'lg' | 'xl' |
| | | > |
| | | <Form> |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('create.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.transfer.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.transfer.type" |
| | | source="type" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <SelectInput |
| | | label="table.field.transfer.source" |
| | | source="source" |
| | | choices={[ |
| | | { id: 1, name: 'ERP系统' }, |
| | | { id: 2, name: 'WMS系统生成' }, |
| | | { id: 3, name: 'EXCEL导入 ' }, |
| | | { id: 4, name: 'QMS系统' }, |
| | | ]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <SelectInput |
| | | label="table.field.transfer.exceStatus" |
| | | source="exceStatus" |
| | | choices={[ |
| | | { id: 0, name: '未执行' }, |
| | | { id: 1, name: '执行中' }, |
| | | { id: 2, name: '执行完成' }, |
| | | ]} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.transfer.orgWareId" |
| | | source="orgWareId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.transfer.orgWareName" |
| | | source="orgWareName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.transfer.tarWareId" |
| | | source="tarWareId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.transfer.tarWareName" |
| | | source="tarWareName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.transfer.orgAreaId" |
| | | source="orgAreaId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.transfer.orgAreaName" |
| | | source="orgAreaName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.transfer.tarAreaId" |
| | | source="tarAreaId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.transfer.tarAreaName" |
| | | source="tarAreaName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | | </Grid> |
| | | <Grid item xs={12} display="flex" gap={1}> |
| | | <Stack direction="column" spacing={1} width={'100%'}> |
| | | <MemoInput /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} > |
| | | <SaveButton /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </Dialog> |
| | | </CreateBase> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default TransferCreate; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import * as Common from '@/utils/common.js'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting.js'; |
| | | import EditBaseAside from "../../components/EditBaseAside.jsx"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar.jsx"; |
| | | import MemoInput from "../../components/MemoInput.jsx"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput.jsx"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const TransferEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={12} md={8}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.transfer.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.transfer.type" |
| | | source="type" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.transfer.source" |
| | | source="source" |
| | | choices={[ |
| | | { id: 1, name: 'ERP系统' }, |
| | | { id: 2, name: 'WMS系统生成' }, |
| | | { id: 3, name: 'EXCEL导入 ' }, |
| | | { id: 4, name: 'QMS系统' }, |
| | | ]} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.transfer.exceStatus" |
| | | source="exceStatus" |
| | | choices={[ |
| | | { id: 0, name: '未执行' }, |
| | | { id: 1, name: '执行中' }, |
| | | { id: 2, name: '执行完成' }, |
| | | ]} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.transfer.orgWareId" |
| | | source="orgWareId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.transfer.orgWareName" |
| | | source="orgWareName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.transfer.tarWareId" |
| | | source="tarWareId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.transfer.tarWareName" |
| | | source="tarWareName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.transfer.orgAreaId" |
| | | source="orgAreaId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.transfer.orgAreaName" |
| | | source="orgAreaName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.transfer.tarAreaId" |
| | | source="tarAreaId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.transfer.tarAreaName" |
| | | source="tarAreaName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | ) |
| | | } |
| | | |
| | | export default TransferEdit; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import TransferCreate from "./TransferCreate.jsx"; |
| | | import TransferPanel from "./TransferPanel.jsx"; |
| | | import EmptyData from "../../components/EmptyData.jsx"; |
| | | import MyCreateButton from "../../components/MyCreateButton.jsx"; |
| | | import MyExportButton from '../../components/MyExportButton.jsx'; |
| | | import PageDrawer from "../../components/PageDrawer.jsx"; |
| | | import MyField from "../../components/MyField.jsx"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting.js'; |
| | | import * as Common from '@/utils/common.js'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.transfer.code" />, |
| | | <NumberInput source="type" label="table.field.transfer.type" />, |
| | | <SelectInput source="source" label="table.field.transfer.source" |
| | | choices={[ |
| | | { id: 1, name: 'ERP系统' }, |
| | | { id: 2, name: 'WMS系统生成' }, |
| | | { id: 3, name: 'EXCEL导入 ' }, |
| | | { id: 4, name: 'QMS系统' }, |
| | | ]} |
| | | />, |
| | | <SelectInput source="exceStatus" label="table.field.transfer.exceStatus" |
| | | choices={[ |
| | | { id: 0, name: '未执行' }, |
| | | { id: 1, name: '执行中' }, |
| | | { id: 2, name: '执行完成' }, |
| | | ]} |
| | | />, |
| | | <NumberInput source="orgWareId" label="table.field.transfer.orgWareId" />, |
| | | <TextInput source="orgWareName" label="table.field.transfer.orgWareName" />, |
| | | <NumberInput source="tarWareId" label="table.field.transfer.tarWareId" />, |
| | | <TextInput source="tarWareName" label="table.field.transfer.tarWareName" />, |
| | | <NumberInput source="orgAreaId" label="table.field.transfer.orgAreaId" />, |
| | | <TextInput source="orgAreaName" label="table.field.transfer.orgAreaName" />, |
| | | <NumberInput source="tarAreaId" label="table.field.transfer.tarAreaId" />, |
| | | <TextInput source="tarAreaName" label="table.field.transfer.tarAreaName" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const TransferList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.transfer"} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='transfer' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='transfer' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <TransferPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.transfer.code" /> |
| | | <NumberField source="type" label="table.field.transfer.type" /> |
| | | <TextField source="source$" label="table.field.transfer.source" sortable={false} /> |
| | | <TextField source="exceStatus$" label="table.field.transfer.exceStatus" sortable={false} /> |
| | | <NumberField source="orgWareId" label="table.field.transfer.orgWareId" /> |
| | | <TextField source="orgWareName" label="table.field.transfer.orgWareName" /> |
| | | <NumberField source="tarWareId" label="table.field.transfer.tarWareId" /> |
| | | <TextField source="tarWareName" label="table.field.transfer.tarWareName" /> |
| | | <NumberField source="orgAreaId" label="table.field.transfer.orgAreaId" /> |
| | | <TextField source="orgAreaName" label="table.field.transfer.orgAreaName" /> |
| | | <NumberField source="tarAreaId" label="table.field.transfer.tarAreaId" /> |
| | | <TextField source="tarAreaName" label="table.field.transfer.tarAreaName" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <TransferCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='Transfer Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default TransferList; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material'; |
| | | import { |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../../components/PanelTypography.jsx"; |
| | | import * as Common from '@/utils/common.js' |
| | | |
| | | const TransferPanel = () => { |
| | | const record = useRecordContext(); |
| | | if (!record) return null; |
| | | const translate = useTranslate(); |
| | | return ( |
| | | <> |
| | | <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}> |
| | | <CardContent> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}> |
| | | <Typography variant="h6" gutterBottom align="left" sx={{ |
| | | maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' }, |
| | | whiteSpace: 'nowrap', |
| | | overflow: 'hidden', |
| | | textOverflow: 'ellipsis', |
| | | }}> |
| | | {Common.camelToPascalWithSpaces(translate('table.field.transfer.id'))}: {record.id} |
| | | </Typography> |
| | | {/* inherit, primary, secondary, textPrimary, textSecondary, error */} |
| | | <Typography variant="h6" gutterBottom align="right" > |
| | | ID: {record.id} |
| | | </Typography> |
| | | </Grid> |
| | | </Grid> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={12} container alignContent="flex-end"> |
| | | <Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}> |
| | | {Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo} |
| | | </Typography> |
| | | </Grid> |
| | | </Grid> |
| | | <Box height={20}> </Box> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.code" |
| | | property={record.code} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.type" |
| | | property={record.type} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.source" |
| | | property={record.source$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.exceStatus" |
| | | property={record.exceStatus$} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.orgWareId" |
| | | property={record.orgWareId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.orgWareName" |
| | | property={record.orgWareName} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.tarWareId" |
| | | property={record.tarWareId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.tarWareName" |
| | | property={record.tarWareName} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.orgAreaId" |
| | | property={record.orgAreaId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.orgAreaName" |
| | | property={record.orgAreaName} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.tarAreaId" |
| | | property={record.tarAreaId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.transfer.tarAreaName" |
| | | property={record.tarAreaName} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default TransferPanel; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | ListGuesser, |
| | | EditGuesser, |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import TransferList from "./TransferList.jsx"; |
| | | import TransferEdit from "./TransferEdit.jsx"; |
| | | |
| | | export default { |
| | | list: TransferList, |
| | | edit: TransferEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.id}` |
| | | } |
| | | }; |
| | |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table = "man_check_diff_item"; |
| | | generator.tableDesc = "盘点明细差异表"; |
| | | generator.table = "man_transfer"; |
| | | generator.tableDesc = "调拔单"; |
| | | generator.packagePath = "com.vincent.rsf.server.manager"; |
| | | |
| | | generator.build(); |
New file |
| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.Transfer; |
| | | import com.vincent.rsf.server.manager.service.TransferService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class TransferController extends BaseController { |
| | | |
| | | @Autowired |
| | | private TransferService transferService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:list')") |
| | | @PostMapping("/transfer/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Transfer, BaseParam> pageParam = new PageParam<>(baseParam, Transfer.class); |
| | | return R.ok().add(transferService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:list')") |
| | | @PostMapping("/transfer/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(transferService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:list')") |
| | | @PostMapping({"/transfer/many/{ids}", "/transfers/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(transferService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:list')") |
| | | @GetMapping("/transfer/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(transferService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:save')") |
| | | @OperationLog("Create 调拔单") |
| | | @PostMapping("/transfer/save") |
| | | public R save(@RequestBody Transfer transfer) { |
| | | transfer.setCreateBy(getLoginUserId()); |
| | | transfer.setCreateTime(new Date()); |
| | | transfer.setUpdateBy(getLoginUserId()); |
| | | transfer.setUpdateTime(new Date()); |
| | | if (!transferService.save(transfer)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(transfer); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:update')") |
| | | @OperationLog("Update 调拔单") |
| | | @PostMapping("/transfer/update") |
| | | public R update(@RequestBody Transfer transfer) { |
| | | transfer.setUpdateBy(getLoginUserId()); |
| | | transfer.setUpdateTime(new Date()); |
| | | if (!transferService.updateById(transfer)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(transfer); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:remove')") |
| | | @OperationLog("Delete 调拔单") |
| | | @PostMapping("/transfer/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!transferService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:list')") |
| | | @PostMapping("/transfer/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<Transfer> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(Transfer::getId, condition); |
| | | } |
| | | transferService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:transfer:list')") |
| | | @PostMapping("/transfer/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(transferService.list(), Transfer.class), response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_transfer") |
| | | public class Transfer implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 调拔单号 |
| | | */ |
| | | @ApiModelProperty(value= "调拔单号") |
| | | private String code; |
| | | |
| | | /** |
| | | * 调拔类型 |
| | | */ |
| | | @ApiModelProperty(value= "调拔类型") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 来源: 1: ERP系统 2: WMS系统生成 3: EXCEL导入 4: QMS系统 |
| | | */ |
| | | @ApiModelProperty(value= "来源: 1: ERP系统 2: WMS系统生成 3: EXCEL导入 4: QMS系统 ") |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 执行状态: 0: 未执行 1: 执行中 2: 执行完成 |
| | | */ |
| | | @ApiModelProperty(value= "执行状态: 0: 未执行 1: 执行中 2: 执行完成 ") |
| | | private Integer exceStatus; |
| | | |
| | | /** |
| | | * 源仓库ID |
| | | */ |
| | | @ApiModelProperty(value= "源仓库ID") |
| | | private Long orgWareId; |
| | | |
| | | /** |
| | | * 原仓库名称 |
| | | */ |
| | | @ApiModelProperty(value= "原仓库名称") |
| | | private String orgWareName; |
| | | |
| | | /** |
| | | * 目标仓库ID |
| | | */ |
| | | @ApiModelProperty(value= "目标仓库ID") |
| | | private Long tarWareId; |
| | | |
| | | /** |
| | | * 目标仓库名称 |
| | | */ |
| | | @ApiModelProperty(value= "目标仓库名称") |
| | | private String tarWareName; |
| | | |
| | | /** |
| | | * 源库区ID |
| | | */ |
| | | @ApiModelProperty(value= "源库区ID") |
| | | private Long orgAreaId; |
| | | |
| | | /** |
| | | * 原库区名称 |
| | | */ |
| | | @ApiModelProperty(value= "原库区名称") |
| | | private String orgAreaName; |
| | | |
| | | /** |
| | | * 目标库区ID |
| | | */ |
| | | @ApiModelProperty(value= "目标库区ID") |
| | | private Long tarAreaId; |
| | | |
| | | /** |
| | | * 目标库区名称 |
| | | */ |
| | | @ApiModelProperty(value= "目标库区名称") |
| | | private String tarAreaName; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 租户 |
| | | */ |
| | | @ApiModelProperty(value= "租户") |
| | | private Integer tenantId; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public Transfer() {} |
| | | |
| | | public Transfer(String code,Integer type,Integer source,Integer exceStatus,Long orgWareId,String orgWareName,Long tarWareId,String tarWareName,Long orgAreaId,String orgAreaName,Long tarAreaId,String tarAreaName,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.code = code; |
| | | this.type = type; |
| | | this.source = source; |
| | | this.exceStatus = exceStatus; |
| | | this.orgWareId = orgWareId; |
| | | this.orgWareName = orgWareName; |
| | | this.tarWareId = tarWareId; |
| | | this.tarWareName = tarWareName; |
| | | this.orgAreaId = orgAreaId; |
| | | this.orgAreaName = orgAreaName; |
| | | this.tarAreaId = tarAreaId; |
| | | this.tarAreaName = tarAreaName; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // Transfer transfer = new Transfer( |
| | | // null, // 调拔单号 |
| | | // null, // 调拔类型 |
| | | // null, // 来源: |
| | | // null, // 执行状态: |
| | | // null, // 源仓库ID |
| | | // null, // 原仓库名称 |
| | | // null, // 目标仓库ID |
| | | // null, // 目标仓库名称 |
| | | // null, // 源库区ID |
| | | // null, // 原库区名称 |
| | | // null, // 目标库区ID |
| | | // null, // 目标库区名称 |
| | | // null, // 状态[非空] |
| | | // null, // 是否删除[非空] |
| | | // null, // 租户 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间[非空] |
| | | // null, // 修改人员 |
| | | // null, // 修改时间[非空] |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getSource$(){ |
| | | if (null == this.source){ return null; } |
| | | switch (this.source){ |
| | | case 1: |
| | | return "ERP系统"; |
| | | case 2: |
| | | return "WMS系统生成"; |
| | | case 3: |
| | | return "EXCEL导入 "; |
| | | case 4: |
| | | return "QMS系统"; |
| | | default: |
| | | return String.valueOf(this.source); |
| | | } |
| | | } |
| | | |
| | | public String getExceStatus$(){ |
| | | if (null == this.exceStatus){ return null; } |
| | | switch (this.exceStatus){ |
| | | case 0: |
| | | return "未执行"; |
| | | case 1: |
| | | return "执行中"; |
| | | case 2: |
| | | return "执行完成"; |
| | | default: |
| | | return String.valueOf(this.exceStatus); |
| | | } |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "冻结"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | |
| | | public Boolean getStatusBool(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return true; |
| | | case 0: |
| | | return false; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | * @version 1.0 |
| | | */ |
| | | public enum OrderSourceType { |
| | | |
| | | //单据来源 |
| | | ORDER_SOURCE_TYPE_ERP("1", "ERP系统"), |
| | | ORDER_SOURCE_TYPE_SYSTEM("2", "WMS系统生成"), |
| | | ORDER_SOURCE_TYPE_EXCEL("3", "EXCEL导入"), |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.Transfer; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface TransferMapper extends BaseMapper<Transfer> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.Transfer; |
| | | |
| | | public interface TransferService extends IService<Transfer> { |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | }); |
| | | List<Long> matnrIds = taskItems.stream().map(TaskItem::getMatnrId).collect(Collectors.toList()); |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.TransferMapper; |
| | | import com.vincent.rsf.server.manager.entity.Transfer; |
| | | import com.vincent.rsf.server.manager.service.TransferService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("transferService") |
| | | public class TransferServiceImpl extends ServiceImpl<TransferMapper, Transfer> implements TransferService { |
| | | |
| | | } |
| | |
| | | public final static String SYS_CHECK_EXCE_STATUS = "sys_check_exce_status"; |
| | | /**盘点差异单执行状态*/ |
| | | public final static String SYS_CHECK_DIFF_EXCE_STATUS = "sys_check_diff_exce_status"; |
| | | |
| | | /**盘点异常原因*/ |
| | | public final static String SYS_CHECK_DIFF_REASON = "sys_check_diff_reason"; |
| | | |
| | | /**盘点类型*/ |
| | | public final static String SYS_CHECK_TYPE = "sys_check_type"; |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.vincent.rsf.server.manager.mapper.TransferMapper"> |
| | | |
| | | </mapper> |