فهرست منبع

0625电子图纸预览bug修改

ezhizao\ezhizao_zx 1 سال پیش
والد
کامیت
96474c51c2

+ 11 - 0
api/business/drawing.js

@@ -12,3 +12,14 @@ export function getDrawingList(data) {
 		data: data
 	})
 }
+/**
+ * 获取工艺工序
+ * @param id
+ */
+export function getProcessDetail(id) {
+	return req.request({
+		url: '/base/technologicalProcessDetail/'+id,
+		// header: reqHeader,
+		method: 'GET'
+	})
+}

+ 29 - 1
components/dialog-lotReporting/dialog-lotReporting.vue

@@ -76,12 +76,13 @@
 				<view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
 					仅显示当前工序后面工艺
 				</view>
-				<scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
+				<scroll-view scroll-y="true" style="height: 80%;" @touchmove.stop>
 					<view v-for="(item,index) in curProcessAfte" :key="index"
 						style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
 						<text>{{ index + 1 }}.{{item.processAlias}}</text>
 					</view>
 				</scroll-view>
+				<view><button  class="start-batch-btn" style="margin-bottom: 10rpx;" type="primary" @click="handleOpenDrawing">查看本工序图纸</button></view>
 			</uni-drawer>
 		</view>
 		<view class="add-btn-container uni-row">
@@ -118,6 +119,8 @@
 	const baseDialog = ref(null)
 	const lotData = ref(null)
 	const curDaywork = ref({})
+	const currentTechnologicalProcessDetailId = ref(null)
+	const currentLotCode = ref("")
 	const workshopList = ref([])
 	const curProcessAfte = ref([])
 	const deptList = ref([])
@@ -161,6 +164,11 @@
 	}
 
 	function handleClickProcessList(item) {
+		console.log(item,7979)
+		var filteredProcess = item.processSequence.filter(i => i.processStepNumber == item.process.processStepNumber);
+		currentTechnologicalProcessDetailId.value = filteredProcess[0].technologicalProcessDetailId
+		console.log(currentTechnologicalProcessDetailId.value)
+		currentLotCode.value = item.lotCode
 		curProcessAfte.value = lotData.value[0].nextProcesses;
 		showRight.value.open();
 	}
@@ -182,6 +190,26 @@
 			props.getList()
 		})
 	}
+	//打开电子图纸
+	function handleOpenDrawing(){
+		
+		  
+		
+		  // 对 technologicalProcessDetailId 进行URL编码
+		  var encodedId = encodeURIComponent(currentTechnologicalProcessDetailId.value);
+		  var encodeCode = encodeURIComponent(currentLotCode.value);
+		  // 构建查询参数字符串
+		  var queryParam = `param1=${encodedId}&param2=${encodeCode}`;
+		
+		  // 使用模板字符串构建完整的URL
+		  var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+		
+		  // 导航到指定页面
+		  uni.navigateTo({
+		    url: navigateUrl
+		  });
+	
+	}
 
 	function addDayworkItem(callback) {
 		// 判断选择下工段和下车间

+ 12 - 3
pages/batchReporting/index.vue

@@ -113,14 +113,14 @@
 			<view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
 				仅显示当前工序后面工艺
 			</view>
-			<scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
+			<scroll-view scroll-y="true" style="height: 80%;" @touchmove.stop>
 				<view v-for="(item,index) in curProcessAfte" :key="index"
 					style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
 					<text>{{ index + 1 }}.{{item.processAlias}}</text>
 				</view>
 				
 			</scroll-view>
-			<view><button  class="start-batch-btn" type="primary" @click="handleOpenDrawing">查看本工序图纸</button></view>
+			<view><button  class="view-end-btn" type="primary"  @click="handleOpenDrawing">查看本工序图纸</button></view>
 		</uni-drawer>
 		<!-- <view v-if="bottomStatus" class="bottom uni-row">
 			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
@@ -734,6 +734,7 @@
 			.label {
 				font-size: 28rpx;
 				width: 220rpx;
+				
 				color: #808080;
 
 				&.right {
@@ -793,6 +794,14 @@
 			color: #FFFFFF;
 			font-size: 28rpx;
 		}
-		
+		.view-end-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+			
+		}
 	}
 </style>

+ 40 - 15
pages/drawingMenu/index.vue

@@ -1,17 +1,22 @@
 <template>
 	<view class="uni-column container">
 			<view style="margin: 12rpx;">
-				<view style="font-size: 24rpx;font-weight: bold;">批次号:{{product.lotCode}}</view>
-				<view style="font-size: 24rpx;font-weight: bold;">产品描述:{{product.description}}</view>
-				<view style="font-size: 24rpx;font-weight: bold;">
-					<view>工艺版本:{{product.technologyVersion}}</view>
-					<view>工序:{{product.processAlias}}</view>
+				<view class="margenTop" style="font-size: 30rpx;font-weight: bold;">批次号:{{product.lotCode}}</view>
+				<view class="margenTop" style="font-size: 30rpx;font-weight: bold;">产品描述:{{product.productDescription}}</view>
+				<view class="margenTop" style="font-size: 30rpx;font-weight: bold;    flex-direction: row;">
+					<view >工艺版本:{{product.technologyVersion}}</view>
+					<view style="margin-left: 200rpx;" >工序:{{product.processAlias}}</view>
 				</view>
+			</view>
+			<view class='middle'>
+				<view class='segment'></view>
+				<uni-icons type="paperclip" size="30" ></uni-icons>
+				<view class='segment'></view>
 			</view>
 			  <view style="overflow: auto;">
 			  	<view  :class="{'list-container':true}"
 			  		v-for="(item, index) in drawingList" :key="item.id">
-			  		<view ><text style="text-align: center; font-size: 24rpx; padding: 48rpx 0 24rpx 0;color:  #1684fc;" @click="handleOpenDrawing(item)">{{item.drawingName}}</text></view>
+			  		<view ><text style="text-align: center; font-size: 28rpx; padding: 48rpx 0 24rpx 0;color:  #1684fc;" @click="handleOpenDrawing(item)">{{item.drawingName}}</text></view>
 			  		
 			  	</view>
 			  </view>
@@ -22,7 +27,7 @@
 </template>
 
 <script setup>
-	import{getDrawingList} from '@/api/business/drawing.js'
+	import{getDrawingList,getProcessDetail} from '@/api/business/drawing.js'
 	import {
 		ref
 	} from 'vue'
@@ -35,7 +40,7 @@ const drawingList = ref([])
 const product = ref({})
 const lotCode = ref("")
 	onLoad((options) => {
-		
+		console.log(options,1111)
 		technologicalProcessDetailId.value = options.param1
 		lotCode.value = options.param2
 		init();
@@ -44,13 +49,20 @@ const lotCode = ref("")
 
 	function init() {
 		console.log(product.value)
+		getProcessDetail(technologicalProcessDetailId.value).then(response=>{
+			console.log(response,1123)
+			if(response.code ==200){
+				product.value  = response.data
+				product.value.lotCode = lotCode.value
+			}
+		})
 		getDrawingList({technologicalProcessDetailId:technologicalProcessDetailId.value}).then(res=>{
 			if(res.code == 200){
 				drawingList.value = res.data
-				product.value = drawingList.value[0].product
-				product.value.technologyVersion = drawingList.value[0].technologyVersion
-				product.value.processAlias = drawingList.value[0].processAlias
-				product.value.lotCode = lotCode.value
+				// product.value = drawingList.value[0].product
+				// product.value.technologyVersion = drawingList.value[0].technologyVersion
+				// product.value.processAlias = drawingList.value[0].processAlias
+				// product.value.lotCode = lotCode.value
 
 			}
 		})
@@ -89,7 +101,13 @@ const lotCode = ref("")
 		height: 100%;
 		background-color: #f5f5f5;
 	}
-	
+	.middle {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		margin-top: 20rpx;
+	}
 	.scroll-container {
 		position: absolute;
 		top: 24rpx;
@@ -97,10 +115,17 @@ const lotCode = ref("")
 		bottom: 160rpx;
 		left: 0;
 	}
-
+.segment {
+		width: 280rpx;
+		background-color: rgba(213, 213, 213, 1);
+		border: 1rpx solid rgba(213, 213, 213, 1);
+	}
 	.selected {
 		border: 1px solid #1684fc;
 	}
+	.margenTop{
+		margin: 20rpx;
+	}
 
 	.list-item {
 		background-color: #fff;
@@ -132,7 +157,7 @@ const lotCode = ref("")
 				}
 			}
 		}
-
+		
 		.item-info {
 			margin-bottom: 16rpx;
 

+ 1 - 1
pages/fastProductionPlan/index.vue

@@ -311,7 +311,7 @@
 		} else {
 			// 测试时用
 			getDayworkByCarrierCode({
-				carrierId: '1747500987688890381',
+				carrierCode: '900005',
 				status: 7,
 				deptId: store.curDeptDetails.deptId,
 			}).then(response => {

+ 30 - 2
pages/sortBatchReporting/index.vue

@@ -113,12 +113,13 @@
 			<view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
 				仅显示当前工序后面工艺
 			</view>
-			<scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
+			<scroll-view scroll-y="true" style="height: 80%;" @touchmove.stop>
 				<view v-for="(item,index) in curProcessAfte" :key="index"
 					style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
 					<text>{{ index + 1 }}.{{item.processAlias}}</text>
 				</view>
 			</scroll-view>
+			<view><button  class="start-batch-btn" style="margin-bottom: 10rpx;" type="primary" @click="handleOpenDrawing">查看本工序图纸</button></view>
 		</uni-drawer>
 		<!-- <view v-if="bottomStatus" class="bottom uni-row">
 			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
@@ -191,7 +192,7 @@
 	const wasteRecyclingList = ref([]) //废品回用批次
 	// 在数据中定义一个变量来控制遮罩层的显示
 	const isMaskShow = ref(false);
-
+	const currentDaywork = ref({})
 	const notPreProcess = ref(true)
 	const curProcessAfte = ref([])
 	const showRight = ref(null) // 抽屉
@@ -270,6 +271,32 @@
 		reflush();
 	})
 
+	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 reflush() {
 		// normalStatus.value = true;
 		init(store.planDetails.id);
@@ -380,6 +407,7 @@
 	function handleClickProcessList(item) {
 		let curProcessAfterList = [];
 		console.log(item)
+		currentDaywork.value = item
 		let nextIndex = 0;
 		for (let i = 0; i < item.processSequence.length; i++) {
 			if (item.nextProcess.id == item.processSequence[i].id) {