#
zhou zhou
15 小时以前 5b7b608a6acd3a6178687372cdb6b74198e23376
#
3个文件已修改
53 ■■■■■ 已修改文件
rsf-admin/src/page/components/DictionarySelect.jsx 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/orders/preparation/PreparationOrderList.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/MatPreparationController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/src/page/components/DictionarySelect.jsx
@@ -9,21 +9,21 @@
import request from '@/utils/request';
const DictionarySelect = (props) => {
    const {
        dictTypeCode,
        name,
    const {
        dictTypeCode,
        name,
        group,
        multiple = false,
        multiple = false,
        perPage = 100,  // 默认每页显示100条数据
        page = 1,       // 默认第一页
        ...parmas
        ...parmas
    } = props;
    const translate = useTranslate();
    const notify = useNotify();
    const { watch } = useFormContext();
    const [list, setList] = useState([]);
    const [loading, setLoading] = useState(false);
    // 获取当前表单值
    const currentValue = watch(name);
@@ -34,13 +34,13 @@
    const http = async () => {
        setLoading(true);
        try {
            const res = await request.post('/dictData/page', {
            const res = await request.post('/dictData/page', {
                dictTypeCode,
                group,
                current: page,
                pageSize: perPage
            });
            if (res?.data?.code === 200) {
                setList(res.data.data.records.map((item) => {
                    return {
@@ -64,21 +64,37 @@
        if (!list || list.length === 0) {
            // 如果列表为空但当前有值,添加占位选项以避免警告
            if (currentValue !== undefined && currentValue !== null && currentValue !== '') {
                if (multiple && Array.isArray(currentValue)) {
                    return currentValue.map(v => ({ id: v, name: String(v) }));
                }
                return [{ id: currentValue, name: String(currentValue) }];
            }
            return [];
        }
        // 检查当前值是否在选项中
        const valueExists = list.some(item => String(item.id) === String(currentValue));
        // 如果当前值不在选项中,添加它(可能是加载延迟导致的)
        if (currentValue !== undefined && currentValue !== null && currentValue !== '' && !valueExists) {
            return [...list, { id: currentValue, name: String(currentValue) }];
        if (currentValue !== undefined && currentValue !== null && currentValue !== '') {
            if (multiple && Array.isArray(currentValue)) {
                let newChoices = [...list];
                currentValue.forEach(val => {
                    const exists = newChoices.some(item => String(item.id) === String(val));
                    if (!exists) {
                        newChoices.push({ id: val, name: String(val) });
                    }
                });
                return newChoices;
            } else {
                // 检查当前值是否在选项中
                const valueExists = list.some(item => String(item.id) === String(currentValue));
                // 如果当前值不在选项中,添加它(可能是加载延迟导致的)
                if (!valueExists) {
                    return [...list, { id: currentValue, name: String(currentValue) }];
                }
            }
        }
        return list;
    }, [list, currentValue]);
    }, [list, currentValue, multiple]);
    const InputComponent = multiple ? SelectArrayInput : SelectInput;
rsf-admin/src/page/orders/preparation/PreparationOrderList.jsx
@@ -224,7 +224,6 @@
        actions={(
          <TopToolbar>
            <FilterButton />
            <CreateByOrderButton setCreateDialog={setCreateDialog} />
            <MyCreateButton onClick={() => { setManualDialog(true); setmodalType(0) }} />
            <ColumnsButton storeKey='outStock' />
            <ImportButton value={'outStockItem'} />
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/MatPreparationController.java
@@ -115,7 +115,7 @@
    }
    @PreAuthorize("hasAuthority('manager:outStock:update')")
    @OperationLog("Update ;出库单据")
    @OperationLog("Update 出库单据")
    @PostMapping("/preparation/update")
    @ApiOperation("更新")
    public R update(@RequestBody WkOrder wkOrder) {