From 8d663e98fe09703daf9ac09950d405faf735585d Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 15 四月 2025 16:02:09 +0800
Subject: [PATCH] #修复:只进行了一次质检操作,质检状态自动变化为"质检完成"
---
rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx | 29 ++++++++++++++++++++---------
1 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx b/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
index ccd61f5..57aa210 100644
--- a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
+++ b/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';
@@ -65,10 +66,10 @@
'& .column-name': {
},
'& .opt': {
- width: 320
+ width: 180
},
'& .status': {
- width: 100
+ width: 90
},
}));
@@ -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,9 +148,12 @@
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']}
+ omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']}
>
<NumberField source="id" />
<TextField source="code" label="table.field.asnOrder.code" />
@@ -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;
--
Gitblit v1.9.1