From 95cbe9595aa314006519b06640710023baa6eeac Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 26 六月 2023 12:49:51 +0800
Subject: [PATCH] #

---
 pages/home/home.vue         |    2 
 pages/order/orderPutOn2.vue |  139 ++++++++++++++++++++++++++++++++++-----------
 pages.json                  |    4 
 3 files changed, 107 insertions(+), 38 deletions(-)

diff --git a/pages.json b/pages.json
index 4446483..0ad18ff 100644
--- a/pages.json
+++ b/pages.json
@@ -33,7 +33,7 @@
 		{
 			"path": "pages/order/orderPakin",
 			"style": {
-				"navigationBarTitleText": "璁㈠崟鍏ュ簱"
+				"navigationBarTitleText": "璁㈠崟缁勬墭"
 			}
 		},
 		{
@@ -93,7 +93,7 @@
 		{
 			"path": "pages/order/orderPutOn2",
 			"style": {
-				"navigationBarTitleText": "璁㈠崟涓婃灦2"
+				"navigationBarTitleText": "璁㈠崟缁勬墭2"
 			}
 		},
 		{
diff --git a/pages/home/home.vue b/pages/home/home.vue
index c8474e8..67f9fc4 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -46,7 +46,7 @@
 						url: '/pakin/putOn'
 					},
 					{
-						title: '璁㈠崟涓婃灦2',
+						title: '璁㈠崟缁勬墭2',
 						name: 'putOn',
 						color: 'cyan',
 						cuIcon: 'pullup',
diff --git a/pages/order/orderPutOn2.vue b/pages/order/orderPutOn2.vue
index 2d67ba6..8da6f90 100644
--- a/pages/order/orderPutOn2.vue
+++ b/pages/order/orderPutOn2.vue
@@ -2,26 +2,26 @@
 	<view>
 		<view class="code">
 			<view class="item">
-				<view class="code-decs">搴撲綅鍙�:</view>
+				<view class="code-decs">鎵樼洏鐮�:</view>
 				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
 					@input="barcodeInput()">
 			</view>
 			<view class="item">
-				<view class="code-decs">鐗╂枡鍙�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()">
-				<view class="item-right">
-					<button></button>
-					<text style="text-align: right;color: #409EFF;" @click="selectMat()">鎼滅储</text>
-					<uni-icons type="right" color="#c1c1c1"></uni-icons>
-				</view>
+				<view class="code-decs">璁㈠崟鍙�:</view>
+				<uni-combox :candidates="orderNoList" placeholder="璇烽�夋嫨璁㈠崟" v-model="orderNo" @input="getOrderDet"></uni-combox>
 			</view>
 		</view>
 		<view class="mat-list-title">
-			鍟嗗搧鍒楄〃
+			<view style="width: 200rpx;"></view>
+			<view style="-webkit-flex: 1;flex: 1;">鍟嗗搧鍒楄〃</view>
+			<view style="width: 200rpx;"><button size="mini" type="primary" @click="getChecked">鎻愬彇</button></view>
 		</view>
 		<scroll-view>
-			<view class="list" v-for="(item,i) in dataList" :key="i">
-				<view class="list-left">
+			<checkbox-group class="list" v-for="(item,i) in dataList" :key="i" @change="checkboxChange">
+				<view class="aside">
+					<checkbox :value="item.matnr" :checked="item.checked" @click="set(i)"/>
+				</view>
+				<view class="list-left" style="margin: 0;">
 					<view class="list-left-item">
 						<view class="desc">No锛�</view>
 						<view class="left-item">{{i + 1}}</view>
@@ -67,7 +67,7 @@
 					<uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
 					<uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
 				</view>
-			</view>
+			</checkbox-group>
 		</scroll-view>
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
@@ -99,7 +99,8 @@
 					<view class="popup-item">
 						<view class="popup-item-left">鏁伴噺:</view>
 						<view class="popup-item-right" style="border: none;justify-content: center;">
-							<uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" />
+							<uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474"
+								@change="changeValue" />
 						</view>
 					</view>
 					<view class="btn">
@@ -148,7 +149,7 @@
 
 <script>
 	export default {
-		data () {
+		data() {
 			return {
 				baseUrl: '',
 				token: '',
@@ -156,6 +157,7 @@
 				barcode: '',
 				barcodeFocus: '',
 				dataList: [],
+				checkedDataList: [],
 				count: 0,
 				rowNum: '',
 				matnr: '',
@@ -170,14 +172,64 @@
 				barcodeFocus: true,
 				matFocus: false,
 				matData: '',
-				removeNum: 0
+				removeNum: 0,
+				orderNoList: [],
+				orderNo: '',
 			}
 		},
 		onShow() {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
+			this.getOrderNoList()
 		},
 		methods: {
+			set(e) {
+				var ck = this.dataList[e].checked
+				this.dataList[e].checked = ck ? false:true
+			},
+			getChecked() {
+				var checkedList = []
+				for(var i = 0; i < this.dataList.length; i++) {
+					var t = !this.dataList[i].checked
+					if (this.dataList[i].checked) {
+						checkedList.push(this.dataList[i])
+					}
+				}
+				this.dataList = checkedList
+			},
+			getOrderDet() {
+				let that = this
+				uni.request({
+					url: that.baseUrl + '/order/list/orderNo',
+					data: {orderNo: that.orderNo} ,
+					method: 'GET',
+					success(res) {
+						res = res.data;
+						if (res.code === 200) {
+							that.dataList = res.data
+							for (var i = 0; i < that.dataList.length; i++) {
+								that.$set(that.dataList[i],'checked',false)
+							}
+						}
+					}
+				})
+			},
+			checkboxChange: function (e) {
+			},
+			getOrderNoList() {
+				let that = this
+				uni.request({
+					url: this.baseUrl + '/order/list/all',
+					method: 'POST',
+					success(res) {
+						res = res.data
+						for (var i = 0; i < res.data.length; i++) {
+							that.orderNoList.push(res.data[i].order_no)
+						}
+					}
+				})
+			},
+
 			messageToggle(type) {
 				this.msgType1 = type
 				this.$refs.message.open()
@@ -209,7 +261,7 @@
 			// 鎼滅储鐗╂枡
 			findMat() {
 				let that = this
-				var matnr =  that.matnr.split(";")
+				var matnr = that.matnr.split(";")
 				that.order = matnr[0]
 				that.matnr = matnr[1]
 				uni.request({
@@ -261,15 +313,16 @@
 								position: 'top'
 							})
 						}
-			
+
 					}
 				});
-			
+
 			},
 			checkMat(mat) {
 				mat['orderNo'] = this.order
 				var len = this.dataList.length
-				var add = true ,sameItem = false
+				var add = true,
+					sameItem = false
 				for (var i = 0; i < len; i++) {
 					if (mat.orderNo != this.dataList[i].orderNo) {
 						add = true
@@ -289,7 +342,7 @@
 								} else {
 									add = true
 								}
-								
+
 							} else {
 								// 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
 								this.dataList[i].anfme += mat.anfme
@@ -298,7 +351,7 @@
 							}
 						}
 					}
-					
+
 				}
 				if (add) {
 					this.dataList.unshift(mat)
@@ -331,9 +384,9 @@
 					}
 				}
 				uni.request({
-					url: that.baseUrl + '/mobile/manDetl/in',
+					url: that.baseUrl + '/mobile/comb/auth',
 					data: JSON.stringify({
-						locNo: that.barcode,
+						barcode: that.barcode,
 						combMats: that.dataList
 					}),
 					method: 'POST',
@@ -370,14 +423,14 @@
 			// 纭閲嶇疆
 			resetConfirm() {
 				this.dataList = []
-				this.order = ''
+				this.orderNo = ''
 				this.barcode = ''
 				this.messageText = "閲嶇疆瀹屾垚"
 				this.messageToggle('success')
 			},
 			// 鍙栨秷閲嶇疆
 			resetClose() {
-			
+
 			},
 			// 淇敼鎵瑰彿
 			revise(item, i) {
@@ -394,7 +447,7 @@
 			},
 			// 鍒楄〃绉婚櫎鎸夐挳
 			remove(item, i, type) {
-				this.removeNum  = i
+				this.removeNum = i
 				this.msgType = type
 				this.title = '璀﹀憡'
 				this.content = '鏄惁绉婚櫎褰撳墠鍟嗗搧!'
@@ -440,20 +493,32 @@
 
 <style>
 	@import url('../../static/css/wms.css/wms.css');
+
 	.list {
 		display: flex;
 		min-height: 80rpx;
 		background-color: #FFF;
-		margin: auto 20rpx;
+		margin: 20rpx 20rpx;
 		border-radius: 20rpx;
-		box-shadow: 0px 0px 30px 0px rgba(0,0,0,0.2);
+		box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.2);
 	}
+
 	.list:first-child {
-		margin-top: 410rpx;
+		margin-top: 360rpx;
 	}
+
 	.list:last-child {
 		margin-bottom: 120rpx;
 	}
+
+	.aside {
+		width: 100rpx;
+		/* background-color: #303133; */
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+
 	.code {
 		width: 100%;
 		position: fixed;
@@ -461,6 +526,7 @@
 		background-color: #FFF;
 		z-index: 10;
 	}
+
 	.item {
 		display: flex;
 		align-items: center;
@@ -468,7 +534,7 @@
 		margin-left: 20rpx;
 		border-bottom: 1px solid #DCDFE6;
 	}
-	
+
 	.item input {
 		height: 50rpx;
 		line-height: 50rpx;
@@ -476,23 +542,24 @@
 		font-size: 36upx;
 		font-family: PingFang SC;
 		width: 55vw;
-	
+
 	}
-	
+
 	.code-decs {
 		width: 20vw;
 		font-size: 18px;
 		color: #303133;
 	}
-	
+
 	.item-right {
 		margin-left: auto;
 		margin-right: 20rpx;
 	}
-	
+
 	.mat-list-title {
+		display: flex;
+		align-items: center;
 		height: 80rpx;
-		line-height: 80rpx;
 		width: 100%;
 		background-color: white;
 		position: fixed;
@@ -501,5 +568,7 @@
 		/* border-top: 1px solid #DCDFE6; */
 		text-align: center;
 		box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
+		
+
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1