diff --git a/frontend/src/pages/ConsumableManagement.jsx b/frontend/src/pages/ConsumableManagement.jsx index 5b1c97f..7021b1b 100644 --- a/frontend/src/pages/ConsumableManagement.jsx +++ b/frontend/src/pages/ConsumableManagement.jsx @@ -65,6 +65,8 @@ import { DownOutlined, CheckSquareOutlined, SettingOutlined, + InboxOutlined, + UserOutlined, } from '@ant-design/icons'; import axios from 'axios'; import * as XLSX from 'xlsx'; @@ -163,6 +165,9 @@ function ConsumableManagement() { const [scanChecking, setScanChecking] = useState(false); const [scannedSnList, setScannedSnList] = useState([]); const [selectedScanInConsumable, setSelectedScanInConsumable] = useState(null); + const [scanInOperator, setScanInOperator] = useState(''); + const [scanInReason, setScanInReason] = useState(''); + const [scanInNotes, setScanInNotes] = useState(''); const scanInputRef = React.useRef(null); const [quickOutModalVisible, setQuickOutModalVisible] = useState(false); const [quickOutConsumable, setQuickOutConsumable] = useState(null); @@ -1066,6 +1071,9 @@ function ConsumableManagement() { setScannedSnList([]); setSelectedScanInConsumable(null); setScanChecking(false); + setScanInOperator(''); + setScanInReason(''); + setScanInNotes(''); }, []); const addToPendingOut = (consumable, snList = []) => { @@ -1253,8 +1261,9 @@ function ConsumableManagement() { consumableId, type: 'in', quantity: scannedSnList.length, - operator: '系统管理员', - reason: '扫码入库', + operator: scanInOperator || '系统管理员', + reason: scanInReason || '扫码入库', + notes: scanInNotes || '', snList: scannedSnList, }); message.success({ @@ -1268,7 +1277,7 @@ function ConsumableManagement() { console.error('入库失败:', error); } }, - [scannedSnList, handleScanCancel, fetchConsumables] + [scannedSnList, scanInOperator, scanInReason, scanInNotes, handleScanCancel, fetchConsumables] ); const searchDevices = useCallback(async keyword => { @@ -3920,68 +3929,135 @@ function ConsumableManagement() { {/* 入库/出库弹窗 */} -
- {stockType === 'in' ? : } -
- - {stockType === 'in' ? '耗材入库' : '耗材出库'} - - - } + title={null} open={stockModalVisible} closeIcon={} onCancel={handleStockCancel} footer={null} - width={500} + width={560} + style={{ top: 80 }} + bodyStyle={{ padding: 0 }} > -
- - - - - - - - {stockType === 'out' && stockRecord?.snList && stockRecord.snList.length > 0 && ( - - 选择SN序列号 - - (已选 {selectedSnList.length} 个) - - - } +
+
- + {stockType === 'in' ? : } +
+
+
+ {stockType === 'in' ? '耗材入库' : '耗材出库'} +
+
+ {stockType === 'in' ? '填写入库信息,增加库存数量' : '填写出库信息,减少库存数量'} +
+
+
+ + +
+ + {/* 耗材信息卡片 */} +
+
+ + + 耗材信息 + +
+ + +
+
耗材ID
+
+ + + +
+
+ + +
+
耗材名称
+
+ + + +
+
+ +
+
+ + {/* SN序列号选择区(出库) */} + {stockType === 'out' && stockRecord?.snList && stockRecord.snList.length > 0 && ( +
+
+
+ + + SN序列号选择 + +
+ 0 ? designTokens.colors.success.main : designTokens.colors.neutral[400], + fontSize: '11px', + }} + /> +
} allowClear value={snSearchKeyword} onChange={e => setSnSearchKeyword(e.target.value)} - style={{ ...inputStyles.search, marginBottom: '8px' }} + style={{ ...inputStyles.search, marginBottom: '12px' }} />
+ )} - {stockType === 'in' && ( - - + +
+ )} - - 0 - ? stockRecord.snList.length - : undefined - } - style={inputNumberStyles.base} - placeholder="请输入数量" - /> - - - - - - - - -