| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { useLocation, useNavigate } from 'react-router-dom'; |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button, |
| | | useRedirect, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 320 |
| | | width: 220 |
| | | }, |
| | | '& .wkType': { |
| | | width: 110 |
| | | }, |
| | | '& .status': { |
| | | width: 100 |
| | | width: 90 |
| | | }, |
| | | })); |
| | | |
| | |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | | <TextInput source="type" label="table.field.asnOrder.type" />, |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{dictTypeCode: 'sys_business_type'}} 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" />, |
| | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const [select, setSelect] = useState(0); |
| | | const billReload = useRef(); |
| | | const navigate = useNavigate(); |
| | | const location = useLocation(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | const assign = (record) => { |
| | | navigate(`/asnOrderItem?asnId=${record.id}`); |
| | | }; |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | |
| | | sx={{ width: '100%' }} |
| | | preferenceKey='asnOrder' |
| | | bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick={() => 'edit'} |
| | | rowClick={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.asnOrder.code" /> |
| | | <TextField source="poCode" label="table.field.asnOrder.poCode" /> |
| | | <NumberField source="poId" label="table.field.asnOrder.poId" /> |
| | | <TextField source="type$" label="table.field.asnOrder.type" /> |
| | | <TextField source="wkType$" label="table.field.asnOrder.wkType" /> |
| | | <TextField cellClassName="wkType" source="wkType$" label="table.field.asnOrder.wkType" /> |
| | | <NumberField source="anfme" label="table.field.asnOrder.anfme" /> |
| | | <NumberField source="qty" label="table.field.asnOrder.qty" /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <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} > |
| | | <WrapperField cellClassName="opt" label="common.field.opt" > |
| | | <EditButton label="toolbar.detail"></EditButton> |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | |
| | | |
| | | const MyButton = ({ setCreateDialog, setmodalType }) => { |
| | | const record = useRecordContext(); |
| | | const handleEditClick = () => { |
| | | const handleEditClick = (btn) => { |
| | | btn.stopPropagation(); |
| | | const id = record.id; |
| | | setmodalType(id); |
| | | setCreateDialog(true); |
| | |
| | | <Button |
| | | color="primary" |
| | | startIcon={<EditIcon />} |
| | | onClick={() => handleEditClick()} |
| | | onClick={(btn) => handleEditClick(btn)} |
| | | sx={{ ml: 1 }} |
| | | label={'ra.action.edit'} |
| | | > |
| | |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const inspection = () => { |
| | | const inspection = (btn) => { |
| | | btn.stopPropagation(); |
| | | requestInspect([record]) |
| | | }; |
| | | |
| | | const requestInspect = async (rows) => { |
| | | const { data: { code, data, msg } } = await request.post(`/asnOrder/inspect`, rows); |
| | | |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | |
| | | const { selectedIds, onUnselectItems, data } = useListContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const inspection = () => { |
| | | const inspection = (btn) => { |
| | | btn.stopPropagation(); |
| | | if (selectedIds.length === 0) { |
| | | notify('请选择通知单'); |
| | | return; |