skyouc
2025-03-22 660fac2458932a36b0c113861423afec9930dc1b
Merge branch 'front' of http://47.97.1.152:5880/r/wms-master into front
10个文件已修改
184 ■■■■ 已修改文件
rsf-admin/package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/pnpm-lock.yaml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/i18n/zh.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/InitModal.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/LocCreate.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/LocEdit.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/LocList.jsx 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx 130 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/package.json
@@ -21,6 +21,7 @@
    "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",
rsf-admin/pnpm-lock.yaml
@@ -41,6 +41,9 @@
      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
rsf-admin/src/i18n/zh.js
@@ -13,8 +13,8 @@
            id: 'ID',
            uuid: '编号',
            name: '名称',
            createTime: '添加时间',
            createBy: '添加人员',
            createTime: '创建时间',
            createBy: '创建人员',
            updateTime: '修改时间',
            updateBy: '修改人员',
            status: '状态',
@@ -122,11 +122,11 @@
        userLogin: '登录日志',
        customer: '客户表',
        shipper: '货主信息',
        matnr: '物料数据',
        matnr: '物料',
        matnrGroup: '物料分组',
        warehouse: '仓库信息',
        warehouseAreas: '仓库库区',
        loc: '基础库位',
        warehouse: '仓库',
        warehouseAreas: '库区',
        loc: '库位',
        locType: '库位类型',
        locArea: '逻辑分区',
        container: '容器管理',
rsf-admin/src/page/basicInfo/loc/InitModal.jsx
@@ -61,6 +61,7 @@
    const notify = useNotify();
    const [disabled, setDisabled] = useState(false)
    const [formData, setFormData] = useState({
        "warehouseId": null,
@@ -94,6 +95,7 @@
    };
    const handleSubmit = async () => {
        setDisabled(true)
        const res = await request.post(`/loc/init`, formData);
        if (res?.data?.code === 200) {
            setOpen(false);
@@ -101,6 +103,7 @@
        } else {
            notify(res.data.msg);
        }
        setDisabled(false)
    }
@@ -232,10 +235,11 @@
                </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>
rsf-admin/src/page/basicInfo/loc/LocCreate.jsx
@@ -154,7 +154,7 @@
                                        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}>
rsf-admin/src/page/basicInfo/loc/LocEdit.jsx
@@ -121,7 +121,7 @@
                                    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}>
rsf-admin/src/page/basicInfo/loc/LocList.jsx
@@ -54,6 +54,7 @@
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': {
@@ -67,6 +68,9 @@
    '& .opt': {
        width: 200
    },
    '& .RaDatagrid-headerCell': {
        textAlign: 'left'
    }
}));
const filters = [
@@ -140,6 +144,7 @@
            >
                <StyledDatagrid
                    preferenceKey='loc'
                    align="left"
                    bulkActionButtons={
                        <>
                            <BatchButton />
@@ -152,9 +157,9 @@
                >
                    <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" />
@@ -175,12 +180,12 @@
                    <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">
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
@@ -156,7 +156,6 @@
    const [columns, setColumns] = useState([]);
    const refresh = useRefresh();
    const { refetch } = useListContext();
    useEffect(() => {
        getDynamicFields();
@@ -360,6 +359,7 @@
const PrintButton = () => {
    const record = useRecordContext();
    const { resource, selectedIds } = useListContext();
    const notify = useNotify();
    const refresh = useRefresh();
@@ -374,6 +374,7 @@
            <PrintModal
                open={createDialog}
                setOpen={setCreateDialog}
                rows={selectedIds}
            />
        </>
rsf-admin/src/page/basicInfo/matnr/MatnrListAside.jsx
@@ -19,7 +19,7 @@
    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) => {
@@ -96,12 +96,12 @@
                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}
                />
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
@@ -53,8 +53,10 @@
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();
@@ -98,8 +100,76 @@
                </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 {
@@ -108,7 +178,7 @@
                        }
                    }`} </style>
                    <div ref={contentRef} className="print-content" style={{ textAlign: 'center', display: 'none' }}>
                        <PrintTemp />
                        <PrintTemp key={'bb'} rows={rows} />
                    </div>
                </Box>
            </DialogContent>
@@ -125,12 +195,39 @@
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) => (
@@ -159,10 +256,11 @@
                                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' }}>
@@ -183,7 +281,7 @@
                                    border: '1px solid black'
                                }}
                            >
                                {item.product}
                                {item.name}
                            </td>
                            <td
                                align="center"
@@ -197,7 +295,7 @@
                                colSpan={2}
                                style={{ border: '1px solid black' }}
                            >
                                {item.remark}
                                {item.memo}
                            </td>
                        </tr>
                    </tbody>