| 
...
 | 
...
 | 
@@ -154,6 +154,7 @@ | 
| 
154
 | 
154
 | 
   import {
 | 
| 
155
 | 
155
 | 
     deleteDevice,
 | 
| 
156
 | 
156
 | 
     devicePage,
 | 
| 
 
 | 
157
 | 
+    checkDeviceOccupied,
 | 
| 
157
 | 
158
 | 
     cancelDispatchCustomer,
 | 
| 
158
 | 
159
 | 
     getGATEWAY,
 | 
| 
159
 | 
160
 | 
   } from '/@/api/device/deviceManager';
 | 
| 
...
 | 
...
 | 
@@ -197,6 +198,7 @@ | 
| 
197
 | 
198
 | 
       const [registerModal, { openModal }] = useModal();
 | 
| 
198
 | 
199
 | 
       const [registerCustomerModal, { openModal: openCustomerModal }] = useModal();
 | 
| 
199
 | 
200
 | 
       const [registerDetailDrawer, { openDrawer }] = useDrawer();
 | 
| 
 
 | 
201
 | 
+
 | 
| 
200
 | 
202
 | 
       const [registerTable, { reload, setSelectedRowKeys, setProps }] = useTable({
 | 
| 
201
 | 
203
 | 
         title: '设备列表',
 | 
| 
202
 | 
204
 | 
         api: devicePage,
 | 
| 
...
 | 
...
 | 
@@ -253,8 +255,16 @@ | 
| 
253
 | 
255
 | 
       }
 | 
| 
254
 | 
256
 | 
       // 取消分配客户
 | 
| 
255
 | 
257
 | 
       async function handleCancelDispatchCustomer(record: Recordable) {
 | 
| 
256
 | 
 
 | 
-        await cancelDispatchCustomer(record);
 | 
| 
257
 | 
 
 | 
-        handleReload();
 | 
| 
 
 | 
258
 | 
+        try {
 | 
| 
 
 | 
259
 | 
+          // 该设备是否正在被场景联动使用中?
 | 
| 
 
 | 
260
 | 
+          const isEnabled = await checkDeviceOccupied(record.id);
 | 
| 
 
 | 
261
 | 
+          if (!isEnabled) {
 | 
| 
 
 | 
262
 | 
+            await cancelDispatchCustomer(record);
 | 
| 
 
 | 
263
 | 
+            handleReload();
 | 
| 
 
 | 
264
 | 
+          } else {
 | 
| 
 
 | 
265
 | 
+            createMessage.warn('该设备正在使用中~');
 | 
| 
 
 | 
266
 | 
+          }
 | 
| 
 
 | 
267
 | 
+        } catch {}
 | 
| 
258
 | 
268
 | 
       }
 | 
| 
259
 | 
269
 | 
 
 | 
| 
260
 | 
270
 | 
       function handleDetail(record: Recordable) {
 | 
...
 | 
...
 | 
 |