From f2fe072a1656bece33174c6a4b51dacc6f33abc7 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 23 九月 2025 15:31:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
UI-Project/src/views/Identify/identify.vue | 144 ++++++++++++++++++++++++++++++++++++++----------
1 files changed, 114 insertions(+), 30 deletions(-)
diff --git a/UI-Project/src/views/Identify/identify.vue b/UI-Project/src/views/Identify/identify.vue
index 461d622..390d7b7 100644
--- a/UI-Project/src/views/Identify/identify.vue
+++ b/UI-Project/src/views/Identify/identify.vue
@@ -1,9 +1,9 @@
<template>
<div style="height: 500px;">
<div style="display: flex;">
- <el-input v-model="engineerId" style="margin-left: 15px;margin-top: 10px;width: 240px" :placeholder="$t('order.projectnumber')" @blur="handleBlur"/>
+ <el-input v-model="engineerId" style="margin-left: 15px;margin-top: 10px;width: 240px" :placeholder="$t('order.projectnumber')"/>
<el-button type="primary" style="margin-left: 10px;margin-top: 10px;" @click="sethistorical()">{{$t('reportmanage.inquire')}}</el-button>
- <el-pagination
+ <el-pagination
v-model:current-page="currentPage"
:page-size="pageSize"
:size="size"
@@ -13,8 +13,31 @@
@current-change="handleCurrentChange"
style="margin-top: 10px;"
/>
+ <el-select
+ v-model="allDamagePatternSequence"
+ :placeholder="$t('workOrder.cway')"
+ clearable
+ style="width: 140px; margin-left: 35%; margin-top: 10px;"
+ >
+ <el-option
+ v-for="item in optionsb"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
+ </el-select>
+ <!-- 淇敼涓�閿牬鎹熸寜閽紝娣诲姞绂佺敤鐘舵�� -->
+ <el-button
+ type="warning"
+ style="margin-left: 10px; margin-top: 10px;"
+ @click="handleAllDamage"
+ :disabled="!allDamagePatternSequence"
+ >
+ {{$t('order.dilapidation')}}
+ </el-button>
</div>
- <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;" v-loading="loading">
+ <el-card style="flex: 1;margin-left: 10px;margin-top: 10px;margin-right: 10px;height: 800px;">
+ <!-- <el-button @click="handleAllDamage" style="margin-left: 90%;margin-top: -20px;margin-bottom: 5px;">{{$t('order.dilapidation')}}</el-button> -->
<el-scrollbar height="750px" width="1400px" style="background-color: #e9e9eb;">
<div style="position: relative;">
<div
@@ -64,7 +87,7 @@
</div>
</template>
<script setup lang="ts">
-import {ElMessage} from 'element-plus'
+import {avatarEmits, ElMessage, ElMessageBox } from 'element-plus'
import {computed, onMounted, onUnmounted, ref} from 'vue';
import request from "@/utils/request"
import {host, WebSocketHost} from '@/utils/constants'
@@ -82,6 +105,9 @@
const totalPages = ref(0);
const pageSize = ref(1);
const currentPage = ref('');
+const realwidth = ref('');
+const realheight = ref('');
+const allDamagePatternSequence = ref();
const disabled = false;
const size = 'small';
const rawData = ref([]);
@@ -102,6 +128,52 @@
isActive: false
}));
}
+// 涓�閿牬鎹熸墍鏈夌幓鐠�
+const handleAllDamage = async () => {
+ if (!allDamagePatternSequence.value) {
+ ElMessage.warning(t('workOrder.cway')); // 鎻愮ず闇�瑕侀�夋嫨绾胯矾
+ return;
+ }
+ try {
+ const confirmResult = await ElMessageBox.confirm(
+ t('order.dilapidationWhether'),
+ t('workOrder.prompt'),
+ {
+ confirmButtonText: t('workOrder.yes'),
+ cancelButtonText: t('workOrder.cancel'),
+ type: 'warning',
+ }
+ );
+ // 绛涢�夊嚭state涓嶆槸8鍜�9鐨勭幓鐠僆D
+ const glassIdList = adjustedRects.value
+ .filter(rect => rect.state !== 8 && rect.state !== 9)
+ .map(rect => rect.glassId);
+ if (glassIdList.length === 0) {
+ ElMessage.warning(t('order.noGlassToDamage')); // 娌℃湁鍙牬鎹熺殑鐜荤拑
+ return;
+ }
+ const response = await request.post('/cacheGlass/taskCache/identControlsByPatternSequence', {
+ glassIdList: glassIdList,
+ state: 8,
+ line: allDamagePatternSequence.value,
+ workingProcedure: '鍒囧壊',
+ remark: '鎺扮墖'
+ });
+ if (response.code === 200) {
+ ElMessage.success(response.message);
+ // 鏇存柊鎵�鏈夌幓鐠冪姸鎬�
+ glassIdList.forEach(glassId => {
+ updateRectStatus(glassId, 8);
+ });
+ allDamagePatternSequence.value = '';
+ } else {
+ ElMessage.error(response.msg);
+ }
+ } catch (error) {
+ console.error(error);
+ ElMessage.error(t(''));
+ }
+};
// 鐮存崯
const handleDamage = async () => {
try {
@@ -153,20 +225,23 @@
var url="/cacheGlass/taskCache/queryCutDrawingByEngineerId?engineerId="+engineerId.value+ "&patternSequence=" + 1;
const response = await request.post(url)
if (response.code === 200) {
-
const rawRects = response.data.currentCutDrawing;
rawData.value = response.data;
totalPages.value = response.data.totalPatternSequence;
- const scaleFactor = 1621.78/6000;
- const scaleFactory = 750/3300;
+ realwidth.value = response.data.upPattenUsage.width;
+ realheight.value = response.data.upPattenUsage.height;
+ const realx = realwidth.value;
+ const realy = realheight.value;
+ const scaleFactor = 1621.78/realx;
+ const scaleFactory = 750/realy;
adjustedRects.value = rawRects.map(rect => ({
...rect,
- xaxisa: (6000 -(rect.xaxis + rect.edgWidth)) * scaleFactor * 1.1,
- yaxisa: rect.yaxis * scaleFactory * 1.1,
- width: rect.edgWidth * scaleFactor * 1.1,
- widtha: rect.edgWidth ,
+ xaxisa: rect.xaxis * scaleFactor,
+ yaxisa: (realy - (rect.yaxis + rect.edgHeight )) * scaleFactory,
+ width: rect.edgWidth * scaleFactor,
+ widtha: rect.edgWidth,
heighta: rect.edgHeight ,
- height: rect.edgHeight * scaleFactory * 1.1,
+ height: rect.edgHeight * scaleFactory,
state: rect.state
}));
currentPage.value = 1;
@@ -178,36 +253,45 @@
const response = await request.post(url)
if (response.code === 200) {
const rawRects = response.data.currentCutDrawing;
- console.log(response.data);
rawData.value = response.data;
- const scaleFactor = 1621.78/6000;
- const scaleFactory = 750/3300;
+ realwidth.value = response.data.upPattenUsage.width;
+ realheight.value = response.data.upPattenUsage.height;
+ const realx = realwidth.value;
+ const realy = realheight.value;
+ const scaleFactor = 1621.78/realx;
+ const scaleFactory = 750/realy;
adjustedRects.value = rawRects.map(rect => ({
...rect,
- xaxisa: (6000 -(rect.xaxis + rect.edgWidth)) * scaleFactor * 1.1,
- yaxisa: rect.yaxis * scaleFactory * 1.1,
- width: rect.edgWidth * scaleFactor * 1.1,
- widtha: rect.edgWidth ,
- heighta: rect.edgHeight ,
- height: rect.edgHeight * scaleFactory * 1.1,
+ xaxisa: rect.xaxis * scaleFactor,
+ yaxisa: (realy - (rect.yaxis + rect.edgHeight )) * scaleFactory,
+ width: rect.edgWidth * scaleFactor,
+ widtha: rect.edgWidth,
+ heighta: rect.edgHeight,
+ height: rect.edgHeight * scaleFactory,
state: rect.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 0:
+ return '#7AC5CD';
+ case 1:
+ return '#95d475';
+ case -1:
+ return '#99BBFF';
+ case 2:
+ return 'lightblue';
+ case 3:
+ return '#eebe77';
+ case 4:
+ return '#CD6090';
case 8:
return '#911005';
case 9:
- return '#f3d19e';
+ return '#4682B4';
+ default:
+ return '#CDAF95';
}
}
const optionsb = [
--
Gitblit v1.8.0