From 75291ece8be07085269e56210e2d3fe10adb4735 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 31 七月 2024 14:56:16 +0800
Subject: [PATCH] #

---
 pages/locDetl/locDetl.vue |   84 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 77 insertions(+), 7 deletions(-)

diff --git a/pages/locDetl/locDetl.vue b/pages/locDetl/locDetl.vue
index 3386dec..d5a2254 100644
--- a/pages/locDetl/locDetl.vue
+++ b/pages/locDetl/locDetl.vue
@@ -15,12 +15,13 @@
 			</view>
 		</scroll-view>
 		<view>
-			<view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item)">
+			<view class="tag-list" v-for="(item,i) in matList" :key="i">				
 				<view class="tag">
-					<view style="display: flex;">
+					<view style="display: flex; justify-content: space-between;">
 						<view class="wms-tag" :style="baColor" >鍟嗗搧</view>
+						<checkbox class="wms-tag" :value="item.matnr" :checked="item.checked" @click="set(i)"/>
 					</view>
-				</view>
+				</view>				
 				<view class="tag-item">搴撲綅鍙凤細 {{item.locNo}}</view>
 				<view class="tag-item">鍟嗗搧缂栫爜锛� {{item.matnr  ? item.matnr : '--'}}</view>
 				<view class="tag-item">鎵瑰彿锛� {{item.batch  ? item.batch : '--'}}</view>
@@ -33,6 +34,8 @@
 			</view>
 		</view>
 		<uni-load-more v-show="matList.length != 0" :status="status" :icon-size="16" :content-text="contentText" />
+		
+		<view class="buttom"><button size="mini" type="primary" @click="findBySelect()">鎻愬彇</button></view>
 	</view>
 </template>
 
@@ -63,7 +66,7 @@
 		onReachBottom() {
 			this.status = 'more';
 			if (this.tagList == null) {
-				this.showMat(this.tagIdNow);
+				this.selectloc2();
 			}
 		},
 		onLoad() {
@@ -83,10 +86,14 @@
 			// this.showTag(10009)
 		},
 		methods: {
+			set(e) {
+				var ck = this.matList[e].checked
+				this.matList[e].checked = ck ? false:true
+			},
 			selectloc(){
 				let that = this
 				that.matList = []
-				
+				that.curr = 1
 				uni.request({
 				    url: that.baseUrl + '/locDetl/pda/select',
 				    data: {
@@ -110,6 +117,54 @@
 							}
 							if (res.data.records.length == 0) {
 								that.status = 'noMore'
+							}
+							for (var i = 0; i < that.matList.length; i++) {
+								that.$set(that.matList[i],'checked',false)
+							}
+							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'})
+						}
+						
+					}
+				});
+			},
+			selectloc2(){
+				let that = this
+				// that.matList = []
+				uni.request({
+				    url: that.baseUrl + '/locDetl/pda/select',
+				    data: {
+						curr:that.curr,
+						limit: 20,
+						matnr: that.condition
+				    },
+					method:"GET",
+				    header: {
+						'token':uni.getStorageSync('token'),
+				    },
+					success(result) {
+						console.log(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'
+							}
+							for (var i = 0; i < that.matList.length; i++) {
+								that.$set(that.matList[i],'checked',false)
 							}
 							that.baColor = "background-color: #1cbbb4;"
 						} else if (res.code === 403 ) {
@@ -242,8 +297,15 @@
 					}
 				});
 			},
-			findBySelect(matnr) {
-				this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: matnr});
+			findBySelect() {
+				var checkedList = []
+				for(var i = 0; i < this.matList.length; i++) {
+					var t = !this.matList[i].checked
+					if (this.matList[i].checked) {
+						checkedList.push(this.matList[i])
+					}
+				}				
+				this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: checkedList});
 				uni.navigateBack({
 					
 				})
@@ -285,4 +347,12 @@
 		color: #606266;
 		font-size: 14px;
 	}
+	.aside {
+		width: 100rpx;
+		/* background-color: #303133; */
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	
 </style>
\ No newline at end of file

--
Gitblit v1.9.1