7个文件已添加
20 文件已重命名
4 文件已复制
20个文件已删除
43个文件已修改
| | |
| | | VITE_BASE_IP=192.168.4.24 |
| | | VITE_BASE_IP=127.0.0.1 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | import ResourceContent from "./page/ResourceContent"; |
| | | import { getSystemInfo, getSystemDicts, tenants } from "@/api/auth"; |
| | | import chineseMessages from 'ra-language-chinese'; |
| | | import { createTheme, ThemeProvider } from '@mui/material/styles'; |
| | | import { zhCN } from '@mui/material/locale'; |
| | | |
| | | const i18nProvider = polyglotI18nProvider( |
| | | (locale) => { |
| | |
| | | allowMissing: true, |
| | | }, |
| | | ); |
| | | |
| | | |
| | | const theme = createTheme( |
| | | { |
| | | palette: { main: '#1976d2' }, |
| | | }, |
| | | zhCN |
| | | ) |
| | | |
| | | |
| | | const store = localStorageStore(SPA_VERSION, SPA_NAME); |
| | | |
| | |
| | | }; |
| | | |
| | | const AppWrapper = () => ( |
| | | <StoreContextProvider value={store}> |
| | | <App /> |
| | | </StoreContextProvider> |
| | | <ThemeProvider theme={theme}> |
| | | <StoreContextProvider value={store}> |
| | | <App /> |
| | | </StoreContextProvider> |
| | | </ThemeProvider> |
| | | |
| | | ); |
| | | |
| | | export default AppWrapper; |
| | |
| | | |
| | | export const DEFAULT_PAGE_SIZE = 25; |
| | | |
| | | export const DEFAULT_ITEM_PAGE_SIZE = 10; |
| | | |
| | | export const PAGE_DRAWER_WIDTH = 400; |
| | | |
| | | export const REFERENCE_INPUT_PAGESIZE = 1000; |
| | | |
| | | export const OPERATE_MODE = 'undoable'; // pessimistic | optimistic(tip) | undoable |
| | | export const OPERATE_MODE = 'pessimistic'; // pessimistic | optimistic(tip) | undoable |
| | | |
| | | export const EDIT_MODE = 'pessimistic'; // pessimistic | undoable |
| | | |
| | |
| | | fail: "Fail", |
| | | dataError: "Submit data was error, Please check", |
| | | }, |
| | | button: { |
| | | edit: "Edit", |
| | | }, |
| | | field: { |
| | | id: 'ID', |
| | | uuid: 'uuid', |
| | |
| | | container: 'Container', |
| | | contract: 'Contract', |
| | | qlyInspect: 'QlyInspect', |
| | | qlyIsptItem: '质检信息明细', |
| | | qlyIsptItem: 'qlyIsptItem', |
| | | dictType: 'DictType', |
| | | dictData: 'DictData', |
| | | companys: 'Companys', |
| | |
| | | dlyQty: "dlyQty", |
| | | rcptQty: "rcptQty", |
| | | isptQty: "isptQty", |
| | | isptResult: "isptResult", |
| | | isptStatus: "isptStatus", |
| | | }, |
| | | qlyIsptItem: { |
| | |
| | | arrTime: "Arrived", |
| | | rleStatus: "Release", |
| | | ntyStatus: "Notify", |
| | | exceStatus: 'bill status' |
| | | }, |
| | | asnOrderItem: { |
| | | asnId: "asnId", |
| | |
| | | ansId: "ansId", |
| | | asnCode: "asnCode", |
| | | barcode: "barcode", |
| | | flagDefect: "Defective", |
| | | anfme: "anfme", |
| | | ioStatus: "ioStatus", |
| | | }, |
| | |
| | | creatcode: "creatcode", |
| | | print: "print", |
| | | enable: 'enable', |
| | | detail: "Detail", |
| | | unenable: 'unenable', |
| | | locInit: 'loc init', |
| | | siteInit: 'site init', |
| | |
| | | fail: "服务器错误", |
| | | dataError: "数据错误,请仔细检查", |
| | | }, |
| | | button: { |
| | | edit: "编辑", |
| | | }, |
| | | field: { |
| | | id: 'ID', |
| | | uuid: '编号', |
| | |
| | | dlyQty: "送货数量", |
| | | rcptQty: "收货数量 ", |
| | | isptQty: "质检数量", |
| | | isptResult: "质检结果", |
| | | isptStatus: "质检状态", |
| | | }, |
| | | qlyIsptItem: { |
| | |
| | | }, |
| | | serialRuleItem: { |
| | | ruleId: "规则标识", |
| | | wkType: "规则类型", |
| | | feildValue: "规则参数", |
| | | wkType: "类型", |
| | | feildValue: "类型参数", |
| | | len: "截取长度", |
| | | lenStr: "截取起始位置", |
| | | sort: "排序", |
| | |
| | | qty: "完成数量", |
| | | logisNo: "物流单号", |
| | | arrTime: "预计到达时间", |
| | | rleStatus: "状态", |
| | | rleStatus: "释放状态", |
| | | ntyStatus: "上报状态", |
| | | exceStatus: '单据状态' |
| | | }, |
| | | asnOrderItem: { |
| | | asnId: "主单标识", |
| | |
| | | ansId: "收货通知单号", |
| | | asnCode: "收货通知单编码", |
| | | barcode: "容器码", |
| | | flagDefect: "不良品", |
| | | anfme: "数量", |
| | | ioStatus: "状态", |
| | | }, |
| | |
| | | inspection: "报检", |
| | | creatcode: "生成条码", |
| | | print: "打印", |
| | | detail: "查看详情", |
| | | enable: '启用', |
| | | unenable: '禁用', |
| | | locInit: '库位初始化', |
| | |
| | | } from '@mui/material'; |
| | | import ExpandMore from '@mui/icons-material/ExpandMore'; |
| | | import { useTranslate, useSidebarState } from 'react-admin'; |
| | | |
| | | import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; |
| | | import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight'; |
| | | const SubMenu = (props) => { |
| | | const { handleToggle, isOpen, name, icon, children, dense } = props; |
| | | const translate = useTranslate(); |
| | |
| | | <MenuItem dense={dense} onClick={handleToggle} sx={{ display: 'flex', alignItems: 'center' }}> |
| | | <ListItemIcon sx={{ minWidth: 40, color: 'text.secondary', display: 'flex', alignItems: 'center' }}> |
| | | {/* {isOpen ? <ExpandMore /> : icon} */} |
| | | {icon} |
| | | {isOpen ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />} |
| | | </ListItemIcon> |
| | | <Typography variant="inherit" color="textSecondary" sx={{ ml: 1, display: 'flex', alignItems: 'center' }}> |
| | | {translate(name)} |
| | |
| | | import container from './container'; |
| | | import contract from './contract'; |
| | | import qlyInspect from './qlyInspect'; |
| | | import qlyIsptItem from './qlyIsptItem'; |
| | | import dictType from './system/dicts/dictType'; |
| | | import dictData from './system/dicts/dictData'; |
| | | import companys from './basicInfo/companys'; |
| | | import locType from './basicInfo/locType'; |
| | | import locArea from './basicInfo//locArea'; |
| | | import locAreaMatRela from './basicInfo/locAreaMatRela'; |
| | | import locAreaMat from './basicInfo/locAreaMat'; |
| | | import serialRuleItem from './system/serialRuleItem'; |
| | | import serialRule from './system/serialRule'; |
| | | import whMat from './basicInfo/whMat'; |
| | | import asnOrder from './asnOrder'; |
| | | import asnOrderItem from './asnOrderItem'; |
| | | // import purchaseItem from './purchaseItem'; |
| | | import purchase from './purchase'; |
| | | import asnOrder from './orders/asnOrder'; |
| | | import purchase from './orders/purchase'; |
| | | import fields from './fields'; |
| | | import fieldsItem from './fieldsItem'; |
| | | import warehouseAreasItem from './warehouseAreasItem'; |
| | |
| | | import waitPakin from './waitPakin'; |
| | | import waitPakinItem from './waitPakinItem'; |
| | | import waitPakinLog from './waitPakinLog'; |
| | | import asnOrderLog from './asnOrderLog'; |
| | | import asnOrderLog from './orders/asnOrderLog'; |
| | | import task from './task'; |
| | | import taskLog from './taskLog'; |
| | | |
| | |
| | | return qlyIsptItem; |
| | | case 'dictType': |
| | | return dictType; |
| | | case 'dictData': |
| | | return dictData; |
| | | case 'companys': |
| | | return companys; |
| | | case 'serialRuleItem': |
| | | return serialRuleItem; |
| | | case 'serialRule': |
| | | return serialRule; |
| | | case 'whMat': |
| | |
| | | return asnOrderItem; |
| | | case 'asnOrderLog': |
| | | return asnOrderLog; |
| | | // case 'purchaseItem': |
| | | // return purchaseItem; |
| | | case 'purchase': |
| | | return purchase; |
| | | case 'fields': |
| | |
| | | const parmas = { |
| | | locId: selectedIds, |
| | | areaMatId: formData.areaMatId, |
| | | groupId: formData.groupId, |
| | | matnrId: formData.matnrId, |
| | | } |
| | | |
| | |
| | | <ReferenceArrayInput source="matnrId" reference="matnr" filter={{ groupId: formData.groupId }}> |
| | | <SelectArrayInput |
| | | label="table.field.locAreaMatRela.matnrId" |
| | | validate={required()} |
| | | // validate={required()} |
| | | value={formData.matnrId} |
| | | onChange={(e) => handleChange(e.target.value, 'matnrId')} |
| | | /> |
| | |
| | | onClick={() => { setCreateDialog(true) }}> |
| | | {translate('create.empty.button')} |
| | | </Button> |
| | | |
| | | <Button |
| | | variant="contained" |
| | | color="primary" |
| | |
| | | const { ...parmas } = props; |
| | | const form = useFormContext(); |
| | | const field = `extendFields.${parmas.source}`; |
| | | const value = form.getValues(field); |
| | | |
| | | const value = form.getValues(field) || form.formState.defaultValues?.extendFields?.[parmas.source]; |
| | | |
| | | value && form.setValue(parmas.source, value); |
| | | return ( |
| | | <TextInput |
copy from rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx
copy to rsf-admin/src/page/locAreaRela/LocAreaRelaList.jsx
File was copied from rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import QlyIsptItemCreate from "./QlyIsptItemCreate"; |
| | | import QlyIsptItemPanel from "./QlyIsptItemPanel"; |
| | | import LocAreaRelaCreate from "./LocAreaRelaCreate"; |
| | | import LocAreaRelaPanel from "./LocAreaRelaPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <NumberInput source="ispectId" label="table.field.qlyIsptItem.ispectId" />, |
| | | <TextInput source="matnrCode" label="table.field.qlyIsptItem.matnrCode" />, |
| | | <TextInput source="maktx" label="table.field.qlyIsptItem.maktx" />, |
| | | <TextInput source="label" label="table.field.qlyIsptItem.label" />, |
| | | <TextInput source="splrName" label="table.field.qlyIsptItem.splrName" />, |
| | | <TextInput source="splrBatch" label="table.field.qlyIsptItem.splrBatch" />, |
| | | <TextInput source="stockBatch" label="table.field.qlyIsptItem.stockBatch" />, |
| | | <NumberInput source="rcptQty" label="table.field.qlyIsptItem.rcptQty" />, |
| | | <NumberInput source="dlyQty" label="table.field.qlyIsptItem.dlyQty" />, |
| | | <NumberInput source="disQty" label="table.field.qlyIsptItem.disQty" />, |
| | | <NumberInput source="safeQty" label="table.field.qlyIsptItem.safeQty" />, |
| | | <TextInput source="picPath" label="table.field.qlyIsptItem.picPath" />, |
| | | <NumberInput source="locAreaId" label="table.field.locAreaRela.locAreaId" />, |
| | | <NumberInput source="locId" label="table.field.locAreaRela.locId" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | |
| | | />, |
| | | ] |
| | | |
| | | const QlyIsptItemList = () => { |
| | | const LocAreaRelaList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.qlyIsptItem"} |
| | | title={"menu.locAreaRela"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='qlyIsptItem' /> |
| | | <SelectColumnsButton preferenceKey='locAreaRela' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='qlyIsptItem' |
| | | preferenceKey='locAreaRela' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <LocAreaRelaPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="ispectId" label="table.field.qlyIsptItem.ispectId" /> |
| | | <TextField source="matnrCode" label="table.field.qlyIsptItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.qlyIsptItem.maktx" /> |
| | | <TextField source="label" label="table.field.qlyIsptItem.label" /> |
| | | <TextField source="splrName" label="table.field.qlyIsptItem.splrName" /> |
| | | <TextField source="splrBatch" label="table.field.qlyIsptItem.splrBatch" /> |
| | | <TextField source="stockBatch" label="table.field.qlyIsptItem.stockBatch" /> |
| | | <NumberField source="rcptQty" label="table.field.qlyIsptItem.rcptQty" /> |
| | | <NumberField source="isptResult$" label="table.field.qlyIsptItem.isptResult" /> |
| | | <NumberField source="dlyQty" label="table.field.qlyIsptItem.dlyQty" /> |
| | | <NumberField source="disQty" label="table.field.qlyIsptItem.disQty" /> |
| | | <NumberField source="safeQty" label="table.field.qlyIsptItem.safeQty" /> |
| | | <TextField source="picPath" label="table.field.qlyIsptItem.picPath" /> |
| | | <NumberField source="locAreaId" label="table.field.locAreaRela.locAreaId" /> |
| | | <NumberField source="locId" label="table.field.locAreaRela.locId" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <QlyIsptItemCreate |
| | | <LocAreaRelaCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='QlyIsptItem Detail' |
| | | title='LocAreaRela Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | |
| | | ) |
| | | } |
| | | |
| | | export default QlyIsptItemList; |
| | | export default LocAreaRelaList; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | useTranslate, |
| | | TextInput, |
| | | DateInput, |
| | | SelectInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | required, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import AsnOrderItemList from "./AsnOrderItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const AsnOrderEdit = () => { |
| | | const translate = useTranslate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_order_type')) || []; |
| | | const business = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | |
| | | return ( |
| | | <> |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <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.asnOrder.code" |
| | | source="code" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrder.poCode" |
| | | source="poCode" |
| | | parse={v => v} |
| | | /> |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.asnOrder.type" |
| | | source="type" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | <AutocompleteInput |
| | | choices={business} |
| | | optionText="label" |
| | | label="table.field.asnOrder.wkType" |
| | | source="wkType" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrder.logisNo" |
| | | source="logisNo" |
| | | parse={v => v} |
| | | /> |
| | | <DateInput |
| | | label="table.field.asnOrder.arrTime" |
| | | source="arrTime" |
| | | /> |
| | | <SelectInput |
| | | label="table.field.asnOrder.rleStatus" |
| | | source="rleStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 正常' }, |
| | | { id: 1, name: ' 已释放' }, |
| | | ]} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | <AsnOrderItemList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default AsnOrderEdit; |
File was renamed from rsf-admin/src/page/asnOrderItem/AsnOrderItemCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const AsnOrderItemCreate = (props) => { |
| | | const { open, setOpen, row } = props; |
| | | |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | |
| | | return ( |
| | | <> |
| | | <CreateBase |
| | | resource="asnOrderItem" |
| | | record={{}} |
| | | transform={(data) => { |
| | | return data; |
| | |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <Grid> |
| | | <Grid item xs={6} display="flex" gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.asnId" |
| | | source="asnId" |
| | | defaultValue={row.asnId} |
| | | readOnly |
| | | hidden |
| | | defaultValue={record?.id} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.asnCode" |
| | | source="asnCode" |
| | | readOnly |
| | | defaultValue={record?.code} |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <Grid item xs={6} display="flex" gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.poDetlId" |
| | | source="poDetlId" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.poDetlCode" |
| | | source="poDetlCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.matnrId" |
| | | source="matnrId" |
| | |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.stockUnit" |
| | | source="stockUnit" |
| | |
| | | source="purQty" |
| | | validate={required()} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.purUnit" |
| | | source="purUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.qty" |
| | | source="qty" |
| | |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.qrcode" |
| | | source="qrcode" |
| | |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.packName" |
| | | source="packName" |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | Form, |
| | | useRecordContext, |
| | | useGetOne, |
| | | DeleteButton, |
| | | EditBase, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const AsnOrderItemEdit = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | const { data, isPending, } = useGetOne('asnOrderItem', { id: record?.id }); |
| | | if (data == null || data == undefined) { return } |
| | | |
| | | return ( |
| | | <EditBase |
| | | id={record?.id} |
| | | resource="asnOrderItem" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Form |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '100%' }}> |
| | | <Grid item xs={24} md={14}> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.asnId" |
| | | source="asnId" |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.asnCode" |
| | | source="asnCode" |
| | | readOnly |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.poDetlId" |
| | | source="poDetlId" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.poDetlCode" |
| | | source="poDetlCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.matnrId" |
| | | source="matnrId" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.stockUnit" |
| | | source="stockUnit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.purQty" |
| | | source="purQty" |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.purUnit" |
| | | source="purUnit" |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.asnOrderItem.qty" |
| | | source="qty" |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.qrcode" |
| | | source="qrcode" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.packName" |
| | | source="packName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > |
| | | <SaveButton type="button" mutationOptions={{ |
| | | onSuccess: () => { |
| | | setOpen(false) |
| | | } |
| | | }} /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </DialogContent> |
| | | </Dialog> |
| | | </EditBase > |
| | | ) |
| | | } |
| | | |
| | | export default AsnOrderItemEdit; |
File was renamed from rsf-admin/src/page/asnOrderItem/AsnOrderItemList.jsx |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button |
| | | Button, |
| | | useEditContext, |
| | | useGetRecordId, |
| | | useGetOne |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, Dialog, DialogActions, DialogTitle } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import AsnOrderItemCreate from "./AsnOrderItemCreate"; |
| | | import AsnOrderItemPanel from "./AsnOrderItemPanel"; |
| | | 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"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import AsnOrderItemEdit from "./AsnOrderItemEdit"; |
| | | import QrCodeIcon from "@mui/icons-material/QrCode"; |
| | | import ImportButton from "../components/ImportButton"; |
| | | import ImportButton from "../../components/ImportButton"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | |
| | | const AsnOrderItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [editDialog, setEditDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | | const location = useLocation(); |
| | | const queryParams = new URLSearchParams(location.search); |
| | | const asnId = queryParams.get("asnId"); |
| | | |
| | | const creatCode = () => { }; |
| | | const [select, setSelect] = useState({}); |
| | | const asnId = useGetRecordId(); |
| | | const { data: dicts, isPending, error } = useGetOne('asnOrder', { id: asnId }); const creatCode = () => { }; |
| | | |
| | | return ( |
| | | <> |
| | | {asnId && <CustomerTopToolBar backPrevious={true} />} |
| | | <Box display="flex"> |
| | | <List |
| | | resource="asnOrderItem" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | }} |
| | | title={"menu.asnOrderItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filter={{ asnId: asnId }} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | rowClick={(id, resource, record) => { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poDetlId', 'matnrId', 'asnId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.asnOrderItem.asnId" /> |
| | |
| | | <TextField source="qrcode" label="table.field.asnOrderItem.qrcode" /> |
| | | <TextField source="barcode" label="table.field.asnOrderItem.barcode" /> |
| | | <TextField source="packName" label="table.field.asnOrderItem.packName" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <BooleanField source="status$" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <Button label="ra.action.edit" onClick={(id, resource, record) => { |
| | | setEditDialog(true) |
| | | setSelect(record) }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <AsnOrderItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | row={{ asnId }} |
| | | record={dicts} |
| | | /> |
| | | <AsnOrderItemEdit |
| | | open={editDialog} |
| | | setOpen={setEditDialog} |
| | | record={select} |
| | | /> |
| | | <PageDrawer |
| | | title='AsnOrderItem Detail' |
File was renamed from rsf-admin/src/page/asnOrder/AsnOrderList.jsx |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import AsnOrderModal from "./AsnOrderModal"; |
| | | import AsnOrderPanel from "./AsnOrderPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import BillStatusField from '../components/BillStatusField'; |
| | | import ConfirmButton from '../components/ConfirmButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import BillStatusField from '../../components/BillStatusField'; |
| | | import ConfirmButton from '../../components/ConfirmButton'; |
| | | 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 ConstructionIcon from "@mui/icons-material/Construction"; |
| | |
| | | import TaskIcon from '@mui/icons-material/Task'; |
| | | import CloseIcon from '@mui/icons-material/Close'; |
| | | import request from '@/utils/request'; |
| | | import DictionarySelect from "../components/DictionarySelect"; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | | <TextInput source="type" label="table.field.asnOrder.type" />, |
| | | <TextInput source="wkType" label="table.field.asnOrder.wkType" />, |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{dictTypeCode: 'sys_business_type'}} label="table.field.asnOrder.wkType"> |
| | | <AutocompleteInput label="table.field.asnOrder.wkType" optionValue="value" /> |
| | | </ReferenceInput>, |
| | | <NumberInput source="anfme" label="table.field.asnOrder.anfme" />, |
| | | <NumberInput source="qty" label="table.field.asnOrder.qty" />, |
| | | <TextInput source="logisNo" label="table.field.asnOrder.logisNo" />, |
| | |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <DictionarySelect |
| | | label='common.field.status' |
| | | label='table.field.asnOrder.exceStatus' |
| | | name="exceStatus" |
| | | dictTypeCode="sys_asn_exce_status" |
| | | alwaysOn |
| | | />, |
| | | |
| | | ] |
| | | |
| | | const AsnOrderList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const billReload = useRef(); |
| | | |
| | | const navigate = useNavigate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | const assign = (record) => { |
| | | navigate(`/asnOrderItem?asnId=${record.id}`); |
| | | }; |
| | |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true); setmodalType(0) }} /> |
| | | <SelectColumnsButton preferenceKey='asnOrder' /> |
| | | |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | sx={{ width: '100%' }} |
| | | preferenceKey='asnOrder' |
| | | bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={() => false} |
| | | expand={<AsnOrderPanel billReload={billReload} />} |
| | | rowClick={() => 'edit'} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId']} |
| | | > |
| | |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | <DateField source="arrTime" label="table.field.asnOrder.arrTime" showTime /> |
| | | <TextField source="rleStatus$" label="table.field.asnOrder.rleStatus" sortable={false} /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="common.field.status" /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.asnOrder.exceStatus" /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt" width={300} > |
| | | {/* <Button label="toolbar.print" onClick={print}> |
| | | <FileDownloadIcon /> |
| | | </Button> */} |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | {/* <Button |
| | | color="primary" |
| | | startIcon={<EditIcon />} |
| | | onClick={(event, record) => handleEditClick(record)} |
| | | sx={{ ml: 1 }} |
| | | label={'ra.action.edit'} |
| | | > |
| | | </Button> */} |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <CloseButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
File was renamed from rsf-admin/src/page/asnOrder/AsnOrderModal.jsx |
| | |
| | | |
| | | |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import ConfirmButton from "../components/ConfirmButton"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import ConfirmButton from "../../components/ConfirmButton"; |
| | | import AsnWareModal from "./AsnWareModal"; |
| | | import { useForm, Controller, useWatch, FormProvider, useFormContext } from "react-hook-form"; |
| | | import SaveIcon from '@mui/icons-material/Save'; |
| | |
| | | import { Add, Edit, Delete } from '@mui/icons-material'; |
| | | import _, { set } from 'lodash'; |
| | | import { DataGrid, useGridApiRef } from '@mui/x-data-grid'; |
| | | import DictionarySelect from "../components/DictionarySelect"; |
| | | import DictSelect from "../components/DictSelect"; |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | import DictSelect from "../../components/DictSelect"; |
| | | |
| | | const AsnOrderModal = (props) => { |
| | | const { open, setOpen, asnId, billReload } = props; |
| | |
| | | dictTypeCode="sys_order_type" |
| | | required |
| | | /> |
| | | |
| | | |
| | | </Grid> |
| | | |
| | | <Grid item md={3}> |
| | | <DictSelect |
| | | label={translate("table.field.asnOrder.wkType")} |
| | |
| | | required |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item md={3}> |
| | | <TextField |
| | | label={translate("table.field.asnOrder.poCode")} |
| | |
| | | onChange={(e) => handleChange(e.target.value, 'poCode')} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item md={3}> |
| | | <TextField |
| | | label={translate("table.field.asnOrder.logisNo")} |
File was renamed from rsf-admin/src/page/asnOrder/AsnOrderPanel.jsx |
| | |
| | | useRefresh, |
| | | useListContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | import { styled } from "@mui/material/styles"; |
| | | import request from '@/utils/request'; |
File was renamed from rsf-admin/src/page/asnOrder/AsnWareModal.jsx |
| | |
| | | Paper, |
| | | styled |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import ConfirmButton from "../components/ConfirmButton"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import ConfirmButton from "../../components/ConfirmButton"; |
| | | import { useTranslate, useNotify, useRefresh } from 'react-admin'; |
| | | import request from '@/utils/request'; |
| | | import { DataGrid } from '@mui/x-data-grid'; |
File was renamed from rsf-admin/src/page/asnOrderLog/AsnOrderItemLogList.jsx |
| | |
| | | } 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 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'; |
| | | |
File was renamed from rsf-admin/src/page/asnOrderLog/AsnOrderLogCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const AsnOrderLogCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/asnOrderLog/AsnOrderLogEdit.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } 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 AsnOrderItemLogList from "./AsnOrderItemLogList" |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import AsnOrderItemLogList from "./AsnOrderItemLogList" |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | </Grid> |
| | | {/* <AsnOrderItemLogList /> */} |
| | | <AsnOrderItemLogList /> |
| | | </> |
| | | ) |
| | | } |
File was renamed from rsf-admin/src/page/asnOrderLog/AsnOrderLogList.jsx |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import AsnOrderLogCreate from "./AsnOrderLogCreate"; |
| | | import AsnOrderLogPanel from "./AsnOrderLogPanel"; |
| | | 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 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'; |
| | | |
File was renamed from rsf-admin/src/page/asnOrderLog/AsnOrderLogPanel.jsx |
| | |
| | | useRefresh, |
| | | useListContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | import { styled } from "@mui/material/styles"; |
| | | import request from '@/utils/request'; |
| | |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import QlyIsptItemList from "./QlyIsptItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | |
| | | |
| | | const QlyInspectEdit = () => { |
| | | const translate = useTranslate(); |
| | | const business = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | |
| | | 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.qlyInspect.asnItemId" |
| | | source="asnItemId" |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.qlyInspect.code" |
| | | source="code" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.qlyInspect.wkType" |
| | | source="wkType" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.safeQty" |
| | | source="safeQty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.dlyQty" |
| | | source="dlyQty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.rcptQty" |
| | | source="rcptQty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.isptQty" |
| | | source="isptQty" |
| | | /> |
| | | </Stack> |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '100%' }}> |
| | | <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.qlyInspect.asnCode" |
| | | source="asnCode" |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.qlyInspect.code" |
| | | source="code" |
| | | parse={v => v} |
| | | readOnly |
| | | validate={required()} |
| | | /> |
| | | <AutocompleteInput |
| | | choices={business} |
| | | optionText="label" |
| | | label="table.field.asnOrder.wkType" |
| | | source="wkType" |
| | | readOnly |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.safeQty" |
| | | source="safeQty" |
| | | readOnly |
| | | /> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.dlyQty" |
| | | source="dlyQty" |
| | | readOnly |
| | | |
| | | /> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.rcptQty" |
| | | source="rcptQty" |
| | | readOnly |
| | | |
| | | /> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.isptQty" |
| | | source="isptQty" |
| | | readOnly |
| | | |
| | | /> |
| | | </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 > |
| | | <QlyIsptItemList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | |
| | | import request from '@/utils/request'; |
| | | import AsnSelModal from "./AsnSelModal"; |
| | | import InspectModal from "./InspectModal"; |
| | | |
| | | import QlyInspectOpCreate from './QlyInspectOpCreate'; |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.qlyInspect.code" />, |
| | | <TextInput source="wkType" label="table.field.qlyInspect.wkType" />, |
| | | <NumberInput source="safeQty" label="table.field.qlyInspect.safeQty" />, |
| | | <NumberInput source="dlyQty" label="table.field.qlyInspect.dlyQty" />, |
| | | <NumberInput source="rcptQty" label="table.field.qlyInspect.rcptQty" />, |
| | | <NumberInput source="isptQty" label="table.field.qlyInspect.isptQty" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const QlyInspectList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <AsnCreatButton /> |
| | | <MyCreateButton onClick={() => { setOpCreateDialog(true) }} /> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='qlyInspect' /> |
| | | <MyExportButton /> |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='qlyInspect' |
| | | bulkActionButtons={<BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <QlyInspectPanel />} |
| | | rowClick='edit' |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool']} |
| | | > |
| | |
| | | <NumberField source="dlyQty" label="table.field.qlyInspect.dlyQty" /> |
| | | <NumberField source="rcptQty" label="table.field.qlyInspect.rcptQty" /> |
| | | <NumberField source="isptQty" label="table.field.qlyInspect.isptQty" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <QlyInspectOpCreate |
| | | open={opCreateDialog} |
| | | setOpen={setOpCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='QlyInspect Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | |
| | | |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
copy from rsf-admin/src/page/qlyIsptItem/QlyIsptItemCreate.jsx
copy to rsf-admin/src/page/qlyInspect/QlyInspectOpCreate.jsx
File was copied from rsf-admin/src/page/qlyIsptItem/QlyIsptItemCreate.jsx |
| | |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | ReferenceField, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | |
| | | const QlyIsptItemCreate = (props) => { |
| | | const QlyInspectOpCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | const isptResult = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_inspect_result')) || []; |
| | | const isptStatus = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_qly_inspect_status')) || []; |
| | | |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="asnCode" |
| | | reference="asnOrder" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.qlyInspect.asnCode" |
| | | optionText="code" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.qlyInspect.wkType" |
| | | source="wkType" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={[required()]} /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.ispectId" |
| | | source="ispectId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.label" |
| | | source="label" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.stockBatch" |
| | | source="stockBatch" |
| | | parse={v => v} |
| | | label="table.field.qlyInspect.safeQty" |
| | | source="safeQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.rcptQty" |
| | | source="rcptQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.dlyQty" |
| | | label="table.field.qlyInspect.dlyQty" |
| | | source="dlyQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.disQty" |
| | | source="disQty" |
| | | label="table.field.qlyInspect.rcptQty" |
| | | source="rcptQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.safeQty" |
| | | source="safeQty" |
| | | label="table.field.qlyInspect.isptQty" |
| | | source="isptQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.picPath" |
| | | source="picPath" |
| | | <AutocompleteInput |
| | | choices={isptStatus} |
| | | optionText="label" |
| | | label="table.field.qlyInspect.isptStatus" |
| | | source="isptStatus" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <AutocompleteInput |
| | | choices={isptResult} |
| | | optionText="label" |
| | | label="table.field.qlyInspect.isptResult" |
| | | source="isptResult" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | | </Grid> |
| | |
| | | ) |
| | | } |
| | | |
| | | export default QlyIsptItemCreate; |
| | | export default QlyInspectOpCreate; |
File was renamed from rsf-admin/src/page/qlyIsptItem/QlyIsptItemCreate.jsx |
| | |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SaveButton, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | Toolbar, |
| | | required, |
| | | useDataProvider, |
| | | useNotify, |
| | | Form, |
| | | useCreateController, |
| | | } from 'react-admin'; |
| | | import { |
| | | Dialog, |
| | |
| | | import MemoInput from "../components/MemoInput"; |
| | | |
| | | const QlyIsptItemCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | const { open, setOpen, record } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | |
| | | <> |
| | | <CreateBase |
| | | record={{}} |
| | | resource="qlyIsptItem" |
| | | transform={(data) => { |
| | | return data; |
| | | }} |
| | |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <Grid item xs={6} display="flex" gap={2}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.ispectId" |
| | | source="ispectId" |
| | | autoFocus |
| | | readOnly |
| | | defaultValue={record?.id} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <StatusSelectInput /> |
| | | </Grid> |
File was renamed from rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetOne, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import QlyIsptItemCreate from "./QlyIsptItemCreate"; |
| | | import QlyIsptItemPanel from "./QlyIsptItemPanel"; |
| | | 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 { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <NumberInput source="ispectId" label="table.field.qlyIsptItem.ispectId" />, |
| | | <TextInput source="matnrCode" label="table.field.qlyIsptItem.matnrCode" />, |
| | | <TextInput source="maktx" label="table.field.qlyIsptItem.maktx" />, |
| | |
| | | <NumberInput source="disQty" label="table.field.qlyIsptItem.disQty" />, |
| | | <NumberInput source="safeQty" label="table.field.qlyIsptItem.safeQty" />, |
| | | <TextInput source="picPath" label="table.field.qlyIsptItem.picPath" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const QlyIsptItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const isptId = useGetRecordId(); |
| | | const { data: dicts, isPending, error } = useGetOne('qlyInspect', { id: isptId }); |
| | | if (dicts == null) {return} |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="qlyIsptItem" |
| | | filter={{ispectId: isptId}} |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.qlyIsptItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='qlyIsptItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='qlyIsptItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | rowClick={false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'ispectId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="ispectId" label="table.field.qlyIsptItem.ispectId" /> |
| | |
| | | <NumberField source="disQty" label="table.field.qlyIsptItem.disQty" /> |
| | | <NumberField source="safeQty" label="table.field.qlyIsptItem.safeQty" /> |
| | | <TextField source="picPath" label="table.field.qlyIsptItem.picPath" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | |
| | | </StyledDatagrid> |
| | | </List> |
| | | <QlyIsptItemCreate |
| | | open={createDialog} |
| | | record={dicts} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | Form, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | useNotify, |
| | | useRedirect, |
| | | useEditContext, |
| | | EditBase, |
| | | useGetOne, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import DialogCloseButton from "../../../components/DialogCloseButton"; |
| | | import EditBaseAside from "../../../components/EditBaseAside"; |
| | | import MemoInput from "../../../components/MemoInput"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | |
| | | const EditToolbar = () => { |
| | | const form = useFormContext(); |
| | | const { record, isPending } = useEditContext(); |
| | | const redirect = useRedirect(); |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton type="button" mutationOptions={{ |
| | | onSuccess: () => { |
| | | redirect('/dictType/' + record?.dictTypeId) |
| | | } |
| | | }} /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const DictDataEdit = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | const {data, isPending, } = useGetOne('dictData', {id: record?.id}); |
| | | if (data == null || data == undefined) {return} |
| | | return ( |
| | | <> |
| | | <Edit |
| | | id={record?.id} |
| | | resource="dictData" |
| | | mutationMode={EDIT_MODE} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <Form> |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={12} md={8}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictData.dictTypeId" |
| | | source="dictTypeId" |
| | | readOnly |
| | | defaultValue={record?.id} |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictData.dictTypeCode" |
| | | source="dictTypeCode" |
| | | defaultValue={record?.code} |
| | | readOnly |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictData.value" |
| | | source="value" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.dictData.label" |
| | | source="label" |
| | | validate={required()} |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.dictData.sort" |
| | | source="sort" |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </Grid> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > |
| | | <SaveButton type="button" mutationOptions={{ |
| | | onSuccess: () => { |
| | | setOpen(false) |
| | | } |
| | | }} /> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Form> |
| | | </Dialog> |
| | | </Edit > |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default DictDataEdit; |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate, useLocation } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | useGetPathForRecord, |
| | | useGetOne, |
| | | Button, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import DictDataCreate from "./DictDataCreate"; |
| | | import EmptyData from "../../../components/EmptyData"; |
| | | import MyCreateButton from "../../../components/MyCreateButton"; |
| | | import MyExportButton from '../../../components/MyExportButton'; |
| | | import PageDrawer from "../../../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import DictDataEdit from "./DictDataEdit"; |
| | | import { use } from "react"; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | | }, |
| | | '& .RaDatagrid-row': { |
| | | cursor: 'auto' |
| | | }, |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 200 |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <TextInput source="dictTypeId" label="table.field.dictData.dictTypeId" />, |
| | | <TextInput source="dictTypeCode" label="table.field.dictData.dictTypeCode" />, |
| | | <TextInput source="value" label="table.field.dictData.value" />, |
| | | <TextInput source="label" label="table.field.dictData.label" />, |
| | | <NumberInput source="sort" label="table.field.dictData.sort" />, |
| | | // <TextInput source="color" label="table.field.dictData.color" />, |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | | source="status" |
| | | choices={[ |
| | | { id: '1', name: 'common.enums.statusTrue' }, |
| | | { id: '0', name: 'common.enums.statusFalse' }, |
| | | ]} |
| | | resettable |
| | | />, |
| | | ] |
| | | |
| | | const DictDataList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [editDialog, setEditDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [select, setSelect] = useState({}); |
| | | const dictId = useGetRecordId(); |
| | | const { data: dicts, isPending, error } = useGetOne('dictType', { id: dictId }); |
| | | |
| | | return ( |
| | | <> |
| | | <Box display="flex" > |
| | | <List |
| | | resource="dictData" |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | | theme.transitions.create(['all'], { |
| | | duration: theme.transitions.duration.enteringScreen, |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.dictData"} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ dictTypeId: dictId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='dictData' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="dictTypeId" label="table.field.dictData.dictTypeId" /> |
| | | <TextField source="dictTypeCode" label="table.field.dictData.dictTypeCode" /> |
| | | <TextField source="value" label="table.field.dictData.value" /> |
| | | <TextField source="label" label="table.field.dictData.label" /> |
| | | <NumberField source="sort" label="table.field.dictData.sort" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <Button onClick={() => { setEditDialog(true) }} label="ra.action.edit"></Button> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode='pessimistic' redirect={"/dictType/" + dictId} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <DictDataEdit |
| | | open={editDialog} |
| | | record={select} |
| | | setOpen={setEditDialog} |
| | | /> |
| | | <DictDataCreate |
| | | open={createDialog} |
| | | record={dicts} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='DictData Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | export default DictDataList; |
| | |
| | | import CustomerTopToolBar from "../../../components/EditTopToolBar"; |
| | | import MemoInput from "../../../components/MemoInput"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | import DictDataList from "../dictData/DictDataList"; |
| | | import DictDataEdit from "./DictDataEdit"; |
| | | import DictDataList from "./DictDataList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | |
| | | |
| | | const DictTypeEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <> |
| | | <Edit |
| | |
| | | import EmptyData from "../../../components/EmptyData"; |
| | | import MyCreateButton from "../../../components/MyCreateButton"; |
| | | import MyExportButton from '../../../components/MyExportButton'; |
| | | import MyField from "../../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" />, |
| | | <DateInput label='common.time.before' source="timeEnd" />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | <TextInput source="code" label="table.field.dictType.code" />, |
| | | <TextInput source="name" label="table.field.dictType.name" />, |
| | | <TextInput source="description" label="table.field.dictType.description" />, |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='dictType' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | rowClick={'edit'} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <MyField source="code" label="table.field.dictType.code" |
| | | onClick={(event, record, val) => { |
| | | event.stopPropagation(); |
| | | assign(record); |
| | | }} |
| | | <TextField source="code" label="table.field.dictType.code" |
| | | // onClick={(event, record, val) => { |
| | | // event.stopPropagation(); |
| | | // assign(record); |
| | | // }} |
| | | /> |
| | | <TextField source="name" label="table.field.dictType.name" /> |
| | | <TextField source="description" label="table.field.dictType.description" /> |
| | |
| | | export default { |
| | | list: DictTypeList, |
| | | edit: DictTypeEdit, |
| | | show: ShowGuesser, |
| | | // show: ShowGuesser, |
| | | recordRepresentation: (record) => { |
| | | return `${record.name}` |
| | | } |
| | |
| | | setOpen(false); |
| | | notify("common.response.success"); |
| | | }; |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_task_reset_type')) || []; |
| | | |
| | | const handleError = async (error) => { |
| | | notify(error.message || "common.response.fail", { |
| | |
| | | parse={(v) => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | {/* <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.serialRule.reset" |
| | | source="reset" |
| | | parse={(v) => v} |
| | | validate={required()} |
| | | /> |
| | | </Grid> */} |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.serialRule.reset" |
| | | source="reset" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={[required()]} /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | |
| | | |
| | | const SerialRuleEdit = () => { |
| | | const translate = useTranslate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_task_reset_type')) || []; |
| | | |
| | | return ( |
| | | <> |
| | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.serialRule.reset" |
| | | source="reset" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | validate={[required()]} /> |
| | | <TextInput |
| | | label="table.field.serialRule.resetDep" |
| | | source="resetDep" |
| | |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const SerialRuleItemCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | const { open, setOpen, record } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_rule_item_type')) || []; |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.ruleId" |
| | | source="ruleId" |
| | | autoFocus |
| | | defaultValue={record?.id} |
| | | readOnly |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.serialRuleItem.wkType" |
| | | source="wkType" |
| | | source="type" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | validate={[required()]} /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo } from "react"; |
| | | import { |
| | | Edit, |
| | | Form, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | useGetOne, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Dialog, DialogContent, DialogTitle, DialogActions } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../../components/EditBaseAside"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'end' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const SerialRuleItemEdit = (props) => { |
| | | const { open, setOpen, record } = props; |
| | | const translate = useTranslate(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_rule_item_type')) || []; |
| | | const handleClose = (event, reason) => { |
| | | if (reason !== "backdropClick") { |
| | | setOpen(false); |
| | | } |
| | | }; |
| | | const { data, isPending, } = useGetOne('serialRuleItem', { id: record?.id }); |
| | | if (data == null || data == undefined) { return } |
| | | |
| | | return ( |
| | | <Edit |
| | | id={record.id} |
| | | redirect="list" |
| | | resource="serialRuleItem" |
| | | mutationMode={EDIT_MODE} |
| | | > |
| | | <Dialog |
| | | open={open} |
| | | onClose={handleClose} |
| | | aria-labelledby="form-dialog-title" |
| | | fullWidth |
| | | disableRestoreFocus |
| | | maxWidth="md" |
| | | > |
| | | <Form |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <DialogTitle id="form-dialog-title" sx={{ |
| | | position: 'sticky', |
| | | top: 0, |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }} |
| | | > |
| | | {translate('update.title')} |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent> |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={12} md={8}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.ruleId" |
| | | source="ruleId" |
| | | readOnly |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.serialRuleItem.wkType" |
| | | source="wkType" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.serialRuleItem.feildValue" |
| | | source="feildValue" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.len" |
| | | source="len" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.lenStr" |
| | | source="lenStr" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.serialRuleItem.sort" |
| | | source="sort" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </Grid> |
| | | </DialogContent> |
| | | <DialogActions> |
| | | |
| | | </DialogActions> |
| | | </Form> |
| | | |
| | | </Dialog> |
| | | </Edit > |
| | | ) |
| | | } |
| | | |
| | | export default SerialRuleItemEdit; |
| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | useGetOne, |
| | | Button, |
| | | } from "react-admin"; |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | |
| | | } from "@/config/setting"; |
| | | import * as Common from "@/utils/common"; |
| | | import CustomerTopToolBar from "../../components/EditTopToolBar"; |
| | | import SerialRuleItemEdit from "./SerialRuleItemEdit"; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | "& .css-1vooibu-MuiSvgIcon-root": { |
| | |
| | | const SerialRuleItemList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [editDialog, setEditDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [select, setSelect] = useState({}); |
| | | const ruleId = useGetRecordId(); |
| | | |
| | | const { data: dicts, isPending, error } = useGetOne('serialRule', { id: ruleId }); |
| | | return ( |
| | | <> |
| | | <Box display="flex"> |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.serialRuleItem"} |
| | | empty={ |
| | | <EmptyData |
| | | onClick={() => { |
| | | setCreateDialog(true); |
| | | }} |
| | | /> |
| | | } |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ ruleId: ruleId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | |
| | | bulkActionButtons={() => ( |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | )} |
| | | rowClick={false} |
| | | rowClick={(id, resource, record) => { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} |
| | | omit={["id", "createTime", "createBy", "memo"]} |
| | | > |
| | | <NumberField source="id" /> |
| | |
| | | source="sort" |
| | | label="table.field.serialRuleItem.sort" |
| | | /> |
| | | <ReferenceField |
| | | source="updateBy" |
| | | <TextField |
| | | source="updateBy$" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | <TextField |
| | | source="createBy$" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | |
| | | sortable={false} |
| | | /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | <EditButton sx={{ padding: "1px", fontSize: ".75rem" }} /> |
| | | <Button onClick={() => { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | | }} label={'ra.action.edit'} |
| | | > </Button> |
| | | <DeleteButton |
| | | sx={{ padding: "1px", fontSize: ".75rem" }} |
| | | mutationMode={OPERATE_MODE} |
| | | redirect={'/serialRule/' + ruleId} |
| | | /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <SerialRuleItemCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <SerialRuleItemCreate open={createDialog} setOpen={setCreateDialog} record={dicts} /> |
| | | <SerialRuleItemEdit open={editDialog} setOpen={setEditDialog} record={select} /> |
| | | <PageDrawer |
| | | title="SerialRuleItem Detail" |
| | | drawerVal={drawerVal} |
| | |
| | | import { Box, Typography, Card, Stack } from "@mui/material"; |
| | | import { styled } from "@mui/material/styles"; |
| | | import SerialRuleCreate from "./SerialRuleCreate"; |
| | | import SerialRuleDetail from "./SerialRuleDetail"; |
| | | import SerialRulePanel from "./SerialRulePanel"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from "../../components/MyExportButton"; |
| | |
| | | <TextInput source="resetDep" label="table.field.serialRule.resetDep" />, |
| | | <TextInput source="currValue" label="table.field.serialRule.currValue" />, |
| | | <TextInput source="lastCode" label="table.field.serialRule.lastCode" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [detailDialog, setDetailDialog] = useState(false); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_rule_item_type')) || []; |
| | | |
| | | // const navigate = useNavigate(); |
| | | // const assign = (record) => { |
| | |
| | | <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" /> |
| | | <TextField label="table.field.serialRule.reset" source="reset$" /> |
| | | <TextField |
| | | source="resetDep" |
| | | label="table.field.serialRule.resetDep" |
| | |
| | | label="table.field.serialRule.lastCode" |
| | | /> |
| | | |
| | | <ReferenceField |
| | | source="updateBy" |
| | | <TextField |
| | | source="updateBy$" |
| | | label="common.field.updateBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="updateTime" |
| | | label="common.field.updateTime" |
| | | showTime |
| | | /> |
| | | <ReferenceField |
| | | source="createBy" |
| | | <TextField |
| | | source="createBy$" |
| | | label="common.field.createBy" |
| | | reference="user" |
| | | link={false} |
| | | sortable={false} |
| | | > |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | /> |
| | | <DateField |
| | | source="createTime" |
| | | label="common.field.createTime" |
| | |
| | | </StyledDatagrid> |
| | | </List> |
| | | <SerialRuleCreate open={createDialog} setOpen={setCreateDialog} /> |
| | | <SerialRuleDetail open={detailDialog} setOpen={setDetailDialog} /> |
| | | {/* <SerialRuleDetail open={detailDialog} setOpen={setDetailDialog} /> */} |
| | | <PageDrawer |
| | | title="SerialRule Detail" |
| | | drawerVal={drawerVal} |
| | |
| | | import { |
| | | Edit, |
| | | SimpleForm, |
| | | FormDataConsumer, |
| | | useTranslate, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | | DateInput, |
| | | SelectInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | SaveButton, |
| | | Toolbar, |
| | | Labeled, |
| | | NumberField, |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import WaitPakinItem from "../waitPakinItem"; |
| | | import WaitPakinItemList from "../waitPakinItem/WaitPakinItemList"; |
| | | |
| | | 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.waitPakin.code" |
| | | source="code" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.waitPakin.ansId" |
| | | source="ansId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.waitPakin.asnCode" |
| | | source="asnCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.waitPakin.barcode" |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.waitPakin.anfme" |
| | | source="anfme" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.waitPakin.ioStatus" |
| | | source="ioStatus" |
| | | choices={[ |
| | | { id: 0, name: '待入库' }, |
| | | { id: 1, name: ' 入库中' }, |
| | | ]} |
| | | /> |
| | | </Stack> |
| | | |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '100%' }}> |
| | | <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.waitPakin.code" |
| | | source="code" |
| | | readOnly |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | <NumberInput |
| | | label="table.field.waitPakin.ansId" |
| | | readOnly |
| | | source="ansId" |
| | | /> |
| | | <TextInput |
| | | label="table.field.waitPakin.asnCode" |
| | | readOnly |
| | | source="asnCode" |
| | | parse={v => v} |
| | | /> |
| | | <SelectInput |
| | | label="table.field.waitPakin.flagDefect" |
| | | readOnly |
| | | source="flagDefect" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.waitPakin.barcode" |
| | | readOnly |
| | | source="barcode" |
| | | parse={v => v} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.waitPakin.anfme" |
| | | readOnly |
| | | source="anfme" |
| | | /> |
| | | <SelectInput |
| | | label="table.field.waitPakin.ioStatus" |
| | | readOnly |
| | | source="ioStatus" |
| | | choices={[ |
| | | { id: 0, name: '待入库' }, |
| | | { id: 1, name: ' 入库中' }, |
| | | ]} |
| | | /> |
| | | </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 > |
| | | <WaitPakinItemList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
copy from rsf-admin/src/page/qlyIsptItem/QlyIsptItemCreate.jsx
copy to rsf-admin/src/page/waitPakin/WaitPakinItemCreate.jsx
File was copied from rsf-admin/src/page/qlyIsptItem/QlyIsptItemCreate.jsx |
| | |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | |
| | | const QlyIsptItemCreate = (props) => { |
| | | const WaitPakinItemCreate = (props) => { |
| | | const { open, setOpen } = props; |
| | | |
| | | const translate = useTranslate(); |
| | |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.ispectId" |
| | | source="ispectId" |
| | | label="table.field.waitPakinItem.pakinId" |
| | | source="pakinId" |
| | | autoFocus |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.maktx" |
| | | label="table.field.waitPakinItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.label" |
| | | source="label" |
| | | parse={v => v} |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.matnrId" |
| | | source="matnrId" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.splrBatch" |
| | | source="splrBatch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.stockBatch" |
| | | source="stockBatch" |
| | | label="table.field.waitPakinItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.rcptQty" |
| | | source="rcptQty" |
| | | label="table.field.waitPakinItem.anfme" |
| | | source="anfme" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.dlyQty" |
| | | source="dlyQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.disQty" |
| | | source="disQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.qlyIsptItem.safeQty" |
| | | source="safeQty" |
| | | label="table.field.waitPakinItem.workQty" |
| | | source="workQty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.qlyIsptItem.picPath" |
| | | source="picPath" |
| | | label="table.field.waitPakinItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.fieldsIndex" |
| | | source="fieldsIndex" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.qty" |
| | | source="qty" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | |
| | | ) |
| | | } |
| | | |
| | | export default QlyIsptItemCreate; |
| | | export default WaitPakinItemCreate; |
File was renamed from rsf-admin/src/page/asnOrder/AsnOrderEdit.jsx |
| | |
| | | ) |
| | | } |
| | | |
| | | const AsnOrderEdit = () => { |
| | | const WaitPakinItemEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | {/* <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrder.code" |
| | | source="code" |
| | | parse={v => v} |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.pakinId" |
| | | source="pakinId" |
| | | autoFocus |
| | | /> |
| | | </Stack> */} |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrder.poCode" |
| | | source="poCode" |
| | | label="table.field.waitPakinItem.maktx" |
| | | source="maktx" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrder.poId" |
| | | source="poId" |
| | | label="table.field.waitPakinItem.matnrId" |
| | | source="matnrId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrder.type" |
| | | source="type" |
| | | label="table.field.waitPakinItem.matnrCode" |
| | | source="matnrCode" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrder.wkType" |
| | | source="wkType" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | {/* <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrder.anfme" |
| | | label="table.field.waitPakinItem.anfme" |
| | | source="anfme" |
| | | validate={required()} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.asnOrder.qty" |
| | | source="qty" |
| | | validate={required()} |
| | | label="table.field.waitPakinItem.workQty" |
| | | source="workQty" |
| | | /> |
| | | </Stack> */} |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrder.logisNo" |
| | | source="logisNo" |
| | | label="table.field.waitPakinItem.unit" |
| | | source="unit" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <DateInput |
| | | label="table.field.asnOrder.arrTime" |
| | | source="arrTime" |
| | | <TextInput |
| | | label="table.field.waitPakinItem.fieldsIndex" |
| | | source="fieldsIndex" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.asnOrder.rleStatus" |
| | | source="rleStatus" |
| | | choices={[ |
| | | { id: 0, name: ' 正常' }, |
| | | { id: 1, name: ' 已释放' }, |
| | | ]} |
| | | validate={required()} |
| | | <NumberInput |
| | | label="table.field.waitPakinItem.qty" |
| | | source="qty" |
| | | /> |
| | | </Stack> |
| | | |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.waitPakinItem.batch" |
| | | source="batch" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | |
| | | ) |
| | | } |
| | | |
| | | export default AsnOrderEdit; |
| | | export default WaitPakinItemEdit; |
copy from rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx
copy to rsf-admin/src/page/waitPakin/WaitPakinItemList.jsx
File was copied from rsf-admin/src/page/qlyIsptItem/QlyIsptItemList.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import QlyIsptItemCreate from "./QlyIsptItemCreate"; |
| | | import QlyIsptItemPanel from "./QlyIsptItemPanel"; |
| | | import WaitPakinItemCreate from "./WaitPakinItemCreate"; |
| | | import WaitPakinItemPanel from "./WaitPakinItemPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <NumberInput source="ispectId" label="table.field.qlyIsptItem.ispectId" />, |
| | | <TextInput source="matnrCode" label="table.field.qlyIsptItem.matnrCode" />, |
| | | <TextInput source="maktx" label="table.field.qlyIsptItem.maktx" />, |
| | | <TextInput source="label" label="table.field.qlyIsptItem.label" />, |
| | | <TextInput source="splrName" label="table.field.qlyIsptItem.splrName" />, |
| | | <TextInput source="splrBatch" label="table.field.qlyIsptItem.splrBatch" />, |
| | | <TextInput source="stockBatch" label="table.field.qlyIsptItem.stockBatch" />, |
| | | <NumberInput source="rcptQty" label="table.field.qlyIsptItem.rcptQty" />, |
| | | <NumberInput source="dlyQty" label="table.field.qlyIsptItem.dlyQty" />, |
| | | <NumberInput source="disQty" label="table.field.qlyIsptItem.disQty" />, |
| | | <NumberInput source="safeQty" label="table.field.qlyIsptItem.safeQty" />, |
| | | <TextInput source="picPath" label="table.field.qlyIsptItem.picPath" />, |
| | | <NumberInput source="pakinId" label="table.field.waitPakinItem.pakinId" />, |
| | | <TextInput source="maktx" label="table.field.waitPakinItem.maktx" />, |
| | | <NumberInput source="matnrId" label="table.field.waitPakinItem.matnrId" />, |
| | | <TextInput source="matnrCode" label="table.field.waitPakinItem.matnrCode" />, |
| | | <NumberInput source="anfme" label="table.field.waitPakinItem.anfme" />, |
| | | <NumberInput source="workQty" label="table.field.waitPakinItem.workQty" />, |
| | | <TextInput source="unit" label="table.field.waitPakinItem.unit" />, |
| | | <TextInput source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" />, |
| | | <NumberInput source="qty" label="table.field.waitPakinItem.qty" />, |
| | | <TextInput source="batch" label="table.field.waitPakinItem.batch" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | |
| | | />, |
| | | ] |
| | | |
| | | const QlyIsptItemList = () => { |
| | | const WaitPakinItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | |
| | | }), |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.qlyIsptItem"} |
| | | title={"menu.waitPakinItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='qlyIsptItem' /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='waitPakinItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='qlyIsptItem' |
| | | preferenceKey='waitPakinItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="ispectId" label="table.field.qlyIsptItem.ispectId" /> |
| | | <TextField source="matnrCode" label="table.field.qlyIsptItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.qlyIsptItem.maktx" /> |
| | | <TextField source="label" label="table.field.qlyIsptItem.label" /> |
| | | <TextField source="splrName" label="table.field.qlyIsptItem.splrName" /> |
| | | <TextField source="splrBatch" label="table.field.qlyIsptItem.splrBatch" /> |
| | | <TextField source="stockBatch" label="table.field.qlyIsptItem.stockBatch" /> |
| | | <NumberField source="rcptQty" label="table.field.qlyIsptItem.rcptQty" /> |
| | | <NumberField source="isptResult$" label="table.field.qlyIsptItem.isptResult" /> |
| | | <NumberField source="dlyQty" label="table.field.qlyIsptItem.dlyQty" /> |
| | | <NumberField source="disQty" label="table.field.qlyIsptItem.disQty" /> |
| | | <NumberField source="safeQty" label="table.field.qlyIsptItem.safeQty" /> |
| | | <TextField source="picPath" label="table.field.qlyIsptItem.picPath" /> |
| | | <NumberField source="pakinId" label="table.field.waitPakinItem.pakinId" /> |
| | | <TextField source="maktx" label="table.field.waitPakinItem.maktx" /> |
| | | <NumberField source="matnrId" label="table.field.waitPakinItem.matnrId" /> |
| | | <TextField source="matnrCode" label="table.field.waitPakinItem.matnrCode" /> |
| | | <NumberField source="anfme" label="table.field.waitPakinItem.anfme" /> |
| | | <NumberField source="workQty" label="table.field.waitPakinItem.workQty" /> |
| | | <TextField source="unit" label="table.field.waitPakinItem.unit" /> |
| | | <TextField source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" /> |
| | | <NumberField source="qty" label="table.field.waitPakinItem.qty" /> |
| | | <TextField source="batch" label="table.field.waitPakinItem.batch" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | |
| | | <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' }} /> |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <QlyIsptItemCreate |
| | | <WaitPakinItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='QlyIsptItem Detail' |
| | | title='WaitPakinItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | |
| | | ) |
| | | } |
| | | |
| | | export default QlyIsptItemList; |
| | | export default WaitPakinItemList; |
| | |
| | | import WaitPakinCreate from "./WaitPakinCreate"; |
| | | import WaitPakinPanel from "./WaitPakinPanel"; |
| | | 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 AddIcon from '@mui/icons-material/Add'; |
| | | import request from '@/utils/request'; |
| | | |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.waitPakin.code" />, |
| | | <NumberInput source="ansId" label="table.field.waitPakin.ansId" />, |
| | | <TextInput source="asnCode" label="table.field.waitPakin.asnCode" />, |
| | |
| | | { id: 1, name: ' 入库中' }, |
| | | ]} |
| | | />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const WaitPakinList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='waitPakin' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakin' |
| | | bulkActionButtons={<> <CreateTaskButton /> <BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <WaitPakinPanel />} |
| | | rowClick='edit' |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | |
| | | <TextField source="barcode" label="table.field.waitPakin.barcode" /> |
| | | <NumberField source="anfme" label="table.field.waitPakin.anfme" /> |
| | | <TextField source="ioStatus$" label="table.field.waitPakin.ioStatus" sortable={false} /> |
| | | |
| | | <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> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | <EditButton label="toolbar.detail" sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | 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 { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <NumberInput source="pakinId" label="table.field.waitPakinItem.pakinId" />, |
| | | <TextInput source="maktx" label="table.field.waitPakinItem.maktx" />, |
| | | <NumberInput source="matnrId" label="table.field.waitPakinItem.matnrId" />, |
| | |
| | | <TextInput source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" />, |
| | | <NumberInput source="qty" label="table.field.waitPakinItem.qty" />, |
| | | <TextInput source="batch" label="table.field.waitPakinItem.batch" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const WaitPakinItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const pakinId = useGetRecordId(); |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="waitPakinItem" |
| | | filter={{pakinId: pakinId}} |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinItem' |
| | |
| | | <TextField source="fieldsIndex" label="table.field.waitPakinItem.fieldsIndex" /> |
| | | <NumberField source="qty" label="table.field.waitPakinItem.qty" /> |
| | | <TextField source="batch" label="table.field.waitPakinItem.batch" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <TextField source="flagDefect" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <WaitPakinItemCreate |
| | |
| | | @ApiOperation("组拖") |
| | | @PostMapping("/waitPakin/merge") |
| | | public R pikinOrder(@RequestBody WaitPakinParam waitPakin) { |
| | | Long userId = getLoginUserId(); |
| | | if (Objects.isNull(waitPakin)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | |
| | | if (Objects.isNull(waitPakin.getItems()) || waitPakin.getItems().isEmpty()) { |
| | | return R.error("跟踪码不能为空!!"); |
| | | } |
| | | return R.ok(mobileService.mergeItems(waitPakin)); |
| | | return R.ok(mobileService.mergeItems(waitPakin, userId)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:update')") |
| | |
| | | return mobileService.completeOrder(id, getLoginUserId()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取不良托盘物料") |
| | | @PostMapping("/defect/matnrs") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | public R getAsnDefectItemByCode(@RequestBody Map<String, Object> map) { |
| | | if (Objects.isNull(map)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.getItemByContainer(map); |
| | | } |
| | | |
| | | @ApiOperation("获取订单不良物料") |
| | | @PostMapping("/defect/{trackCode}") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | public R defectProducts(@PathVariable String trackCode) { |
| | | if (Objects.isNull(trackCode)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.defectProducts(trackCode); |
| | | } |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title MatnrDefectType |
| | | * @description |
| | | * @create 2025/4/12 09:34 |
| | | */ |
| | | public enum MatnrDefectType { |
| | | //物料不良类型 |
| | | MATNR_DEFECT_NORMAL("0", "正常"), |
| | | MATNR_DEFECT_FIX("1", "待返修"), |
| | | MATNR_DEFECT_SCRAP("2", "待报废"), |
| | | MATNR_DEFECT_DEGRADE("3", "待降级"), |
| | | MATNR_DEFECT_PENDING("4", "待定"), |
| | | ; |
| | | |
| | | MatnrDefectType(String type, String desc) { |
| | | this.type = Short.parseShort(type); |
| | | this.val = desc; |
| | | } |
| | | |
| | | public Short type; |
| | | public String val; |
| | | } |
| | |
| | | |
| | | R getDeltByCode(String code); |
| | | |
| | | WaitPakin mergeItems(WaitPakinParam waitPakin); |
| | | WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId); |
| | | |
| | | WaitPakin unBind(WaitPakinParam param); |
| | | |
| | |
| | | R completeOrder(Long id, Long loginUserId); |
| | | |
| | | R getItemByContainer(Map<String, Object> params); |
| | | |
| | | R defectProducts(String trackCode); |
| | | } |
| | |
| | | import com.vincent.rsf.server.common.security.JwtSubject; |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.common.utils.JSONUtil; |
| | | import com.vincent.rsf.server.common.utils.JwtUtil; |
| | | import com.vincent.rsf.server.manager.controller.params.IsptItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | |
| | | import com.vincent.rsf.server.system.entity.*; |
| | | import com.vincent.rsf.server.system.mapper.FieldsMapper; |
| | | import com.vincent.rsf.server.system.mapper.TenantMapper; |
| | | 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; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | Double receiptQty = receipts.stream().mapToDouble(ReceiptDetlsDto::getReceiptQty).sum(); |
| | | |
| | | if (Objects.isNull(receiptQty) || receiptQty.compareTo(0.00) <= 0) { |
| | | throw new CoolException("收货数量不能小于或等于零!!"); |
| | | } |
| | | |
| | | String asnCode = receipts.stream().findFirst().get().getAsnCode(); |
| | | |
| | | AsnOrder asnOrder = asnOrderMapper.getOne(new LambdaQueryWrapper<AsnOrder>() |
| | |
| | | */ |
| | | @Override |
| | | public R getReceiptAreas() { |
| | | return R.ok(warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>().eq(WarehouseAreas::getType, WarehouseAreaType.WAREHOUSE_AREA_RECEIPT.type))); |
| | | List<WarehouseAreas> areas = warehouseAreasService.list(new LambdaQueryWrapper<WarehouseAreas>().eq(WarehouseAreas::getType, WarehouseAreaType.WAREHOUSE_AREA_RECEIPT.type)); |
| | | return R.ok(areas); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * @param |
| | | * @param userId |
| | | * @return |
| | | * @author Ryan |
| | | * @description PDA组拖 |
| | | * @param |
| | | * @return |
| | | * @time 2025/3/29 14:26 |
| | | */ |
| | | @Override |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin) { |
| | | return waitPakinService.mergeItems(waitPakin); |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId) { |
| | | return waitPakinService.mergeItems(waitPakin, userId); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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)); |
| | | Short flagDefect = 0; |
| | | if (!Objects.isNull(params.get("type")) && params.get("type").equals("defective")) { |
| | | flagDefect = 1; |
| | | } |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>() |
| | | .eq(WaitPakin::getBarcode, params.get("barcode").toString()) |
| | | .eq(WaitPakin::getFlagDefect, flagDefect) |
| | | .in(WaitPakin::getIoStatus, asList)); |
| | | if (Objects.isNull(waitPakin)) { |
| | | return R.ok(new ArrayList<>()); |
| | |
| | | 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()); |
| | | if (!Objects.isNull(params.get("type")) && params.get("type").equals("defective")) { |
| | | return R.ok(pakinItems); |
| | | } else { |
| | | 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); |
| | | } |
| | | return R.ok(warehouseAreasItems); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 不良标签 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/12 08:12 |
| | | */ |
| | | @Override |
| | | public R defectProducts(String trackCode) { |
| | | AsnOrderItem orderItem = asnOrderItemMapper.selectOne(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getTrackCode, trackCode)); |
| | | return R.ok(orderItem); |
| | | } |
| | | |
| | | /** |
| | |
| | | FieldsItem item = new FieldsItem(); |
| | | item.setUuid(uuid) |
| | | .setValue(template.get(obj.getFields()).toString()) |
| | | .setMatnrId(Long.parseLong(template.get("matnrId").toString())) |
| | | .setMatnrId(!Objects.isNull(template.get("matnrId")) ? Long.parseLong(template.get("matnrId").toString()) : null) |
| | | .setFieldsId(obj.getId()); |
| | | fieldsItems.add(item); |
| | | } |
| | |
| | | FieldsItem item = new FieldsItem(); |
| | | item.setUuid(index) |
| | | .setFieldsId(field.getId()) |
| | | .setMatnrId(Long.parseLong(params.get("matnrId").toString())) |
| | | .setMatnrId(!Objects.isNull(params.get("matnrId")) ? Long.parseLong(params.get("matnrId").toString()) : null) |
| | | .setValue(params.get(field.getFields()).toString()); |
| | | if (!fieldsItemService.save(item)) { |
| | | throw new CoolException("扩展字段修改失败!!"); |
| | |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getId, map.get("ids")).eq(AsnOrderItem::getStatus, 1)); |
| | | } else { |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().last("limit 1")); |
| | | orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>()); |
| | | } |
| | | |
| | | ExcelUtil.build(ExcelUtil.create(orderItems, AsnOrderItem.class, true), response); |
| | |
| | | if (!Objects.isNull(map.get("ids"))) { |
| | | matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().in(Matnr::getId, map.get("ids")).eq(Matnr::getStatus, 1)); |
| | | } else { |
| | | matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().last("limit 1")); |
| | | matnrs = matnrService.list(); |
| | | } |
| | | ExcelUtil.build(ExcelUtil.create(matnrs, Matnr.class, true), response); |
| | | ExcelUtil.build(ExcelUtil.create(matnrs, Matnr.class, false), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:list')") |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyInspect; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public R save(@RequestBody QlyInspect qlyInspect) { |
| | | qlyInspect.setCreateBy(getLoginUserId()); |
| | | qlyInspect.setUpdateBy(getLoginUserId()); |
| | | if (!qlyInspectService.save(qlyInspect)) { |
| | | if (!qlyInspectService.qlySave(qlyInspect)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(qlyInspect); |
| | |
| | | @ApiModelProperty("跟踪码") |
| | | private List<PakinItem> items; |
| | | |
| | | @ApiModelProperty("组拖类型{null: 组拖, defective: 不良品}") |
| | | private String type; |
| | | |
| | | } |
| | | |
| | |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
| | |
| | | private Short ioStatus; |
| | | |
| | | /** |
| | | * 是否不良品 |
| | | */ |
| | | @ApiModelProperty("是否不良品") |
| | | private Short flagDefect; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 冻结 ") |
| | |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // WarehouseAreas warehouseAreas = new WarehouseAreas( |
| | | // null, // 编号 |
| | | // null, // 名称 |
| | | // null, // 编码 |
| | | // null, // 货主标识(*) |
| | | // null, // 供应商标识 |
| | | // null, // 允许负库存(*) |
| | | // null, // 是否标签管理(*)[非空] |
| | | // null, // 支持混放(*)[非空] |
| | | // null, // 状态[非空] |
| | | // null, // 是否删除[非空] |
| | | // null, // 租户 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间[非空] |
| | | // null, // 修改人员 |
| | | // null, // 修改时间[非空] |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getShipperId$(){ |
| | | CompanysService service = SpringUtils.getBean(CompanysService.class); |
| | | Companys shipper = service.getById(this.shipperId); |
| | |
| | | public class MatnrsTemplate { |
| | | |
| | | @NotNull |
| | | @Excel(name = "物料名称") |
| | | @Excel(name = "物料名称*") |
| | | @ExcelComment(example = "华为手机") |
| | | private String name; |
| | | |
| | | @NotNull |
| | | @Excel(name = "分类助记码") |
| | | @Excel(name = "分类助记码*") |
| | | @ExcelComment(example = "256874556") |
| | | private String groupCode; |
| | | |
| | | @NotNull |
| | | @Excel(name = "分类名称") |
| | | @Excel(name = "分类名称*") |
| | | @ExcelComment(example = "移动设备") |
| | | private String groupName; |
| | | |
| | | @NotNull |
| | | @Excel(name = "物料助记码") |
| | | @Excel(name = "物料助记码*") |
| | | @ExcelComment(example = "P3528461569") |
| | | private String erpCode; |
| | | |
| | |
| | | List<AsnOrder> getUnInspect(Map<String, Object> map); |
| | | |
| | | R saveSelected(IsptOrderParam param, Long loginUserId); |
| | | |
| | | boolean qlySave(QlyInspect qlyInspect); |
| | | } |
| | |
| | | |
| | | public interface WaitPakinService extends IService<WaitPakin> { |
| | | |
| | | WaitPakin mergeItems(WaitPakinParam waitPakin); |
| | | WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId); |
| | | |
| | | WaitPakin unBind(WaitPakinParam param); |
| | | } |
| | |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("收货明细为空!!"); |
| | | } |
| | | if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) { |
| | | throw new CoolException("收货数量不能为零!!"); |
| | | } |
| | | // if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) { |
| | | // throw new CoolException("收货数量不能为零!!"); |
| | | // } |
| | | AsnOrder order = this.getById(asrder.getId()); |
| | | AsnOrderLog orderLog = new AsnOrderLog(); |
| | | order.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val)); |
| | |
| | | AsnOrderItemLog itemLog = new AsnOrderItemLog(); |
| | | BeanUtils.copyProperties(item, itemLog); |
| | | itemLog.setAsnItemId(itemLog.getId()) |
| | | .setLogId(orderLog.getId()) |
| | | .setAsnId(item.getAsnId()); |
| | | logs.add(itemLog); |
| | | }); |
| | |
| | | } |
| | | return R.ok("保存成功!!"); |
| | | } |
| | | |
| | | @Override |
| | | public boolean qlySave(QlyInspect qlyInspect) { |
| | | String code = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_INSPECT_CODE, qlyInspect); |
| | | if (Objects.isNull(code) || StringUtils.isBlank(code)) { |
| | | throw new CoolException("编码规则错误:" + "请检查编码:" + "「SYS_INSPECT_CODE」" + "是否设置成功!!"); |
| | | } |
| | | qlyInspect.setCode(code); |
| | | if (Objects.isNull(qlyInspect.getAsnCode()) || StringUtils.isBlank(qlyInspect.getAsnCode())) { |
| | | throw new CoolException("收货单号不能为空!!"); |
| | | } |
| | | AsnOrder asnOrder = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getId, qlyInspect.getAsnCode())); |
| | | if (Objects.isNull(asnOrder)) { |
| | | throw new CoolException("收货单不存在!!"); |
| | | } |
| | | qlyInspect.setAsnCode(asnOrder.getCode()).setAsnId(asnOrder.getId()); |
| | | |
| | | return this.save(qlyInspect); |
| | | } |
| | | } |
| | |
| | | |
| | | 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.manager.controller.params.WaitPakinParam; |
| | |
| | | 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; |
| | | |
| | |
| | | private LocService locService; |
| | | |
| | | /** |
| | | * @param |
| | | * @param userId |
| | | * @return |
| | | * @author Ryan |
| | | * @description 组拖 |
| | | * @param |
| | | * @return |
| | | * @time 2025/3/29 14:42 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin) { |
| | | public WaitPakin mergeItems(WaitPakinParam waitPakin, Long userId) { |
| | | if (waitPakin.getItems().isEmpty()) { |
| | | throw new CoolException("参数错误:物料跟踪码为空!"); |
| | | } |
| | |
| | | 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 (WarehouseAreasItem item : warehouseAreasItems) { |
| | | WaitPakinItem pakinItem = new WaitPakinItem(); |
| | | pakinItem.setAnfme(item.getAnfme()) |
| | | .setPakinId(waitPakin1.getId()) |
| | | .setAsnId(item.getAsnId()) |
| | | .setAsnCode(item.getAsnCode()) |
| | | .setAsnItemId(item.getId()) |
| | | .setBatch(item.getSplrBatch()) |
| | | .setUnit(item.getStockUnit()) |
| | | .setFieldsIndex(item.getFieldsIndex()) |
| | | .setMatnrId(item.getMatnrId()) |
| | | .setMaktx(item.getMaktx()) |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | } |
| | | pakinItem |
| | | .setAnfme(waitPakinItem.getReceiptQty()) |
| | | .setTrackCode(waitPakinItem.getTrackCode()); |
| | | /**更新单据执行中库存*/ |
| | | // if (v.compareTo(item.getAnfme()) > 0) {throw new CoolException("执行中数量大于收货数量!!");} |
| | | // if (!asnOrderItemService.update(new LambdaUpdateWrapper<AsnOrderItem>() |
| | | // .eq(AsnOrderItem::getTrackCode, waitPakinItem.getTrackCode()).set(AsnOrderItem::getWorkQty, v))) { |
| | | // throw new CoolException("执行中库存更新失败!!"); |
| | | // } |
| | | } |
| | | if (!Objects.isNull(waitPakin.getType()) && waitPakin.getType().equals("defective")) { |
| | | List<AsnOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getTrackCode, tracks)); |
| | | if (Objects.isNull(orderItems) || orderItems.isEmpty()) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | items.add(pakinItem); |
| | | for (AsnOrderItem item : orderItems) { |
| | | WaitPakinItem pakinItem = new WaitPakinItem(); |
| | | pakinItem.setAnfme(item.getAnfme()) |
| | | .setPakinId(waitPakin1.getId()) |
| | | .setAsnId(item.getAsnId()) |
| | | .setAsnCode(item.getAsnCode()) |
| | | .setAsnItemId(item.getId()) |
| | | .setBatch(item.getSplrBatch()) |
| | | .setUnit(item.getStockUnit()) |
| | | .setFieldsIndex(item.getFieldsIndex()) |
| | | .setMatnrId(item.getMatnrId()) |
| | | .setMaktx(item.getMaktx()) |
| | | .setUpdateBy(userId) |
| | | .setCreateBy(userId) |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | } |
| | | pakinItem.setAnfme(waitPakinItem.getReceiptQty()).setTrackCode(waitPakinItem.getTrackCode()); |
| | | } |
| | | } |
| | | items.add(pakinItem); |
| | | } |
| | | } else { |
| | | 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("物料未送至收货区!!"); |
| | | } |
| | | for (WarehouseAreasItem item : warehouseAreasItems) { |
| | | WaitPakinItem pakinItem = new WaitPakinItem(); |
| | | pakinItem.setAnfme(item.getAnfme()) |
| | | .setPakinId(waitPakin1.getId()) |
| | | .setAsnId(item.getAsnId()) |
| | | .setAsnCode(item.getAsnCode()) |
| | | .setAsnItemId(item.getId()) |
| | | .setBatch(item.getSplrBatch()) |
| | | .setUnit(item.getStockUnit()) |
| | | .setFieldsIndex(item.getFieldsIndex()) |
| | | .setMatnrId(item.getMatnrId()) |
| | | .setMaktx(item.getMaktx()) |
| | | .setUpdateBy(userId) |
| | | .setCreateBy(userId) |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |
| | | if (waitPakinItem.getTrackCode().equals(item.getTrackCode())) { |
| | | if (waitPakinItem.getReceiptQty() > item.getAnfme()) { |
| | | throw new CoolException("组拖数量不能大于收货数量!!"); |
| | | } |
| | | pakinItem.setAnfme(waitPakinItem.getReceiptQty()).setTrackCode(waitPakinItem.getTrackCode()); |
| | | } |
| | | } |
| | | items.add(pakinItem); |
| | | } |
| | | } |
| | | double sum1 = items.stream().mapToDouble(WaitPakinItem::getAnfme).sum(); |
| | | if (!waitPakinItemService.saveBatch(items)) { |
| | |
| | | return " 年"; |
| | | case "month": |
| | | return " 月"; |
| | | case "day": |
| | | case "dd": |
| | | return " 天"; |
| | | case "non": |
| | | return " 无"; |
| | | default: |
| | | return String.valueOf(this.reset); |
| | | } |
| | |
| | | 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 |
| | | # url: jdbc:mysql://192.168.0.116: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 |
| | | url: jdbc:mysql://127.0.0.1:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: rsf |
| | | password: 34821015 |
| | | type: com.alibaba.druid.pool.DruidDataSource |