From da6ffd9b8d9687f8fb876e194da597c02f25f588 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 18 六月 2024 16:57:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/Four-Way-Rack' into Four-Way-Rack

---
 zy-asrs-flow/src/pages/device/shuttle/index.jsx |   48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/zy-asrs-flow/src/pages/device/shuttle/index.jsx b/zy-asrs-flow/src/pages/device/shuttle/index.jsx
index 360d421..1aebf64 100644
--- a/zy-asrs-flow/src/pages/device/shuttle/index.jsx
+++ b/zy-asrs-flow/src/pages/device/shuttle/index.jsx
@@ -12,6 +12,7 @@
     const [ws, setWs] = useState(null);
     const [openOpera, setOpenOpera] = useState(false);
     const [currentData, setCurrentData] = useState(null);
+    const [sourceLoc, setSourceLoc] = useState("");
     const [targetLoc, setTargetLoc] = useState("");
     const [xStart, setXStart] = useState(1);
     const [xTarget, setXTarget] = useState(1);
@@ -88,6 +89,10 @@
         setOpenOpera(false);
     };
 
+    const sourceLocChange = (e) => {
+        setSourceLoc(e.target.value)
+    }
+
     const targetLocChange = (e) => {
         setTargetLoc(e.target.value)
     }
@@ -98,12 +103,23 @@
                 message.warning('璇疯緭鍏ョ洰鏍囦綅缃�');
                 return;
             }
+        }else if(type == 'takeMove') {
+            if (targetLoc == '') {
+                message.warning('璇疯緭鍏ョ洰鏍囦綅缃�');
+                return;
+            }
+
+            if (sourceLoc == '') {
+                message.warning('璇疯緭鍏ヨ捣濮嬩綅缃�');
+                return;
+            }
         }
 
         try {
             const resp = await Http.doPost('api/basShuttle/operator/shuttle', {
                 shuttleNo: currentData.shuttleNo,
                 shuttleTaskMode: type,
+                sourceLocNo: sourceLoc,
                 targetLocNo: targetLoc
             });
             if (resp.code === 200) {
@@ -146,6 +162,25 @@
             return false;
         }
     }
+
+    const shuttleMoveLocClose = async () => {
+        try {
+            const resp = await Http.doPost('api/basShuttle/moveLocClose', {
+                shuttleNo: currentData.shuttleNo,
+            });
+            if (resp.code === 200) {
+                message.success("璇锋眰鎴愬姛");
+                return true;
+            } else {
+                message.warning(resp.msg);
+                return false;
+            }
+        } catch (error) {
+            message.warning("璇锋眰澶辫触");
+            return false;
+        }
+    }
+
 
     const xStartChange = (e) => {
         setXStart(e.target.value)
@@ -207,7 +242,7 @@
                     {
                         key: '6',
                         label: '閿欒鐮�',
-                        children: '0',
+                        children: item.errorCode$,
                     },
                     {
                         key: '7',
@@ -265,11 +300,19 @@
                     <div style={{ marginBottom: '15px' }}>
                         <Card title="绉诲姩鎸囦护" style={{ width: 300 }}>
                             <p>
+                                <Input addonBefore="璧峰浣嶇疆" onChange={sourceLocChange} />
+                            </p>
+                            <p>
                                 <Input addonBefore="鐩爣浣嶇疆" onChange={targetLocChange} />
                             </p>
                             <p>
-                                <Button onClick={() => shuttleOperator('moveLoc')}>绉诲姩鍒扮洰鏍囦綅缃�</Button>
                             </p>
+                            <p>
+                            </p>
+                            <div className="commandItem">
+                                <Button onClick={() => shuttleOperator('moveLoc')}>绉诲姩鍒扮洰鏍囦綅缃�</Button>
+                                <Button onClick={() => shuttleOperator('takeMove')}>鍙栨斁璐т綔涓�</Button>
+                            </div>
                         </Card>
                     </div>
 
@@ -301,6 +344,7 @@
                                     />
                                 </div>
                                 <Button onClick={() => shuttleMoveLoc()}>璺戝簱</Button>
+                                <Button onClick={() => shuttleMoveLocClose()}>璺戝簱鍏抽棴</Button>
                             </div>
                         </Card>
                     </div>

--
Gitblit v1.9.1