skyouc
2025-03-26 1f5173508a63509985b27d94660f6ad251d18e6e
Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
11个文件已修改
286 ■■■■■ 已修改文件
rsf-admin/src/i18n/en.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/i18n/zh.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/asnOrder/AsnOrderList.jsx 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/BatchModal.jsx 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/LocList.jsx 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/loc/LocListAside.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/locAreaMat/LocAreaMatPanel.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/i18n/en.js
@@ -653,6 +653,8 @@
        batchMix: 'batchFiexed',
        batchWarehouse: 'batchWarehouse',
        batchStockLevel: "batchStockLevel",
        batchWarehouseAreas: "batchWarehouseAreas",
        batchLocType: "batchLocType",
    },
};
rsf-admin/src/i18n/zh.js
@@ -657,6 +657,8 @@
        batchStockLevel: "批量ABC分类",
        batchValidWarn: "批量预警",
        batchFlagCheck: "批量免检",
        batchWarehouseAreas: "批量库区",
        batchLocType: "批量库位类型",
    },
};
rsf-admin/src/page/asnOrder/AsnOrderList.jsx
@@ -111,29 +111,29 @@
  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 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>');
    // 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;">`);
    });
    // // 将图片插入到 iframe 中
    // imageUrls.forEach((imageUrl) => {
    //   iframeDoc.write(`<img src="${imageUrl}" style="margin: 10px;">`);
    // });
    iframeDoc.write('</body></html>');
    iframeDoc.close();
    // iframeDoc.write('</body></html>');
    // iframeDoc.close();
    // 等待图片加载完成后触发打印
    iframe.contentWindow.onload = () => {
      iframe.contentWindow.print();
      // 打印完成后移除 iframe
      document.body.removeChild(iframe);
    };
    // // 等待图片加载完成后触发打印
    // iframe.contentWindow.onload = () => {
    //   iframe.contentWindow.print();
    //   // 打印完成后移除 iframe
    //   document.body.removeChild(iframe);
    // };
  };
rsf-admin/src/page/basicInfo/loc/BatchModal.jsx
@@ -55,7 +55,7 @@
import StatusSelectInput from "../../components/StatusSelectInput";
const BatchModal = ({ open, setOpen }) => {
const BatchModal = ({ open, setOpen, fieldType }) => {
    const refresh = useRefresh();
    const translate = useTranslate();
@@ -128,48 +128,48 @@
    }
    return (
        <Dialog open={open} maxWidth="md" fullWidth>
        <Dialog open={open} maxWidth="xs" fullWidth>
            <Form onSubmit={handleSubmit}>
                <DialogCloseButton onClose={handleClose} />
                <DialogTitle>{translate('toolbar.batch')}</DialogTitle>
                <DialogContent sx={{ mt: 2 }}>
                    <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}>
                        <Grid container spacing={2}>
                            <Grid item xs={4}>
                                <ReferenceInput
                                    source="warehouseId"
                                    reference="warehouse"
                                >
                                    <AutocompleteInput
                                        label="table.field.loc.warehouseId"
                                        optionText="name"
                                        onChange={(value) => handleChange(value, 'warehouseId')}
                                        value={formData.warehouseId}
                                        filterToQuery={(val) => ({ name: val })}
                                    />
                                </ReferenceInput>
                            {fieldType === 'warehouseId' &&
                                <Grid item xs={6}>
                                    <ReferenceInput
                                        source="warehouseId"
                                        reference="warehouse"
                                    >
                                        <AutocompleteInput
                                            label="table.field.loc.warehouseId"
                                            optionText="name"
                                            value={formData.warehouseId}
                                            filterToQuery={(val) => ({ name: val })}
                                        />
                                    </ReferenceInput>
                                </Grid>
                            }
                            {fieldType === 'areaId' &&
                                <Grid item xs={6}>
                                    <ReferenceInput
                                        source="areaId"
                                        reference="warehouseAreas"
                                    >
                                        <AutocompleteInput
                                            label="table.field.loc.areaId"
                                            optionText="name"
                                            onChange={(value) => handleChange(value, 'areaId')}
                                            value={formData.areaId}
                                            filterToQuery={(val) => ({ name: val })}
                                        />
                                    </ReferenceInput>
                            </Grid>
                            <Grid item xs={4}>
                                <ReferenceInput
                                    source="areaId"
                                    reference="warehouseAreas"
                                    filter={{ warehouseId: formData.warehouseId }}
                                >
                                    <AutocompleteInput
                                        label="table.field.loc.areaId"
                                        optionText="name"
                                        onChange={(value) => handleChange(value, 'areaId')}
                                        value={formData.areaId}
                                        filterToQuery={(val) => ({ name: val })}
                                    />
                                </ReferenceInput>
                            </Grid>
                            <Grid item xs={4}>
                                {/* <DictionarySelect
                                </Grid>
                            }
                            {fieldType === 'typeIds' &&
                                <Grid item xs={6}>
                                    {/* <DictionarySelect
                                    label={translate("table.field.loc.type")}
                                    name="type"
                                    value={formData.type}
@@ -177,19 +177,21 @@
                                    size="small"
                                    dictTypeCode="sys_loc_type"
                                /> */}
                                <ReferenceArrayInput source="typeIds" reference="locType" >
                                    <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} />
                                </ReferenceArrayInput>
                            </Grid>
                                    <ReferenceArrayInput source="typeIds" reference="locType" >
                                        <SelectArrayInput label="table.field.loc.type" onChange={(e) => handleChange(e.target.value, 'typeIds')} />
                                    </ReferenceArrayInput>
                                </Grid>
                            }
                            <Grid item xs={4}>
                                <StatusSelectInput
                                    onChange={(e) => handleChange(e.target.value, 'status')}
                                    defaultValue={''}
                                    require={false}
                                />
                            </Grid>
                            {fieldType === 'status' &&
                                <Grid item xs={6}>
                                    <StatusSelectInput
                                        onChange={(e) => handleChange(e.target.value, 'status')}
                                        defaultValue={''}
                                        require={false}
                                    />
                                </Grid>
                            }
                        </Grid>
                    </Box>
rsf-admin/src/page/basicInfo/loc/LocList.jsx
@@ -85,7 +85,6 @@
        source="warehouseId"
        label="table.field.loc.warehouseId"
        reference="warehouse"
        alwaysOn
    >
        <AutocompleteInput
            label="table.field.loc.warehouseId"
@@ -97,7 +96,6 @@
        source="areaId"
        label="table.field.loc.areaId"
        reference="warehouseAreas"
        alwaysOn
    >
        <AutocompleteInput
            label="table.field.loc.areaId"
@@ -194,14 +192,16 @@
                    </TopToolbar>
                )}
                perPage={DEFAULT_PAGE_SIZE}
                aside={<LocListAside />}
            >
                <StyledDatagrid
                    preferenceKey='loc'
                    align="left"
                    bulkActionButtons={
                        <>
                            <BatchButton />
                            <BatchWateButton />
                            <BatchAreasButton />
                            <BatchLocTypeButton />
                            <BatchStatusButton />
                            <BindButton />
                            <SubzoneButton />
                            <BulkDeleteButton />
@@ -298,7 +298,7 @@
    )
}
const BatchButton = () => {
const BatchWateButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
@@ -306,16 +306,88 @@
    const [createDialog, setCreateDialog] = useState(false);
    return (
        <>
            <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}>
            <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouse"}>
                <EditIcon />
            </Button>
            <BatchModal
                open={createDialog}
                setOpen={setCreateDialog}
                fieldType={'warehouseId'}
            />
        </>
    )
}
const BatchAreasButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const [createDialog, setCreateDialog] = useState(false);
    return (
        <>
            <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchWarehouseAreas"}>
                <EditIcon />
            </Button>
            <BatchModal
                open={createDialog}
                setOpen={setCreateDialog}
                fieldType={'areaId'}
            />
        </>
    )
}
const BatchLocTypeButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const [createDialog, setCreateDialog] = useState(false);
    return (
        <>
            <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchLocType"}>
                <EditIcon />
            </Button>
            <BatchModal
                open={createDialog}
                setOpen={setCreateDialog}
                fieldType={'typeIds'}
            />
        </>
    )
}
const BatchStatusButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const [createDialog, setCreateDialog] = useState(false);
    return (
        <>
            <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchStatus"}>
                <EditIcon />
            </Button>
            <BatchModal
                open={createDialog}
                setOpen={setCreateDialog}
                fieldType={'status'}
            />
        </>
rsf-admin/src/page/basicInfo/loc/LocListAside.jsx
@@ -62,8 +62,15 @@
    }
    const handleNodeSelect = (event, nodeId) => {
        console.log(nodeId);
        // setFilters({ groupId: nodeId });
        const row = apiRef.current.getItem(nodeId);
        console.log(row);
        if (row.type === 'warehouseId') {
            // setFilters({ warehouseId: row.id ,areaId:''});
        } else if (row.type === 'areaId') {
            // setFilters({ areaId: row.id ,warehouseId:''});
        }
    };
    const handleSearch = (e) => {
        setCondition(e.target.value)
rsf-admin/src/page/basicInfo/locAreaMat/LocAreaMatPanel.jsx
@@ -252,8 +252,8 @@
            <RichTreeView
                expansionTrigger="iconContainer"
                checkboxSelection
                multiSelect
                // checkboxSelection
                // multiSelect
                items={matnrTree}
                apiRef={apiRef}
                getItemId={(item) => item.id}
@@ -388,17 +388,17 @@
            <RichTreeView
                expansionTrigger="iconContainer"
                checkboxSelection
                multiSelect
                items={locTree}
                apiRef={apiRef}
                selectedItems={selectedItems}
                getItemId={(item) => item.id}
                getItemLabel={(item) => item.name}
                defaultExpandedItems={['grid']}
                onSelectedItemsChange={handleSelectedItemsChange}
                onItemSelectionToggle={handleItemSelectionToggle}
                onItemClick={handleNodeSelect}
                onItemSelectionToggle={handleItemSelectionToggle}
                // checkboxSelection
                // multiSelect
                selectedItems={selectedItems}
                onSelectedItemsChange={handleSelectedItemsChange}
            />
            <BindLocModal
rsf-admin/src/page/basicInfo/matnr/MatnrCreate.jsx
@@ -285,7 +285,7 @@
                                            <Grid key={item.id} item xs={6} display="flex" gap={1}>
                                                <TextInput
                                                    label={item.fieldsAlise}
                                                    source={`extendFields.[${item.fields}]`}
                                                    source={item.fields}
                                                    validate={required()}
                                                />
                                            </Grid>
rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx
@@ -268,7 +268,7 @@
                                        <Grid key={item.id} item xs={6} display="flex" gap={1}>
                                            <TextInput
                                                label={item.fieldsAlise}
                                                source={`extendFields.[${item.fields}]`}
                                                source={item.fields}
                                                validate={required()}
                                            />
                                        </Grid>
rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx
@@ -211,7 +211,7 @@
                const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />)
                const opt = <WrapperField key="opt" cellClassName="fixed" className="fixed" label="common.field.opt">
                    <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
                    <EnableButton />
                    <PrintButton />
                </WrapperField>
                setColumns([...arr, ...fields, opt]);
@@ -247,7 +247,7 @@
                        <BatchStatusButton />
                        <BatchLevelButton />
                        <BindButton />
                        <PrintButton />
                        <BatchPrintButton />
                        <BulkDeleteButton mutationMode={OPERATE_MODE} />
                    </>}
                    rowClick={(id, resource, record) => false}
@@ -461,7 +461,7 @@
    )
}
const PrintButton = () => {
const BatchPrintButton = () => {
    const record = useRecordContext();
    const { resource, selectedIds } = useListContext();
    const notify = useNotify();
@@ -484,6 +484,29 @@
    )
}
const PrintButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const [createDialog, setCreateDialog] = useState(false);
    return (
        <>
            <Button color="secondary" onClick={() => setCreateDialog(true)} label={"toolbar.print"}>
                <PrintIcon />
            </Button>
            <PrintModal
                open={createDialog}
                setOpen={setCreateDialog}
                rows={[record]}
            />
        </>
    )
}
const BindButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
rsf-admin/src/page/basicInfo/matnr/PrintModal.jsx
@@ -241,7 +241,7 @@
                        overflow: 'hidden',
                        fontSize: 'small',
                        tableLayout: 'fixed',
                        width: '280px',
                        width: '520px',
                        borderCollapse: 'collapse',
                        borderSpacing: 0,
                        margin: '0 auto',