mao 1 year ago
parent
commit
af7a8f1e85
2 changed files with 62 additions and 15 deletions
  1. 52 12
      pages/addNewBatch/index.vue
  2. 10 3
      pages/dashboard/index.vue

+ 52 - 12
pages/addNewBatch/index.vue

@@ -18,13 +18,13 @@
 						<text>扫码修正批次</text>
 						<text>扫码修正批次</text>
 					</view>
 					</view>
 				</view>
 				</view>
-			</view>segment
+			</view>
 			<view class='middle'>
 			<view class='middle'>
-				<view class=''></view>
+				<view class='segment'></view>
 				<uni-icons type="link" size="30" style="margin: 10rpx;  transform: rotate(135deg);"></uni-icons>
 				<uni-icons type="link" size="30" style="margin: 10rpx;  transform: rotate(135deg);"></uni-icons>
 				<view class='segment'></view>
 				<view class='segment'></view>
 			</view>
 			</view>
-			<!-- 			<view>
+<!-- 			<view>
 				<text class='title'>扫码绑定载具</text>
 				<text class='title'>扫码绑定载具</text>
 				<view class="vehicleList uni-row">
 				<view class="vehicleList uni-row">
 					<view class="vehicleNo uni-row" v-for="(item,index) in vehicleList">
 					<view class="vehicleNo uni-row" v-for="(item,index) in vehicleList">
@@ -37,17 +37,24 @@
 						   color: white;margin: 20rpx auto;
 						   color: white;margin: 20rpx auto;
 						   width: 80%;' @click='handleScanCode'>扫码</button>
 						   width: 80%;' @click='handleScanCode'>扫码</button>
 				</view>
 				</view>
+			</view> -->
+			<view class="selectedProcess">
+				<uni-section title="请选择工序" type="square">
+					<uni-data-select v-model="selectedProcess" :localdata="processList" :clear="false"
+						@change="handleProcessChange"></uni-data-select>
+				</uni-section>
 			</view>
 			</view>
 			<view class='middle'>
 			<view class='middle'>
 				<view class='segment'></view>
 				<view class='segment'></view>
 				<uni-icons type="paperclip" size="30" style="margin: 10rpx;"></uni-icons>
 				<uni-icons type="paperclip" size="30" style="margin: 10rpx;"></uni-icons>
 				<view class='segment'></view>
 				<view class='segment'></view>
-			</view> -->
+			</view>
 			<view>
 			<view>
 				<text class='title' style="margin-bottom: 50rpx;">基础信息</text>
 				<text class='title' style="margin-bottom: 50rpx;">基础信息</text>
 				<view class="uni-row info">
 				<view class="uni-row info">
 					<label for="HeatNo">炉号:</label>
 					<label for="HeatNo">炉号:</label>
-					<uni-data-select id="incomingInfo" class="uni-input data-select" v-model="basicInfo" :localdata="furnaceNumberInfoList" :clear="false"
+					<uni-data-select id="incomingInfo" class="uni-input data-select" v-model="basicInfo"
+						:localdata="furnaceNumberInfoList" :clear="false"
 						@change="handleFurnaceNumberChange"></uni-data-select>
 						@change="handleFurnaceNumberChange"></uni-data-select>
 					<!-- <input id="HeatNo" class="uni-input" v-model="basicInfo.heatNo" placeholder="请填写" /> -->
 					<!-- <input id="HeatNo" class="uni-input" v-model="basicInfo.heatNo" placeholder="请填写" /> -->
 					<!-- <text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text> -->
 					<!-- <text id="HeatNo" class="uni-input">{{basicInfo.heatNo}}</text> -->
@@ -68,7 +75,8 @@
 				<view class="uni-row info">
 				<view class="uni-row info">
 					<label for="incomingInfo">材质:</label>
 					<label for="incomingInfo">材质:</label>
 					<!-- <input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" /> -->
 					<!-- <input id="incomingInfo" class="uni-input" v-model="basicInfo.incomingInfo" placeholder="请填写" /> -->
-					<text id="incomingInfo" class="material uni-input">{{basicInfo.firstTechnicalRequirement}}{{basicInfo.secondTechnicalRequirement || basicInfo.secondTechnicalRequirement != '' ? basicInfo.secondTechnicalRequirement : ''}}</text>
+					<text id="incomingInfo"
+						class="material uni-input">{{basicInfo.firstTechnicalRequirement}}{{basicInfo.secondTechnicalRequirement || basicInfo.secondTechnicalRequirement != '' ? basicInfo.secondTechnicalRequirement : ''}}</text>
 				</view>
 				</view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 				<view class='segment' style="width: 90%;margin: 20rpx auto;"></view>
 			</view>
 			</view>
@@ -105,6 +113,9 @@
 	import {
 	import {
 		getToken
 		getToken
 	} from '@/utils/auth'
 	} from '@/utils/auth'
+	import {
+		getProcessList
+	} from '@/api/business/deptProcess.js'
 
 
 	const batchNoCheck = ref(null) // 批次号是否选中
 	const batchNoCheck = ref(null) // 批次号是否选中
 	const batchNoList = ref([]) // 批次号列表
 	const batchNoList = ref([]) // 批次号列表
@@ -116,6 +127,8 @@
 	const emit = defineEmits(['batchReporting-addBatch']);
 	const emit = defineEmits(['batchReporting-addBatch']);
 	const inpValue = ref('')
 	const inpValue = ref('')
 	const lotList = ref([])
 	const lotList = ref([])
+	const selectedProcess = ref(null)
+	const processList = ref([])
 
 
 	onLoad(() => {
 	onLoad(() => {
 		// 处理特殊字符JSON解析失败报错
 		// 处理特殊字符JSON解析失败报错
@@ -160,20 +173,38 @@
 			sslVerify: false,
 			sslVerify: false,
 			success: (res) => {
 			success: (res) => {
 				console.log(res.data);
 				console.log(res.data);
-				if(res.data.code == 200 && res.data.data.length > 0){
+				if (res.data.code == 200 && res.data.data.length > 0) {
 					for (let i = 0; i < res.data.data.length; i++) {
 					for (let i = 0; i < res.data.data.length; i++) {
 						furnaceNumberInfoList.value[i] = {
 						furnaceNumberInfoList.value[i] = {
 							text: res.data.data[i].factory,
 							text: res.data.data[i].factory,
 							value: res.data.data[i]
 							value: res.data.data[i]
-						} 
+						}
 					}
 					}
-					
+
 					basicInfo.value = res.data.data[0];
 					basicInfo.value = res.data.data[0];
 					console.log(basicInfo.value);
 					console.log(basicInfo.value);
 					console.log(furnaceNumberInfoList.value)
 					console.log(furnaceNumberInfoList.value)
 				}
 				}
 			}
 			}
 		})
 		})
+		
+		getProcessList({
+			deptId: store.curDeptDetails.deptId,
+		}).then(res => {
+			if (res.code == 200) {
+				//过滤出工序交集
+				let filteredData = res.data.filter((item1) =>
+					store.dayworkInfo.processSequence.some((item2) => item2.processCode === item1.processCode)
+				);
+				for (let i = 0; i < filteredData.length; i++) {
+					processList.value[i] = {
+						text: filteredData[i].processAlias,
+						value: filteredData[i].processId
+					}
+				}
+				selectedProcess.value = filteredData[0].processId;
+			} 
+		})
 	}
 	}
 
 
 	// function handleCheckBatchNo(item) {
 	// function handleCheckBatchNo(item) {
@@ -258,8 +289,12 @@
 		);
 		);
 	}
 	}
 
 
-	function handleFurnaceNumberChange(){
-		
+	function handleFurnaceNumberChange() {
+
+	}
+	
+	function handleProcessChange() {
+	
 	}
 	}
 
 
 	// function handleScanCode() {
 	// function handleScanCode() {
@@ -494,9 +529,14 @@
 			}
 			}
 		}
 		}
 	}
 	}
-	
+
 	.material {
 	.material {
 		height: auto;
 		height: auto;
 		width: 60%;
 		width: 60%;
 	}
 	}
+	
+	.selectedProcess {
+		width: 88%;
+		margin: 20rpx auto 40rpx;
+	}
 </style>
 </style>

+ 10 - 3
pages/dashboard/index.vue

@@ -87,9 +87,16 @@
 	}
 	}
 
 
 	function handleToProductionPlan() {
 	function handleToProductionPlan() {
-		uni.navigateTo({
-			url: '/pages/productionPlan/index'
-		})
+		if(curSelectedDept.value){
+			uni.navigateTo({
+				url: '/pages/productionPlan/index'
+			})
+		}else{
+			uni.showToast({
+				icon: "none",
+				title: "请选择工段"
+			})
+		}
 	}
 	}
 
 
 	function handleToHandlingList() {
 	function handleToHandlingList() {