From 987c5449befa49ae050d84b83d9d27b4b748003b Mon Sep 17 00:00:00 2001 From: wang <3597712270@qq.com> Date: 星期三, 10 四月 2024 09:52:55 +0800 Subject: [PATCH] 路由 --- UI-Project/src/views/UnLoadGlass/loadmachinerack.vue | 285 +++++++++++++------------------------------------------- 1 files changed, 66 insertions(+), 219 deletions(-) diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue index 7b8b00f..5c43e1d 100644 --- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue +++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue @@ -1,166 +1,51 @@ <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) - - -const dialogFormVisiblea2 = ref(false) - - -const tableData = reactive([]); - - - - - -// 鏁版嵁 -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/downWorkstation/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/downWorkstation/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/downWorkstation/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/downWorkstation/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( '鏄惁鍒犻櫎璇ユ潯淇℃伅?', @@ -247,10 +132,6 @@ ], }) - - - - </script> <template> @@ -260,80 +141,50 @@ <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> <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> + <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> <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> @@ -357,11 +208,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