Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
3个文件已添加
3 文件已重命名
7个文件已删除
36个文件已修改
| | |
| | | |
| | | export const DEFAULT_THEME_NAME = 'rsf'; |
| | | |
| | | export const DEFAULT_THEME_MODE = 'dark'; |
| | | export const DEFAULT_THEME_MODE = 'light'; |
| | | |
| | | export const TOKEN_HEADER_NAME = 'Authorization'; |
| | | |
| | |
| | | close: "close", |
| | | asnCreate: "asnCreate", |
| | | createTask: "createTask", |
| | | recover: "recover", |
| | | }, |
| | | }; |
| | | |
| | |
| | | packName: "包装名称", |
| | | ntyStatus: "报检状态", |
| | | prodTime: "生产日期", |
| | | platItemId: 'PO行号' |
| | | platItemId: 'PO单号' |
| | | }, |
| | | asnOrderLog: { |
| | | code: "编码", |
| | |
| | | fields: { |
| | | fields: "字段", |
| | | fieldsAlise: "字段别名", |
| | | unique: "索引字段", |
| | | unique: "是否必填", |
| | | flagEnable: "启用", |
| | | }, |
| | | fieldsItem: { |
| | |
| | | close: "关闭", |
| | | asnCreate: "通过ASN创建", |
| | | createTask: "生成任务", |
| | | recover: "继续收货", |
| | | }, |
| | | }; |
| | | |
| | |
| | | import waitPakinLog from './waitPakinLog'; |
| | | import waitPakinItemLog from './waitPakinItemLog'; |
| | | import asnOrderLog from './asnOrderLog'; |
| | | import asnOrderItemLog from './asnOrderItemLog'; |
| | | // import asnOrderItemLog from './asnOrderItemLog'; |
| | | import task from './task'; |
| | | import taskItem from './taskItem'; |
| | | // import taskItem from './taskItem'; |
| | | import taskLog from './taskLog'; |
| | | import taskItemLog from './taskItemLog'; |
| | | // import taskItemLog from './taskItemLog'; |
| | | |
| | | |
| | | const ResourceContent = (node) => { |
| | |
| | | return asnOrderItem; |
| | | case 'asnOrderLog': |
| | | return asnOrderLog; |
| | | case 'asnOrderItemLog': |
| | | return asnOrderItemLog; |
| | | // case 'asnOrderItemLog': |
| | | // return asnOrderItemLog; |
| | | case 'purchaseItem': |
| | | return purchaseItem; |
| | | case 'purchase': |
| | |
| | | return waitPakinItemLog; |
| | | case 'task': |
| | | return task; |
| | | case 'taskItem': |
| | | return taskItem; |
| | | // case 'taskItem': |
| | | // return taskItem; |
| | | case 'taskLog': |
| | | return taskLog; |
| | | case 'taskItemLog': |
| | | return taskItemLog; |
| | | // case 'taskItemLog': |
| | | // return taskItemLog; |
| | | |
| | | default: |
| | | return { |
| | |
| | | const [formData, setFormData] = useState({ |
| | | type: '', |
| | | wkType: '', |
| | | poCode: '', |
| | | logisNo: '' |
| | | }); |
| | | |
| | | const [tabelData, setTableData] = useState([]); |
| | |
| | | setFormData({ |
| | | type: '', |
| | | wkType: '', |
| | | poCode: '', |
| | | logisNo: '' |
| | | }) |
| | | setTableData([]) |
| | | } |
| | |
| | | <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> |
| | | <Form> |
| | | <Grid container spacing={2}> |
| | | <Grid item md={4}> |
| | | <Grid item md={3}> |
| | | <DictSelect |
| | | label={translate("table.field.asnOrder.type")} |
| | | value={formData.type} |
| | |
| | | |
| | | </Grid> |
| | | |
| | | <Grid item md={4}> |
| | | <Grid item md={3}> |
| | | <DictSelect |
| | | label={translate("table.field.asnOrder.wkType")} |
| | | value={formData.wkType} |
| | | onChange={(e) => handleChange(e.target.value, 'wkType')} |
| | | dictTypeCode="sys_business_type" |
| | | required |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item md={3}> |
| | | <TextField |
| | | label={translate("table.field.asnOrder.poCode")} |
| | | value={formData.poCode} |
| | | onChange={(e) => handleChange(e.target.value, 'poCode')} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item md={3}> |
| | | <TextField |
| | | label={translate("table.field.asnOrder.logisNo")} |
| | | value={formData.logisNo} |
| | | onChange={(e) => handleChange(e.target.value, 'logisNo')} |
| | | /> |
| | | </Grid> |
| | | </Grid> |
| | |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | // preProcessEditCellProps: (params) => { |
| | | // const hasError = params.props.value.length !== ''; |
| | | // return { ...params.props, error: hasError }; |
| | | // }, |
| | | valueFormatter: (val) => val < 0 ? 0 : val |
| | | }, |
| | | { |
| | | field: 'splrCode', |
| | |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | processRowUpdate={processRowUpdate} |
| | | autoPageSize |
| | | initialState={{ |
| | | pagination: { |
| | | paginationModel: { |
| | | pageSize: 25, |
| | | }, |
| | | }, |
| | | }} |
| | | pageSizeOptions={[10, 25, 50, 100]} |
| | | editMode="row" |
| | | checkboxSelection |
| | | onRowSelectionModelChange={handleSelectionChange} |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | return ( |
| | | <Box sx={{ |
| | | position: 'relative', |
| | | padding: '5px 10px' |
| | | }}> |
| | | |
| | | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} size="small" /> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" sx={{ width: '300px' }} size="small" /> |
| | | |
| | | <div style={{ display: 'flex', gap: '10px' }}> |
| | | <PrintsButton rows={selectedRows} /> |
| | |
| | | disableColumnMenu={true} |
| | | disableColumnSorting |
| | | disableMultipleColumnsSorting |
| | | columnHeaderHeight={40} |
| | | rowHeight={42} |
| | | initialState={{ |
| | | pagination: { |
| | | paginationModel: { |
| | | pageSize: 10, |
| | | }, |
| | | }, |
| | | }} |
| | | pageSizeOptions={[10, 25, 50]} |
| | | /> |
| | | </Box > |
| | | |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } 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, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import EmptyData from "../components/EmptyData"; |
| | | 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': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <NumberInput source="asnId" label="table.field.asnOrderItemLog.asnId" />, |
| | | <TextInput source="asnCode" label="table.field.asnOrderItemLog.asnCode" />, |
| | | <TextInput source="platItemId" label="table.field.asnOrderItemLog.platItemId" />, |
| | | <NumberInput source="poDetlId" label="table.field.asnOrderItemLog.poDetlId" />, |
| | | <TextInput source="poCode" label="table.field.asnOrderItemLog.poCode" />, |
| | | <TextInput source="fieldsIndex" label="table.field.asnOrderItemLog.fieldsIndex" />, |
| | | <TextInput source="matnrId" label="table.field.asnOrderItemLog.matnrId" />, |
| | | <TextInput source="matnrCode" label="table.field.asnOrderItemLog.matnrCode" />, |
| | | <TextInput source="maktx" label="table.field.asnOrderItemLog.maktx" />, |
| | | <NumberInput source="anfme" label="table.field.asnOrderItemLog.anfme" />, |
| | | <TextInput source="stockUnit" label="table.field.asnOrderItemLog.stockUnit" />, |
| | | <NumberInput source="purQty" label="table.field.asnOrderItemLog.purQty" />, |
| | | <TextInput source="purUnit" label="table.field.asnOrderItemLog.purUnit" />, |
| | | <NumberInput source="qty" label="table.field.asnOrderItemLog.qty" />, |
| | | <TextInput source="splrCode" label="table.field.asnOrderItemLog.splrCode" />, |
| | | <TextInput source="splrBatch" label="table.field.asnOrderItemLog.splrBatch" />, |
| | | <TextInput source="splrName" label="table.field.asnOrderItemLog.splrName" />, |
| | | <TextInput source="qrcode" label="table.field.asnOrderItemLog.qrcode" />, |
| | | <TextInput source="trackCode" label="table.field.asnOrderItemLog.trackCode" />, |
| | | <TextInput source="barcode" label="table.field.asnOrderItemLog.barcode" />, |
| | | <TextInput source="packName" label="table.field.asnOrderItemLog.packName" />, |
| | | <SelectInput source="ntyStatus" label="table.field.asnOrderItemLog.ntyStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 未上报' }, |
| | | { id: 1, name: ' 已上报' }, |
| | | ]} |
| | | />, |
| | | |
| | | <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 AsnOrderItemLogList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const recodeId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="asnOrderItemLog" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.asnOrderItemLog"} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ logId: recodeId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='asnOrderItemLog' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderItemLog' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'asnId', 'poDetlId', 'poCode', 'qrcode', 'packName', 'createTime', 'memo', 'fieldsIndex', 'matnrId', 'splrCode', 'status', 'createBy$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.asnOrderItemLog.asnId" /> |
| | | <TextField source="asnCode" label="table.field.asnOrderItemLog.asnCode" /> |
| | | <TextField source="platItemId" label="table.field.asnOrderItemLog.platItemId" /> |
| | | <NumberField source="poDetlId" label="table.field.asnOrderItemLog.poDetlId" /> |
| | | <TextField source="poCode" label="table.field.asnOrderItemLog.poCode" /> |
| | | <TextField source="fieldsIndex" label="table.field.asnOrderItemLog.fieldsIndex" /> |
| | | <TextField source="matnrId" label="table.field.asnOrderItemLog.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.asnOrderItemLog.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.asnOrderItemLog.maktx" /> |
| | | <NumberField source="anfme" label="table.field.asnOrderItemLog.anfme" /> |
| | | <NumberField source="purQty" label="table.field.asnOrderItemLog.purQty" /> |
| | | <TextField source="purUnit" label="table.field.asnOrderItemLog.purUnit" /> |
| | | <NumberField source="qty" label="table.field.asnOrderItemLog.qty" /> |
| | | <TextField source="splrCode" label="table.field.asnOrderItemLog.splrCode" /> |
| | | <TextField source="splrBatch" label="table.field.asnOrderItemLog.splrBatch" /> |
| | | <TextField source="splrName" label="table.field.asnOrderItemLog.splrName" /> |
| | | <TextField source="qrcode" label="table.field.asnOrderItemLog.qrcode" /> |
| | | <TextField source="trackCode" label="table.field.asnOrderItemLog.trackCode" /> |
| | | <TextField source="packName" label="table.field.asnOrderItemLog.packName" /> |
| | | <TextField source="ntyStatus$" label="table.field.asnOrderItemLog.ntyStatus" sortable={false} /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PageDrawer |
| | | title='AsnOrderItemLog Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | | |
| | | export default AsnOrderItemLogList; |
| | |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import { Stack, Grid, Box, Typography, Card } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | |
| | | import AsnOrderItemLogList from "./AsnOrderItemLogList" |
| | | 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}> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.poCode" |
| | | source="poCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrderLog.poId" |
| | | source="poId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.type" |
| | | source="type" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.wkType" |
| | | source="wkType" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrderLog.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrderLog.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.logisNo" |
| | | source="logisNo" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.asnOrderLog.arrTime" |
| | | source="arrTime" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.asnOrderLog.rleStatus" |
| | | source="rleStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 正常' }, |
| | | { id: 1, name: ' 已释放' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.asnOrderLog.ntyStatus" |
| | | source="ntyStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 未上报' }, |
| | | { id: 1, name: ' 已上报' }, |
| | | { id: 2, name: ' 部分上报' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </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={24} md={12}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.code" |
| | | source="code" |
| | | parse={v => v} |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.poCode" |
| | | source="poCode" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.asnOrderLog.poId" |
| | | readOnly |
| | | source="poId" |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.type" |
| | | source="type" |
| | | readOnly |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.wkType" |
| | | source="wkType" |
| | | readOnly |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrderLog.anfme" |
| | | source="anfme" |
| | | readOnly |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.asnOrderLog.qty" |
| | | source="qty" |
| | | readOnly |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderLog.logisNo" |
| | | source="logisNo" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <DateInput |
| | | label="table.field.asnOrderLog.arrTime" |
| | | readOnly |
| | | source="arrTime" |
| | | /> |
| | | <SelectInput |
| | | label="table.field.asnOrderLog.ntyStatus" |
| | | source="ntyStatus" |
| | | readOnly |
| | | choices={[ |
| | | { id: 0, name: ' 未上报' }, |
| | | { id: 1, name: ' 已上报' }, |
| | | { id: 2, name: ' 部分上报' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </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 > |
| | | <Grid item xs={24} md={16} sx={{ marginTop: '1em' }}> |
| | | <Typography variant="h6" gutterBottom > |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | </Grid> |
| | | <AsnOrderItemLogList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | |
| | | |
| | | const AsnOrderLogList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='asnOrderLog' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderLog' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <AsnOrderLogPanel />} |
| | | rowClick={'edit'} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | |
| | | <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} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <AsnOrderLogCreate |
| | |
| | | label="table.field.fields.fields" |
| | | source="fields" |
| | | parse={v => v} |
| | | validate={required()} |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | |
| | | <TextInput |
| | | label="table.field.fields.fieldsAlise" |
| | | source="fieldsAlise" |
| | | validate={required()} |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | |
| | | label="table.field.fields.unique" |
| | | source="unique" |
| | | choices={[ |
| | | { id: 0, name: ' 非唯一' }, |
| | | { id: 1, name: ' 唯一' }, |
| | | { id: 0, name: ' 非必填' }, |
| | | { id: 1, name: ' 必填' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | |
| | | source="flagEnable" |
| | | choices={[ |
| | | { id: 0, name: ' 不启用' }, |
| | | { id: 1, name: ' 启用' }, |
| | | { id: 1, name: ' 启用' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | |
| | |
| | | source="fields" |
| | | parse={v => v} |
| | | autoFocus |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | |
| | | label="table.field.fields.fieldsAlise" |
| | | source="fieldsAlise" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | |
| | | label="table.field.fields.unique" |
| | | source="unique" |
| | | choices={[ |
| | | { id: 0, name: ' 非唯一' }, |
| | | { id: 1, name: ' 唯一' }, |
| | | { id: 0, name: ' 非必填' }, |
| | | { id: 1, name: ' 必填' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | |
| | | source="flagEnable" |
| | | choices={[ |
| | | { id: 0, name: ' 不启用' }, |
| | | { id: 1, name: ' 启用' }, |
| | | { id: 1, name: ' 启用' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="fields" label="table.field.fields.fields" />, |
| | | <TextInput source="fieldsAlise" label="table.field.fields.fieldsAlise" />, |
| | | <SelectInput source="unique" label="table.field.fields.unique" |
| | | choices={[ |
| | | { id: 0, name: ' 非唯一' }, |
| | | { id: 1, name: ' 唯一' }, |
| | | { id: 0, name: ' 非必填' }, |
| | | { id: 1, name: ' 必填' }, |
| | | ]} |
| | | />, |
| | | <SelectInput source="flagEnable" label="table.field.fields.flagEnable" |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='purchase' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | rowClick={'edit'} |
| | | expand={() => <PurchasePanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | |
| | | }; |
| | | |
| | | const [formData, setFormData] = useState({ |
| | | code: '' |
| | | asnCode: '' |
| | | }); |
| | | |
| | | const [tableData, setTableData] = useState([]); |
| | |
| | | |
| | | const reset = () => { |
| | | setFormData({ |
| | | code: '' |
| | | asnCode: '' |
| | | }) |
| | | } |
| | | |
| | |
| | | }; |
| | | |
| | | const getData = async () => { |
| | | const res = await request.post(`/qlyInspect/asn/list`, { |
| | | ...formData, |
| | | }); |
| | | const res = await request.post(`/qlyInspect/asn/list`, { asnCode: formData.asnCode }); |
| | | if (res?.data?.code === 200) { |
| | | setTableData(res.data.data); |
| | | } else { |
| | |
| | | <Grid item md={4}> |
| | | <TextField |
| | | label={translate('table.field.asnOrder.code')} |
| | | name="code" |
| | | value={formData.code} |
| | | name="asnCode" |
| | | value={formData.asnCode} |
| | | onChange={handleChange} |
| | | size="small" |
| | | /> |
| | |
| | | <Card sx={{ |
| | | ml: 1, |
| | | mr: 1, |
| | | height: '620px' |
| | | height: 'calc(100vh - 140px)', |
| | | overflowY: 'auto' |
| | | }}> |
| | | <CardContent sx={{ |
| | | overflow: 'auto', |
| | | height: '100%', |
| | | display: 'flex', |
| | | flexDirection: 'column', |
| | | justifyContent: 'space-between' |
| | |
| | | </Box> |
| | | |
| | | <Box sx={{ |
| | | height: 480, |
| | | minWidth: 290, |
| | | overflow: 'auto', |
| | | marginTop: '10px', |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <TextInput source="name" label="table.field.role.name" />, |
| | | <TextInput source="code" label="table.field.role.code" />, |
| | | |
| | |
| | | preferenceKey='role' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <RolePanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import SerialRuleItemList from "./SerialRuleItemList"; |
| | | |
| | | 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}> |
| | | <TextInput |
| | | label="table.field.serialRule.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.delimit" |
| | | source="delimit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.reset" |
| | | source="reset" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.resetDep" |
| | | source="resetDep" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.currValue" |
| | | source="currValue" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.lastCode" |
| | | source="lastCode" |
| | | 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={12} md={8}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.code" |
| | | source="code" |
| | | parse={v => v} |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.name" |
| | | source="name" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.delimit" |
| | | source="delimit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRule.reset" |
| | | source="reset" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.resetDep" |
| | | source="resetDep" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.currValue" |
| | | source="currValue" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.serialRule.lastCode" |
| | | source="lastCode" |
| | | 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> |
| | | <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 > |
| | | <SerialRuleItemList></SerialRuleItemList> |
| | | </> |
| | | ) |
| | | } |
| | | |
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 SerialRuleItemCreate = (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}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.ruleId" |
| | | source="ruleId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.serialRuleItem.wkType" |
| | | source="wkType" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.serialRuleItem.feildValue" |
| | | source="feildValue" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.len" |
| | | source="len" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.lenStr" |
| | | source="lenStr" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.sort" |
| | | source="sort" |
| | | validate={required()} |
| | | /> |
| | | </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 SerialRuleItemCreate; |
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, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import SerialRuleItemCreate from "./SerialRuleItemCreate"; |
| | | 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": { |
| | | height: ".9em", |
| | | }, |
| | | "& .RaDatagrid-row": { |
| | | cursor: "auto", |
| | | }, |
| | | "& .column-name": {}, |
| | | "& .opt": { |
| | | width: 200, |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label="common.time.after" source="timeStart" />, |
| | | <DateInput label="common.time.before" source="timeEnd" />, |
| | | |
| | | <NumberInput source="ruleId" label="table.field.serialRuleItem.ruleId" />, |
| | | <TextInput source="wkType" label="table.field.serialRuleItem.wkType" />, |
| | | <TextInput |
| | | source="feildValue" |
| | | label="table.field.serialRuleItem.feildValue" |
| | | />, |
| | | <NumberInput source="len" label="table.field.serialRuleItem.len" />, |
| | | <NumberInput source="lenStr" label="table.field.serialRuleItem.lenStr" />, |
| | | <NumberInput source="sort" label="table.field.serialRuleItem.sort" />, |
| | | |
| | | <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 SerialRuleItemList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const location = useLocation(); |
| | | const ruleId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <> |
| | | {ruleId && <CustomerTopToolBar backPrevious={true} />} |
| | | <Box display="flex"> |
| | | <List |
| | | resource="serialRuleItem" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(["all"], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.serialRuleItem"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | filters={filters} |
| | | filter={{ ruleId: ruleId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={ |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | <SelectColumnsButton preferenceKey="serialRuleItem" /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | } |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey="serialRuleItem" |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={false} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField |
| | | source="ruleId" |
| | | label="table.field.serialRuleItem.ruleId" |
| | | /> |
| | | <TextField |
| | | source="wkType$" |
| | | label="table.field.serialRuleItem.wkType" |
| | | /> |
| | | <TextField |
| | | source="feildValue" |
| | | label="table.field.serialRuleItem.feildValue" |
| | | /> |
| | | <NumberField source="len" label="table.field.serialRuleItem.len" /> |
| | | <NumberField |
| | | source="lenStr" |
| | | label="table.field.serialRuleItem.lenStr" |
| | | /> |
| | | <NumberField |
| | | source="sort" |
| | | label="table.field.serialRuleItem.sort" |
| | | /> |
| | | |
| | | <ReferenceField |
| | | 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" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | | showTime |
| | | /> |
| | | <BooleanField |
| | | source="statusBool" |
| | | label="common.field.status" |
| | | sortable={false} |
| | | /> |
| | | <TextField |
| | | source="memo" |
| | | label="common.field.memo" |
| | | sortable={false} |
| | | /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: "1px", fontSize: ".75rem" }} /> |
| | | <DeleteButton |
| | | sx={{ padding: "1px", fontSize: ".75rem" }} |
| | | mutationMode={OPERATE_MODE} |
| | | /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <SerialRuleItemCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <PageDrawer |
| | | title="SerialRuleItem Detail" |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | ></PageDrawer> |
| | | </Box> |
| | | </> |
| | | ); |
| | | }; |
| | | |
| | | export default SerialRuleItemList; |
| | |
| | | <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.serialRule.code" />, |
| | | <TextInput source="name" label="table.field.serialRule.name" />, |
| | | <TextInput source="delimit" label="table.field.serialRule.delimit" />, |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [detailDialog, setDetailDialog] = useState(false); |
| | | |
| | | const navigate = useNavigate(); |
| | | const assign = (record) => { |
| | | navigate(`/serialRuleItem?ruleId=${record.id}`); |
| | | }; |
| | | // const navigate = useNavigate(); |
| | | // const assign = (record) => { |
| | | // navigate(`/serialRuleItem?ruleId=${record.id}`); |
| | | // }; |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | 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.serialRule.code" |
| | | onClick={(event, record, val) => { |
| | | event.stopPropagation(); |
| | | assign(record); |
| | | }} |
| | | /> |
| | | {/* <MyField |
| | | source="code" |
| | | label="table.field.serialRule.code" |
| | | onClick={() => { |
| | | setDetailDialog(true); |
| | | }} |
| | | /> */} |
| | | |
| | | <TextField source="code" label="table.field.serialRule.code" /> |
| | | <TextField source="name" label="table.field.serialRule.name" /> |
| | | <TextField source="delimit" label="table.field.serialRule.delimit" /> |
| | | <TextField source="reset" label="table.field.serialRule.reset" /> |
| | |
| | | |
| | | const filters = [ |
| | | // <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label="common.time.after" source="timeStart" alwaysOn />, |
| | | <DateInput label="common.time.before" source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="username" label="table.field.user.username" />, |
| | | <TextInput source="nickname" label="table.field.user.nickname" />, |
| | |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <UserPanel />} |
| | | expandSingle={true} |
| | | omit={[ |
| | | "id", |
| | | "email", |
| | |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import { useWatch, useFormContext, useForm } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Card } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import TaskItemList from "./TaskItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | {/* <DeleteButton mutationMode="optimistic" /> */} |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const TaskEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | <> |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={12} md={8}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.taskCode" |
| | | source="taskCode" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.task.taskStatus" |
| | | source="taskStatus" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.task.taskType" |
| | | source="taskType" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.orgLoc" |
| | | source="orgLoc" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.orgSite" |
| | | source="orgSite" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.targLoc" |
| | | source="targLoc" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.targSite" |
| | | source="targSite" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.robotCode" |
| | | source="robotCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.task.exceStatus" |
| | | source="exceStatus" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.expDesc" |
| | | source="expDesc" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.task.sort" |
| | | source="sort" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.expCode" |
| | | source="expCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.task.startTime" |
| | | source="startTime" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.task.endTime" |
| | | source="endTime" |
| | | /> |
| | | </Stack> |
| | | |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={24} md={16}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.taskCode" |
| | | source="taskCode" |
| | | readOnly |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.taskStatus" |
| | | readOnly |
| | | source="taskStatus$" |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.taskType" |
| | | source="taskType$" |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.orgLoc" |
| | | source="orgLoc" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.targLoc" |
| | | source="targLoc" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.orgSite" |
| | | source="orgSite" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.targSite" |
| | | source="targSite" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.barcode" |
| | | source="barcode" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.task.sort" |
| | | source="sort" |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | </SimpleForm> |
| | | </Edit > |
| | | <Grid item xs={24} md={16} sx={{ margin: '1em', height: 'auto' }}> |
| | | <Typography variant="h6" gutterBottom > |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | </Grid> |
| | | <TaskItemList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
File was renamed from rsf-admin/src/page/taskItem/TaskItemList.jsx |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { useFetcher, useNavigate } 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, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | 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 MyCreateButton from "../components/MyCreateButton"; |
| | | import TaskItemCreate from "./TaskItemCreate"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | cursor: 'auto', |
| | | maring: '1em' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | width: 220 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" />, |
| | | <DateInput label='common.time.before' source="timeEnd" />, |
| | | <NumberInput source="taskId" label="table.field.taskItem.taskId" />, |
| | | <NumberInput source="orderId" label="table.field.taskItem.orderId" />, |
| | | <NumberInput source="orderType" label="table.field.taskItem.orderType" />, |
| | |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const recordId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="taskItem" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | }} |
| | | title={"menu.taskItem"} |
| | | empty={false} |
| | | pagination={false} |
| | | filters={filters} |
| | | filter={{taskId: recordId}} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='taskItem' /> |
| | | {/* <MyExportButton /> */} |
| | | </TopToolbar> |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='taskItem' |
| | | // bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | // expand={() => <TaskItemPanel />} |
| | | expandSingle={true} |
| | |
| | | <TextField source="batch" label="table.field.taskItem.batch" /> |
| | | <TextField source="spec" label="table.field.taskItem.spec" /> |
| | | <TextField source="model" label="table.field.taskItem.model" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <TaskItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} /> |
| | | <PageDrawer |
| | | title='TaskItem Detail' |
| | | drawerVal={drawerVal} |
| | |
| | | |
| | | Button, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, Drawer } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import TaskCreate from "./TaskCreate"; |
| | | import TaskPanel from "./TaskPanel"; |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | width: 248 |
| | | }, |
| | | })); |
| | | |
| | |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | </> |
| | | } |
| | | rowClick={false} |
| | | expand={() => <TaskPanel/>} |
| | | rowClick={'edit'} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'sort']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'status', 'sort']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="taskCode" label="table.field.task.taskCode" /> |
| | |
| | | <TextField source="createBy$" label="common.field.createBy"/> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton> |
| | |
| | | } |
| | | |
| | | export default TaskList; |
| | | |
| | | |
| | | /** |
| | | * 完成操作 |
| | | * @returns |
File was renamed from rsf-admin/src/page/taskItemLog/TaskItemLogList.jsx |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import TaskItemLogCreate from "./TaskItemLogCreate"; |
| | | import TaskItemLogPanel from "./TaskItemLogPanel"; |
| | | 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': { |
| | |
| | | |
| | | const TaskItemLogList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const recodeId = useGetRecordId(); |
| | | |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="taskItemLog" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | title={"menu.taskItemLog"} |
| | | filters={filters} |
| | | empty={false} |
| | | filter={{logId: Number(recodeId) }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="taskItemId" label="table.field.taskItemLog.taskItemId" /> |
| | | <NumberField source="taskId" label="table.field.taskItemLog.taskId" /> |
| | | <NumberField source="orderId" label="table.field.taskItemLog.orderId" /> |
| | | <TextField source="orderType" label="table.field.taskItemLog.orderType" /> |
| | |
| | | <TextField source="batch" label="table.field.taskItemLog.batch" /> |
| | | <TextField source="spec" label="table.field.taskItemLog.spec" /> |
| | | <TextField source="model" label="table.field.taskItemLog.model" /> |
| | | <TextField source="fieldsIndex" label="table.field.taskItemLog.fieldsIndex" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import { useWatch, useFormContext, useForm } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Card } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import TaskItemLogList from "./TaskItemLogList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | {/* <DeleteButton mutationMode="optimistic" /> */} |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const TaskLogEdit = () => { |
| | | const TaskItemLog = () => { |
| | | 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}> |
| | | <NumberInput |
| | | label="table.field.taskLog.taskId" |
| | | source="taskId" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.taskCode" |
| | | source="taskCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.taskLog.taskStatus" |
| | | source="taskStatus" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.taskLog.taskType" |
| | | source="taskType" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.orgLoc" |
| | | source="orgLoc" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.orgSite" |
| | | source="orgSite" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.targLoc" |
| | | source="targLoc" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.targSite" |
| | | source="targSite" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.robotCode" |
| | | source="robotCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.taskLog.exceStatus" |
| | | source="exceStatus" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.expDesc" |
| | | source="expDesc" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.taskLog.sort" |
| | | source="sort" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskLog.expCode" |
| | | source="expCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.taskLog.startTime" |
| | | source="startTime" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.taskLog.endTime" |
| | | source="endTime" |
| | | /> |
| | | </Stack> |
| | | |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={24} md={16}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.taskCode" |
| | | source="taskCode" |
| | | readOnly |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.taskStatus" |
| | | readOnly |
| | | source="taskStatus$" |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.taskType" |
| | | source="taskType$" |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.orgLoc" |
| | | source="orgLoc" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.targLoc" |
| | | source="targLoc" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.orgSite" |
| | | source="orgSite" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.task.targSite" |
| | | source="targSite" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.task.barcode" |
| | | source="barcode" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.task.sort" |
| | | readOnly |
| | | source="sort" |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | <Card sx={{ marginTop: '1em', }}> |
| | | <Grid item xs={24} md={16} sx={{ margin: '1em' }}> |
| | | <Typography variant="h6" gutterBottom > |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <TaskItemLogList /> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | </Card> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default TaskLogEdit; |
| | | export default TaskItemLog; |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | width: 250 |
| | | }, |
| | | })); |
| | | |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='taskLog' |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <TaskLogPanel />} |
| | | rowClick={'edit'} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'robotCode', 'exceStatus', 'sort', 'expCode']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="taskId" label="table.field.taskLog.taskId" /> |
| | | <TextField source="taskCode" label="table.field.taskLog.taskCode" /> |
| | | <NumberField source="taskStatus" label="table.field.taskLog.taskStatus" /> |
| | | <NumberField source="taskType" label="table.field.taskLog.taskType" /> |
| | | <TextField source="orgLoc" label="table.field.taskLog.orgLoc" /> |
| | | <TextField source="orgSite" label="table.field.taskLog.orgSite" /> |
| | | <TextField source="targLoc" label="table.field.taskLog.targLoc" /> |
| | | <TextField source="targSite" label="table.field.taskLog.targSite" /> |
| | | <TextField source="barcode" label="table.field.taskLog.barcode" /> |
| | | <TextField source="robotCode" label="table.field.taskLog.robotCode" /> |
| | | <NumberField source="exceStatus" label="table.field.taskLog.exceStatus" /> |
| | | <TextField source="expDesc" label="table.field.taskLog.expDesc" /> |
| | | <NumberField source="sort" label="table.field.taskLog.sort" /> |
| | | <TextField source="expCode" label="table.field.taskLog.expCode" /> |
| | | <DateField source="startTime" label="table.field.taskLog.startTime" showTime /> |
| | | <DateField source="endTime" label="table.field.taskLog.endTime" showTime /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="taskCode" label="table.field.task.taskCode" /> |
| | | <NumberField source="taskStatus$" label="table.field.task.taskStatus" /> |
| | | <NumberField source="taskType$" label="table.field.task.taskType" /> |
| | | <TextField source="orgLoc" label="table.field.task.orgLoc" /> |
| | | <TextField source="orgSite" label="table.field.task.orgSite" /> |
| | | <TextField source="targLoc" label="table.field.task.targLoc" /> |
| | | <TextField source="targSite" label="table.field.task.targSite" /> |
| | | <TextField source="barcode" label="table.field.task.barcode" /> |
| | | <TextField source="robotCode" label="table.field.task.robotCode" /> |
| | | <NumberField source="exceStatus" label="table.field.task.exceStatus" /> |
| | | <TextField source="expDesc" label="table.field.task.expDesc" /> |
| | | <NumberField source="sort" label="table.field.task.sort" /> |
| | | <TextField source="expCode" label="table.field.task.expCode" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | {/* <TaskLogCreate |
| | |
| | | <NumberField source="matnrId" label="table.field.warehouseAreasItem.matnrId" /> |
| | | <TextField source="matnrName" label="table.field.warehouseAreasItem.matnrName" /> |
| | | <TextField source="matnrCode" label="table.field.warehouseAreasItem.matnrCode" /> |
| | | <TextField source="barcode" label="table.field.warehouseAreasItem.barcode" /> |
| | | <TextField source="trackCode" label="table.field.warehouseAreasItem.barcode" /> |
| | | <NumberField source="anfme" label="table.field.warehouseAreasItem.anfme" /> |
| | | <TextField source="batch" label="table.field.warehouseAreasItem.batch" /> |
| | | <TextField source="unit" label="table.field.warehouseAreasItem.unit" /> |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | |
| | | return mobileService.getDeltByCode(code); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | | @ApiOperation("获取拖盘明细") |
| | | @PostMapping("/asnOrderItem/container") |
| | | public R getItemByContainer(@RequestBody Map<String, Object> params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.getItemByContainer(params); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | | @ApiOperation("组拖") |
| | | @PostMapping("/waitPakin/merge") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("快带质检") |
| | | @ApiOperation("快速质检") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | @PostMapping("/inspect/check/update") |
| | | public R checkUpdate(@RequestBody QlyIsptItem params) { |
| | | if (Objects.isNull(params)) { |
| | | public R checkUpdate(@RequestBody List<QlyIsptItem> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.checkUpdate(params); |
| | |
| | | |
| | | R checkObjs(CheckObjParams params); |
| | | |
| | | R checkUpdate(QlyIsptItem params); |
| | | R checkUpdate(List<QlyIsptItem> params); |
| | | |
| | | R operateToStock(OpStockParams params); |
| | | |
| | |
| | | R taskGetLocs(String code) throws Exception; |
| | | |
| | | R completeOrder(Long id, Long loginUserId); |
| | | |
| | | R getItemByContainer(Map<String, Object> params); |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.mapper.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.CodeRes; |
| | |
| | | import com.vincent.rsf.server.system.mapper.UserMapper; |
| | | import com.vincent.rsf.server.system.service.FieldsItemService; |
| | | import com.vincent.rsf.server.system.service.UserLoginService; |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.utils.ExtendFieldsUtils; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import net.sf.jsqlparser.statement.select.Wait; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private TenantMapper tenantService; |
| | | @Autowired |
| | | private UserMapper userService; |
| | | private UserService userService; |
| | | @Autowired |
| | | private UserLoginService userLoginService; |
| | | @Autowired |
| | |
| | | if (user.getStatus() != 1) { |
| | | return R.parse(CodeRes.USER_10002); |
| | | } |
| | | if (!user.getPassword().equals(param.getPassword())) { |
| | | if (!userService.comparePassword(user.getPassword(), param.getPassword())) { |
| | | return R.parse(CodeRes.USER_10003); |
| | | } |
| | | |
| | |
| | | throw new CoolException("通知单明细不存在!!"); |
| | | } |
| | | if (Objects.isNull(dto.getReceiptQty()) || Double.compare(dto.getReceiptQty(), 0.0) == 0) { |
| | | throw new CoolException("收货数量不能为零!!"); |
| | | throw new CoolException("物料:" + dto.getMaktx() + "收货数量不能为零!!"); |
| | | } |
| | | Double itemRcptQty = dto.getReceiptQty() + orderItem.getQty(); |
| | | orderItem.setQty(itemRcptQty) |
| | |
| | | if (Objects.isNull(params.getIsptCode())) { |
| | | throw new CoolException("质检单不能为空"); |
| | | } |
| | | if (Objects.isNull(params.getMatnrCode())) { |
| | | throw new CoolException("物料编码不能为空!"); |
| | | } |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>().eq(QlyInspect::getCode, params.getIsptCode())); |
| | | if (Objects.isNull(inspect)) { |
| | | throw new CoolException("质检单据不存在!!"); |
| | | } |
| | | QlyIsptItem isptItem = qlyIsptItemService.getOne(new LambdaQueryWrapper<QlyIsptItem>() |
| | | .eq(QlyIsptItem::getMatnrCode, params.getMatnrCode()) |
| | | List<QlyIsptItem> isptItems = qlyIsptItemService.list(new LambdaQueryWrapper<QlyIsptItem>() |
| | | .eq(StringUtils.isNotBlank(params.getMatnrCode()), QlyIsptItem::getMatnrCode, StringUtils.isNotBlank(params.getMatnrCode()) ? params.getMatnrCode() : null) |
| | | .eq(QlyIsptItem::getIspectId, inspect.getId())); |
| | | if (Objects.isNull(isptItem)) { |
| | | if (Objects.isNull(isptItems)) { |
| | | throw new CoolException("质检单明细不存在!!"); |
| | | } |
| | | |
| | | CheckObjDto objDto = new CheckObjDto(); |
| | | objDto.setIsptCode(inspect.getCode()) |
| | | .setAsnCode(inspect.getAsnCode()) |
| | | .setId(isptItem.getId()) |
| | | .setMatnrCode(isptItem.getMatnrCode()) |
| | | .setMaktx(isptItem.getMaktx()) |
| | | .setDisQty(isptItem.getDisQty()) |
| | | .setDlyQty(isptItem.getDlyQty()) |
| | | .setRcptQty(isptItem.getRcptQty()) |
| | | .setIsptResult(isptItem.getIsptResult()) |
| | | .setSplrBatch(isptItem.getSplrBatch()) |
| | | .setSplrName(isptItem.getSplrName()) |
| | | .setPicPath(isptItem.getPicPath()) |
| | | .setMemo(isptItem.getMemo()) |
| | | .setSafeQty(isptItem.getSafeQty()); |
| | | return R.ok(objDto); |
| | | List<CheckObjDto> dtos = new ArrayList<>(); |
| | | isptItems.forEach(isptItem -> { |
| | | CheckObjDto objDto = new CheckObjDto(); |
| | | objDto.setIsptCode(inspect.getCode()) |
| | | .setAsnCode(inspect.getAsnCode()) |
| | | .setId(isptItem.getId()) |
| | | .setMatnrCode(isptItem.getMatnrCode()) |
| | | .setMaktx(isptItem.getMaktx()) |
| | | .setDisQty(isptItem.getDisQty()) |
| | | .setDlyQty(isptItem.getDlyQty()) |
| | | .setRcptQty(isptItem.getRcptQty()) |
| | | .setIsptResult(isptItem.getIsptResult()) |
| | | .setSplrBatch(isptItem.getSplrBatch()) |
| | | .setSplrName(isptItem.getSplrName()) |
| | | .setPicPath(isptItem.getPicPath()) |
| | | .setMemo(isptItem.getMemo()) |
| | | .setSafeQty(isptItem.getSafeQty()); |
| | | dtos.add(objDto); |
| | | }); |
| | | return R.ok(dtos); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R checkUpdate(QlyIsptItem params) { |
| | | if (Objects.isNull(params.getId())) { |
| | | public R checkUpdate(List<QlyIsptItem> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | IsptItemsParams itemsParams = new IsptItemsParams(); |
| | | List<QlyIsptItem> items = new ArrayList<>(); |
| | | items.add(params); |
| | | itemsParams.setIsptItem(items).setType("0"); |
| | | itemsParams.setIsptItem(params).setType("0"); |
| | | if (qlyIsptItemService.batchUpdate(itemsParams)) { |
| | | return R.ok(); |
| | | } else { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 通过容器获取组拖物料 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/9 16:57 |
| | | */ |
| | | @Override |
| | | public R getItemByContainer(Map<String, Object> params) { |
| | | //获取组拖未生成任务的组拖档 |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.get("barcode").toString()) |
| | | .in(WaitPakin::getIoStatus, asList)); |
| | | if (Objects.isNull(waitPakin)) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakin.getId())); |
| | | if (pakinItems.isEmpty()) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | List<String> list = pakinItems.stream().map(WaitPakinItem::getTrackCode).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new QueryWrapper<WarehouseAreasItem>() |
| | | .select("SUM(anfme) as anfme, track_code, asn_code, id, splr_batch, ispt_result, plat_item_id, batch, qty, work_qty, matnr_code, matnr_id, maktx") |
| | | .lambda() |
| | | .in(WarehouseAreasItem::getTrackCode, list) |
| | | .groupBy(WarehouseAreasItem::getSplrBatch, |
| | | WarehouseAreasItem::getTrackCode); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | for (int i = 0; i < warehouseAreasItems.size(); i++) { |
| | | for (WaitPakinItem pakinItem : pakinItems) { |
| | | if (warehouseAreasItems.get(i).getTrackCode().equals(pakinItem.getTrackCode())) { |
| | | warehouseAreasItems.get(i).setAnfme(pakinItem.getAnfme()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(warehouseAreasItems); |
| | | } |
| | | |
| | | /** |
| | | * 获取ReceiptDetlsDtos |
| | | */ |
| | | private R getAsnOrderItem(List<AsnOrderItem> items) { |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("主单ID") |
| | | private Long logId; |
| | | |
| | | @ApiModelProperty("Item ID") |
| | | private Long asnItemId; |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("主单ID") |
| | | private Long logId; |
| | | |
| | | /** |
| | | * 主单ID |
| | | */ |
| | |
| | | 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 getTaskStatus$(){ |
| | | if (Cools.isEmpty(this.taskStatus)) { |
| | | return null; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_STATUS) |
| | | .eq(DictData::getValue, this.taskStatus)); |
| | | if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) { |
| | | return null; |
| | | } |
| | | return dictDatas.getLabel(); |
| | | } |
| | | |
| | | public String getTaskType$() { |
| | | if (Cools.isEmpty(this.taskType)) { |
| | | return null; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_TYPE) |
| | | .eq(DictData::getValue, this.taskType)); |
| | | if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) { |
| | | return null; |
| | | } |
| | | return dictDatas.getLabel(); |
| | | } |
| | | |
| | | public String getStartTime$(){ |
| | | if (Cools.isEmpty(this.startTime)){ |
| | | return ""; |
| | |
| | | return "待入库"; |
| | | case 1: |
| | | return " 入库中"; |
| | | case 2: |
| | | return "任务执行中"; |
| | | case 3: |
| | | return "任务完成"; |
| | | default: |
| | | return String.valueOf(this.ioStatus); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface WarehouseAreasItemService extends IService<WarehouseAreasItem> { |
| | | |
| | | List<WarehouseAreasItem> getList(); |
| | | |
| | | } |
| | |
| | | public List<AsnOrder> getUnInspect(Map<String, Object> params) { |
| | | List<AsnOrder> asnOrders = asnOrderService.list(new LambdaQueryWrapper<AsnOrder>() |
| | | .eq(AsnOrder::getStatus, 1) |
| | | .eq(!Objects.isNull(params.get("asnCode")), AsnOrder::getCode, !Objects.isNull(params.get("asnCode")) ? params.get("asnCode").toString() : "") |
| | | .eq(AsnOrder::getNtyStatus, 0)); |
| | | .eq(!Objects.isNull(params.get("asnCode")) && StringUtils.isNotBlank(params.get("asnCode").toString()), AsnOrder::getCode, StringUtils.isNotBlank(params.get("asnCode").toString()) ? params.get("asnCode").toString() : null)); |
| | | return asnOrders; |
| | | } |
| | | |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.PakinItem; |
| | |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("waitPakinService") |
| | |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | | private WarehouseAreasItemService warehouseAreasItemService; |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | |
| | | if (StringUtils.isBlank(waitPakin.getBarcode())) { |
| | | throw new CoolException("参数错误:托盘码为空!!"); |
| | | } |
| | | |
| | | List<WaitPakin> list = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!list.isEmpty()) { |
| | | List<String> stringList = list.stream().map(WaitPakin::getCode).collect(Collectors.toList()); |
| | | String join = StringUtils.join(stringList, ","); |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被组拖单:" + join + "使用!!"); |
| | | List<Short> asList = Arrays.asList(Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val), Short.valueOf(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)); |
| | | WaitPakin list = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .notIn(WaitPakin::getIoStatus, asList) |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!Objects.isNull(list)) { |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被组拖单:" + list.getCode() + "使用!!"); |
| | | } |
| | | |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, waitPakin.getBarcode())); |
| | | if (!locs.isEmpty()) { |
| | | List<String> locCodes = locs.stream().map(Loc::getCode).collect(Collectors.toList()); |
| | | String join = StringUtils.join(locCodes, ","); |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被库位:" + join + "使用!!"); |
| | | } |
| | | |
| | | double sum = waitPakin.getItems().stream().mapToDouble(PakinItem::getReceiptQty).sum(); |
| | | |
| | | WaitPakin pakin = new WaitPakin(); |
| | | |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_WAIT_PAKIN_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误: 编码规则「SYS_WAIT_PAKIN_CODE」规则是不存在"); |
| | | WaitPakin waitPakin1 = new WaitPakin(); |
| | | WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .in(WaitPakin::getIoStatus, asList) |
| | | .eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (Objects.isNull(pakin)) { |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_WAIT_PAKIN_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误: 编码规则「SYS_WAIT_PAKIN_CODE」规则是不存在"); |
| | | } |
| | | waitPakin1.setCode(ruleCode) |
| | | //状态修改为入库中 |
| | | .setIoStatus(Short.parseShort(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)) |
| | | .setAnfme(sum) |
| | | .setBarcode(waitPakin.getBarcode()); |
| | | if (!this.save(waitPakin1)) { |
| | | throw new CoolException("主单保存失败!!"); |
| | | } |
| | | } else { |
| | | BeanUtils.copyProperties(pakin, waitPakin1); |
| | | waitPakin1.setAnfme(sum); |
| | | if (!this.saveOrUpdate(waitPakin1)) { |
| | | throw new CoolException("主单修改失败!!"); |
| | | } |
| | | } |
| | | pakin.setCode(ruleCode) |
| | | //状态修改为入库中 |
| | | .setIoStatus(Short.parseShort(PakinIOStatus.PAKIN_IO_STATUS_DONE.val)) |
| | | .setAnfme(sum) |
| | | .setBarcode(waitPakin.getBarcode()); |
| | | if (!this.save(pakin)) { |
| | | throw new CoolException("主单保存失败!!"); |
| | | } |
| | | |
| | | /**物料跟踪码*/ |
| | | List<String> tracks = waitPakin.getItems().stream().map(PakinItem::getTrackCode).collect(Collectors.toList()); |
| | | |
| | | List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .in(AsnOrderItem::getTrackCode, tracks)); |
| | | if (Objects.isNull(asnOrderItems) || asnOrderItems.isEmpty()) { |
| | | throw new CoolException("单据不存在!!"); |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakin1.getId()) |
| | | .in(WaitPakinItem::getTrackCode, tracks)); |
| | | if (!pakinItems.isEmpty()) { |
| | | if (!waitPakinItemService.remove(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .eq(WaitPakinItem::getPakinId, waitPakin1.getId()) |
| | | .in(WaitPakinItem::getTrackCode, tracks))) { |
| | | throw new CoolException("原单据清除失败!!"); |
| | | } |
| | | } |
| | | |
| | | LambdaQueryWrapper<WarehouseAreasItem> queryWrapper = new QueryWrapper<WarehouseAreasItem>() |
| | | .select("SUM(anfme) as anfme, track_code, asn_code, id, splr_batch, ispt_result, plat_item_id, batch, qty, work_qty, matnr_code, matnr_id, maktx") |
| | | .lambda() |
| | | .in(WarehouseAreasItem::getTrackCode, tracks) |
| | | .groupBy(WarehouseAreasItem::getSplrBatch, |
| | | WarehouseAreasItem::getTrackCode); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService.list(queryWrapper); |
| | | if (Objects.isNull(warehouseAreasItems) || warehouseAreasItems.isEmpty()) { |
| | | throw new CoolException("物料未送至收货区!!"); |
| | | } |
| | | List<WaitPakinItem> items = new ArrayList<>(); |
| | | for (AsnOrderItem item : asnOrderItems) { |
| | | for (WarehouseAreasItem item : warehouseAreasItems) { |
| | | WaitPakinItem pakinItem = new WaitPakinItem(); |
| | | pakinItem.setAnfme(item.getAnfme()) |
| | | .setPakinId(pakin.getId()) |
| | | .setPakinId(waitPakin1.getId()) |
| | | .setAsnId(item.getAsnId()) |
| | | .setAsnCode(item.getAsnCode()) |
| | | .setAsnItemId(item.getId()) |
| | |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | // Double v = item.getWorkQty() + waitPakinItem.getReceiptQty(); |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | } |
| | | pakinItem |
| | | .setWorkQty(waitPakinItem.getReceiptQty()) |
| | | .setAnfme(waitPakinItem.getReceiptQty()) |
| | | .setTrackCode(waitPakinItem.getTrackCode()); |
| | | /**更新单据执行中库存*/ |
| | |
| | | } |
| | | items.add(pakinItem); |
| | | } |
| | | double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | if (!waitPakinItemService.saveBatch(items)) { |
| | | throw new CoolException("组拖明细保存失败!!"); |
| | | } |
| | | waitPakin1.setAnfme(sum1); |
| | | if (!this.updateById(waitPakin1)) { |
| | | throw new CoolException("组拖数量修改失败!!"); |
| | | } |
| | | return pakin; |
| | | } |
| | | |
| | |
| | | |
| | | String encodePassword(String password); |
| | | |
| | | User selectByUsernameWithoutTenant(String username, Long tenantId); |
| | | } |
| | |
| | | return password == null ? null : bCryptPasswordEncoder.encode(password); |
| | | } |
| | | |
| | | @Override |
| | | public User selectByUsernameWithoutTenant(String username, Long tenantId) { |
| | | return baseMapper.selectByUsernameWithoutTenant(username,tenantId); |
| | | } |
| | | |
| | | } |
| | |
| | | matching-strategy: ANT_PATH_MATCHER |
| | | datasource: |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: root |
| | | # url: jdbc:mysql://192.168.4.24:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: rsf |
| | | # url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | url: jdbc:mysql://192.168.4.24:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: rsf |
| | | password: 34821015 |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | druid: |