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/maintenanceReport/maintenanceReport.vue |   79 +++++++++++++++++++--------------------
 1 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/pages/maintenanceReport/maintenanceReport.vue b/pages/maintenanceReport/maintenanceReport.vue
index 6508047..28d3333 100644
--- a/pages/maintenanceReport/maintenanceReport.vue
+++ b/pages/maintenanceReport/maintenanceReport.vue
@@ -39,8 +39,8 @@
 				<view class="content">
 					<uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index"
 						@click="onClickProductionTask(item)">
-						
-						
+
+
 						<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">
@@ -59,11 +59,12 @@
 								{{item.faultStartTime}}
 							</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"
+							<view v-if="authIncludes('eam:repair:collect')"
+								class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center"
 								@click.stop="handleStartWork(item)" hover-class="is-hover">棰嗗彇</view>
 
 						</view>
@@ -91,7 +92,7 @@
 				activeColor: '#5277A6',
 				url: {
 					stallList: "/eam/eamReportRepair/list",
-					add:'/eam/eamRepairOrder/add'
+					add: '/eam/eamRepairOrder/add'
 				},
 
 				upOption: {
@@ -116,10 +117,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 + 50
 			},
@@ -132,57 +140,47 @@
 		},
 
 
+
+
 		onShow() {
 			if (this.mescroll) {
 				this.mescroll.resetUpScroll()
 			}
 		},
-
+		onLoad: function(options) {
+			this.equipmentId = options.equipmentId ?
+				decodeURIComponent(options.equipmentId) :
+				'';
+		},
 		created() {},
 		methods: {
-
+			/**
+			 * @param {Object} code鎸夐挳鏉冮檺
+			 */
+			authIncludes(code) {
+				return this.authList.some(auth => auth.action === code)
+			},
 			/**
 			 * 棰嗗彇
 			 */
 			handleStartWork(item) {
-			
-				this.$tip.loading();
+
+				uni.showLoading({
+					mask: true,
+					title: "鍔犺浇涓�....",
+				})
 				this.$http.post(this.url.add, {
-					
-							 actualEndTime: item.actualEndTime,
-							  actualStartTime: item.actualStartTime,
-							  createBy: item.actualStartTime,
-							  createTime: item.createTime,
-							  delFlag: item.delFlag,
-							  equipmentId:item.equipmentId,
-							  equipmentName: item.equipmentName,
-							  faultReason:item.faultReason,
-							  id: item.faultReason,
-							  imageFiles:item.imageFiles,
-							  imageFilesResult:null,
-							  outsourcedEndTime:item.outsourcedEndTime,
-							  outsourcedFlag:item.outsourcedFlag,
-							  outsourcedPerson: item.outsourcedPerson,
-							  outsourcedRepairDescription:item.outsourcedRepairDescription,
-							  outsourcedStartTime:item.outsourcedStartTime,
-							  repairCode:item.repairCode,
-							  repairDescription:item.repairDescription,
-							  repairStatus:item.repairStatus,
-							  repairer:item.repairer,
-							  reportId:item.id,
-							  updateBy:item.updateBy,
-							  updateTime: item.updateTime
-					
+					reportId: item.id,
 				}).then(res => {
 					console.log(res)
-					this.$tip.loaded();
+					uni.hideLoading()
 					if (res.data.success) {
 						uni.showToast({
 							icon: "success",
 							title: '棰嗗彇鎴愬姛',
 							duration: 2000
 						});
-						this.mescroll.resetUpScroll()
+						this.mescroll.resetUpScroll();
 					} else {
 						uni.showModal({
 							title: "鎻愮ず",
@@ -205,11 +203,11 @@
 			 * 璇︽儏椤甸潰
 			 */
 			onClickProductionTask(item) {
-			
+
 				uni.navigateTo({
 					url: '/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils?item=' +
 						encodeURIComponent(JSON.stringify(item))
-			
+
 				})
 			},
 
@@ -225,7 +223,8 @@
 						pageSize: page.size,
 						order: 'desc',
 						column: 'createTime',
-						repairStatus: 'WAIT_REPAIR'
+						reportStatus: 'WAIT_REPAIR',
+						equipmentId: this.equipmentId || ''
 					},
 
 				}).then(res => {

--
Gitblit v1.9.3