#新增&修改
1. 删除货主管理
2. 删除客户管理
3.新增往来企业管理
4个文件已修改
10个文件已添加
8个文件已删除
2 文件已重命名
| | |
| | | qlyInspect: 'QlyInspect', |
| | | dictType: 'DictType', |
| | | dictData: 'DictData', |
| | | companys: 'Companys', |
| | | |
| | | |
| | | |
| | |
| | | sort: "sort", |
| | | color: "color", |
| | | }, |
| | | companys: { |
| | | code: "Code", |
| | | name: "Name", |
| | | nameEn: "NameEn", |
| | | breifCode: "BreifCode", |
| | | type: "Type", |
| | | contact: "Contact", |
| | | tel: "Tel", |
| | | email: "Email", |
| | | pcode: "PCode", |
| | | province: "Province", |
| | | city: "City", |
| | | address: "Address", |
| | | }, |
| | | } |
| | | }, |
| | | page: { |
| | |
| | | qlyInspect: '质检信息', |
| | | dictType: '数据字典', |
| | | dictData: '字典数据集', |
| | | |
| | | companys: '往来企业', |
| | | |
| | | |
| | | }, |
| | |
| | | sort: "排序", |
| | | color: "颜色", |
| | | }, |
| | | companys: { |
| | | code: "企业编码", |
| | | name: "名称", |
| | | nameEn: "英文别名", |
| | | breifCode: "助记码", |
| | | type: "类型", |
| | | contact: "联系人", |
| | | tel: "联系电话", |
| | | email: "电子邮件", |
| | | pcode: "邮编", |
| | | province: "省份", |
| | | city: "城市", |
| | | address: "地址", |
| | | }, |
| | | |
| | | } |
| | | }, |
| | | page: { |
| | |
| | | import menu from './system/menu' |
| | | import user from './system/user'; |
| | | import operationRecord from './system/operationRecord'; |
| | | import customer from './customer'; |
| | | import shipper from './basicInfo/shipper'; |
| | | import matnr from './basicInfo/matnr'; |
| | | import matnrGroup from './basicInfo/matnrGroup'; |
| | | import warehouse from './basicInfo/warehouse'; |
| | |
| | | import qlyInspect from './qlyInspect'; |
| | | import dictType from './dictType'; |
| | | import dictData from './dictData'; |
| | | import companys from './basicInfo/companys'; |
| | | |
| | | |
| | | const ResourceContent = (node) => { |
| | |
| | | return user; |
| | | case 'operationRecord': |
| | | return operationRecord; |
| | | case 'customer': |
| | | return customer; |
| | | case 'shipper': |
| | | return shipper; |
| | | case 'matnr': |
| | | return matnr; |
| | | case 'matnrGroup': |
| | |
| | | return dictType; |
| | | case 'dictData': |
| | | return dictData; |
| | | case 'companys': |
| | | return companys; |
| | | default: |
| | | return { |
| | | list: ListGuesser, |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | CreateBase, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SaveButton, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | Toolbar, |
| | | required, |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | | DialogActions, |
| | | DialogContent, |
| | | DialogTitle, |
| | | Stack, |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const CompanysCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | |
| | | const handleSuccess = async (data) => { |
| | | setOpen(false); |
| | | notify('common.response.success'); |
| | | }; |
| | | |
| | | const handleError = async (error) => { |
| | | notify(error.message || 'common.response.fail', { type: 'error', messageArgs: { _: error.message } }); |
| | | }; |
| | | |
| | | return ( |
| | | <> |
| | | <CreateBase |
| | | record={{}} |
| | | transform={(data) => { |
| | | return data; |
| | | }} |
| | | mutationOptions={{ onSuccess: handleSuccess, onError: handleError }} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" // 'xs' | 'sm' | 'md' | 'lg' | 'xl' |
| | | > |
| | | <Form> |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('create.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.nameEn" |
| | | source="nameEn" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.breifCode" |
| | | source="breifCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.type" |
| | | source="type" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.contact" |
| | | source="contact" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.tel" |
| | | source="tel" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.email" |
| | | source="email" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.pcode" |
| | | source="pcode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.province" |
| | | source="province" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.city" |
| | | source="city" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.companys.address" |
| | | source="address" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | | </Grid> |
| | | <Grid item xs={12} display="flex" gap={1}> |
| | | <Stack direction="column" spacing={1} width={'100%'}> |
| | | <MemoInput /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} > |
| | | <SaveButton /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </Dialog> |
| | | </CreateBase> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default CompanysCreate; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | 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 * 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"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const CompanysEdit = () => { |
| | | 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.companys.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.nameEn" |
| | | source="nameEn" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.breifCode" |
| | | source="breifCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.type" |
| | | source="type" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.contact" |
| | | source="contact" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.tel" |
| | | source="tel" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.email" |
| | | source="email" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.pcode" |
| | | source="pcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.province" |
| | | source="province" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.city" |
| | | source="city" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.companys.address" |
| | | source="address" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | |
| | | </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 > |
| | | ) |
| | | } |
| | | |
| | | export default CompanysEdit; |
File was renamed from rsf-admin/src/page/basicInfo/shipper/ShipperList.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import ShipperCreate from "./ShipperCreate"; |
| | | import ShipperPanel from "./ShipperPanel"; |
| | | import EmptyData from "@/page/components/EmptyData"; |
| | | import MyCreateButton from "@/page/components/MyCreateButton"; |
| | | import MyExportButton from '@/page/components/MyExportButton'; |
| | | import PageDrawer from "@/page/components/PageDrawer"; |
| | | import MyField from "@/page/components/MyField"; |
| | | import CompanysCreate from "./CompanysCreate"; |
| | | import CompanysPanel from "./CompanysPanel"; |
| | | 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'; |
| | | |
| | |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="uuid" label="table.field.shipper.uuid" />, |
| | | <TextInput source="name" label="table.field.shipper.name" />, |
| | | <TextInput source="code" label="table.field.companys.code" />, |
| | | <TextInput source="name" label="table.field.companys.name" />, |
| | | <TextInput source="nameEn" label="table.field.companys.nameEn" />, |
| | | <TextInput source="breifCode" label="table.field.companys.breifCode" />, |
| | | <TextInput source="type" label="table.field.companys.type" />, |
| | | <TextInput source="contact" label="table.field.companys.contact" />, |
| | | <TextInput source="tel" label="table.field.companys.tel" />, |
| | | <TextInput source="email" label="table.field.companys.email" />, |
| | | <TextInput source="pcode" label="table.field.companys.pcode" />, |
| | | <TextInput source="province" label="table.field.companys.province" />, |
| | | <TextInput source="city" label="table.field.companys.city" />, |
| | | <TextInput source="address" label="table.field.companys.address" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | |
| | | />, |
| | | ] |
| | | |
| | | const ShipperList = () => { |
| | | const CompanysList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.shipper"} |
| | | title={"menu.companys"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='shipper' /> |
| | | <SelectColumnsButton preferenceKey='companys' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='shipper' |
| | | preferenceKey='companys' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <ShipperPanel />} |
| | | expand={() => <CompanysPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="uuid" label="table.field.shipper.uuid" /> |
| | | <TextField source="name" label="table.field.shipper.name" /> |
| | | <TextField source="code" label="table.field.companys.code" /> |
| | | <TextField source="name" label="table.field.companys.name" /> |
| | | <TextField source="nameEn" label="table.field.companys.nameEn" /> |
| | | <TextField source="breifCode" label="table.field.companys.breifCode" /> |
| | | <TextField source="type" label="table.field.companys.type" /> |
| | | <TextField source="contact" label="table.field.companys.contact" /> |
| | | <TextField source="tel" label="table.field.companys.tel" /> |
| | | <TextField source="email" label="table.field.companys.email" /> |
| | | <TextField source="pcode" label="table.field.companys.pcode" /> |
| | | <TextField source="province" label="table.field.companys.province" /> |
| | | <TextField source="city" label="table.field.companys.city" /> |
| | | <TextField source="address" label="table.field.companys.address" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <ShipperCreate |
| | | <CompanysCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='Shipper Detail' |
| | | title='Companys Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | |
| | | ) |
| | | } |
| | | |
| | | export default ShipperList; |
| | | export default CompanysList; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material'; |
| | | import { |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | |
| | | const CompanysPanel = () => { |
| | | const record = useRecordContext(); |
| | | if (!record) return null; |
| | | const translate = useTranslate(); |
| | | return ( |
| | | <> |
| | | <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}> |
| | | <CardContent> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}> |
| | | <Typography variant="h6" gutterBottom align="left" sx={{ |
| | | maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' }, |
| | | whiteSpace: 'nowrap', |
| | | overflow: 'hidden', |
| | | textOverflow: 'ellipsis', |
| | | }}> |
| | | {Common.camelToPascalWithSpaces(translate('table.field.companys.name'))}: {record.name} |
| | | </Typography> |
| | | {/* inherit, primary, secondary, textPrimary, textSecondary, error */} |
| | | <Typography variant="h6" gutterBottom align="right" > |
| | | ID: {record.id} |
| | | </Typography> |
| | | </Grid> |
| | | </Grid> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={12} container alignContent="flex-end"> |
| | | <Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}> |
| | | {Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo} |
| | | </Typography> |
| | | </Grid> |
| | | </Grid> |
| | | <Box height={20}> </Box> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.code" |
| | | property={record.code} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.name" |
| | | property={record.name} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.nameEn" |
| | | property={record.nameEn} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.breifCode" |
| | | property={record.breifCode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.type" |
| | | property={record.type} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.contact" |
| | | property={record.contact} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.tel" |
| | | property={record.tel} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.email" |
| | | property={record.email} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.pcode" |
| | | property={record.pcode} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.province" |
| | | property={record.province} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.city" |
| | | property={record.city} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6}> |
| | | <PanelTypography |
| | | title="table.field.companys.address" |
| | | property={record.address} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | </CardContent> |
| | | </Card > |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default CompanysPanel; |
File was renamed from rsf-admin/src/page/basicInfo/shipper/index.jsx |
| | |
| | | ShowGuesser, |
| | | } from "react-admin"; |
| | | |
| | | import ShipperList from "./ShipperList"; |
| | | import ShipperEdit from "./ShipperEdit"; |
| | | import CompanysList from "./CompanysList"; |
| | | import CompanysEdit from "./CompanysEdit"; |
| | | |
| | | export default { |
| | | list: ShipperList, |
| | | edit: ShipperEdit, |
| | | list: CompanysList, |
| | | edit: CompanysEdit, |
| | | show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.name}` |
| | |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table="sys_dict_data"; |
| | | generator.table="man_companys"; |
| | | generator.tableDesc="字典数据集"; |
| | | generator.packagePath="com.vincent.rsf.server.system"; |
| | | generator.packagePath="com.vincent.rsf.server.manager"; |
| | | |
| | | generator.build(); |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class CompanysController extends BaseController { |
| | | |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:list')") |
| | | @PostMapping("/companys/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Companys, BaseParam> pageParam = new PageParam<>(baseParam, Companys.class); |
| | | return R.ok().add(companysService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:list')") |
| | | @PostMapping("/companys/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(companysService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:list')") |
| | | @PostMapping({"/companys/many/{ids}", "/companyss/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(companysService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:list')") |
| | | @GetMapping("/companys/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(companysService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:save')") |
| | | @OperationLog("Create 字典数据集") |
| | | @PostMapping("/companys/save") |
| | | public R save(@RequestBody Companys companys) { |
| | | companys.setCreateBy(getLoginUserId()); |
| | | companys.setCreateTime(new Date()); |
| | | companys.setUpdateBy(getLoginUserId()); |
| | | companys.setUpdateTime(new Date()); |
| | | if (!companysService.save(companys)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(companys); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:update')") |
| | | @OperationLog("Update 字典数据集") |
| | | @PostMapping("/companys/update") |
| | | public R update(@RequestBody Companys companys) { |
| | | companys.setUpdateBy(getLoginUserId()); |
| | | companys.setUpdateTime(new Date()); |
| | | if (!companysService.updateById(companys)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(companys); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:remove')") |
| | | @OperationLog("Delete 字典数据集") |
| | | @PostMapping("/companys/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!companysService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:list')") |
| | | @PostMapping("/companys/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<Companys> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(Companys::getName, condition); |
| | | } |
| | | companysService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getName())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:companys:list')") |
| | | @PostMapping("/companys/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(companysService.list(), Companys.class), response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_companys") |
| | | public class Companys implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | private String code; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value= "名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 英文别名 |
| | | */ |
| | | @ApiModelProperty(value= "英文别名") |
| | | private String nameEn; |
| | | |
| | | /** |
| | | * 助记码 |
| | | */ |
| | | @ApiModelProperty(value= "助记码") |
| | | private String breifCode; |
| | | |
| | | /** |
| | | * 帐号类型:shipper:货主,customer:客户,supplier:供应商 |
| | | */ |
| | | @ApiModelProperty(value= "帐号类型:shipper:货主,customer:客户,supplier:供应商") |
| | | private String type; |
| | | |
| | | /** |
| | | * 联系人 |
| | | */ |
| | | @ApiModelProperty(value= "联系人") |
| | | private String contact; |
| | | |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | @ApiModelProperty(value= "联系电话") |
| | | private String tel; |
| | | |
| | | /** |
| | | * 邮箱 |
| | | */ |
| | | @ApiModelProperty(value= "邮箱") |
| | | private String email; |
| | | |
| | | /** |
| | | * 邮件编码 |
| | | */ |
| | | @ApiModelProperty(value= "邮件编码") |
| | | private String pcode; |
| | | |
| | | /** |
| | | * 省份 |
| | | */ |
| | | @ApiModelProperty(value= "省份") |
| | | private String province; |
| | | |
| | | /** |
| | | * 城市 |
| | | */ |
| | | @ApiModelProperty(value= "城市") |
| | | private String city; |
| | | |
| | | /** |
| | | * 地址 |
| | | */ |
| | | @ApiModelProperty(value= "地址") |
| | | private String address; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 租户 |
| | | */ |
| | | @ApiModelProperty(value= "租户") |
| | | private Integer tenantId; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public Companys() {} |
| | | |
| | | public Companys(String code,String name,String nameEn,String breifCode,String type,String contact,String tel,String email,String pcode,String province,String city,String address,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.code = code; |
| | | this.name = name; |
| | | this.nameEn = nameEn; |
| | | this.breifCode = breifCode; |
| | | this.type = type; |
| | | this.contact = contact; |
| | | this.tel = tel; |
| | | this.email = email; |
| | | this.pcode = pcode; |
| | | this.province = province; |
| | | this.city = city; |
| | | this.address = address; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.tenantId = tenantId; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // Companys companys = new Companys( |
| | | // null, // 编号 |
| | | // null, // 名称 |
| | | // null, // 英文别名 |
| | | // null, // 助记码 |
| | | // null, // 帐号类型:shipper:货主,customer:客户,supplier:供应商[非空] |
| | | // null, // 联系人 |
| | | // null, // 联系电话 |
| | | // null, // 邮箱 |
| | | // null, // 邮件编码 |
| | | // null, // 省份 |
| | | // null, // 城市 |
| | | // null, // 地址 |
| | | // null, // 状态[非空] |
| | | // null, // 是否删除[非空] |
| | | // null, // 租户 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间[非空] |
| | | // null, // 修改人员 |
| | | // null, // 修改时间[非空] |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "冻结"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | |
| | | public Boolean getStatusBool(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return true; |
| | | case 0: |
| | | return false; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface CompanysMapper extends BaseMapper<Companys> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | |
| | | public interface CompanysService extends IService<Companys> { |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.vincent.rsf.server.manager.mapper.CompanysMapper; |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("companysService") |
| | | public class CompanysServiceImpl extends ServiceImpl<CompanysMapper, Companys> implements CompanysService { |
| | | |
| | | } |
New file |
| | |
| | | -- save companys record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.companys', '0', '/manager/companys', 'companys', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 字典数据集', '', '1', 'manager:companys:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 字典数据集', '', '1', 'manager:companys:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 字典数据集', '', '1', 'manager:companys:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 字典数据集', '', '1', 'manager:companys:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | companys: 'Companys', |
| | | |
| | | -- locale field |
| | | companys: { |
| | | code: "code", |
| | | name: "name", |
| | | nameEn: "nameEn", |
| | | breifCode: "breifCode", |
| | | type: "type", |
| | | contact: "contact", |
| | | tel: "tel", |
| | | email: "email", |
| | | pcode: "pcode", |
| | | province: "province", |
| | | city: "city", |
| | | address: "address", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | | import companys from './companys'; |
| | | |
| | | case 'companys': |
| | | return companys; |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.vincent.rsf.server.manager.mapper.CompanysMapper"> |
| | | |
| | | </mapper> |