From ef9e8df8f911d53d1ec23bf920f1cd5ba8f18e13 Mon Sep 17 00:00:00 2001 From: 严智鑫 <test> Date: 星期五, 13 九月 2024 08:04:26 +0800 Subject: [PATCH] 线路配置,打标机前端页面 --- UI-Project/src/views/Marking/marking.vue | 191 ++++++++++++++++++++++++++++++++++++----------- 1 files changed, 146 insertions(+), 45 deletions(-) diff --git a/UI-Project/src/views/Marking/marking.vue b/UI-Project/src/views/Marking/marking.vue index 6ec2763..8b76033 100644 --- a/UI-Project/src/views/Marking/marking.vue +++ b/UI-Project/src/views/Marking/marking.vue @@ -1,33 +1,116 @@ <!-- 鎵撴爣鏈� --> <script setup> import request from "@/utils/request"; -import { ElMessage } from "element-plus"; -</script> -<script> -export default { - mounted() { - //鑾峰彇鏁版嵁 - var data="ProcessId="+"P24032508"; - request.get("/TidyUpGlassModule/SelectTerritoryInfo?"+data).then((res) => { - if (res.code == 200) { - for(var i=0;i<res.data.length;i++){ - //閬嶅巻鏁版嵁 - } - f1(); - } else { - ElMessage.warning(res.msg) - router.push("/login"); - } - }); - }, - methods: { - //鏂规硶 - f1() { - +import { ElMessage, ElMessageBox } from "element-plus"; +import { reactive, ref, onMounted } from 'vue' +import { useI18n } from 'vue-i18n' +let language = ref(localStorage.getItem('lang') || 'zh') +const { t } = useI18n() +const requestData = reactive({ + account: '', + password: '', +}); +const findCraftTaskingData = ref([]); + +onMounted(async () => { + load(); +}); +//鑾峰彇鏁版嵁 +const load = async() => { + try { + const response = await request.post('/deviceInteraction/tasking/findCraftTasking', + { + "glassId": 0, + "state": "绾夸笂", + "workState": "宸ヤ綔", + "currentCraft": "鎵撶(" + }); // 鏇挎崲涓轰綘鐨凙PI绔偣 + if (response.code === 200) { + findCraftTaskingData.value= response.data; + } else { + ElMessage.warning(res.msg) } + } catch (error) { + // console.error('Error fetching rects :', error); } } +//淇敼宸ヤ綔鐘舵�� 銆愬け璐�/宸ヤ綔/瀹屾垚銆� +const workStatus = async(row,state) => { + ElMessageBox.confirm( + t('marking.tips'), + t('delivery.prompt'), + { + confirmButtonText: t('marking.sure'), + cancelButtonText: t('marking.cancel'), + type: 'warning', + } + ) + .then(() => { + //寮�濮嬩慨鏀� + request.post("/deviceInteraction/tasking/updateCraftTasking", + { + "glassId": row.glassId, + "workState": state + }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣 + if (res.code === 200) { + ElMessage.success(res.message); + load(); + } else { + ElMessage.warning(res.message) + } + }) + }) + .catch(() => { + ElMessage({ + type: 'info', + message: t('marking.cancel'), + }) + }) +} + +//寮�宸�/鏆傚仠 +const machineStatus = async(row,state) => { + +} + +//涓嬬嚎(鎷胯蛋) +const downLine = async(row,state) => { + ElMessageBox.confirm( + t('marking.tips'), + t('delivery.prompt'), + { + confirmButtonText: t('marking.sure'), + cancelButtonText: t('marking.cancel'), + type: 'warning', + } + ) + .then(() => { + //涓嬬嚎鎺ュ彛 + request.post("/deviceInteraction/tasking/updateDownLine", + { + "glassId": row.glassId, + "state": state + }).then((res) => { // 鏇挎崲涓轰綘鐨凙PI绔偣 + if (res.code === 200) { + ElMessage.success(res.message); + this.load(); + } else { + ElMessage.warning(res.message) + } + }) + }) + .catch(() => { + ElMessage({ + type: 'info', + message: t('marking.cancel'), + }) + }) +} +//涓婄嚎 +const topLine = async() => { + +} </script> <template> @@ -35,52 +118,70 @@ <div id="div-title" style="font-size: 20px; font-weight: bold; margin:10px 0 10px 0;padding-left: 20px;"> 鑷姩鎵撴爣鏈� </div> - <hr/> + <hr /> <br> - <div id="search"> + <div id="search" style="padding-left: 20px;"> <!-- 鍔熻兘 --> - <el-button type="primary" id="searchButton">寮�宸�</el-button> - <el-button type="primary" id="searchButton">涓婄嚎</el-button> - <el-button type="primary" id="searchButton">涓嬬嚎</el-button> - <el-button type="primary" id="searchButton">鐮存崯</el-button> - <el-button type="primary" id="searchButton">瀹屽伐</el-button> + <el-button type="primary" id="searchButton" @click="machineStatus">寮�宸�</el-button> + <el-button type="primary" id="searchButton" @click="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> --> </div> <div id="main-body" style="min-height:240px;"> <!-- 琛ㄦ牸鍐呭 --> - <el-table :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129',textAlign:'center'}"> - <el-table-column prop="date" label="搴忓彿" /> - <el-table-column prop="name" label="宸ョ▼鍙�" /> - <el-table-column prop="name" label="鐜荤拑绫诲瀷" /> - <el-table-column prop="name" label="鐜荤拑缂栧彿" /> - <el-table-column prop="name" label="闀�" /> - <el-table-column prop="name" label="瀹�" /> - <el-table-column prop="name" label="鍘�" /> - <el-table-column prop="name" label="鐘舵��" /> + <el-table :data="findCraftTaskingData" stripe + :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }" + :cell-style="{ textAlign: 'center' }"> + <!-- <el-table-column type="selection" min-width="30" /> --> + <el-table-column type="index" label="搴忓彿" min-width="30" /> + <el-table-column prop="batchNumber" label="鎵规鍙�" /> + <el-table-column prop="taskType" label="浠诲姟绫诲瀷" /> + <el-table-column prop="glassId" label="鐜荤拑缂栧彿" /> + <el-table-column prop="length" label="闀�" /> + <el-table-column prop="width" label="瀹�" /> + <el-table-column prop="thickness" label="鍘�" /> + <el-table-column prop="workState" label="鐘舵��" /> + <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, '鐮存崯')">鐮存崯</el-button> + <el-button size="mini" link type="primary" plain @click="workStatus(scope.row, '瀹屽伐')">瀹屽伐</el-button> + <el-button size="mini" link type="primary" plain @click="downLine(scope.row, '涓嬬嚎')">涓嬬嚎</el-button> + </template> + </el-table-column> </el-table> </div> - - <div id="main-body" style="height: 100%;"> + + <div id="main-body" + style="width: 100%; height: 460px;background-image: url(../../src/assets/鑷姩鎵撴爣鏈�.png) ;background-size: 100% 100%;"> <!-- 鐢诲浘鍐呭 --> - <el-image style="width: 100%; height: 460px;" src="../../src/assets/鑷姩鎵撴爣鏈�.png"></el-image> + <div style="width: 100px; height: 100px; background-color: red; position: relative; top: 171px; left: 218px"> + </div> </div> </div> </template> <style scoped> -table{ +table { text-align: center; width: 100%; height: 100%; border-collapse: collapse; border-spacing: 0; } -#main-body{ + +table td { + text-align: center; +} + +#main-body { width: 100%; height: 100%; border: 1px solid #ccc; margin-top: 25px; } -#searchButton{ + +#searchButton { width: 100px; height: 40px; font-size: 16px; -- Gitblit v1.8.0