From 2fda34643bc22e25f6c569415da5f955c81536bf Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期二, 03 六月 2025 09:37:08 +0800
Subject: [PATCH] 设备详情通过ID过滤/设备详情增加上传附件

---
 pages/reportRepair/reportRepairList/reportRepairList.vue |  249 +++++++++++++++++++++++--------------------------
 1 files changed, 119 insertions(+), 130 deletions(-)

diff --git a/pages/reportRepair/reportRepairList/reportRepairList.vue b/pages/reportRepair/reportRepairList/reportRepairList.vue
index ac4c155..090d5c3 100644
--- a/pages/reportRepair/reportRepairList/reportRepairList.vue
+++ b/pages/reportRepair/reportRepairList/reportRepairList.vue
@@ -3,6 +3,11 @@
 		<cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
 			<block slot="backText">杩斿洖</block>
 			<block slot="content">鎶ヤ慨</block>
+			<block slot="right">
+				<view @click="search">
+					<image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" />
+				</view>
+			</block>
 		</cu-custom>
 
 		<view style="width: 100%;">
@@ -11,8 +16,9 @@
 					<!-- 鍩虹琛ㄥ崟鏍¢獙 -->
 					<uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext">
 						<uni-group title="" top="0">
-							<uni-forms-item name="numbers" label="棰嗘枡鐢宠鍗曞彿:">
-								<uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ラ鏂欑敵璇峰崟鍙锋绱�" />
+							<uni-forms-item name="numbers" label="鎶ヤ慨鐘舵��:">
+								<uni-data-select v-model="formData.reportStatus" :localdata="reportStatusList"
+									@change="changetypeList" placeholder="璇烽�夋嫨鎶ヤ慨鐘舵��" />
 							</uni-forms-item>
 							<uni-forms-item name="name" label="棰嗘枡浜у搧:">
 								<uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" />
@@ -33,10 +39,10 @@
 				</view>
 			</uni-popup>
 		</view>
-		<view class="flex">
+		<view class="flex"  v-if="authIncludes('eam:reportRepair:add')">
 
 			<view
-				class="cuIcon-add flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center"
+				class="cuIcon-add radius     flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center"
 				@click="getAdd()">鏂板
 			</view>
 		</view>
@@ -49,7 +55,13 @@
 						<view class="flex">
 							<view class="flex-sub text-light bg-white padding-xs margin-xs radius">璁惧缂栧彿:</view>
 							<view class="flex-sub bg-white padding-xs margin-xs   text-bold  radius text-right">
-								{{item.equipmentId_dictText}}
+								{{item.equipmentCode}}
+							</view>
+						</view>
+						<view class="flex">
+							<view class="flex-sub text-light bg-white padding-xs margin-xs radius">璁惧鍚嶇О:</view>
+							<view class="flex-sub bg-white padding-xs margin-xs   text-bold  radius text-right">
+								{{item.equipmentName}}
 							</view>
 						</view>
 						<view class="flex">
@@ -70,7 +82,12 @@
 								{{item.breakdownFlag_dictText}}
 							</view>
 						</view>
-
+						<view class="flex">
+							<view class="flex-sub text-light bg-white padding-xs margin-xs radius">瀹夎浣嶇疆:</view>
+							<view class="flex-sub bg-white padding-xs margin-xs   text-blue   radius text-right">
+								{{item.installationPosition}}
+							</view>
+						</view>
 						<!-- <view class="flex">
 							<view class="flex-sub text-light bg-white  padding-xs margin-xs radius">鎿嶄綔:</view>
 							<view class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center"
@@ -91,16 +108,19 @@
 		mixins: [MescrollMixin], // 浣跨敤mixin
 		data() {
 			return {
+
 				type: 'top',
 				scrollLeft: 0,
 				formData: {
-					num: '',
-					partNumNameModel: ''
+					reportStatus: ''
+
 				},
+				reportStatusList: [],
 				NavBarColor: this.NavBarColor,
 				activeColor: '#5277A6',
 				url: {
-					stallList: "/eam/eamReportRepair/list"
+					stallList: "/eam/eamReportRepair/list",
+					flowType: "/sys/dict/getDictItems/report_repair_status",
 				},
 
 				upOption: {
@@ -125,10 +145,17 @@
 				announcement1: [],
 				msg1Count: 0,
 				msg2Count: 0,
-				msg1Title: ""
+				msg1Title: "",
+				equipmentId: ''
 			}
 		},
+		mounted() {
+			console.log('浠� store 鑾峰彇鐨� auth:', this.$store.getters.getAuth)
+		},
 		computed: {
+			authList() {
+				return this.$store.getters.getAuth || []
+			},
 			top() {
 				return this.CustomBar * 2 + 100
 			},
@@ -147,8 +174,48 @@
 			}
 		},
 
-		created() {},
+		onLoad: function(option) {
+			console.log(option)
+			let queryData = {};
+			try {
+				queryData = JSON.parse(option.query);
+			} catch (e) {
+				console.error('瑙f瀽 query 澶辫触', e);
+			}
+
+			const equipmentId = queryData.equipmentId;
+
+			console.log('璁惧ID:', equipmentId);
+
+			// 浣犲彲浠ュ湪杩欓噷缁х画浣跨敤 equipmentId 璇锋眰鏁版嵁鎴栬祴鍊肩粰 data
+			this.equipmentId = equipmentId;
+		},
+		created() {
+			this.getTypeList()
+		},
 		methods: {
+			authIncludes(code) {
+				return this.authList.some(auth => auth.action === code)
+			},
+
+			/**
+			 * 鎶ヤ慨鐘舵�佸垪琛ㄤ簨浠�
+			 */
+			getTypeList() {
+				this.$http.get(this.url.flowType).then(res => {
+					//璁剧疆鍒楄〃鏁版嵁
+					if (res.data.success) {
+						console.log(res)
+						this.reportStatusList = res.data.result
+					}
+				}).catch(() => {
+					//鑱旂綉澶辫触, 缁撴潫鍔犺浇
+				})
+
+			},
+			changetypeList(e) {
+				this.formData.reportStatus = e;
+			},
 			getAdd() {
 				uni.redirectTo({
 					url: '/pages/reportRepair/reportRepair'
@@ -178,8 +245,8 @@
 						pageNo: page.num,
 						pageSize: page.size,
 						order: 'asc',
-						column: 'createTime'
-
+						column: 'createTime',
+						equipmentId: this.equipmentId
 					},
 
 				}).then(res => {
@@ -200,9 +267,13 @@
 						this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹�
 					}
 
-				}).catch(() => {
+				}).catch((err) => {
 					//鑱旂綉澶辫触, 缁撴潫鍔犺浇
 					this.mescroll.endErr();
+					uni.showToast({
+						title: '缃戠粶寮傚父锛岃绋嶅悗鍐嶈瘯',
+						icon: 'none'
+					});
 				})
 
 			},
@@ -218,125 +289,43 @@
 			/* 妫�绱� */
 			getSera() {
 				this.$refs.popup.close();
-				let keyword = this.TabCur
 				this.msgList = [];
+				this.$http.get(this.url.stallList, {
+					params: {
+						pageNo: 1,
+						pageSize: 9999,
+						order: "desc",
+						column: "createTime",
+						reportStatus: this.formData.reportStatus
+					}
+				}).then(res => {
+					//鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��;
 
-				if (keyword == 0) {
-					this.$http.get(this.url.stallList, {
-						params: {
-							pageNo: 1,
-							pageSize: 999,
-							order: "desc",
-							column: "createTime",
-							num: '*' + this.formData.num + '*',
-							partNumNameModel: '*' + this.formData.partNumNameModel + '*',
-							status: 'published'
+					this.announcement1 = res.data.result.records
+					this.mescroll.endSuccess(this.announcement1.length);
+					console.log("url", res)
+					//璁剧疆鍒楄〃鏁版嵁
+					if (res.data.success) {
+						console.log("res", res.data)
+						this.msg1Count = res.data.result.total
+						this.msg1Title = "閫氱煡(" + res.data.result.total + ")";
+						for (let annItem of this.announcement1) {
+							this.msgList.push(annItem)
 						}
-					}).then(res => {
-						//鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��;
+					}
+					if (page.num == 1) {
+						this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃
+						this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹�
+					}
 
-						this.announcement1 = res.data.result.records
-						this.mescroll.endSuccess(this.announcement1.length);
-						console.log("url", res)
-						//璁剧疆鍒楄〃鏁版嵁
-						if (res.data.success) {
-							console.log("res", res.data)
-							this.msg1Count = res.data.result.total
-							this.msg1Title = "閫氱煡(" + res.data.result.total + ")";
-							for (let annItem of this.announcement1) {
-								this.msgList.push(annItem)
-							}
-						}
-						if (page.num == 1) {
-							this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃
-							this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹�
-						}
-
-					}).catch(() => {
-						//鑱旂綉澶辫触, 缁撴潫鍔犺浇
-						this.mescroll.endErr();
-					})
-
-				} else if (keyword == 1) {
-					this.$http.get(this.url.stallList, {
-						params: {
-							pageNo: 1,
-							pageSize: 999,
-							order: "desc",
-							column: "createTime",
-							status: 'training',
-							num: '*' + this.formData.num + '*',
-							partNumNameModel: '*' + this.formData.partNumNameModel + '*'
-
-						}
-					}).then(res => {
-						//鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��;
-
-						this.announcement1 = res.data.result.records
-						this.mescroll.endSuccess(this.announcement1.length);
-						console.log("url", res)
-						//璁剧疆鍒楄〃鏁版嵁
-						if (res.data.success) {
-							console.log("res", res.data)
-							this.msg1Count = res.data.result.total
-							this.msg2Title = "閫氱煡(" + res.data.result.total + ")";
-							for (let annItem of this.announcement1) {
-								this.msgList.push(annItem)
-							}
-						}
-						if (page.num == 1) {
-							this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃
-							this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹�
-						}
-
-					}).catch(() => {
-						//鑱旂綉澶辫触, 缁撴潫鍔犺浇
-						this.mescroll.endErr();
-					})
-
-				} else if (keyword == 2) {
-					this.$http.get(this.url.stallList, {
-						params: {
-							pageNo: 1,
-							pageSize: 999,
-							order: "desc",
-							column: "createTime",
-							status: 'completed',
-							num: '*' + this.formData.num + '*',
-							partNumNameModel: '*' + this.formData.partNumNameModel + '*'
-
-						}
-					}).then(res => {
-						//鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��;
-
-						this.announcement1 = res.data.result.records
-						this.mescroll.endSuccess(this.announcement1.length);
-						console.log("url", res)
-						//璁剧疆鍒楄〃鏁版嵁
-						if (res.data.success) {
-							console.log("res", res.data)
-							this.msg3Count = res.data.result.total
-							this.msg1Title = "閫氱煡(" + res.data.result.total + ")";
-							for (let annItem of this.announcement1) {
-								this.msgList.push(annItem)
-							}
-						}
-						if (page.num == 1) {
-							this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃
-							this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹�
-						}
-
-					}).catch(() => {
-						//鑱旂綉澶辫触, 缁撴潫鍔犺浇
-						this.mescroll.endErr();
-					})
-
-				}
-
-
-
-
-
+				}).catch((err) => {
+					//鑱旂綉澶辫触, 缁撴潫鍔犺浇
+					this.mescroll.endErr();
+					uni.showToast({
+						title: '缃戠粶寮傚父锛岃绋嶅悗鍐嶈瘯',
+						icon: 'none'
+					});
+				})
 			},
 
 
@@ -367,7 +356,7 @@
 	}
 
 	.popupView {
-		margin-top: 85px;
+		margin-top: 50px;
 		height: auto;
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3