From 32b10def2b0944c4afbe4d89e55261c39a690f1d Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 17 七月 2025 13:40:09 +0800
Subject: [PATCH] #

---
 pages/listing/matnrPalletising.vue |  191 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 150 insertions(+), 41 deletions(-)

diff --git a/pages/listing/matnrPalletising.vue b/pages/listing/matnrPalletising.vue
index e4f8d9d..50618e4 100644
--- a/pages/listing/matnrPalletising.vue
+++ b/pages/listing/matnrPalletising.vue
@@ -1,5 +1,7 @@
 <template>
 	<view class="has-foot">
+		<view>
+		
 		<form>
 			<view class="cu-form-group margin-top">
 				<view class="title">瀹瑰櫒鍙�</view>
@@ -11,15 +13,17 @@
 				<input placeholder="璇锋壂鎻忕墿鏂欑紪鐮�" v-model="matnrCode"></input>
 				<text class='cuIcon-search text-blue' @click="search"></text>
 			</view>
-			<!-- <view class="cu-form-group">
-				<view class="title">鎵规鍙�</view>
-				<input placeholder="璇疯緭鍏ョ墿鏂欐壒娆�" v-model="batch"></input>
-			</view> -->
+			<view class="cu-form-group">
+				<view class="title">ASN鍗曞彿</view>
+				<input placeholder="璇疯緭鍏SN鍗曞彿" v-model="asnCode"></input>
+			</view>
 		</form>
 
 		<view class="flex solid-bottom padding-sm justify-between">
 			<view class="text-blue">鐗╂枡鎬荤被:{{list.length}}</view>
 			<view class="text-blue">缁勭洏鎬绘暟:{{allCount}}</view>
+		</view>
+		
 		</view>
 
 		<view class="padding-lr margin-top-sm">
@@ -42,20 +46,18 @@
 					</view>
 					<view class="cu-item">
 						<view class="content">
+							<text class="text-black">鐗╂枡缂栫爜:</text>
+							<text class="text-grey ">{{item.maktx}}</text>
+						</view>
+					</view>
+					<view class="cu-item">
+						<view class="content">
 							<text class="text-black">ASN:</text>
 						</view>
 						<view class="action">
 							<text class="text-grey ">{{item.asnCode}}</text>
 						</view>
-					</view>
-					<view class="cu-item">
-						<view class="content">
-							<text class="text-black">鐗╂枡鏉$爜:</text>
-						</view>
-						<view class="action">
-							<text class="text-grey ">{{item.trackCode}}</text>
-						</view>
-					</view>
+					</view>					
 					<view class="cu-item">
 						<view class="content">
 							<text class="text-black">渚涘簲鍟嗘壒娆�:</text>
@@ -64,12 +66,9 @@
 							<text class="text-grey ">{{item.splrBatch}}</text>
 						</view>
 					</view>
-					<view class="cu-item">
+					<view class="cu-item">						
 						<view class="content">
-							<text class="text-black">搴撳瓨鎵规:</text>
-						</view>
-						<view class="action">
-							<text class="text-grey ">{{item.batch}}</text>
+							<text class="text-black">璐ㄦ缁撴灉: <text class="text-grey ">{{item.inspect}}</text></text>
 						</view>
 					</view>
 					<!-- <view class="cu-item">
@@ -96,7 +95,7 @@
 					<view class="cu-item">
 						<view class="content">
 							<text class="text-black">鍙粍鐩樻暟閲�: <text
-									class="text-grey ">{{item.anfme - item.workQty}}</text></text>
+									class="text-grey ">{{item.anfme - item.workQty - item.qty}}</text></text>
 						</view>
 						
 					</view>
@@ -106,8 +105,8 @@
 								<view class="title text-blue"><text
 										class="text-red text-xl vertical-middle">*</text>缁勭洏鏁伴噺:
 								</view>
-								<uni-number-box style="width: 70%;" :max="max" v-model="item.receiptQty"
-									:step='1'></uni-number-box>
+								<uni-number-box style="width: 70%;" :min="0" :max="max" :decimal="2" :step="0.01" v-model="item.receiptQty"
+									></uni-number-box>
 							</view>
 						</view>
 					</view>
@@ -139,7 +138,7 @@
 				megreQty: '',
 				list: [],
 				range: [],
-				batch: '',
+				asnCode: '',
 				repeatClick: false,
 				isconfirm: false,				
 				matnrCode:'',
@@ -153,31 +152,91 @@
 			}
 		},
 		mounted() {},
-		methods: {
+		methods: {			
 			async search() {
 				const find = this.list.find(el => el.trackCode === this.barcode);
 				find ? this.scrollTo() : this.getDet();
 
 			},
-			async getDet() {
-				const {
-					code,
-					data,
-					msg
-				} = await request('/asnOrderItem/trackCode', {
-					matnrCode: this.matnrCode
-				}, "post")
-				if (code === 200) {
-					this.list = data
-				} else {
+			getDet() {
+				let that = this;
+				uni.navigateTo({
+					url: "../listing/itemSelect",
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+						res.eventChannel.emit('data', {
+							matnrCode: that.matnrCode,
+							asnCode: that.asnCode
+						})
+					},
+					events: {
+						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+						backData: function(data) {									
+							that.showBackData(data.data)
+						},
+					},
+				
+				
+				});
+			},
+			// async getDet() {
+			// 	let that = this;
+			// 	const {
+			// 		code,
+			// 		data,
+			// 		msg
+			// 	} = await request('/asnOrderItem/trackCode', {
+			// 		matnrCode: that.matnrCode,
+			// 		asnCode: that.asnCode
+			// 	}, "post")
+			// 	if (code === 200) {
+			// 		data.map(item => {
+			// 			item.receiptQty = 0;
+			// 			item.selected = false;
+			// 		})
+			// 		// for (var i = 0; i < data.length; i++) {
+			// 		// 	data[i].receiptQty =1;
+			// 		// 	data[i].selected = false;							
+			// 		// }
+			// 		if(data !== [] || data !== null){					
+			// 		uni.navigateTo({
+			// 				url: "../listing/itemSelect",
+			// 				success: function(res) {
+			// 					// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+			// 					res.eventChannel.emit('data', {
+			// 						item: data
+			// 					})
+			// 				},
+			// 				events: {
+			// 					// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+			// 					backData: function(data) {									
+			// 						that.showBackData(data.data)
+			// 					},
+			// 				},
+						
+						
+			// 			});
+						
+			// 		}
+						
+			// 		// this.list = data
+			// 	} else {
+			// 		uni.showToast({
+			// 			title: msg,
+			// 			icon: "none",
+			// 			position: 'top'
+			// 		})
+			// 	}
+			// },
+			async getList() {
+				if(this.container === '' || this.container === null){
 					uni.showToast({
-						title: msg,
+						title: "瀹瑰櫒鐮佷负绌�",
 						icon: "none",
 						position: 'top'
 					})
+					return ;
 				}
-			},
-			async getList() {
 				const {
 					code,
 					data,
@@ -186,7 +245,11 @@
 					barcode: this.container
 				})
 				if (code === 200) {
-					this.list = data
+					uni.showToast({
+						title: msg,
+						icon: "success",
+						position: 'top'
+					})
 				} else {
 					uni.showToast({
 						title: msg,
@@ -194,6 +257,36 @@
 						position: 'top'
 					})
 				}
+			},
+			showBackData(data){				
+				let status ;
+				data.map(item => {					
+					this.list.push(item)
+				})	
+				let oldLength = this.list.length
+				this.list = this.list.filter((item, index, self) =>
+					self.findIndex(i => (
+						i.id === item.id // 鏍规嵁id鍘婚噸
+					)) === index && item.isptResult === self[0].isptResult
+				);
+				let newLength = this.list.length
+				
+				if(oldLength > newLength){	
+					this.showMsg("鏂版槑缁嗚杩囨护锛岃妫�鏌ョ姸鎬�")
+					
+				}
+								
+			},
+			showMsg(msg){				
+				setTimeout(function() {
+				 uni.showToast({
+				 	icon: "none",
+				 	position: 'top',
+				 	title: msg,
+				 	duration:2000,				 	
+				 })
+				}, 200);
+				
 			},
 			scrollTo() {
 				const ref = this.$refs[`${this.barcode}ref`][0];
@@ -223,8 +316,25 @@
 				this.isconfirm = false
 			},
 			async confirm() {
-				this.repeatClick = true
+				if(this.container === '' || this.container === null){
+					uni.showToast({
+						title: "瀹瑰櫒鐮佷负绌�",
+						icon: "none",
+						position: 'top'
+					})
+					return ;
+				}
+				if(this.list.length ===0 || this.list === null){
+					uni.showToast({
+						title: "鏈坊鍔犳槑缁�",
+						icon: "none",
+						position: 'top'
+					})
+					return ;
+				}
+				this.repeatClick = true				
 				const newArr = this.list.map(item => {
+					
 					return {
 						...item,
 						anfme: item.anfme === null ? 0 : +item.anfme,						
@@ -237,8 +347,7 @@
 					msg
 				} = await request('/waitPakin/merge', {
 					items: newArr,
-					barcode: this.container,
-					batch: this.batch,
+					barcode: this.container,					
 				})
 				if (code === 200) {
 					uni.showToast({

--
Gitblit v1.9.1