Browse Source

0717查询批次信息工艺列表全部显示

zhuzeyu 11 months ago
parent
commit
d738d02e37
1 changed files with 62 additions and 5 deletions
  1. 62 5
      pages/batchReporting/index.vue

+ 62 - 5
pages/batchReporting/index.vue

@@ -130,6 +130,8 @@
 					<text>{{ index + 1 }}.{{item.processAlias}}</text>
 					<text>{{ index + 1 }}.{{item.processAlias}}</text>
 				</view>
 				</view>
 			</scroll-view>
 			</scroll-view>
+			<view><button v-if="!editStatus" class="view-end-btn" type="primary"  @click="handleOpenDrawing">查看本工序图纸</button></view>
+
 		</uni-drawer>
 		</uni-drawer>
 		<!-- <view v-if="bottomStatus" class="bottom uni-row">
 		<!-- <view v-if="bottomStatus" class="bottom uni-row">
 			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
 			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
@@ -203,7 +205,10 @@
 	const wasteRecyclingList = ref([]) //废品回用批次
 	const wasteRecyclingList = ref([]) //废品回用批次
 	// 在数据中定义一个变量来控制遮罩层的显示
 	// 在数据中定义一个变量来控制遮罩层的显示
 	const isMaskShow = ref(false);
 	const isMaskShow = ref(false);
-
+	//打开图纸
+	//选中的daywork
+	const currentDaywork = ref({})
+	const editStatus = ref(false)
 	const notPreProcess = ref(true)
 	const notPreProcess = ref(true)
 	const curProcessAfte = ref([])
 	const curProcessAfte = ref([])
 	const showRight = ref(null) // 抽屉
 	const showRight = ref(null) // 抽屉
@@ -360,11 +365,20 @@
 	function handleClickProcessList(item) {
 	function handleClickProcessList(item) {
 		let curProcessAfterList = [];
 		let curProcessAfterList = [];
 		console.log("工序列表", item)
 		console.log("工序列表", item)
-
+		currentDaywork.value = item
+		if(item.isWasteRecycling ==1 || item.isAmend ==1){
+			editStatus.value = true
+		}else{
+			editStatus.value = false
+		}
 		let nextIndex = 0;
 		let nextIndex = 0;
 		for (let i = 0; i < item.processSequence.length; i++) {
 		for (let i = 0; i < item.processSequence.length; i++) {
-			if (item.nextProcess.processStepNumber == item.processSequence[i].processStepNumber) {
-				nextIndex = i;
+			if(item.nextProcess){
+							if (item.nextProcess.processStepNumber == item.processSequence[i].processStepNumber) {
+								nextIndex = i;
+							}
+						}else{
+							nextIndex = item.processSequence.length
 			}
 			}
 		}
 		}
 		for (let i = 0; i < item.processSequence.length; i++) {
 		for (let i = 0; i < item.processSequence.length; i++) {
@@ -486,6 +500,15 @@
 					console.log(response)
 					console.log(response)
 					console.log(response.data[0].productionPlanDetailId)
 					console.log(response.data[0].productionPlanDetailId)
 					console.log(store.planDetails.id)
 					console.log(store.planDetails.id)
+					console.log(response.data[0].deptId !== store.curDeptDetails.deptId)
+								if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+									uni.showToast({
+										icon: 'none',
+										title: '该批次已转至其他工段',
+										duration: 2000
+									})
+									return
+								}
 					if (response.data[0].productionPlanDetailId == store.planDetails.id) {
 					if (response.data[0].productionPlanDetailId == store.planDetails.id) {
 						console.log(response.data)
 						console.log(response.data)
 						lotDialog.value.open(response.data);
 						lotDialog.value.open(response.data);
@@ -523,7 +546,32 @@
 	function handleDoIt(data) {
 	function handleDoIt(data) {
 		handleAddDaywork(data);
 		handleAddDaywork(data);
 	}
 	}
-
+	function handleOpenDrawing(){
+		console.log(currentDaywork.value,"444")
+		
+		var filteredProcess = currentDaywork.value.processSequence.filter(item => item.processStepNumber == currentDaywork.value.currentProcess.processStepNumber);
+		
+		// 检查 filteredProcess 是否有元素,并选择第一个元素
+		if (filteredProcess.length > 0) {
+		  var firstMatch = filteredProcess[0]; // 获取第一个匹配的对象
+		
+		  // 对 technologicalProcessDetailId 进行URL编码
+		  var encodedId = encodeURIComponent(firstMatch.technologicalProcessDetailId);
+		  var encodeCode = encodeURIComponent(currentDaywork.value.lotCode);
+		  // 构建查询参数字符串
+		  var queryParam = `param1=${encodedId}&param2=${encodeCode}`;
+		
+		  // 使用模板字符串构建完整的URL
+		  var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+		
+		  // 导航到指定页面
+		  uni.navigateTo({
+			url: navigateUrl
+		  });
+		} else {
+		  console.log('No process matched the current process step number.');
+		}
+	}
 	function handleDoTurnoverAfter() {
 	function handleDoTurnoverAfter() {
 		reflush();
 		reflush();
 	}
 	}
@@ -774,6 +822,15 @@
 			border-radius: 8rpx;
 			border-radius: 8rpx;
 			color: #FFFFFF;
 			color: #FFFFFF;
 			font-size: 28rpx;
 			font-size: 28rpx;
+					}
+		.view-end-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+
 		}
 		}
 	}
 	}
 </style>
 </style>