瀏覽代碼

邀请报工

wangxin 1 年之前
父節點
當前提交
f47b22ce54
共有 1 個文件被更改,包括 29 次插入23 次删除
  1. 29 23
      pages/reportingForWork/index.vue

+ 29 - 23
pages/reportingForWork/index.vue

@@ -171,11 +171,12 @@
 			}
 		})
 
-		getEquipmentByUidAndDid(store.planDetails.id, store.curDeptDetails.deptId,store.dayworkInfo.lotId).then(equipmentRes => {
-			if (equipmentRes.code == 200) {
-				hasEquipment.value = equipmentRes.rows.length > 0 ? true : false;
-			}
-		})
+		getEquipmentByUidAndDid(store.planDetails.id, store.curDeptDetails.deptId, store.dayworkInfo.lotId).then(
+			equipmentRes => {
+				if (equipmentRes.code == 200) {
+					hasEquipment.value = equipmentRes.rows.length > 0 ? true : false;
+				}
+			})
 	}
 
 	function reflush() {
@@ -211,24 +212,29 @@
 	}
 
 	function HandleSeleteInviteUser(data) {
-		if (store.dayworkInfo.status == 4) {
-			uni.showToast({
-				icon: 'none',
-				title: '当前批次已完成'
-			})
-		} else if (store.dayworkInfo.status == 2 || store.dayworkInfo.status == 3) {
-			uni.showToast({
-				icon: 'none',
-				title: '当前工序已完成'
-			})
-		} else if (!hasEquipment.value) {
-			uni.showToast({
-				icon: 'none',
-				title: '当前无可用设备',
-			})
-		} else {
-			inviteUser.value.open(data);
-		}
+		isCurProcessFinish({
+			dayworkId: store.dayworkInfo.id,
+			processId: listData.value[0].processId
+		}).then(res => {
+			if (store.dayworkInfo.status == 4) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前批次已完成'
+				})
+			} else if (res.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '该工序已完成,不能邀请报工'
+				})
+			} else if (!hasEquipment.value) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前无可用设备',
+				})
+			} else {
+				inviteUser.value.open(data);
+			}
+		})
 	}
 
 	function handleChangevehicle() {