From 0c8f85d16c97a8fd4ba381dce13ea9f0b051e6c1 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期三, 03 十二月 2025 15:26:56 +0800
Subject: [PATCH] 只更新第一行 currentCjNum

---
 pages/index.vue |  180 ++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 97 insertions(+), 83 deletions(-)

diff --git a/pages/index.vue b/pages/index.vue
index 63d1fbb..9726dc4 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -38,27 +38,24 @@
 		<scroll-view class="content">
 			<view v-if="currentTab === 7" class="tab-content">
 				<view class="content">
-					<view class="top-right">
+					<!--<view class="top-right">
 						<button class="refresh-btn" @click="refresh">鍒锋柊</button>
-					</view>
+					</view>-->
 					<view>
 						<h4>涓�鍙版満鍙板彧鑳介�夋嫨涓�鏉″伐鍗曪紙澶氶�夐粯璁や负鏈�鍚庝竴鏉★級</h4>
 					</view>
 					<view class="section top-section">
-						<!--鏄剧ず褰撳墠鏈哄彴-->
-						<view class="form-row">
-							<view>
-								<input v-model="machineName"
-									   disabled="true"
-									   type="text"
-									   class="machine-name-box" />
-							</view>
-						</view>
-
-						<view class="form-row">
-							<view>
-								<label style="float: left;font-family: fantasy;font-size: 33px;margin-top: 20px;">绗竴姝ラ�夋嫨宸ュ崟:</label>
+						<view class="form-row align-row">
+							<input v-model="machineName"
+								   disabled="true"
+								   type="text"
+								   class="machine-name-box" />
+							<view class="form-group">
+								<label class="order-label">绗竴姝ラ�夋嫨宸ュ崟:</label>
 								<button class="print-btn" @click="isShowTab">閫夋嫨宸ュ崟</button>
+							</view>
+							<view class="top-right">
+								<button class="refresh-btn" @click="refresh">鍒锋柊</button>
 							</view>
 						</view>
 					</view>
@@ -106,8 +103,7 @@
 									<input class="form-input" disabled="true" type="text" v-model="item.daa008" /><!--娲惧伐鏁伴噺-->
 								</uni-td>
 								<!--<uni-td align="center">
-								<input class="form-input" disabled="true" type="text" v-model="item.daa008" />-->
-								<!--宸ュ崟鏁伴噺-->
+									<input class="form-input" disabled="true" type="text" v-model="item.daa008" />--><!--宸ュ崟鏁伴噺-->
 								<!--</uni-td>-->
 								<uni-td align="center">
 									<input class="form-input" disabled="true" type="text" v-model="item.daa018" /><!--宸ュ崟鐘舵��-->
@@ -190,16 +186,11 @@
 
 				<div style="height: 400px; overflow: auto;">
 					<table>
+
 						<view class="section card">
-							<uni-table ref="table"
-									   type="selection"
-									   border
-									   stripe
-									   emptyText="鏆傛棤鏇村鏁版嵁"
-									   class="large-selection-table"
-									   @selection-change="selectionChange">
+							<uni-table ref="table" type="selection" border stripe emptyText="鏆傛棤鏇村鏁版嵁"
+									   class="large-selection-table" @selection-change="selectionChange">
 								<uni-tr>
-									<uni-th type="selection" align="center" class="th" style="width: 70px;"></uni-th> <!-- 鏂板閫夋嫨鍒� -->
 									<uni-th align="center" class="th" style="color: #FFFFFF; width: 170px;">宸ュ簭</uni-th>
 									<uni-th align="center" class="th" style="color: #FFFFFF; width: 490px;">宸ュ崟鍙�</uni-th>
 									<uni-th align="center" class="th" style="color: #FFFFFF; width: 250px;">浜у搧缂栫爜</uni-th>
@@ -214,42 +205,42 @@
 									<!--<uni-th align="center" class="th" style="color: #FFFFFF; width: 100px;">閫夋嫨</uni-th>-->
 								</uni-tr>
 								<uni-tr v-for="(item, index) in tableData"
-										:key="item.id || index"  <!-- 淇敼: 浼樺厛浣跨敤鍚庣 id -->
+										:key="index"
 										:class="{'row-selected': selectedIndexs.includes(index)}"
 										@click="onRowClick(index)"
 										style="cursor: pointer;">
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.procName" /><!--宸ュ簭-->
+										<input class="form-input" disabled="true" type="text" v-model="item.procName" /><!--宸ュ簭-->
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.daa001" />
+										<input class="form-input" disabled="true" type="text" v-model="item.daa001" />
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.daa002" />
+										<input class="form-input" disabled="true" type="text" v-model="item.daa002" />
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.daa003" /><!--浜у搧鍚嶇О-->
+										<input class="form-input" disabled="true" type="text" v-model="item.daa003" /><!--浜у搧鍚嶇О-->
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.daa004" /><!--瑙勬牸-->
+										<input class="form-input" disabled="true" type="text" v-model="item.daa004" /><!--瑙勬牸-->
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.daa011" /><!--宸茬敓浜ф暟閲�-->
+										<input class="form-input" disabled="true" type="text" v-model="item.daa011" /><!--宸茬敓浜ф暟閲�-->
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" :value="(item.daa008 || 0) - (item.daa011 || 0)" /><!--鏈敓浜ф暟閲�-->
+										<input class="form-input" disabled="true" type="text" :value="(item.daa008 || 0) - (item.daa011 || 0)" /><!--鏈敓浜ф暟閲�-->
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.daa008" /><!--娲惧伐鏁伴噺-->
+										<input class="form-input" disabled="true" type="text" v-model="item.daa008" /><!--娲惧伐鏁伴噺-->
 									</uni-td>
 									<!--<uni-td align="center">
 										<input class="form-input" disabled="true" type="text" v-model="item.daa008" />--><!--宸ュ崟鏁伴噺-->
 									<!--</uni-td>-->
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.daa018" /><!--宸ュ崟鐘舵��-->
+										<input class="form-input" disabled="true" type="text" v-model="item.daa018" /><!--宸ュ崟鐘舵��-->
 									</uni-td>
 									<uni-td align="center">
-										<input class="form-input row-input" disabled="true" type="text" v-model="item.staffName" /><!--鎶ュ伐浜�-->
+										<input class="form-input" disabled="true" type="text" v-model="item.staffName" /><!--鎶ュ伐浜�-->
 									</uni-td>
 								</uni-tr>
 							</uni-table>
@@ -350,16 +341,10 @@
 			this.refresh();
 		},
 		methods: {
-            onRowClick(index) { // 淇敼: 鏁磋鐐瑰嚮瀹炵幇鍗曢��
-                const row = this.tableData[index];
-                if (!row) return;
-                // 鍗曢��: 鍙繚鐣欏綋鍓嶇储寮�
-                this.selectedIndexs = [index]; // 淇濈暀宸叉湁娉ㄩ噴閫昏緫
-                // 濡傛灉 uni-table 鏆撮湶鏂规硶鍒欏悓姝ュ閫夋鐘舵��
-                if (this.$refs.table) {
-                    this.$refs.table.clearSelection && this.$refs.table.clearSelection();
-                    this.$refs.table.toggleRowSelection && this.$refs.table.toggleRowSelection(row, true);
-                }
+            onRowClick(index) {
+                this.selectedIndexs = [index]; // 鍗曢��
+                // 鎵嬪姩瑙﹀彂 selectionChange 浠ュ悓姝ュ閫夋
+                this.selectionChange({ detail: { index } });
             },
 			checkForUpdate() {
 				this.$post({
@@ -613,25 +598,10 @@
 				let day = String(date.getDate()).padStart(2, '0'); // 鑾峰彇鏃ユ湡骞惰ˉ闆�
 				return `${year}-${month}-${day}`; // 杩斿洖鏍煎紡鍖栧悗鐨勫瓧绗︿覆
 			},
-            selectionChange(e) { // 淇敼: 浣跨敤 selection 鏁扮粍鑰屼笉鏄� index
-                // 鍗曢�夌洿鎺ヨ祴鍊硷紙淇濈暀鍘熸敞閲婏級
-                const selection = e.detail && e.detail.selection ? e.detail.selection : [];
-                if (selection.length === 0) {
-                    this.selectedIndexs = [];
-                    return;
-                }
-                // 澶氶�夋椂鍙繚鐣欐渶鍚庝竴涓紙淇濈暀鍘熲�滃閫夐粯璁や负鏈�鍚庝竴鏉♀�濋�昏緫锛�
-                const last = selection[selection.length - 1];
-                const idx = this.tableData.findIndex(r => (r.id || r.daa001) === (last.id || last.daa001));
-                this.selectedIndexs = idx >= 0 ? [idx] : [];
-                // 寮哄埗鍙嬀閫夋渶鍚庝竴涓紙闃叉澶氶�夋畫鐣欙級
-                if (selection.length > 1 && this.$refs.table) {
-                    this.$nextTick(() => {
-                        this.$refs.table.clearSelection && this.$refs.table.clearSelection();
-                        this.$refs.table.toggleRowSelection && this.$refs.table.toggleRowSelection(last, true);
-                    });
-                }
-            },
+			selectionChange(e) {
+                // 鍗曢�夌洿鎺ヨ祴鍊�
+                this.selectedIndexs = [e.detail.index];
+			},
 
 			selectedItems() {
 				return this.selectedIndexs.map(i => this.tableData[i])
@@ -780,10 +750,6 @@
 </script>
 
 <style lang="scss">
-
-	/* 杩藉姞琛屽唴杈撳叆涓嶆嫤鎴偣鍑� */
-.row-input { pointer-events: none; } /* 鏂板: 閬垮厤 input 鎶㈠崰鐐瑰嚮 */
-
 
     :deep(.checkbox),
     :deep(.checkbox__inner) {
@@ -1041,17 +1007,18 @@
 		cursor: pointer;
 	}
 
-	.overlay {
-		position: fixed;
-		top: 0;
-		left: 0;
-		width: 100%;
-		height: 100%;
-		background-color: rgba(0, 0, 0, 0.5);
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	}
+    .overlay {
+        position: fixed;
+        top: 0;
+        left: 0;
+        width: 100%;
+        height: 100%;
+        background-color: rgba(0, 0, 0, 0.5);
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        z-index: 2000; // 澧炲姞z-index锛岀‘淇濆脊绐楀湪鍒锋柊鎸夐挳涔嬩笂
+    }
 
     .popup {
         background-color: #fff;
@@ -1077,13 +1044,13 @@
 	}
 
     .machine-name-box {
-        border: 2px solid #e53935; /* 绾㈣壊杈规 */
+        border: 2px solid #007aff; /* 钃濊壊杈规 */
         border-radius: 8px;
         font-family: fantasy;
         font-size: 33px;
         margin-top: 20px;
-        padding: 15px 48px; /* 涓婁笅20px锛屽乏鍙�48px锛屽鍔犲唴杈硅窛 */
-        width: 500px; /* 鏇村锛屼繚璇佸唴瀹瑰畬鏁存樉绀� */
+        padding: 15px 28px; /* 涓婁笅20px锛屽乏鍙�48px锛屽鍔犲唴杈硅窛 */
+        width: 300px; /* 鏇村锛屼繚璇佸唴瀹瑰畬鏁存樉绀� */
         height: 70px; /* 澧炲姞楂樺害 */
         box-sizing: border-box;
         background: #fff;
@@ -1151,6 +1118,53 @@
         display: block;
     }
 
+    .top-section {
+        position: relative;
+        display: flex;
+        flex-direction: column;
+        margin-bottom: 20px;
+        padding: 20px 10px;
+    }
+
+    .form-row.align-row {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        position: relative;
+        width: 100%;
+    }
+
+    .machine-name-box {
+        flex: 1 1 45%;
+        margin-right: 20px;
+    }
+
+    .form-group {
+        display: flex;
+        align-items: center;
+        flex: 1 1 45%;
+        justify-content: flex-start;
+    }
+
+    .order-label {
+        font-family: fantasy;
+        font-size: 33px;
+        margin-top: 20px;
+        margin-right: 10px;
+        float: none;
+    }
+
+    .print-btn {
+        margin-top: 20px;
+    }
+
+    .top-right {
+        position: absolute;
+        top: -30px; // 寰�涓婄Щ
+        right: 0;
+        z-index: 1000;
+    }
+
 /* 鏀惧ぇ琛ㄥご鍜岃〃鏍煎唴瀹瑰瓧浣� */
     .th,
     .uni-th,

--
Gitblit v1.9.3