Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
|  |  |  | 
|---|
|  |  |  | getSystemInfo().then((data) => { | 
|---|
|  |  |  | localStorage.setItem("system", JSON.stringify(data)); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | getSystemDicts().then(data => { | 
|---|
|  |  |  | localStorage.setItem('sys_dicts', JSON.stringify(data)); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, []); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | useTranslate, | 
|---|
|  |  |  | useLogin, | 
|---|
|  |  |  | localStorageStore, | 
|---|
|  |  |  | useNotify, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { getSystemDicts } from "@/api/auth"; | 
|---|
|  |  |  | import { useForm, Controller, useWatch, FormProvider, useFormContext } from "react-hook-form"; | 
|---|
|  |  |  | import ProviderChoices from "./ProviderChoices"; | 
|---|
|  |  |  | import Visibility from '@mui/icons-material/Visibility'; | 
|---|
|  |  |  | 
|---|
|  |  |  | const username = watch('username'); | 
|---|
|  |  |  | const password = watch('password'); | 
|---|
|  |  |  | const tenantId = watch('tenantId'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | useEffect(() => { | 
|---|
|  |  |  | if (tenantList.length > 0 && !tenantId) { | 
|---|
|  |  |  | const rememberTenantId = localStorage.getItem('remember_tenantId'); | 
|---|
|  |  |  | 
|---|
|  |  |  | }, [tenantList, setValue]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const onSubmit = (data) => { | 
|---|
|  |  |  | getSystemDicts().then(data => { | 
|---|
|  |  |  | localStorage.setItem('sys_dicts', JSON.stringify(data)); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | setLoading(true); | 
|---|
|  |  |  | login( | 
|---|
|  |  |  | data, | 
|---|
|  |  |  | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='purchase' | 
|---|
|  |  |  | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | rowClick={'edit'} | 
|---|
|  |  |  | expand={() => <PurchasePanel />} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo']} | 
|---|
|  |  |  | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | Edit, | 
|---|
|  |  |  | SimpleForm, | 
|---|
|  |  |  | FormDataConsumer, | 
|---|
|  |  |  | useTranslate, | 
|---|
|  |  |  | TextInput, | 
|---|
|  |  |  | NumberInput, | 
|---|
|  |  |  | BooleanInput, | 
|---|
|  |  |  | DateInput, | 
|---|
|  |  |  | SelectInput, | 
|---|
|  |  |  | ReferenceInput, | 
|---|
|  |  |  | ReferenceArrayInput, | 
|---|
|  |  |  | AutocompleteInput, | 
|---|
|  |  |  | SaveButton, | 
|---|
|  |  |  | Toolbar, | 
|---|
|  |  |  | Labeled, | 
|---|
|  |  |  | NumberField, | 
|---|
|  |  |  | required, | 
|---|
|  |  |  | useRecordContext, | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { useWatch, useFormContext } from "react-hook-form"; | 
|---|
|  |  |  | import { Stack, Grid, Box, Typography } from '@mui/material'; | 
|---|
|  |  |  | import { useWatch, useFormContext, useForm } from "react-hook-form"; | 
|---|
|  |  |  | import { Stack, Grid, Box, Typography, Card } from '@mui/material'; | 
|---|
|  |  |  | import * as Common from '@/utils/common'; | 
|---|
|  |  |  | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; | 
|---|
|  |  |  | import EditBaseAside from "../components/EditBaseAside"; | 
|---|
|  |  |  | import CustomerTopToolBar from "../components/EditTopToolBar"; | 
|---|
|  |  |  | import MemoInput from "../components/MemoInput"; | 
|---|
|  |  |  | import StatusSelectInput from "../components/StatusSelectInput"; | 
|---|
|  |  |  | import TaskItemList from "./TaskItemList"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const FormToolbar = () => { | 
|---|
|  |  |  | const { getValues } = useFormContext(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Toolbar sx={{ justifyContent: 'space-between' }}> | 
|---|
|  |  |  | <Toolbar sx={{ justifyContent: 'end' }}> | 
|---|
|  |  |  | <SaveButton /> | 
|---|
|  |  |  | <DeleteButton mutationMode="optimistic" /> | 
|---|
|  |  |  | {/* <DeleteButton mutationMode="optimistic" /> */} | 
|---|
|  |  |  | </Toolbar> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const TaskEdit = () => { | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Edit | 
|---|
|  |  |  | redirect="list" | 
|---|
|  |  |  | mutationMode={EDIT_MODE} | 
|---|
|  |  |  | actions={<CustomerTopToolBar />} | 
|---|
|  |  |  | aside={<EditBaseAside />} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <SimpleForm | 
|---|
|  |  |  | shouldUnregister | 
|---|
|  |  |  | warnWhenUnsavedChanges | 
|---|
|  |  |  | toolbar={<FormToolbar />} | 
|---|
|  |  |  | mode="onTouched" | 
|---|
|  |  |  | defaultValues={{}} | 
|---|
|  |  |  | // validate={(values) => { }} | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <Edit | 
|---|
|  |  |  | redirect="list" | 
|---|
|  |  |  | mutationMode={EDIT_MODE} | 
|---|
|  |  |  | actions={<CustomerTopToolBar />} | 
|---|
|  |  |  | aside={<EditBaseAside />} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> | 
|---|
|  |  |  | <Grid item xs={12} md={8}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom> | 
|---|
|  |  |  | {translate('common.edit.title.main')} | 
|---|
|  |  |  | </Typography> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.taskCode" | 
|---|
|  |  |  | source="taskCode" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | autoFocus | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.task.taskStatus" | 
|---|
|  |  |  | source="taskStatus" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.task.taskType" | 
|---|
|  |  |  | source="taskType" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.orgLoc" | 
|---|
|  |  |  | source="orgLoc" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.orgSite" | 
|---|
|  |  |  | source="orgSite" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.targLoc" | 
|---|
|  |  |  | source="targLoc" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.targSite" | 
|---|
|  |  |  | source="targSite" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.barcode" | 
|---|
|  |  |  | source="barcode" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.robotCode" | 
|---|
|  |  |  | source="robotCode" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.task.exceStatus" | 
|---|
|  |  |  | source="exceStatus" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.expDesc" | 
|---|
|  |  |  | source="expDesc" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.task.sort" | 
|---|
|  |  |  | source="sort" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.expCode" | 
|---|
|  |  |  | source="expCode" | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <DateInput | 
|---|
|  |  |  | label="table.field.task.startTime" | 
|---|
|  |  |  | source="startTime" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <DateInput | 
|---|
|  |  |  | label="table.field.task.endTime" | 
|---|
|  |  |  | source="endTime" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <SimpleForm | 
|---|
|  |  |  | shouldUnregister | 
|---|
|  |  |  | warnWhenUnsavedChanges | 
|---|
|  |  |  | toolbar={<FormToolbar />} | 
|---|
|  |  |  | mode="onTouched" | 
|---|
|  |  |  | defaultValues={{}} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> | 
|---|
|  |  |  | <Grid item xs={24} md={16}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom> | 
|---|
|  |  |  | {translate('common.edit.title.main')} | 
|---|
|  |  |  | </Typography> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.taskCode" | 
|---|
|  |  |  | source="taskCode" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | autoFocus | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.taskStatus" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | source="taskStatus$" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.taskType" | 
|---|
|  |  |  | source="taskType$" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.orgLoc" | 
|---|
|  |  |  | source="orgLoc" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.targLoc" | 
|---|
|  |  |  | source="targLoc" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.orgSite" | 
|---|
|  |  |  | source="orgSite" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | <Stack direction='row' gap={2}> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.targSite" | 
|---|
|  |  |  | source="targSite" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <TextInput | 
|---|
|  |  |  | label="table.field.task.barcode" | 
|---|
|  |  |  | source="barcode" | 
|---|
|  |  |  | readOnly | 
|---|
|  |  |  | parse={v => v} | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | <NumberInput | 
|---|
|  |  |  | label="table.field.task.sort" | 
|---|
|  |  |  | source="sort" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | </Stack> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | <Grid item xs={12} md={4}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom> | 
|---|
|  |  |  | {translate('common.edit.title.common')} | 
|---|
|  |  |  | </Typography> | 
|---|
|  |  |  | <StatusSelectInput /> | 
|---|
|  |  |  | <Box mt="2em" /> | 
|---|
|  |  |  | <MemoInput /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | </SimpleForm> | 
|---|
|  |  |  | </Edit > | 
|---|
|  |  |  | <Card sx={{ marginTop: '1em', }}> | 
|---|
|  |  |  | <Grid item xs={24} md={16} sx={{ margin: '1em' }}> | 
|---|
|  |  |  | <Typography variant="h6" gutterBottom > | 
|---|
|  |  |  | {translate('common.edit.title.common')} | 
|---|
|  |  |  | </Typography> | 
|---|
|  |  |  | <TaskItemList /> | 
|---|
|  |  |  | </Grid> | 
|---|
|  |  |  | </SimpleForm> | 
|---|
|  |  |  | </Edit > | 
|---|
|  |  |  | </Card> | 
|---|
|  |  |  | </> | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | useTranslate, | 
|---|
|  |  |  | useNotify, | 
|---|
|  |  |  | useRefresh, | 
|---|
|  |  |  | useDataProvider, | 
|---|
|  |  |  | useListContext, | 
|---|
|  |  |  | FunctionField, | 
|---|
|  |  |  | TextField, | 
|---|
|  |  |  | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | Button, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack } from '@mui/material'; | 
|---|
|  |  |  | import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import TaskCreate from "./TaskCreate"; | 
|---|
|  |  |  | import TaskPanel from "./TaskPanel"; | 
|---|
|  |  |  | 
|---|
|  |  |  | '& .column-name': { | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .opt': { | 
|---|
|  |  |  | width: 200 | 
|---|
|  |  |  | width: 248 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | })); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | <SearchInput source="condition" alwaysOn />, | 
|---|
|  |  |  | <DateInput label='common.time.after' source="timeStart" alwaysOn />, | 
|---|
|  |  |  | <DateInput label='common.time.before' source="timeEnd" 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" />, | 
|---|
|  |  |  | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  | const [drawerVal, setDrawerVal] = useState(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const [data, setData] = useState([]); | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <Box display="flex"> | 
|---|
|  |  |  | <List | 
|---|
|  |  |  | 
|---|
|  |  |  | actions={( | 
|---|
|  |  |  | <TopToolbar> | 
|---|
|  |  |  | <FilterButton /> | 
|---|
|  |  |  | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} | 
|---|
|  |  |  | <SelectColumnsButton preferenceKey='task' /> | 
|---|
|  |  |  | {/* <MyExportButton /> */} | 
|---|
|  |  |  | </TopToolbar> | 
|---|
|  |  |  | )} | 
|---|
|  |  |  | perPage={DEFAULT_PAGE_SIZE} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='task' | 
|---|
|  |  |  | // bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
|---|
|  |  |  | bulkActionButtons={ | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <BulkResortButton /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <BulkDeleteButton mutationMode={OPERATE_MODE} /> | 
|---|
|  |  |  | </> | 
|---|
|  |  |  | } | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | expand={() => <TaskPanel />} | 
|---|
|  |  |  | rowClick={'edit'} | 
|---|
|  |  |  | expand={false} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'sort']} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'sort']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <NumberField source="id" /> | 
|---|
|  |  |  | <TextField source="taskCode" label="table.field.task.taskCode" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextField source="expDesc" label="table.field.task.expDesc" /> | 
|---|
|  |  |  | <NumberField source="sort" label="table.field.task.sort" /> | 
|---|
|  |  |  | <TextField source="expCode" label="table.field.task.expCode" /> | 
|---|
|  |  |  | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | <TextField source="updateBy$" label="common.field.updateBy"/> | 
|---|
|  |  |  | <TextField source="createBy$" label="common.field.createBy"/> | 
|---|
|  |  |  | <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|---|
|  |  |  | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | <DateField source="createTime" label="common.field.createTime" showTime /> | 
|---|
|  |  |  | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> | 
|---|
|  |  |  | {/* <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"> | 
|---|
|  |  |  | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} | 
|---|
|  |  |  | <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton> | 
|---|
|  |  |  | <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> | 
|---|
|  |  |  | <SetTopButton sx={{ padding: '1px', fontSize: '.75rem' }} ></SetTopButton> | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default TaskList; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 完成操作 | 
|---|
|  |  |  | * @returns | 
|---|
|  |  |  | 
|---|
|  |  |  | import React, { useState, useRef, useEffect, useMemo } from "react"; | 
|---|
|  |  |  | import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material'; | 
|---|
|  |  |  | import { Box } from '@mui/material'; | 
|---|
|  |  |  | import { | 
|---|
|  |  |  | List, | 
|---|
|  |  |  | DatagridConfigurable, | 
|---|
|  |  |  | SearchInput, | 
|---|
|  |  |  | TopToolbar, | 
|---|
|  |  |  | SelectColumnsButton, | 
|---|
|  |  |  | EditButton, | 
|---|
|  |  |  | FilterButton, | 
|---|
|  |  |  | CreateButton, | 
|---|
|  |  |  | ExportButton, | 
|---|
|  |  |  | BulkDeleteButton, | 
|---|
|  |  |  | WrapperField, | 
|---|
|  |  |  | useRecordContext, | 
|---|
|  |  |  | useTranslate, | 
|---|
|  |  |  | useNotify, | 
|---|
|  |  |  | useListContext, | 
|---|
|  |  |  | FunctionField, | 
|---|
|  |  |  | TextField, | 
|---|
|  |  |  | NumberField, | 
|---|
|  |  |  | DateField, | 
|---|
|  |  |  | BooleanField, | 
|---|
|  |  |  | ReferenceField, | 
|---|
|  |  |  | TextInput, | 
|---|
|  |  |  | DateTimeInput, | 
|---|
|  |  |  | DateInput, | 
|---|
|  |  |  | SelectInput, | 
|---|
|  |  |  | NumberInput, | 
|---|
|  |  |  | ReferenceInput, | 
|---|
|  |  |  | ReferenceArrayInput, | 
|---|
|  |  |  | AutocompleteInput, | 
|---|
|  |  |  | DeleteButton, | 
|---|
|  |  |  | } from 'react-admin'; | 
|---|
|  |  |  | import { styled } from '@mui/material/styles'; | 
|---|
|  |  |  | import PageDrawer from "../components/PageDrawer"; | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | })); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | <SearchInput source="condition" alwaysOn />, | 
|---|
|  |  |  | <DateInput label='common.time.after' source="timeStart"  />, | 
|---|
|  |  |  | <DateInput label='common.time.before' source="timeEnd" />, | 
|---|
|  |  |  | <NumberInput source="taskId" label="table.field.taskItem.taskId" />, | 
|---|
|  |  |  | <NumberInput source="orderId" label="table.field.taskItem.orderId" />, | 
|---|
|  |  |  | <NumberInput source="orderType" label="table.field.taskItem.orderType" />, | 
|---|
|  |  |  | <NumberInput source="orderItemId" label="table.field.taskItem.orderItemId" />, | 
|---|
|  |  |  | <NumberInput source="matnrId" label="table.field.taskItem.matnrId" />, | 
|---|
|  |  |  | <TextInput source="maktx" label="table.field.taskItem.maktx" />, | 
|---|
|  |  |  | <TextInput source="matnrCode" label="table.field.taskItem.matnrCode" />, | 
|---|
|  |  |  | <TextInput source="unit" label="table.field.taskItem.unit" />, | 
|---|
|  |  |  | <NumberInput source="anfme" label="table.field.taskItem.anfme" />, | 
|---|
|  |  |  | <TextInput source="batch" label="table.field.taskItem.batch" />, | 
|---|
|  |  |  | <TextInput source="spec" label="table.field.taskItem.spec" />, | 
|---|
|  |  |  | <TextInput source="model" label="table.field.taskItem.model" />, | 
|---|
|  |  |  | <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 TaskPanel = () => { | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  | const translate = useTranslate(); | 
|---|
|  |  |  | const [createDialog, setCreateDialog] = useState(false); | 
|---|
|  |  |  | const [drawerVal, setDrawerVal] = useState(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | <> | 
|---|
|  |  |  | <Box display="flex"> | 
|---|
|  |  |  | <List | 
|---|
|  |  |  | <List resource="taskItem" | 
|---|
|  |  |  | sx={{ | 
|---|
|  |  |  | flexGrow: 1, | 
|---|
|  |  |  | transition: (theme) => | 
|---|
|  |  |  | 
|---|
|  |  |  | }), | 
|---|
|  |  |  | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | filter={{ taskId: record.id }} | 
|---|
|  |  |  | title={"menu.taskItem"} | 
|---|
|  |  |  | pagination={false} | 
|---|
|  |  |  | empty={false} | 
|---|
|  |  |  | filters={filters} | 
|---|
|  |  |  | sort={{ field: "create_time", order: "desc" }} | 
|---|
|  |  |  | actions={( | 
|---|
|  |  |  | <TopToolbar> | 
|---|
|  |  |  | <FilterButton /> | 
|---|
|  |  |  | </TopToolbar> | 
|---|
|  |  |  | )} | 
|---|
|  |  |  | perPage={DEFAULT_PAGE_SIZE} | 
|---|
|  |  |  | actions={false} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <StyledDatagrid | 
|---|
|  |  |  | preferenceKey='taskItem' | 
|---|
|  |  |  | bulkActionButtons={false} | 
|---|
|  |  |  | rowClick={(id, resource, record) => false} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | rowClick={false} | 
|---|
|  |  |  | expandSingle | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <NumberField source="id" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextField source="batch" label="table.field.taskItem.batch" /> | 
|---|
|  |  |  | <TextField source="spec" label="table.field.taskItem.spec" /> | 
|---|
|  |  |  | <TextField source="model" label="table.field.taskItem.model" /> | 
|---|
|  |  |  | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | <TextField source="updateBy$" label="common.field.updateBy"/> | 
|---|
|  |  |  | <TextField source="createBy$" label="common.field.createBy"/> | 
|---|
|  |  |  | <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|---|
|  |  |  | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | <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} /> | 
|---|
|  |  |  | </StyledDatagrid> | 
|---|
|  |  |  | </List> | 
|---|
|  |  |  | <PageDrawer | 
|---|
|  |  |  | title='TaskItem Detail' | 
|---|
|  |  |  | drawerVal={drawerVal} | 
|---|
|  |  |  | setDrawerVal={setDrawerVal} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | </PageDrawer> | 
|---|
|  |  |  | </Box> | 
|---|
|  |  |  | </> | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | 
|---|
|  |  |  | import TaskEdit from "./TaskEdit"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | list: TaskList, | 
|---|
|  |  |  | edit: TaskEdit, | 
|---|
|  |  |  | show: ShowGuesser, | 
|---|
|  |  |  | 
|---|
|  |  |  | import MyField from "../components/MyField"; | 
|---|
|  |  |  | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; | 
|---|
|  |  |  | import * as Common from '@/utils/common'; | 
|---|
|  |  |  | import MyCreateButton from "../components/MyCreateButton"; | 
|---|
|  |  |  | import TaskItemCreate from "../task/TaskItemCreate"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
|---|
|  |  |  | '& .css-1vooibu-MuiSvgIcon-root': { | 
|---|
|  |  |  | 
|---|
|  |  |  | actions={( | 
|---|
|  |  |  | <TopToolbar> | 
|---|
|  |  |  | <FilterButton /> | 
|---|
|  |  |  | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} | 
|---|
|  |  |  | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> | 
|---|
|  |  |  | <SelectColumnsButton preferenceKey='taskItem' /> | 
|---|
|  |  |  | {/* <MyExportButton /> */} | 
|---|
|  |  |  | </TopToolbar> | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextField source="batch" label="table.field.taskItem.batch" /> | 
|---|
|  |  |  | <TextField source="spec" label="table.field.taskItem.spec" /> | 
|---|
|  |  |  | <TextField source="model" label="table.field.taskItem.model" /> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> | 
|---|
|  |  |  | <TextField source="nickname" /> | 
|---|
|  |  |  | </ReferenceField> | 
|---|
|  |  |  | 
|---|
|  |  |  | <TextField source="memo" label="common.field.memo" sortable={false} /> | 
|---|
|  |  |  | </StyledDatagrid> | 
|---|
|  |  |  | </List> | 
|---|
|  |  |  | <TaskItemCreate | 
|---|
|  |  |  | open={createDialog} | 
|---|
|  |  |  | setOpen={setCreateDialog} /> | 
|---|
|  |  |  | <PageDrawer | 
|---|
|  |  |  | title='TaskItem Detail' | 
|---|
|  |  |  | drawerVal={drawerVal} | 
|---|
|  |  |  | 
|---|
|  |  |  | return mobileService.taskGetLocs(code); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("一键收货") | 
|---|
|  |  |  | @PostMapping("/complete/{id}") | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:asnOrder:update')") | 
|---|
|  |  |  | public R completeOrder(@PathVariable Long id) { | 
|---|
|  |  |  | if (Objects.isNull(id)) { | 
|---|
|  |  |  | return R.error("参数不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return mobileService.completeOrder(id, getLoginUserId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | R taskToStock(String code); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | R taskGetLocs(String code) throws Exception; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | R completeOrder(Long id, Long loginUserId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //            //日志表操作 | 
|---|
|  |  |  | //            operateOrderLogs(asnOrder); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | return R.ok("操作成功"); | 
|---|
|  |  |  | return R.ok(asnOrder); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public R completeOrder(Long id, Long loginUserId) { | 
|---|
|  |  |  | return  asnOrderMapper.completeOrder(id, loginUserId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取ReceiptDetlsDtos | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | driver-class-name: com.mysql.jdbc.Driver | 
|---|
|  |  |  | url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai | 
|---|
|  |  |  | #    username: root | 
|---|
|  |  |  | #    url: jdbc:mysql://localhost:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai | 
|---|
|  |  |  | #    url: jdbc:mysql://192.168.4.24:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai | 
|---|
|  |  |  | username: rsf | 
|---|
|  |  |  | password: 34821015 | 
|---|
|  |  |  | type: com.alibaba.druid.pool.DruidDataSource | 
|---|