skyouc
2025-04-15 39e16dc87c7b55b0d202bbd5416a478075dc236d
rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
@@ -1,5 +1,5 @@
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,
@@ -33,6 +33,7 @@
  AutocompleteInput,
  DeleteButton,
  Button,
  useRedirect,
} from 'react-admin';
import { Box, Typography, Card, Stack } from '@mui/material';
import { styled } from '@mui/material/styles';
@@ -107,7 +108,11 @@
  const [createDialog, setCreateDialog] = useState(false);
  const [drawerVal, setDrawerVal] = useState(false);
  const [modalType, setmodalType] = useState(0);
  const [select, setSelect] = useState(0);
  const billReload = useRef();
  const location = useLocation();
  const redirect = useRedirect();
  const navigate = useNavigate();
  const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || [];
  const assign = (record) => {
@@ -143,7 +148,10 @@
          sx={{ width: '100%' }}
          preferenceKey='asnOrder'
          bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>}
          rowClick={() => 'edit'}
          rowClick='toggleSelection'
          onToggleItem={(id, resource, record)=>{
            redirect(location.pathname + '/' + id)
          }}
          expandSingle={true}
          omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']}
        >
@@ -191,7 +199,8 @@
const MyButton = ({ setCreateDialog, setmodalType }) => {
  const record = useRecordContext();
  const handleEditClick = () => {
  const handleEditClick = (btn) => {
    btn.stopPropagation();
    const id = record.id;
    setmodalType(id);
    setCreateDialog(true);
@@ -201,7 +210,7 @@
    <Button
      color="primary"
      startIcon={<EditIcon />}
      onClick={() => handleEditClick()}
      onClick={(btn) => handleEditClick(btn)}
      sx={{ ml: 1 }}
      label={'ra.action.edit'}
    >
@@ -213,7 +222,8 @@
  const record = useRecordContext();
  const notify = useNotify();
  const refresh = useRefresh();
  const inspection = () => {
  const inspection = (btn) => {
    btn.stopPropagation();
    requestInspect([record])
  };
@@ -240,7 +250,8 @@
  const { selectedIds, onUnselectItems, data } = useListContext();
  const notify = useNotify();
  const refresh = useRefresh();
  const inspection = () => {
  const inspection = (btn) => {
    btn.stopPropagation();
    if (selectedIds.length === 0) {
      notify('请选择通知单');
      return;