From 996dabcbdd36abc044a8d7ad665af24e58959426 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期五, 31 十月 2025 16:20:36 +0800
Subject: [PATCH] 界面优化
---
components/WorkOrderPrint.vue | 193 ++++++++++++++++++++++++------------------------
.vs/前端2/v17/.wsuo | 0
2 files changed, 97 insertions(+), 96 deletions(-)
diff --git "a/.vs/\345\211\215\347\253\2572/v17/.wsuo" "b/.vs/\345\211\215\347\253\2572/v17/.wsuo"
index 3d0b61f..42084c7 100644
--- "a/.vs/\345\211\215\347\253\2572/v17/.wsuo"
+++ "b/.vs/\345\211\215\347\253\2572/v17/.wsuo"
Binary files differ
diff --git a/components/WorkOrderPrint.vue b/components/WorkOrderPrint.vue
index 8cfcd57..30ba33a 100644
--- a/components/WorkOrderPrint.vue
+++ b/components/WorkOrderPrint.vue
@@ -88,6 +88,14 @@
</view>
<view class="flex-row gap-lg">
+ <!-- 褰撳墠鎶ュ伐浜洪儴鍒嗙Щ鍒板乏杈� -->
+ <view class="current-user-section fill-width">
+ <text>褰撳墠鎶ュ伐浜猴細</text>
+ <text class="current-user-name">{{ staffDisplay || '鏈�夋嫨' }}</text>
+ <button class="select-user-btn" @click="isShowUserSelect = true">閫変汉</button>
+ </view>
+
+ <!-- 涓嶈壇鏁伴噺閮ㄥ垎绉诲埌鍙宠竟 -->
<view class="print-section flex-grow">
<view class="barcode-info">
<view class="user-select">
@@ -98,12 +106,6 @@
<button class="details-btn" @click="confirmCustomAmount">纭鎻愪氦</button>
</view>
</view>
- </view>
-
- <view class="current-user-section fill-width">
- <text>褰撳墠鎶ュ伐浜猴細</text>
- <text class="current-user-name">{{ staffDisplay || '鏈�夋嫨' }}</text>
- <button class="select-user-btn" @click="isShowUserSelect = true">閫変汉</button>
</view>
</view>
@@ -149,7 +151,6 @@
<button class="save-btn" @click="save">淇濆瓨骞剁敓鏁�</button>
<button class="cancel-btn" @click="cancel">鍙栨秷</button>
</view>-->
-
<!-- 淇濈暀鏃у脊绐� -->
<view v-if="isShow" class="overlay">
<view class="popup">
@@ -217,41 +218,41 @@
}
},
computed: {
- //鑹搧鏁板疄鏃惰绠�
- realTimeDefectiveCount() {
- // 浼樺厛鐢ㄨ緭鍏ユ鐨勫�硷紝鍚﹀垯鐢ㄦ帴鍙f暟鎹�
- const val = Number(this.customAmount);
- if (!isNaN(val) && this.customAmount !== '') return val;
- return this.calculatedDefectiveCount;
- },
- realTimeOkCount() {
- // 鑹搧鏁� = 鎶ュ伐鏁帮紙璁$畻锛� - 涓嶈壇鏁�
- const total = (this.order.currentCjNum || 0) - (this.order.initCjNum || 0);
- return total - this.realTimeDefectiveCount;
- },
- calculatedCurrentCount() { return (this.productionCount || 0) - (this.initialValue || 0); },
- calculatedTotalProduction() { return (this.kgQty || 0); }, // 鑻ラ渶鎭㈠鏃ч�昏緫鍙敤 (this.kgQty||0)+this.calculatedCurrentCount
- calculatedDefectiveCount() { return this.calculatedTotalProduction - (this.sQuantity || 0); },
- planQtyDisplay() { return this.order.planQty || this.order.planQuantity || this.order.daa008 || 0; },
- staffDisplay() {
- if (!this.staffNo) return '';
- const segs = this.staffNo.split(':');
- return segs.length > 1 ? `${segs[0]} ${segs[1]}` : this.staffNo;
- },
- filteredUsers() {
- if (!this.userSearch) return this.users;
- const kw = this.userSearch.trim().toLowerCase();
- return this.users.filter(u => u.toLowerCase().includes(kw));
- }
- },
- created() {
- this.initializeData();
- this.fetchData(true);
- this.init();
- this.getXS0101();
- this.updateNowTime();
- // 绉掔骇鍒锋柊锛涘涓嶉渶鍔ㄦ�佽烦绉掑彲鏀逛负 60000
- this.nowTimeTimer = setInterval(this.updateNowTime, 1000);
+ //鑹搧鏁板疄鏃惰绠�
+ realTimeDefectiveCount() {
+ // 浼樺厛鐢ㄨ緭鍏ユ鐨勫�硷紝鍚﹀垯鐢ㄦ帴鍙f暟鎹�
+ const val = Number(this.customAmount);
+ if (!isNaN(val) && this.customAmount !== '') return val;
+ return this.calculatedDefectiveCount;
+ },
+ realTimeOkCount() {
+ // 鑹搧鏁� = 鎶ュ伐鏁帮紙璁$畻锛� - 涓嶈壇鏁�
+ const total = (this.order.currentCjNum || 0) - (this.order.initCjNum || 0);
+ return total - this.realTimeDefectiveCount;
+ },
+ calculatedCurrentCount() { return (this.productionCount || 0) - (this.initialValue || 0); },
+ calculatedTotalProduction() { return (this.kgQty || 0); }, // 鑻ラ渶鎭㈠鏃ч�昏緫鍙敤 (this.kgQty||0)+this.calculatedCurrentCount
+ calculatedDefectiveCount() { return this.calculatedTotalProduction - (this.sQuantity || 0); },
+ planQtyDisplay() { return this.order.planQty || this.order.planQuantity || this.order.daa008 || 0; },
+ staffDisplay() {
+ if (!this.staffNo) return '';
+ const segs = this.staffNo.split(':');
+ return segs.length > 1 ? `${segs[0]} ${segs[1]}` : this.staffNo;
+ },
+ filteredUsers() {
+ if (!this.userSearch) return this.users;
+ const kw = this.userSearch.trim().toLowerCase();
+ return this.users.filter(u => u.toLowerCase().includes(kw));
+ }
+ },
+ created() {
+ this.initializeData();
+ this.fetchData(true);
+ this.init();
+ this.getXS0101();
+ this.updateNowTime();
+ // 绉掔骇鍒锋柊锛涘涓嶉渶鍔ㄦ�佽烦绉掑彲鏀逛负 60000
+ this.nowTimeTimer = setInterval(this.updateNowTime, 1000);
},
beforeDestroy() { if (this.nowTimeTimer) clearInterval(this.nowTimeTimer); },
methods: {
@@ -261,28 +262,28 @@
return segs.length > 1 ? `${segs[0]} ${segs[1]}` : u;
},
selectUser(u) { this.staffNo = u; this.isShowUserSelect = false; this.userSearch = ''; },
- /* 淇敼锛氬鍔犵 */
- updateNowTime() {
- 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())}:${p(d.getSeconds())}`;
- },
- 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/RefreshDevBycl",
- data: { machineNo: this.order.machineNo },
- contentType: "application/json"
- }).then(r => { r.code == 200 ? this.fetchData(true) : this.$showMessage("鍚屾澶辫触"); });
- },
+ /* 淇敼锛氬鍔犵 */
+ updateNowTime() {
+ 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())}:${p(d.getSeconds())}`;
+ },
+ 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/RefreshDevBycl",
+ data: { machineNo: this.order.machineNo },
+ 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;
@@ -305,34 +306,34 @@
}
},
/* 鏂板锛氳幏鍙栧巻鍙叉姤宸ヨ褰� */
- /* 淇敼锛氳鑼冨巻鍙叉椂闂村埌绉� */
- getReportingHistory() {
- if (!this.orderNo) { this.reportingHistory = []; return; }
- const fmtSec = v => {
- if (!v) return '';
- // 鍏煎鍚庣鍙兘杩斿洖鐨勪笉鍚屾牸寮�
- const d = new Date(typeof v === 'string' ? v.replace(/-/g, '/') : v);
- if (isNaN(d.getTime())) return v; // 鏃犳硶瑙f瀽鍒欏師鏍疯繑鍥�
- const p = n => n.toString().padStart(2, '0');
- return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
- };
- this.$post({
- url: "/Womdaa/GetByBillNoBG",
- data: { billNo: this.orderNo, machineNo: this.machineNo || null }
+ /* 淇敼锛氳鑼冨巻鍙叉椂闂村埌绉� */
+ getReportingHistory() {
+ if (!this.orderNo) { this.reportingHistory = []; return; }
+ const fmtSec = v => {
+ if (!v) return '';
+ // 鍏煎鍚庣鍙兘杩斿洖鐨勪笉鍚屾牸寮�
+ const d = new Date(typeof v === 'string' ? v.replace(/-/g, '/') : v);
+ if (isNaN(d.getTime())) return v; // 鏃犳硶瑙f瀽鍒欏師鏍疯繑鍥�
+ const p = n => n.toString().padStart(2, '0');
+ return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
+ };
+ this.$post({
+ url: "/Womdaa/GetByBillNoBG",
+ data: { billNo: this.orderNo, machineNo: this.machineNo || null }
}).then(res => {
const list = res?.data?.tbBillList || res?.data || [];
this.reportingHistory = list.map(r => {
// 渚濇嵁浣犳暟鎹簱瀛楁鍋氭槧灏勶紙涓嬮潰瀛楁鍚嶆寜甯歌鍛藉悕涓句緥锛岄渶瑕佹寜瀹為檯鏀癸級
return {
- bgDate: r.bgDate || '', // 鎶ュ伐鏃堕棿
- staff: (r.staffNo ? (r.staffNo + ' ' + (r.staffName || '')) : (r.staffName || '')),//鎶ュ伐浜�
- orderNo: r.billNo,//宸ュ崟鍙�
- machineNo: r.machineNo ,//鏈哄彴鍙�
- initialValue: r.csQty ?? 0,//鍒濆閲囬泦鏁�
- productionCount: r.cjQty ?? 0,//鎶ュ伐鏃堕噰闆嗘暟
- totalProduction: (r.cjQty - r.csQty) ?? 0,//鎶ュ伐鏁帮紙璁$畻锛�
- BfQty: r.bfQty,//涓嶈壇鏁�
- OkQty: r.okQty//鑹搧鏁帮紙璁$畻锛�
+ bgDate: r.bgDate || '', // 鎶ュ伐鏃堕棿
+ staff: (r.staffNo ? (r.staffNo + ' ' + (r.staffName || '')) : (r.staffName || '')),//鎶ュ伐浜�
+ orderNo: r.billNo,//宸ュ崟鍙�
+ machineNo: r.machineNo,//鏈哄彴鍙�
+ initialValue: r.csQty ?? 0,//鍒濆閲囬泦鏁�
+ productionCount: r.cjQty ?? 0,//鎶ュ伐鏃堕噰闆嗘暟
+ totalProduction: (r.cjQty - r.csQty) ?? 0,//鎶ュ伐鏁帮紙璁$畻锛�
+ BfQty: r.bfQty,//涓嶈壇鏁�
+ OkQty: r.okQty//鑹搧鏁帮紙璁$畻锛�
}
});
}).catch(() => { this.reportingHistory = []; });
@@ -342,7 +343,7 @@
this.user = this.user === u ? null : u;
this.staffNo = this.user;
},
- //閫夋嫨鎶ュ伐浜�
+ //閫夋嫨鎶ュ伐浜�
confirmCustomAmount() {
if (!this.customAmount || isNaN(Number(this.customAmount))) { this.$showMessage('璇疯緭鍏ユ湁鏁堢殑鏁伴噺'); return; }
if (!this.staffNo) { this.$showMessage('璇烽�夋嫨鎶ュ伐浜�'); return; }
@@ -350,14 +351,14 @@
const amount = Number(this.customAmount);
this.$post({
url: "/MesInvItemBarcodes/AddBFToBarcodes",
- data: {
- orderNo: this.orderNo,
- orderId: this.orderId,
- bf: amount,
- staffNo: staffNo,
- initCjNum: this.order.initCjNum, // 鍒濆閲囬泦鏁�
- currentCjNum: this.order.currentCjNum // 鎶ュ伐鏃堕噰闆嗘暟
- }
+ data: {
+ orderNo: this.orderNo,
+ orderId: this.orderId,
+ bf: amount,
+ staffNo: staffNo,
+ initCjNum: this.order.initCjNum, // 鍒濆閲囬泦鏁�
+ currentCjNum: this.order.currentCjNum // 鎶ュ伐鏃堕噰闆嗘暟
+ }
}).then(res => {
if (res.status == 1) { this.$showMessage(res.message); return; }
this.$showMessage('鎶ュ簾鏁伴噺濉啓鎴愬姛');
--
Gitblit v1.9.3