From bce71e280936919befda3fc8c9491b7955727025 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 17 四月 2025 08:32:52 +0800
Subject: [PATCH] #优化:收货通知单明细供应商自动从往来企业中获取

---
 rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx |   40 ++++++++++++++++++++++------------------
 1 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx b/rsf-admin/src/page/orders/asnOrder/AsnOrderList.jsx
index ccd61f5..1a1356a 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,13 @@
   '& .column-name': {
   },
   '& .opt': {
-    width: 320
+    width: 220
+  },
+  '& .wkType': {
+    width: 110
   },
   '& .status': {
-    width: 100
+    width: 90
   },
 }));
 
@@ -78,7 +82,7 @@
   <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" />,
@@ -107,13 +111,10 @@
   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
@@ -143,16 +144,16 @@
           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" />
@@ -164,7 +165,8 @@
           <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 />
@@ -191,7 +193,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 +204,7 @@
     <Button
       color="primary"
       startIcon={<EditIcon />}
-      onClick={() => handleEditClick()}
+      onClick={(btn) => handleEditClick(btn)}
       sx={{ ml: 1 }}
       label={'ra.action.edit'}
     >
@@ -213,13 +216,13 @@
   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()
@@ -240,7 +243,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