From 6e7bca8a67ef51e53ddcf20e0de66040b3da4572 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 18 十二月 2025 11:11:17 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-VUEUI
---
.env.staging | 2
src/views/basic/gyStockPlace/gyStockPlace.vue | 11 +++++
.env.production | 4 +-
src/views/component/printList/barcode.vue | 100 ++++++++++++++++++++++++++++++++-----------------
4 files changed, 79 insertions(+), 38 deletions(-)
diff --git a/.env.production b/.env.production
index 605ec3c..a3da59f 100644
--- a/.env.production
+++ b/.env.production
@@ -4,8 +4,8 @@
# 鐢熶骇鐜閰嶇疆
ENV = 'production'
-VUE_APP_BASE_API = http://192.168.0.236:9010/API/
-# VUE_APP_BASE_API = http://220.189.218.155:9010/API/ # 鍥涚淮灏� 澶栫綉
+# VUE_APP_BASE_API = http://192.168.0.236:9010/API/
+VUE_APP_BASE_API = http://220.189.218.155:9010/API/
# VUE_APP_BASE_API = http://47.96.97.237/API/ # 鏅轰簯杩堟�滾-MOM绠$悊绯荤粺/鐢熶骇鐜
# 璺敱鎳掑姞杞�
VUE_CLI_BABEL_TRANSPILE_MODULES = true
\ No newline at end of file
diff --git a/.env.staging b/.env.staging
index 1a84e05..ceed279 100644
--- a/.env.staging
+++ b/.env.staging
@@ -9,7 +9,7 @@
ENV = 'staging'
# 鏅轰簯杩堟�滾-MOM绠$悊绯荤粺/娴嬭瘯鐜
-VUE_APP_BASE_API = 'http://192.168.0.51:81/API/'
+VUE_APP_BASE_API = 'http://localhost:81/API/'
# 璺敱鎳掑姞杞�
VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/src/views/basic/gyStockPlace/gyStockPlace.vue b/src/views/basic/gyStockPlace/gyStockPlace.vue
index a743d1c..50972e5 100644
--- a/src/views/basic/gyStockPlace/gyStockPlace.vue
+++ b/src/views/basic/gyStockPlace/gyStockPlace.vue
@@ -23,6 +23,13 @@
@keyup.enter.native="handleQuery"
class="ForFilteringSchemes"
/>
+ </el-form-item><el-form-item label="浠撳簱鍚嶇О" prop="HWHName">
+ <el-input
+ v-model="queryParams.HWHName"
+ placeholder="璇疯緭鍏ヤ粨搴撳悕绉�"
+ @keyup.enter.native="handleQuery"
+ class="ForFilteringSchemes"
+ />
</el-form-item>
<el-form-item label="缁勭粐">
<el-select
@@ -1156,6 +1163,9 @@
if (this.queryParams.HName) {
this.sWhere += " and 浠撲綅鍚嶇О like '%" + this.queryParams.HName + "%'";
}
+ if (this.queryParams.HWHName) {
+ this.sWhere += " and 浠撳簱鍚嶇О like '%" + this.queryParams.HWHName + "%'";
+ }
if (this.queryParams.HOrgID) {
let OrgName = this.organizationList.find((e) => e.ID == this.queryParams.HOrgID)
?.Name;
@@ -1211,6 +1221,7 @@
this.queryParams = {
HNumber: "",
HName: "",
+ HWHName: "",
HBillNo: "",
HInitTimeCycle: 29,
HProjectNumber: "",
diff --git a/src/views/component/printList/barcode.vue b/src/views/component/printList/barcode.vue
index 1aff0a0..911824d 100644
--- a/src/views/component/printList/barcode.vue
+++ b/src/views/component/printList/barcode.vue
@@ -1,13 +1,15 @@
<template>
- <div>
- <button @click="getTemp">鎵撳嵃</button>
- <div id="report_holder"> </div>
+ <div style="padding: 10px">
+ <el-button type="primary" @click="getTemp">鎵撳嵃</el-button>
+ <!-- <el-button type="primary" @click="getTempMeta">鑾峰彇鍏冩暟鎹�</el-button> -->
+ <div id="report_holder"></div>
</div>
</template>
<script>
-import PrintJS from 'print-js'
+import PrintJS from "print-js";
import axios from "axios";
+import { watch } from "vue";
export default {
name: "HBarPlanPrintWeb",
data() {
@@ -16,7 +18,7 @@
handleMessage: this.$route.query,
pageSize: {
width: 0,
- height: 0
+ height: 0,
},
reportViewer: null,
baseUrl: process.env.VUE_APP_BASE_API,
@@ -24,17 +26,28 @@
recordset: [],
},
grfPath: "",
-
- }
+ oriention: null,
+ };
},
async mounted() {
// 鑾峰彇 鎵撳嵃鐨勬暟鎹�
- await this.getPrintData()
-
+ await this.getPrintData();
+ // 鑾峰彇鎵撳嵃绾稿紶澶у皬
rubylong.grhtml5.barcodeURL = this.baseUrl + "/Utility/Barcode.ashx";
- this.reportViewer = rubylong.grhtml5.insertReportViewer("report_holder", this.grfPath, this.json_data.recordset,
+ this.reportViewer = rubylong.grhtml5.insertReportViewer(
+ "report_holder",
+ this.grfPath,
+ this.json_data
);
this.reportViewer.start();
+ },
+ watch: {
+ // 鐩戝惉reportViewer鏄惁宸茬粡鏋勫缓瀹屾垚锛屾瀯寤哄畬鎴愬悗 鑾峰彇grf鏂囦欢鐨勬墦鍗伴〉闈㈠ぇ灏�
+ 'reportViewer.generated'(newVal, oldVal) {
+ if(newVal == true) {
+ this.getTempMeta()
+ }
+ },
},
methods: {
getUrlVars_JSON() {
@@ -45,6 +58,7 @@
return datajson;
},
async getPrintData() {
+ // 鍦ㄥぇ鎵归噺鎵撳嵃鐨勬椂鍊� url闀垮害鍙兘瓒単et鍏佽鐨勯暱搴� 鍚庣闇�鎸夐渶姹� 鏀规垚POST璇锋眰
let OpenTmp = decodeURIComponent(this.$route.query.OpenTmp);
let sql = "";
if (this.$route.query.Type == "Kf_SellOutBillList") {
@@ -91,58 +105,74 @@
ModRightNameCheck: "",
// , "HSubID": data[i].hsubid
},
- })
+ });
// 灏� 娓叉煋鏁版嵁 鍜� 妯℃澘鍔犺浇鍒版湰鍦�
let result = res.data;
- this.json_data.recordset = result.data;
- this.grfPath = "./static/grf/" + OpenTmp + ".grf"
- console.log(this.json_data);
- }catch(err) {
+ this.json_data.recordset = result.data;
+ this.grfPath = "./static/grf/" + OpenTmp + ".grf";
+ console.log(this.json_data);
+ } catch (err) {
this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!" + err);
}
-
+ },
+ getTempMeta() {
+ let grfMeta = JSON.parse(this.reportViewer.reportText);
+ console.log("grfMeta", grfMeta)
+ this.pageSize.width = grfMeta.Printer.Width * 10 + "mm";
+ this.pageSize.height = grfMeta.Printer.Height * 10 + "mm";
+ console.log("pageSize: ",this.pageSize)
+ this.oriention = grfMeta.Printer.Oriention.toLowerCase()
},
getTemp() {
// 瀵规瘡涓鎵撳嵃鐨勫璞℃坊鍔犲垎椤�
- let docs = document.querySelectorAll('[_grrecno]')
- this.pageSize.width = docs[0].offsetWidth
- this.pageSize.height = docs[0].offsetHeight
+ let docs = document.querySelectorAll("[_grrecno]");
+ // this.pageSize.width = docs[0].offsetWidth;
+ // this.pageSize.height = docs[0].offsetHeight;
docs.forEach((elem, index) => {
- elem.classList.add('printable')
- })
- let styles = document.querySelectorAll('[id^="_gridcss"]')
- this.styleList.push(...styles)
+ elem.classList.add("printable");
+ });
+ let styles = document.querySelectorAll('[id^="_gridcss"]');
+ this.styleList.push(...styles);
- this.execPrint()
+ this.execPrint();
},
execPrint() {
PrintJS({
- printable: 'report_holder',
+ printable: "report_holder",
scanStyles: false,
- type: 'html',
- style: this.styleList[0].innerText + ` @media print {
+ type: "html",
+ style:
+ this.styleList[0].innerText +
+ `
.printable {
page-break-inside: avoid;
page-break-after: always;
+ box-sizing: border-box !important; /* 鍐呰竟璺濅笉褰卞搷瀹介珮 */
}
@page {
- size: ${this.pageSize.width + 1}px ${this.pageSize.height + 1}px;
+ size: ${this.pageSize.width} ${this.pageSize.height};
margin: 0;
padding: 0;
}
+
+ table { border-collapse: collapse !important; }
* {
margin: 0;
padding: 0;
+ color: #000 !important;
+ opacity: 1 !important;
+ filter: none !important;
+ text-shadow: none !important;
+ -webkit-print-color-adjust: exact; /* 寮哄埗杩樺師棰滆壊锛堥伩鍏嶆贰鑹诧級 */
}
`,
- })
-
-
- }
- }
-}
+ });
+ },
+ },
+};
</script>
-<style></style>
\ No newline at end of file
+<style>
+</style>
--
Gitblit v1.9.1