|  |  |  | 
|---|
|  |  |  | import AsnSelModal from "./AsnSelModal"; | 
|---|
|  |  |  | import InspectModal from "./InspectModal"; | 
|---|
|  |  |  | import QlyInspectOpCreate from './QlyInspectOpCreate'; | 
|---|
|  |  |  | import ConfirmButton from "../../components/ConfirmButton"; | 
|---|
|  |  |  | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ | 
|---|
|  |  |  | '& .css-1vooibu-MuiSvgIcon-root': { | 
|---|
|  |  |  | height: '.9em' | 
|---|
|  |  |  | 
|---|
|  |  |  | '& .opt': { | 
|---|
|  |  |  | width: 200 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | '& .MuiTableCell-root': { | 
|---|
|  |  |  | whiteSpace: 'nowrap', | 
|---|
|  |  |  | overflow: 'visible', | 
|---|
|  |  |  | textOverflow: 'unset' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | })); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const filters = [ | 
|---|
|  |  |  | 
|---|
|  |  |  | actions={( | 
|---|
|  |  |  | <TopToolbar> | 
|---|
|  |  |  | <AsnCreatButton /> | 
|---|
|  |  |  | <MyCreateButton onClick={() => { setOpCreateDialog(true) }} /> | 
|---|
|  |  |  | {/* <MyCreateButton onClick={() => { setOpCreateDialog(true) }} /> */} | 
|---|
|  |  |  | <FilterButton /> | 
|---|
|  |  |  | <SelectColumnsButton preferenceKey='qlyInspect' /> | 
|---|
|  |  |  | <MyExportButton /> | 
|---|
|  |  |  | 
|---|
|  |  |  | bulkActionButtons={<BulkDeleteButton mutationMode={OPERATE_MODE} />} | 
|---|
|  |  |  | rowClick={false} | 
|---|
|  |  |  | expandSingle={true} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool']} | 
|---|
|  |  |  | omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool','createBy$']} | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <NumberField source="id" /> | 
|---|
|  |  |  | <TextField source="code" label="table.field.qlyInspect.code" /> | 
|---|
|  |  |  | <TextField source="isptStatus$" label="table.field.qlyInspect.isptStatus" /> | 
|---|
|  |  |  | <TextField source="wkType$" label="table.field.qlyInspect.wkType" /> | 
|---|
|  |  |  | <NumberField source="asnId" label="table.field.qlyInspect.asnId" /> | 
|---|
|  |  |  | <NumberField source="asnCode" label="table.field.qlyInspect.asnCode" /> | 
|---|
|  |  |  | <NumberField source="isptQty" label="table.field.qlyInspect.isptQty" /> | 
|---|
|  |  |  | <TextField source="isptStatus$" label="table.field.qlyInspect.isptStatus" /> | 
|---|
|  |  |  | <TextField source="updateBy$" label="common.field.updateBy" /> | 
|---|
|  |  |  | <DateField source="updateTime" label="common.field.updateTime" showTime /> | 
|---|
|  |  |  | <TextField source="createBy$" label="common.field.createBy" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <EditButton label="toolbar.detail" /> | 
|---|
|  |  |  | <InspectionButton /> | 
|---|
|  |  |  | <CompleteButton /> | 
|---|
|  |  |  | <CloseButton /> | 
|---|
|  |  |  | {/* <CloseButton /> */} | 
|---|
|  |  |  | </WrapperField> | 
|---|
|  |  |  | </StyledDatagrid> | 
|---|
|  |  |  | </List> | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default QlyInspectList; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const PrintLabelButton = () => { | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const InspectionButton = () => { | 
|---|
|  |  |  | const record = useRecordContext(); | 
|---|
|  |  |  | 
|---|
|  |  |  | const notify = useNotify(); | 
|---|
|  |  |  | const refresh = useRefresh(); | 
|---|
|  |  |  | const requestComplete = async () => { | 
|---|
|  |  |  | const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, isptStatus: '1' }); | 
|---|
|  |  |  | const { data: { code, data, msg } } = await request.post(`/qlyInspect/verify/complate/` + record?.id); | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | notify(msg); | 
|---|
|  |  |  | refresh() | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | record.isptStatus != 1 && record.isptStatus != 3 ? (<Button onClick={requestComplete} label={"toolbar.complete"} mutationMode={OPERATE_MODE}> | 
|---|
|  |  |  | <TaskIcon /> | 
|---|
|  |  |  | </Button>) : (<></>) | 
|---|
|  |  |  | record.isptStatus == 2 ? (<ConfirmButton label={"toolbar.verifyComfirm"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} />) : (<></>) | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|