From 8f7e1bf264a5beaca1cf563452bc9ef72dea848f Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期三, 21 五月 2025 08:16:22 +0800 Subject: [PATCH] 修复取消组托,收货数量修改错误问题 --- rsf-admin/src/page/task/TaskList.jsx | 83 ++++++++++++++++++++++------------------- 1 files changed, 44 insertions(+), 39 deletions(-) diff --git a/rsf-admin/src/page/task/TaskList.jsx b/rsf-admin/src/page/task/TaskList.jsx index 1b85223..068a809 100644 --- a/rsf-admin/src/page/task/TaskList.jsx +++ b/rsf-admin/src/page/task/TaskList.jsx @@ -18,12 +18,14 @@ TextField, NumberField, DateField, + AutocompleteInput, BooleanField, TextInput, DateInput, SelectInput, NumberInput, Button, + EditButton, } from 'react-admin'; import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; import { styled } from '@mui/material/styles'; @@ -38,6 +40,7 @@ import CancelIcon from '@mui/icons-material/Cancel'; import PageDrawer from "../components/PageDrawer"; import MyField from "../components/MyField"; +import ConfirmButton from "../components/ConfirmButton"; import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; import * as Common from '@/utils/common'; @@ -55,40 +58,46 @@ }, })); -const filters = [ - <SearchInput source="condition" alwaysOn />, - <DateInput label='common.time.after' source="timeStart" />, - <DateInput label='common.time.before' source="timeEnd" />, - <TextInput source="taskCode" label="table.field.task.taskCode" />, - <NumberInput source="taskStatus" label="table.field.task.taskStatus" />, - <NumberInput source="taskType" label="table.field.task.taskType" />, - <TextInput source="orgLoc" label="table.field.task.orgLoc" />, - <TextInput source="orgSite" label="table.field.task.orgSite" />, - <TextInput source="targLoc" label="table.field.task.targLoc" />, - <TextInput source="targSite" label="table.field.task.targSite" />, - <TextInput source="barcode" label="table.field.task.barcode" />, - <TextInput source="robotCode" label="table.field.task.robotCode" />, - <NumberInput source="exceStatus" label="table.field.task.exceStatus" />, - <TextInput source="expDesc" label="table.field.task.expDesc" />, - <NumberInput source="sort" label="table.field.task.sort" />, - <TextInput source="expCode" label="table.field.task.expCode" />, - <DateInput source="startTime" label="table.field.task.startTime" />, - <DateInput source="endTime" label="table.field.task.endTime" />, - <TextInput label="common.field.memo" source="memo" />, - <SelectInput - label="common.field.status" - source="status" - choices={[ - { id: '1', name: 'common.enums.statusTrue' }, - { id: '0', name: 'common.enums.statusFalse' }, - ]} - resettable - />, -] const TaskList = (props) => { const translate = useTranslate(); const [drawerVal, setDrawerVal] = useState(false); + const dict = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_warehouse_type')) || []; + + const filters = [ + <SearchInput source="condition" alwaysOn />, + <DateInput label='common.time.after' source="timeStart" />, + <DateInput label='common.time.before' source="timeEnd" />, + <TextInput source="taskCode" label="table.field.task.taskCode" />, + <NumberInput source="taskStatus" label="table.field.task.taskStatus" />, + <NumberInput source="taskType" label="table.field.task.taskType" />, + <AutocompleteInput choices={dict} optionText='label' optionValue="value" source="warehType" label="table.field.task.warehType" />, + <TextInput source="orgLoc" label="table.field.task.orgLoc" />, + <TextInput source="orgSite" label="table.field.task.orgSite" />, + <TextInput source="targLoc" label="table.field.task.targLoc" />, + <TextInput source="targSite" label="table.field.task.targSite" />, + <TextInput source="barcode" label="table.field.task.barcode" />, + <TextInput source="robotCode" label="table.field.task.robotCode" />, + <NumberInput source="exceStatus" label="table.field.task.exceStatus" />, + <TextInput source="expDesc" label="table.field.task.expDesc" />, + <NumberInput source="sort" label="table.field.task.sort" />, + <TextInput source="expCode" label="table.field.task.expCode" />, + <DateInput source="startTime" label="table.field.task.startTime" />, + <DateInput source="endTime" label="table.field.task.endTime" />, + <TextInput label="common.field.memo" source="memo" />, + <SelectInput + label="common.field.status" + source="status" + choices={[ + { id: '1', name: 'common.enums.statusTrue' }, + { id: '0', name: 'common.enums.statusFalse' }, + ]} + resettable + />, + ] + + + return ( <Box display="flex"> <List @@ -121,7 +130,7 @@ <BulkDeleteButton mutationMode={OPERATE_MODE} /> </> } - rowClick={'edit'} + rowClick={false} expand={false} expandSingle={true} omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'sort']} @@ -130,6 +139,7 @@ <TextField source="taskCode" label="table.field.task.taskCode" /> <NumberField source="taskStatus$" label="table.field.task.taskStatus" /> <NumberField source="taskType$" label="table.field.task.taskType" /> + <NumberField source="warehType$" label="table.field.task.warehType" /> <TextField source="orgLoc" label="table.field.task.orgLoc" /> <TextField source="orgSite" label="table.field.task.orgSite" /> <TextField source="targLoc" label="table.field.task.targLoc" /> @@ -147,6 +157,7 @@ {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} <TextField source="memo" label="common.field.memo" sortable={false} /> <WrapperField cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} > + <EditButton label="toolbar.detail"/> <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton> <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> <SetTopButton sx={{ padding: '1px', fontSize: '.75rem' }} ></SetTopButton> @@ -174,13 +185,11 @@ const record = useRecordContext(); const notify = useNotify(); const refresh = useRefresh(); - const clickComplete = (event) => { - event.stopPropagation(); + const clickComplete = () => { completeTask(record) }; //瀹屾垚浠诲姟 const completeTask = async (row) => { - console.log(row.id); const { data: { code, data, msg } } = await request.post(`task/complete/` + row.id); if (code === 200) { notify(msg); @@ -190,11 +199,7 @@ } } return ( - <Button - onClick={clickComplete} - label="toolbar.complete"> - <TaskAltIcon /> - </Button> + record?.taskStatus < 98 ? (<ConfirmButton label={"toolbar.complete"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />) : (<></>) ) } -- Gitblit v1.9.1