guoyujia 1 سال پیش
والد
کامیت
fd27f3749a

+ 8 - 0
api/business/dayWork.js

@@ -30,6 +30,14 @@ export function showDaywork(data) {
 	})
 }
 
+export function selectProcessList(data) {
+	return req.request({
+		url:'/business/daywork/selectProcessList',
+		method: 'GET',
+		data: data
+	})
+}
+
 export function showDayworkSave(data) {
 	return req.request({
 		url:'/business/daywork/showDayworkSave',

+ 23 - 0
api/business/lot.js

@@ -11,3 +11,26 @@ export function getLotList(data) {
 		data: data
 	})
 }
+
+/**
+ * 查询计划单当前工段废品回用批次列表
+ * @param {Object} data
+ */
+export function getWasteRecyclingLot(data) {
+	return req.request({
+		url:'/business/lot/getWasteRecyclingLot',
+		method: 'GET',
+		data: data
+	})
+}
+/**
+ * 查询当前批号绑定的工序
+ * @param {Object} data
+ */
+export function getProcessListByLot(data) {
+	return req.request({
+		url:'/business/lot/getProcessListByLot',
+		method: 'GET',
+		data: data
+	})
+}

+ 1 - 1
components/dialog-lotInfo/dialog-lotInfo.vue

@@ -21,7 +21,7 @@
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">投入数</text>
-				<text class="label right">{{lotData['processQualifiedNum'] == 0 ? lotData['isLast'] == 1 ? lotData['lastLotQuantity'] : lotData['oneLotQuantity'] : lotData['processQualifiedNum']}}</text>
+				<text class="label right">{{lotData['processQualifiedNum'] == 0 ? lotData['productionQuantity'] : lotData['processQualifiedNum']}}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">上道工序</text>

+ 10 - 4
components/dialog-selectEquipment/dialog-selectEquipment.vue

@@ -124,9 +124,10 @@
 			console.log(res)
 			if (res.code == 200) {
 				//过滤出工序交集store.dayworkInfo.processSequence
-				let filteredData = store.dayworkInfo.processSequence.filter((item1) =>
-					res.data.some((item2) => item2.processCode === item1.processCode)
-				);
+				let filteredData = store.dayworkInfo.processSequence.filter((item1) =>{
+					 return res.data.some(item2 => item2.processCode === item1.processCode) &&
+					    store.dayworkInfo.currentProcess.processStepNumber === item1.processStepNumber;
+				});
 				console.log(filteredData)
 				/* 20240409 修改
 				for (let i = 0; i < filteredData.length; i++) {
@@ -140,10 +141,12 @@
 					// console.log(processList.value)
 				}
 				*/
+			   console.log(store.dayworkInfo)
 			    processList.value = filteredData.map(v => ({
 					text: v.processAlias,
 					value: v.technologicalProcessDetailId,
-					processId: v.id
+					processId: v.id,
+					processStepNumber:store.dayworkInfo.currentProcess.processStepNumber
 			    }))
 				console.log(processList.value)
 				selectedProcess.value = filteredData[0].technologicalProcessDetailId;
@@ -192,6 +195,7 @@
 	function open(data) {
 		resetPage()
 		firstItem.value = data;
+		console.log(store.dayworkInfo)
 		userName.value = null;
 		userList.value = [];
 		init();
@@ -284,6 +288,7 @@
 				technologicalProcessDetailId: selectedProcess.value,
 				processId: store.dayworkInfo.processSequence.findIndex(v => v.technologicalProcessDetailId === selectedProcess.value) >= 0 ? store.dayworkInfo.processSequence.find(v => v.technologicalProcessDetailId === selectedProcess.value).id : null,
 				equipmentDetailId: selectedEquipment.value.commonId,
+				processStepNumber:store.dayworkInfo.currentProcess.processStepNumber,
 				equipmentDetailCode: selectedEquipment.value.commonCode,
 				startTime: timestampToTime(new Date()),
 				status: 1,
@@ -299,6 +304,7 @@
 				technologicalProcessDetailId: selectedProcess.value,
 				processId: store.dayworkInfo.processSequence.findIndex(v => v.technologicalProcessDetailId === selectedProcess.value) >= 0 ? store.dayworkInfo.processSequence.find(v => v.technologicalProcessDetailId === selectedProcess.value).id : null,
 				equipmentDetailId: selectedEquipment.value.commonId,
+				processStepNumber:store.dayworkInfo.currentProcess.processStepNumber,
 				equipmentDetailCode: selectedEquipment.value.commonCode,
 				collaborationList: selectedUserList.value
 			});

+ 89 - 40
components/dialog-selectProduction/dialog-selectProduction.vue

@@ -30,7 +30,8 @@
 		store
 	} from '../../store';
 	import {
-		getAvailableCarrierList
+		getAvailableCarrierList,
+		selectProcessList
 	} from '@/api/business/dayWork.js'
 	import {
 		getProcessList
@@ -39,52 +40,79 @@
 	const baseDialog = ref(null)
 	const selectedProcess = ref(0)
 	const processList = ref([])
+	const isNormalLot = ref("true")
 	const curProcessId = ref('')
+	const processSquence = ref([])
 	const carrierList = ref([])
 
-	function open() {
+	function open(data) {
 		reset();
 		console.log(store.planDetails)
-		getProcessList({
+		console.log(data)
+		if(data == 1) {
+			isNormalLot.value = "false"
+		}
+		// getProcessList({
+		// 	deptId: store.curDeptDetails.deptId,
+		// 	planDetailId: store.planDetails.id
+		// }).then(res => {
+		// 	if (res.code == 200) {
+		// 		for (let i = 0; i < res.data.length; i++) {
+		// 			processList.value[i] = {
+		// 				text: res.data[i].processAlias,
+		// 				value: res.data[i].processId
+		// 			}
+		// 		}
+		// 	}
+		// 	baseDialog.value.open()
+		// })
+		// return
+		Promise.all([getProcessList({
 			deptId: store.curDeptDetails.deptId,
 			planDetailId: store.planDetails.id
-		}).then(res => {
-			if (res.code == 200) {
-				for (let i = 0; i < res.data.length; i++) {
-					processList.value[i] = {
-						text: res.data[i].processAlias,
-						value: res.data[i].processId
-					}
-				}
-			}
-			baseDialog.value.open()
-		})
-		return
-		Promise.all([getProcessList({
-			deptId: store.curDeptDetails.deptId
 		}), getAvailableCarrierList({
 			planDetailId: store.planDetails.id,
 			deptId: store.curDeptDetails.deptId
-		})]).then(([res, response]) => {
-			if (res.code == 200) {
+		}), selectProcessList({
+			productionPlanDetailId: store.planDetails.id,
+			isNormalLot:isNormalLot.value,
+			deptId: store.curDeptDetails.deptId
+		})
+		])
+		.then(([res, response,resp]) => {
+			if (resp.code == 200) {
+				processSquence.value = resp.data
 				//过滤出工序交集
-				let filteredData = store.planDetails.processSequence.filter((item1) =>
+				let filteredData = resp.data.filter((item1) =>
 					res.data.some((item2) => item2.processCode === item1.processCode)
 				);
 				for (let i = 0; i < filteredData.length; i++) {
-					processList.value[i] = {
+					var processAliasList = [];
+					if(processAliasList.includes(filteredData[i].processAlias)) {
+						continue;
+					}else {
+						processAliasList.push(filteredData[i].processAlias)
+					    processList.value[i] = {
 						text: filteredData[i].processAlias,
 						value: filteredData[i].id
 					}
-				}
-
-				console.log(processList.value)
+					}
+			
 			}
+			console.log(processList.value)
 			/* 处理结果格式 */
 			carrierList.value = changeResultStructure(response.data)
 			console.log(carrierList.value)
 			console.log(store.userInfo)
 			baseDialog.value.open();
+			}
+			else {
+				uni.showToast({
+					icon: "error",
+					title: "请重新选择是否正常批次",
+					duration: 1000
+				})
+			}
 		})
 	}
 	/**
@@ -127,26 +155,47 @@
 	}
 
 	function handleProcessChange(e) {
+		console.log(store)
 		if (e == '' || e == null) {
 			Promise.all([getProcessList({
-				deptId: store.curDeptDetails.deptId
+				deptId: store.curDeptDetails.deptId,
+				planDetailId: store.planDetails.id
 			}), getAvailableCarrierList({
 				planDetailId: store.planDetails.id,
 				deptId: store.curDeptDetails.deptId
-			})]).then(([res, response]) => {
+			}), selectProcessList({
+				productionPlanDetailId: store.planDetails.id,
+				isNormalLot:isNormalLot.value,
+				deptId: store.curDeptDetails.deptId
+			})]).then(([res, response,resp]) => {
 				if (res.code == 200) {
-					//过滤出工序交集
-					let filteredData = store.planDetails.processSequence.filter((item1) =>
-						res.data.some((item2) => item2.processCode === item1.processCode)
-					);
-					for (let i = 0; i < filteredData.length; i++) {
-						processList.value[i] = {
-							text: filteredData[i].processAlias,
-							value: filteredData[i].id
-						}
-					}
+					// //过滤出工序交集
+					// let filteredData = store.planDetails.processSequence.filter((item1) =>
+					// 	res.data.some((item2) => item2.processCode === item1.processCode)
+					// );
+					// for (let i = 0; i < filteredData.length; i++) {
+					// 	processList.value[i] = {
+					// 		text: filteredData[i].processAlias,
+					// 		value: filteredData[i].id
+					// 	}
+					// }
 
-					console.log(processList.value)
+					// console.log(processList.value)
+				let filteredData = resp.data.filter((item1) =>
+					res.data.some((item2) => item2.processCode === item1.processCode)
+				);
+				for (let i = 0; i < filteredData.length; i++) {
+					var processAliasList = [];
+					if(processAliasList.includes(filteredData[i].processAlias)) {
+						continue;
+					}else {
+						processAliasList.push(filteredData[i].processAlias)
+					    processList.value[i] = {
+						text: filteredData[i].processAlias,
+						value: filteredData[i].id
+					}
+					}
+				}
 				}
 				/* 处理结果格式 */
 				carrierList.value = changeResultStructure(response.data);
@@ -154,9 +203,9 @@
 			})
 		} else {
 			let processIds = []
-			for (let i = 0; i < store.planDetails.processSequence.length; i++) {
-				processIds.push(store.planDetails.processSequence[i].id)
-				if (store.planDetails.processSequence[i].id == selectedProcess.value) {
+			for (let i = 0; i < processSquence.value.length; i++) {
+				processIds.push(processSquence.value[i].id)
+				if (processSquence.value[i].id == selectedProcess.value) {
 					break;
 				}
 			}

+ 7 - 2
components/dialog-turnoverApplication/dialog-turnoverApplication.vue

@@ -131,7 +131,10 @@
 		})
 		getDayWorkItemList({
 			dayworkId: dayworkInfo.value.id,
-			userId: store.userInfo.userId
+			userId: store.userInfo.userId,
+			lotId:dayworkInfo.value.lotId,
+			isWasteRecycling:dayworkInfo.value.isWasteRecycling,
+			processStepNumber:dayworkInfo.value.currentProcess.processStepNumber
 		}).then(res => {
 			curDayworkItem.value = {
 				...res.rows[0],
@@ -141,7 +144,9 @@
 		})
 		getDeptList({
 			tenantId: store.tenantId,
-			productionPlanDetailId: store.planDetails.id
+			productionPlanDetailId: store.planDetails.id,
+			lotId:dayworkInfo.value.lotId,
+			isWasteRecycling:dayworkInfo.value.isWasteRecycling
 		}).then(res => {
 			for (let i = 0; i < res.data.length; i++) {
 				deptList.value = res.data;

+ 72 - 25
pages/batchReporting/index.vue

@@ -9,6 +9,11 @@
 				搜索
 			</view>
 		</view>
+		<view class="list-title uni-row">
+			<text class="label">是否正常批次</text><text>是</text>
+			<switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" />
+			<text>否</text>
+		</view>
 		<view class="scroll-container">
 			<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
 				<text>暂无批次</text>
@@ -161,8 +166,10 @@
 	const bizDayworkObj = ref({})
 	const bottomStatus = ref(false) // 底部按钮显示
 	const reqParam = ref(null);
+	const normalStatus = ref(0)
 	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
 	const keywords = ref(null)
+	const tempList = ref([])
 	const wasteRecyclingList = ref([])//废品回用批次
 	const notPreProcess = ref(true)
 	const curProcessAfte = ref([])
@@ -170,6 +177,7 @@
 
 	onLoad(() => {
 		curPlan.value = store.planDetails;
+		normalStatus.value = 0
 		console.log(curPlan.value)
 		//废品回用的领料部门如果是当前工段,也要可以开始新批次
 		//查找当前计划单下的批次废品回用是当前工段
@@ -207,12 +215,13 @@
 					title: res.msg
 				})
 			}
-		}).catch(err => {
-			uri.showToast({
-				icon: "fail",
-				title: "网络请求失败。"
-			})
 		})
+		// .catch(err => {
+		// 	uri.showToast({
+		// 		icon: "fail",
+		// 		title: "网络请求失败。"
+		// 	})
+		// })
 	}
 
 	function handleStartNewBatch() {
@@ -233,7 +242,10 @@
 
 		getDayWorkList(reqData).then(res => {
 			if (res.code == 200) {
-				listData.value = res.data;
+				tempList.value = res.data
+				listData.value =  res.data.filter(item => {
+				    return item.isWasteRecycling == 0 && item.isAmend == 0;
+				});
 				for (let i = 0; i < listData.value.length; i++) {
 					if(listData.value[i].prevProcess){
 						let sum = 0;
@@ -285,9 +297,22 @@
 
 
 	function handleSearchCode() {
-		selectProduction.value.open();
+		selectProduction.value.open(normalStatus.value);
+	}
+	
+	function switchChange(event) {
+		console.log(event.detail.value)
+		//异常批
+		if (event.detail.value) {
+			listData.value = tempList.value.filter(item => {
+			    return item.isWasteRecycling == 1 || item.isAmend == 1;
+			});
+			normalStatus.value = 1
+		} else {
+			normalStatus.value = 0
+		}
 	}
-	/*
+	
 	function handleScanCode() {
 		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
@@ -369,23 +394,23 @@
 			})
 		}
 	}
-	*/
-	function handleScanCode() {
-		uni.scanCode({
-			onlyFromCamera: true,
-			success: function (res) {
-				if (res.scanType !== 'QR_CODE') {
-					uni.showToast({
-						icon: 'none',
-						title: '二维码未识别成功',
-						duration: 2000
-					})
-				}
-				console.log('条码类型:' + res.scanType);
-				console.log('条码内容:' + res.result);
-			}
-		});
-	}
+	
+	// function handleScanCode() {
+	// 	uni.scanCode({
+	// 		onlyFromCamera: true,
+	// 		success: function (res) {
+	// 			if (res.scanType !== 'QR_CODE') {
+	// 				uni.showToast({
+	// 					icon: 'none',
+	// 					title: '二维码未识别成功',
+	// 					duration: 2000
+	// 				})
+	// 			}
+	// 			console.log('条码类型:' + res.scanType);
+	// 			console.log('条码内容:' + res.result);
+	// 		}
+	// 	});
+	// }
 
 	function handleAddDaywork(data) {
 		console.log(data)
@@ -470,7 +495,29 @@
 			color: #808080;
 		}
 	}
+	.list-title {
+				width: 100%;
+				margin-top: 16rpx;
+				height: 64rpx;
+				line-height: 64rpx;
+				align-items: center;
+				margin-left: 32rpx;
 
+				.label {
+			
+					font-size: 32rpx;
+					margin-right: 24rpx;
+				}
+
+				.icon-gear {
+					font-size: 56rpx;
+				}
+			}
+
+			.switch {
+				margin-top: -8rpx;
+				transform: scale(0.7);
+			}
 	.scroll-container {
 		width: 92%;
 		margin: 24rpx auto 0 auto;

+ 4 - 1
pages/reportingForWork/index.vue

@@ -45,7 +45,7 @@
 				<view class="item-info uni-row">
 					<text class="label">投入数</text>
 					<text
-						class="label right">{{store.dayworkInfo['processQualifiedNum'] == 0 ? store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo['oneLotQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
+						class="label right">{{store.dayworkInfo['processQualifiedNum'] == 0 ?  store.dayworkInfo['productionQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">设备</text>
@@ -148,6 +148,9 @@
 		});
 		getDayWorkItemList({
 			dayworkId: dayWorkInfo.value.id,
+			lotId:dayWorkInfo.value.lotId,
+			isWasteRecycling:dayWorkInfo.value.isWasteRecycling,
+			processStepNumber:dayWorkInfo.value.currentProcess.processStepNumber,
 			// processId: store.dayworkInfo.currentProcess.id,
 			type: '非周转中item'
 		}).then(res => {