From d23eb6d53cb10362de2b961e77f45c27ec38196d Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期三, 04 二月 2026 15:03:46 +0800
Subject: [PATCH] #页面持久化

---
 rsf-admin/src/page/locPreview/LocPreviewList.jsx |   68 ++++++++++++++++++++++++++++++++-
 1 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/rsf-admin/src/page/locPreview/LocPreviewList.jsx b/rsf-admin/src/page/locPreview/LocPreviewList.jsx
index 5c20428..24e134d 100644
--- a/rsf-admin/src/page/locPreview/LocPreviewList.jsx
+++ b/rsf-admin/src/page/locPreview/LocPreviewList.jsx
@@ -95,6 +95,7 @@
             source="areaId"
             label="table.field.loc.areaId"
             reference="warehouseAreas"
+            sort={{ field: 'sort', order: 'ASC' }}
         >
             <AutocompleteInput
                 label="table.field.loc.areaId"
@@ -109,7 +110,7 @@
             source="useStatus"
             optionValue="value"
             parse={v => v}
-
+            alwaysOn
         />,
         <TextInput source="code" label="table.field.loc.code" />,
         <AutocompleteInput
@@ -123,7 +124,7 @@
         <TextInput source="name" label="table.field.loc.name" />,
         <NumberInput source="flagLogic" label="table.field.loc.flagLogic" />,
         <TextInput source="fucAtrrs" label="table.field.loc.fucAtrrs" />,
-        <TextInput source="barcode" label="table.field.loc.barcode" />,
+        <TextInput source="barcode" label="table.field.loc.barcode" alwaysOn/>,
         <TextInput source="unit" label="table.field.loc.unit" />,
         <TextInput source="size" label="table.field.loc.size" />,
         <NumberInput source="row" label="table.field.loc.row" />,
@@ -201,6 +202,8 @@
                     <TextField source="memo" label="common.field.memo" sortable={false} />
                     <WrapperField cellClassName="opt" label="common.field.opt">
                         <EditButton sx={{ padding: '1px', fontSize: '.75rem' }}  label="toolbar.detail" />
+                        {/* <LocButton sx={{ padding: '1px', fontSize: '.75rem' }} ></LocButton>
+                        <UnLockButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /><UnLockButton /> */}
                     </WrapperField>
                 </StyledDatagrid>
             </List>
@@ -208,4 +211,63 @@
     )
 }
 
-export default LocPreviewList;
\ No newline at end of file
+export default LocPreviewList;
+
+/**
+ * 鎿嶄綔
+ * @returns 
+ */
+const LocButton = (props) => {
+    // const record = useRecordContext();
+    const notify = useNotify();
+    const refresh = useRefresh();
+    const clickComplete = () => {
+        completeTask(record)
+    };
+    //瀹屾垚浠诲姟
+    const completeTask = async (row) => {
+        const { data: { code, data, msg } } = await request.post(`task/complete/` + row.id);
+        if (code === 200) {
+            notify(msg);
+            refresh();
+        } else {
+            notify(msg);
+        }
+    }
+    return (
+        <ConfirmButton label={"鍐荤粨"} color="secondary" startIcon={<TaskAltIcon />} onConfirm={clickComplete} />
+    )
+}
+
+/**
+ * 鍙栨秷鎸夐挳
+ * @returns 
+ */
+const UnLockButton = () => {
+    const record = useRecordContext();
+    const notify = useNotify();
+    const refresh = useRefresh();
+    const clickCancel = () => {
+        cancleTask(record)
+    };
+    //鍙栨秷浠诲姟
+    const cancleTask = async (row) => {
+        const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id);
+        if (code === 200) {
+            notify(msg);
+            refresh();
+        } else {
+            notify(msg);
+        }
+    }
+    return (
+        (record.taskStatus == 1 || record.taskStatus == 101) && (record.taskType == 1 || record.taskType == 101 || record.taskType == 10 || record.taskType == 107 || record.taskType == 103 || record.taskType == 11) ?
+            <ConfirmButton
+                onConfirm={clickCancel}
+                startIcon={<CancelIcon />}
+                label={"toolbar.cancel"}>
+            </ConfirmButton>
+            :
+            <></>
+    )
+}
\ No newline at end of file

--
Gitblit v1.9.1