ezhizao_zx 11 ヶ月 前
コミット
0dd5454607

+ 17 - 16
pages/changeInspectionBox/index.vue

@@ -254,23 +254,24 @@
 				carrierRejectList.push(discardVehicleList.value[i])
 			}
 		}
-		if (carrierRejectList.length > 0) {
-			addCarrierReject(carrierRejectList).then((response) => {
-				if (response.code == 200) {
-					uni.showToast({
-						icon: 'success',
-						title: '操作成功',
-					});
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: '添加失败',
-					});
-				}
-			})
-		}
-		console.log(dayWorkInfo)
+		// if (carrierRejectList.length > 0) {
+		// 	addCarrierReject(carrierRejectList).then((response) => {
+		// 		if (response.code == 200) {
+		// 			uni.showToast({
+		// 				icon: 'success',
+		// 				title: '操作成功',
+		// 			});
+		// 		} else {
+		// 			uni.showToast({
+		// 				icon: 'none',
+		// 				title: '添加失败',
+		// 			});
+		// 		}
+		// 	})
+		// }
+		// console.log(dayWorkInfo)
 		dayWorkInfo.dayworkCarriers = newBindList.value;
+		dayWorkInfo.rejectCarrier = carrierRejectList
 		console.log(dayWorkInfo)
 		saveInspectionCarrier(dayWorkInfo).then(res => {
 			if (res.code === 200) {

+ 6 - 3
pages/outsourcedInspection/consultation.vue

@@ -55,23 +55,26 @@
 		const eventChannel = instance.getOpenerEventChannel();
 
 		eventChannel.on('outsourcedInspectionConsultation', function(data) {
+			console.log('show')
+			console.log(lot.value)
 			console.log('outsourcedInspectionConsultation', data)
 			// 传入当前报工信息 通过当前报工的产品和工序获取检查指导书和分选标准
 			if (data && data.data) {
 				getProductConsult(data.data).then(res => {
-					console.log("res", res);
+					// console.log("res", res);
 					if (res.code == 200) {
 						lot.value = data.data
 						lot.value.product = res.data
+						lot.value.question = ''
 					}
 				})
 
 			}
 		})
 	})
-	onLoad(() => {
+	onLoad(() => {})
 
-	})
+	onShow(() => {})
 
 	const handleSubmit = () => {
 		if (lot.value.question == null || lot.value.question == '') {

+ 8 - 0
pages/outsourcedInspection/form.vue

@@ -338,6 +338,7 @@
 			}
 		}
 
+		let sumReject = 0
 		unfitInfos.value.forEach(v => {
 			sumReject += Number(v.rejectNum)
 		})
@@ -356,6 +357,13 @@
 			})
 			return
 		}
+		if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
+			uni.showToast({
+				icon: 'none',
+				title: '不良品量不能大于投产量'
+			})
+			return
+		}
 
 		save();
 

+ 2 - 2
pages/outsourcedInspection/index.vue

@@ -240,7 +240,7 @@
 		// })
 		uni.showModal({
 			title: '确认',
-			content: '确认删除该序检么?',
+			content: (item.rejectNum > 0 ? "已有外协检测信息,确认删除么?" : '确认删除该序检么?'),
 			success: function(res) {
 				if (res.confirm) {
 					delProcessInspection(item.id).then(res => {
@@ -288,7 +288,7 @@
 	}
 
 	function delable(item) {
-		if (store.userInfo.permissions.some(item => item === 'business:outsourcedInspection:remove')) {
+		if (store.userInfo.permissions.some(item => item === 'business:outsourcedInspection:remove') && item.status == 0) {
 			return true
 		}
 		if (item.creatorId === userId.value && item.status == 0) {