From 0ece4e0ed07f412178150c3badaa2ce49cb52e86 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期一, 02 十二月 2024 09:30:13 +0800
Subject: [PATCH] 使用sqlserver 移除mysql代码
---
UI-Project/src/views/Slicecage/slicecage.vue | 157 +++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 129 insertions(+), 28 deletions(-)
diff --git a/UI-Project/src/views/Slicecage/slicecage.vue b/UI-Project/src/views/Slicecage/slicecage.vue
index 686a171..06b7e10 100644
--- a/UI-Project/src/views/Slicecage/slicecage.vue
+++ b/UI-Project/src/views/Slicecage/slicecage.vue
@@ -1,16 +1,17 @@
<script lang="ts" setup>
-import { useI18n } from 'vue-i18n'
- const { t } = useI18n()
- let language = ref(localStorage.getItem('lang') || 'zh')
-import {Search} from "@element-plus/icons-vue";
+import {useI18n} from 'vue-i18n'
import {useRouter} from "vue-router"
-const router = useRouter()
import request from "@/utils/request"
-import { WebSocketHost ,host} from '@/utils/constants'
-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";
+import {host, WebSocketHost} from '@/utils/constants'
+import {computed, onBeforeUnmount, onMounted, onUnmounted, reactive, ref} from "vue";
+import {closeWebSocket, initializeWebSocket} from '@/utils/WebSocketService';
+import {ElMessage, ElMessageBox} from 'element-plus'
+import PrintLabel from "@/views/UnLoadGlass/PrintCustomLabelSemi1.vue";
+const dialogFormVisibleaDownGlasss = ref(false)
+const scanGlass = ref([])
+const {t} = useI18n()
+let language = ref(localStorage.getItem('lang') || 'zh')
+const router = useRouter()
const dialogFormVisible = ref(false)
const dialoglea = ref(false)
const dialogFormVisiblea = ref(false)
@@ -142,6 +143,61 @@
if (page >= 1 && page <= totalPages.value) {
currentPage.value = page;
}
+}
+const printFlowCardId = ref('')
+const printLayer = ref('')
+const printGlassId = ref('')
+const dialogTableVisible1 = ref(false)
+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 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 =
+ "body>#" +
+ printId +
+ "{display:none}@media print{" +
+ "@page {" +
+ " size: auto; " +
+ " margin: 2mm 2mm 2mm 2mm; " +
+ " }body>:not(#" +
+ printId +
+ "){display:none !important}body>#" +
+ printId +
+ "{display:block;padding-top:1px}}";
+ //
+ content.innerHTML = el.outerHTML;
+ // // console.log("el.outerHTML", el.outerHTML);
+ body.appendChild(style);
+
+ // 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
+ // 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
+ body.appendChild(content);
+ setTimeout(() => {
+ window.print();
+ body.removeChild(content);
+ body.removeChild(style);
+ }, 20);
}
// 涓婁竴椤靛拰涓嬩竴椤垫柟娉�
const prevPage = () => {
@@ -362,7 +418,7 @@
}
};
// 鎸囧畾閽㈠寲
- const brokee = async(row) => {
+ const brokee = async(row,temperingFeedSequence) => {
try {
const confirmResult = await ElMessageBox.confirm(
t('searchOrder.specifytemperinga'),
@@ -377,6 +433,7 @@
const response = await request.post("/cacheVerticalGlass/bigStorageCageDetails/TemperingGlass",{
engineerId: row.engineer_id,
temperingLayoutId: row.tempering_layout_id,
+ temperingFeedSequence:temperingFeedSequence
});
if (response.code === 200) {
ElMessage.success(response.message);
@@ -387,6 +444,7 @@
} catch (error) {
console.error('鍙戠敓閿欒:', error);
}
+ handleganghua();
};
// 鎸囧畾宸ョ▼
const brokek = async(row) => {
@@ -601,7 +659,7 @@
} catch (error) {
// console.error('Error fetching rects :', error);
}
-
+
});
const fetchFlows = async () => {
@@ -617,7 +675,7 @@
}
}
-
+
const fetchFlow = async () => {
try {
const response = await request.post('/cacheVerticalGlass/bigStorageCageDetails/selectTemperingGlass')
@@ -635,7 +693,7 @@
});
glasstotal.value = totalCount;
fulltotals.value = fullCount;
-
+
} else {
ElMessage.error(response.message);
}
@@ -702,6 +760,18 @@
const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/slicecage`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
+ if (data.scanGlass != null) {
+ scanGlass.value = data.scanGlass[0];
+ let width = scanGlass.value.width;
+ let height = scanGlass.value.height;
+ if (width < height) {
+ scanGlass.value.width = height;
+ scanGlass.value.height = width;
+ }
+ if (autoPrint.value == true && browser.value == true) {
+ open1(scanGlass);
+ }
+ }
//褰撳墠鎸囧畾宸ョ▼
if(data.bigStorageCageDetailsOutTask!=null){
temperingengineerId.value=data.temperingengineerId[0];
@@ -876,6 +946,7 @@
// console.log("鍏抽棴浜�")
closeWebSocket();
});
+
</script>
<template>
@@ -884,8 +955,11 @@
<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="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-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisibles=true;fetchFlows()">闈為挗鍖栨祦绋嬪崱鏌ヨ</el-button>
+ <el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="info" @click="dialogFormVisibles=true;fetchFlows()">{{ $t('searchOrder.searchlayout') }}</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-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
+ @click="dialogFormVisibleaDownGlasss = true">鏍囩鎵撳嵃
+ </el-button>
<el-card style="flex: 1;margin-left: 10px;margin-top: 5px;" v-loading="loading">
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 100px;">
<el-table height="100px" ref="table"
@@ -896,9 +970,9 @@
<el-table-column prop="bigStorageCageOutTask.trainNumber" align="center" :label="$t('searchOrder.trips')" min-width="120" />
<el-table-column prop="bigStorageCageOutTask.serialNumber" align="center" :label="$t('searchOrder.number')" min-width="120" />
<el-table-column prop="bigStorageCageOutTask.taskState" align="center" :label="$t('searchOrder.taskstatus')" min-width="157">
- <template #default="scope">
- <el-tag type="success" >{{ scope.row.bigStorageCageOutTask.taskState==0? $t('searchOrder.filmenter') : $t('searchOrder.infilm') }}</el-tag>
- </template>
+ <!-- <template #default="scope">
+ <el-tag type="success" >{{ scope.row.bigStorageCageOutTask.taskState==0? $t('searchOrder.filmenter') : $t('searchOrder.infilm') }}111</el-tag>
+ </template> -->
</el-table-column>
<!-- <el-table-column prop="id" align="center" :label="$t('searchOrder.tabid')" min-width="150"/> -->
<el-table-column prop="deviceId" align="center" :label="$t('searchOrder.tid')" min-width="100"/>
@@ -1531,21 +1605,21 @@
</el-col>
<el-col :span="4">
<div id="dt" style="font-size: 15px;">
- <el-form-item :label="$t('婊$倝鏁伴噺')" style="width: 14vw">
+ <el-form-item :label="$t('searchOrder.fullfurnaces')" style="width: 14vw">
{{ fulltotals }}
</el-form-item>
</div>
</el-col>
<el-col :span="4">
<div id="dt" style="font-size: 15px;">
- <el-form-item :label="$t('褰撳墠鎸囧畾宸ョ▼')" style="width: 14vw">
+ <el-form-item :label="$t('searchOrder.specifiedproject')" style="width: 14vw">
{{ temperingengineerId }}
</el-form-item>
</div>
</el-col>
<el-col :span="4">
<div id="dt" style="font-size: 15px;">
- <el-button size="mini" type="text" plain @click="broked()">{{ $t('鍙栨秷鎸囧畾') }}</el-button>
+ <el-button size="mini" type="text" plain @click="broked()">{{ $t('searchOrder.undesignate') }}</el-button>
</div>
</el-col>
</el-row>
@@ -1555,16 +1629,16 @@
: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"/>
<el-table-column prop="tempering_layout_id" fixed align="center" :label="$t('searchOrder.layoutnumber')" min-width="120" />
- <el-table-column prop="count2" align="center" :label="$t('鎬绘暟閲�')" min-width="150" />
- <el-table-column prop="count1" align="center" :label="$t('绗煎瓙鍐呮暟閲�')" min-width="150" />
- <el-table-column prop="count3" align="center" :label="$t('缂哄皯鏁伴噺')" min-width="150" />
- <el-table-column prop="count4" align="center" :label="$t('鐮存崯/鎷胯蛋鏁伴噺')" min-width="150" />
+ <el-table-column prop="count2" align="center" :label="$t('searchOrder.allnumber')" min-width="150" />
+ <el-table-column prop="count1" align="center" :label="$t('searchOrder.numbercages')" min-width="150" />
+ <el-table-column prop="count3" align="center" :label="$t('searchOrder.missingquantity')" min-width="150" />
+ <el-table-column prop="count4" align="center" :label="$t('searchOrder.breakquantity')" min-width="150" />
<el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" width="250">
<template #default="scope">
- <el-button size="mini" type="text" plain @click="brokee(scope.row)">{{ $t('searchOrder.specifytempering') }}</el-button>
+ <el-button size="mini" type="text" plain @click="brokee(scope.row,1)">{{ $t('searchOrder.specifytempering') }}</el-button>
+ <el-button size="mini" type="text" plain @click="brokee(scope.row,0)">{{ $t('searchOrder.specifyout') }}</el-button>
<el-button size="mini" type="text" plain @click="brokek(scope.row)">{{ $t('searchOrder.specifyengineerid') }}</el-button>
</template>
-
</el-table-column>
</el-table>
</el-dialog>
@@ -1597,7 +1671,7 @@
<el-table ref="table" style="margin-top: 20px;height: 500px;"
:data="tableDatas" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
<el-table-column prop="flow_card_id" fixed align="center" :label="$t('searchOrder.processcards')"/>
- <el-table-column prop="layer" align="center" label="灞�" />
+ <el-table-column prop="layer" align="center" :label="$t('searchOrder.ceng')" />
<el-table-column prop="count" align="center" :label="$t('searchOrder.numberglasses')" />
<el-table-column fixed="right" :label="$t('searchOrder.operate')" align="center" >
<template #default="scope">
@@ -1606,6 +1680,33 @@
</el-table-column>
</el-table>
</el-dialog>
+<el-dialog v-model="dialogFormVisibleaDownGlasss" top="2vh" width="97%" :title="$t('浜哄伐涓嬬墖淇℃伅')">
+ <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: 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>
+ <el-button type="primary" @click="open1(scanGlass)">鎵撳嵃鏍囩</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>
+ </el-dialog>
+ <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close>
+ <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer"
+ :printGlassId="printGlassId" style=""/>
+ </el-dialog>
</template>
<style scoped>
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
--
Gitblit v1.8.0