From 1460aa1d5f2b5722d43ed31724594c006213bea7 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期五, 18 四月 2025 16:40:43 +0800
Subject: [PATCH] 看板2更新
---
UI-Project/src/views/Rotate/rotate.vue | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 50 insertions(+), 4 deletions(-)
diff --git a/UI-Project/src/views/Rotate/rotate.vue b/UI-Project/src/views/Rotate/rotate.vue
index 82a2081..e961aeb 100644
--- a/UI-Project/src/views/Rotate/rotate.vue
+++ b/UI-Project/src/views/Rotate/rotate.vue
@@ -21,7 +21,12 @@
const downLineTask = ref([]);
const searchs = ref();
-const machineId = 20;//褰撳墠椤甸潰鐨勮澶嘔D
+const userInfo=JSON.parse(window.localStorage.getItem('userInfo'));
+const pageParams=userInfo.user.menus[0].pages[5].params;
+const pageParamsJson=JSON.parse(pageParams);
+const machineId = pageParamsJson.machineId;//褰撳墠椤甸潰鐨勮澶嘔D
+console.log(machineId);
+//const machineId = 20;//褰撳墠椤甸潰鐨勮澶嘔D
var errorScanId;
var errorOpen=false;
//浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁
@@ -32,9 +37,11 @@
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
// 鏇存柊 tableData 鐨勬暟鎹�
- loadData.value = data.taskingList[0];
- findMachine.value = data.machine[0];
- sendRecords.value = data.sendRecords[0].reverse();
+ let dataJson = data[""+machineId][0];
+
+ loadData.value = dataJson.taskingList[0];
+ findMachine.value = dataJson.machine[0];
+ sendRecords.value = dataJson.sendRecords[0].reverse();
if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
//鏈夋暟鎹氨寮圭獥
@@ -202,6 +209,39 @@
})
})
}
+
+//瀹氬埗/鏍囧噯
+const rotateMode = async (mode) => {
+ ElMessageBox.confirm(
+ t('functionState.tips'),
+ t('delivery.prompt'),
+ {
+ confirmButtonText: t('functionState.sure'),
+ cancelButtonText: t('functionState.cancel'),
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ //涓嬬嚎鎺ュ彛
+ request.post("/deviceInteraction/machine/toggleModeRotate",
+ {
+ "id": machineId,
+ "rotateMode": mode
+ }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (res.code === 200) {
+ ElMessage.success(res.message);
+ } else {
+ ElMessage.warning(res.message)
+ }
+ })
+ })
+ .catch(() => {
+ ElMessage({
+ type: 'info',
+ message: t('functionState.cancel'),
+ })
+ })
+}
//鐮存崯
const damagedTask = async (row) => {
ElMessageBox.confirm(
@@ -350,6 +390,12 @@
<el-button :type="(findMachine['mode'] == '瀹氬埗' ? 'danger' : 'success')" id="ButtonMachineMode"
@click="machineMode((findMachine['mode'] == 0 ? 1 : 0))">{{ findMachine['mode'] == 0 ?
$t('functionState.modeD') : $t('functionState.modeB') }}</el-button>
+
+ <el-button :type="(findMachine['rotateMode'] == 1 ? 'danger' : 'success')" id="ButtonRotateMode"
+ @click="rotateMode((findMachine['rotateMode'] == 1 ? 2 : 1))">{{ findMachine['rotateMode'] == 1 ?
+ $t('functionState.rotate') : $t('functionState.notRotate') }}</el-button>
+
+
<el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.topLine') }}</el-button>
<!-- <el-button type="primary" id="searchButton" @click="downLine('涓嬬嚎')">涓嬬嚎</el-button>
<el-button type="primary" id="searchButton" @click="workStatus('鐮存崯')">鐮存崯</el-button>
--
Gitblit v1.8.0