From f5a13d8fc3d0e49adcf73231e7ba60bfd7f5e296 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期二, 13 八月 2024 09:14:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue | 189 +++++++++++++++++------------------------------
1 files changed, 68 insertions(+), 121 deletions(-)
diff --git a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
index ea71644..5ffd4ae 100644
--- a/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
+++ b/UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -13,12 +13,7 @@
import request from "@/utils/request";
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 autoPrint = ref(false)
-
+// import PrintFlow from './PrintFlow.vue'
const dialogFormVisiblea = ref(false)
const dialogFormVisiblea2 = ref(false)
const dialogFormVisibleaDownGlass = ref(false)
@@ -33,38 +28,12 @@
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 now = new Date();
-const timeRange = ref([new Date(now.setHours(0, 0, 0, 0)), new Date(now.setHours(23, 59, 59, 999))])
-
-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) {
- // 缁戝畾鎴愬姛锛屽鐞嗛�昏緫
- ElMessage.success(response.message);
- autoPrint.value = response.data
- } else {
- ElMessage.error(response.message);
- }
- }
- catch (error) {
- // 澶勭悊閿欒
- console.error(error);
- }
-}
-
+// const printFlowCardId = ref('')
+// const printLayer=ref('')
const handleInputChangea = (value, rowId) => {
// 鏇存柊瀵瑰簲琛岀殑 select 鍊�
@@ -186,7 +155,6 @@
const socketUrl = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unloadglass`;
// 瀹氫箟娑堟伅澶勭悊鍑芥暟锛屾洿鏂� receivedData 鍙橀噺
const handleMessage = (data) => {
-
// 鏇存柊 tableData 鐨勬暟鎹�
if (data.downGlassInfos != null) {
downGlass.value = data.downGlassInfos[0][1];
@@ -194,27 +162,8 @@
if (data.engineerIdList != null) {
selectOptionsa.value = data.engineerIdList[0]
}
- if (data.autoPrint != null) {
- autoPrint.value = data.autoPrint;
- }
- console.log(autoPrint.value)
- tableData.splice(0, tableData.length, ...data.params[0]);
- if (fullFlowCard.value == "") {
- for (let i = 0; i < tableData.length; i++) {
- if (tableData[i].totalQuantity != 0) {
- 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;
- }
- } else {
- console.log("娌℃湁flowCardId")
- }
- }
- }
-
+ // tableData.splice(0, tableData.length, ...data.params[0]);
// console.log("鏇存柊鍚庢暟鎹�", data.params[0]);
};
@@ -268,14 +217,15 @@
// 鏌ヨ鏁版嵁
const selectDownGlassData = async () => {
-
- const response = await request.post("/unLoadGlass/downGlassInfo/setDownGlassInfoRequest", {
+
+ const response = await request.post("/unLoadGlass/downGlassInfo/selectDownGlassInfo", {
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);
@@ -284,58 +234,56 @@
}
-const open = async (row) => {
+// const open=async(row)=>{
- printFlowCardId.value = row.flowCardId;
- printLayer.value = row.layer
- dialogTableVisible.value = true;
- setTimeout(() => {
- printFlowCard(); // 鏇挎崲鎴愪綘瑕佹墽琛岀殑鍑芥暟鍚�
- dialogTableVisible.value = false;
- }, 1000);
- ;
+// printFlowCardId.value=row.flowCardId;
+// printLayer.value=row.layer
+// dialogTableVisible.value = true;
+// setTimeout(() => {
+// printFlowCard(); // 鏇挎崲鎴愪綘瑕佹墽琛岀殑鍑芥暟鍚�
+// }, 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();
-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;
- // 鍒涘缓鏃犲壇浣滅敤鐨勬墦鍗板鍣�(鍥犱笉纭畾椤甸潰鐨勬墦鍗板厓绱犳湁鏃犲叾瀹冩牱寮�)
- 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 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);
+// body.appendChild(style);
- // 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
- 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}}";
- //
- 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);
-}
+// // 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
+// // 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
+// body.appendChild(content);
+// setTimeout(() => {
+// window.print();
+// body.removeChild(content);
+// body.removeChild(style);
+// }, 20);
+// }
// beforeUnmount(() => {
@@ -347,8 +295,6 @@
<div>
<el-button style="margin-top: 5px;margin-left: 10px;" id="searchButton" type="primary"
@click="dialogFormVisibleaDownGlass = true">钀芥灦璇︽儏</el-button>
- <el-switch style="margin-top: 5px;margin-left: 10px;" v-model="autoPrint" class="mb-2" :inactive-text="$t('鑷姩鎵撳嵃')"
- @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;">
@@ -378,7 +324,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>
@@ -405,12 +351,9 @@
@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="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡">
- </el-date-picker>
-
+ <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" />
<el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{
$t('reportmanage.inquire')
}}</el-button>
@@ -486,13 +429,17 @@
</template>
</el-dialog>
- <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>
+ <!-- <el-dialog
+ id="sizePrintCalrd"
+ v-model="dialogTableVisible"
+ destroy-on-close
+ style="width: 75%;height:75% ">
+ <print-flow
+ id="child"
+ :printFlowCardId="printFlowCardId"
+ :printLayer="printLayer"
+ style="width: 100%;height: 100%"/>
+ </el-dialog> -->
</template>
<style scoped>
--
Gitblit v1.8.0