cl
2026-04-13 b3fb3db3341ea98dac914f62dc94e59fe37e6b3f
rsf-admin/src/page/task/TaskList.jsx
@@ -182,6 +182,7 @@
                    <WrapperField cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} >
                        <EditButton label="toolbar.detail" />
                        <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton>
                        <FullOutStockCompleteButton />
                        <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                        <CheckButton />
                        <PickButton />
@@ -190,7 +191,7 @@
                </StyledDatagrid>
            </List>
            <PageDrawer
                title='Task Detail'
                title={translate('toolbar.detail')}
                drawerVal={drawerVal}
                setDrawerVal={setDrawerVal}
            >
@@ -336,6 +337,57 @@
}
/**
 * 全版出库完结按钮(199状态)
 * @returns
 */
const FullOutStockCompleteButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const clickComplete = () => {
        completeFullOutStock(record)
    };
    //全版出库完结
    const completeFullOutStock = async (row) => {
        const { data: { code, data, msg } } = await request.post(`/task/complete/fullOutStock/` + row.id);
        if (code === 200) {
            notify(msg);
            refresh();
        } else {
            notify(msg);
        }
    }
    return (
        record?.taskStatus == 199 && record?.taskType == 101 ?
            <ConfirmButton
                label={"toolbar.complete"}
                color="primary"
                startIcon={<TaskAltIcon />}
                onConfirm={clickComplete}
            />
            : <></>
    )
}
/** 拣料/盘点出库:仅 RCS 执行中(<198)可取消;199、198 不可取消 */
const canCancelPickOrCheckOut = (record) => {
    if (record?.taskType != 103 && record?.taskType != 107) return false;
    const s = record.taskStatus;
    return s < 198;
};
/** 普通入出库、空板、移库等:创建态可取消;199 不可取消 */
const canCancelLegacy = (record) => {
    const t = record?.taskType;
    const s = record?.taskStatus;
    if (t != 1 && t != 101 && t != 10 && t != 11) return false;
    return s == 1 || s == 101;
};
/**
 * 取消按钮
 * @returns 
 */
@@ -356,8 +408,9 @@
            notify(msg);
        }
    }
    const showCancel = canCancelPickOrCheckOut(record) || canCancelLegacy(record);
    return (
        (record.taskStatus == 1 || record.taskStatus == 101 || record.taskStatus == 199) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 107 || record.taskType == 103 || record.taskType == 11) ?
        showCancel ?
            <ConfirmButton
                onConfirm={clickCancel}
                startIcon={<CancelIcon />}