From 8fa09262479b1c33bbce6bc11ecc25442068fd9f Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期三, 03 十二月 2025 16:56:30 +0800
Subject: [PATCH] 历史报工记录添加一个向下的滑条

---
 components/EquipmentInspection.vue |  500 ++++++++++++++++++++++++++++++-------------------------
 1 files changed, 274 insertions(+), 226 deletions(-)

diff --git a/components/EquipmentInspection.vue b/components/EquipmentInspection.vue
index 7770ebf..acdeceb 100644
--- a/components/EquipmentInspection.vue
+++ b/components/EquipmentInspection.vue
@@ -1,6 +1,7 @@
 <template>
 	<view class="inspection-page">
 		<!-- 椤堕儴鏍囬鍜屾満鍙颁俊鎭� -->
+	    <!--璁惧鐐规-->
 		<view class="header">
 			<view class="title-row">
 				<text class="page-title">璁惧鐐规琛�</text>
@@ -12,8 +13,8 @@
 				</view>
 				<view class="info-item">
 					<text class="info-label">鏃ユ湡锛�</text>
-					<picker mode="date" :value="currentDate" @change="handleDateChange">
-						<view class="date-picker">{{ currentDate }}</view>
+					<picker mode="date" fields="month" :value="currentDate" @change="handleDateChange">
+						<view class="date-picker">{{ displayDate }}</view>
 					</picker>
 				</view>
 			</view>
@@ -70,7 +71,7 @@
 					:loading="saving"
 					:disabled="saving || !machineNo"
 					@click="handleSave">
-				淇濆瓨
+				鎻愪氦
 			</button>
 			<button class="btn-clear"
 					:disabled="saving"
@@ -117,6 +118,14 @@
 			dirty: false
 		}
 	},
+	computed: {
+		displayDate() {
+			// 鏍煎紡鍖栨樉绀轰负 "2025骞�11鏈�"
+			if (!this.currentDate) return ''
+			const [year, month] = this.currentDate.split('-')
+			return `${year}骞�${month}鏈坄
+		}
+	},
 	created() {
 		this.initChecks()
 	},
@@ -152,14 +161,34 @@
 					date: this.currentDate
 				}, { mock: true, showLoading: true })
 
-				if (record && record.dailyChecks) {
-					this.dailyChecks = record.dailyChecks
+				// 楠岃瘉骞惰缃棩甯哥偣妫�鏁版嵁
+				if (record && Array.isArray(record.dailyChecks) && record.dailyChecks.length === 6) {
+					// 纭繚姣忎釜瀛愭暟缁勯兘鏄湁鏁堢殑鏁扮粍
+					const isValid = record.dailyChecks.every(arr => Array.isArray(arr) && arr.length === 31)
+					if (isValid) {
+						// 浣跨敤 $set 纭繚 Vue 鑳藉妫�娴嬪埌宓屽鏁扮粍鐨勫彉鍖�
+						this.$set(this, 'dailyChecks', record.dailyChecks.map(arr => [...arr]))
+					} else {
+						console.warn('鏃ュ父鐐规鏁版嵁鏍煎紡涓嶆纭紝浣跨敤榛樿鍊�')
+						this.$set(this, 'dailyChecks', this.dailyItems.map(() => Array(31).fill(false)))
+					}
 				} else {
-					this.initChecks()
+					this.$set(this, 'dailyChecks', this.dailyItems.map(() => Array(31).fill(false)))
 				}
 
-				if (record && record.monthlyChecks) {
-					this.monthlyChecks = record.monthlyChecks
+				// 楠岃瘉骞惰缃湀搴︾偣妫�鏁版嵁
+				if (record && Array.isArray(record.monthlyChecks) && record.monthlyChecks.length === 2) {
+					// 纭繚姣忎釜瀛愭暟缁勯兘鏄湁鏁堢殑鏁扮粍
+					const isValid = record.monthlyChecks.every(arr => Array.isArray(arr) && arr.length === 31)
+					if (isValid) {
+						// 浣跨敤 $set 纭繚 Vue 鑳藉妫�娴嬪埌宓屽鏁扮粍鐨勫彉鍖�
+						this.$set(this, 'monthlyChecks', record.monthlyChecks.map(arr => [...arr]))
+					} else {
+						console.warn('鏈堝害鐐规鏁版嵁鏍煎紡涓嶆纭紝浣跨敤榛樿鍊�')
+						this.$set(this, 'monthlyChecks', this.monthlyItems.map(() => Array(31).fill(false)))
+					}
+				} else {
+					this.$set(this, 'monthlyChecks', this.monthlyItems.map(() => Array(31).fill(false)))
 				}
 
 				this.dirty = false
@@ -178,8 +207,20 @@
 			}
 
 			if (type === 'daily') {
+				// 瀹夊叏妫�鏌ワ細纭繚鏁扮粍鍜岀储寮曟湁鏁�
+				if (!Array.isArray(this.dailyChecks) || !Array.isArray(this.dailyChecks[itemIdx])) {
+					console.error('鏃ュ父鐐规鏁版嵁缁撴瀯寮傚父锛岄噸鏂板垵濮嬪寲')
+					this.initChecks()
+					return
+				}
 				this.$set(this.dailyChecks[itemIdx], dayIdx, !this.dailyChecks[itemIdx][dayIdx])
 			} else {
+				// 瀹夊叏妫�鏌ワ細纭繚鏁扮粍鍜岀储寮曟湁鏁�
+				if (!Array.isArray(this.monthlyChecks) || !Array.isArray(this.monthlyChecks[itemIdx])) {
+					console.error('鏈堝害鐐规鏁版嵁缁撴瀯寮傚父锛岄噸鏂板垵濮嬪寲')
+					this.initChecks()
+					return
+				}
 				this.$set(this.monthlyChecks[itemIdx], dayIdx, !this.monthlyChecks[itemIdx][dayIdx])
 			}
 			this.dirty = true
@@ -223,263 +264,270 @@
 </script>
 
 <style scoped>
-.inspection-page {
-	display: flex;
-	flex-direction: column;
-	padding: 10px;
-	font-size: 14px;
-	color: #333;
-	background: #f5f5f5;
-	height: 100%;
-	overflow: hidden;
-}
+    .inspection-page {
+        display: flex;
+        flex-direction: column;
+        padding: 10px;
+        font-size: 18px; /* 鍘�14px锛屾暣浣撴彁鍗� */
+        color: #333;
+        background: #f5f5f5;
+        height: 100%;
+        overflow: hidden;
+    }
 
-.header {
-	background: #fff;
-	border-radius: 8px;
-	padding: 12px 16px;
-	margin-bottom: 10px;
-	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
-}
+    .header {
+        background: #fff;
+        border-radius: 8px;
+        padding: 12px 16px;
+        margin-bottom: 10px;
+        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
+    }
 
-.title-row {
-	text-align: center;
-	margin-bottom: 8px;
-}
+    .title-row {
+        text-align: center;
+        margin-bottom: 8px;
+    }
 
-.page-title {
-	font-size: 20px;
-	font-weight: bold;
-	color: #333;
-}
+    .page-title {
+        font-size: 28px; /* 鍘�20px */
+        font-weight: bold;
+        color: #333;
+    }
 
-.info-row {
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-	gap: 20px;
-}
+    .info-row {
+        display: flex;
+        justify-content: flex-start;
+        align-items: center;
+        gap: 60px;
+    }
 
-.info-item {
-	display: flex;
-	align-items: center;
-	gap: 8px;
-}
+    .info-item {
+        display: flex;
+        align-items: center;
+        gap: 8px;
+    }
 
-.info-label {
-	font-size: 14px;
-	color: #666;
-}
+    .info-label {
+        font-size: 18px; /* 鍘�14px */
+        color: #666;
+    }
 
-.info-value {
-	font-size: 14px;
-	font-weight: 600;
-	color: #333;
-}
+    .info-value {
+        font-size: 18px; /* 鍘�14px */
+        font-weight: 600;
+        color: #333;
+    }
 
-.date-picker {
-	padding: 4px 12px;
-	background: #f0f0f0;
-	border-radius: 4px;
-	font-size: 14px;
-	cursor: pointer;
-	min-width: 100px;
-	text-align: center;
-}
+    .date-picker {
+        padding: 4px 12px;
+        background: #f0f0f0;
+        border-radius: 4px;
+        font-size: 18px; /* 鍘�14px */
+        cursor: pointer;
+        min-width: 100px;
+        text-align: center;
+    }
 
-.table-container {
-	flex: 1;
-	overflow: auto;
-	background: #fff;
-	border-radius: 8px;
-	padding: 8px;
-	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
-}
+    .table-container {
+        flex: 1;
+        overflow: auto;
+        background: #fff;
+        border-radius: 8px;
+        padding: 8px;
+        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
+    }
 
-.inspection-table {
-	width: 100%;
-	border-collapse: collapse;
-	font-size: 12px;
-	min-width: 1400px;
-}
+    .inspection-table {
+        width: 100%;
+        border-collapse: collapse;
+        font-size: 16px; /* 鍘�12px */
+        min-width: 1400px;
+    }
 
-.inspection-table th,
-.inspection-table td {
-	border: 1px solid #666;
-	padding: 4px 6px;
-	text-align: center;
-	white-space: nowrap;
-}
+        .inspection-table th,
+        .inspection-table td {
+            border: 1px solid #666;
+            padding: 6px 10px; /* 鍘�4px 6px */
+            text-align: center;
+            white-space: nowrap;
+        }
 
-.inspection-table thead {
-	background: #e8e8e8;
-	position: sticky;
-	top: 0;
-	z-index: 10;
-}
+        .inspection-table thead {
+            background: #e8e8e8;
+            position: sticky;
+            top: 0;
+            z-index: 10;
+        }
 
-.inspection-table th {
-	font-weight: bold;
-	font-size: 13px;
-	background: #e8e8e8;
-}
+        .inspection-table th {
+            font-weight: bold;
+            font-size: 18px; /* 鍘�13px */
+            background: #e8e8e8;
+        }
 
-.col-category {
-	min-width: 80px;
-	width: 80px;
-}
+    .col-category {
+        min-width: 80px;
+        width: 80px;
+    }
 
-.col-item {
-	min-width: 180px;
-	width: 180px;
-	text-align: left;
-}
+    .col-item {
+        min-width: 180px;
+        width: 180px;
+        text-align: left;
+    }
 
-.col-cycle {
-	min-width: 50px;
-	width: 50px;
-}
+    .col-cycle {
+        min-width: 50px;
+        width: 50px;
+    }
 
-.col-days {
-	background: #d0d0d0;
-}
+    .col-days {
+        background: #d0d0d0;
+    }
 
-.day-header {
-	width: 30px;
-	min-width: 30px;
-	font-size: 11px;
-	padding: 2px;
-}
+    .day-header {
+        width: 36px; /* 鍘�30px */
+        min-width: 36px;
+        font-size: 15px; /* 鍘�11px */
+        padding: 4px;
+    }
 
-.category-cell {
-	background: #f5f5f5;
-	font-weight: bold;
-	vertical-align: middle;
-}
+    .category-cell {
+        background: #f5f5f5;
+        font-weight: bold;
+        vertical-align: middle;
+    }
 
-.item-cell {
-	text-align: left;
-	padding-left: 8px;
-	font-size: 12px;
-}
+    .item-cell {
+        text-align: left;
+        padding-left: 12px; /* 鍘�8px */
+        font-size: 16px; /* 鍘�12px */
+    }
 
-.cycle-cell {
-	font-size: 16px;
-	color: #333;
-}
+    .cycle-cell {
+        font-size: 20px; /* 鍘�16px */
+        color: #333;
+    }
 
-.check-cell {
-	width: 30px;
-	min-width: 30px;
-	height: 28px;
-	cursor: pointer;
-	background: #fff;
-	transition: background 0.2s;
-	font-size: 18px;
-	color: #0faeff;
-}
+    .check-cell {
+        width: 36px; /* 鍘�30px */
+        min-width: 36px;
+        height: 32px; /* 鍘�28px */
+        cursor: pointer;
+        background: #fff;
+        transition: background 0.2s;
+        font-size: 22px; /* 鍘�18px */
+        color: #0faeff;
+    }
 
-.check-cell:hover {
-	background: #f0f8ff;
-}
+        .check-cell:hover {
+            background: #f0f8ff;
+        }
 
-.check-cell.checked {
-	background: #e6f7ff;
-}
+        .check-cell.checked {
+            background: #e6f7ff;
+        }
 
-.actions {
-	display: flex;
-	justify-content: center;
-	gap: 16px;
-	margin-top: 10px;
-	padding: 10px 0;
-}
+    .actions {
+        display: flex;
+        justify-content: center;
+        gap: 24px; /* 鍘�16px */
+        margin-top: 10px;
+        padding: 10px 0;
+    }
 
-.btn-save,
-.btn-clear {
-	min-width: 120px;
-	padding: 10px 24px;
-	font-size: 16px;
-	border-radius: 6px;
-	border: none;
-	cursor: pointer;
-	transition: all 0.2s;
-}
+    .btn-save,
+    .btn-clear {
+        min-width: 140px; /* 鍘�120px */
+        padding: 14px 32px; /* 鍘�10px 24px */
+        font-size: 20px; /* 鍘�16px */
+        border-radius: 6px;
+        border: none;
+        cursor: pointer;
+        transition: all 0.2s;
+    }
 
-.btn-save {
-	background: #00a2e9;
-	color: #fff;
-}
+    .btn-save {
+        background: #00a2e9;
+        color: #fff;
+    }
 
-.btn-save:hover {
-	background: #0086c0;
-}
+        .btn-save:hover {
+            background: #0086c0;
+        }
 
-.btn-save:disabled {
-	background: #ccc;
-	cursor: not-allowed;
-}
+        .btn-save:disabled {
+            background: #ccc;
+            cursor: not-allowed;
+        }
 
-.btn-clear {
-	background: #fff;
-	color: #333;
-	border: 1px solid #d0d0d0;
-}
+    .btn-clear {
+        background: #fff;
+        color: #333;
+        border: 1px solid #d0d0d0;
+    }
 
-.btn-clear:hover {
-	background: #f5f5f5;
-}
+        .btn-clear:hover {
+            background: #f5f5f5;
+        }
 
-/* 閽堝1280*717灞忓箷浼樺寲 */
-@media screen and (max-width: 1280px) and (max-height: 800px) {
-	.inspection-page {
-		padding: 6px;
-	}
+    /* 閽堝1280*717灞忓箷浼樺寲 */
+    @media screen and (max-width: 1280px) and (max-height: 800px) {
+        .inspection-page {
+            padding: 6px;
+            font-size: 15px;
+        }
 
-	.header {
-		padding: 8px 12px;
-		margin-bottom: 6px;
-	}
+        .header {
+            padding: 8px 12px;
+            margin-bottom: 6px;
+        }
 
-	.page-title {
-		font-size: 18px;
-	}
+        .page-title {
+            font-size: 22px;
+        }
 
-	.inspection-table {
-		font-size: 11px;
-	}
+        .info-label,
+        .info-value,
+        .date-picker {
+            font-size: 15px;
+        }
 
-	.inspection-table th {
-		font-size: 12px;
-		padding: 3px 4px;
-	}
+        .inspection-table {
+            font-size: 13px;
+        }
 
-	.inspection-table td {
-		padding: 3px 4px;
-	}
+            .inspection-table th {
+                font-size: 15px;
+                padding: 4px 6px;
+            }
 
-	.day-header {
-		width: 26px;
-		min-width: 26px;
-		font-size: 10px;
-	}
+            .inspection-table td {
+                padding: 4px 6px;
+            }
 
-	.check-cell {
-		width: 26px;
-		min-width: 26px;
-		height: 24px;
-		font-size: 16px;
-	}
+        .day-header {
+            width: 28px;
+            min-width: 28px;
+            font-size: 12px;
+        }
 
-	.item-cell {
-		font-size: 11px;
-	}
+        .check-cell {
+            width: 28px;
+            min-width: 28px;
+            height: 24px;
+            font-size: 16px;
+        }
 
-	.btn-save,
-	.btn-clear {
-		min-width: 100px;
-		padding: 8px 20px;
-		font-size: 14px;
-	}
-}
+        .item-cell {
+            font-size: 13px;
+        }
+
+        .btn-save,
+        .btn-clear {
+            min-width: 110px;
+            padding: 10px 20px;
+            font-size: 16px;
+        }
+    }
 </style>

--
Gitblit v1.9.3