From 8eaee61fbbdea1eaa294b0f1a7d9f2a10da9ade9 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 10 三月 2025 17:06:37 +0800
Subject: [PATCH] Merge branch 'dev' of http://47.97.1.152:5880/r/wms-master into dev

---
 rsf-admin/src/page/components/ImportModal.jsx |   41 ++++++++++++++++++++++++++++++-----------
 1 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/rsf-admin/src/page/components/ImportModal.jsx b/rsf-admin/src/page/components/ImportModal.jsx
index 501cb22..1461531 100644
--- a/rsf-admin/src/page/components/ImportModal.jsx
+++ b/rsf-admin/src/page/components/ImportModal.jsx
@@ -18,6 +18,7 @@
 import { Link } from 'react-router-dom';
 import DialogCloseButton from './DialogCloseButton';
 import { usePapaParse } from './usePapaParse';
+import MatnrList from '../basicInfo/matnr/MatnrList';
 
 const ImportModal = ({ open, onClose, importTemp, useCodeImport, onceBatch = 10 }) => {
     const refresh = useRefresh();
@@ -45,8 +46,9 @@
         if (!file) {
             return;
         }
+        console.log(file);
+        //TODO 娣诲姞涓婃枃浠朵笂浼犳帴鍙�
 
-        parseCsv(file);
     };
 
     const handleClose = () => {
@@ -144,22 +146,30 @@
                                 <Alert
                                     severity="info"
                                     action={
-                                        <Button
-                                            component={Link}
-                                            label="common.action.import.download"
-                                            color="info"
-                                            to={importTemp}
-                                            download={'import_template.csv'}
-                                        />
+                                        <MatnrList.Context.Consumer>
+                                            {context => (
+                                                <Button
+                                                    component={Link}
+                                                    onClick={() => {
+                                                        downloadTemplate(context)
+                                                    }}
+                                                    label="common.action.import.download"
+                                                    color="info"
+                                                    to={importTemp}
+                                                    download={'import_template.csv'}
+                                                />
+                                            )}
+
+                                        </MatnrList.Context.Consumer>
                                     }
                                 >
                                     {translate('common.action.import.msg')}
                                 </Alert>
 
                                 <FileInput
-                                    source="csv"
-                                    label="CSV File"
-                                    accept={{ 'text/csv': ['.csv'] }}
+                                    source="xlsx"
+                                    label="Xlsx File"
+                                    accept={{ 'text/xlsx': ['.xls', '.xlsx'] }}
                                     onChange={handleFileChange}
                                 >
                                     <FileField source="src" title="title" />
@@ -201,6 +211,15 @@
         </Dialog>
     );
 }
+{/**涓嬭浇鎵撳嵃妯℃澘锛屼紶鍏ype绫诲瀷锛岃皟鐢ㄤ笅杞芥ā鏉挎帴鍙� */}
+const downloadTemplate = (type) => {
+    // 涓嬭浇鐗╂枡妯℃澘
+    if (type != undefined &&  type == 'matnr') {
+        
+    } 
+    console.log('======>');
+    console.log(type);
+}
 
 function millisecondsToTime(ms) {
     var seconds = Math.floor((ms / 1000) % 60);

--
Gitblit v1.9.1