Merge branch 'front' of http://47.97.1.152:5880/r/wms-master into front
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  |     "axios": "^1.7.4", | 
 |  |  |     "date-fns": "^3.6.0", | 
 |  |  |     "framer-motion": "^12.4.10", | 
 |  |  |     "jsbarcode": "^3.11.6", | 
 |  |  |     "lodash": "^4.17.21", | 
 |  |  |     "motion": "^12.4.1", | 
 |  |  |     "papaparse": "^5.4.1", | 
 
 |  |  | 
 |  |  |       framer-motion: | 
 |  |  |         specifier: ^12.4.10 | 
 |  |  |         version: 12.4.10(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) | 
 |  |  |       jsbarcode: | 
 |  |  |         specifier: ^3.11.6 | 
 |  |  |         version: 3.11.6 | 
 |  |  |       lodash: | 
 |  |  |         specifier: ^4.17.21 | 
 |  |  |         version: 4.17.21 | 
 
 |  |  | 
 |  |  |             id: 'ID', | 
 |  |  |             uuid: '编号', | 
 |  |  |             name: '名称', | 
 |  |  |             createTime: '添加时间', | 
 |  |  |             createBy: '添加人员', | 
 |  |  |             createTime: '创建时间', | 
 |  |  |             createBy: '创建人员', | 
 |  |  |             updateTime: '修改时间', | 
 |  |  |             updateBy: '修改人员', | 
 |  |  |             status: '状态', | 
 |  |  | 
 |  |  |         userLogin: '登录日志', | 
 |  |  |         customer: '客户表', | 
 |  |  |         shipper: '货主信息', | 
 |  |  |         matnr: '物料数据', | 
 |  |  |         matnr: '物料', | 
 |  |  |         matnrGroup: '物料分组', | 
 |  |  |         warehouse: '仓库信息', | 
 |  |  |         warehouseAreas: '仓库库区', | 
 |  |  |         loc: '基础库位', | 
 |  |  |         warehouse: '仓库', | 
 |  |  |         warehouseAreas: '库区', | 
 |  |  |         loc: '库位', | 
 |  |  |         locType: '库位类型', | 
 |  |  |         locArea: '逻辑分区', | 
 |  |  |         container: '容器管理', | 
 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const [disabled, setDisabled] = useState(false) | 
 |  |  |  | 
 |  |  |     const [formData, setFormData] = useState({ | 
 |  |  |         "warehouseId": null, | 
 |  |  | 
 |  |  |     }; | 
 |  |  |  | 
 |  |  |     const handleSubmit = async () => { | 
 |  |  |         setDisabled(true) | 
 |  |  |         const res = await request.post(`/loc/init`, formData); | 
 |  |  |         if (res?.data?.code === 200) { | 
 |  |  |             setOpen(false); | 
 |  |  | 
 |  |  |         } else { | 
 |  |  |             notify(res.data.msg); | 
 |  |  |         } | 
 |  |  |         setDisabled(false) | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |                 </DialogContent> | 
 |  |  |                 <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> | 
 |  |  |                     <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> | 
 |  |  |                         <Button type="submit" variant="contained" startIcon={<SaveIcon />}> | 
 |  |  |                         <Button disabled={disabled} type="submit" variant="contained" startIcon={<SaveIcon />} > | 
 |  |  |                             {translate('toolbar.confirm')} | 
 |  |  |                         </Button> | 
 |  |  |                     </Box> | 
 |  |  |  | 
 |  |  |                 </DialogActions> | 
 |  |  |             </Form> | 
 |  |  |         </Dialog> | 
 
 |  |  | 
 |  |  |                                         validate={[required()]} | 
 |  |  |                                     /> */} | 
 |  |  |                                     <ReferenceArrayInput source="typeIds" reference="locType" > | 
 |  |  |                                         <SelectArrayInput label="table.field.loc.type" /> | 
 |  |  |                                         <SelectArrayInput label="table.field.loc.type" validate={[required()]} /> | 
 |  |  |                                     </ReferenceArrayInput> | 
 |  |  |                                 </Grid> | 
 |  |  |                                 {/* <Grid item xs={6} display="flex" gap={1}> | 
 
 |  |  | 
 |  |  |                                     validate={[required()]} | 
 |  |  |                                 /> */} | 
 |  |  |                                 <ReferenceArrayInput source="typeIds" reference="locType" > | 
 |  |  |                                     <SelectArrayInput label="table.field.loc.type" /> | 
 |  |  |                                     <SelectArrayInput label="table.field.loc.type" validate={[required()]} /> | 
 |  |  |                                 </ReferenceArrayInput> | 
 |  |  |                             </Grid> | 
 |  |  |                             <Grid item xs={6} display="flex" gap={1}> | 
 
 |  |  | 
 |  |  | import EditIcon from '@mui/icons-material/Edit'; | 
 |  |  | import request from '@/utils/request'; | 
 |  |  | import DiscountIcon from '@mui/icons-material/Discount'; | 
 |  |  | import { textAlign } from "@mui/system"; | 
 |  |  |  | 
 |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
 |  |  |     '& .css-1vooibu-MuiSvgIcon-root': { | 
 |  |  | 
 |  |  |     '& .opt': { | 
 |  |  |         width: 200 | 
 |  |  |     }, | 
 |  |  |     '& .RaDatagrid-headerCell': { | 
 |  |  |         textAlign: 'left' | 
 |  |  |     } | 
 |  |  | })); | 
 |  |  |  | 
 |  |  | const filters = [ | 
 |  |  | 
 |  |  |             > | 
 |  |  |                 <StyledDatagrid | 
 |  |  |                     preferenceKey='loc' | 
 |  |  |                     align="left" | 
 |  |  |                     bulkActionButtons={ | 
 |  |  |                         <> | 
 |  |  |                             <BatchButton /> | 
 |  |  | 
 |  |  |                 > | 
 |  |  |                     <NumberField source="id" /> | 
 |  |  |                     <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" /> | 
 |  |  |                     <NumberField source="areaId$" label="table.field.loc.areaId" align="left" /> | 
 |  |  |                     <TextField source="code" label="table.field.loc.code" align="left" /> | 
 |  |  |                     <TextField source="typeIds$" label="table.field.loc.type" align="left" /> | 
 |  |  |                     {/* <TextField source="name" label="table.field.loc.name" /> */} | 
 |  |  |                     {/* <NumberField source="flagLogic" label="table.field.loc.flagLogic" /> | 
 |  |  |                     <TextField source="fucAtrrs" label="table.field.loc.fucAtrrs" /> | 
 |  |  | 
 |  |  |                     <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}> | 
 |  |  |                     <DateField source="updateTime" label="common.field.updateTime" showTime align="left" /> | 
 |  |  |                     <ReferenceField source="createBy" label="common.field.createBy" align="left" 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} /> | 
 |  |  |                     <DateField source="createTime" label="common.field.createTime" showTime align="left" /> | 
 |  |  |                     <BooleanField source="statusBool" label="common.field.status" sortable={false} align="left" /> | 
 |  |  |                     <TextField source="memo" label="common.field.memo" sortable={false} /> | 
 |  |  |  | 
 |  |  |                     <WrapperField cellClassName="opt" label="common.field.opt"> | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     const [columns, setColumns] = useState([]); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const { refetch } = useListContext(); | 
 |  |  |  | 
 |  |  |     useEffect(() => { | 
 |  |  |         getDynamicFields(); | 
 |  |  | 
 |  |  |  | 
 |  |  | const PrintButton = () => { | 
 |  |  |     const record = useRecordContext(); | 
 |  |  |     const { resource, selectedIds } = useListContext(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |  | 
 |  |  | 
 |  |  |             <PrintModal | 
 |  |  |                 open={createDialog} | 
 |  |  |                 setOpen={setCreateDialog} | 
 |  |  |                 rows={selectedIds} | 
 |  |  |             /> | 
 |  |  |         </> | 
 |  |  |  | 
 
 |  |  | 
 |  |  |     const { setFilters } = useListContext(); // 获取列表上下文 | 
 |  |  |     const [selectedOption, setSelectedOption] = useState(null); | 
 |  |  |     const [treeData, setTreeData] = useState([]); | 
 |  |  |     const [defaultIds, setDefaultIds] = useState(['29']); | 
 |  |  |     const [defaultIds, setDefaultIds] = useState(['65']); | 
 |  |  |     const [condition, setCondition] = useState(''); | 
 |  |  |  | 
 |  |  |     const haveChildren = (item) => { | 
 |  |  | 
 |  |  |                 border: theme.palette.mode === 'light' && '1px solid #e0e0e3', | 
 |  |  |                 width: 250, | 
 |  |  |                 minWidth: 150, | 
 |  |  |                 height: `calc(100% - 120px)`, | 
 |  |  |                 height: `100%`, | 
 |  |  |             }} | 
 |  |  |         > | 
 |  |  |             <CardContent> | 
 |  |  |                 <Input | 
 |  |  |                     placeholder="搜索物料分区" | 
 |  |  |                     placeholder="搜索物料分组" | 
 |  |  |                     sx={{ '--Input-focused': 1, marginBottom: '10px' }} | 
 |  |  |                     onChange={handleSearch} | 
 |  |  |                 /> | 
 
 |  |  | 
 |  |  | import StatusSelectInput from "../../components/StatusSelectInput"; | 
 |  |  |  | 
 |  |  | import { useReactToPrint } from "react-to-print"; | 
 |  |  | import jsbarcode from 'jsbarcode' | 
 |  |  | import { el } from "date-fns/locale"; | 
 |  |  |  | 
 |  |  | const PrintModal = ({ open, setOpen }) => { | 
 |  |  | const PrintModal = ({ open, setOpen, rows }) => { | 
 |  |  |     const refresh = useRefresh(); | 
 |  |  |     const translate = useTranslate(); | 
 |  |  |     const notify = useNotify(); | 
 |  |  | 
 |  |  |                 </FormControl> | 
 |  |  |  | 
 |  |  |                 <Box> | 
 |  |  |                     <div style={{ textAlign: 'center' }}> | 
 |  |  |                         <PrintTemp /> | 
 |  |  |                     <div style={{ textAlign: 'center', display: 'flex', justifyContent: 'center' }}> | 
 |  |  |                         <table | 
 |  |  |                             className="contain" | 
 |  |  |                             style={{ | 
 |  |  |                                 overflow: 'hidden', | 
 |  |  |                                 fontSize: 'small', | 
 |  |  |                                 tableLayout: 'fixed', | 
 |  |  |                                 width: '280px', | 
 |  |  |                                 borderCollapse: 'collapse', // 合并边框 | 
 |  |  |                                 border: '1px solid black' // 设置表格整体边框 | 
 |  |  |                             }} | 
 |  |  |                         > | 
 |  |  |                             <tbody> | 
 |  |  |                                 <tr style={{ height: '74px' }}> | 
 |  |  |                                     <td | 
 |  |  |                                         align="center" | 
 |  |  |                                         colSpan={3} | 
 |  |  |                                         style={{ border: '1px solid black' }} // 设置单元格边框 | 
 |  |  |                                     > | 
 |  |  |                                         商品编码 | 
 |  |  |                                     </td> | 
 |  |  |                                     <td | 
 |  |  |                                         align="center" | 
 |  |  |                                         className="barcode" | 
 |  |  |                                         colSpan={9} | 
 |  |  |                                         style={{ border: '1px solid black' }} | 
 |  |  |                                     > | 
 |  |  |                                         <img className="template-code" src={'/img/barcode.jpeg'} style={{ width: '90%' }} alt="Barcode" /> | 
 |  |  |                                         <div style={{ letterSpacing: '2px', marginTop: '1px', textAlign: 'center' }}> | 
 |  |  |                                             <span>{'xxxxxx'}</span> | 
 |  |  |                                         </div> | 
 |  |  |                                     </td> | 
 |  |  |                                 </tr> | 
 |  |  |                                 <tr style={{ height: '74px' }}> | 
 |  |  |                                     <td | 
 |  |  |                                         align="center" | 
 |  |  |                                         colSpan={3} | 
 |  |  |                                         style={{ border: '1px solid black' }} | 
 |  |  |                                     > | 
 |  |  |                                         商品 | 
 |  |  |                                     </td> | 
 |  |  |                                     <td | 
 |  |  |                                         align="center" | 
 |  |  |                                         colSpan={5} | 
 |  |  |                                         style={{ | 
 |  |  |                                             overflow: 'hidden', | 
 |  |  |                                             whiteSpace: 'nowrap', | 
 |  |  |                                             textOverflow: 'ellipsis', | 
 |  |  |                                             border: '1px solid black' | 
 |  |  |                                         }} | 
 |  |  |                                     > | 
 |  |  |                                         {'xxxxxxxx'} | 
 |  |  |                                     </td> | 
 |  |  |                                     <td | 
 |  |  |                                         align="center" | 
 |  |  |                                         colSpan={2} | 
 |  |  |                                         style={{ border: '1px solid black' }} | 
 |  |  |                                     > | 
 |  |  |                                         备注 | 
 |  |  |                                     </td> | 
 |  |  |                                     <td | 
 |  |  |                                         align="center" | 
 |  |  |                                         colSpan={2} | 
 |  |  |                                         style={{ border: '1px solid black' }} | 
 |  |  |                                     > | 
 |  |  |                                         {'xx'} | 
 |  |  |                                     </td> | 
 |  |  |                                 </tr> | 
 |  |  |                             </tbody> | 
 |  |  |                         </table> | 
 |  |  |                     </div> | 
 |  |  |                     <style>{` | 
 |  |  |                     @media print { | 
 |  |  | 
 |  |  |                         } | 
 |  |  |                     }`} </style> | 
 |  |  |                     <div ref={contentRef} className="print-content" style={{ textAlign: 'center', display: 'none' }}> | 
 |  |  |                         <PrintTemp /> | 
 |  |  |                         <PrintTemp key={'bb'} rows={rows} /> | 
 |  |  |                     </div> | 
 |  |  |                 </Box> | 
 |  |  |             </DialogContent> | 
 |  |  | 
 |  |  |  | 
 |  |  | export default PrintModal; | 
 |  |  |  | 
 |  |  | const PrintTemp = (props) => { | 
 |  |  |     const [data, setData] = useState([{ | 
 |  |  |         barcode: '/img/barcode.jpeg', | 
 |  |  |         product: 'xxxxxx-xx/xx', | 
 |  |  |         remark: 'xx' | 
 |  |  |     }]); | 
 |  |  | const PrintTemp = ({ rows }) => { | 
 |  |  |     const notify = useNotify(); | 
 |  |  |     const [data, setData] = useState([]); | 
 |  |  |     const http = async () => { | 
 |  |  |         const res = await request.post(`/matnrs/many/${rows?.join()}`); | 
 |  |  |         if (res?.data?.code === 200) { | 
 |  |  |             let val = res.data.data.map((el => { | 
 |  |  |                 return { | 
 |  |  |                     barcode: '/img/barcode.jpeg', | 
 |  |  |                     code: el.code, | 
 |  |  |                     name: el.name, | 
 |  |  |                     memo: el.memo | 
 |  |  |                 } | 
 |  |  |             })) | 
 |  |  |             setData(val) | 
 |  |  |             val.forEach((el) => { | 
 |  |  |                 jsbarcode(`#barcode${el.code}`, el.code, { height: 30 }); | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         } else { | 
 |  |  |             notify(res.data.msg); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     useEffect(() => { | 
 |  |  |         if (rows?.length > 0) { | 
 |  |  |             http(); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     }, [rows]); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     return ( | 
 |  |  |         <> | 
 |  |  |             {data.map((item, index) => ( | 
 |  |  | 
 |  |  |                                 colSpan={9} | 
 |  |  |                                 style={{ border: '1px solid black' }} | 
 |  |  |                             > | 
 |  |  |                                 <img className="template-code" src={item.barcode} style={{ width: '90%', verticalAlign: 'middle' }} alt="Barcode" /> | 
 |  |  |                                 <div style={{ letterSpacing: '2px', marginTop: '1px', textAlign: 'center' }}> | 
 |  |  |                                     <span>{'xxxxxx'}</span> | 
 |  |  |                                 </div> | 
 |  |  |                                 <img id={"barcode" + item.code} style={{ width: '70%', verticalAlign: 'middle' }} /> | 
 |  |  |                                 {/* <img className="template-code" src={item.barcode} style={{ width: '90%', verticalAlign: 'middle' }} alt="Barcode" /> */} | 
 |  |  |                                 {/* <div style={{ letterSpacing: '2px', marginTop: '1px', textAlign: 'center' }}> | 
 |  |  |                                     <span>{item.code}</span> | 
 |  |  |                                 </div> */} | 
 |  |  |                             </td> | 
 |  |  |                         </tr> | 
 |  |  |                         <tr style={{ height: '74px' }}> | 
 |  |  | 
 |  |  |                                     border: '1px solid black' | 
 |  |  |                                 }} | 
 |  |  |                             > | 
 |  |  |                                 {item.product} | 
 |  |  |                                 {item.name} | 
 |  |  |                             </td> | 
 |  |  |                             <td | 
 |  |  |                                 align="center" | 
 |  |  | 
 |  |  |                                 colSpan={2} | 
 |  |  |                                 style={{ border: '1px solid black' }} | 
 |  |  |                             > | 
 |  |  |                                 {item.remark} | 
 |  |  |                                 {item.memo} | 
 |  |  |                             </td> | 
 |  |  |                         </tr> | 
 |  |  |                     </tbody> |