From 0a48655d2162b709ecb80d249a4085971add6140 Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期一, 07 七月 2025 17:26:30 +0800
Subject: [PATCH] 企业微信

---
 pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue |  207 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 134 insertions(+), 73 deletions(-)

diff --git a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue
index 951b926..82b9e97 100644
--- a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue
+++ b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue
@@ -11,19 +11,36 @@
 				<uni-group top="1">
 					<view class="divider"><text>鎶ヤ慨鍩烘湰淇℃伅</text></view>
 					<!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀姤淇熀鏈俊鎭�斺�斺�斺�斺�斺�斺�斺�斺��</view> -->
-					<uni-forms-item :label-width="100" name="num" label="宸ュ崟鍙�:">
+					<uni-forms-item :label-width="100" name="repairCode" label="宸ュ崟鍙�:">
 						<uni-easyinput v-model="formData.repairCode" :disabled="true" />
 					</uni-forms-item>
-					<uni-forms-item :label-width="100" required name="num" label="璁惧缂栧彿:">
+					<uni-forms-item :label-width="100" name="repairStatus_dictText" label="宸ュ崟鐘舵��:">
+						<uni-easyinput v-model="formData.repairStatus_dictText" :disabled="true" />
+					</uni-forms-item>
+					<uni-forms-item :label-width="100" name="num" label="璁惧缂栧彿:">
 						<uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList"
 							placeholder="璇烽�夋嫨" :disabled="true" />
 					</uni-forms-item>
-
+					<uni-forms-item :label-width="100" name="installationPosition_dictText" label="瀹夎浣嶇疆:">
+						<uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" />
+					</uni-forms-item>
+					<uni-forms-item :label-width="100" name="faultName" label="鏁呴殰绠�绉�:">
+						<uni-easyinput v-model="formData.faultName" :disabled="true" />
+					</uni-forms-item>
 					<uni-forms-item :label-width="100" name="remark" label="鏁呴殰寮�濮嬫椂闂�:">
 						<uni-easyinput v-model="formData.faultStartTime" :disabled="true" />
 					</uni-forms-item>
-					<uni-forms-item :label-width="100" name="outNum" label="缁翠慨璐熻矗浜�:">
-						<uni-easyinput v-model="formData.repairer" :disabled="true" />
+					<uni-forms-item :label-width="100" name="reporter_dictText" label="鎶ヤ慨浜�:">
+						<uni-easyinput v-model="formData.reporter_dictText" :disabled="true" />
+					</uni-forms-item>
+					<uni-forms-item :label-width="100" name="reporterPhone_dictText" label="鎶ヤ慨浜虹數璇�:">
+						<uni-easyinput v-model="formData.reporterPhone_dictText" :disabled="true" />
+					</uni-forms-item>
+					<uni-forms-item :label-width="100" name="repairer_dictText" label="缁翠慨浜�:">
+						<uni-easyinput v-model="formData.repairer_dictText" :disabled="true" />
+					</uni-forms-item>
+					<uni-forms-item :label-width="100" name="repairerPhone_dictText" label="缁翠慨浜虹數璇�:">
+						<uni-easyinput v-model="formData.repairerPhone_dictText" :disabled="true" />
 					</uni-forms-item>
 					<uni-forms-item :label-width="100" name="remark" label="澶囨敞:">
 						<uni-easyinput v-model="formData.remark" :disabled="true" />
@@ -31,8 +48,8 @@
 					<uni-forms-item :label-width="100" name="outNum" label="鎶ヤ慨鍥剧墖:">
 
 						<uni-file-picker limit="9" :value="fileList" :image-styles="imageStyles" @select="select"
-						:sourceType="sourceType" @progress="progress" @success="success" @fail="fail" @delete="deletea"
-							:readonly="readonly" />
+							:sourceType="sourceType" @progress="progress" @success="success" @fail="fail"
+							@delete="deletea" :readonly="readonly" />
 					</uni-forms-item>
 
 					<view class="divider"><text>鏄惁闇�瑕侀鐢ㄥ浠�</text></view>
@@ -51,8 +68,8 @@
 					</uni-forms-item>
 					<uni-forms-item v-show="isShow" :label-width="100" name="outNum" label="缁翠慨鍥剧墖:">
 						<uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select"
-						:sourceType="sourceType"	@progress="progress" @success="success" @fail="fail" @delete="deletea"
-							:readonly="readonlyRepaier" />
+							:sourceType="sourceType" @progress="progress" @success="success" @fail="fail"
+							@delete="deletea" :readonly="readonlyRepaier" />
 					</uni-forms-item>
 				</uni-group>
 			</uni-forms>
@@ -63,7 +80,7 @@
 					<!-- <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"/>
+							:disabled="isRuning" />
 					</uni-forms-item>
 
 				</uni-group>
@@ -82,8 +99,8 @@
 					</uni-forms-item>
 					<uni-forms-item :label-width="100" name="outNum" label="缁翠慨鍥剧墖:">
 						<uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select"
-						:sourceType="sourceType"	@progress="progress" @success="success" @fail="fail" @delete="deletea"
-							:readonly="readonlyRepaier" />
+							:sourceType="sourceType" @progress="progress" @success="success" @fail="fail"
+							@delete="deletea" :readonly="readonlyRepaier" />
 					</uni-forms-item>
 				</uni-group>
 			</uni-forms>
@@ -192,7 +209,9 @@
 				procInstId: '',
 				values: '',
 				isShow: true,
-				flag: ''
+				flag: '',
+				from: '',
+				todoName: ''
 
 			}
 		},
@@ -210,12 +229,22 @@
 		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,
-				this.values = annItem.values,
-				this.assignee = annItem.assignee
+			this.from = options.from
+			if (this.flag == 'task') {
+				this.todoName = annItem.taskName
+			} else {
+				this.todoName = annItem.name
+			}
+			if (this.from === 'detils') {
+				this.id = annItem.id;
+				console.log(annItem.id);
+			} else {
+				this.id = annItem.dataId;
+			}
+			this.taskId = annItem.id
+			this.procInstId = annItem.procInstId
+			this.values = annItem.values
+			this.assignee = annItem.assignee
 		},
 		created() {
 			this.getEquipment();
@@ -277,40 +306,6 @@
 				console.log('鍒犻櫎鍥剧墖', e);
 			},
 			ProductionTask() {
-				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 ==
-						'') {
-
-						uni.showToast({
-							icon: 'none',
-							title: '澶囦欢鎻忚堪涓嶈兘涓虹┖'
-						});
-						return false;
-					}
-				}
-
-
-				
-				if (this.formData.reportStatus == 'UNDER_REPAIR' && this.flag !== 'task' && this.formData.isSpare == 0) {
-				    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 ||
@@ -325,6 +320,49 @@
 						return false;
 					}
 				}
+
+
+				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 ==
+						'') {
+
+						uni.showToast({
+							icon: 'none',
+							title: '澶囦欢鎻忚堪涓嶈兘涓虹┖'
+						});
+						return false;
+					}
+				}
+
+
+
+				if (
+					this.formData.reportStatus === 'UNDER_REPAIR' &&
+					this.flag !== 'task' &&
+					(this.formData.isSpare === 0 || this.ScanData.sparePartDescription?.trim())
+				) {
+					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;
+					}
+				}
+
+
 				uni.showLoading({
 					mask: true,
 					title: "鍔犺浇涓�....",
@@ -350,6 +388,14 @@
 						});
 						this.$Router.replaceAll({
 							name: 'ToDoList'
+						})
+					} else {
+
+						uni.showModal({
+							title: "鎻愮ず",
+							content: res.data.message,
+							confirmText: '纭畾',
+							showCancel: false,
 						})
 					}
 				}).catch(() => {
@@ -416,36 +462,36 @@
 					//璁剧疆鍒楄〃鏁版嵁
 					if (res.data.success) {
 						this.formData.reportStatus = this.announcement1.reportStatus
-
+						this.title = this.todoName ?? '璇︽儏';
 						if (this.announcement1.reportStatus === 'WAIT_CONFIRM') {
 							if (this.flag == 'task') {
-								this.title = '缁翠慨鎵ц';
+								// this.title = '缁翠慨鎵ц';
 								this.isUNDERREPAIR = true
 								this.readonly = true
 								this.isRuning = true
-								this.isSHowBtn=false
-								this.readonlyRepaier=true
+								this.isSHowBtn = false
+								this.readonlyRepaier = true
 								this.isShowRepari = false
 							} else if (this.flag !== 'task') {
-								this.title = '鎿嶄綔宸ョ‘璁�';
+								// this.title = '鎿嶄綔宸ョ‘璁�';
 								this.isUNDERREPAIR = true
 								this.readonly = true
 								this.isRuning = true
-								this.isSHowBtn=true
-								this.readonlyRepaier=true
+								this.isSHowBtn = true
+								this.readonlyRepaier = true
 								this.isShowRepari = false
 							}
 
 						} else if (this.announcement1.reportStatus === 'WAIT_SPARES') {
 							if (this.flag == 'task' && this.announcement1.isUseSpare == 1) {
-								this.title = '鏄惁闇�瑕侀鐢ㄥ浠�';
+								// 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;
@@ -454,7 +500,7 @@
 
 						} else if (this.announcement1.reportStatus === 'UNDER_REPAIR') {
 							if (this.announcement1.isUseSpare == 1 && this.flag == 'task') {
-								this.title = '绠$悊鍛橀鐢ㄥ浠�';
+								// this.title = '绠$悊鍛橀鐢ㄥ浠�';
 								this.isShowRepari = true;
 								this.readonlyRepaier = true
 								this.isShowUNDEREPAIR = true;
@@ -465,21 +511,29 @@
 								this.isSHowBtn = false;
 
 							} else if (this.announcement1.isUseSpare == 1 && this.flag !== 'task') {
-								this.title = '缁翠慨鎵ц'
+								// this.title = '缁翠慨鎵ц'
 								this.isUNDERREPAIR = true
 								this.readonly = true
 								this.isShowUNDEREPAIR = true
 								this.isRuning = true
 								this.isShowRepari = true
 
+							} else if (this.announcement1.isUseSpare == 0 && this.flag == 'task') {
+								this.readonlyRepaier = true
+								this.isUNDERREPAIR = true;
+								this.isRuning = true;
+								this.isRepari = true;
+								this.readonly = true
+								this.isSHowBtn = false;
+
 							} else {
-								this.title = '鏄惁闇�瑕侀鐢ㄥ浠�'
+								// 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.title = '鎿嶄綔宸ョ‘璁�'
 								this.isUNDERREPAIR = true
 								this.isShowUNDEREPAIR = false
 								this.readonly = true
@@ -489,22 +543,22 @@
 								this.isRepari = false
 								this.isSHowBtn = false
 							} else if (this.flag == 'task' && this.announcement1.isUseSpare == 1) {
-								this.title = '鎿嶄綔宸ョ‘璁�'
+								// this.title = '鎿嶄綔宸ョ‘璁�'
 								this.isUNDERREPAIR = true
 								this.isShowUNDEREPAIR = true
 								this.isRuning = true
-								this.readonlyRepaier=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 = '缁翠慨鎵ц'
+							} else if (this.flag !== 'task' && this.announcement1.isUseSpare == 0) {
+								// this.title = '缁翠慨鎵ц'
 								this.isUNDERREPAIR = true
-								this.readonlyRepaier=true
+								this.readonlyRepaier = true
 								this.readonly = true
 								this.isRuning = true
-							
+
 							}
 
 						}
@@ -531,8 +585,15 @@
 						}
 						console.log(this.fileLists)
 						this.formData.num = this.announcement1.equipmentId
+						this.formData.repairStatus_dictText = this.announcement1.repairStatus_dictText
 						this.formData.repairCode = this.announcement1.repairCode
-						this.formData.repairer = this.announcement1.repairer
+						this.formData.installationPosition_dictText = this.announcement1
+							.installationPosition_dictText
+						this.formData.faultName = this.announcement1.faultName
+						this.formData.repairer_dictText = this.announcement1.repairer_dictText
+						this.formData.repairerPhone_dictText = this.announcement1.repairerPhone_dictText
+						this.formData.reporter_dictText = this.announcement1.reporter_dictText
+						this.formData.reporterPhone_dictText = this.announcement1.reporterPhone_dictText
 						this.formData.faultStartTime = this.announcement1.faultStartTime
 						this.formData.remark = this.announcement1.remark
 						this.formData.repairDescription = this.announcement1.repairDescription

--
Gitblit v1.9.3