| | |
| | | VITE_BASE_IP=127.0.0.1 |
| | | VITE_BASE_IP=192.168.4.24 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | |
| | | // create a record |
| | | create: async (resource, params) => { |
| | | console.log("create", resource, params); |
| | | const res = await request.post(resource + "/save", params?.data); |
| | | const { code, msg, data } = res.data; |
| | | if (code === 200) { |
| | |
| | | |
| | | // update a record based on a patch |
| | | update: async (resource, params) => { |
| | | console.log("update", resource, params); |
| | | const res = await request.post(resource + "/update", { |
| | | id: params.id, |
| | | ...params.data, |
| | |
| | | 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 FileDownloadIcon from '@mui/icons-material/FileDownload'; |
| | | import EditIcon from '@mui/icons-material/Edit'; |
| | | import TaskIcon from '@mui/icons-material/Task'; |
| | | import CloseIcon from '@mui/icons-material/Close'; |
| | | import request from '@/utils/request'; |
| | | |
| | | |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 300 |
| | | width: 320 |
| | | }, |
| | | '& .status': { |
| | | width: 90 |
| | | }, |
| | | })); |
| | | |
| | |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <TextField source="exceStatus$" label="common.field.status" /> |
| | | {/* <BooleanField source="statusBool" label="common.field.status" sortable={false} /> */} |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="common.field.status" /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt" width={300} > |
| | | {/* <Button label="toolbar.print" onClick={print}> |
| | |
| | | </Button> */} |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <CloseButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | |
| | | |
| | | return ( |
| | | <Button onClick={requestComplete} label={"toolbar.complete"} color="success"> |
| | | record.exceStatus === 1 && (record.anfme === record.qty ? <Button onClick={requestComplete} label={"toolbar.complete"} color="success"> |
| | | <TaskIcon /> |
| | | </Button> |
| | | </Button> : <ConfirmButton label={"toolbar.complete"} color="success" data={'当前收货数量小于计划数量,是否确认完成'} startIcon={<TaskIcon />} onConfirm={requestComplete} />) |
| | | |
| | | ) |
| | | |
| | | |
| | | } |
| | | |
| | | const CloseButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const requestClose = async () => { |
| | | const { data: { code, data, msg } } = await request.post(`/asnOrder/close/${record.id}`); |
| | | |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | (<Button onClick={requestClose} label={"toolbar.close"} color="error"> |
| | | <CloseIcon /> |
| | | </Button>) |
| | | ) |
| | | } |
| | |
| | | import debounce from 'lodash/debounce'; |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import PrintModal from './PrintModal'; |
| | | import { width } from "@mui/system"; |
| | | import PrintIcon from '@mui/icons-material/Print'; |
| | | const AsnOrderPanel = ({ billReload }) => { |
| | | const record = useRecordContext(); |
| | | if (!record) return null; |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <Button size="small" variant="contained" color="secondary" onClick={modalChange}>{translate("toolbar.batchPrint")}</Button> |
| | | <Button size="small" color="secondary" onClick={modalChange} startIcon={<PrintIcon />}>{translate("toolbar.batchPrint")}</Button> |
| | | |
| | | <PrintModal |
| | | open={createDialog} |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <Button size="small" variant="contained" color="secondary" onClick={() => setCreateDialog(true)}>{translate("toolbar.print")}</Button> |
| | | <Button size="small" color="secondary" onClick={() => setCreateDialog(true)} startIcon={<PrintIcon />}>{translate("toolbar.print")}</Button> |
| | | |
| | | <PrintModal |
| | | open={createDialog} |
New file |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { useTheme } from '@mui/material/styles'; |
| | | import CircleIcon from '@mui/icons-material/Circle'; |
| | | |
| | | const BillStatusField = () => { |
| | | const record = useRecordContext(); |
| | | const theme = useTheme(); |
| | | const color = { |
| | | 0: '#BFBFBF', |
| | | 1: '#FFC53D', |
| | | 2: '#52C41A', |
| | | 3: '#595959', |
| | | 4: '#FF4D4F', |
| | | } |
| | | return ( |
| | | <Typography |
| | | variant="body2" |
| | | sx={{ display: 'flex', alignItems: 'center' }} |
| | | > |
| | | <CircleIcon sx={{ fontSize: 10, color: color[record.exceStatus || 0], marginRight: '3px' }} /> {record.exceStatus$} |
| | | </Typography > |
| | | ) |
| | | |
| | | } |
| | | |
| | | export default BillStatusField; |
| | |
| | | <DialogTitle>{translate('common.msg.confirm.tip')}</DialogTitle> |
| | | <DialogContent> |
| | | <DialogContentText> |
| | | {translate('common.msg.confirm.desc')} |
| | | {data ? data : translate('common.msg.confirm.desc')} |
| | | </DialogContentText> |
| | | </DialogContent> |
| | | <DialogActions> |
| | |
| | | const resource = useResourceContext(); |
| | | const translate = useTranslate(); |
| | | |
| | | |
| | | |
| | | return ( |
| | | <TopToolbar sx={{ |
| | | marginTop: 1, |
| | |
| | | required, |
| | | useRecordContext, |
| | | DeleteButton, |
| | | useNotify, |
| | | useRedirect, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | const form = useFormContext(); |
| | | const redirect = useRedirect(); |
| | | const notify = useNotify(); |
| | | const onSuccess = (data) => { |
| | | const { dictTypeId, dictTypeCode } = data |
| | | notify(`修改成功!`); |
| | | redirect(`/dictData?dictTypeId=${dictTypeId}&code=${dictTypeCode}`); |
| | | } |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <SaveButton type="button" mutationOptions={{ onSuccess }} /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="dictTypeId" label="table.field.dictData.dictTypeId" />, |
| | | <TextInput source="dictTypeCode" label="table.field.dictData.dictTypeCode" />, |