From 1833dd6d7cac01c35840af52fadc1199821e5805 Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期四, 15 五月 2025 09:28:16 +0800
Subject: [PATCH] 提交优化项

---
 pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue |  627 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 320 insertions(+), 307 deletions(-)

diff --git a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue
index fe98829..31844e8 100644
--- a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue
+++ b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue
@@ -9,7 +9,8 @@
 
 			<uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext">
 				<uni-group top="1">
-					<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀姤淇熀鏈俊鎭�斺�斺�斺�斺�斺�斺�斺�斺��</view>
+					<view class="divider"><text>鎶ヤ慨鍩烘湰淇℃伅</text></view>
+					<!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀姤淇熀鏈俊鎭�斺�斺�斺�斺�斺�斺�斺�斺��</view> -->
 					<uni-forms-item :label-width="100" name="num" label="宸ュ崟鍙�:">
 						<uni-easyinput v-model="formData.repairCode" :disabled="true" />
 					</uni-forms-item>
@@ -28,22 +29,13 @@
 						<uni-easyinput v-model="formData.remark" :disabled="true" />
 					</uni-forms-item>
 					<uni-forms-item :label-width="100" name="outNum" label="鎶ヤ慨鍥剧墖:">
-						<view class="grid col-4 grid-square flex-sub">
-							<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage"
-								:data-url="imgList[index]">
-								<image :src="imgList[index]" mode="aspectFill"></image>
-								<view class="cu-tag bg-red radius" @tap.stop="DelImg" :data-index="index">
-									<text class='cuIcon-close'></text>
-								</view>
-							</view>
-							<view class="solids" v-if="imgList.length<1">
-								<text class='cuIcon-cameraadd'></text>
-							</view>
-						</view>
 
+						<uni-file-picker limit="9" :value="fileList" :image-styles="imageStyles" @select="select"
+						:sourceType="sourceType" @progress="progress" @success="success" @fail="fail" @delete="deletea"
+							:readonly="readonly" />
 					</uni-forms-item>
 
-					<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀槸鍚﹂渶瑕侀鐢ㄥ浠垛�斺�斺�斺�斺�斺�斺�斺�斺��</view>
+					<view class="divider"><text>鏄惁闇�瑕侀鐢ㄥ浠�</text></view>
 					<uni-forms-item :label-width="140" required name="num" label="鏄惁闇�瑕侀鐢ㄥ浠�:">
 						<uni-data-select v-model="formData.isSpare" :localdata="SpareList" @change="changeisSpareList"
 							placeholder="璇烽�夋嫨" :disabled="isUNDERREPAIR" />
@@ -58,26 +50,17 @@
 							:disabled="isUNDERREPAIR" />
 					</uni-forms-item>
 					<uni-forms-item v-show="isShow" :label-width="100" name="outNum" label="缁翠慨鍥剧墖:">
-						<view class="grid col-4 grid-square flex-sub">
-							<view class="bg-img" v-for="(item,index) in imgTwoList" :key="index" @tap="ViewImageTwo"
-								:data-url="imgTwoList[index]">
-								<image :src="imgTwoList[index]" mode="aspectFill"></image>
-								<view class="cu-tag bg-red radius" @tap.stop="DelImgTwo" :data-index="index">
-									<text class='cuIcon-close'></text>
-								</view>
-							</view>
-							<view class="solids" @tap="ChooseImageTwo" v-if="imgTwoList.length<1">
-								<text class='cuIcon-cameraadd'></text>
-							</view>
-						</view>
-
+						<uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select"
+						:sourceType="sourceType"	@progress="progress" @success="success" @fail="fail" @delete="deletea"
+							:readonly="readonlyRepaier" />
 					</uni-forms-item>
 				</uni-group>
 			</uni-forms>
 			<uni-forms v-show="isShowUNDEREPAIR" ref="form" :modelValue="ScanData" validate-trigger="bind"
 				err-show-type="undertext">
 				<uni-group top="1">
-					<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂鐞嗗憳棰嗙敤澶囦欢鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view>
+					<view class="divider"><text>绠$悊鍛橀鐢ㄥ浠�</text></view>
+					<!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂鐞嗗憳棰嗙敤澶囦欢鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> -->
 					<uni-forms-item :label-width="100" required name="sparePartDescription" label="澶囦欢鎻忚堪:">
 						<uni-easyinput type="textarea" v-model="ScanData.sparePartDescription" placeholder="璇疯緭鍏ュ浠舵弿杩�"
 							:disabled="isRuning" />
@@ -88,7 +71,8 @@
 			<uni-forms v-show="isShowRepari" ref="form" :modelValue="formData" validate-trigger="bind"
 				err-show-type="undertext">
 				<uni-group top="1">
-					<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂淮淇粨鏋滀笂鎶モ�斺�斺�斺�斺�斺�斺�斺�斺�斺��</view>
+					<view class="divider"><text>缁翠慨缁撴灉涓婃姤</text></view>
+					<!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂淮淇粨鏋滀笂鎶モ�斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> -->
 					<uni-forms-item :label-width="140" required name="faultReason" label="鏁呴殰鍘熷洜:">
 						<uni-easyinput v-model="formData.faultReason" placeholder="璇疯緭鍏ユ晠闅滃師鍥�" :disabled="isRepari" />
 					</uni-forms-item>
@@ -97,24 +81,13 @@
 							:disabled="isRepari" />
 					</uni-forms-item>
 					<uni-forms-item :label-width="100" name="outNum" label="缁翠慨鍥剧墖:">
-						<view class="grid col-4 grid-square flex-sub">
-							<view class="bg-img" v-for="(item,index) in imgThreeList" :key="index" @tap="ViewImageTwo"
-								:data-url="imgThreeList[index]">
-								<image :src="imgThreeList[index]" mode="aspectFill"></image>
-								<view class="cu-tag bg-red radius" @tap.stop="DelImgTwo" :data-index="index">
-									<text class='cuIcon-close'></text>
-								</view>
-							</view>
-							<view class="solids" @tap="ChooseImageThree" v-if="imgThreeList.length<1">
-								<text class='cuIcon-cameraadd'></text>
-							</view>
-						</view>
-
+						<uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select"
+						:sourceType="sourceType"	@progress="progress" @success="success" @fail="fail" @delete="deletea"
+							:readonly="readonlyRepaier" />
 					</uni-forms-item>
-
 				</uni-group>
 			</uni-forms>
-			<view  v-show="isSHowBtn" class="padding flex flex-direction">
+			<view v-show="isSHowBtn" class="padding flex flex-direction">
 				<view class="flex-sub bg-blue padding-sm margin-xl radius text-sm text-center text-white"
 					@click.stop="ProductionTask()" hover-class="is-hover">纭畾</view>
 			</view>
@@ -133,9 +106,20 @@
 		mixins: [MescrollMixin], // 浣跨敤mixin
 		data() {
 			return {
-				isSHowBtn:true,
+				readonly: false,
+				readonlyRepaier: false,
+				// 鍥剧墖鍥炴樉
+				fileLists: [],
+				fileList: [],
+				// 涓婁紶鍥剧墖鐨勬牱寮�
+				imageStyles: {
+					width: 90,
+					height: 90,
+				},
+				sourceType: ['album', 'camera'],
+				isSHowBtn: true,
 				isShowRepari: false,
-				title: '鏄惁闇�瑕侀鐢ㄥ浠�',
+				title: '',
 				isRepari: false,
 				isRuning: false,
 				isShowUNDEREPAIR: false,
@@ -179,8 +163,7 @@
 				url: {
 					upload: "/eam/sysFiles/batch_upload",
 					stallList: "/eam/eamRepairOrder/queryById",
-					getEquipmentList:'eam/equipment/list',
-					// getEquipmentList: "eam/equipment/asyncLoadEquipment",
+					getEquipmentList: 'eam/equipment/list',
 					approval: '/eam/eamRepairOrder/perform'
 				},
 				id: '',
@@ -208,7 +191,8 @@
 				msg1Title: "",
 				procInstId: '',
 				values: '',
-				isShow: true
+				isShow: true,
+				flag: ''
 
 			}
 		},
@@ -225,7 +209,8 @@
 		},
 		onLoad(options) {
 			const annItem = JSON.parse(decodeURIComponent(options.item));
-
+			this.flag = options.flag
+			console.log(this.flag)
 			this.id = annItem.dataId,
 				this.taskId = annItem.id,
 				this.procInstId = annItem.procInstId,
@@ -246,8 +231,54 @@
 					this.isShow = false;
 				}
 			},
+
+			select(e) {
+				const tempFilePaths = e.tempFilePaths;
+				uni.showLoading({
+					title: '涓婁紶涓�...'
+				});
+				const uploadPromises = tempFilePaths.map((filePath, index) => {
+					return new Promise((resolve, reject) => {
+						this.$http.upload(this.url.upload, {
+								filePath: filePath,
+								name: 'file'
+							})
+							.then(uploadRes => {
+								// 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰�
+								const serverFilePath = uploadRes.data.result[0];
+								this.formData.avatar.push(serverFilePath);
+								resolve(uploadRes); // 杩斿洖缁撴灉缁� Promise.all
+							})
+							.catch(err => {
+								console.error(`鍥剧墖 ${index + 1} 涓婁紶澶辫触:`, err);
+								reject(err);
+							});
+					});
+				});
+
+				Promise.all(uploadPromises)
+					.then(() => {
+						uni.hideLoading();
+						uni.showToast({
+							title: '鍏ㄩ儴涓婁紶鎴愬姛'
+						});
+					})
+					.catch(err => {
+						uni.hideLoading();
+						uni.showToast({
+							title: '閮ㄥ垎涓婁紶澶辫触',
+							icon: 'none'
+						});
+						console.error('涓婁紶寮傚父:', err);
+					});
+			},
+			// 鍒犻櫎
+			deletea(e) {
+				console.log('鍒犻櫎鍥剧墖', e);
+			},
 			ProductionTask() {
-				if (this.formData.reportStatus == 'WAIT_SPARES') {
+				console.log(this.formData.isSpare)
+				if (this.formData.reportStatus == 'WAIT_SPARES' && this.formData.isSpare == 1 && this.flag !== 'task') {
 					if (this.ScanData.sparePartDescription == undefined || this.ScanData.sparePartDescription == null ||
 						this
 						.ScanData.sparePartDescription ==
@@ -260,57 +291,112 @@
 						return false;
 					}
 				}
-				if (this.formData.reportStatus == 'UNDER_REPAIR') {
 
-					if (this.formData.faultReason == undefined || this.formData.faultReason == null ||
-						this
-						.formData.faultReason ==
-						'') {
 
-						uni.showToast({
-							icon: 'none',
-							title: '鏁呴殰鍘熷洜涓嶈兘涓虹┖'
-						});
-						return false;
-					}
-					if (this.formData.repairDescription == undefined || this.formData.repairDescription == null ||
-						this
-						.formData.repairDescription ==
-						'') {
+				// if (this.formData.reportStatus == 'UNDER_REPAIR' && this.formData.isSpare == 0 && this.flag !== 'task') {
+				// 	if (this.formData.faultReason == undefined || this.formData.faultReason == null ||
+				// 		this
+				// 		.formData.faultReason ==
+				// 		'') {
 
-						uni.showToast({
-							icon: 'none',
-							title: '缁翠慨缁撴灉涓嶈兘涓虹┖'
-						});
-						return false;
-					}
+				// 		uni.showToast({
+				// 			icon: 'none',
+				// 			title: '鏁呴殰鍘熷洜涓嶈兘涓虹┖'
+				// 		});
+				// 		return false;
+				// 	}
+				// 	if (this.formData.repairDescription == undefined || this.formData.repairDescription == null ||
+				// 		this
+				// 		.formData.repairDescription ==
+				// 		'') {
 
+				// 		uni.showToast({
+				// 			icon: 'none',
+				// 			title: '缁翠慨缁撴灉涓嶈兘涓虹┖'
+				// 		});
+				// 		return false;
+				// 	}
+
+				// }
+				// if (this.formData.reportStatus == 'UNDER_REPAIR' && this.formData.isSpare == 1 && this.flag !== 'task') {
+				// 	if (this.formData.faultReason == undefined || this.formData.faultReason == null ||
+				// 		this
+				// 		.formData.faultReason ==
+				// 		'') {
+
+				// 		uni.showToast({
+				// 			icon: 'none',
+				// 			title: '鏁呴殰鍘熷洜涓嶈兘涓虹┖'
+				// 		});
+				// 		return false;
+				// 	}
+				// 	if (this.formData.repairDescription == undefined || this.formData.repairDescription == null ||
+				// 		this
+				// 		.formData.repairDescription ==
+				// 		'') {
+
+				// 		uni.showToast({
+				// 			icon: 'none',
+				// 			title: '缁翠慨缁撴灉涓嶈兘涓虹┖'
+				// 		});
+				// 		return false;
+				// 	}
+
+				// }
+				if (this.formData.reportStatus == 'UNDER_REPAIR' && this.flag !== 'task') {
+				    if (this.formData.faultReason == undefined || this.formData.faultReason == null || this.formData.faultReason == '') {
+				        uni.showToast({
+				            icon: 'none',
+				            title: '鏁呴殰鍘熷洜涓嶈兘涓虹┖'
+				        });
+				        return false;
+				    }
+				    if (this.formData.repairDescription == undefined || this.formData.repairDescription == null || this.formData.repairDescription == '') {
+				        uni.showToast({
+				            icon: 'none',
+				            title: '缁翠慨缁撴灉涓嶈兘涓虹┖'
+				        });
+				        return false;
+				    }
 				}
 
+				if (this.formData.reportStatus == 'UNDER_REPAIR' && this.formData.isSpare == 1) {
 
+					if (this.formData.isSpare == undefined || this.formData.isSpare == null ||
+						this
+						.formData.isSpare ==
+						'') {
+
+						uni.showToast({
+							icon: 'none',
+							title: '鏄惁闇�瑕侀鐢ㄥ浠朵笉鑳戒负绌�'
+						});
+						return false;
+					}
+				}
+				uni.showLoading({
+					mask: true,
+					title: "鍔犺浇涓�....",
+				})
 				this.$http.post(this.url.approval, {
 					sparePartDescription: this.ScanData.sparePartDescription,
 					dataId: this.id,
 					equipmentId: this.formData.num,
 					faultReason: this.formData.faultReason,
 					id: this.id,
-					imageFilesResult: this.formData.avatarTwo,
+					imageFilesResult: this.formData.avatar,
 					instanceId: this.procInstId,
 					isUseSpare: this.formData.isSpare,
 					repairDescription: this.formData.repairDescription,
 					taskId: this.taskId
 				}).then(res => {
-					console.log(res)
-					this.$tip.loaded();
+					uni.hideLoading()
 					if (res.data.success) {
 						uni.showToast({
 							icon: "success",
 							title: '鎻愪氦鎴愬姛',
 							duration: 2000
 						});
-						// this.$Router.replace({
-						// 	name: 'ToDoList'
-						// })
 						this.$Router.replaceAll({
 							name: 'ToDoList'
 						})
@@ -338,11 +424,20 @@
 					this.partTakeAdviceDetailList[index].istrue = true;
 				}
 			},
+
 			getEquipment() {
-				this.$http.get(this.url.getEquipmentList).then(res => {
+				this.$http.get(this.url.getEquipmentList, {
+					params: {
+						pageNo: 1,
+						pageSize: 9999,
+						order: 'desc',
+						column: 'createTime'
+					},
+
+				}).then(res => {
 					//璁剧疆鍒楄〃鏁版嵁
 					if (res.data.success) {
-						this.equipmentList = res.data.result
+						this.equipmentList = res.data.result.records
 					} else {
 						uni.showToast({
 							icon: "error",
@@ -355,179 +450,8 @@
 					this.$tip.error("鑱旂綉澶辫触")
 				})
 			},
-			ChooseImageThree() {
-				var that = this;
-				uni.chooseImage({
-					count: 4,
-					sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈�
-					sourceType: ['album'], // 浠庣浉鍐岄�夋嫨
-					success: (res) => {
-						// 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰�
-						that.imgThreeList = res.tempFilePaths;
 
-						// 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓�
-						that.formData.avatarTwo = [];
 
-						// 鍒涘缓涓婁紶浠诲姟鐨� Promise 鏁扮粍
-						const uploadPromises = res.tempFilePaths.map((filePath, index) => {
-							return new Promise((resolve, reject) => {
-								that.$http.upload(that.url.upload, {
-										filePath: filePath,
-										name: 'file'
-									})
-									.then(uploadRes => {
-										// 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰�
-										const filePath = uploadRes.data.result[0];
-										this.formData.avatarTwo.push(filePath);
-										resolve(filePath);
-									})
-									.catch(err => {
-										console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err);
-										reject(err);
-									});
-							});
-						});
-
-						// 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔�
-						Promise.all(uploadPromises)
-							.then((uploadedFilePaths) => {
-								console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatar);
-							})
-							.catch((err) => {
-								console.error('鍥剧墖涓婁紶澶辫触:', err);
-								that.$tip.error('鍥剧墖涓婁紶澶辫触');
-							});
-					}
-				});
-			},
-			ChooseImage() {
-				var that = this;
-				uni.chooseImage({
-					count: 4,
-					sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈�
-					sourceType: ['album'], // 浠庣浉鍐岄�夋嫨
-					success: (res) => {
-						// 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰�
-						that.imgList = res.tempFilePaths;
-
-						// 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓�
-						that.formData.avatar = [];
-
-						// 鍒涘缓涓婁紶浠诲姟鐨� Promise 鏁扮粍
-						const uploadPromises = res.tempFilePaths.map((filePath, index) => {
-							return new Promise((resolve, reject) => {
-								that.$http.upload(that.url.upload, {
-										filePath: filePath,
-										name: 'file'
-									})
-									.then(uploadRes => {
-										// 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰�
-										const filePath = uploadRes.data.result[0];
-										this.formData.avatar.push(filePath);
-										resolve(filePath);
-									})
-									.catch(err => {
-										console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err);
-										reject(err);
-									});
-							});
-						});
-
-						// 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔�
-						Promise.all(uploadPromises)
-							.then((uploadedFilePaths) => {
-								console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatar);
-							})
-							.catch((err) => {
-								console.error('鍥剧墖涓婁紶澶辫触:', err);
-								that.$tip.error('鍥剧墖涓婁紶澶辫触');
-							});
-					}
-				});
-			},
-			ChooseImageTwo() {
-				var that = this;
-				uni.chooseImage({
-					count: 4,
-					sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈�
-					sourceType: ['album'], // 浠庣浉鍐岄�夋嫨
-					success: (res) => {
-						// 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰�
-						that.imgListTwo = res.tempFilePaths;
-
-						// 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓�
-						that.formData.avatarTwo = [];
-
-						// 鍒涘缓涓婁紶浠诲姟鐨� Promise 鏁扮粍
-						const uploadPromises = res.tempFilePaths.map((filePath, index) => {
-							return new Promise((resolve, reject) => {
-								that.$http.upload(that.url.upload, {
-										filePath: filePath,
-										name: 'file'
-									})
-									.then(uploadRes => {
-										const filePath = uploadRes.data.result[0];
-										this.formData.avatarTwo.push(filePath);
-										resolve(filePath);
-									})
-									.catch(err => {
-										console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err);
-										reject(err);
-									});
-							});
-						});
-
-						// 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔�
-						Promise.all(uploadPromises)
-							.then((uploadedFilePaths) => {
-								console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatarTwo);
-							})
-							.catch((err) => {
-								console.error('鍥剧墖涓婁紶澶辫触:', err);
-								that.$tip.error('鍥剧墖涓婁紶澶辫触');
-							});
-					}
-				});
-			},
-			ViewImageTwo(e) {
-				uni.previewImage({
-					urls: this.imgListTwo,
-					current: e.currentTarget.dataset.url
-				});
-			},
-
-			ViewImage(e) {
-				uni.previewImage({
-					urls: this.imgList,
-					current: e.currentTarget.dataset.url
-				});
-			},
-			DelImgTwo(e) {
-				uni.showModal({
-					title: '鎻愮ず',
-					content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�',
-					cancelText: '鍐嶇湅鐪�',
-					confirmText: '鍐嶈',
-					success: res => {
-						if (res.confirm) {
-							this.imgListTwo.splice(e.currentTarget.dataset.index, 1)
-						}
-					}
-				})
-			},
-			DelImg(e) {
-				uni.showModal({
-					title: '鎻愮ず',
-					content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�',
-					cancelText: '鍐嶇湅鐪�',
-					confirmText: '鍐嶈',
-					success: res => {
-						if (res.confirm) {
-							this.imgList.splice(e.currentTarget.dataset.index, 1)
-						}
-					}
-				})
-			},
 
 			upCallback() {
 				this.$http.get(this.url.stallList, {
@@ -541,51 +465,120 @@
 					//璁剧疆鍒楄〃鏁版嵁
 					if (res.data.success) {
 						this.formData.reportStatus = this.announcement1.reportStatus
-					
-						if (this.announcement1.reportStatus === 'WAIT_CONFIRM') {
-							this.title = '鎿嶄綔宸ョ‘璁�';
-							this.isUNDERREPAIR = true;
-						} else if (this.announcement1.reportStatus === 'WAIT_SPARES') {
-							this.title = '绠$悊鍛橀鐢ㄥ浠�';
-							this.isUNDERREPAIR = true;
-							this.isShowUNDEREPAIR = true;
 
-						} else if (this.announcement1.reportStatus === 'UNDER_REPAIR') {
-							if (this.announcement1.isUseSpare == 1) {
-								this.title = '缁翠慨缁撴灉涓婃姤';
-							} else {
-								this.title = '鏄惁闇�瑕侀鐢ㄥ浠�';
+						if (this.announcement1.reportStatus === 'WAIT_CONFIRM') {
+							if (this.flag == 'task') {
+								this.title = '缁翠慨鎵ц';
+								this.isUNDERREPAIR = true
+								this.readonly = true
+								this.isRuning = true
+								this.isSHowBtn=false
+								this.readonlyRepaier=true
+								this.isShowRepari = false
+							} else if (this.flag !== 'task') {
+								this.title = '鎿嶄綔宸ョ‘璁�';
+								this.isUNDERREPAIR = true
+								this.readonly = true
+								this.isRuning = true
+								this.isSHowBtn=true
+								this.readonlyRepaier=true
+								this.isShowRepari = false
 							}
 
-							this.isUNDERREPAIR = true;
-							this.isShowUNDEREPAIR = true;
-							this.isRuning = true;
-							this.isShowRepari = true;
-
-						}else if (this.announcement1.reportStatus === 'COMPLETE') {
-							if (this.announcement1.isUseSpare == 0) {
-								this.title = '绠$悊鍛橀鐢ㄥ浠�';
-								this.isShowRepari=false;
-								this.isSHowBtn=false;
-								this.isRepari;
+						} else if (this.announcement1.reportStatus === 'WAIT_SPARES') {
+							if (this.flag == 'task' && this.announcement1.isUseSpare == 1) {
+								this.title = '鏄惁闇�瑕侀鐢ㄥ浠�';
+								this.isShowUNDEREPAIR = false;
 								this.isUNDERREPAIR = true;
-								
+								this.readonly = true
+
+								this.isSHowBtn = false;
 							} else {
-								this.title = '鎿嶄綔宸ョ‘璁�';
+								this.title = '绠$悊鍛橀鐢ㄥ浠�';
+								this.readonly = true
 								this.isUNDERREPAIR = true;
 								this.isShowUNDEREPAIR = true;
-								this.isRuning=true;
-								this.isShowRepari=true;
-								this.isRepari=true;
-								this.isSHowBtn=false;
 							}
+
+
+						} else if (this.announcement1.reportStatus === 'UNDER_REPAIR') {
+							if (this.announcement1.isUseSpare == 1 && this.flag == 'task') {
+								this.title = '绠$悊鍛橀鐢ㄥ浠�';
+								this.isShowRepari = true;
+								this.readonlyRepaier = true
+								this.isShowUNDEREPAIR = true;
+								this.isUNDERREPAIR = true;
+								this.isRuning = true;
+								this.isRepari = true;
+								this.readonly = true
+								this.isSHowBtn = false;
+
+							} else if (this.announcement1.isUseSpare == 1 && this.flag !== 'task') {
+								this.title = '缁翠慨鎵ц'
+								this.isUNDERREPAIR = true
+								this.readonly = true
+								this.isShowUNDEREPAIR = true
+								this.isRuning = true
+								this.isShowRepari = true
+
+							} else {
+								this.title = '鏄惁闇�瑕侀鐢ㄥ浠�'
+								this.isSHowBtn = true
+								this.readonly = true
+							}
+						} else if (this.announcement1.reportStatus === 'COMPLETE') {
+							if (this.flag == 'task' && this.announcement1.isUseSpare == 0) {
+								this.title = '鎿嶄綔宸ョ‘璁�'
+								this.isUNDERREPAIR = true
+								this.isShowUNDEREPAIR = false
+								this.readonly = true
+								this.readonlyRepaier = true
+								this.isRuning = true
+								this.isShowRepari = false
+								this.isRepari = false
+								this.isSHowBtn = false
+							} else if (this.flag == 'task' && this.announcement1.isUseSpare == 1) {
+								this.title = '鎿嶄綔宸ョ‘璁�'
+								this.isUNDERREPAIR = true
+								this.isShowUNDEREPAIR = true
+								this.isRuning = true
+								this.readonlyRepaier=true
+								this.isShowRepari = true
+								this.isRepari = true
+								this.readonly = true
+								this.isSHowBtn = false;
+							}else if (this.flag !== 'task' && this.announcement1.isUseSpare == 0){
+								this.title = '缁翠慨鎵ц'
+								this.isUNDERREPAIR = true
+								this.readonlyRepaier=true
+								this.readonly = true
+								this.isRuning = true
 							
-							
-							
-							
-							
+							}
 
 						}
+						console.log(this.announcement1.reportImageFiles)
+						if (this.announcement1.reportImageFiles) {
+							try {
+								const parsedData = JSON.parse(this.announcement1.reportImageFiles);
+								this.imageFilesList = parsedData;
+								this.imgList = parsedData.map(imageObj => {
+									return `${this.ipAndPort}${imageObj.filePath}`;
+								});
+
+								this.fileList = this.imgList.map(url => ({
+									url: url,
+									extname: 'png',
+									name: 'eam'
+								}));
+							} catch (error) {
+								console.error('JSON 瑙f瀽澶辫触:', error);
+								this.imageFilesList = [];
+								this.imgList = [];
+								this.fileList = [];
+							}
+						}
+						console.log(this.fileLists)
 						this.formData.num = this.announcement1.equipmentId
 						this.formData.repairCode = this.announcement1.repairCode
 						this.formData.repairer = this.announcement1.repairer
@@ -600,29 +593,26 @@
 							this.isShow = true;
 						}
 						this.ScanData.sparePartDescription = this.announcement1.sparePartDescription
-						this.formData.avatar = this.announcement1.reportImageFiles
-						this.imageFilesList = JSON.parse(this.formData.avatar)
-						const imageObjects = JSON.parse(this.formData.avatar)
-						this.imgList = imageObjects.map(imageObj => {
-							return `${this.ipAndPort}${imageObj.filePath}`;
-						})
-						this.formData.avatarTwo = this.announcement1.imageFiles
-						this.imageAvatarTwo = JSON.parse(this.formData.avatarTwo)
-						const imageObjectTwo = JSON.parse(this.formData.avatarTwo)
-						if(this.formData.isSpare == 1){
-							this.imgThreeList = imageObjectTwo.map(imageObj => {
-								return `${this.ipAndPort}${imageObj.filePath}`;
-							})
-						}else{
-							this.imgTwoList = imageObjectTwo.map(imageObj => {
-								return `${this.ipAndPort}${imageObj.filePath}`;
-							})
+						if (this.announcement1.imageFiles) {
+							try {
+								const parsedDataIn = JSON.parse(this.announcement1.imageFiles);
+								this.imageAvatarTwo = parsedDataIn;
+								this.imgTwoList = parsedDataIn.map(imageObj => {
+									return `${this.ipAndPort}${imageObj.filePath}`;
+								});
+
+								this.fileLists = this.imgTwoList.map(url => ({
+									url: url,
+									extname: 'png',
+									name: 'eam'
+								}));
+							} catch (error) {
+								console.error('JSON 瑙f瀽澶辫触:', error);
+								this.imageAvatarTwo = [];
+								this.imgTwoList = [];
+								this.fileLists = [];
+							}
 						}
-						
-						
-						
-
-
 					}
 				}).catch(() => {
 					//鑱旂綉澶辫触, 缁撴潫鍔犺浇
@@ -686,7 +676,30 @@
 		border-color: #55aaff;
 	}
 
+	.divider {
+		display: flex;
+		align-items: center;
+		text-align: center;
+		color: gray;
+		/* 鏂囧瓧棰滆壊 */
+		margin: 20px 0;
+		/* 涓婁笅闂磋窛 */
+	}
 
+	.divider::before,
+	.divider::after {
+		content: '';
+		flex: 1;
+		border-bottom: 1px solid gray;
+		/* 妯嚎棰滆壊 */
+		margin: 0 16px;
+		/* 妯嚎涓庢枃瀛椾箣闂寸殑闂磋窛 */
+	}
+
+	.divider text {
+		white-space: nowrap;
+		/* 闃叉鏂囧瓧鎹㈣ */
+	}
 
 	.content {
 		margin-top: 5px;

--
Gitblit v1.9.3