From 78e5175a05eeb3776d3f21f603fb6fb7a18b3d54 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期四, 08 八月 2024 10:14:59 +0800
Subject: [PATCH] 1、任务表中新增是否删除字段 0:未删除 1:已删除 2、磨边队列方法改造:增加设置参数接口,websocket推送数据时可按照设置的参数推送对应的数据 3、任务新增破损、拿走状态处理 4、破损数据新增批量新增 5、工位流程卡玻璃是否到齐方法完善
---
UI-Project/src/views/Slicecage/slicecage.vue | 91 ++++++++++++++++++++++++++++++++++++---------
1 files changed, 72 insertions(+), 19 deletions(-)
diff --git a/UI-Project/src/views/Slicecage/slicecage.vue b/UI-Project/src/views/Slicecage/slicecage.vue
index 3b15d14..e15909d 100644
--- a/UI-Project/src/views/Slicecage/slicecage.vue
+++ b/UI-Project/src/views/Slicecage/slicecage.vue
@@ -7,7 +7,7 @@
const router = useRouter()
import request from "@/utils/request"
import { WebSocketHost ,host} from '@/utils/constants'
-import { ref, onMounted , onBeforeUnmount, reactive, computed } from "vue";
+import { ref, onMounted , onBeforeUnmount, reactive, computed,onUnmounted } from "vue";
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
import { ElMessage, ElMessageBox } from 'element-plus'
import { tr } from "element-plus/es/locale";
@@ -40,7 +40,6 @@
const adjustedRectsh = ref([]);
const currentRow = reactive({}); // 褰撳墠琛岀殑鏁版嵁
const inputValuesa = reactive({});
-
const add = ref(false)
const flowCardId = ref('');
const gap = ref('');
@@ -76,19 +75,8 @@
const cell8=ref(true);
const cell9=ref(true);
const selectedRow = ref(null); // 瀛樺偍閫変腑鐨勮鏁版嵁
-
-onMounted(async () => {
- try {
- const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass');
- if (response.code === 200) {
- tableDatagh.value = response.data
- } else {
- ElMessage.warning(response.msg)
- }
- } catch (error) {
- // console.error('Error fetching rects :', error);
- }
-});
+const temperingtotal = ref(0);
+const glasstotal = ref(0);
// 褰撳墠椤电爜鍜屾瘡椤垫樉绀虹殑鏉℃暟
const currentPage = ref(1);
const itemsPerPage = computed(() => {
@@ -513,6 +501,46 @@
dialoglea.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
fetchFlowCardId();
};
+const handleganghua = () => {
+ dialogFormVisiblec.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
+ fetchFlow();
+};
+// 閽㈠寲鏌ヨ
+
+onMounted(async () => {
+ try {
+ const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass');
+ if (response.code === 200) {
+ tableDatagh.value = response.data
+ } else {
+ ElMessage.warning(response.msg)
+ }
+ } catch (error) {
+ // console.error('Error fetching rects :', error);
+ }
+});
+const fetchFlow = async () => {
+ try {
+ const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass')
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ tableDatagh.value = response.data
+ temperingtotal.value = response.data.length
+ let totalCount = 0;
+ response.data.forEach(item => {
+ totalCount += item.count || 0;
+ });
+ glasstotal.value = totalCount;
+ } else {
+ ElMessage.error(response.message);
+ }
+}
+catch (error) {
+ // 澶勭悊閿欒
+ console.error(error);
+ }
+}
+// 鍊肩彮淇℃伅
const fetchFlowCardId = async () => {
try {
const response = await request.post('/cacheVerticalGlass/work_assignment/selectWorkAssignment',{
@@ -523,7 +551,6 @@
ElMessage.success(response.message);
tableDatax.value = response.data;
console.log(tableDatax.value);
- console
} else {
ElMessage.error(response.message);
}
@@ -566,6 +593,7 @@
console.error(error);
}
}
+let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
@@ -673,9 +701,14 @@
// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
onMounted(() => {
// fetchFlowCardId();
- initializeWebSocket(socketUrl, handleMessage);
-
+ // initializeWebSocket(socketUrl, handleMessage);
+ socket = initializeWebSocket(socketUrl, handleMessage);
});
+ onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+ });
function getStatusType(enableState: number) {
switch (enableState) {
case 100:
@@ -736,7 +769,7 @@
<div style="height: 600px;">
<el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary" @click="dialogFormVisiblea = true">{{ $t('searchOrder.cageinformation') }}</el-button>
<el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('searchOrder.productionqueue') }}</el-button>
- <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="dialogFormVisiblec = true">{{ $t('searchOrder.temperingqueries') }}</el-button>
+ <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="warning" @click="handleganghua">{{ $t('searchOrder.temperingqueries') }}</el-button>
<el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="handlezhiban">{{ $t('searchOrder.dutyinformation') }}</el-button>
<el-switch style="margin-top: 5px;margin-left: 10px;" v-model="ganghua" class="mb-2" :inactive-text="$t('searchOrder.temperedswitch')" @change="handleChange" />
<el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading">
@@ -1362,6 +1395,26 @@
</el-table>
</el-dialog>
<el-dialog v-model="dialogFormVisiblec" top="5vh" width="85%" :title="$t('searchOrder.temperingqueries')">
+ <div style="margin-bottom: 20px">
+ <el-form>
+ <el-row style="margin-top: -15px;margin-bottom: -2px;">
+ <el-col :span="4">
+ <div id="dt" style="font-size: 15px;">
+ <el-form-item :label="$t('searchOrder.temperingtotal')" style="width: 14vw">
+ {{ temperingtotal }}
+ </el-form-item>
+ </div>
+ </el-col>
+ <el-col :span="5">
+ <div id="dta" style="font-size: 15px;">
+ <el-form-item :label="$t('searchOrder.glasstotal')" style="width: 14vw">
+ {{ glasstotal }}
+ </el-form-item>
+ </div>
+ </el-col>
+ </el-row>
+ </el-form>
+ </div>
<el-table ref="table" style="margin-top: 20px;height: 500px;"
:data="tableDatagh" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
<el-table-column prop="engineer_id" fixed align="center" :label="$t('searchOrder.projectnumber')" min-width="150"/>
--
Gitblit v1.8.0