ezhizao_zx 1 year ago
parent
commit
ee3df71205

+ 2 - 2
components/dialog-turnoverApplicationAll/dialog-turnoverApplicationAll.vue

@@ -247,13 +247,13 @@
 
 			/**** 此处暂时为硬编码,170000为外协部门编码,根据编码查询信息 ***/
 			curDayworkItem.value.deptCode = 170000;
-			close();
 			turnoverOutsourceAll(curDayworkItem.value).then(res => {
 				if (res.code === 200) {
 					uni.showToast({
 						icon: 'success',
 						title: '操作成功'
 					});
+					baseDialog.value.close()
 					emit('reflushDaywork');
 				} else {
 					uni.showToast({
@@ -311,13 +311,13 @@
 					title: '请选择完整信息'
 				});
 			} else {
-				close();
 				turnoverAll(curDayworkItem.value).then(res => {
 					if (res.code === 200) {
 						uni.showToast({
 							icon: 'success',
 							title: '操作成功'
 						});
+						baseDialog.value.close()
 						emit('reflushDaywork');
 					} else {
 						uni.showToast({

+ 18 - 0
pages/batchReporting/index.vue

@@ -408,6 +408,15 @@
 							console.log(response)
 							console.log(response.data[0].productionPlanDetailId)
 							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) {
 								console.log(response.data)
 								lotDialog.value.open(response.data);
@@ -438,6 +447,15 @@
 					console.log(response)
 					console.log(response.data[0].productionPlanDetailId)
 					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) {
 						console.log(response.data)
 						lotDialog.value.open(response.data);

+ 20 - 3
pages/outsourcedReturnCheck/carriers.vue

@@ -96,6 +96,7 @@
 	function cancelConfirm() {
 		inputDialog.value.close()
 	}
+
 	function continueScna() {
 		inputDialog.value.close()
 		handleScanCode()
@@ -105,7 +106,9 @@
 		// 获取该外协单所有关联箱
 		getOutsourceOrderCarrier(form.value).then(res => {
 			// console.log(res)
-			details.value = res.data
+			details.value = res.data.details
+			form.value.carrierCount = res.data.form.carrierCount
+			console.log(res)
 		})
 	}
 
@@ -140,16 +143,30 @@
 						return;
 					}
 					let checked = false
+					let allChecked = true
 					details.value.forEach(l => {
 						checked = checked || (l.carriers.findIndex(e => e.id === vehicleObj.carrierId) >= 0)
+						// allChecked = allChecked && (l.carriers.findIndex(e => e.id === vehicleObj.carrierId) >= 0)
+						if (checked) {
+							checkedCarriers.value.push(vehicleObj.carrierId)
+						}
+						allChecked = allChecked && checkedCarriers.values.includes(l.carriers)
 					})
 					if (checked) {
-						checkedCarriers.value.push(vehicleObj.carrierId)
 						uni.showToast({
 							icon: 'none',
 							title: '已扫箱' + vehicleObj.carrierCode
 						})
-						debounce(handleScanCode, 700)
+						if (allChecked) {
+							debonce(() => {
+								uni.showToast({
+									icon: 'none',
+									title: '已验证所有箱码'
+								})
+							}, 700)
+						} else {
+							debounce(handleScanCode, 700)
+						}
 					} else {
 						message.value = '该箱号' + vehicleObj.carrierCode + '不在此发出单'
 						inputDialog.value.open()

+ 9 - 0
pages/sorting/form.vue

@@ -330,6 +330,15 @@
 			})
 			return false;
 		}
+
+		if (dayworkItem.value.qualifiedNum < 0) {
+			uni.showToast({
+				icon: 'none',
+				title: "合格数不能为负数,请检查不合格信息后提交",
+				duration: 2000
+			})
+			return false;
+		}
 		return true
 		// unfitInfos.value.forEach((e, i) => {
 		// 	if (e.name)

+ 23 - 5
pages/switchDept/index.vue

@@ -63,7 +63,7 @@
 			</scroll-view>
 		</uni-drawer>
 		<view class="bottom uni-row">
-			<button class="start-batch-btn" style="margin-right: 10rpx; background-color: #68f000;"
+			<button class="start-batch-btn" style="margin-right: 10rpx; background-color: #60d500;"
 				@click="handleScanCode">扫码添加</button>
 			<button class="start-batch-btn" :disabled="allData.length === 0" type="primary"
 				@click="showDoTurnover">周转申请</button>
@@ -93,6 +93,9 @@
 	import {
 		store
 	} from '@/store/index.js'
+	import {
+		debounce
+	} from '@/utils/common.js'
 
 	const turnoverApplicationDialog = ref(null)
 	const selectProduction = ref(null)
@@ -146,13 +149,25 @@
 						})
 						return;
 					}
+					// 测试时用
 					getDayworkByCarrierCode({
 						carrierId: vehicleObj.carrierId,
 						status: 7,
 						deptId: store.curDeptDetails.deptId
 					}).then(res => {
 						if (res.code == 200) {
-							console.log(res)
+							if (res.data.length === 0) {
+								uni.showToast({
+									title: '该批次未周转到当前工段',
+									icon: 'none'
+								})
+							} else {
+								allData.value.push(...res.data.filter(v =>
+									allData.value.findIndex(e => e.id === v.id) <
+									0))
+								handleSearch()
+								debounce(handleScanCode, 700)
+							}
 						} else {
 							uni.showToast({
 								icon: 'none',
@@ -160,6 +175,8 @@
 								duration: 2000
 							})
 						}
+					}).catch(err => {
+						console.log(err)
 					})
 				}
 			);
@@ -234,13 +251,14 @@
 	function handleClickProcessList(item) {
 		let curProcessAfterList = [];
 		let nextIndex = 0;
+		console.log(item)
 		for (let i = 0; i < item.processSequence.length; i++) {
-			if (item.technologicalProcessDetail.id == item.processSequence[i].id) {
+			if (item.technologicalProcessDetail.id == item.processSequence[i].technologicalProcessDetailId) {
 				nextIndex = i;
 			}
 		}
 		for (let i = 0; i < item.processSequence.length; i++) {
-			if (i >= nextIndex) {
+			if (i > nextIndex) {
 				curProcessAfterList.push(item.processSequence[i]);
 			}
 		}
@@ -254,7 +272,7 @@
 <style lang="scss">
 	$nav-height: 60rpx;
 	$gray: #ebebeb;
-	$green: #68f000;
+	$green: #62e200;
 
 	/* 遮罩层样式 */
 	.mask {