From a5a12dfed331c5d2508e1acee474c9d6dc35b774 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期一, 18 十一月 2024 08:26:12 +0800
Subject: [PATCH] 义乌新增掰片/识别、卧式缓存、磨边(冷加工)页面 前端路由配置等
---
UI-Project/src/views/Identify/identifwu.vue | 345 +++++++++++++++++++++
UI-Project/src/views/Returns/upreturns.vue | 16
UI-Project/src/views/Returns/upreturns2.vue | 11
UI-Project/src/views/Identify/ident.vue | 53 +++
UI-Project/src/views/StockBasicData/stockBasicyiwu.vue | 252 +++++++++++++++
UI-Project/src/router/index.js | 21 +
UI-Project/src/views/Caching/cachingyiwu.vue | 205 ++++++++++++
7 files changed, 884 insertions(+), 19 deletions(-)
diff --git a/UI-Project/src/router/index.js b/UI-Project/src/router/index.js
index 1b60f11..c62b00d 100644
--- a/UI-Project/src/router/index.js
+++ b/UI-Project/src/router/index.js
@@ -95,13 +95,18 @@
/*----------- 鎺扮墖/璇嗗埆 ----------------*/
{
path: 'Identify',
- name: 'Identify',
- component: () => import('../views/Identify/identify.vue'),
- children:[
+ name: 'ident',
+ component: () => import('../views/Identify/ident.vue'),
+ children: [
{
path: '/Identify/identify',
name: 'identify',
component: () => import('../views/Identify/identify.vue')
+ },
+ {
+ path: '/Identify/identifwu',
+ name: 'identifwu',
+ component: () => import('../views/Identify/identifwu.vue')
},
]
},
@@ -121,6 +126,11 @@
name: 'cachingun',
component: () => import('../views/Caching/cachingun.vue')
},
+ {
+ path: '/Caching/cachingyiwu',
+ name: 'cachingyiwu',
+ component: () => import('../views/Caching/cachingyiwu.vue')
+ },
]
},
/*----------- 纾ㄨ竟锛堝喎鍔犲伐锛� ----------------*/
@@ -139,6 +149,11 @@
name: 'stockBasicDatatwo',
component: () => import('../views/StockBasicData/stockBasicDatatwo.vue')
},
+ {
+ path: '/StockBasicData/stockBasicyiwu',
+ name: 'stockBasicyiwu',
+ component: () => import('../views/StockBasicData/stockBasicyiwu.vue')
+ },
]
},
/*----------- 澶х悊鐗囩 ----------------*/
diff --git a/UI-Project/src/views/Caching/cachingyiwu.vue b/UI-Project/src/views/Caching/cachingyiwu.vue
new file mode 100644
index 0000000..6f75e6a
--- /dev/null
+++ b/UI-Project/src/views/Caching/cachingyiwu.vue
@@ -0,0 +1,205 @@
+<script setup>
+import {onBeforeUnmount, onMounted, onUnmounted, ref} from "vue";
+import {useRouter} from "vue-router"
+import {host, WebSocketHost} from '@/utils/constants'
+
+import request from "@/utils/request"
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+// import { ref } from 'vue'
+import {ElMessage, ElMessageBox} from 'element-plus'
+// import LanguageMixin from './lang/LanguageMixin'
+import {useI18n} from 'vue-i18n'
+
+const router = useRouter()
+const adda = ref(false)
+const {t} = useI18n()
+let language = ref(localStorage.getItem('lang') || 'zh')
+const tableData = ref([])
+const slot = ref('')
+const adjustedRects = ref([]);
+onMounted(async () => {
+ try {
+ const response = await request.post('/cacheGlass/edgStorageCage/selectEdgStorageCage'); // 鏇挎崲涓轰綘鐨凙PI绔偣
+ if (response.code === 200) {
+ const rawRects = response.data; // 璁剧疆鐭╁舰鏁版嵁
+ tableData.value = response.data
+ console.log(response.data);
+ adjustedRects.value = rawRects.map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ width: rect.width * 0.5,
+ id: rect.id * 10,
+ }));
+ console.log(adjustedRects.value);
+ } else {
+ ElMessage.warning(res.msg)
+ }
+ } catch (error) {
+ // console.error('Error fetching rects :', error);
+ }
+});
+const toggleEnableState = async (row) => {
+ const newState = row.enable_state === 1 ? 0 : 1;
+ // 鍙戦�佽姹傚埌鍚庣鏇存柊鐘舵�侊紙杩欓噷鐪佺暐浜嗗疄闄呯殑璇锋眰閫昏緫锛�
+ const response = await request.post('/cacheGlass/edgStorageCage/updateEdgStorageCage', {
+ id: row.id,
+ enableState: newState
+ });
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ ElMessage.error(response.message);
+ }
+ row.enable_state = newState;
+};
+const open = async (row) => {
+ try {
+ const confirmResult = await ElMessageBox.confirm(
+ t('sorter.information'),
+ t('sorter.prompt'),
+ {
+ confirmButtonText: t('sorter.yes'),
+ cancelButtonText: t('sorter.cancel'),
+ type: 'warning',
+ }
+ );
+ if (confirmResult === 'confirm') {
+ var url = "/cacheGlass/edgStorageCage/edgStorageCageGlass?edgStorageCageId=" + row.id;
+ console.log(row);
+ const response = await request.post(url, {
+ glassId: row.glass_id
+ })
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ ElMessage.error(response.msg);
+ }
+ }
+ } catch (error) {
+ console.error('鍙戠敓閿欒:', error);
+ }
+};
+let socket = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ tableData.value = data.EdgStorageCageinfos[0]
+ // adjustedRects.value = data.EdgStorageCageinfos[0]
+ adjustedRects.value = data.EdgStorageCageinfos[0].map(rect => ({
+ ...rect, // 澶嶅埗鍘熷瀵硅薄鐨勫叾浠栧睘鎬�
+ width: rect.width * 0.5,
+ id: rect.id * 10,
+ }));
+
+};
+// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
+onMounted(() => {
+ socket = initializeWebSocket(socketUrl, handleMessage);
+});
+onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+});
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
+</script>
+<template>
+ <div style="height: 500px;">
+ <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading">
+ <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
+ <el-table height="340" ref="table"
+ @selection-change="handleSelectionChange"
+ :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
+ <el-table-column prop="slot" align="center" :label="$t('sorter.gridnumber')" min-width="80"/>
+ <el-table-column prop="glass_id" align="center" :label="$t('sorter.glassnumber')" min-width="80"/>
+ <el-table-column prop="width" align="center" :label="$t('sorter.width')" min-width="120"/>
+ <el-table-column prop="height" align="center" :label="$t('sorter.height')" min-width="120"/>
+ <el-table-column
+ align="center"
+ :label="$t('sorter.startstatus')"
+ min-width="80"
+ prop="enable_state"
+ >
+ <template #default="scope">
+ <el-tag
+ :type="scope.row.enable_state === 1 ? 'success' : 'danger'"
+ @click="toggleEnableState(scope.row)"
+ >
+ {{ scope.row.enable_state === 1 ? $t('sorter.start') : $t('sorter.disable') }}
+ </el-tag>
+ </template>
+ <!-- <template #default="scope">
+ <el-tag type="success" >{{ scope.row.enable_state==1?"鍚敤":"鏈惎鐢�" }}</el-tag>
+ </template> -->
+ </el-table-column>
+ <el-table-column fixed="right" :label="$t('sorter.operate')" align="center" width="200">
+ <template #default="scope">
+ <!-- <el-button size="mini" type="text" plain @click="handleBindRacka(scope.row)">鎶ョ己</el-button> -->
+ <el-button size="mini" type="text" plain @click="open(scope.row)">{{
+ $t('sorter.deficiencieste')
+ }}
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </el-card>
+ <div class="awatch">
+ <img src="../../assets/woshihuancun.png" alt=""
+ style="width: 70%;height: 90%;margin-left: 200px;margin-top: 20px;position: relative;">
+ <div style="position: relative; width: 500px;height: 95px;margin-top: -165px;margin-left: 450px;">
+ <div
+ v-for="(rect, index) in adjustedRects"
+ :key="rect"
+ :style="{ position: 'absolute',
+ top: `${rect.id}px`, left: `10px`, width: `${rect.width}px`, height: `5px`,
+ backgroundColor: '#409EFF'
+ }"
+ >
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<style scoped>
+
+#dt {
+ display: block;
+ float: left;
+ line-height: 20px;
+ margin-left: 100px;
+}
+
+#dta {
+ display: block;
+ float: left;
+ line-height: 20px;
+ margin-left: 80%;
+}
+
+#dialog-footer {
+ text-align: center;
+ margin-top: -15px;
+}
+
+#message {
+ text-align: center;
+ align-items: center;
+ color: black;
+ width: 200px;
+ height: 100px;
+ background-color: #337ecc;
+ margin-left: 28%;
+}
+
+.awatch {
+ height: 460px;
+ width: 1500px;
+ max-width: 100%;
+}
+
+</style>
diff --git a/UI-Project/src/views/Identify/ident.vue b/UI-Project/src/views/Identify/ident.vue
new file mode 100644
index 0000000..46345b7
--- /dev/null
+++ b/UI-Project/src/views/Identify/ident.vue
@@ -0,0 +1,53 @@
+<script setup>
+let indexFlag = $ref(1)
+
+function changeRouter(index) {
+ indexFlag = index
+}
+
+</script>
+
+<template>
+ <!-- <div id="main-div"> -->
+
+
+ <div id="main-body">
+ <router-view/>
+ </div>
+ <!-- </div> -->
+</template>
+
+<style scoped>
+#main-div {
+ width: 100%;
+ height: 100%;
+}
+
+#div-title {
+ height: 2%;
+ width: 100%;
+}
+
+#searchButton {
+ margin-top: -5px;
+ margin-left: 1rem;
+}
+
+/* #searchButton1{
+//margin-left: 10rem;
+} */
+/*main-body鏍峰紡*/
+#main-body {
+ width: 100%;
+ height: 95%;
+ /* margin-top: 1%; */
+}
+
+#select {
+ margin-left: 0.5rem;
+}
+
+:deep(.indexTag .el-breadcrumb__inner) {
+ color: #5CADFE !important;
+}
+</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/Identify/identifwu.vue b/UI-Project/src/views/Identify/identifwu.vue
new file mode 100644
index 0000000..651915c
--- /dev/null
+++ b/UI-Project/src/views/Identify/identifwu.vue
@@ -0,0 +1,345 @@
+<template>
+ <div style="height: 500px;">
+ <div style="display: flex;">
+ <el-input v-model="inputValue" style="margin-left: 15px;margin-top: 10px;width: 240px" placeholder="璇疯緭鍏ュ伐绋嬪彿"
+ @blur="handleBlur"/>
+ <el-pagination
+ v-model:current-page="currentPage"
+ :page-size="pageSize"
+ :size="size"
+ :disabled="disabled"
+ layout="prev, pager, next, jumper"
+ :total="totalPages"
+ @current-change="handleCurrentChange"
+ />
+ </div>
+ <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading">
+ <el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;">
+ <div style="position: relative;">
+ <div
+ v-for="(rect, index) in adjustedRects"
+ :key="rect.glass_id"
+ class="rect"
+ @click="showDialog(rect.glass_id)"
+ :style="{ position: 'absolute',
+ top: `${rect.y_axis}px`, left: `${rect.x_axis}px`, width: `${rect.width}px`, height: `${rect.height}px`,
+ backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor(rect.glass_state)
+ }"
+ >
+ <!-- 绠ご -->
+ <!-- <div id="arrow"></div>
+ <div id="line"></div> -->
+ <div class="centered-text">
+ <div>{{ rect.glass_id }}</div>
+ <div>{{ rect.widtha }}*{{ rect.heighta }}</div>
+ </div>
+ </div>
+ </div>
+ </el-scrollbar>
+ <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose">
+ <el-button :disabled="currentGlassRect?.glass_state === 8 || currentGlassRect?.glass_state === 9" type="warning"
+ plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;">
+ {{ $t('order.dilapidation') }}
+ </el-button>
+ <el-button :disabled="currentGlassRect?.glass_state === 9 || currentGlassRect?.glass_state === 8" type="danger"
+ plain @click="handleManualTake(currentGlassId)" style="width: 140px;margin-top: 10px;">
+ <el-icon class="el-icon--right">
+ <Upload/>
+ </el-icon>
+ {{ $t('order.takeaway') }}
+ </el-button>
+ </el-dialog>
+ </el-card>
+ </div>
+</template>
+<script setup lang="ts">
+import {ElMessage} from 'element-plus'
+import {computed, onMounted, onUnmounted, ref} from 'vue';
+import request from "@/utils/request"
+import {host, WebSocketHost} from '@/utils/constants'
+import {useI18n} from 'vue-i18n'
+
+const {t} = useI18n()
+let language = ref(localStorage.getItem('lang') || 'zh')
+const blind = ref(false)
+const olWidth = ref();
+const olHeight = ref();
+const glass_id = ref();
+const inputValue = ref('');
+const currentGlassId = ref(null); // 瀛樺偍褰撳墠鐐瑰嚮鐭╁舰鐨� glass_id
+const currentstate = ref(null);
+const adjustedRects = ref([]);
+const raw = ref([]);
+let webSocket: WebSocket | null = null;
+const totalPages = ref(0);
+const pageSize = ref(1);
+const currentPage = ref('');
+const disabled = false;
+const size = 'small';
+const rawData = ref([]);
+// const handleBind = (row) => {
+// blind.value = true; // 鎵撳紑缁戝畾鏋跺瓙瀵硅瘽妗�
+// };
+// 鏄剧ず瀵硅瘽妗嗗苟璁剧疆褰撳墠 glass_id
+const currentGlassRect = computed(() => {
+ return adjustedRects.value.find(rect => rect.glass_id === currentGlassId.value);
+});
+
+function showDialog(glassId: number) {
+ currentGlassId.value = glassId;
+ blind.value = true;
+ adjustedRects.value = adjustedRects.value.map(rect =>
+ rect.glass_id === glassId ? {...rect, isActive: true} : rect
+ );
+}
+
+const handleDialogClose = () => {
+ adjustedRects.value = adjustedRects.value.map(rect => ({
+ ...rect,
+ isActive: false
+ }));
+}
+// 鐮存崯
+const handleDamage = async () => {
+ try {
+ const response = await request.post('/cacheGlass/taskCache/identControls', {
+ glassId: currentGlassId.value,
+ state: 8,
+ line: 1001,
+ workingProcedure: '鍒囧壊',
+ })
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ // window.location.reload()
+ blind.value = false;
+ updateRectStatus(currentGlassId.value, 8);
+ findEngineering()
+ } else {
+ // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
+ ElMessage.error(response.msg);
+ }
+ } catch (error) {
+ // 澶勭悊閿欒
+ console.error(error);
+ }
+}
+// 浜哄伐鎷胯蛋
+const handleManualTake = async () => {
+ try {
+ // var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200;
+ // console.log(url);
+ // const response = await request.post(url)
+ const response = await request.post('/cacheGlass/taskCache/identControls', {
+ glassId: currentGlassId.value,
+ state: 9,
+ line: 1001,
+ workingProcedure: '鍒囧壊',
+ })
+ if (response.code == 200) {
+ // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
+ ElMessage.success(response.message);
+ // window.location.reload()
+ blind.value = false;
+ updateRectStatus(currentGlassId.value, 9);
+ findEngineering()
+ } else {
+ // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
+ ElMessage.error(response.msg);
+ }
+ } catch (error) {
+ // 澶勭悊閿欒
+ console.error(error);
+ }
+}
+const handleBlur = async () => {
+ if (inputValue.value) {
+ var url = "/cacheGlass/taskCache/cutTerritory?current=" + inputValue.value;
+ const response = await request.post(url)
+ if (response.code === 200) {
+ const rawRects = response.data[0];
+ rawData.value = response.data;
+ totalPages.value = rawData.value.length;
+ const scaleFactor = 1621.78 / 6000;
+ const scaleFactory = 750 / 3300;
+ adjustedRects.value = rawRects.map(rect => ({
+ ...rect,
+ x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor,
+ y_axis: rect.y_axis * scaleFactory,
+ width: rect.width * scaleFactor,
+ widtha: rect.width,
+ heighta: rect.height,
+ height: rect.height * scaleFactory,
+ glass_state: rect.glass_state
+ }));
+ // 濡傛灉WebSocket宸茶繛鎺ワ紝鍒欏叧闂�
+ if (webSocket) {
+ webSocket.close();
+ webSocket = null;
+ }
+ currentPage.value = 1;
+ }
+ } else {
+ connectWebSocket();
+ }
+};
+const findEngineering = async () => {
+ if (inputValue.value) {
+ var url = "/cacheGlass/taskCache/cutTerritory?current=" + inputValue.value;
+ const response = await request.post(url)
+ if (response.code === 200) {
+ rawData.value = response.data;
+ }
+ } else {
+ }
+};
+
+const handleCurrentChange = (val: number) => {
+ currentPage.value = val;
+ // window.localStorage.setItem('pagenumber', currentPage.value).
+ const page = currentPage.value - 1
+ const scaleFactor = 1621.78 / 6000;
+ const scaleFactory = 750 / 3300;
+ adjustedRects.value = rawData.value[page]?.map(rect => ({
+ // adjustedRects.value = rawRects.map(rect => ({
+ ...rect,
+ x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor,
+ y_axis: rect.y_axis * scaleFactory,
+ width: rect.width * scaleFactor,
+ widtha: rect.width,
+ heighta: rect.height,
+ height: rect.height * scaleFactory,
+ glass_state: rect.glass_state
+ }));
+};
+
+function getRectColor(state: number): string {
+ switch (state) {
+ case 0:
+ return '#e1f3d8';
+ case 100:
+ return '#c8c9cc';
+ case 110:
+ return '#b3e19d';
+ case 120:
+ return '#f89898';
+ case 8:
+ return '#911005';
+ case 9:
+ return '#f3d19e';
+ }
+}
+
+// 鏇存柊鐭╁舰鐘舵��
+function updateRectStatus(glassId: string, status: number) {
+ adjustedRects.value.forEach(rect => {
+ if (rect.glass_id === glassId) {
+ rect.glass_state = status; // 鏇存柊鐭╁舰鐨勭姸鎬�
+ }
+ });
+}
+
+const connectWebSocket = () => {
+ if (!webSocket) {
+ const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`;
+ webSocket = new WebSocket(socketUrl);
+ webSocket.onmessage = (event) => {
+ const data = JSON.parse(event.data);
+ const scaleFactor = 1621.78 / 6000;
+ const scaleFactory = 750 / 3300;
+ if (data.currentCutTerritory && data.currentCutTerritory.length > 0) {
+ const newRects = data.currentCutTerritory[0].map(rect => {
+ const existingRect = adjustedRects.value.find(r => r.glass_id === rect.glass_id);
+
+ if (existingRect) {
+ return {
+ ...existingRect,
+ x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor,
+ y_axis: rect.y_axis * scaleFactory,
+ width: rect.width * scaleFactor,
+ height: rect.height * scaleFactory,
+ widtha: rect.width,
+ heighta: rect.height,
+ glass_state: rect.glass_state,
+ // 淇濇寔 isActive 鐘舵�佷笉鍙�
+ };
+ } else {
+ // 濡傛灉涓嶅瓨鍦紝鍒欐坊鍔犳柊鐭╁舰锛岄粯璁� isActive 涓� false
+ return {
+ ...rect,
+ x_axis: (6000 - (rect.x_axis + rect.width)) * scaleFactor,
+ y_axis: rect.y_axis * scaleFactory,
+ width: rect.width * scaleFactor,
+ height: rect.height * scaleFactory,
+ widtha: rect.width,
+ heighta: rect.height,
+ glass_state: rect.glass_state,
+ isActive: false,
+ glass_id: rect.glass_id,
+ };
+ }
+ });
+ adjustedRects.value = newRects;
+ } else if (data.currentCutTerritory == '') {
+ adjustedRects.value = [];
+ }
+ };
+ }
+};
+onMounted(() => {
+ // 鍒濆鏃讹紝濡傛灉杈撳叆妗嗕负绌猴紝鍒欒繛鎺ebSocket
+ if (!inputValue.value) {
+ connectWebSocket();
+ }
+});
+
+onUnmounted(() => {
+ if (webSocket) {
+ webSocket.close();
+ }
+});
+</script>
+
+<style scoped>
+.rect {
+ border: 1px solid black; /* 璁剧疆鐭╁舰鐨勮竟妗� */
+ /* background-color: lightblue; 璁剧疆鐭╁舰鐨勮儗鏅壊 */
+}
+
+.centered-text {
+ /* 璁剧疆鏂囧瓧灞呬腑鏍峰紡 */
+ /* display: flex; */
+ justify-content: center;
+ align-items: center;
+ height: 100%; /* 纭繚div鍗犳嵁鏁翠釜鐭╁舰鐨勯珮搴� */
+ font-size: small;
+}
+
+#rect {
+ position: relative; /* 纭繚绠ご鍙互鐩稿浜庣煩褰㈠畾浣� */
+ /* 鍏朵粬鏍峰紡 */
+}
+
+#arrow {
+ position: absolute;
+ top: 70%; /* 绠ご浣嶄簬鐭╁舰涓棿 */
+ left: 200px; /* 绠ご鍦ㄧ煩褰㈠乏渚т竴浜涜窛绂� */
+ transform: translateY(-50%); /* 鍨傜洿灞呬腑 */
+ width: 0;
+ height: 0;
+ border-top: 10px solid transparent; /* 涓婅竟妗� */
+ border-bottom: 10px solid transparent; /* 涓嬭竟妗� */
+ border-right: 20px solid #911005; /* 鍙宠竟妗嗭紝褰㈡垚绠ご */
+ /* 鏍规嵁闇�瑕佽皟鏁磋竟妗嗗ぇ灏忓拰棰滆壊 */
+}
+
+#line {
+ position: absolute;
+ top: 70%; /* 鐩寸嚎浣嶄簬鐭╁舰涓棿 */
+ left: 210px; /* 鐩寸嚎鍦ㄧ澶村彸渚т竴浜涜窛绂� */
+ transform: translateY(-50%); /* 鍨傜洿灞呬腑 */
+ height: 2px; /* 鐩寸嚎鐨勯珮搴� */
+ width: 240px; /* 鐩寸嚎鐨勯暱搴︼紝鏍规嵁闇�瑕佽皟鏁� */
+ background-color: #911005; /* 鐩寸嚎鐨勯鑹� */
+}
+
+</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/Returns/upreturns.vue b/UI-Project/src/views/Returns/upreturns.vue
index f58b075..1236871 100644
--- a/UI-Project/src/views/Returns/upreturns.vue
+++ b/UI-Project/src/views/Returns/upreturns.vue
@@ -94,8 +94,7 @@
const handlesure = async () => {
try {
const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', {
- stationCell: 1,
- // engineerId: 'P24101602',
+ stationCell: 5,
engineerId: selectedProjectNo.value,
filmRemove: filmRemove.value,
})
@@ -122,10 +121,10 @@
let engineeringId = window.localStorage.getItem('engineeringId')
if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') {
try {
- const response = await request.post('/loadGlass/engineering/engineering/changeTask', {
- stationCell: 1,
+ const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
+ // const response = await request.post('/loadGlass/engineering/engineering/changeTask', {
+ stationCell: 5,
filmRemove: filmRemove,
- // engineerId: 'P24101602',
engineerId: engineeringId,
state: 1,
})
@@ -150,9 +149,8 @@
console.log(engineeringId);
if (engineeringId !== '') {
const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
- stationCell: 1,
- // engineerId: 'P24101602',
- engineeringId: engineeringId,
+ stationCell: 5,
+ engineerId: engineeringId,
state: 0,
})
if (response.code == 200) {
@@ -182,7 +180,7 @@
}
const response = await request.post("/loadGlass/up-patten-usage/setUpPattenRequest", {
taskState: stateList,
- taskType: 1
+ taskType: 5
})
if (response.code === 200) {
tableData.value = response.data;
diff --git a/UI-Project/src/views/Returns/upreturns2.vue b/UI-Project/src/views/Returns/upreturns2.vue
index a1ed23d..8c4d9c2 100644
--- a/UI-Project/src/views/Returns/upreturns2.vue
+++ b/UI-Project/src/views/Returns/upreturns2.vue
@@ -94,8 +94,7 @@
const handlesure = async () => {
try {
const response = await request.post('/loadGlass/up-patten-usage/selectUpPattenUsage', {
- stationCell: 2,
- // engineerId: 'P24101602',
+ stationCell: 6,
engineerId: selectedProjectNo.value,
filmRemove: filmRemove.value,
})
@@ -123,9 +122,8 @@
if (markingMachineStatus.value === 'green' && cuttingMachineStatus.value === 'green') {
try {
const response = await request.post('/loadGlass/engineering/engineering/changeTask', {
- stationCell: 2,
+ stationCell: 6,
filmRemove: filmRemove,
- // engineerId: 'P24101602',
engineerId: engineeringId,
state: 1,
})
@@ -150,8 +148,7 @@
console.log(engineeringId);
if (engineeringId !== '') {
const response = await request.post('/loadGlass/engineering/engineering/pauseTask', {
- stationCell: 2,
- // engineerId: 'P24101602',
+ stationCell: 6,
engineeringId: engineeringId,
state: 0,
})
@@ -182,7 +179,7 @@
}
const response = await request.post("/loadGlass/up-patten-usage/setUpPattenRequest", {
taskState: stateList,
- taskType: 2
+ taskType: 6
})
if (response.code === 200) {
tableData.value = response.data;
diff --git a/UI-Project/src/views/StockBasicData/stockBasicyiwu.vue b/UI-Project/src/views/StockBasicData/stockBasicyiwu.vue
new file mode 100644
index 0000000..e06ef18
--- /dev/null
+++ b/UI-Project/src/views/StockBasicData/stockBasicyiwu.vue
@@ -0,0 +1,252 @@
+<script setup>
+import {onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue";
+import {useRouter} from "vue-router"
+import {host, WebSocketHost} from '@/utils/constants'
+import request from "@/utils/request"
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+// import { ref } from 'vue'
+import {ElMessage, ElMessageBox} from 'element-plus'
+// import LanguageMixin from './lang/LanguageMixin'
+import {useI18n} from 'vue-i18n'
+
+const router = useRouter()
+const adda = ref(false)
+const {t} = useI18n()
+let language = ref(localStorage.getItem('lang') || 'zh')
+
+const tableData = ref([])
+const slot = ref('')
+const requestData = {
+ line: 2001
+};
+const timeRange = ref([])
+const selectValuesa = reactive([]);
+// request.post("/cacheGlass/taskCache/selectEdgTask",{
+// ...requestData,
+
+// }).then((res) => {
+// if (res.code == 200) {
+
+// console.log(res.data);
+// tableData.value = res.data
+// console.log(res.data[0].slot);
+// } else {
+// ElMessage.warning(res.msg)
+
+// }
+// });
+
+// 纾ㄨ竟浠诲姟鏌ヨ
+const setEdgGlassInfoRequest = async () => {
+ let celllist = []
+ let stateList = []
+ if (selectValuesa[0] != null && selectValuesa[0] != 'undefined') {
+ if (selectValuesa[0] != "") {
+ celllist = [selectValuesa[0]];
+ }
+ }
+ if (selectValuesa[1] != null && selectValuesa[1] != 'undefined') {
+ if (selectValuesa[1] != "") {
+ stateList = [selectValuesa[1]];
+ }
+ }
+ console.log(timeRange.value[0], timeRange.value[1]);
+ const response = await request.post("/cacheGlass/edgGlassTaskInfo/setEdgGlassInfoRequest", {
+ cellList: celllist,
+ stateList: stateList,
+ beginDate: timeRange.value[0],
+ endDate: timeRange.value[1],
+ })
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ ElMessage.error(response.message);
+ }
+
+}
+
+// 鐮存崯
+const open = async (row) => {
+ try {
+ const confirmResult = await ElMessageBox.confirm(
+ t('workOrder.messagedamaged'),
+ t('workOrder.prompt'),
+ {
+ confirmButtonText: t('workOrder.yes'),
+ cancelButtonText: t('workOrder.cancel'),
+ type: 'warning',
+ }
+ );
+ if (confirmResult === 'confirm') {
+ // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛
+ const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", {
+ glassId: row.glassId,
+ state: 8,
+ line: row.line,
+ workingProcedure: '纾ㄨ竟',
+ })
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛
+ ElMessage.error(response.msg);
+ // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message);
+ }
+ }
+ } catch (error) {
+ // 澶勭悊鍙兘鍑虹幇鐨勯敊璇紝姣斿 ElMessageBox 鎶涘嚭鐨勫紓甯哥瓑
+ console.error('鍙戠敓閿欒:', error);
+ }
+};
+// 鎷胯蛋
+const opena = async (row) => {
+ try {
+ const confirmResult = await ElMessageBox.confirm(
+ t('workOrder.takemessage'),
+ t('workOrder.prompt'),
+ {
+ confirmButtonText: t('workOrder.yes'),
+ cancelButtonText: t('workOrder.cancel'),
+ type: 'warning',
+ }
+ );
+ if (confirmResult === 'confirm') {
+ // 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛
+ const response = await request.post("/cacheGlass/edgStorageCage/edgReportStatus", {
+ glassId: row.glassId,
+ state: 9,
+ line: row.line,
+ workingProcedure: '纾ㄨ竟',
+ })
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ } else {
+ // 鍒犻櫎澶辫触锛屾偍鍙互澶勭悊閿欒鎴栨樉绀洪敊璇俊鎭粰鐢ㄦ埛
+ ElMessage.error(response.msg);
+ // alert('鍒犻櫎澶辫触锛�' + deleteResponse.message);
+ }
+ }
+ } catch (error) {
+ // 澶勭悊鍙兘鍑虹幇鐨勯敊璇紝姣斿 ElMessageBox 鎶涘嚭鐨勫紓甯哥瓑
+ console.error('鍙戠敓閿欒:', error);
+ }
+};
+let socket = null;
+const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/edgTasks`;
+// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
+const handleMessage = (data) => {
+ // 鏇存柊 tableData 鐨勬暟鎹�
+ tableData.value = data.edgTasks[0]
+};
+onMounted(() => {
+ socket = initializeWebSocket(socketUrl, handleMessage);
+});
+onUnmounted(() => {
+ if (socket) {
+ closeWebSocket(socket);
+ }
+});
+onBeforeUnmount(() => {
+ console.log("鍏抽棴浜�")
+ closeWebSocket();
+});
+</script>
+<template>
+ <div style="height: 500px;">
+ <div>
+ <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading">
+ <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('workOrder.cway')" clearable
+ style="margin-left: 20px;margin-bottom: 10px;">
+ <el-option :label="$t('workOrder.edgingone')" value="2001"></el-option>
+ <el-option :label="$t('workOrder.edgingtwo')" value="2002"></el-option>
+ </el-select>
+
+ <el-select v-model="selectValuesa[1]" filterable :placeholder="$t('workOrder.cstate')" clearable
+ style="margin-left: 20px;margin-bottom: 10px;">
+ <el-option :label="$t('workOrder.nedging')" value="0"></el-option>
+ <el-option :label="$t('workOrder.edging')" value="1"></el-option>
+ <el-option :label="$t('workOrder.finedging')" value="2"></el-option>
+ </el-select>
+ <span class="demonstration" style="margin-left: 20px;margin-bottom: 10px;">{{ $t('workOrder.time') }}</span>
+ <el-date-picker v-model="timeRange" type="datetimerange" range-separator="鑷�"
+ :start-placeholder="$t('reportmanage.starttime')" style="margin-left: 20px;margin-bottom: 10px;"
+ value-format="YYYY-MM-DD hh:mm:ss"
+
+ :end-placeholder="$t('reportmanage.endtime')">
+ </el-date-picker>
+ <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px;" @click="setEdgGlassInfoRequest()">{{
+ $t('reportmanage.inquire')
+ }}
+ </el-button>
+
+ <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
+ <el-table height="750" ref="table"
+ @selection-change="handleSelectionChange"
+ :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
+ <el-table-column prop="glassId" align="center" :label="$t('workOrder.glassID')" min-width="180"/>
+ <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120"/>
+ <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80"/>
+ <el-table-column prop="thickness" align="center" :label="$t('workOrder.thickness')" min-width="120"/>
+ <el-table-column prop="glassType" align="center" :label="$t('workOrder.glasstype')" min-width="120"/>
+ <el-table-column prop="line" align="center" :label="$t('workOrder.line')" min-width="120"/>
+ <el-table-column prop="status" :label="$t('workOrder.status')" align="center" width="200">
+ <template #default="scope">
+ {{ scope.row.status == 0 ? "鏈(杈�" : scope.row.status == 1 ? "纾ㄨ竟涓�" : "宸茬(杈�" }}
+ </template>
+ </el-table-column>
+
+
+ <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200">
+ <template #default="scope">
+ <el-button size="mini" type="text" plain @click="open(scope.row)">{{
+ $t('workOrder.breakage')
+ }}
+ </el-button>
+ <el-button size="mini" type="text" plain @click="opena(scope.row)">{{
+ $t('workOrder.takeout')
+ }}
+ </el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </el-card>
+ </div>
+ </div>
+</template>
+
+<style scoped>
+#dt {
+ display: block;
+ float: left;
+ line-height: 20px;
+ margin-left: 100px;
+}
+
+#dta {
+ display: block;
+ float: left;
+ line-height: 20px;
+ margin-left: 80%;
+}
+
+#dialog-footer {
+ text-align: center;
+ margin-top: -15px;
+}
+
+#message {
+ text-align: center;
+ align-items: center;
+ color: black;
+ width: 200px;
+ height: 100px;
+ background-color: #337ecc;
+ margin-left: 28%;
+}
+
+#awatch {
+ height: 460px;
+ /* margin-top: -60px; */
+}
+</style>
\ No newline at end of file
--
Gitblit v1.8.0