From 90ca52cace1d8d1c5ef69b04a030b6a481880b09 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期三, 15 十月 2025 10:43:11 +0800
Subject: [PATCH] 界面优化
---
components/WorkOrderPrint.vue | 52 +++++++++++++++++++++++-----------------------------
1 files changed, 23 insertions(+), 29 deletions(-)
diff --git a/components/WorkOrderPrint.vue b/components/WorkOrderPrint.vue
index 84506b4..c3f02ac 100644
--- a/components/WorkOrderPrint.vue
+++ b/components/WorkOrderPrint.vue
@@ -24,7 +24,7 @@
<tbody>
<tr>
<td>{{ nowTime }}</td>
- <td>{{ staffNo || '-' }}</td>
+ <td>{{ staffDisplay || '-' }}</td>
<td>{{ orderNo || '-' }}</td>
<td>{{ order.daa003 || '-' }}</td>
<td>{{ planQtyDisplay }}</td>
@@ -69,7 +69,6 @@
</view>
</view>
- <!-- 宸茬Щ闄�: 浜у搧缂栫爜 / 浜у搧鍚嶇О / 浜у搧瑙勬牸 杈撳叆鍖哄煙 -->
<!-- 涓嶈壇鏁伴噺 -->
<view class="print-section" style="margin-top:10px;">
<view class="barcode-info">
@@ -85,23 +84,22 @@
</view>
<!-- 鎶ュ伐浜洪�夋嫨 -->
- <!-- 鏇挎崲鍘熸湁鎶ュ伐浜洪�夋嫨鍖哄煙 -->
<view class="current-user-section">
<text>褰撳墠鎶ュ伐浜猴細</text>
- <text class="current-user-name">{{ staffNo ? staffNo.split(':')[1] : '鏈�夋嫨' }}</text>
+ <text class="current-user-name">{{ staffDisplay || '鏈�夋嫨' }}</text>
<button class="select-user-btn" @click="isShowUserSelect = true">閫変汉</button>
</view>
<!-- 閫変汉寮圭獥 -->
<view v-if="isShowUserSelect" class="overlay">
<view class="popup user-select-popup">
- <!-- 婊氬姩鍖哄煙锛屾寜閽秴鍑烘椂鍙粴鍔� -->
<view class="user-list-scroll">
<view class="user-list-grid">
- <button v-for="(u, index) in users" :key="index"
+ <button v-for="(u, index) in users"
+ :key="index"
class="user-list-btn"
@click="selectUser(u)">
- {{ u.split(':')[1] }}
+ {{ formatUser(u) }}
</button>
</view>
</view>
@@ -128,7 +126,9 @@
<view class="reason-buttons">
<button v-for="(u,index) in users" :key="index"
:class="{'reason-btn':true,'selected': user===u}"
- @click="toggleUser(u)" v-text="u"></button>
+ @click="toggleUser(u)">
+ {{ formatUser(u) }}
+ </button>
</view>
</view>
</view>
@@ -182,7 +182,13 @@
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; }
+ planQtyDisplay() { return this.order.planQty || this.order.planQuantity || this.order.daa007 || this.order.daa010 || 0; },
+ // 缁熶竴鏄剧ず 鈥滃伐鍙� 濮撳悕鈥�
+ staffDisplay() {
+ if (!this.staffNo) return '';
+ const segs = this.staffNo.split(':');
+ return segs.length > 1 ? `${segs[0]} ${segs[1]}` : this.staffNo;
+ }
},
created() {
this.initializeData();
@@ -194,6 +200,12 @@
},
beforeDestroy() { if (this.nowTimeTimer) clearInterval(this.nowTimeTimer); },
methods: {
+ // 鏍煎紡鍖� 鈥滃伐鍙�:濮撳悕鈥� 涓� 鈥滃伐鍙� 濮撳悕鈥�
+ formatUser(u) {
+ if (!u) return '';
+ const segs = u.split(':');
+ return segs.length > 1 ? `${segs[0]} ${segs[1]}` : u;
+ },
// 閫夋嫨浜哄憳
selectUser(u) {
this.staffNo = u;
@@ -203,19 +215,16 @@
const d = new Date(), p = n => n.toString().padStart(2, '0');
this.nowTime = `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}`;
},
- // 鍒濆鍖栨暟鎹�
initializeData() {
this.productionCount = this.printedCount = this.defectiveCount = 0;
this.icount = 1; this.bqty = 0; this.sQuantity = 0; this.kgQty = 0;
this.initialValue = 0; this.qqty = 0;
this.isGeneratingBarcode = false; this.lastGenerateTime = 0; this.generateRequestId = null;
},
- // 閲嶇疆鏉$爜鐢熸垚鐘舵��
resetGenerateState() {
this.isGeneratingBarcode = false; this.generateRequestId = null; this.lastGenerateTime = 0;
this.$showMessage("宸查噸缃潯鐮佺敓鎴愮姸鎬�");
},
- // 鍒锋柊鏁版嵁
refresh() {
this.$sendPostRequest({
url: "http://192.168.0.94:9095/Numerical/RefreshDev",
@@ -223,7 +232,6 @@
contentType: "application/json"
}).then(r => { r.code == 200 ? this.fetchData(true) : this.$showMessage("鍚屾澶辫触"); });
},
- // 宸ュ崟鍒囨崲
onDaa003Change(v) {
let o = this.lineList[this.DAA003List.indexOf(v)];
this.orderId = o.id; this.orderNo = o.daa001;
@@ -232,7 +240,6 @@
uni.setStorageSync('orderNo', this.orderNo);
this.fetchData(false);
},
- // 鎷夊彇鏁版嵁
fetchData(flag) {
if (!this.orderId && !this.orderNo) return;
this.getOrderById();
@@ -245,13 +252,11 @@
});
}
},
- // 鏃у脊绐楅�変汉
toggleUser(u) {
if (!u) return;
this.user = this.user === u ? null : u;
this.staffNo = this.user;
},
- // 鎻愪氦涓嶈壇鏁伴噺
confirmCustomAmount() {
if (!this.customAmount || isNaN(Number(this.customAmount))) {
this.$showMessage('璇疯緭鍏ユ湁鏁堢殑鏁伴噺'); return;
@@ -267,14 +272,11 @@
this.customAmount = '';
}).catch(() => this.$showMessage('鎶ュ簾鏁伴噺濉啓澶辫触锛岃閲嶈瘯'));
},
- // 淇濆瓨
save() {
if (!this.staffNo) { this.$showMessage('璇烽�夋嫨鎶ュ伐浜�'); return; }
uni.showToast({ title: '淇濆瓨鎴愬姛', icon: 'success' });
},
- // 鍙栨秷
cancel() { uni.showToast({ title: '鍙栨秷鎿嶄綔', icon: 'none' }); },
- // 鑾峰彇宸ュ崟淇℃伅
getOrderById() {
this.$post({ url: "/Womdaa/GetWomdaaById", data: { orderId: this.orderId, orderNo: this.orderNo } })
.then(res => {
@@ -284,7 +286,6 @@
this.productionCount = this.order.todayOutput || 0;
});
},
- // 鑾峰彇鎵�鏈夊憳宸�
getXS0101() {
this.$post({ url: "/MesStaff/GetAllXS0101" })
.then(res => {
@@ -292,7 +293,6 @@
this.users = this.staff.map(s => s.staffNo + ":" + s.staffName);
});
},
- // 鑾峰彇宸ュ崟鎵撳嵃淇℃伅
getWomdaaPrintById() {
this.$post({ url: "/Womdaa/GetWomdaaPrintById", data: { orderId: this.orderId } })
.then(res => {
@@ -307,11 +307,9 @@
if (this.bqty === 0) this.Completed();
}).catch(() => { });
},
- // 宸ュ崟瀹屾垚
Completed() {
this.$post({ url: "/MesOrderSta/Completed", data: { orderId: this.orderId, orderNo: this.orderNo } });
},
- // 钃濈墮鍒濆鍖�
init() {
try {
const v = this.getAndroidVersion();
@@ -357,7 +355,6 @@
}
} catch (e) { }
},
- // 鍏抽棴寮圭獥骞堕噸缃�
deleteBarcode() {
this.isShow = false;
this.isGeneratingBarcode = false;
@@ -377,11 +374,10 @@
box-sizing: border-box;
}
- /* 寮圭獥鍑虹幇鏃朵粎绂佺敤搴曞眰鏅�氬唴瀹癸紝涓嶇鐢ㄥ脊绐楁湰韬� */
.page.has-overlay .status-section > :not(.overlay) {
pointer-events: none;
}
- /* 纭繚寮圭獥缁х画鍙氦浜� */
+
.page.has-overlay .status-section > .overlay {
pointer-events: auto;
}
@@ -569,7 +565,6 @@
border-radius: 8px;
}
- /* 鍏抽敭: 寮圭獥灞傜骇 */
.overlay {
position: fixed;
top: 0;
@@ -594,7 +589,7 @@
max-height: 80vh;
overflow-y: auto;
border-radius: 8px;
- z-index: 1001; /* 楂樹簬 overlay 鑳屾櫙灞� */
+ z-index: 1001;
}
.clean-btn {
@@ -642,7 +637,6 @@
margin-left: 8px;
}
- /* 閫変汉寮圭獥鏁翠綋甯冨眬锛屽唴瀹瑰尯婊氬姩锛屽簳閮ㄦ寜閽浐瀹� */
.user-select-popup {
width: 480px;
max-width: 96vw;
--
Gitblit v1.9.3