| | |
| | | code: "ASN单号", |
| | | poCode: "PO编码", |
| | | poId: "PO标识", |
| | | type: "单据类型", |
| | | type: "类型", |
| | | wkType: "业务类型", |
| | | anfme: "数量", |
| | | qty: "已完成数量", |
| | | qty: "完成数量", |
| | | logisNo: "物流单号", |
| | | arrTime: "预计到达时间", |
| | | rleStatus: "释放状态", |
| | | ntyStatus: "质检上报状态", |
| | | rleStatus: "状态", |
| | | ntyStatus: "上报状态", |
| | | }, |
| | | asnOrderItem: { |
| | | asnId: "主单标识", |
| | |
| | | import whMat from './basicInfo/whMat'; |
| | | import asnOrder from './asnOrder'; |
| | | import asnOrderItem from './asnOrderItem'; |
| | | import purchaseItem from './purchaseItem'; |
| | | // import purchaseItem from './purchaseItem'; |
| | | import purchase from './purchase'; |
| | | import fields from './fields'; |
| | | import fieldsItem from './fieldsItem'; |
| | |
| | | return asnOrderItem; |
| | | case 'asnOrderLog': |
| | | return asnOrderLog; |
| | | case 'purchaseItem': |
| | | return purchaseItem; |
| | | // case 'purchaseItem': |
| | | // return purchaseItem; |
| | | case 'purchase': |
| | | return purchase; |
| | | case 'fields': |
| | |
| | | rowClick={'edit'} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'rleStatus']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.asnOrderLog.code" /> |
| | |
| | | <DateField source="arrTime" label="table.field.asnOrderLog.arrTime" showTime /> |
| | | <TextField source="rleStatus$" label="table.field.asnOrderLog.rleStatus" sortable={false} /> |
| | | <TextField source="ntyStatus$" label="table.field.asnOrderLog.ntyStatus" sortable={false} /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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> |
| | | <TextField source="createBy$" label="common.field.createBy"/> |
| | | <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} /> |
| | |
| | | rowClick={'edit'} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'preArr', 'channel','startTime','workQty', 'endTime']} |
| | | > |
| | | <NumberField source="id" /> |
| | | {/* <MyField |
| | | source="code" |
| | | label="table.field.purchase.code" |
| | | onClick={(event, record, val) => { |
| | | event.stopPropagation(); |
| | | assign(record); |
| | | }} |
| | | /> */} |
| | | <TextField source="code" label="table.field.purchase.code" /> |
| | | <TextField source="type" label="table.field.purchase.type" /> |
| | | <TextField source="type$" label="table.field.purchase.type" /> |
| | | <TextField source="source" label="table.field.purchase.source" /> |
| | | <DateField source="preArr" label="table.field.purchase.preArr" showTime /> |
| | | <NumberField source="anfme" label="table.field.purchase.anfme" /> |
| | |
| | | <DateField source="startTime" label="table.field.purchase.startTime" showTime /> |
| | | <DateField source="endTime" label="table.field.purchase.endTime" showTime /> |
| | | <TextField source="project" label="table.field.purchase.project" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <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} /> |
| | |
| | | import MemoInput from "../../../components/MemoInput"; |
| | | |
| | | const DictDataCreate = (props) => { |
| | | const { open, setOpen, row } = props; |
| | | |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | |
| | | return ( |
| | | <> |
| | | <CreateBase |
| | | resource="dictData" |
| | | record={{}} |
| | | transform={(data) => { |
| | | return data; |
| | |
| | | <TextInput |
| | | label="table.field.dictData.dictTypeId" |
| | | source="dictTypeId" |
| | | defaultValue={record?.id} |
| | | parse={v => v} |
| | | autoFocus |
| | | readOnly |
| | | validate={required()} |
| | | defaultValue={row.dictTypeId} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | |
| | | label="table.field.dictData.dictTypeCode" |
| | | source="dictTypeCode" |
| | | parse={v => v} |
| | | readOnly |
| | | defaultValue={record?.code} |
| | | validate={required()} |
| | | defaultValue={row.dictTypeCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | |
| | | <TextInput |
| | | label="table.field.dictData.label" |
| | | validate={required()} |
| | | autoFocus |
| | | source="label" |
| | | parse={v => v} |
| | | /> |
| | |
| | | DeleteButton, |
| | | useNotify, |
| | | useRedirect, |
| | | useEditContext, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | |
| | | |
| | | const FormToolbar = () => { |
| | | const form = useFormContext(); |
| | | const { record, isPending } = useEditContext(); |
| | | const redirect = useRedirect(); |
| | | const notify = useNotify(); |
| | | const onSuccess = (data) => { |
| | | const { dictTypeId, dictTypeCode } = data |
| | | notify(`修改成功!`); |
| | | redirect(`/dictData?dictTypeId=${dictTypeId}&code=${dictTypeCode}`); |
| | | } |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton type="button" mutationOptions={{ onSuccess }} /> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton type="button" mutationOptions={{onSuccess:() => { |
| | | redirect('/dictType/' + record?.dictTypeId) |
| | | } }}/> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | |
| | | const DictDataEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | | resource="dictData" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar backPrevious={true} />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | |
| | | <TextInput |
| | | label="table.field.dictData.dictTypeId" |
| | | source="dictTypeId" |
| | | readOnly |
| | | parse={v => v} |
| | | autoFocus |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | |
| | | <TextInput |
| | | label="table.field.dictData.dictTypeCode" |
| | | source="dictTypeCode" |
| | | readOnly |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | useGetPathForRecord, |
| | | useGetOne, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import DictDataCreate from "./DictDataCreate"; |
| | | import DictDataPanel from "./DictDataPanel"; |
| | | import EmptyData from "../../../components/EmptyData"; |
| | | import MyCreateButton from "../../../components/MyCreateButton"; |
| | | import MyExportButton from '../../../components/MyExportButton'; |
| | | import PageDrawer from "../../../components/PageDrawer"; |
| | | import MyField from "../../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import CustomerTopToolBar from "../../../components/EditTopToolBar"; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="dictTypeId" label="table.field.dictData.dictTypeId" />, |
| | | <TextInput source="dictTypeCode" label="table.field.dictData.dictTypeCode" />, |
| | | <TextInput source="value" label="table.field.dictData.value" />, |
| | | <TextInput source="label" label="table.field.dictData.label" />, |
| | | <NumberInput source="sort" label="table.field.dictData.sort" />, |
| | | // <TextInput source="color" label="table.field.dictData.color" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const DictDataList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [fit, setFilters] = useState(filters); |
| | | const location = useLocation(); |
| | | const queryParams = new URLSearchParams(location.search); |
| | | const dictTypeId = queryParams.get('dictTypeId'); |
| | | const dictTypeCode = queryParams.get('code'); |
| | | |
| | | const dictId = useGetRecordId(); |
| | | const {data: dicts, isPending, error} = useGetOne('dictType', {id: dictId}); |
| | | |
| | | return ( |
| | | <> |
| | | {dictTypeId && <CustomerTopToolBar backPrevious={true} />} |
| | | <Box display="flex" > |
| | | |
| | | <List |
| | | resource="dictData" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | title={"menu.dictData"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | filter={dictTypeId ? { dictTypeId } : undefined} |
| | | filter={{ dictTypeId: dictId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='dictData' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | rowClick="edit" |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | <TextField source="value" label="table.field.dictData.value" /> |
| | | <TextField source="label" label="table.field.dictData.label" /> |
| | | <NumberField source="sort" label="table.field.dictData.sort" /> |
| | | {/* <TextField source="color" label="table.field.dictData.color" /> */} |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <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"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} redirect={"/dictType/" + dictId}/> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} redirect={"/dictType/" + dictId} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <DictDataCreate |
| | | open={createDialog} |
| | | record={dicts} |
| | | setOpen={setCreateDialog} |
| | | row={{ dictTypeId, dictTypeCode }} |
| | | /> |
| | | <PageDrawer |
| | | title='DictData Detail' |
| | |
| | | |
| | | const DictTypeCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | |
| | | import CustomerTopToolBar from "../../../components/EditTopToolBar"; |
| | | import MemoInput from "../../../components/MemoInput"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | import DictDataList from "../dictData/DictDataList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | |
| | | |
| | | const DictTypeEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | > |
| | | <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.dictType.code" |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictType.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictType.description" |
| | | source="description" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | |
| | | return ( |
| | | <> |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={14} md={10}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictType.code" |
| | | readOnly |
| | | source="code" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.dictType.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.dictType.description" |
| | | source="description" |
| | | parse={v => v} |
| | | /> |
| | | </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> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | </SimpleForm> |
| | | </Edit > |
| | | <DictDataList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | |
| | | |
| | | const DictTypeList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const navigate = useNavigate(); |
| | | const assign = (record) => { |
| | | navigate(`/dictData?dictTypeId=${record.id}&code=${record.code}`); |
| | | } |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | |
| | | /> |
| | | <TextField source="name" label="table.field.dictType.name" /> |
| | | <TextField source="description" label="table.field.dictType.description" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <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} /> |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.server.system.constant.DictTypeCode; |
| | | import com.vincent.rsf.server.system.entity.DictData; |
| | | import com.vincent.rsf.server.system.service.DictDataService; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getType$() { |
| | | if (Cools.isEmpty(this.type)) { |
| | | return ""; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_ORDER_TYPE) |
| | | .eq(DictData::getValue, this.type)); |
| | | if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) { |
| | | return null; |
| | | } |
| | | return dictDatas.getLabel(); |
| | | } |
| | | |
| | | public String getPreArr$(){ |
| | | if (Cools.isEmpty(this.preArr)){ |
| | | return ""; |