From d871326f5ad1c55367333e1cb1aaf93e87989bea Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 23 五月 2025 09:39:42 +0800
Subject: [PATCH] 库存出库功能优化

---
 rsf-admin/src/page/orders/asnOrder/POItemModal.jsx |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/rsf-admin/src/page/orders/asnOrder/POItemModal.jsx b/rsf-admin/src/page/orders/asnOrder/POItemModal.jsx
index 0e9ccc3..dcde225 100644
--- a/rsf-admin/src/page/orders/asnOrder/POItemModal.jsx
+++ b/rsf-admin/src/page/orders/asnOrder/POItemModal.jsx
@@ -105,21 +105,19 @@
     const handleSubmit = async () => {
         setFinally()
         setDisabled(true)
-        setOpen(false)
         const parmas = {
             "purchaseId": record,
             "items": tabelData,
         }
-        console.log('--------->');
-        console.log(parmas);
-        // const res = await request.post(`/asnOrder/purchases/save`, parmas);
-        // if (res?.data?.code === 200) {
-        //     setOpen(false);
-        //     refresh();
-        //     resetData()
-        // } else {
-        //     notify(res.data.msg);
-        // }
+        const res = await request.post(`/asnOrder/purchases/save`, parmas);
+        if (res?.data?.code === 200) {
+            notify(res.data.msg);
+        } else {
+            notify(res.data.msg);
+        }
+        setOpen(false);
+        refresh();
+        resetData()
         setDisabled(false)
     };
 
@@ -167,7 +165,7 @@
                     </Box>
                 </DialogContent>
                 <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}>
-                    <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }}  >
+                    <Toolbar sx={{ width: '100%', justifyContent: 'end' }}  >
                         <Button disabled={disabled} onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}>
                             {translate('toolbar.confirm')}
                         </Button>
@@ -283,6 +281,14 @@
             headerClassName: "custom",
         },
         {
+            field: 'qty',
+            headerName: translate('table.field.asnOrderItem.qty') + "*",
+            type: 'number',
+            minWidth: 100,
+            flex: 1,
+            valueFormatter: (val) => val < 0 ? 0 : val,
+        },
+        {
             field: 'unit',
             headerName: translate('table.field.asnOrderItem.stockUnit'),
             minWidth: 100,

--
Gitblit v1.9.1