From ad28331c1e3ed456b72765874b41b83b49dc279f Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期四, 18 四月 2024 14:44:11 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
---
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue | 349 ++++++++++++++--------------------------------------------
1 files changed, 84 insertions(+), 265 deletions(-)
diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
index 1bcac06..0666da4 100644
--- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
+++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -1,209 +1,52 @@
<script setup>
import {Search} from "@element-plus/icons-vue";
-import {reactive, onMounted} from "vue";
+import {reactive} from "vue";
import {useRouter} from "vue-router"
const router = useRouter()
+const dialogFormVisiblea = ref(false)
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import Landingindication from "./Landingindication.vue";
-import Landingindicationtwo from "./Landingindicationtwo.vue";
-import unloadrequest from "@/utils/unloadrequest";
-const dialogFormVisiblea = ref(false)
+// import Landingindicationtwo from "./Landingindicationtwo.vue";
-
-
-const dialogFormVisiblea2 = ref(false)
-
-
-const tableData = reactive([]);
-
-
-let socket;
-
-
-const initWebSocket = (token) =>{ //鍒濆鍖杦e
-
-let viewname = "unloadglass";
-
-if (typeof WebSocket === "undefined") {
- console.log("鎮ㄧ殑娴忚鍣ㄤ笉鏀寔WebSocket");
-} else {
- let socketUrl = "ws://" + "localhost"+":88" + "/api/unLoadGlass/api/talk/" + viewname;
- if (socket != null) {
- socket.close();
- socket = null;
- }
-
- // 寮�鍚竴涓獁ebsocket鏈嶅姟
- socket = new WebSocket(socketUrl);
-
- // 鎵撳紑浜嬩欢
- socket.onopen = function () {
- console.log("websocket宸叉墦寮�");
- };
-
-
-
-socket.onmessage = (msg) => {
-if (!msg.data) {
-return; // 濡傛灉鏀跺埌绌烘暟鎹紝鍒欑洿鎺ヨ繑鍥烇紝涓嶆墽琛屽悗缁�昏緫
-}
-
-
-
- let obj = JSON.parse(msg.data);
-
-
- console.log('鏀跺埌娑堟伅锛�', obj.data);
-
- }
-
- }
- }
-
-
-
-
-// 鏁版嵁
-const loading = ref(false);
-
-
-// 寮规鏄剧ず鎺у埗
-
-const dialogFormVisible = ref(false);
-
-// 琛ㄥ崟鏁版嵁
-const workstationId = ref('');
-const flowCardId = ref('');
-const flowCardOptions = ref([]);
-
-
-// 鏂规硶
-const handleSelectionChange = () => {
- // 澶勭悊琛ㄦ牸琛岄�夋嫨浜嬩欢
-};
-
-const handleBindRack = (row) => {
- workstationId.value = row.workstationId; // 鍋囪rackNumber鏄灦鍙峰瓧娈电殑灞炴�у悕
-
- // 鍙戣捣鎺ュ彛璇锋眰鑾峰彇娴佺▼鍗″彿
- fetchFlowCardId();
-
-
- dialogFormVisiblea.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
-};
-
-
-
-//鑾峰彇娴佺▼鍗″彿
-const fetchFlowCardId = async () => {
- try {
- const response = await unloadrequest.get('/api/unLoadGlass/getflowCardId');
- console.log(response)
- if (response.code === 200) {
- flowCardOptions.value = response.data.map(item => ({ flowcard_id: item.flowcard_id }));
- } else {
- ElMessage.error(response.msg);
- }
- } catch (error) {
- console.error(error);
- }
-};
-//纭
-const handleConfirm = async () => {
- try {
- const response = await unloadrequest.post('/api/unLoadGlass/updateFlowCardId', {
- workstationId: workstationId.value,
- flowCardId: flowCardId.value
- });
-
- console.log(response)
- if (response.code == 200) {
- // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
- console.log('缁戝畾鎴愬姛');
- ElMessage.success(response.message);
- dialogFormVisiblea.value = false;
- } else {
- // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
- }
- } catch (error) {
- // 澶勭悊閿欒
- console.error(error);
- }
-};
-
-
-
-const handleBindRack2 = (row) => {
- workstationId.value = row.workstationId; // 鍋囪rackNumber鏄灦鍙峰瓧娈电殑灞炴�у悕
-
-
-
-
- dialogFormVisiblea2.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
-};
-//娓呴櫎鍐呭
-const handleclear = async () => {
- try {
- const response = await unloadrequest.post('/api/unLoadGlass/clear', {
- workstationId: workstationId.value,
- });
-
- console.log(response);
-
- if (response.code === 200) {
- // 娓呴櫎鎴愬姛鐨勯�昏緫
- console.log('娓呴櫎鎴愬姛');
- ElMessage.success(response.message);
- dialogFormVisiblea2.value = false;
- } else if (response.code === 400) {
- // 娓呴櫎澶辫触鐨勯�昏緫
- console.log('娓呴櫎澶辫触');
- console.log(response.message); // 鎵撳嵃鏈嶅姟鍣ㄨ繑鍥炵殑閿欒淇℃伅
- ElMessage.error(response.message);
- dialogFormVisiblea2.value = false;
- }
- } catch (error) {
- // console.log(error);
- ElMessage.error("娓呴櫎澶辫触");
- dialogFormVisiblea2.value = false;
- }
-};
-
-
-
-
-
-// 鍙戦�佽幏鍙栬〃鏍兼暟鎹殑璇锋眰
-const fetchTableData = async () => {
- try {
- // 鍙戦�佽幏鍙栬〃鏍兼暟鎹殑璇锋眰锛屽苟绛夊緟鍝嶅簲
- const response = await unloadrequest.get('/api/unLoadGlass/getone');
-
- // 妫�鏌ュ搷搴旂姸鎬�
- if (response.code === 200) {
- // 鏇存柊琛ㄦ牸鏁版嵁
- console.log('鎴愬姛鑾峰彇琛ㄦ牸鏁版嵁:', response.data);
- tableData.splice(0, tableData.length, ...response.data);
- } else {
- // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
- ElMessage.error(response.msg);
- }
- } catch (error) {
- // 澶勭悊璇锋眰澶辫触鐨勬儏鍐�
- ElMessage.error('鑾峰彇琛ㄦ牸鏁版嵁澶辫触锛岃閲嶈瘯');
- }
-};
-
-
-
-
-initWebSocket();
-onMounted(fetchTableData);
-setInterval(fetchTableData, 2000)
-
+const tableData = [
+ {
+ id: '1',
+ long: '1005',
+ wide: '183.6',
+ thick: '1991',
+ state: '鏈惎鐢�',
+ },
+ {
+ id: '2',
+ long: '105',
+ wide: '183',
+ thick: '191',
+ state: '鏈惎鐢�'
+ },
+ {
+ id: '3',
+ long: '105',
+ wide: '183',
+ thick: '191',
+ state: '鏈惎鐢�'
+ },
+ {
+ id: '4',
+ long: '105',
+ wide: '183',
+ thick: '191',
+ state: '鏈惎鐢�'
+ },
+ {
+ id: '5',
+ long: '105',
+ wide: '183',
+ thick: '191',
+ state: '鏈惎鐢�'
+ },
+]
const open = () => {
ElMessageBox.confirm(
'鏄惁鍒犻櫎璇ユ潯淇℃伅?',
@@ -241,6 +84,17 @@
}
}
+const dialogForm = () => {
+ ElMessageBox.confirm(
+ '鏄惁娓呯┖璇ユ潯淇℃伅?',
+ '鎻愮ず',
+ {
+ confirmButtonText: '鏄�',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }
+ )
+}
const gridOptions = reactive({
border: "full",//琛ㄦ牸鍔犺竟妗�
keepSource: true,//淇濇寔婧愭暟鎹�
@@ -279,10 +133,6 @@
],
})
-
-
-
-
</script>
<template>
@@ -292,80 +142,53 @@
<el-table height="100%" ref="table"
@selection-change="handleSelectionChange"
:data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
- <el-table-column prop="workstationId" align="center" label="涓嬬墖浣�" min-width="80" />
- <el-table-column prop="workstationId" align="center" label="鏋跺彿" min-width="120" />
- <el-table-column prop="flowCardId" align="center" label="娴佺▼鍗″彿" min-width="120" />
- <el-table-column prop="totalquantity" align="center" label="鎬绘暟閲�" min-width="120" />
- <el-table-column prop="racksnumber" align="center" label="宸茶惤鏋舵暟閲�" min-width="120" />
- <el-table-column prop="work_state" align="center" label="鐘舵��" min-width="120" />
- <el-table-column prop="deviceId" align="center" label="璁惧鍙�" min-width="120" />
- <el-table-column prop="enableState" align="center" label="鍚敤鐘舵��" min-width="120" />
+ <el-table-column prop="id" align="center" label="涓嬬墖浣�" min-width="80" />
+ <el-table-column prop="long" align="center" label="鏋跺彿" min-width="120" />
+ <el-table-column prop="wide" align="center" label="娴佺▼鍗″彿" min-width="120" />
+ <el-table-column prop="wide" align="center" label="鎬绘暟閲�" min-width="120" />
+ <el-table-column prop="wide" align="center" label="宸茶惤鏋舵暟閲�" min-width="120" />
+ <el-table-column prop="state" align="center" label="鍚敤鐘舵��" min-width="120" />
<el-table-column fixed="right" label="鎿嶄綔" align="center" width="200">
- <template #default="scope">
- <el-button size="mini" type="text" plain v-show="scope.row.enableState !== '宸插惎鐢�' " @click="handleBindRack(scope.row)">缁戝畾鏋跺瓙</el-button>
- <el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">娓呯┖</el-button>
- </template>
+ <template #default>
+ <el-button size="mini" type="text" plain v-show="state !== '宸插惎鐢�' " @click="dialogFormVisiblea = true">缁戝畾鏋跺瓙</el-button>
+ <el-button size="mini" type="text" plain @click="dialogForm">娓呯┖</el-button>
+ </template>
</el-table-column>
</el-table>
</div>
</el-card>
-
-
+
+ </div>
+ <div style="display: flex;">
+ <div id="main-body">
+ <Landingindication></Landingindication>
+ </div>
+ <!-- <div id="main-body">
+ <Landingindicationtwo></Landingindicationtwo>
+ </div> -->
+ </div>
<el-dialog v-model="dialogFormVisiblea" top="21vh" width="30%" title="缁戝畾鏋跺瓙" >
<div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;">
- <el-form size="mini" label-width="150px">
- <el-form label-width="100px" label-position="right">
- <el-form-item label="鏋跺彿锛�" :required="true" style="width: 18vw">
- <el-input v-model="workstationId" autocomplete="off"/>
- </el-form-item>
- <el-form-item label="娴佺▼鍗″彿锛�" :required="true" style="width: 18vw;">
- <el-select v-model="flowCardId" placeholder="璇烽�夋嫨娴佺▼鍗″彿">
- <el-option v-for="item in flowCardOptions" :key="item.flowcard_id" :label="item.flowcard_id" :value="item.flowcard_id" />
- </el-select>
- </el-form-item>
- </el-form>
- </el-form>
- </div>
+ <el-form size="mini" label-width="150px">
+ <el-form label-width="100px" label-position="right">
+ <el-form-item label="鏋跺彿锛�" :required="true" style="width: 18vw">
+ <el-input autocomplete="off"/>
+ </el-form-item>
+ <el-form-item label="娴佺▼鍗″彿锛�" :required="true" style="width: 18vw;">
+ <el-input autocomplete="off" />
+ </el-form-item>
+ </el-form>
+ </el-form>
+ </div>
<template #footer>
<div id="dialog-footer">
- <el-button type="primary" @click="handleConfirm">
+ <el-button type="primary" @click="dialogFormVisiblea = false">
纭
</el-button>
<el-button @click="dialogFormVisiblea = false">鍙栨秷</el-button>
</div>
</template>
</el-dialog>
-
-
-
-
- <el-dialog v-model="dialogFormVisiblea2" top="21vh" width="30%" title="娓呴櫎鏋跺瓙鐜荤拑" >
-
- <template #footer>
- <div id="dialog-footer">
- <el-button type="primary" @click="handleclear">
- 纭
- </el-button>
- <el-button @click="dialogFormVisiblea2 = false">鍙栨秷</el-button>
- </div>
- </template>
- </el-dialog>
-
-
- <!-- workstationId: '1',
- workstationId: '1005',
- flowCardId: '183.6',
- totalquantity: '1991',
- racksnumber:"1",
- work_state: '寰呰瘑鍒�', -->
- </div>
- <div style="display: flex;">
- <div id="main-body">
- <Landingindication></Landingindication>
- </div>
- <div id="main-bodya">
- <Landingindicationtwo></Landingindicationtwo>
- </div></div>
</template>
<style scoped>
@@ -389,11 +212,7 @@
height: 450px;
}
#main-body{
- margin-top: -20px;
- margin-left: 300px;
-}
-#main-bodya{
margin-top: -10px;
- margin-left: 100px;
+ margin-left: 450px;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0