From f815627a748d2ec5f68f1579443e231acc6fd1ba Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 07 五月 2025 10:05:44 +0800
Subject: [PATCH] #物料组盘

---
 pages/listing/itemSelect.vue       |  328 ++++++++++++++++++++++++++++++++++++++++++++++
 pages/listing/matnrPalletising.vue |   48 +++++-
 pages/listing/disc.vue             |    3 
 pages.json                         |    7 +
 4 files changed, 375 insertions(+), 11 deletions(-)

diff --git a/pages.json b/pages.json
index 0278378..70790d0 100644
--- a/pages.json
+++ b/pages.json
@@ -37,6 +37,13 @@
 			}
 		},
 		{
+			"path": "pages/listing/itemSelect",
+			"style": {
+				"navigationBarTitleText": "閫夋嫨鐗╂枡",
+				"enablePullDownRefresh": false
+			}
+		},
+		{
 			"path": "pages/listing/untie",
 			"style": {
 				"navigationBarTitleText": "瑙g粦"
diff --git a/pages/listing/disc.vue b/pages/listing/disc.vue
index d2debba..ee12153 100644
--- a/pages/listing/disc.vue
+++ b/pages/listing/disc.vue
@@ -156,8 +156,7 @@
 					})
 					return
 				}
-				const find = this.list.find(el => el.trackCode === this.barcode);
-				find ? this.scrollTo() : this.getDet();
+				this.getDet();
 			},
 			async getDet() {
 				const {
diff --git a/pages/listing/itemSelect.vue b/pages/listing/itemSelect.vue
new file mode 100644
index 0000000..d803bc0
--- /dev/null
+++ b/pages/listing/itemSelect.vue
@@ -0,0 +1,328 @@
+<template>
+	<view>
+		<!-- 鎼滅储妗� -->
+		<view class="search-bar">
+			<uni-search-bar v-model="condition" placeholder=" 鎵爜 / 杈撳叆" bgColor="#EEEEEE" @confirm="search" />
+		</view>		
+		<view>
+			<view class="padding-lr margin-top-sm">
+				<block v-for="(item, index) in matList" :key="index">
+					<view class="cu-list det menu sm-border margin-bottom-sm " :class="[item.selected === true &&'act']" @click="selectedItem(index)">
+						<view class="cu-bar bg-white solid-bottom " >
+							<view class="action">
+								<view class="index">
+									{{index+1}}
+								</view>
+								<view class="text-blue">
+									缂栫爜:
+									{{`${item.matnrCode}`}}
+								</view>
+							</view>
+							<view class="action">
+								<text v-if="item.selected" class="cuIcon-check text-green" style="font-size: 24px;"></text>
+								<text v-else  class="cuIcon-close text-red" style="font-size: 24px;"></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 class="cu-item">
+							<view class="content">
+								<text class="text-black">渚涘簲鍟嗘壒娆�:</text>
+							</view>
+							<view class="action">
+								<text class="text-grey ">{{item.splrBatch}}</text>
+							</view>
+						</view>
+						<view class="cu-item">
+							<view class="content">
+								<text class="text-black">搴撳瓨鎵规:</text>
+							</view>
+							<view class="action">
+								<text class="text-grey ">{{item.batch}}</text>
+							</view>
+						</view>
+						<!-- <view class="cu-item">
+							<view class="content">
+								<text class="text-black">骞冲彴琛屽彿: <text class="text-grey ">{{item.platformId}}</text></text>
+							</view>
+							<view class="content">
+								<text class="text-black">璐ㄦ缁撴灉: <text class="text-grey ">{{item.inspect}}</text></text>
+							</view>
+						</view> -->
+			
+						<view class="cu-item">
+							<view class="content">
+								<text class="text-black">搴撳瓨鍗曚綅: <text class="text-grey ">{{item.stockUnit}}</text></text>
+							</view>
+							<view class="content">
+								<text class="text-black">鏀惰揣鏁伴噺: <text class="text-grey ">{{item.anfme}}</text></text>
+							</view>
+							<view class="content">
+								<text class="text-black">宸蹭笂鏋舵暟閲�: <text
+										class="text-grey ">{{item.workQty + item.qty}}</text></text>
+							</view>
+						</view>
+						<view class="cu-item">
+							<view class="content">
+								<text class="text-black">鍙粍鐩樻暟閲�: <text
+										class="text-grey ">{{item.anfme - item.workQty}}</text></text>
+							</view>							
+						</view>
+						
+					</view>
+				</block>
+			</view>
+		</view>
+		<!-- <uni-load-more v-show="matList.length != 0" :status="status" :icon-size="16" :content-text="contentText" /> -->
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tagList: [],
+				matList: [],
+				condition: '',
+				reload: false,
+				curr:1,
+				tag: '鍒嗙被',
+				baColor: "background-color: #0081ff;",
+				desc: '鍟嗗搧缂栧彿:',
+				baseUrl: '',
+				token: '',
+				status: 'more',
+				contentText: {
+					contentdown: '涓婃媺鍔犺浇鏇村',
+					contentrefresh: '鍔犺浇涓�',
+					contentnomore: '娌℃湁鏇村'
+				},
+				// 褰撳墠tagId
+				tagIdNow: 1,
+				itemStyle: {
+				    border: "1px solid #e54d42",
+				},
+				selectedList:[]
+				
+			}
+		},
+		// onReachBottom() {
+		// 	this.status = 'more';
+		// 	this.showMat(this.tagIdNow);
+		// },
+		onLoad() {
+			// 娌″暐鐢ㄤ簡
+			let that = this
+			// const eventChannel = this.$scope.eventChannel; // 鍏煎APP-NVUE
+			const eventChannel = this.getOpenerEventChannel();
+			
+			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+			eventChannel.on('data', function(data) {
+				console.log(data.item)
+				that.matList = data.item
+			})
+		},
+		onShow() {
+			this.baseUrl = uni.getStorageSync('baseUrl');
+			this.token = uni.getStorageSync('token');
+			
+		},
+		methods: {
+			selectedItem(index){
+				
+				if(this.matList[index].selected === '' || this.matList[index].selected === null || this.matList[index].selected === undefined){
+					this.matList[index].selected = true
+				}else{
+					this.matList[index].selected = !this.matList[index].selected
+				}
+				console.log(this.matList[index].selected)
+			},
+			search() {
+				let that = this
+				uni.request({
+				    url: that.baseUrl + '/order/search/pda/auth',
+				    data: {
+						condition: that.condition
+				    },
+					method:"GET",
+				    header: {
+						'token':uni.getStorageSync('token'),
+				    },
+					success(result) {
+						console.log(result);
+						var res = result.data
+						if (res.code === 200 ) {
+							that.matList = res.data
+							// that.save()
+						} else if (res.code == 403) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+						}
+					}
+				});
+			},
+			showTag(parentId) {
+				let that = this
+				uni.request({
+				    url: that.baseUrl + '/tag/list/pda/auth',
+					header: {
+						'token':uni.getStorageSync('token'),
+					},
+				    data: {
+						limit: 100000,
+						parentId: parentId
+				    },
+					header: {
+						'token':uni.getStorageSync('token'),
+					},
+					success(result) {
+						that.tagList = null
+						that.matList = []
+						var res = result.data
+						if (res.code === 200) {
+							if (res.data != null && res.data.length > 0) {
+								that.tagList = res.data
+							} else {
+								that.showMat(parentId)
+							}
+							that.baColor = "background-color: #0081ff;"
+						} else if (res.code === 403 ) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+						}
+					}
+				});
+			},
+			showMat(tagId) {
+				let that = this				
+				// wms绔� 琛ユ帴鍙�
+				// @RequestMapping(value = "/mat/list/pda/page/auth")
+				// @ManagerAuth
+				// public R pdaPageList(@RequestParam(required = true)Long tagId,
+				// 					 @RequestParam(defaultValue = "1")Integer curr,
+				// 					 @RequestParam(defaultValue = "10")Integer limit){
+				// 	EntityWrapper<Mat> wrapper = new EntityWrapper<>();
+				// 	wrapper.eq("tag_id", tagId);
+				// 	wrapper.orderBy("create_time", false);
+				// 	return R.ok().add(matService.selectPage(new Page<>(curr, limit), wrapper));
+				// }
+				uni.request({
+				    url: that.baseUrl + '/order/list/pda/page/auth',
+				    data: {
+						curr:that.curr,
+						limit: 100,
+						tagId: tagId
+				    },
+					method:"GET",
+				    header: {
+						'token':uni.getStorageSync('token'),
+				    },
+					success(result) {
+						that.tagList = null
+						var res = result.data
+						if (res.code === 200) {
+							if (res.data.records != null && res.data.records.length > 0) {
+								let list = res.data.records
+								that.matList = that.reload ? list : that.matList.concat(list);
+								that.curr = that.curr + 1
+							}
+							if (res.data.records.length == 0) {
+								that.status = 'noMore'
+							}
+							that.baColor = "background-color: #1cbbb4;"
+						} else if (res.code === 403 ) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+						}
+						
+					}
+				});
+			},
+			toPrint(item) {
+				let that = this
+				uni.navigateTo({
+					url: "../order/orderDetlList",
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+						res.eventChannel.emit('data', {
+							data: item
+						})
+					},
+					events: {
+						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+						acceptDataFromOpenedPage: function(data) {
+							that.matnr = data.data
+							that.findMat(that.matnr)
+						},
+					},
+				
+				
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+	@import url('../../static/css/wms.css/wms.css');
+	.index {
+		border: 1px solid #e54d42;
+		color: #e54d42;
+		border-radius: 50%;
+		display: block;
+		width: 50rpx;
+		height: 50rpx;
+		line-height: 48rpx;
+		text-align: center;
+		margin-right: 20rpx;
+		font-size: 30rpx;
+	}
+	
+	.text-blue {
+		color: #0081ff !important;
+	
+	}
+	
+	.act {
+		border: 1px solid #e54d42;
+	}
+	
+	.item {
+		position: relative;
+		display: flex;
+		min-height: 80upx;
+		align-items: center;
+	}
+</style>
\ No newline at end of file
diff --git a/pages/listing/matnrPalletising.vue b/pages/listing/matnrPalletising.vue
index e4f8d9d..fc247ce 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">
@@ -139,7 +143,7 @@
 				megreQty: '',
 				list: [],
 				range: [],
-				batch: '',
+				asnCode: '',
 				repeatClick: false,
 				isconfirm: false,				
 				matnrCode:'',
@@ -153,7 +157,7 @@
 			}
 		},
 		mounted() {},
-		methods: {
+		methods: {			
 			async search() {
 				const find = this.list.find(el => el.trackCode === this.barcode);
 				find ? this.scrollTo() : this.getDet();
@@ -165,9 +169,35 @@
 					data,
 					msg
 				} = await request('/asnOrderItem/trackCode', {
-					matnrCode: this.matnrCode
+					matnrCode: this.matnrCode,
+					asnCode: this.asnCode
 				}, "post")
 				if (code === 200) {
+					// if(data !== [] || data !== null){					
+					// uni.navigateTo({
+					// 		url: "../listing/itemSelect",
+					// 		success: function(res) {
+					// 			// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+					// 			res.eventChannel.emit('data', {
+					// 				item: data
+					// 			})
+					// 		},
+					// 		events: {
+					// 			// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+					// 			acceptDataFromOpenedPage: function(data) {
+					// 				that.matnr = data.data
+					// 				that.findMat(that.matnr)
+					// 			},
+					// 		},
+						
+						
+					// 	});
+						
+					// }
+					for (var i = 0; i < data.length; i++) {
+						data[i].receiptQty =1;
+						data[i].selected = false;							
+					}	
 					this.list = data
 				} else {
 					uni.showToast({
@@ -225,6 +255,7 @@
 			async confirm() {
 				this.repeatClick = true
 				const newArr = this.list.map(item => {
+					
 					return {
 						...item,
 						anfme: item.anfme === null ? 0 : +item.anfme,						
@@ -237,8 +268,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