From 35c745548ab8a4266caf027921410f4164cf5e42 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期二, 14 十月 2025 16:31:04 +0800
Subject: [PATCH] 分页优化
---
components/WorkOrderPrint.vue | 171 ++++++++++++++++----------------------------------------
1 files changed, 50 insertions(+), 121 deletions(-)
diff --git a/components/WorkOrderPrint.vue b/components/WorkOrderPrint.vue
index f5ce7d8..f51371c 100644
--- a/components/WorkOrderPrint.vue
+++ b/components/WorkOrderPrint.vue
@@ -38,7 +38,7 @@
</table>
</view>
- <!-- 缁熻琛岋紙鍒锋柊鎸夐挳绉诲埌杩欓噷鍙充晶锛� -->
+ <!-- 缁熻琛� -->
<view class="status-row">
<view class="status-box">
<text>鏈哄彴闈㈡澘鏁帮細</text>
@@ -68,32 +68,13 @@
</view>
</view>
- <!-- 鍩虹淇℃伅锛堝凡鍘绘帀 鍥惧彿 / 鏉愯川 / 棰滆壊锛� -->
- <view class="basic-info">
- <view class="form-row">
- <view class="form-item">
- <label>浜у搧缂栫爜:</label>
- <input class="inp" type="text" v-model="order.daa002" disabled />
- </view>
- <view class="form-item">
- <label>浜у搧鍚嶇О:</label>
- <superwei-combox :candidates="DAA003List" v-model="order.daa003"
- @select="onDaa003Change" class="inp"></superwei-combox>
- </view>
- <view class="form-item">
- <label>浜у搧瑙勬牸:</label>
- <input class="inp" type="text" v-model="order.daa004" disabled />
- </view>
- </view>
- </view>
-
+ <!-- 宸茬Щ闄�: 浜у搧缂栫爜 / 浜у搧鍚嶇О / 浜у搧瑙勬牸 杈撳叆鍖哄煙 -->
<!-- 涓嶈壇鏁伴噺 -->
<view class="print-section" style="margin-top:10px;">
<view class="barcode-info">
<view class="user-select">
- <text style="display:inline-block;float:left;">涓嶈壇鏁伴噺锛�</text>
- <input v-model="customAmount" class="inp"
- style="width:55%;height:60px;border:3px solid #808080;font-size:32px;text-align:center;margin-top:5px;"
+ <text>涓嶈壇鏁伴噺锛�</text>
+ <input v-model="customAmount" class="inp bad-input"
placeholder="璇疯緭鍏ユ暟閲�" />
</view>
<view class="user-select" style="margin-left:30px;">
@@ -106,7 +87,7 @@
<view>
<view class="reason-section" style="margin-bottom:-10px">
<text>鎶ュ伐浜猴細</text>
- <view class="reason-buttons" style="font-size:20px;">
+ <view class="reason-buttons">
<button v-for="(u,index) in users" :key="index"
:class="{'reason-btn':true,'selected': staffNo===u}"
@click="toggleUser(u)" v-text="u"></button>
@@ -120,7 +101,7 @@
<button class="cancel-btn" @click="cancel">鍙栨秷</button>
</view>
- <!-- 淇濈暀寮圭獥 -->
+ <!-- 寮圭獥淇濈暀 -->
<view v-if="isShow" class="overlay">
<view class="popup">
<view class="bottom-section1">
@@ -153,9 +134,7 @@
<uni-td align="center"><input v-model="item.okQty" /></uni-td>
</uni-tr>
</uni-table>
- <view>
- <button class="clean-btn" type="warn" @click="barcodeIsShow=false">鍏抽棴</button>
- </view>
+ <view><button class="clean-btn" type="warn" @click="barcodeIsShow=false">鍏抽棴</button></view>
</view>
</view>
</view>
@@ -171,60 +150,22 @@
return {
currentUser: '',
barcodeAmount: '',
- users: [],
- userForm: [],
- staff: [],
- user: {},
- productionCount: 0,
- printedCount: 0,
- defectiveCount: 0,
- order: {},
- icount: 1,
- bqty: 0,
- sQuantity: 0,
- kgQty: 0,
- initialValue: 0,
- qqty: 0,
- ngStaid: 0,
- bufferData: '',
- dataToPrint: [],
- isLoading: false,
- but: false,
- DAA003List: [],
- lineList: [],
- isShow: false,
- barcodeIsShow: false,
- barcodeList: [],
- staffNo: '',
- printStr: '',
- printMac: '',
- bluetoothSocket: {},
- device: '',
- uuid: '',
- printNum: 1,
- reportingList: [],
- printLoading: false,
- customAmount: '',
- isGeneratingBarcode: false,
- lastGenerateTime: 0,
- generateRequestId: null,
- nowTimeTimer: null,
- nowTime: ''
- };
+ users: [], userForm: [], staff: [], user: {},
+ productionCount: 0, printedCount: 0, defectiveCount: 0, order: {},
+ icount: 1, bqty: 0, sQuantity: 0, kgQty: 0, initialValue: 0, qqty: 0,
+ ngStaid: 0, bufferData: '', dataToPrint: [], isLoading: false, but: false,
+ DAA003List: [], lineList: [], isShow: false, barcodeIsShow: false, barcodeList: [],
+ staffNo: '', printStr: '', printMac: '', bluetoothSocket: {}, device: '', uuid: '',
+ printNum: 1, reportingList: [], printLoading: false, customAmount: '',
+ isGeneratingBarcode: false, lastGenerateTime: 0, generateRequestId: null,
+ nowTimeTimer: null, nowTime: ''
+ }
},
computed: {
- calculatedCurrentCount() {
- return (this.productionCount || 0) - (this.initialValue || 0);
- },
- calculatedTotalProduction() {
- return (this.kgQty || 0) + this.calculatedCurrentCount;
- },
- calculatedDefectiveCount() {
- return this.calculatedTotalProduction - (this.sQuantity || 0);
- },
- planQtyDisplay() {
- return this.order.planQty || this.order.planQuantity || this.order.daa007 || this.order.daa010 || 0;
- }
+ calculatedCurrentCount() { return (this.productionCount || 0) - (this.initialValue || 0); },
+ calculatedTotalProduction() { return (this.kgQty || 0) + this.calculatedCurrentCount; },
+ calculatedDefectiveCount() { return this.calculatedTotalProduction - (this.sQuantity || 0); },
+ planQtyDisplay() { return this.order.planQty || this.order.planQuantity || this.order.daa007 || this.order.daa010 || 0; }
},
created() {
this.initializeData();
@@ -234,9 +175,7 @@
this.updateNowTime();
this.nowTimeTimer = setInterval(this.updateNowTime, 60000);
},
- beforeDestroy() {
- if (this.nowTimeTimer) clearInterval(this.nowTimeTimer);
- },
+ beforeDestroy() { if (this.nowTimeTimer) clearInterval(this.nowTimeTimer); },
methods: {
updateNowTime() {
const d = new Date(), p = n => n.toString().padStart(2, '0');
@@ -249,9 +188,7 @@
this.isGeneratingBarcode = false; this.lastGenerateTime = 0; this.generateRequestId = null;
},
resetGenerateState() {
- this.isGeneratingBarcode = false;
- this.generateRequestId = null;
- this.lastGenerateTime = 0;
+ this.isGeneratingBarcode = false; this.generateRequestId = null; this.lastGenerateTime = 0;
this.$showMessage("宸查噸缃潯鐮佺敓鎴愮姸鎬�");
},
refresh() {
@@ -259,9 +196,7 @@
url: "http://192.168.0.94:9095/Numerical/RefreshDev",
data: { machineNo: this.order.machineNo },
contentType: "application/json"
- }).then(r => {
- if (r.code == 200) this.fetchData(true); else this.$showMessage("鍚屾澶辫触");
- });
+ }).then(r => { r.code == 200 ? this.fetchData(true) : this.$showMessage("鍚屾澶辫触"); });
},
onDaa003Change(v) {
let o = this.lineList[this.DAA003List.indexOf(v)];
@@ -318,10 +253,11 @@
});
},
getXS0101() {
- this.$post({ url: "/MesStaff/GetAllXS0101" }).then(res => {
- this.staff = res.data.tbBillList;
- this.users = this.staff.map(s => s.staffNo + ":" + s.staffName);
- });
+ this.$post({ url: "/MesStaff/GetAllXS0101" })
+ .then(res => {
+ this.staff = res.data.tbBillList;
+ this.users = this.staff.map(s => s.staffNo + ":" + s.staffName);
+ });
},
getWomdaaPrintById() {
this.$post({ url: "/Womdaa/GetWomdaaPrintById", data: { orderId: this.orderId } })
@@ -343,7 +279,7 @@
init() {
try {
const v = this.getAndroidVersion();
- if (v >= 12) this.initForAndroid12Plus(); else this.initForAndroidLegacy();
+ v >= 12 ? this.initForAndroid12Plus() : this.initForAndroidLegacy();
} catch (e) { console.error(e); }
},
getAndroidVersion() {
@@ -389,16 +325,11 @@
this.isShow = false;
this.isGeneratingBarcode = false;
this.generateRequestId = null;
- this.bufferData = '';
- this.dataToPrint = [];
- this.staffNo = null;
- this.user = '';
- this.barcodeAmount = '';
- this.icount = 1;
- this.staff = null;
+ this.bufferData = ''; this.dataToPrint = [];
+ this.staffNo = null; this.user = ''; this.barcodeAmount = ''; this.icount = 1; this.staff = null;
}
}
- };
+ }
</script>
<style scoped>
@@ -511,25 +442,6 @@
padding: 6px 14px;
}
- .basic-info .form-row {
- display: flex;
- justify-content: space-between;
- margin: 4px 0 10px;
- }
-
- .form-item {
- width: 32%;
- }
-
- .inp {
- width: 100%;
- padding: 6px;
- font-size: 14px;
- border: 1px solid #808080;
- border-radius: 6px;
- box-sizing: border-box;
- }
-
.print-section {
padding: 4px 0 10px;
margin-bottom: 8px;
@@ -541,6 +453,23 @@
gap: 20px;
}
+ .inp {
+ padding: 6px;
+ font-size: 14px;
+ border: 1px solid #808080;
+ border-radius: 6px;
+ box-sizing: border-box;
+ }
+
+ .bad-input {
+ width: 55%;
+ height: 60px;
+ border: 3px solid #808080;
+ font-size: 32px;
+ text-align: center;
+ margin-top: 5px;
+ }
+
.details-btn {
padding: 10px 26px;
background: #00a2e9;
--
Gitblit v1.9.3