From 668590b860e572990b357747f39810e955823caf Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 19 五月 2025 20:16:53 +0800
Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
---
rsf-admin/src/page/task/TaskList.jsx | 96 +++++++++++++++++++++++++++---------------------
1 files changed, 54 insertions(+), 42 deletions(-)
diff --git a/rsf-admin/src/page/task/TaskList.jsx b/rsf-admin/src/page/task/TaskList.jsx
index 087ce49..e482fe3 100644
--- a/rsf-admin/src/page/task/TaskList.jsx
+++ b/rsf-admin/src/page/task/TaskList.jsx
@@ -18,12 +18,12 @@
TextField,
NumberField,
DateField,
+ AutocompleteInput,
BooleanField,
TextInput,
DateInput,
SelectInput,
NumberInput,
-
Button,
} from 'react-admin';
import { Box, Typography, Card, Stack, Drawer } from '@mui/material';
@@ -56,40 +56,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
@@ -104,7 +110,7 @@
title={"menu.task"}
empty={false}
filters={filters}
- sort={{ field: "sort", order: "desc" }}
+ sort={{ field: "create_time", order: "desc" }}
actions={(
<TopToolbar>
<FilterButton />
@@ -131,6 +137,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.taskType" />
<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,7 +154,7 @@
<DateField source="createTime" label="common.field.createTime" showTime />
{/* <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">
+ <WrapperField cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} >
<DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton>
<CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
<SetTopButton sx={{ padding: '1px', fontSize: '.75rem' }} ></SetTopButton>
@@ -173,7 +180,7 @@
*/
const DoneButton = (props) => {
const record = useRecordContext();
- const notify = useNotify();
+ const notify = useNotify();
const refresh = useRefresh();
const clickComplete = (event) => {
event.stopPropagation();
@@ -207,11 +214,12 @@
const record = useRecordContext();
const notify = useNotify();
const refresh = useRefresh();
- const clickCancel = () => {
+ const clickCancel = (event) => {
+ event.stopPropagation();
cancleTask(record)
};
//鍙栨秷浠诲姟
- const cancleTask = async (row) => {
+ const cancleTask = async (row) => {
console.log(row);
const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id);
if (code === 200) {
@@ -222,11 +230,14 @@
}
}
return (
- <Button
- onClick={clickCancel}
- label="toolbar.cancel">
- <CancelIcon />
- </Button>
+ record.taskStatus === 1 ?
+ <Button
+ onClick={clickCancel}
+ label="toolbar.cancel">
+ <CancelIcon />
+ </Button>
+ :
+ <></>
)
}
/**
@@ -237,7 +248,8 @@
const record = useRecordContext();
const notify = useNotify();
const refresh = useRefresh();
- const clickTop = () => {
+ const clickTop = (event) => {
+ event.stopPropagation();
topTask(record)
};
//缃《浠诲姟
--
Gitblit v1.9.1