From 3fba99c4b89dfcc56d08cfe99c7391dbae082713 Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期五, 11 十月 2024 08:09:24 +0800 Subject: [PATCH] 增加报工管理前后台,中英文等 --- UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue | 66 ++++++++++++++++++++------------ 1 files changed, 41 insertions(+), 25 deletions(-) diff --git a/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue b/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue index 6919e53..f0ac399 100644 --- a/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue +++ b/UI-Project/src/views/ScanQrCodesReport/scanQrCodesReport.vue @@ -17,12 +17,13 @@ const machineId=23;//褰撳墠椤甸潰鐨勮澶嘔D //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁 let socket = null; -const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edging`; +const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/scanQrCodesReport`; // 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺 const handleMessage = (data) => { // 鏇存柊 tableData 鐨勬暟鎹� loadData.value = data.taskingList[0]; findMachine.value = data.machine[0]; + // console.log(data); }; onUnmounted(() => { if (socket) { @@ -37,6 +38,7 @@ onMounted(async () => { //浣跨敤WebSocket鏂瑰紡灞曠ず鏁版嵁 socket = initializeWebSocket(socketUrl, handleMessage);// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁� + //浣跨敤鎺ュ彛鏂瑰紡灞曠ず鏁版嵁 //load(); @@ -86,11 +88,11 @@ return; } ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -110,7 +112,7 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) @@ -119,11 +121,11 @@ //寮�宸�/鏆傚仠 const machineStatus = async(state) => { ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -144,18 +146,18 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) } //鐮存崯 const damagedTask = async(row) => { ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -175,18 +177,18 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) } //涓嬬嚎(鎷胯蛋) const glassDownLine = async(row) => { ElMessageBox.confirm( - t('marking.tips'), + t('functionState.tips'), t('delivery.prompt'), { - confirmButtonText: t('marking.sure'), - cancelButtonText: t('marking.cancel'), + confirmButtonText: t('functionState.sure'), + cancelButtonText: t('functionState.cancel'), type: 'warning', } ) @@ -206,7 +208,7 @@ .catch(() => { ElMessage({ type: 'info', - message: t('marking.cancel'), + message: t('functionState.cancel'), }) }) } @@ -219,14 +221,14 @@ <template> <div ref="content" style="padding:0 20px;"> <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;"> - {{$t('machine.edging')}} + {{$t('machine.scanQrCodesReport')}} </div> <hr /> <br> <div id="search" > <!-- 鍔熻兘 --> - <el-button type="primary" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='鏆傚仠'?'寮�宸�':'鏆傚仠'))">{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button> - <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$t('functionState.topLine')}}</el-button> + <!-- <el-button :type="(findMachine['state']=='鏆傚仠'?'danger':'success')" id="ButtonMachineStatus" @click="machineStatus((findMachine['state']=='鏆傚仠'?'寮�宸�':'鏆傚仠'))">{{findMachine['state']=='寮�宸�'?$t('functionState.start'):$t('functionState.stop')}}</el-button> + <el-button type="primary" id="ButtonTopLine" @click="topLine">{{$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> <el-button type="primary" id="searchButton" @click="workStatus('瀹屽伐')">瀹屽伐</el-button> --> @@ -245,27 +247,41 @@ <el-table-column prop="width" :label="$t('glassInfo.width')"/> <el-table-column prop="thickness" :label="$t('glassInfo.thickness')"/> <el-table-column prop="workState" :label="$t('glassInfo.workState')"/> - <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270"> + <!-- <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270"> <template #default="scope"> <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '閲嶅彂')" >{{$t('functionState.anew')}}</el-button> <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">{{$t('functionState.finish')}}</el-button> <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{$t('functionState.lose')}}</el-button> <el-button size="mini" link type="primary" plain @click="glassDownLine(scope.row)">{{$t('functionState.downLine')}}</el-button> </template> - </el-table-column> + </el-table-column> --> </el-table> </div> - <div id="main-body" - style="width: 50%; height: 460px; margin: auto;background-image: url(../../src/assets/鎵爜璇嗗埆.png) ;background-size: 100% 100%;"> + <div id="main-body1" + style="width: 70%; height: 400px;margin:20px auto;background-size: 100% 100%;"> <!-- 鐢诲浘鍐呭 --> - <div style="width: 150px; height: 100px; background-color: red; position: relative; top: 171px; left: 328px"> + <div :style="{ + width: loadData.length > 0 ? loadData[0]['length'] + 'px' : '200px', + height: loadData.length > 0 ? loadData[0]['width'] + 'px' : '100px', + backgroundColor: 'red', + position: 'relative', + top: '60px', + left: '28px', + textAlign: 'center' + }"> + <p v-if="loadData.length > 0">{{ loadData[0]['scanId'] }}</p> + <p v-if="loadData.length > 0"> + {{ loadData[0]['length'] }} * {{ loadData[0]['width'] }} + </p> + <p v-else>鏆傛棤鏁版嵁</p> <!-- 鍙�夛細鏄剧ず榛樿娑堟伅 --> </div> </div> </div> </template> <style scoped> + table { text-align: center; width: 100%; -- Gitblit v1.8.0