Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
3个文件已添加
4 文件已重命名
20个文件已删除
25个文件已修改
| | |
| | | VITE_BASE_IP=192.168.4.24 |
| | | VITE_BASE_IP=127.0.0.1 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | fail: "Fail", |
| | | dataError: "Submit data was error, Please check", |
| | | }, |
| | | button: { |
| | | edit: "Edit", |
| | | }, |
| | | field: { |
| | | id: 'ID', |
| | | uuid: 'uuid', |
| | |
| | | fail: "服务器错误", |
| | | dataError: "数据错误,请仔细检查", |
| | | }, |
| | | button: { |
| | | edit: "编辑", |
| | | }, |
| | | field: { |
| | | id: 'ID', |
| | | uuid: '编号', |
| | |
| | | code: "ASN单号", |
| | | poCode: "PO编码", |
| | | poId: "PO标识", |
| | | type: "单据类型", |
| | | type: "类型", |
| | | wkType: "业务类型", |
| | | anfme: "数量", |
| | | qty: "已完成数量", |
| | | qty: "完成数量", |
| | | logisNo: "物流单号", |
| | | arrTime: "预计到达时间", |
| | | rleStatus: "释放状态", |
| | | ntyStatus: "质检上报状态", |
| | | rleStatus: "状态", |
| | | ntyStatus: "上报状态", |
| | | }, |
| | | asnOrderItem: { |
| | | asnId: "主单标识", |
| | |
| | | import qlyInspect from './qlyInspect'; |
| | | import qlyIsptItem from './qlyIsptItem'; |
| | | import dictType from './system/dicts/dictType'; |
| | | import dictData from './system/dicts/dictData'; |
| | | // import dictData from './system/dicts/dictData'; |
| | | import companys from './basicInfo/companys'; |
| | | import locType from './basicInfo/locType'; |
| | | import locArea from './basicInfo//locArea'; |
| | | import locAreaMatRela from './basicInfo/locAreaMatRela'; |
| | | import locAreaMat from './basicInfo/locAreaMat'; |
| | | import serialRuleItem from './system/serialRuleItem'; |
| | | // import serialRuleItem from './system/serialRuleItem'; |
| | | import serialRule from './system/serialRule'; |
| | | 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 qlyIsptItem; |
| | | case 'dictType': |
| | | return dictType; |
| | | case 'dictData': |
| | | return dictData; |
| | | // case 'dictData': |
| | | // return dictData; |
| | | case 'companys': |
| | | return companys; |
| | | case 'serialRuleItem': |
| | | return serialRuleItem; |
| | | // case 'serialRuleItem': |
| | | // return serialRuleItem; |
| | | case 'serialRule': |
| | | return serialRule; |
| | | case 'whMat': |
| | |
| | | return asnOrderItem; |
| | | case 'asnOrderLog': |
| | | return asnOrderLog; |
| | | case 'purchaseItem': |
| | | return purchaseItem; |
| | | // case 'purchaseItem': |
| | | // return purchaseItem; |
| | | case 'purchase': |
| | | return purchase; |
| | | case 'fields': |
| | |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | </Grid> |
| | | <AsnOrderItemLogList /> |
| | | {/* <AsnOrderItemLogList /> */} |
| | | </> |
| | | ) |
| | | } |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.asnOrderLog.code" />, |
| | | <TextInput source="poCode" label="table.field.asnOrderLog.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrderLog.poId" />, |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderLog' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={false} |
| | | 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" /> |
| | | <TextField source="poCode" label="table.field.asnOrderLog.poCode" /> |
| | | <NumberField source="poId" label="table.field.asnOrderLog.poId" /> |
| | | <TextField source="type" label="table.field.asnOrderLog.type" /> |
| | | <TextField source="wkType" label="table.field.asnOrderLog.wkType" /> |
| | | <TextField source="type$" label="table.field.asnOrderLog.type" /> |
| | | <TextField source="wkType$" label="table.field.asnOrderLog.wkType" /> |
| | | <NumberField source="anfme" label="table.field.asnOrderLog.anfme" /> |
| | | <NumberField source="qty" label="table.field.asnOrderLog.qty" /> |
| | | <TextField source="logisNo" label="table.field.asnOrderLog.logisNo" /> |
| | | <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} /> |
| | |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import PurchaseItemList from "./PurchaseItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | |
| | | 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}> |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={18} md={10}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | {/* <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.code" |
| | | source="code" |
| | |
| | | autoFocus |
| | | /> |
| | | </Stack> */} |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.type" |
| | | source="type" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.source" |
| | | source="source" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.type" |
| | | source="type$" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.source" |
| | | source="source" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <DateInput |
| | | label="table.field.purchase.preArr" |
| | | source="preArr" |
| | | /> |
| | | <NumberInput |
| | | label="table.field.purchase.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchase.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.purchase.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.channel" |
| | | source="channel" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.platCode" |
| | | source="platCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.purchase.preArr" |
| | | source="preArr" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchase.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchase.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.purchase.workQty" |
| | | source="workQty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.channel" |
| | | source="channel" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.platCode" |
| | | source="platCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.purchase.startTime" |
| | | source="startTime" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.purchase.endTime" |
| | | source="endTime" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.purchase.project" |
| | | source="project" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | |
| | | label="table.field.purchase.startTime" |
| | | source="startTime" |
| | | /> |
| | | <DateInput |
| | | label="table.field.purchase.endTime" |
| | | source="endTime" |
| | | /> |
| | | <TextInput |
| | | label="table.field.purchase.project" |
| | | source="project" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | <Grid item xs={6} md={2}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </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 > |
| | | <PurchaseItemList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
File was renamed from rsf-admin/src/page/purchaseItem/PurchaseItemList.jsx |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import PurchaseItemCreate from "./PurchaseItemCreate"; |
| | | import PurchaseItemPanel from "./PurchaseItemPanel"; |
| | | 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 }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | |
| | | const PurchaseItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const location = useLocation(); |
| | | const queryParams = new URLSearchParams(location.search); |
| | | const poId = queryParams.get("poId"); |
| | | const poId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <> |
| | | {poId && <CustomerTopToolBar backPrevious={true} />} |
| | | <Box display="flex"> |
| | | <List |
| | | resource="purchaseItem" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | title={"menu.purchaseItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | filter={{ purchaseId: poId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | |
| | | preferenceKey='purchaseItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | omit={['id', 'createTime','purchaseId', 'platItemId', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="purchaseId" label="table.field.purchaseItem.purchaseId" /> |
| | |
| | | <TextField source="splrName" label="table.field.purchaseItem.splrName" /> |
| | | <TextField source="splrCode" label="table.field.purchaseItem.splrCode" /> |
| | | <TextField source="splrBatch" label="table.field.purchaseItem.splrBatch" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" reference="user" /> |
| | | <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} /> |
| | |
| | | preferenceKey='purchase' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={'edit'} |
| | | expand={() => <PurchasePanel />} |
| | | 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="type" label="table.field.purchase.type" /> |
| | | <TextField source="code" label="table.field.purchase.code" /> |
| | | <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} /> |
| | |
| | | DeleteButton, |
| | | useNotify, |
| | | useRedirect, |
| | | useEditContext, |
| | | } 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"; |
| | |
| | | |
| | | 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} /> |
| | | <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' |
File was renamed from rsf-admin/src/page/system/dicts/dictData/DictDataCreate.jsx |
| | |
| | | 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} |
| | | /> |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | Form, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | useNotify, |
| | | useRedirect, |
| | | useEditContext, |
| | | EditBase, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import DialogCloseButton from "../../../components/DialogCloseButton"; |
| | | import EditBaseAside from "../../../components/EditBaseAside"; |
| | | import MemoInput from "../../../components/MemoInput"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | |
| | | const EditToolbar = () => { |
| | | const form = useFormContext(); |
| | | const { record, isPending } = useEditContext(); |
| | | const redirect = useRedirect(); |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton type="button" mutationOptions={{ |
| | | onSuccess: () => { |
| | | redirect('/dictType/' + record?.dictTypeId) |
| | | } |
| | | }} /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const DictDataEdit = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | return ( |
| | | <> |
| | | <Edit |
| | | id={record?.id} |
| | | resource="dictData" |
| | | mutationMode={EDIT_MODE} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <Form> |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <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.dictData.dictTypeId" |
| | | source="dictTypeId" |
| | | readOnly |
| | | defaultValue={record?.id} |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictData.dictTypeCode" |
| | | source="dictTypeCode" |
| | | defaultValue={record?.code} |
| | | readOnly |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictData.value" |
| | | source="value" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictData.label" |
| | | source="label" |
| | | validate={required()} |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.dictData.sort" |
| | | source="sort" |
| | | /> |
| | | </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> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > |
| | | <SaveButton type="button" mutationOptions={{ |
| | | onSuccess: () => { |
| | | setOpen(false) |
| | | } |
| | | }} /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </Dialog> |
| | | </Edit > |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default DictDataEdit; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate, useLocation } from 'react-router-dom'; |
| | | 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, |
| | | useGetRecordId, |
| | | useGetPathForRecord, |
| | | useGetOne, |
| | | Button, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import DictDataCreate from "./DictDataCreate"; |
| | | import EmptyData from "../../../components/EmptyData"; |
| | | import MyCreateButton from "../../../components/MyCreateButton"; |
| | | import MyExportButton from '../../../components/MyExportButton'; |
| | | import PageDrawer from "../../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import DictDataEdit from "./DictDataEdit"; |
| | | import { use } from "react"; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | 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" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const DictDataList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [editDialog, setEditDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [select, setSelect] = useState({}); |
| | | const dictId = useGetRecordId(); |
| | | const { data: dicts, isPending, error } = useGetOne('dictType', { id: dictId }); |
| | | |
| | | return ( |
| | | <> |
| | | <Box display="flex" > |
| | | <List |
| | | resource="dictData" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.dictData"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | filter={{ dictTypeId: dictId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='dictData' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource ,record)=> { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="dictTypeId" label="table.field.dictData.dictTypeId" /> |
| | | <TextField source="dictTypeCode" label="table.field.dictData.dictTypeCode" /> |
| | | <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="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <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' }} type="button" redirect={"/dictType/" + dictId} onClick={()=> { |
| | | setEditDialog(true) |
| | | }} /> */} |
| | | <Button onClick={()=>{setEditDialog(true)}}>编辑</Button> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode='pessimistic' redirect={"/dictType/" + dictId} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <DictDataEdit |
| | | open={editDialog} |
| | | record={select} |
| | | setOpen={setEditDialog} |
| | | /> |
| | | <DictDataCreate |
| | | open={createDialog} |
| | | record={dicts} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='DictData Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | export default DictDataList; |
| | |
| | | |
| | | 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 DictDataEdit from "./DictDataEdit"; |
| | | import DictDataList from "./DictDataList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | |
| | | |
| | | 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) => { }} |
| | | <> |
| | | <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.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> |
| | | |
| | | <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 /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import DictTypeCreate from "./DictTypeCreate"; |
| | | import DictTypePanel from "./DictTypePanel"; |
| | | 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'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.dictType.code" />, |
| | | <TextInput source="name" label="table.field.dictType.name" />, |
| | | <TextInput source="description" label="table.field.dictType.description" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | 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 |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='dictType' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | rowClick={'edit'} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <MyField source="code" label="table.field.dictType.code" |
| | | onClick={(event, record, val) => { |
| | | event.stopPropagation(); |
| | | assign(record); |
| | | }} |
| | | <TextField source="code" label="table.field.dictType.code" |
| | | // onClick={(event, record, val) => { |
| | | // event.stopPropagation(); |
| | | // assign(record); |
| | | // }} |
| | | /> |
| | | <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} /> |
| | |
| | | export default { |
| | | list: DictTypeList, |
| | | edit: DictTypeEdit, |
| | | show: ShowGuesser, |
| | | // show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.name}` |
| | | } |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | Form, |
| | | 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, Dialog, DialogContent, DialogTitle, DialogActions } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | 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 SerialRuleItemEdit = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | return ( |
| | | <Edit |
| | | id={record.id} |
| | | redirect="list" |
| | | resource="serialRuleItem" |
| | | mutationMode={EDIT_MODE} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <Form |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent> |
| | | <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}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.ruleId" |
| | | source="ruleId" |
| | | readOnly |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRuleItem.wkType" |
| | | source="wkType$" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRuleItem.feildValue" |
| | | source="feildValue" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.len" |
| | | source="len" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.lenStr" |
| | | source="lenStr" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.sort" |
| | | source="sort" |
| | | validate={required()} |
| | | /> |
| | | </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> |
| | | </DialogContent> |
| | | <DialogActions> |
| | | |
| | | </DialogActions> |
| | | </Form> |
| | | |
| | | </Dialog> |
| | | </Edit > |
| | | ) |
| | | } |
| | | |
| | | export default SerialRuleItemEdit; |
| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | Button, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | |
| | | } from "@/config/setting"; |
| | | import * as Common from "@/utils/common"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import SerialRuleItemEdit from "./SerialRuleItemEdit"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | "& .css-1vooibu-MuiSvgIcon-root": { |
| | |
| | | const SerialRuleItemList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [editDialog, setEditDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [select, setSelect] = useState({}); |
| | | const ruleId = useGetRecordId(); |
| | | |
| | | return ( |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.serialRuleItem"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ ruleId: ruleId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={false} |
| | | rowClick={(id, resource, record) => { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | source="sort" |
| | | label="table.field.serialRuleItem.sort" |
| | | /> |
| | | <ReferenceField |
| | | source="updateBy" |
| | | <TextField |
| | | source="updateBy$" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | <TextField |
| | | source="createBy$" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | |
| | | sortable={false} |
| | | /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: "1px", fontSize: ".75rem" }} /> |
| | | <Button onClick={() => { |
| | | setSelect(re) |
| | | setEditDialog(true) |
| | | }} label={'ra.action.edit'} |
| | | > </Button> |
| | | <DeleteButton |
| | | sx={{ padding: "1px", fontSize: ".75rem" }} |
| | | mutationMode={OPERATE_MODE} |
| | | redirect={'/serialRule/' + ruleId} |
| | | /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <SerialRuleItemCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <SerialRuleItemEdit open={editDialog} setOpen={setEditDialog} record={select} /> |
| | | <PageDrawer |
| | | title="SerialRuleItem Detail" |
| | | drawerVal={drawerVal} |
| | |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import SerialRuleCreate from "./SerialRuleCreate"; |
| | | import SerialRuleDetail from "./SerialRuleDetail"; |
| | | import SerialRulePanel from "./SerialRulePanel"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from "../../components/MyExportButton"; |
| | |
| | | <TextInput source="resetDep" label="table.field.serialRule.resetDep" />, |
| | | <TextInput source="currValue" label="table.field.serialRule.currValue" />, |
| | | <TextInput source="lastCode" label="table.field.serialRule.lastCode" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | label="table.field.serialRule.lastCode" |
| | | /> |
| | | |
| | | <ReferenceField |
| | | source="updateBy" |
| | | <TextField |
| | | source="updateBy$" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | <TextField |
| | | source="createBy$" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | |
| | | </StyledDatagrid> |
| | | </List> |
| | | <SerialRuleCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <SerialRuleDetail open={detailDialog} setOpen={setDetailDialog} /> |
| | | {/* <SerialRuleDetail open={detailDialog} setOpen={setDetailDialog} /> */} |
| | | <PageDrawer |
| | | title="SerialRule Detail" |
| | | drawerVal={drawerVal} |
| | |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <NumberInput source="taskItemId" label="table.field.taskItemLog.taskItemId" />, |
| | | <NumberInput source="taskId" label="table.field.taskItemLog.taskId" />, |
| | | <NumberInput source="orderId" label="table.field.taskItemLog.orderId" />, |
| | |
| | | preferenceKey='warehouseAreasItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'areaId', 'matnrId']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'areaId', 'matnrId', 'batch', 'shipperId', 'splrId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="areaId" label="table.field.warehouseAreasItem.areaId" /> |
| | | <TextField source="areaName" label="table.field.warehouseAreasItem.areaName" /> |
| | | <NumberField source="matnrId" label="table.field.warehouseAreasItem.matnrId" /> |
| | | <TextField source="matnrName" label="table.field.warehouseAreasItem.matnrName" /> |
| | | <TextField source="maktx" label="table.field.warehouseAreasItem.matnrName" /> |
| | | <TextField source="matnrCode" label="table.field.warehouseAreasItem.matnrCode" /> |
| | | <TextField source="trackCode" label="table.field.warehouseAreasItem.barcode" /> |
| | | <NumberField source="anfme" label="table.field.warehouseAreasItem.anfme" /> |
| | |
| | | <NumberField source="weight" label="table.field.warehouseAreasItem.weight" /> |
| | | <TextField source="prodTime" label="table.field.warehouseAreasItem.prodTime" /> |
| | | <TextField source="splrBtch" label="table.field.warehouseAreasItem.splrBtch" /> |
| | | |
| | | <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 org.apache.commons.lang3.StringUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | |
| | | } |
| | | |
| | | public static <T> Workbook create(List<T> list, Class<T> clz, boolean flagTemplate) { |
| | | HSSFWorkbook workbook = new HSSFWorkbook(); |
| | | XSSFWorkbook workbook = new XSSFWorkbook(); |
| | | Sheet sheet = workbook.createSheet(clz.getSimpleName()); |
| | | |
| | | Row header = sheet.createRow(0); |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.AsnOrderAndItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.BatchUpdateParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.entity.Matnr; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | |
| | | @PostMapping("/asnOrder/export") |
| | | @ApiOperation("导出") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(asnOrderService.list(), AsnOrder.class), response); |
| | | List<AsnOrder> orders = new ArrayList<>(); |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | orders = asnOrderService.list(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, map.get("ids")).eq(AsnOrder::getStatus, 1)); |
| | | } else { |
| | | orders = asnOrderService.list(new LambdaQueryWrapper<AsnOrder>().last("limit 1")); |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(orders, AsnOrder.class), response); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/asnOrderItem/export") |
| | | @ApiOperation("导出收货通知单明细") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | AsnOrderTemplate template = ExcelUtil.mockData(AsnOrderTemplate.class); |
| | | List<AsnOrderTemplate> list = new ArrayList<>(); |
| | | list.add(template); |
| | | ExcelUtil.build(ExcelUtil.create(list, AsnOrderTemplate.class, true), response); |
| | | // AsnOrderTemplate template = ExcelUtil.mockData(AsnOrderTemplate.class); |
| | | // List<AsnOrderTemplate> list = new ArrayList<>(); |
| | | // list.add(template); |
| | | List<AsnOrderItem> orderItems = new ArrayList<>(); |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getId, map.get("ids")).eq(AsnOrderItem::getStatus, 1)); |
| | | } else { |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().last("limit 1")); |
| | | } |
| | | |
| | | ExcelUtil.build(ExcelUtil.create(orderItems, AsnOrderItem.class, true), response); |
| | | } |
| | | |
| | | |
| | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getExceStatus$() { |
| | | if (Cools.isEmpty(this.exceStatus)){ |
| | | return ""; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>().eq(DictData::getDictTypeCode, DictTypeCode.DICT_ASN_EXCE_STATUS).eq(DictData::getValue, this.exceStatus)); |
| | | if (Objects.isNull(dictData)) { |
| | | return null; |
| | | } |
| | | return dictData.getLabel(); |
| | | } |
| | | |
| | | public String getType$(){ |
| | | if (Cools.isEmpty(this.type)){ |
| | | return ""; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>().eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_ORDER_TYPE).eq(DictData::getValue, this.type)); |
| | | if (Objects.isNull(dictData)) { |
| | | return null; |
| | | } |
| | | return dictData.getLabel(); |
| | | } |
| | | |
| | | public String getWkType$(){ |
| | | if (Cools.isEmpty(this.wkType)){ |
| | | return ""; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>().eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_BUSINESS_TYPE).eq(DictData::getValue, this.wkType)); |
| | | if (Objects.isNull(dictData)) { |
| | | return null; |
| | | } |
| | | return dictData.getLabel(); |
| | | } |
| | | |
| | | public String getArrTime$(){ |
| | | if (Cools.isEmpty(this.arrTime)){ |
| | | return ""; |
| | |
| | | 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 ""; |
| | |
| | | if (Objects.isNull(order)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | order.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val)); |
| | | |
| | | if (!this.updateById(order)) { |
| | | throw new CoolException("单据关闭失败!!"); |
| | | } |
| | | try { |
| | | operateOrderLogs(order); |
| | | } catch (Exception e) { |
| | |
| | | if (Objects.isNull(asrder) || Objects.isNull(asrder.getId())) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | asrder.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val)); |
| | | |
| | | if (!this.updateById(asrder)) { |
| | | throw new CoolException("单据关闭失败!!"); |
| | | } |
| | | List<AsnOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getAsnId, asrder.getId())); |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("收货明细为空!!"); |
| | | } |
| | | if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) { |
| | | throw new CoolException("收货数量不能为零!!"); |
| | | } |
| | |
| | | stock_unit, |
| | | pur_qty, |
| | | pur_unit, |
| | | prod_time, |
| | | qty, |
| | | splr_code, |
| | | splr_batch, |