| | |
| | | VITE_BASE_IP=192.168.4.13 |
| | | VITE_BASE_IP=192.168.4.24 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | import ConstructionIcon from "@mui/icons-material/Construction"; |
| | | import FileDownloadIcon from '@mui/icons-material/FileDownload'; |
| | | import EditIcon from '@mui/icons-material/Edit'; |
| | | import TaskIcon from '@mui/icons-material/Task'; |
| | | import request from '@/utils/request'; |
| | | |
| | | |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const [billReload, setBillReload] = useState(null); |
| | | |
| | | const navigate = useNavigate(); |
| | | const assign = (record) => { |
| | |
| | | preferenceKey='asnOrder' |
| | | bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={() => false} |
| | | expand={<AsnOrderPanel />} |
| | | expand={<AsnOrderPanel setBillReload={setBillReload} />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId']} |
| | | > |
| | |
| | | > |
| | | </Button> */} |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | asnId={modalType} |
| | | billReload={billReload} |
| | | /> |
| | | <PageDrawer |
| | | title='AsnOrder Detail' |
| | |
| | | </Button> |
| | | ) |
| | | } |
| | | |
| | | const CompleteButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const requestComplete = async () => { |
| | | const { data: { code, data, msg } } = await request.post(`/asnOrder/complete/${record.id}`); |
| | | |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | |
| | | return ( |
| | | <Button onClick={requestComplete} label={"toolbar.complete"} color="success"> |
| | | <TaskIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | |
| | | import DictSelect from "../components/DictSelect"; |
| | | |
| | | const AsnOrderModal = (props) => { |
| | | const { open, setOpen, asnId } = props; |
| | | const { open, setOpen, asnId, billReload } = props; |
| | | |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | |
| | | const res = await request.post(`/asnOrder/items/save`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | setOpen(false); |
| | | billReload() |
| | | refresh(); |
| | | } else { |
| | | notify(res.data.msg); |
| | |
| | | if (res?.data?.code === 200) { |
| | | setOpen(false); |
| | | refresh(); |
| | | |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import PrintModal from './PrintModal'; |
| | | import { width } from "@mui/system"; |
| | | const AsnOrderPanel = () => { |
| | | const AsnOrderPanel = ({ setBillReload }) => { |
| | | const record = useRecordContext(); |
| | | if (!record) return null; |
| | | const translate = useTranslate(); |
| | |
| | | |
| | | useEffect(() => { |
| | | debouncedHttp({ maktx }); |
| | | setBillReload(http) |
| | | }, [asnId, maktx]); |
| | | |
| | | useEffect(() => { |
| | | setBillReload(http) |
| | | }, []); |
| | | |
| | | |
| | | |
| | | const http = async (parmas) => { |
| | |
| | | notify(res.data.msg); |
| | | } |
| | | } |
| | | |
| | | |
| | | const debouncedHttp = useMemo(() => debounce(http, 300), []); |
| | | |
| | |
| | | }, |
| | | { |
| | | field: 'trackCode', |
| | | headerName: translate('table.field.asnOrderItem.barcode') |
| | | headerName: translate('table.field.asnOrderItem.barcode'), |
| | | width: 150 |
| | | }, |
| | | { |
| | | field: 'prodTime', |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.qlyInspect"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={<EmptyData |
| | | children={ |
| | | <Box sx={{ gap: 2, display: 'flex' }}> |
| | | <AsnCreatButton isInit={true} /> |
| | | </Box> |
| | | } |
| | | onClick={() => { }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | |
| | | ) |
| | | } |
| | | |
| | | const AsnCreatButton = () => { |
| | | const AsnCreatButton = ({ isInit }) => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | |
| | | |
| | | return ( |
| | | <> |
| | | <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"}> |
| | | <AddIcon /> |
| | | </Button> |
| | | { |
| | | isInit ? <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"} variant="contained" |
| | | color="primary"> |
| | | <AddIcon /> |
| | | </Button> : <Button onClick={() => setCreateDialog(true)} label={"toolbar.asnCreate"} > |
| | | <AddIcon /> |
| | | </Button> |
| | | } |
| | | |
| | | |
| | | <AsnSelModal |
| | | open={createDialog} |
| | |
| | | preferenceKey='warehouseAreasItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'areaId', 'matnrId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="areaId" label="table.field.warehouseAreasItem.areaId" /> |