From da43aa38dedc711d20093a0ee467a9674594644b Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期三, 24 七月 2024 13:56:22 +0800
Subject: [PATCH] 上片机位置信息更换,显示玻璃根据宽、高、数量判断,上方表格增加序号,数量固定为1。钢化模块新增状态5,新增破损功能
---
UI-Project/src/layout/MainErpView.vue | 4
UI-Project/src/views/Returns/returns.vue | 91 ++++++++++--------
UI-Project/src/views/Identify/identify.vue | 3
UI-Project/src/views/PurchaseReturn/purchaseStorage.vue | 59 +++++++++++
UI-Project/src/lang/zh.js | 1
UI-Project/src/views/PurchaseReturn/purchaseReturn.vue | 89 +++++++++++++++--
6 files changed, 190 insertions(+), 57 deletions(-)
diff --git a/UI-Project/src/lang/zh.js b/UI-Project/src/lang/zh.js
index 0117165..21ceabd 100644
--- a/UI-Project/src/lang/zh.js
+++ b/UI-Project/src/lang/zh.js
@@ -83,6 +83,7 @@
updatanull:'璇ュ伐绋嬫湭淇濆瓨鍒颁笂鐗囪〃锛�',
glassnull:'鏇存柊鐜荤拑鐘舵�佹椂鍙戠敓閿欒',
deletemessage:'鏄惁鍒犻櫎璇ユ潯淇℃伅?',
+ layoutSequence:'搴忓彿',
},
sorter:{
gridnumber:'鏍呮牸鍙�',
diff --git a/UI-Project/src/layout/MainErpView.vue b/UI-Project/src/layout/MainErpView.vue
index 098140d..8680e02 100644
--- a/UI-Project/src/layout/MainErpView.vue
+++ b/UI-Project/src/layout/MainErpView.vue
@@ -169,6 +169,10 @@
alt=""
style="max-width: 100%;max-height: 100%">
<h3 style="margin: 1rem ;font-weight: bold;width: 33vw;"> {{ $t('main.titleFirst') }}{{ user }}{{ $t('main.titleLast') }}</h3>
+ <!-- <div class="header-left">
+ <el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse"
+ style="height:30px;"></el-button>
+ </div> -->
<span style="height: 70%;width: 78vw;margin-top: 1rem;">
<!-- <el-button class="sys-quit"
@click="quit"
diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue
index a972dbe..74f05a1 100644
--- a/UI-Project/src/views/Identify/identify.vue
+++ b/UI-Project/src/views/Identify/identify.vue
@@ -111,7 +111,6 @@
// controlsId: 201,
// })
if (response.code == 200) {
- // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
ElMessage.success(response.message);
// window.location.reload()
blind.value = false;
@@ -126,7 +125,7 @@
console.error(error);
}
}
-// // 浜哄伐鎷胯蛋
+ // 浜哄伐鎷胯蛋
const handleManualTake = async () => {
try {
var url="/cacheGlass/taskCache/identControls?identId="+currentGlassId.value+'&controlsId='+200;
diff --git a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
index 42ec676..ee5825e 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -5,6 +5,7 @@
import request from "@/utils/request"
import { ref, onMounted, onBeforeUnmount } from 'vue';
import { WebSocketHost ,host} from '@/utils/constants'
+import { ElMessage, ElMessageBox } from 'element-plus'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
@@ -19,6 +20,8 @@
const adjustedRects2 = ref([]);
const adjustedRectsa = ref([]);
const adjustedRectsb = ref([]);
+const currentGlassId = ref(null);
+const currenttemperingFeedSequence = ref(null);
const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingGlass`;
const handleMessage = (data) => {
// 杩涚倝涓�
@@ -140,19 +143,64 @@
onMounted(() => {
initializeWebSocket(socketUrl, handleMessage);
});
-function getRectColor(state) {
+function updateRectColors() {
+ adjustedRectsa.value.forEach(rect => {
+ if (rect.glassId === glassId) {
+ rect.state = 5;
+ }
+ });
+}
+function getRectColora(state) {
switch (state) {
case 0:
- return '#f8e3c5';
+ return '#d1edc4';
case 1:
- return '#d1edc4';
+ return '#E6E6FA';
case -1:
return '#dedfe0';
+ case 5:
+ return '#911005';
+ }
+}
+function getRectColorb(state) {
+ switch (state) {
+ case 3:
+ return '#f8e3c5';
+ case 4:
+ return '#F0F8FF';
+ case 5:
+ return '#911005';
}
-}
-function showDialog(row) {
+}
+function showDialog(rect) {
+ currentGlassId.value = rect.glassId;
+ currenttemperingFeedSequence.value = rect.temperingFeedSequence;
blind.value = true;
}
+// 鐮存崯
+const handleDamage = async () => {
+ try {
+ const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
+ glassId: currentGlassId.value,
+ // temperingFeedSequence: currenttemperingFeedSequence.value,
+ line: 4001,
+ status: 2,
+ workingProcedure: '閽㈠寲',
+ })
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ blind.value = false;
+ updateRectColors();
+ } else {
+ // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
+ ElMessage.error(response.message);
+ }
+}
+catch (error) {
+ // 澶勭悊閿欒
+ console.error(error);
+ }
+}
onBeforeUnmount(() => {
console.log("鍏抽棴浜�")
closeWebSocket();
@@ -173,8 +221,14 @@
<div
v-for="(rect, index) in adjustedRects"
:key="index"
+ @click="showDialog(rect)"
class="rect"
- :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }"
+ :style="{ position: 'absolute',
+ top: `${rect.ycoordinate}px`,
+ left: `${rect.xcoordinate}px`,
+ width: `${rect.width}px`,
+ height: `${rect.height}px`,
+ backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }"
>
<div class="centered-text">
<div >{{ rect.glassId }}</div>
@@ -194,9 +248,15 @@
<div
v-for="(rect, index) in adjustedRects2"
:key="index"
+ @click="showDialog(rect)"
class="rect"
- :style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px` }"
- >
+ :style="{ position: 'absolute',
+ top: `${rect.ycoordinate}px`,
+ left: `${rect.xcoordinate}px`,
+ width: `${rect.width}px`,
+ height: `${rect.height}px`,
+ backgroundColor: rect.state === 5 ? '#911005' : 'lightblue' }"
+ >
<div class="centered-text">
<div >{{ rect.glassId }}</div>
<div >{{ rect.flowCardId }}</div>
@@ -214,17 +274,16 @@
<el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 600px;" v-loading="loading">
<div v-if="adjustedRectsa.length > 0">
<div style="text-align: center;">鐐夊彿锛歿{ adjustedRects[0].engineerId }}-{{ adjustedRects[0].temperingLayoutId }}</div>
- <!-- <div style="text-align: center;">娴佺▼鍗�: {{ adjustedRectsa[0].flowCardId }}</div> -->
<el-scrollbar height="550px" style="background-color: #e9e9eb;">
<div style="position: relative;max-width: 1400px;">
<div
v-for="(rect, index) in adjustedRectsa"
:key="index"
- @click="showDialog"
+ @click="showDialog(rect)"
class="rect"
:style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`,
width: `${rect.width}px`, height: `${rect.height}px`,
- backgroundColor: getRectColor(rect.state) }">
+ backgroundColor: getRectColora(rect.state) }">
<div class="centered-text">
<div>{{ rect.glassId }}</div>
<div >{{ rect.flowCardId }}</div>
@@ -246,10 +305,12 @@
<div
v-for="(rect, index) in adjustedRectsb"
:key="index"
+ @click="showDialog(rect)"
class="rect"
:style="{ position: 'absolute', top: `${rect.y}px`, left: `${rect.x}px`,
width: `${rect.width}px`, height: `${rect.height}px`,
- backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }">
+ backgroundColor: getRectColorb(rect.state) }">
+ <!-- backgroundColor: rect.state === 4 ? '#911005' : '#f8e3c5' }"> -->
<div class="centered-text">
<div >{{ rect.glassId }}</div>
<div >{{ rect.flowCardId }}</div>
@@ -263,7 +324,7 @@
</div>
<el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;">
- <el-button type="warning" plain :icon="Delete" @click="handleDamage(currentGlassId)" style="width: 140px;margin-left: 10px;">
+ <el-button type="warning" plain :icon="Delete" @click="handleDamage" style="width: 140px;margin-left: 10px;">
{{ $t('order.dilapidation') }}
</el-button>
</el-dialog>
@@ -348,6 +409,6 @@
justify-content: center;
align-items: center;
height: 100%; /* 纭繚div鍗犳嵁鏁翠釜鐭╁舰鐨勯珮搴� */
- font-size: small;
+ /* font-size: small; */
}
</style>
\ No newline at end of file
diff --git a/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue b/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
index 4e372e6..742ba24 100644
--- a/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
+++ b/UI-Project/src/views/PurchaseReturn/purchaseStorage.vue
@@ -2,14 +2,19 @@
import {Search} from "@element-plus/icons-vue";
import {reactive} from "vue";
import {useRouter} from "vue-router"
+import { ElMessage, ElMessageBox } from 'element-plus'
+import request from "@/utils/request"
import { ref, onMounted, onBeforeUnmount } from 'vue';
import { WebSocketHost ,host} from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
const adjustedRects = ref([]);
+const currentGlassId = ref(null);
+const currenttemperingFeedSequence = ref(null);
const dialogFormVisible = ref(true)
const dialogFormVisiblea = ref(false)
+const blind = ref(false)
const getTableRow = (row,type) =>{
switch (type) {
@@ -58,6 +63,52 @@
});
}
};
+function updateRectColors() {
+ adjustedRectsa.value.forEach(rect => {
+ if (rect.glassId === glassId) {
+ rect.state = 5;
+ }
+ });
+}
+function getRectColora(state) {
+ switch (state) {
+ case 3:
+ return '#f8e3c5';
+ case 4:
+ return '#F0F8FF';
+ case 5:
+ return '#911005';
+ }
+}
+function showDialog(rect) {
+ currentGlassId.value = rect.glassId;
+ currenttemperingFeedSequence.value = rect.temperingFeedSequence;
+ blind.value = true;
+}
+// 鐮存崯
+const handleDamage = async () => {
+ try {
+ const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', {
+ glassId: currentGlassId.value,
+ // temperingFeedSequence: currenttemperingFeedSequence.value,
+ line: 4001,
+ status: 2,
+ workingProcedure: '閽㈠寲',
+ })
+ if (response.code == 200) {
+ ElMessage.success(response.message);
+ blind.value = false;
+ updateRectColors();
+ } else {
+ // 璇锋眰澶辫触锛屾樉绀洪敊璇秷鎭�
+ ElMessage.error(response.message);
+ }
+}
+catch (error) {
+ // 澶勭悊閿欒
+ console.error(error);
+ }
+}
onMounted(() => {
// fetchFlowCardId();
// fetchTableData(); // 鑾峰彇鏁版嵁
@@ -82,10 +133,11 @@
<div
v-for="(rect, index) in adjustedRects"
:key="index"
+ @click="showDialog(rect)"
class="rect"
:style="{ position: 'absolute', top: `${rect.ycoordinate}px`, left: `${rect.xcoordinate}px`,
width: `${rect.width}px`, height: `${rect.height}px`,
- backgroundColor: rect.state === 4 ? '#d1edc4' : '#f8e3c5' }">
+ backgroundColor: getRectColora(rect.state) }">
<div class="centered-text">
<div >{{ rect.glassId }}</div>
<div >{{ rect.flowCardId }}</div>
@@ -98,6 +150,11 @@
</div>
</el-card>
</div>
+ <el-dialog v-model="blind" top="30vh" width="15%" style="text-align: center;">
+ <el-button type="warning" plain :icon="Delete" @click="handleDamage" style="width: 140px;margin-left: 10px;">
+ {{ $t('order.dilapidation') }}
+ </el-button>
+ </el-dialog>
</div>
</template>
diff --git a/UI-Project/src/views/Returns/returns.vue b/UI-Project/src/views/Returns/returns.vue
index 55a5f37..3dc5d78 100644
--- a/UI-Project/src/views/Returns/returns.vue
+++ b/UI-Project/src/views/Returns/returns.vue
@@ -17,6 +17,15 @@
const flakea = ref(false)
const flakeb = ref(false)
const flakec = ref(false)
+const user = ref('');
+const projectNo = ref('');
+const workstationId = ref('');
+const id = ref('');
+const patternHeight = ref('');
+const patternWidth = ref('');
+const filmsId = ref('');
+const patternThickness = ref('');
+const number = ref('');
import { WebSocketHost ,host} from '@/utils/constants'
import request from "@/utils/request"
const ida = ref(null);
@@ -93,16 +102,16 @@
if (response.code == 200) {
tableDataa.value = response.data
if (tableDataa.value.length === 4) {
- if (tableDataa.value[0].patternHeight > 0) {
+ if (tableDataa.value[0].patternHeight > 0 && tableDataa.value[0].patternWidth > 0 && tableDataa.value[0].number > 0) {
flake.value = true;
}
- if (tableDataa.value[1].patternHeight > 0) {
+ if (tableDataa.value[1].patternHeight > 0 && tableDataa.value[1].patternWidth > 0 && tableDataa.value[1].number > 0) {
flakea.value = true;
}
- if (tableDataa.value[2].patternHeight > 0) {
+ if (tableDataa.value[2].patternHeight > 0 && tableDataa.value[2].patternWidth > 0 && tableDataa.value[2].number > 0) {
flakeb.value = true;
}
- if (tableDataa.value[3].patternHeight > 0) {
+ if (tableDataa.value[3].patternHeight > 0 && tableDataa.value[3].patternWidth > 0 && tableDataa.value[3].number > 0) {
flakec.value = true;
}
}
@@ -196,15 +205,6 @@
onBeforeUnmount(() => {
closeWebSocket();
});
-const user = ref('');
-const projectNo = ref('');
-const workstationId = ref('');
-const id = ref('');
-const patternHeight = ref('');
-const patternWidth = ref('');
-const filmsId = ref('');
-const patternThickness = ref('');
-const number = ref('');
// 娣诲姞
const handleBindRack = (row) => {
workstationId.value = row.workstationId; // 鍋囪rackNumber鏄灦鍙峰瓧娈电殑灞炴�у悕
@@ -225,25 +225,38 @@
patternThickness: selectedValuec.value,
number: number.value
});
- window.localStorage.setItem('workstationId', workstationId.value)
- window.localStorage.setItem('patternHeight', selectedValuea.value)
+ // window.localStorage.setItem('workstationId', workstationId.value)
+ // window.localStorage.setItem('patternHeight', selectedValuea.value)
+ // window.localStorage.setItem('patternWidth', selectedValue.value)
+ // window.localStorage.setItem('number', number.value)
if (response.code == 200) {
// 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
ElMessage.success(response.message);
// window.location.reload()
add.value = false;
tableDataa.value = response.data;
- let workstationId = window.localStorage.getItem('workstationId')
- let patternHeight = window.localStorage.getItem('patternHeight')
- if (patternHeight !== '' && workstationId === '1') {
+ // let workstationId = window.localStorage.getItem('workstationId')
+ // let patternHeight = window.localStorage.getItem('patternHeight')
+ // let patternWidth = window.localStorage.getItem('patternWidth')
+ // let number = window.localStorage.getItem('number')
+ if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') {
flake.value = true
- } else if (patternHeight !== '' && workstationId === '2'){
+ } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){
flakea.value = true
- }else if (patternHeight !== '' && workstationId === '3'){
+ }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '3'){
flakeb.value = true
- }else if (patternHeight !== '' && workstationId === '4'){
+ }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '4'){
flakec.value = true
}
+ // if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '1') {
+ // flake.value = true
+ // } else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '2'){
+ // flakea.value = true
+ // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '3'){
+ // flakeb.value = true
+ // }else if (patternHeight !== '0' && patternWidth !== '0' && number !== '0' && workstationId === '4'){
+ // flakec.value = true
+ // }
selectedValuea.value = '';
selectedValue.value = '';
selectedValueb.value = '';
@@ -256,8 +269,6 @@
}
} catch (error) {
// 澶勭悊璇锋眰閿欒
- console.error(error);
- alert('璇锋眰澶辫触锛岃绋嶅悗鍐嶈瘯锛�');
}
}
else if( ida.value === 1 || ida.value === 3){
@@ -271,23 +282,19 @@
patternThickness: selectedValuec.value,
number: number.value
});
- window.localStorage.setItem('workstationId', workstationId.value)
- window.localStorage.setItem('patternHeight', selectedValuea.value)
if (response.code == 200) {
// 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
ElMessage.success(response.message);
// window.location.reload()
add.value = false;
tableDataa.value = response.data;
- let workstationId = window.localStorage.getItem('workstationId')
- let patternHeight = window.localStorage.getItem('patternHeight')
- if (patternHeight !== '' && workstationId === '1') {
+ if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '1') {
flake.value = true
- } else if (patternHeight !== '' && workstationId === '2'){
+ } else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '2'){
flakea.value = true
- }else if (patternHeight !== '' && workstationId === '3'){
+ }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '3'){
flakeb.value = true
- }else if (patternHeight !== '' && workstationId === '4'){
+ }else if (selectedValuea.value !== '0' && selectedValue.value !== '0' && number.value !== '0' && workstationId.value === '4'){
flakec.value = true
}
selectedValuea.value = '';
@@ -302,8 +309,6 @@
}
} catch (error) {
// 澶勭悊璇锋眰閿欒
- console.error(error);
- alert('璇锋眰澶辫触锛岃绋嶅悗鍐嶈瘯锛�');
}
}
else {
@@ -660,12 +665,18 @@
:header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
:data="tableData"
>
- <el-table-column prop="engineeringId" :label="$t('basicData.projectnumber')" width="200" align="center"/>
+ <el-table-column prop="layoutSequence" :label="$t('basicData.layoutSequence')" width="100" align="center"/>
+ <el-table-column prop="engineeringId" :label="$t('basicData.projectnumber')" width="200" align="center"/>
<el-table-column prop="width" :label="$t('basicData.glasswidth')" align="center"/>
<el-table-column prop="height" :label="$t('basicData.glassheight')" align="center"/>
<el-table-column prop="filmsId" :label="$t('basicData.coatingtypes')" align="center"/>
- <el-table-column prop="layoutSequence" :label="$t('basicData.quantity')" align="center"/>
- <el-table-column prop="thickness" :label="$t('basicData.thickness')" align="center"/>
+ <el-table-column :label="$t('basicData.quantity')" align="center">
+ <template #default="{ row }">
+ <!-- 杩欓噷鎬绘槸鏄剧ず 1 -->
+ <span>{{ 1 }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="thickness" :label="$t('basicData.quantity')" align="center"/>
<!-- <el-table-column
align="center"
label="鐘舵��"
@@ -928,7 +939,7 @@
width: 1500px;
margin-left: -300px
}
-#overlay{
+#overlayb{
position: absolute;
z-index: 1;
width: 228px;
@@ -937,7 +948,7 @@
margin-top: -303px;
margin-left: 355px;
}
-#overlaya{
+#overlayc{
position: absolute;
z-index: 1;
width: 228px;
@@ -946,7 +957,7 @@
margin-top: -303px;
margin-left:703px;
}
-#overlayb{
+#overlay{
position: absolute;
z-index: 1;
width: 228px;
@@ -955,7 +966,7 @@
margin-top: -45px;
margin-left: 355px;
}
-#overlayc{
+#overlaya{
position: absolute;
z-index: 1;
width: 228px;
--
Gitblit v1.8.0