From 32bc1fb9a3692c460d21f8094ca80f1e0e0eb6a6 Mon Sep 17 00:00:00 2001
From: wangfei <3597712270@qq.com>
Date: 星期四, 17 十月 2024 09:26:04 +0800
Subject: [PATCH] 被覆盖代码找回
---
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue | 193 +++++++++++++++++++++++++-----------------------
1 files changed, 100 insertions(+), 93 deletions(-)
diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
index 5a918af..618e73c 100644
--- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
+++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -10,7 +10,7 @@
import Landingindication from "./Landingindication.vue";
import Landingindicationtwo from "./Landingindicationtwo.vue";
import PrintLabel from "@/views/UnLoadGlass/PrintCustomLabelSemi1.vue";
-
+
const router = useRouter()
const { t } = useI18n()
let language = ref(localStorage.getItem('lang') || 'zh')
@@ -19,8 +19,8 @@
const autoPrint = ref(false)
const takeGlass = ref([])
const scanGlass = ref([])
-
-
+
+
const dialogFormVisiblea = ref(false)
const dialogFormVisiblea2 = ref(false)
const dialogFormVisibleaDownGlass = ref(false)
@@ -37,24 +37,25 @@
const flowCardOptions = ref('[]');
const tableData = reactive([]);
const downGlass = ref([]);
-
+
const selectValuesa = reactive({});
const selectOptionsa = ref([]);
const dialogTableVisible = ref(false)
const dialogTableVisible1 = ref(false)
const printFlowCardId = ref('')
const printLayer = ref('')
+const printGlassId = ref('')
const now = new Date();
const timeRange = ref([])
const browser = ref(false)
-
+
const handleChange = async () => {
console.log("瑙﹀彂寮�鍏�")
try {
const body = {
flag: autoPrint.value, // 浣跨敤 ganghua.value 鑾峰彇褰撳墠寮�鍏崇殑鐘舵��
};
-
+
var url = "/unLoadGlass/downWorkStation/autoPrint?flag=" + autoPrint.value;
const response = await request.post(url)
if (response.code == 200) {
@@ -78,7 +79,7 @@
browser.value = false
}
}
-
+
const handleInputChangea = (value, rowId) => {
// 鏇存柊瀵瑰簲琛岀殑 select 鍊�
selectValuesa[rowId] = value;
@@ -100,7 +101,7 @@
const response = await request.get('unLoadGlass/downWorkStation/getflowCardId');
console.log(response)
if (response.code === 200) {
-
+
flowCardOptions.value = response.data.filter(item => item !== null)
.map(item => ({ flowcard_id: item.flow_card_id }));
console.log(flowCardOptions.value);
@@ -125,7 +126,7 @@
if (response.code == 200) {
// 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
console.log('缁戝畾鎴愬姛');
-
+
ElMessage.success(response.message);
updatePageData();
dialogFormVisiblea.value = false;
@@ -155,8 +156,8 @@
const response = await request.post('unLoadGlass/downWorkStation/clear', {
workstationId: workstationId.value,
});
-
-
+
+
if (response.code === 200) {
// 娓呴櫎鎴愬姛鐨勯�昏緫
console.log('娓呴櫎鎴愬姛');
@@ -183,7 +184,7 @@
try {
// 鍙戦�佽幏鍙栬〃鏍兼暟鎹殑璇锋眰锛屽苟绛夊緟鍝嶅簲
const response = await request.get('unLoadGlass/downWorkStation/getone');
-
+
// 妫�鏌ュ搷搴旂姸鎬�
if (response.code === 200) {
// 鏇存柊琛ㄦ牸鏁版嵁
@@ -202,7 +203,7 @@
const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
-
+
// 鏇存柊 tableData 鐨勬暟鎹�
if (data.downGlassInfos != null) {
downGlass.value = data.downGlassInfos[0];
@@ -223,8 +224,8 @@
takeGlass.value.width = height;
takeGlass.value.height = width;
}
-
-
+
+
}
if (data.scanGlass != null) {
scanGlass.value = data.scanGlass[0];
@@ -234,8 +235,11 @@
scanGlass.value.width = height;
scanGlass.value.height = width;
}
+ if(autoPrint.value == true && browser.value == true){
+ open1(scanGlass);
+ }
}
-
+
//鑷姩鎵撳嵃
if (fullFlowCard.value == "" && autoPrint.value == true && browser.value == true) {
for (let i = 0; i < tableData.length; i++) {
@@ -254,7 +258,7 @@
if (data.params != null) {
tableData.splice(0, tableData.length, ...data.params[0]);
}
-
+
// console.log("鏇存柊鍚庢暟鎹�", data.params[0]);
};
// 鍒濆鍖� WebSocket锛屽苟浼犻�掓秷鎭鐞嗗嚱鏁�
@@ -273,30 +277,30 @@
console.log("鍏抽棴浜�")
closeWebSocket();
});
-
-
+
+
const getTagType = (status) => {
return status === 1 ? 'success' : 'danger';
// 鏍规嵁鐘舵�佸�煎喅瀹氭爣绛剧被鍨嬶紝杩欓噷鍋囪鐘舵�佷负1鏃朵负鎴愬姛锛堢豢鑹诧級锛屽惁鍒欎负澶辫触锛堢孩鑹诧級
}
-
+
const toggleStatus = (row) => {
// 鍒囨崲鏂欐灦鐘舵�佺殑閫昏緫
row.enableState = 1 - row.enableState; // Toggle between 0 and 1
// 姝ゅ鍙互娣诲姞淇濆瓨鐘舵�佺殑閫昏緫锛屾瘮濡傝皟鐢� API 鏇存柊鏁版嵁
updateRowStatus(row);
};
-
+
const updateRowStatus = async (row) => {
try {
// 鍋囪浣犵殑鍚庣 API 鎺ユ敹 PUT 璇锋眰锛屽苟涓旈渶瑕佷紶閫� row.id 鍜� row.enableState 鍙傛暟
-
-
+
+
const response = await request.post('unLoadGlass/downWorkStation/updateDownWorkstation', {
enableState: row.enableState,
id: row.id
-
-
+
+
});
console.log('Updated row status:', response.data);
// 鍙互鏍规嵁鍚庣杩斿洖鐨勬暟鎹繘琛岃繘涓�姝ュ鐞嗭紝姣斿鏇存柊鏈湴鐘舵�佺瓑
@@ -305,10 +309,10 @@
// 澶勭悊閿欒鎯呭喌锛屾瘮濡傛彁绀虹敤鎴锋洿鏂板け璐�
}
};
-
+
// 鏌ヨ鏁版嵁
const selectDownGlassData = async () => {
-
+
const response = await request.post("/unLoadGlass/downGlassInfo/setDownGlassInfoRequest", {
workStationId: selectValuesa[0],
engineerId: selectValuesa[1],
@@ -320,12 +324,12 @@
} else {
ElMessage.error(response.message);
}
-
+
}
-
-
+
+
const open = async (row) => {
-
+
printFlowCardId.value = row.flowCardId;
printLayer.value = row.layer
dialogTableVisible.value = true;
@@ -335,29 +339,30 @@
}, 2000);
}
const open1 = async (row) => {
-
+
printFlowCardId.value = row.flowCardId;
printLayer.value = row.layer
+ printGlassId.value = row.glassId
dialogTableVisible1.value = true;
setTimeout(() => {
printFlowCard1();
//dialogTableVisible1.value = false;
}, 1000);
}
-
+
const printFlowCard = () => {
// 闇�瑕佹墦鍗扮殑灞�閮ㄥ尯鍩熻祴浜�"print-wrap"鐨刬d
let el = document.getElementById("child");
let doc = document;
let body = doc.body || doc.getElementsByTagName("body")[0];
let printId = "print-" + Date.now();
-
+
// 鍒涘缓鏃犲壇浣滅敤鐨勬墦鍗板鍣�(鍥犱笉纭畾椤甸潰鐨勬墦鍗板厓绱犳湁鏃犲叾瀹冩牱寮�)
let content = doc.createElement("div");
content.id = printId;
-
+
// alert(/Chrome/.test(userAgent) && !/Edge/.test(userAgent));
-
+
// 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
let style = doc.createElement("style");
console.log("style1:" + style.innerHTML)
@@ -375,11 +380,11 @@
"{display:block;}#" +
printId +
"{display: block; padding: 0; margin: 0; width: 100%; position: absolute; top: 0; left: 0; height: 100vh; box-sizing: border-box;}} ";
-
+
content.innerHTML = el.outerHTML;
// // console.log("el.outerHTML", el.outerHTML);
body.appendChild(style);
-
+
// 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
// 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
body.appendChild(content);
@@ -389,18 +394,18 @@
body.removeChild(style);
}, 20);
}
-
+
const printFlowCard1 = () => {
// 闇�瑕佹墦鍗扮殑灞�閮ㄥ尯鍩熻祴浜�"print-wrap"鐨刬d
let el = document.getElementById("printFlowCard");
let doc = document;
let body = doc.body || doc.getElementsByTagName("body")[0];
let printId = "print-" + Date.now();
-
+
// 鍒涘缓鏃犲壇浣滅敤鐨勬墦鍗板鍣�(鍥犱笉纭畾椤甸潰鐨勬墦鍗板厓绱犳湁鏃犲叾瀹冩牱寮�)
let content = doc.createElement("div");
content.id = printId;
-
+
// 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
let style = doc.createElement("style");
style.innerHTML =
@@ -419,7 +424,7 @@
content.innerHTML = el.outerHTML;
// // console.log("el.outerHTML", el.outerHTML);
body.appendChild(style);
-
+
// 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
// 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
body.appendChild(content);
@@ -429,10 +434,10 @@
body.removeChild(style);
}, 20);
}
-
-
-
-
+
+
+
+
// beforeUnmount(() => {
// closeWebSocket();
// });
@@ -441,13 +446,13 @@
<template>
<div>
<el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
- @click="dialogFormVisibleaDownGlass = true">钀芥灦璇︽儏
+ @click="dialogFormVisibleaDownGlass = true">{{ $t('reportWork.details') }}
</el-button>
<el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
- @click="dialogFormVisibleaDownGlasss = true">浜哄伐涓嬬墖
+ @click="dialogFormVisibleaDownGlasss = true">{{ $t('reportWork.filming') }}
</el-button>
<el-switch style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;" v-model="autoPrint" class="mb-2"
- :inactive-text="$t('鑷姩鎵撳嵃')" @change="handleChange" />
+ :inactive-text="$t('basicData.printing')" @change="handleChange" />
<el-card style="flex: 1;" v-loading="loading">
<el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading">
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
@@ -460,8 +465,8 @@
<el-table-column prop="totalQuantity" align="center" :label="$t('reportWork.totalquantity')"
min-width="120" />
<el-table-column prop="racksNumber" align="center" :label="$t('reportWork.beendropped')" min-width="120" />
- <el-table-column prop="layer" align="center" label="灞傛暟" min-width="120" />
- <el-table-column prop="otherNumber" align="center" label="浜哄伐涓嬬墖鏁�" min-width="120" />
+ <el-table-column prop="layer" align="center" :label="$t('reportWork.cenumber')" min-width="120" />
+ <el-table-column prop="otherNumber" align="center" :label="$t('reportWork.artificialorder')" min-width="120" />
<!-- <el-table-column prop="work_state" align="center" :label="$t('reportWork.state')" min-width="120" /> -->
<el-table-column prop="deviceId" align="center" :label="$t('reportWork.devicenumber')" min-width="120" />
<el-table-column align="center" :label="$t('reportWork.startstatus')" min-width="80" prop="enableState">
@@ -478,17 +483,17 @@
</el-button>
<el-button size="mini" type="text" plain @click="handleBindRack2(scope.row)">{{ $t('reportWork.clear')
}}</el-button>
- <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId == null">鎵撳嵃娴佺▼鍗�</el-button>
- <el-button @click="open1(scope.row)" :disabled="scope.row.flowCardId == null">鎵撳嵃鏍囩</el-button>
+ <el-button @click="open(scope.row)" :disabled="scope.row.flowCardId == null">{{ $t('reportWork.processcard') }}</el-button>
+ <el-button @click="open1(scope.row)" :disabled="scope.row.flowCardId == null">{{ $t('reportWork.printlabels') }}</el-button>
</template>
-
+
</el-table-column>
</el-table>
-
+
</div>
- <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" :title="$t('钀芥灦淇℃伅')">
- <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('璇烽�夋嫨宸ヤ綅')" clearable>
- <el-option label="鍏ㄩ儴" value="0"></el-option>
+ <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" :title="$t('reportWork.information')">
+ <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('reportWork.cstation')" clearable>
+ <el-option :label="$t('reportWork.all')" value="0"></el-option>
<el-option label="1" value="1"></el-option>
<el-option label="2" value="2"></el-option>
<el-option label="3" value="3"></el-option>
@@ -497,45 +502,46 @@
<el-option label="6" value="6"></el-option>
<el-option label="7" value="7"></el-option>
</el-select>
-
+
<el-select v-model="selectValuesa[1]" filterable :placeholder="$t('basicData.plselectproject')" clearable
@input="handleInputChangea($event, row.id)">
<el-option v-for="item in selectOptionsa" :key="item" :label="item" :value="item" />
</el-select>
-
- <span class="demonstration">鏃堕棿娈�</span>
- <el-date-picker v-model="timeRange" type="datetimerange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�"
- value-format="YYYY-MM-DD hh:mm:ss" end-placeholder="缁撴潫鏃ユ湡">
+
+ <span class="demonstration">{{ $t('reportWork.timeperiod') }}</span>
+ <el-date-picker v-model="timeRange" type="datetimerange" range-separator="鑷�" :start-placeholder="$t('reportmanage.starttime')"
+ value-format="YYYY-MM-DD hh:mm:ss" :end-placeholder="$t('reportmanage.endtime')">
</el-date-picker>
-
+
<el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{
$t('reportmanage.inquire')
}}
</el-button>
<el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="downGlass"
:header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }">
- <el-table-column prop="workStationId" align="center" :label="$t('宸ヤ綅鍙�')" min-width="80" />
- <el-table-column prop="engineerId" align="center" :label="$t('宸ョ▼鍙�')" min-width="80" />
- <el-table-column prop="flowCardId" align="center" :label="$t('娴佺▼鍗″彿')" min-width="80" />
- <el-table-column prop="layer" align="center" :label="$t('灞�')" min-width="120" />
- <el-table-column prop="sequence" align="center" :label="$t('椤哄簭')" min-width="150" />
- <el-table-column prop="width" align="center" :label="$t('瀹�')" min-width="120" />
- <el-table-column prop="height" align="center" :label="$t('楂�')" min-width="120" />
- <el-table-column prop="Filmsid" align="center" :label="$t('鑶滅郴')" min-width="120" />
- <el-table-column prop="thickness" align="center" label="鍘氬害" min-width="120" />
- <el-table-column prop="glassId" align="center" :label="$t('鐜荤拑id')" min-width="120" />
+ <el-table-column prop="workStationId" align="center" :label="$t('reportWork.stationnumber')" min-width="80" />
+ <el-table-column prop="engineerId" align="center" :label="$t('basicData.projectnumber')" min-width="80" />
+ <el-table-column prop="flowCardId" align="center" :label="$t('workOrder.cardnumber')" min-width="80" />
+ <el-table-column prop="layer" align="center" :label="$t('searchOrder.ceng')" min-width="120" />
+ <el-table-column prop="sequence" align="center" :label="$t('reportWork.order')" min-width="150" />
+ <el-table-column prop="width" align="center" :label="$t('basicData.width')" min-width="120" />
+ <el-table-column prop="height" align="center" :label="$t('basicData.height')" min-width="120" />
+ <el-table-column prop="Filmsid" align="center" :label="$t('basicData.coatingtypes')" min-width="120" />
+ <el-table-column prop="thickness" align="center" :label="$t('basicData.thickness')" min-width="120" />
+ <el-table-column prop="glassId" align="center" :label="$t('searchOrder.glassID')" min-width="120" />
</el-table>
</el-dialog>
- <el-dialog v-model="dialogFormVisibleaDownGlasss" top="2vh" width="97%" :title="$t('浜哄伐涓嬬墖淇℃伅')">
+ <el-dialog v-model="dialogFormVisibleaDownGlasss" top="2vh" width="97%" :title="$t('searchOrder.filminformation')">
<div style="display:flex;justify-content: space-around;">
<el-card
style="display: flex; justify-content: center; align-items: center; width:800px; height: 800px;position: relative;">
<div
:style="{ width: takeGlass.width + 'px', height: takeGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (takeGlass.width > takeGlass.height ? takeGlass.width : takeGlass.height) + ')' }">
-
+
</div>
<div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:170px;">
- <div>浜哄伐涓嬬墖褰撳墠鐜荤拑淇℃伅</div>
+ <div>{{ $t('reportWork.glassmation') }}</div>
+ <div><el-button type="primary" @click="open1(takeGlass)" >{{ $t('reportWork.printlabels') }}</el-button></div>
<div>{{ takeGlass.flowCardId }}</div>
<div>{{ takeGlass.layer }}</div>
<div>{{ takeGlass.glassId }}</div>
@@ -547,16 +553,17 @@
style="display: flex; justify-content: center; align-items: center; width: 800px; height: 800px;position: relative;">
<div
:style="{ width: scanGlass.width + 'px', height: scanGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (scanGlass.width > scanGlass.height ? scanGlass.width : scanGlass.height) + ')' }">
-
+
</div>
<div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:200px;">
- <div>鎵爜鏋綋鍓嶇幓鐠冧俊鎭�</div>
+ <div>{{ $t('reportWork.barcodescanner') }}</div>
+ <div><el-button type="primary" @click="open1(scanGlass)" >{{ $t('reportWork.printlabels') }}</el-button></div>
<div>{{ scanGlass.flowCardId }}</div>
<div>{{ scanGlass.layer }}</div>
<div>{{ scanGlass.glassId }}</div>
<div>{{ scanGlass.width }}</div>
<div>{{ scanGlass.height }}</div>
-
+
</div>
</el-card>
</div>
@@ -577,9 +584,9 @@
</div>
</div>
</el-card>
-
+
</div>
-
+
<el-dialog v-model="dialogFormVisiblea" top="21vh" width="40%" :title="$t('reportWork.bindingshelves')">
<div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;">
<el-form size="mini" label-width="100px">
@@ -598,7 +605,7 @@
</div>
<template #footer>
<div id="dialog-footer">
-
+
<el-button type="primary" @click="handleConfirm">
{{ $t('reportWork.sure') }}
</el-button>
@@ -616,15 +623,15 @@
</div>
</template>
</el-dialog>
-
+
<el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close>
<print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer"
style="width: 100%;height: 100%" />
</el-dialog>
<el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close>
- <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" style="" />
+ <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" :printGlassId="printGlassId" style="" />
</el-dialog>
-
+
</template>
<style scoped>
#dt {
@@ -633,19 +640,19 @@
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;
@@ -655,21 +662,21 @@
background-color: #337ecc;
margin-left: 28%;
}
-
+
.awatch {
max-width: 100%;
}
-
+
#main-body {
margin-top: -40px;
margin-left: 150px;
}
-
+
#main-bodya {
margin-top: -40px;
margin-left: 100px;
}
-
+
:deep(#sizePrintCalrd .el-dialog__body) {
height: 85%;
width: 100%;
--
Gitblit v1.8.0