From 1d18ff904468e4a864312bdcf6d7c6a7c0477721 Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期五, 25 四月 2025 14:57:36 +0800
Subject: [PATCH] 项目提交

---
 pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue |  398 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 302 insertions(+), 96 deletions(-)

diff --git a/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue b/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue
index c20b66f..399d52f 100644
--- a/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue
+++ b/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue
@@ -2,7 +2,7 @@
 	<view class="container">
 		<cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
 			<block slot="backText">杩斿洖</block>
-			<block slot="content">宸插姙璇︽儏</block>
+			<block slot="content">璇︽儏</block>
 		</cu-custom>
 		<view class="container">
 
@@ -11,28 +11,20 @@
 				<uni-group top="1">
 					<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view>
 					<uni-forms-item name="num" label="宸ュ崟鍙�:">
-						<uni-easyinput v-model="formData.equipmentCode" :disabled="true" />
+						<uni-easyinput v-model="formData.orderNum" :disabled="true" />
 					</uni-forms-item>
-					<uni-forms-item required name="num" label="璁惧缂栫爜:">
-						<uni-easyinput v-model="formData.equipmentCode" :disabled="true" />
+					<uni-forms-item required name="num" label="璁惧缂栧彿:">
+						<uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList"
+							placeholder="璇烽�夋嫨" :disabled="true" />
 					</uni-forms-item>
 
-					<uni-forms-item name="remark" label="鏍囧噯鍚嶇О:">
-						<uni-easyinput v-model="formData.equipmentName" :disabled="true" />
+					<uni-forms-item name="remark" label="鐐规鏃ユ湡:">
+						<uni-easyinput v-model="formData.inspectionDate" :disabled="true" />
 					</uni-forms-item>
-					<uni-forms-item name="remark" label="淇濆吇鏃ユ湡:">
-						<uni-easyinput v-model="formData.equipmentModel" :disabled="true" />
+					<uni-forms-item name="outNum" label="鐐规浜�:">
+						<uni-easyinput v-model="formData.operator" :disabled="true" />
 					</uni-forms-item>
-					<uni-forms-item name="outNum" label="淇濆吇浜�:">
-						<uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" />
-					</uni-forms-item>
-					<uni-forms-item name="outNum" label="淇濆吇鍛ㄦ湡:">
-						<uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" />
-					</uni-forms-item>
-					<uni-forms-item name="outNum" label="澶囨敞:">
-						<uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" />
-					</uni-forms-item>
-					<uni-forms-item name="outNum" label="淇濆吇鍥剧墖:">
+					<uni-forms-item 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]">
@@ -41,22 +33,12 @@
 									<text class='cuIcon-close'></text>
 								</view>
 							</view>
-							<view class="solids" @tap="ChooseImage" v-if="imgList.length<1">
+							<view class="solids" v-if="imgList.length<1">
 								<text class='cuIcon-cameraadd'></text>
 							</view>
 						</view>
 
 					</uni-forms-item>
-					<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鐝粍闀跨‘璁� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view>
-					<uni-forms-item name="outNum" required label="纭绫诲瀷:">
-						<uni-data-select :localdata="formData.msListCategory" popup-title="璇烽�夋嫨" @change="changeType"
-							:clear="false">
-						</uni-data-select>
-					</uni-forms-item>
-					<uni-forms-item name="outNum" required label="纭鎰忚:">
-						<uni-easyinput type="textarea" v-model="formData.ttitle" placeholder="璇疯緭鍏ュ唴瀹�"></uni-easyinput>
-					</uni-forms-item>
-
 				</uni-group>
 			</uni-forms>
 			<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view>
@@ -71,64 +53,65 @@
 				<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.title}}
+						{{item.itemName}}
 					</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 radius text-right"
-						v-if="item.small!=null && item.small.length>10">
-						{{(item.small).toString().substr(0,10)+'...'}}
-					</view>
 
-					<view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else>
-						{{item.small}}
-					</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 radius text-right"
-						v-if="item.yaoqiu!=null && item.yaoqiu.length>10">
-						{{(item.yaoqiu).toString().substr(0,10)+'...'}}
+						v-if="item.itemDemand!=null && item.itemDemand.length>10">
+						{{(item.itemDemand).toString().substr(0,10)+'...'}}
 					</view>
 
 					<view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else>
-						{{item.yaoqiu}}
+						{{item.itemDemand}}
 					</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     text-right margin-xs radius">
-						<uni-data-select :localdata="item.restle" :clear="true" />
+					<view class="flex-sub text-light bg-white  padding-xs margin-xs radius">鐐规缁撴灉:</view>
+					
+					<uni-data-select :localdata="restle" v-model="item.inspectionResult" @change="handleCode()"
+						:clear="true" :disabled="true" />
 
-					</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     text-right margin-xs radius">
-						<uni-easyinput v-model="item.desc" :disabled="true" />
+						<uni-easyinput v-model="item.exceptionDescription" :disabled="true" />
 					</view>
 				</view>
-
 				<view class="flex">
-					<view class="flex-sub text-light bg-white  padding-xs margin-xs radius">鏄惁鎶ヤ慨:</view>
+					<view class="flex-sub text-light bg-white  padding-xs margin-xs radius">寮傚父鏄惁鎶ヤ慨:</view>
 					<view class="flex-sub bg-white padding-xs     text-right margin-xs radius">
-						<uni-data-select :localdata="item.type" />
-
+						<uni-data-select :localdata="item.type" v-model="item.reportFlag" :disabled="true" />
 					</view>
 				</view>
-
 			</uni-card>
 
 
+			<uni-forms v-if="isDisplayConfirm == 'WAIT_CONFIRM' || isDisplayConfirm == 'COMPLETE'" ref="form"
+				:modelValue="ScanData" validate-trigger="bind" err-show-type="undertext">
+				<uni-group top="1">
+					<view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鐝粍闀跨‘璁� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view>
+					<uni-forms-item required name="typeName" label="澶勭悊绫诲瀷:">
+						<uni-data-select v-model="ScanData.typeName" :localdata="ScanData.handlingType"
+							@change="changehandlingType" placeholder="璇烽�夋嫨" :disabled="true" />
+					</uni-forms-item>
+					<uni-forms-item required name="handlingSuggestion" label="澶勭悊鎰忚:">
+						<uni-easyinput type="textarea" v-model="ScanData.handlingSuggestion" :disabled="true" />
+					</uni-forms-item>
+				</uni-group>
+			</uni-forms>
 		</view>
 	</view>
 </template>
 
 <script>
 	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
+	import configService from '@/common/service/config.service.js';
 	export default {
 		mixins: [MescrollMixin], // 浣跨敤mixin
 		data() {
@@ -136,28 +119,42 @@
 				scrollLeft: 0,
 				searchValue: '',
 				imgList: [],
+				equipmentList: [],
 				uploadUrl: "/sys/common/upload",
-				formData: {},
-				partTakeAdviceDetailList: [{
-					title: "鏈哄簥绌烘皵杩囨护",
-					small: "澶栧3鍙婄璺�",
-					yaoqiu: "杩囨护缃�,杩囨护妫夊畬濂斤紝鏃犳补",
-					restle: [{
-							text: "姝e父",
-							value: 0
+				ScanData: {
+					typeName: '',
+					handlingType: [{
+							text: "閫氳繃",
+							value: "1"
 						},
 						{
-							text: "寮傚父",
-							value: 1
+							text: "椹冲洖",
+							value: "2"
 						}
-					]
-
-				}],
+					],
+					handlingSuggestion: ''
+				},
+				formData: {
+					num: '',
+					avatar: '',
+					orderNum: '',
+					inspectionDate: '',
+					operator: ''
+				},
+				istrue: true,
+				partTakeAdviceDetailList: [],
 				NavBarColor: this.NavBarColor,
 				url: {
-					stallList: "/eam/equipment/queryById"
+					upload: "/eam/sysFiles/batch_upload",
+					stallList: "/eam/eamInspectionOrder/queryById",
+					// getEquipmentList: "eam/equipment/asyncLoadEquipment",
+					getEquipmentList:'eam/equipment/list',
+					BaoList: 'eam/eamInspectionOrderDetail/queryList',
+					approval: 'eam/eamInspectionOrder/approval'
 				},
 				id: '',
+				taskId: '',
+				inspectionResult: '',
 				upOption: {
 					page: {
 						num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮�
@@ -178,7 +175,10 @@
 				},
 				msg1Count: 0,
 				msg2Count: 0,
-				msg1Title: ""
+				msg1Title: "",
+				procInstId: '',
+				values: '',
+				isDisplayConfirm: false
 			}
 		},
 		computed: {
@@ -192,38 +192,237 @@
 				return style
 			},
 		},
+		onLoad(options) {
+			const annItem = JSON.parse(decodeURIComponent(options.item));
 
-
-		onShow() {
-
-		},
-
-		onLoad: function(option) {
-			const annItem = JSON.parse(decodeURIComponent(option.item));
-			this.id = annItem.id
+			this.id = annItem.dataId
+			this.taskId = annItem.id
+			this.procInstId = annItem.procInstId
+			this.values = annItem.values
+			this.assignee = annItem.assignee
+			const imageFiles = annItem.imageFiles
+			this.ipAndPort = configService.staticURL
+			// const ipAndPort = 'https://192.168.1.42:9999/jeecg-boot/sys/common/static' + '/'
+			if (imageFiles) {
+				const fileArray = imageFiles.split(',');
+				this.imgList = fileArray.map(file => {
+					return ipAndPort + file.trim();
+				});
+			}
 		},
 		created() {
-			this.upCallback()
+			this.getEquipment();
+			this.getList();
+			this.upCallback();
 		},
+
 		methods: {
+			changehandlingType(e) {
+				this.ScanData.typeName = e;
+			},
+			ProductionTask() {
+				if (this.ScanData.typeName == undefined || this.ScanData.typeName == null || this.ScanData.typeName ==
+					'') {
+
+					uni.showToast({
+						icon: 'none',
+						title: '澶勭悊绫诲瀷涓嶈兘涓虹┖'
+					});
+					return false;
+				}
+				if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == null || this
+					.ScanData.handlingSuggestion ==
+					'') {
+
+					uni.showToast({
+						icon: 'none',
+						title: '澶勭悊鎰忚涓嶈兘涓虹┖'
+					});
+					return false;
+				}
+				this.$http.post(this.url.approval, {
+					/**
+					 * 纭鎰忚
+					 */
+					confirmComment: this.ScanData.handlingSuggestion,
+					/**
+					 * 纭绫诲瀷 1 閫氳繃  2 椹冲洖
+					 */
+					confirmDealType: this.ScanData.typeName,
+					dataId: this.id,
+					fileList: this.formData.avatar, // 鍖呭惈涓婁紶鍚庣殑鍥剧墖璺緞,,
+					instanceId: this.procInstId,
+					tableDetailList: this.partTakeAdviceDetailList,
+					taskId: this.taskId,
+					userId: this.assignee,
+					values: this.values
+				}).then(res => {
+					console.log(res)
+					this.$tip.loaded();
+					if (res.data.success) {
+						uni.showToast({
+							icon: "success",
+							title: '鎻愪氦鎴愬姛',
+							duration: 2000
+						});
+						this.$Router.replace({
+							name: 'ToDoList'
+						})
+
+					}
+				}).catch(() => {
+					this.$tip.loaded();
+					uni.showToast({
+						icon: "error",
+						title: '鎻愪氦澶辫触',
+						duration: 2000
+					});
+				});
+			},
+
+			changeEquipmentList(e) {
+				this.formData.num = e;
+			},
+			handleCode(e, index) {
+				console.log(index);
+				// 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬�
+				if (e === 2) {
+					this.partTakeAdviceDetailList[index].istrue = false;
+
+				} else {
+					this.partTakeAdviceDetailList[index].istrue = true;
+				}
+			},
+			// getEquipment() {
+			// 	this.$http.get(this.url.getEquipmentList).then(res => {
+			// 		//璁剧疆鍒楄〃鏁版嵁
+			// 		if (res.data.success) {
+			// 			this.equipmentList = res.data.result
+			// 		} else {
+			// 			uni.showToast({
+			// 				icon: "error",
+			// 				title: res.data.message,
+			// 				duration: 2000
+			// 			});
+
+			// 		}
+			// 	}).catch(() => {
+			// 		this.$tip.error("鑱旂綉澶辫触")
+			// 	})
+			// },
+				getEquipment() {
+							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.records
+								} else {
+									uni.showToast({
+										icon: "error",
+										title: res.data.message,
+										duration: 2000
+									});
+			
+								}
+							}).catch(() => {
+								this.$tip.error("鑱旂綉澶辫触")
+							})
+						},
+			getList() {
+				this.$http.get(this.url.BaoList, {
+					params: {
+						orderId: this.id
+					},
+
+				}).then(res => {
+					this.partTakeAdviceDetailList = res.data.result;
+					const restle = [];
+					this.partTakeAdviceDetailList.forEach(item => {
+						item.restle = [{
+								text: "姝e父",
+								value: 1
+							},
+							{
+								text: "寮傚父",
+								value: 2
+							}
+						]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍
+						item.type = [{
+								text: "鍚�",
+								value: 0
+							},
+							{
+								text: "鏄�",
+								value: 1
+							}
+						]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍
+						item.istrue = true;
+					});
+					console.log("url", res)
+					//璁剧疆鍒楄〃鏁版嵁
+					if (res.data.success) {
+						console.log("res", res.data.result)
+
+					}
+				}).catch(() => {
+					//鑱旂綉澶辫触, 缁撴潫鍔犺浇
+				})
+			},
 			ChooseImage() {
 				var that = this;
 				uni.chooseImage({
-					count: 4, //榛樿9
-					sizeType: ['original', 'compressed'], //鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈�
-					sourceType: ['album'], //浠庣浉鍐岄�夋嫨
+					count: 4,
+					sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈�
+					sourceType: ['album'], // 浠庣浉鍐岄�夋嫨
 					success: (res) => {
-						that.$http.upload(that.uploadUrl, {
-								filePath: res.tempFilePaths[0],
-								name: 'file'
-							})
-							.then(res => {
-								that.myFormData.avatar = res.data.message;
-							})
-							.catch(err => {
-								that.$tip.error(err.data.message)
+						// 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰�
+						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].filePath;
+										// 杩藉姞鍒� formData.avatar 涓紝骞剁敤閫楀彿鍒嗛殧
+										if (that.formData.avatar) {
+											that.formData.avatar += ',' + filePath;
+										} else {
+											that.formData.avatar = filePath;
+										}
+										console.log('鍥剧墖' + index + '涓婁紶瀹屾垚:', filePath);
+										resolve(filePath);
+									})
+									.catch(err => {
+										console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err);
+										reject(err);
+									});
 							});
-						this.imgList = res.tempFilePaths
+						});
+
+						// 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔�
+						Promise.all(uploadPromises)
+							.then((uploadedFilePaths) => {
+								console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatar);
+							})
+							.catch((err) => {
+								console.error('鍥剧墖涓婁紶澶辫触:', err);
+								that.$tip.error('鍥剧墖涓婁紶澶辫触');
+							});
 					}
 				});
 			},
@@ -250,12 +449,7 @@
 			upCallback() {
 				this.$http.get(this.url.stallList, {
 					params: {
-						pageNo: 999,
-						pageSize: 1,
-						order: 'asc',
-						column: 'createTime',
 						id: this.id
-
 					},
 
 				}).then(res => {
@@ -264,7 +458,19 @@
 					//璁剧疆鍒楄〃鏁版嵁
 					if (res.data.success) {
 						console.log("res", res.data.result.equipmentCode)
-						this.formData = this.announcement1
+						this.formData.num = this.announcement1.equipmentId,
+							this.formData.orderNum = this.announcement1.orderNum,
+							this.formData.operator = this.announcement1.operator,
+							this.formData.inspectionDate = this.announcement1.inspectionDate,
+							this.formData.avatar = this.announcement1.imageFiles,
+							this.ScanData.handlingSuggestion = this.announcement1.confirmComment,
+							this.ScanData.typeName = this.announcement1.confirmDealType
+						this.isDisplayConfirm = this.announcement1.inspectionStatus
+						if (this.announcement1.inspectionStatus == 'WAIT_CONFIRM' || this.announcement1
+							.inspectionStatus == 'COMPLETE') {
+							thihs.isDisplayConfirm = true
+						}
+
 					}
 				}).catch(() => {
 					//鑱旂綉澶辫触, 缁撴潫鍔犺浇

--
Gitblit v1.9.3