Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
| | |
| | | version: 6.4.7(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1) |
| | | '@mui/x-data-grid': |
| | | specifier: ^7.27.3 |
| | | version: 7.27.3(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@mui/material@5.16.14(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/system@6.4.7(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) |
| | | version: 7.28.1(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@mui/material@5.16.14(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/system@6.4.7(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) |
| | | '@mui/x-tree-view': |
| | | specifier: ^7.16.0 |
| | | version: 7.26.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@mui/material@5.16.14(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/system@6.4.7(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) |
| | |
| | | |
| | | '@babel/runtime@7.26.9': |
| | | resolution: {integrity: sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg==} |
| | | engines: {node: '>=6.9.0'} |
| | | |
| | | '@babel/runtime@7.27.0': |
| | | resolution: {integrity: sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==} |
| | | engines: {node: '>=6.9.0'} |
| | | |
| | | '@babel/template@7.26.9': |
| | |
| | | '@types/react': |
| | | optional: true |
| | | |
| | | '@mui/x-data-grid@7.27.3': |
| | | resolution: {integrity: sha512-7zbDbFrhV6ODjyn3ImOZG34nbMbCvmHgqYTYP273TNAj8hMy4BiLyiKFFZTzVddIj3KQ6qLzBpByhqifGgEDOg==} |
| | | '@mui/x-data-grid@7.28.1': |
| | | resolution: {integrity: sha512-uDJcjRB7zfRoquZb4G8iw0NWbhziVVPsHisi/EIzvOPHP+a1ZUnG0bLEnY+cy6eEwDrO1dNzYpwGFCcjl8ZKfA==} |
| | | engines: {node: '>=14.0.0'} |
| | | peerDependencies: |
| | | '@emotion/react': ^11.9.0 |
| | | '@emotion/styled': ^11.8.1 |
| | | '@mui/material': ^5.15.14 || ^6.0.0 |
| | | '@mui/system': ^5.15.14 || ^6.0.0 |
| | | '@mui/material': ^5.15.14 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta |
| | | '@mui/system': ^5.15.14 || ^6.0.0 || ^7.0.0 || ^7.0.0-beta |
| | | react: ^17.0.0 || ^18.0.0 || ^19.0.0 |
| | | react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 |
| | | peerDependenciesMeta: |
| | |
| | | |
| | | '@mui/x-internals@7.26.0': |
| | | resolution: {integrity: sha512-VxTCYQcZ02d3190pdvys2TDg9pgbvewAVakEopiOgReKAUhLdRlgGJHcOA/eAuGLyK1YIo26A6Ow6ZKlSRLwMg==} |
| | | engines: {node: '>=14.0.0'} |
| | | peerDependencies: |
| | | react: ^17.0.0 || ^18.0.0 || ^19.0.0 |
| | | |
| | | '@mui/x-internals@7.28.0': |
| | | resolution: {integrity: sha512-p4GEp/09bLDumktdIMiw+OF4p+pJOOjTG0VUvzNxjbHB9GxbBKoMcHrmyrURqoBnQpWIeFnN/QAoLMFSpfwQbw==} |
| | | engines: {node: '>=14.0.0'} |
| | | peerDependencies: |
| | | react: ^17.0.0 || ^18.0.0 || ^19.0.0 |
| | |
| | | dependencies: |
| | | regenerator-runtime: 0.14.1 |
| | | |
| | | '@babel/runtime@7.27.0': |
| | | dependencies: |
| | | regenerator-runtime: 0.14.1 |
| | | |
| | | '@babel/template@7.26.9': |
| | | dependencies: |
| | | '@babel/code-frame': 7.26.2 |
| | |
| | | '@emotion/babel-plugin@11.13.5': |
| | | dependencies: |
| | | '@babel/helper-module-imports': 7.25.9 |
| | | '@babel/runtime': 7.26.9 |
| | | '@babel/runtime': 7.27.0 |
| | | '@emotion/hash': 0.9.2 |
| | | '@emotion/memoize': 0.9.0 |
| | | '@emotion/serialize': 1.3.3 |
| | |
| | | |
| | | '@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1)': |
| | | dependencies: |
| | | '@babel/runtime': 7.26.9 |
| | | '@babel/runtime': 7.27.0 |
| | | '@emotion/babel-plugin': 11.13.5 |
| | | '@emotion/cache': 11.14.0 |
| | | '@emotion/serialize': 1.3.3 |
| | |
| | | |
| | | '@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1)': |
| | | dependencies: |
| | | '@babel/runtime': 7.26.9 |
| | | '@babel/runtime': 7.27.0 |
| | | '@emotion/babel-plugin': 11.13.5 |
| | | '@emotion/is-prop-valid': 1.3.1 |
| | | '@emotion/react': 11.14.0(@types/react@18.3.18)(react@18.3.1) |
| | |
| | | optionalDependencies: |
| | | '@types/react': 18.3.18 |
| | | |
| | | '@mui/x-data-grid@7.27.3(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@mui/material@5.16.14(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/system@6.4.7(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': |
| | | '@mui/x-data-grid@7.28.1(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@mui/material@5.16.14(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mui/system@6.4.7(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': |
| | | dependencies: |
| | | '@babel/runtime': 7.26.9 |
| | | '@babel/runtime': 7.27.0 |
| | | '@mui/material': 5.16.14(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) |
| | | '@mui/system': 6.4.7(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@emotion/styled@11.14.0(@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1))(@types/react@18.3.18)(react@18.3.1) |
| | | '@mui/utils': 6.4.6(@types/react@18.3.18)(react@18.3.1) |
| | | '@mui/x-internals': 7.26.0(@types/react@18.3.18)(react@18.3.1) |
| | | '@mui/x-internals': 7.28.0(@types/react@18.3.18)(react@18.3.1) |
| | | clsx: 2.1.1 |
| | | prop-types: 15.8.1 |
| | | react: 18.3.1 |
| | |
| | | '@mui/x-internals@7.26.0(@types/react@18.3.18)(react@18.3.1)': |
| | | dependencies: |
| | | '@babel/runtime': 7.26.9 |
| | | '@mui/utils': 6.4.6(@types/react@18.3.18)(react@18.3.1) |
| | | react: 18.3.1 |
| | | transitivePeerDependencies: |
| | | - '@types/react' |
| | | |
| | | '@mui/x-internals@7.28.0(@types/react@18.3.18)(react@18.3.1)': |
| | | dependencies: |
| | | '@babel/runtime': 7.27.0 |
| | | '@mui/utils': 6.4.6(@types/react@18.3.18)(react@18.3.1) |
| | | react: 18.3.1 |
| | | transitivePeerDependencies: |
| | |
| | | |
| | | babel-plugin-macros@3.1.0: |
| | | dependencies: |
| | | '@babel/runtime': 7.26.9 |
| | | '@babel/runtime': 7.27.0 |
| | | cosmiconfig: 7.1.0 |
| | | resolve: 1.22.10 |
| | | |
| | |
| | | |
| | | react-error-boundary@4.1.2(react@18.3.1): |
| | | dependencies: |
| | | '@babel/runtime': 7.26.9 |
| | | '@babel/runtime': 7.27.0 |
| | | react: 18.3.1 |
| | | |
| | | react-hook-form@7.54.2(react@18.3.1): |
| | |
| | | const inspection = () => { }; |
| | | |
| | | const print = () => { |
| | | // const imageUrls = ['https://www.baidu.com/img/flexible/logo/pc/result@2.png',] |
| | | // const iframe = document.createElement('iframe'); |
| | | // iframe.style.display = 'none'; |
| | | // document.body.appendChild(iframe); |
| | | |
| | | // const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; |
| | | // iframeDoc.open(); |
| | | // iframeDoc.write('<html><head><title>Print Images</title></head><body>'); |
| | | |
| | | // // 将图片插入到 iframe 中 |
| | | // imageUrls.forEach((imageUrl) => { |
| | | // iframeDoc.write(`<img src="${imageUrl}" style="margin: 10px;">`); |
| | | // }); |
| | | |
| | | // iframeDoc.write('</body></html>'); |
| | | // iframeDoc.close(); |
| | | |
| | | // // 等待图片加载完成后触发打印 |
| | | // iframe.contentWindow.onload = () => { |
| | | // iframe.contentWindow.print(); |
| | | // // 打印完成后移除 iframe |
| | | // document.body.removeChild(iframe); |
| | | // }; |
| | | }; |
| | | |
| | | |
| | |
| | | <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" > |
| | | <Button label="toolbar.print" onClick={print}> |
| | | {/* <Button label="toolbar.print" onClick={print}> |
| | | <FileDownloadIcon /> |
| | | </Button> |
| | | </Button> */} |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | {/* <Button |
| | |
| | | import _ from 'lodash'; |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import DictionarySelect from "../components/DictionarySelect"; |
| | | import DictSelect from "../components/DictSelect"; |
| | | |
| | | const AsnOrderModal = (props) => { |
| | | const { open, setOpen, asnId } = props; |
| | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | useEffect(() => { |
| | |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | refresh(); |
| | | setFormData({ type: '' }) |
| | | setFormData({ type: '', wkType: '' }) |
| | | setTableData([]) |
| | | } |
| | | }; |
| | | |
| | | const [formData, setFormData] = useState({ |
| | | type: '', |
| | | wkType: '', |
| | | }); |
| | | |
| | | const [tabelData, setTableData] = useState([]); |
| | |
| | | "orders": formData, |
| | | "items": tabelData, |
| | | } |
| | | |
| | | const res = await request.post(`/asnOrder/items/save`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | setOpen(false); |
| | |
| | | notify(res.data.msg); |
| | | } |
| | | } else { |
| | | setOpen(false); |
| | | const parmas = { |
| | | "orders": formData, |
| | | "items": tabelData, |
| | | } |
| | | console.log(parmas); |
| | | // const res = await request.post(`/asnOrder/items/save`, parmas); |
| | | // if (res?.data?.code === 200) { |
| | | // setOpen(false); |
| | | // refresh(); |
| | | // } else { |
| | | // notify(res.data.msg); |
| | | // } |
| | | // setOpen(false); |
| | | } |
| | | |
| | | |
| | | }; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | const requestSetHead = async () => { |
| | | if (asnId !== 0) { |
| | | const res = await request.post(`/asnOrder/update`, { ...formData }); |
| | | refresh() |
| | | } |
| | | } |
| | | |
| | | |
| | | return ( |
| | | <> |
| | | <Dialog |
| | |
| | | <Form> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={4}> |
| | | <DictionarySelect |
| | | <DictSelect |
| | | label={translate("table.field.asnOrder.type")} |
| | | name="type" |
| | | value={formData.type} |
| | | onChange={(e) => handleChange(+e.target.value, 'type')} |
| | | size="small" |
| | | onChange={(e) => handleChange(e.target.value, 'type')} |
| | | dictTypeCode="sys_order_type" |
| | | required |
| | | /> |
| | | |
| | | |
| | | </Grid> |
| | | |
| | | <Grid item xs={4}> |
| | | <DictionarySelect |
| | | <DictSelect |
| | | label={translate("table.field.asnOrder.wkType")} |
| | | name="wkType" |
| | | value={formData.wkType} |
| | | onChange={(e) => handleChange(+e.target.value, 'wkType')} |
| | | size="small" |
| | | onChange={(e) => handleChange(e.target.value, 'wkType')} |
| | | dictTypeCode="sys_business_type" |
| | | required |
| | | /> |
| | | </Grid> |
| | | </Grid> |
| | |
| | | |
| | | const AsnOrderModalTable = ({ tabelData, setTableData, asnId }) => { |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | | const columns = [ |
| | | const [columns, setColumns] = useState([ |
| | | { |
| | | field: 'action', |
| | | headerName: '操作', |
| | | minWidth: 100, |
| | | sticky: 'right', |
| | | flex: 1, |
| | | width: 70, |
| | | lockPosition: 'left', |
| | | renderCell: (params) => ( |
| | | <Tooltip title="Delete"> |
| | | <IconButton onClick={() => handleDelete(params.row)}> |
| | |
| | | </IconButton> |
| | | </Tooltip> |
| | | ), |
| | | |
| | | }, |
| | | { |
| | | field: 'matnrId', |
| | |
| | | headerName: translate('table.field.asnOrderItem.stockUnit'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'purQty', |
| | |
| | | headerName: translate('table.field.asnOrderItem.purUnit'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'splrCode', |
| | |
| | | editable: true, |
| | | }, |
| | | { |
| | | field: 'qrcode', |
| | | headerName: translate('table.field.asnOrderItem.qrcode'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | }, |
| | | { |
| | | field: 'barcode', |
| | | headerName: translate('table.field.asnOrderItem.barcode'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | }, |
| | | { |
| | | field: 'packName', |
| | | headerName: translate('table.field.asnOrderItem.packName'), |
| | | minWidth: 100, |
| | |
| | | editable: true, |
| | | }, |
| | | |
| | | ]; |
| | | ]) |
| | | |
| | | const requestSetBody = async (row) => { |
| | | if (asnId !== 0) { |
| | | const res = await request.post(`/asnOrderItem/update`, row); |
| | | let cdata = useRef([]); |
| | | |
| | | |
| | | useEffect(() => { |
| | | getDynamicFields(); |
| | | }, []); |
| | | |
| | | useEffect(() => { |
| | | cdata.current = tabelData |
| | | }, [tabelData]); |
| | | |
| | | |
| | | const getDynamicFields = async () => { |
| | | const { |
| | | data: { code, data, msg }, |
| | | } = await request.get("/fields/enable/list"); |
| | | if (code === 200) { |
| | | const cols = data.map(el => ({ |
| | | field: el.fields, |
| | | headerName: el.fieldsAlise, |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: el.unique |
| | | })) |
| | | setColumns([...columns, ...cols]) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | const handleDelete = (row) => { |
| | | const newData = _.filter(tabelData, (item) => item.matnrId !== row.matnrId); |
| | | const newData = _.filter(cdata.current, (item) => item.matnrId !== row.matnrId); |
| | | setTableData(newData); |
| | | }; |
| | | |
| | |
| | | ) |
| | | ); |
| | | |
| | | requestSetBody(newRow) |
| | | return newRow; |
| | | }; |
| | | |
| | |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | processRowUpdate={processRowUpdate} |
| | | autoPageSize |
| | | /> |
| | | </div> |
| | | ); |
| | |
| | | import request from '@/utils/request'; |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | | import { use } from "react"; |
| | | const AsnWareModal = (props) => { |
| | | const { open, setOpen, data, setData } = props; |
| | | |
| | |
| | | }); |
| | | |
| | | const [tableData, setTableData] = useState([]); |
| | | const [dyFields, setDyFields] = useState([]); |
| | | const [selectedRows, setSelectedRows] = useState([]); |
| | | |
| | | const handleChange = (e) => { |
| | |
| | | })); |
| | | }; |
| | | |
| | | const handleSubmit = () => { |
| | | const selectedData = selectedRows.map(id => tableData.find(row => row.id === id)); |
| | | const reset = () => { |
| | | setFormData({ |
| | | name: '', |
| | | code: '' |
| | | }) |
| | | } |
| | | |
| | | const handleSubmit = () => { |
| | | const hasarr = data.map(el => +el.matnrId) |
| | | const selectedData = selectedRows.filter(item => !hasarr.includes(item)).map(id => (tableData.find(row => row.id === id))); |
| | | const value = selectedData.map((el => { |
| | | const dynamicFields = dyFields.reduce((acc, item) => { |
| | | acc[item.fields] = el['extendFields']?.[item.fields] || ''; |
| | | return acc; |
| | | }, {}); |
| | | return { |
| | | matnrId: el.id, |
| | | maktx: el.name, |
| | | stockUnit: el.stockUnit || '', |
| | | purUnit: el.purchaseUnit || '', |
| | | ...dynamicFields |
| | | } |
| | | })) |
| | | setData(value); |
| | | setData([...data, ...value]); |
| | | setOpen(false); |
| | | // refresh(); |
| | | reset(); |
| | | }; |
| | | |
| | | const getData = async () => { |
| | | const res = await request.post(`/matnr/page`, { |
| | | ...formData, |
| | | pageSize: 199 |
| | | current: 1, |
| | | pageSize: 199, |
| | | orderBy: "create_time desc" |
| | | }); |
| | | if (res?.data?.code === 200) { |
| | | setTableData(res.data.data.records); |
| | |
| | | |
| | | useEffect(() => { |
| | | getData(); |
| | | }, []); |
| | | }, [open]); |
| | | |
| | | const handleSearch = () => { |
| | | getData() |
| | |
| | | </Stack> |
| | | </Box> |
| | | <Box sx={{ mt: 2, height: 400, width: '100%' }}> |
| | | <AsnWareModalTable tableData={tableData} setTableData={setTableData} |
| | | <AsnWareModalTable |
| | | tableData={tableData} |
| | | setTableData={setTableData} |
| | | dyFields={dyFields} |
| | | setDyFields={setDyFields} |
| | | selectedRows={selectedRows} |
| | | setSelectedRows={setSelectedRows} /> |
| | | setSelectedRows={setSelectedRows} |
| | | /> |
| | | </Box> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | |
| | | |
| | | export default AsnWareModal; |
| | | |
| | | const AsnWareModalTable = ({ tableData, setTableData, selectedRows, setSelectedRows }) => { |
| | | const AsnWareModalTable = ({ tableData, setTableData, selectedRows, setSelectedRows, dyFields, setDyFields }) => { |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | | const columns = [ |
| | | const [columns, setColumns] = useState([ |
| | | { field: 'id', headerName: 'ID', width: 100 }, |
| | | { field: 'name', headerName: translate('table.field.matnr.name'), width: 100 }, |
| | | { field: 'code', headerName: translate('table.field.matnr.code'), width: 100 }, |
| | | { field: 'spec', headerName: translate('table.field.matnr.spec'), width: 100 }, |
| | | { field: 'model', headerName: translate('table.field.matnr.model'), width: 100 }, |
| | | { field: 'weight', headerName: translate('table.field.matnr.weight'), width: 100 }, |
| | | { field: 'color', headerName: translate('table.field.matnr.color'), width: 100 }, |
| | | { field: 'size', headerName: translate('table.field.matnr.size'), width: 100 }, |
| | | |
| | | { field: 'describle', headerName: translate('table.field.matnr.describle'), width: 100 }, |
| | | { field: 'nromNum', headerName: translate('table.field.matnr.nromNum'), width: 100 }, |
| | | { field: 'unit', headerName: translate('table.field.matnr.unit'), width: 100 }, |
| | | { field: 'purchaseUnit', headerName: translate('table.field.matnr.purUnit'), width: 100 }, |
| | | { field: 'stockUnit', headerName: translate('table.field.matnr.stockUnit'), width: 100 }, |
| | | { field: 'stockLeval$', headerName: translate('table.field.matnr.stockLevel'), width: 100, sortable: false }, |
| | | ]; |
| | | ]) |
| | | |
| | | |
| | | |
| | | const handleSelectionChange = (ids) => { |
| | | setSelectedRows(ids) |
| | | |
| | | }; |
| | | |
| | | useEffect(() => { |
| | | getDynamicFields(); |
| | | }, []); |
| | | |
| | | const getDynamicFields = async () => { |
| | | const { |
| | | data: { code, data, msg }, |
| | | } = await request.get("/fields/enable/list"); |
| | | if (code === 200) { |
| | | const cols = data.map(el => ({ |
| | | field: el.fields, |
| | | headerName: el.fieldsAlise, |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: el.unique, |
| | | valueGetter: (value, row) => { |
| | | return row.extendFields?.[el.fields] || ''; |
| | | }, |
| | | })) |
| | | setDyFields(data) |
| | | setColumns([...columns, ...cols]) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <div style={{ height: 400, width: '100%' }}> |
| | |
| | | disableColumnMenu={true} |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | columnBufferPx={100} |
| | | /> |
| | | </div> |
| | | ); |
| | |
| | | }, |
| | | '& .RaDatagrid-rowCell': { |
| | | textAlign: 'left' |
| | | } |
| | | }, |
| | | '& .type .MuiTypography-root': { |
| | | whiteSpace: 'nowrap', |
| | | overflow: 'hidden', |
| | | textOverflow: 'ellipsis', |
| | | display: 'block', |
| | | width: '200px', |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | |
| | | <NumberField source="warehouseId$" label="table.field.loc.warehouseId" /> |
| | | <NumberField source="areaId$" label="table.field.loc.areaId" /> |
| | | <TextField source="code" label="table.field.loc.code" /> |
| | | <TextField source="typeIds$" label="table.field.loc.type" /> |
| | | <TextField source="typeIds$" label="table.field.loc.type" cellClassName="type" /> |
| | | {/* <TextField source="name" label="table.field.loc.name" /> */} |
| | | {/* <NumberField source="flagLogic" label="table.field.loc.flagLogic" /> |
| | | <TextField source="fucAtrrs" label="table.field.loc.fucAtrrs" /> |
New file |
| | |
| | | import { useState, useEffect } from 'react'; |
| | | import { |
| | | useTranslate, useNotify |
| | | } from 'react-admin'; |
| | | import request from '@/utils/request'; |
| | | import { Select, MenuItem, FormControl, InputLabel } from '@mui/material'; |
| | | |
| | | const DictSelect = (props) => { |
| | | const { dictTypeCode, label, value, onChange, ...params } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [list, setList] = useState([]); |
| | | |
| | | useEffect(() => { |
| | | http(); |
| | | }, [dictTypeCode]); |
| | | |
| | | const http = async () => { |
| | | const res = await request.post('/dictData/page', { dictTypeCode }); |
| | | if (res?.data?.code === 200) { |
| | | setList(res.data.data.records.map((item) => { |
| | | return { |
| | | value: item.value, |
| | | label: item.label |
| | | }; |
| | | })); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | }; |
| | | |
| | | const handleChange = (event) => { |
| | | const selectedValue = event.target.value; |
| | | if (onChange) { |
| | | onChange(event); |
| | | } |
| | | }; |
| | | |
| | | const validValue = list.some(item => item.value === value) ? value : ''; |
| | | |
| | | return ( |
| | | <FormControl fullWidth> |
| | | <InputLabel id="demo-select-small-label">{label}</InputLabel> |
| | | <Select |
| | | labelId="demo-select-small-label" |
| | | value={validValue} |
| | | onChange={handleChange} |
| | | size='small' |
| | | > |
| | | {list.map((item) => ( |
| | | <MenuItem key={item.value} value={item.value}> |
| | | {item.label} |
| | | </MenuItem> |
| | | ))} |
| | | </Select> |
| | | </FormControl> |
| | | ); |
| | | }; |
| | | |
| | | export default DictSelect; |
| | |
| | | <SelectInput |
| | | source={name} |
| | | choices={list} |
| | | |
| | | {...parmas} |
| | | /> |
| | | ); |
| | |
| | | private List<Long> typeIds; |
| | | |
| | | @ApiModelProperty("作业站点") |
| | | private List<String> sites; |
| | | private String sites; |
| | | |
| | | @ApiModelProperty("设备编号") |
| | | private String deviceCode; |
| | | |
| | | @ApiModelProperty("设备作业站点") |
| | | private List<String> deviceSites; |
| | | private String deviceSites; |
| | | |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.DeviceSiteParame; |
| | |
| | | throw new CoolException("初始化失败: 删除站点失败!!"); |
| | | } |
| | | } |
| | | if (Objects.isNull(param.getDeviceSites()) || param.getDeviceSites().isEmpty()) { |
| | | if (Objects.isNull(param.getDeviceSites()) || StringUtils.isBlank(param.getDeviceSites())) { |
| | | throw new CoolException("初始化失败: 设备作业站点不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getSites()) || param.getSites().isEmpty()) { |
| | | if (Objects.isNull(param.getSites()) || StringUtils.isBlank(param.getSites())) { |
| | | throw new CoolException("初始化失败: 作业站点不能为空!!"); |
| | | } |
| | | if (Objects.isNull(param.getTypeIds()) || param.getTypeIds().isEmpty()) { |
| | | throw new CoolException("初始化失败: 作业类型不能为空!!"); |
| | | } |
| | | List<String> sites = Arrays.asList(StringUtils.split(param.getSites(), ",")); |
| | | List<String> dvSites = Arrays.asList(StringUtils.split(param.getDeviceSites(), ",")); |
| | | List<DeviceSite> deviceSites = new ArrayList<>(); |
| | | for (String site : param.getSites()) { |
| | | for (String deviceSite : param.getDeviceSites()) { |
| | | for (String site : sites) { |
| | | for (String deviceSite : dvSites) { |
| | | for (Long id : param.getTypeIds()) { |
| | | DeviceSite site1 = new DeviceSite(); |
| | | site1.setType(id + "") |