guoyujia 3 hónapja
szülő
commit
b1e9da39ff

+ 7 - 0
api/business/processInspection.js

@@ -11,6 +11,13 @@ export function getProcessInspecionList(data) {
 		data: data
 	})
 }
+export function checkHasInspection(data) {
+	return req.request({
+		url: '/business/inspecion/checkHasInspection',
+		method: 'get',
+		data: data
+	})
+}
 export function getExamineListList(data) {
 	return req.request({
 		url: '/business/inspecion/examineList',

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "(测试)德迈仕数字生产管理平台",
     "appid" : "__UNI__54D8B02",
     "description" : "",
-    "versionName" : "1.0.50",
-    "versionCode" : 150,
+    "versionName" : "1.0.51",
+    "versionCode" : 151,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 47 - 9
pages/deliveryInspection/scan.vue

@@ -74,6 +74,7 @@
 		getDeliveryLotInfo,
 		getCarrierInfoProcess,
 		getCarrierInfo,
+		checkHasInspection
 	} from '@/api/business/processInspection.js'
 	import {
 		debounce
@@ -204,7 +205,7 @@
 			)
 		} else {
 			const result = {
-				carrierCode: '100273'
+				carrierCode: '000952'
 			}
 			getCarrierInfo(result).then(response => {
 				if (response.code == 200) {
@@ -240,8 +241,8 @@
 										};
 										lot.value.carrierCode = result.carrierCode
 										carrierCode.value = result.carrierCode;
-										lot.value.inspectionCarrierId = '1803605009558978562'
-										lot.value.inspectionCarrierCode = "300057"
+										lot.value.inspectionCarrierId = '1846793994447667208'
+										lot.value.inspectionCarrierCode = "300172"
 										// console.log("res", res);
 										uni.hideLoading();
 										// 判断是否批次号和检查箱码都扫完
@@ -400,15 +401,52 @@
 			lot.value.userId = userId.value
 			lot.value.nickName = userList.value[userList.value.findIndex(item => item.value == userId.value)].text
 			store.processInspection = null
-			uni.navigateTo({
-				url: "/pages/deliveryInspection/form",
-				success: (res) => {
-					// 通过eventChannel向被打开页面传送数据
-					res.eventChannel.emit("deliveryInspectionFrom", {
-						data: lot.value
+			//判断当前工序是否做过交检
+			checkHasInspection({
+				id: lot.value.id,
+				processStepNumber: lot.value.processStepNumber,
+				type: "deliveryInspection"
+			}).then(res => {
+				if (res.data) {
+					//没有检查
+					uni.navigateTo({
+						url: "/pages/deliveryInspection/form",
+						success: (res) => {
+							// 通过eventChannel向被打开页面传送数据
+							res.eventChannel.emit("deliveryInspectionFrom", {
+								data: lot.value
+							})
+						}
 					})
+				} else {
+					uni.showModal({
+						title: '提示',
+						content: `${lot.value.lotCode}批次已经做过交检,是否重复创建`,
+						showCancel: true,
+						cancelText: '取消',
+						confirmText: '确定',
+						confirmColor: '#ff0000',
+						cancelColor: '#55aa00',
+						complete: (res) => {
+							if (res.confirm) {
+								uni.navigateTo({
+									url: "/pages/deliveryInspection/form",
+									success: (res) => {
+										// 通过eventChannel向被打开页面传送数据
+										res.eventChannel.emit(
+											"deliveryInspectionFrom", {
+												data: lot.value
+											})
+									}
+								})
+							} else {
+
+							}
+						}
+					});
 				}
 			})
+
 		} else {
 			if (lot.value.allCarrierName == undefined) {
 				uni.showToast({

+ 66 - 21
pages/factoryInspection/scan.vue

@@ -60,7 +60,8 @@
 		getCarrierInfoProcess,
 		getCarrierInfo,
 		saveFactoryInspecion,
-		saveFirstFactoryInspection
+		saveFirstFactoryInspection,
+		checkHasInspection
 	} from '@/api/business/processInspection.js'
 	import {
 		debounce
@@ -179,7 +180,7 @@
 			)
 		} else {
 			const result = {
-				carrierCode: '000682'
+				carrierCode: '000952'
 			}
 			getCarrierInfo(result).then(response => {
 				if (response.code == 200) {
@@ -206,8 +207,8 @@
 									};
 									lot.value.carrierCode = result.carrierCode
 									carrierCode.value = result.carrierCode;
-									lot.value.inspectionCarrierId = '1844294555287994371'
-									lot.value.inspectionCarrierCode = "300071"
+									lot.value.inspectionCarrierId = '1846793994447667208'
+									lot.value.inspectionCarrierCode = "300172"
 									// console.log("res", res);
 									uni.hideLoading();
 									// 判断是否批次号和检查箱码都扫完
@@ -312,27 +313,71 @@
 				processInspection.reviewerId = 0
 			}
 			//保存
-			console.log(processInspection)
-			lot.value = {}
-			if (store.userInfo.roles.some(item => item.roleKey == 'factoryInspection')) {
-				uni.navigateTo({
-					url: "/pages/factoryInspection/form",
-					success: (res) => {
-						// 通过eventChannel向被打开页面传送数据
-						res.eventChannel.emit("factoryInspectionFrom", {
-							data: processInspection.lot
+			//判断当前工序是否做过交检
+			checkHasInspection({
+				id: lot.value.id,
+				type: "factoryInspection"
+			}).then(res => {
+				if (res.data) {
+					//没有检查
+					lot.value = {}
+					if (store.userInfo.roles.some(item => item.roleKey == 'factoryInspection')) {
+						uni.navigateTo({
+							url: "/pages/factoryInspection/form",
+							success: (res) => {
+								// 通过eventChannel向被打开页面传送数据
+								res.eventChannel.emit("factoryInspectionFrom", {
+									data: processInspection.lot
+								})
+							}
 						})
+					} else {
+						saveFirstFactoryInspection(processInspection).then(res => {
+							uni.navigateTo({
+								url: '/pages/factoryInspection/index'
+							})
+						})
+
 					}
-				})
-			} else {
-				saveFirstFactoryInspection(processInspection).then(res => {
+				} else {
+					uni.showModal({
+						title: '提示',
+						content: `${lot.value.lotCode}批次已经做过出厂检,是否重复创建`,
+						showCancel: true,
+						cancelText: '取消',
+						confirmText: '确定',
+						confirmColor: '#ff0000',
+						cancelColor: '#55aa00',
+						complete: (res) => {
+							if (res.confirm) {
+								lot.value = {}
+								if (store.userInfo.roles.some(item => item.roleKey ==
+										'factoryInspection')) {
+									uni.navigateTo({
+										url: "/pages/factoryInspection/form",
+										success: (res) => {
+											// 通过eventChannel向被打开页面传送数据
+											res.eventChannel.emit(
+												"factoryInspectionFrom", {
+													data: processInspection.lot
+												})
+										}
+									})
+								} else {
+									saveFirstFactoryInspection(processInspection).then(res => {
+										uni.navigateTo({
+											url: '/pages/factoryInspection/index'
+										})
+									})
 
-					uni.navigateTo({
-						url: '/pages/factoryInspection/index'
-					})
-				})
+								}
+							} else {
 
-			}
+							}
+						}
+					});
+				}
+			})
 
 		} else {
 			if (lot.value.allCarrierName == undefined) {

+ 1 - 1
pages/outsourcedInspection/index.vue

@@ -346,7 +346,7 @@
 		// })
 		uni.showModal({
 			title: '确认',
-			content: (item.rejectNum > 0 ? "已有外协检测信息,确认删除么?" : '确认删除该序检么?'),
+			content: (item.rejectNum > 0 ? "已有外协检测信息,确认删除么?" : '确认删除该外协检查么?'),
 			success: function(res) {
 				if (res.confirm) {
 					delProcessInspection(item.id).then(res => {

+ 18 - 0
pages/sortBatchReporting/index.vue

@@ -439,15 +439,27 @@
 	}
 
 	function handleToreportingForWork(item) {
+		isLoading.value = true
+		uni.showLoading({
+			title: '加载中'
+		});
 		store.dayworkInfo = item
 		console.log(store.dayworkInfo)
+		console.log(isLoading.value)
 		// if (item.dayworkItemList[0].status == 0) {
 		// 	return
 		// }
 		uni.$once("formBack", () => handleSearch())
 		if (item.dayworkItemList[0].equipmentDetailId == 0) {
+
+			isLoading.value = false;
+			uni.hideLoading();
+			console.log(isLoading.value)
 			selectEquipment.value.open(null);
 		} else {
+
+			isLoading.value = false;
+			uni.hideLoading();
 			uni.navigateTo({
 				url: "/pages/sorting/form",
 				success: function(res) {
@@ -462,6 +474,10 @@
 	}
 	//选择设备
 	function handleAddEquipment(data) {
+		isLoading.value = true
+		uni.showLoading({
+			title: '加载中'
+		});
 		let dayworkItem = store.dayworkInfo.dayworkItemList[0]
 		store.dayworkInfo.dayworkItemList[0].equipmentDetailId = data.equipmentDetailId
 		store.dayworkInfo.dayworkItemList[0].equipmentDetailCode = data.equipmentDetailCode
@@ -469,6 +485,8 @@
 		dayworkItem.equipmentDetailCode = data.equipmentDetailCode
 		//保存
 		addEquipmentInfo(dayworkItem).then(res => {
+			isLoading.value = false;
+			uni.hideLoading();
 			if (res.code == 200) {
 				uni.navigateTo({
 					url: "/pages/sorting/form",