From 7fd37a99f4bf0a3f2955e60436c63e59b58054f4 Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期六, 10 八月 2024 09:10:11 +0800 Subject: [PATCH] 新增自动报工功能,磨边队列,下片队列增加查询条件 --- UI-Project/src/views/UnLoadGlass/loadmachinerack.vue | 94 +++++++++++++++++++++++++++++------------------ 1 files changed, 58 insertions(+), 36 deletions(-) diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue index 6f7522a..7f796a3 100644 --- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue +++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue @@ -14,6 +14,10 @@ import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; import { WebSocketHost, host } from '@/utils/constants' import PrintFlow from './PrintFlow.vue' +import print from 'vue3-print-nb'; +const printLoading = ref(true) +const fullFlowCard =ref('') + const dialogFormVisiblea = ref(false) const dialogFormVisiblea2 = ref(false) const dialogFormVisibleaDownGlass = ref(false) @@ -28,12 +32,22 @@ const flowCardOptions = ref('[]'); const tableData = reactive([]); const downGlass = ref([]); -const timeRange = ref(["2022-01-01", "2025-01-01"]) + const selectValuesa = reactive({}); const selectOptionsa = ref([]); const dialogTableVisible = ref(false) const printFlowCardId = ref('') -const printLayer=ref('') +const printLayer = ref('') +const now = new Date(); +const timeRange = ref([new Date(now.setHours(0, 0, 0, 0)), new Date(now.setHours(23, 59, 59, 999))]) + +const printWithoutPreview = () => { + const printElement = document.getElementById('printMe'); + + // 璋冪敤鎵撳嵃鍑芥暟锛屼紶閫掓墦鍗板尯鍩熺殑 DOM 鍏冪礌鍜岃烦杩囬瑙堢殑鍙傛暟 + print(printElement, { preview: false }); +}; + const handleInputChangea = (value, rowId) => { // 鏇存柊瀵瑰簲琛岀殑 select 鍊� @@ -164,6 +178,17 @@ } // tableData.splice(0, tableData.length, ...data.params[0]); + if (fullFlowCard.value == "") { + for (let i = 0; i < tableData.length; i++) { + if (tableData[i].totalQuantity == tableData[i].racksNumber + tableData[i].otherNumber&&fullFlowCard.value!=tableData[i].flowCardId) { + // printFlowCardId.value = tableData[i].flowCardId; + fullFlowCard.value=tableData[i].flowCardId; + open(tableData[i]); + break; + } + } + } + // console.log("鏇存柊鍚庢暟鎹�", data.params[0]); }; @@ -217,15 +242,14 @@ // 鏌ヨ鏁版嵁 const selectDownGlassData = async () => { - - const response = await request.post("/unLoadGlass/downGlassInfo/selectDownGlassInfo", { + + const response = await request.post("/unLoadGlass/downGlassInfo/setDownGlassInfoRequest", { workStationId: selectValuesa[0], engineerId: selectValuesa[1], beginDate: timeRange.value[0], endDate: timeRange.value[1], }) if (response.code === 200) { - sendDownGlass.value = response.data; ElMessage.success(response.message); } else { ElMessage.error(response.message); @@ -234,15 +258,17 @@ } -const open=async(row)=>{ +const open = async (row) => { - printFlowCardId.value=row.flowCardId; - printLayer.value=row.layer + printFlowCardId.value = row.flowCardId; + printLayer.value = row.layer dialogTableVisible.value = true; setTimeout(() => { printFlowCard(); // 鏇挎崲鎴愪綘瑕佹墽琛岀殑鍑芥暟鍚� - }, 1000); + dialogTableVisible.value = false; + }, 1000); ; + } const printFlowCard = () => { @@ -259,17 +285,17 @@ // 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌 let style = doc.createElement("style"); style.innerHTML = - "body>#" + - printId + - "{display:none}@media print{" + - "@page {" + - " size: auto; " + - " margin: 2mm 2mm 0mm 1mm; " + - " }body>:not(#" + - printId + - "){display:none !important}body>#" + - printId + - "{display:block;padding-top:1px}}"; + "body>#" + + printId + + "{display:none}@media print{" + + "@page {" + + " size: auto; " + + " margin: 2mm 2mm 0mm 1mm; " + + " }body>:not(#" + + printId + + "){display:none !important}body>#" + + printId + + "{display:block;padding-top:1px}}"; // content.innerHTML = el.outerHTML; // // console.log("el.outerHTML", el.outerHTML); @@ -324,7 +350,7 @@ @click="handleBindRack(scope.row)">{{ $t('reportWork.bindingshelves') }}</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="open(scope.row)" :disabled="scope.row.flowCardId == null">鎵撳嵃</el-button> </template> </el-table-column> @@ -351,9 +377,12 @@ @input="handleInputChangea($event, row.id)"> <el-option v-for="item in selectOptionsa" :key="item" :label="item" :value="item" /> </el-select> - <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" - value-format="YYYY-MM-DD" :start-placeholder="$t('reportmanage.starttime')" - :end-placeholder="$t('reportmanage.endtime')" :default-time="defaultTime" /> + + <span class="demonstration">鏃堕棿娈�</span> + <el-date-picker v-model="timeRange" type="datetimerange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡"> + </el-date-picker> + <el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{ $t('reportmanage.inquire') }}</el-button> @@ -429,20 +458,13 @@ </template> </el-dialog> - <el-dialog - id="sizePrintCalrd" - v-model="dialogTableVisible" - destroy-on-close - style="width: 75%;height:75% "> - <!-- <template #header="{ close, titleId, titleClass }"> + <el-dialog id="sizePrintCalrd" v-model="dialogTableVisible" destroy-on-close style="width: 75%;height:75% "> + <!-- <template #header="{ close, titleId, titleClass }"> <el-button @click="printFlowCard" >鎵撳嵃</el-button> </template> --> - <print-flow - id="child" - :printFlowCardId="printFlowCardId" - :printLayer="printLayer" - style="width: 100%;height: 100%"/> - </el-dialog> + <print-flow id="child" :printFlowCardId="printFlowCardId" :printLayer="printLayer" + style="width: 100%;height: 100%" /> + </el-dialog> </template> <style scoped> -- Gitblit v1.8.0