From 019a83aab02d22616ea68d55a83d1925b6e94102 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期六, 02 三月 2024 16:16:07 +0800
Subject: [PATCH] #

---
 pages/basics/order.vue       |   82 ++++++-
 pages/basics/orderQuery.vue  |  147 ++++++++++++
 pages/basics/orderSelect.vue |  394 +++++++++++++++++++++++++++++++++++
 3 files changed, 601 insertions(+), 22 deletions(-)

diff --git a/pages/basics/order.vue b/pages/basics/order.vue
index 47dd66d..80f81af 100644
--- a/pages/basics/order.vue
+++ b/pages/basics/order.vue
@@ -36,12 +36,12 @@
 				</view>
 				<view class="square-content">
 					<view class="content-input-btn">
-						<input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()"
+						<input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()"
 						:focus="focus" placeholder-style="line-height:  85rpx;">
-						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons>
+						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons>
 					</view>
 					<view class="content-btn">
-						<button class="cu-btn bg-blue pda-btn" @click="selectMat()">+鎻愬彇</button>
+						<button class="cu-btn bg-blue pda-btn" @click="selectOrder()">+鎻愬彇</button>
 					</view>
 				</view>
 			</view>
@@ -76,6 +76,8 @@
 					<view class="data-list-left">
 						<view class="matnr"><text style="width: 700rpx;">缂栫爜锛歿{item.matnr}}</text></view>
 						<view><text style="width: 700rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
+						<view><text style="width: 700rpx;">鍚堝悓鍙凤細{{item.model}}</text></view>
+						<view><text style="width: 700rpx;">绠卞彿锛歿{item.xh}}</text></view>
 						<view><text style="width: 700rpx;">鎵瑰彿锛歿{item.batch}}</text></view>
 						<view>
 							<text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text>
@@ -123,7 +125,7 @@
 						<view class="num-box">
 							<uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474"  @change="changeValue"/>
 						</view> 
-						<button class="cu-btn" @click="changeMax">max</button>
+						<!-- <button class="cu-btn" @click="changeMax">max</button> -->
 					</view>
 					<view class="revise-box-buttom">
 						<view>
@@ -161,6 +163,7 @@
 				check:false,
 				checkText:'鍏ㄩ��',
 				checkedData:[],
+				matData: ''
 			}
 		},
 		mounted(){
@@ -176,6 +179,60 @@
 			// 鑾峰彇url
 			getUrl() {
 				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
+			},
+			selectOrder() {
+				let that = this
+				uni.vibrateShort();
+				uni.navigateTo({
+					url: "orderSelect",
+					events: {
+					    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+					    acceptDataFromOpenedPage: function(data) {
+							that.matData = data.data
+							setTimeout(()=> {
+								that.findMat1()
+							},100)
+					    },
+					},
+					success: function(res) {
+					    // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+					    res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
+					},
+					
+				});
+				that.matnr = ''
+			},
+			findMat1() {
+				let that = this
+				uni.navigateTo({
+					url: "orderQuery",
+					events: {
+					    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+					    matList1: function(data) {
+							that.checkMat(data.data)
+							// that.matList.push(data.data)
+						},
+					},
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+						res.eventChannel.emit('matData', { data: that.matData })
+					},
+				});
+				
+			},
+			checkMat(mat) {
+				var len = this.matList.length
+				var add = true
+				for (var i = 0; i < len; i++) {
+					if (mat.matnr == this.matList[i].matnr) {
+						this.matList[i].anfme += mat.anfme 
+						this.$forceUpdate() // 寮哄埗鍒锋柊
+						add = false
+					}
+				}
+				if (add) {
+					this.matList.unshift(mat)
+				}
 			},
 			// barcode input 浜嬩欢
 			barcodeInput() {
@@ -356,11 +413,14 @@
 						let res = result.data
 						if (res.code === 200) {
 							if(res.data) {
-									uni.showLoading();
-								that.matList = res.data;
+								uni.showLoading();
+								// res.data[0].combMats
+								for (let k in res.data[0].combMats) {
+									res.data[0].combMats[k]['id'] = k + 1
+								}
+								that.matList = res.data[0].combMats;
 								that.orderNo = that.order
 								that.initAnfme()
-								console.log(that.matList)
 							}
 						} else if (res.code == 403) {
 							uni.showToast({title: res.msg, icon: "none", position: 'top'})
@@ -559,7 +619,7 @@
 	}
 	.data-list {
 		border-bottom: 1px solid #d8d8d8;
-		height: 180rpx;
+		height: 250rpx;
 		margin: 15rpx;
 		border-radius: 20rpx;
 	}
@@ -584,13 +644,13 @@
 		height: 100%;
 		width: 100rpx;
 		text-align: center;
-		line-height: 170rpx;
+		line-height: 250rpx;
 	}
 	.data-list-left {
 		/* background-color: #ffff7f; */
 		display: inline-block;
 		float: left;
-		height: 180rpx;
+		height: 250rpx;
 		width: 500rpx;
 		color: #676767;
 	}
@@ -603,7 +663,7 @@
 		float: right;
 		width: 100rpx;
 		height: 180rpx;
-		line-height: 180rpx;
+		line-height: 250rpx;
 	}
 	.data-list-right label {
 		display: inline-block;
diff --git a/pages/basics/orderQuery.vue b/pages/basics/orderQuery.vue
index 8183fd0..e712154 100644
--- a/pages/basics/orderQuery.vue
+++ b/pages/basics/orderQuery.vue
@@ -1,22 +1,157 @@
 <template>
-	<view>
-		
-	</view>
+	<scroll-view scroll-y>
+		<view>
+			<view class="container">
+				<view class="text-box">
+					<view class="text-title"><text>鍟嗗搧缂栫爜</text></view>
+					<view class="text-title"><text>{{matData.matnr}}</text></view>
+				</view>
+				<view class="text-box">
+					<view class="text-title"><text>鍟嗗搧鍚嶇О</text></view>
+					<view class="text-title">{{matData.maktx}}</view>
+				</view>
+				<view class="text-box">
+					<view class="text-title"><text>瑙勬牸</text></view>
+					<view class="text-title">{{matData.specs}}</view>
+				</view>
+				<view class="text-box">
+					<view class="text-title"><text>鍚堝悓鍙�</text></view>
+					<view class="text-title">{{matData.model}}</view>
+				</view>
+				<view class="text-box">
+					<view class="text-title"><text>绠卞彿</text></view>
+					<view class="text-title">{{matData.xh}}</view>
+				</view>
+				<view class="text-box">
+					<view class="text-title"><text>鎵瑰彿</text></view>
+					<view class="text-title"><input type="text" v-model="matData.batch"></view>
+				</view>
+				<view class="text-box">
+					<view class="text-title"><text>鏁伴噺</text></view>
+					<view class="text-title">
+						<view>
+							<uni-number-box :value="matData.anfme" :max="99999999" color="#747474" @change="changeValue"/>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="foot flex justify-center">
+			<label>
+				<button class="cu-btn bg-blue" @click="back()">鎻愬彇</button>
+			</label>
+		</view>
+	</scroll-view>
 </template>
 
 <script>
 	export default {
 		data() {
 			return {
-				
+				matData: {
+					matnr: null,
+					maktx: null,
+					batch: null,
+					anfme: null,
+				},
+				baseIP:'',
+				basePORT:'',
 			}
 		},
-		methods: {
+		onLoad(option) {
+			let that = this
+			// #ifdef APP-NVUE
+			const eventChannel = this.$scope.eventChannel; // 鍏煎APP-NVUE
+			// #endif
+			// #ifndef APP-NVUE
+			const eventChannel = this.getOpenerEventChannel();
+			// #endif
 			
+			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+			eventChannel.on('matData', function(data) {
+				console.log(data);
+			that.matData = data.data
+			that.matData.anfme = 0
+			})
+			
+			
+		},
+		methods: {
+			blur() {
+				
+			},
+			focus() {
+				
+			},
+			changeValue(value) {
+				this.matData.anfme = value
+			},
+			back() {
+				if (this.matData.anfme === 0) {
+					uni.showToast({title: '璇疯緭鍏ユ暟閲�', icon: "none", position: 'top'});
+					return;
+				}
+				this.getOpenerEventChannel().emit('matList1', {data: this.matData});
+				uni.vibrateShort();
+				uni.navigateBack({
+					
+				})
+			}
 		}
 	}
 </script>
 
 <style>
-
+	.container {
+		width: 100%;
+		height: 100%;
+		background-color: #ffffff;
+	}
+	.text-box {
+		height: 100rpx;
+		line-height: 100rpx;
+		margin-top: 20rpx;
+		margin-left: 10%;
+		width: 80%;
+		font-size: 32rpx;
+		font-weight: 400;
+		color: #434343;
+		border-bottom: 1rpx solid #e8e8e8;
+	}
+	.text-box:last-child {
+		border-bottom: none;
+	}
+	.text-box .text-title {
+		width: 30%;
+		height: 100rpx;
+		float: left;
+		display: inline-block;
+	}
+	.text-box .text-title:last-child {
+		display: inline-block;
+		margin-left: 5%;
+		width: 65%;
+		font-size: 30rpx;
+		font-weight: 400;
+		color: #747474;
+		display: flex;
+		align-items: center;
+	}
+	.text-box .text-title:last-child input {
+		border-bottom: 1rpx solid #e8e8e8 ;
+		width: 100%;
+	}
+	
+	
+	.foot {
+		width: 100%;
+		height: 100rpx;
+		line-height: 100rpx;
+		background-color: rgba(255,255,255,1);
+		position: fixed;
+		bottom: 0%;
+		border-top: 1px solid #d8d8d8;
+		z-index: 1;
+	}
 </style>
+
diff --git a/pages/basics/orderSelect.vue b/pages/basics/orderSelect.vue
index 8183fd0..399cd81 100644
--- a/pages/basics/orderSelect.vue
+++ b/pages/basics/orderSelect.vue
@@ -1,22 +1,406 @@
 <template>
 	<view>
-		
-	</view>
+		<scroll-view scroll-y >
+			<view class="search-box">
+				<view class="search-area">
+					<view class="search-icon"><uni-icons type="search" size="25" color="#a5a5a5"></uni-icons></view>
+					<input type="text" v-model="condition" placeholder="璇疯緭鍏ュ晢鍝佺紪鐮� / 鍚嶇О"/>
+					<view class="close-icon" @click="reset()"><uni-icons type="closeempty" size="25" color="#a5a5a5"></uni-icons></view>
+				</view>
+				<view class="search-btn"><button @click="search(condition)" class="cu-btn bg-blue">鎼滅储</button></view>
+			</view>
+			<checkbox-group @change="checkbox">
+				<label v-for="(item,index) in tag" :key="index" class="demo-list bg-false"
+					@click="showTag(item.id)">
+					<view class="demo-list-right">
+						<view class="tag">
+							<view class="cu-tag bg-blue ">璁㈠崟</view>
+						</view>
+						
+						<view class="order-ditel"><text class="orderNo">{{item.orderNo}}</text></view>
+					</view>
+				</label>
+				
+			</checkbox-group>
+			<checkbox-group>
+				<label v-for="(item,index) in data" :key="index" class="demo-list bg-false"
+					@click="findBySelect(item)">
+					<view class="demo-list-right">
+						<view class="tag">
+							<view class="cu-tag bg-cyan ">璁㈠崟鏄庣粏</view>
+						</view>
+						<view class="matnr" style="font-size: 16px;"><text style="min-width: 400rpx;font-size: 12px;">{{item.matnr}}</text></view>
+						<view class="matnr" style="font-size: 16px;"><text style="min-width: 400rpx;font-size: 12px;">{{item.maktx}}</text></view>
+						<view class="matnr" style="font-size: 16px;"><text style="min-width: 400rpx;font-size: 12px;">{{item.specs}}</text></view>
+					</view>
+				</label>
+			</checkbox-group>
+		</scroll-view>
+		</view>
 </template>
 
 <script>
 	export default {
 		data() {
 			return {
-				
+				commonUrl:null,
+				condition:null,
+				tag: [],
+				data: [],
 			}
 		},
-		methods: {
+		onLoad() {
+			let that = this
+			// const eventChannel = this.$scope.eventChannel; // 鍏煎APP-NVUE
+			const eventChannel = this.getOpenerEventChannel();
 			
+			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+			eventChannel.on('commonUrl', function(data) {
+				that.commonUrl = data.commonUrl
+				that.showTag1(1)
+			})
+		},
+		methods: {
+			checkbox() {
+				
+			},
+			reset() {
+				this.condition = null
+				uni.vibrateShort();
+			},
+			search(condition) {
+				let that = this
+				that.tag = null
+				that.data = null
+				uni.vibrateShort();
+				uni.showLoading({
+				    title: '鎼滅储涓�...'
+				});
+				uni.request({
+					// url: "http://localhost:8081/jkwms/tag/list/pda/auth",
+				    url: that.commonUrl + '/order/head/page/auth',
+				    data: {
+						condition: condition
+				    },
+					method:"GET",
+				    header: {
+						'token':uni.getStorageSync('token'),
+				    },
+					success(result) {
+						uni.hideLoading();
+						var res = result.data
+						if (res.code === 200 ) {
+							that.data = res.data
+						} 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'})
+						}
+					}
+				});
+			},
+			showTag1(parentId) {
+				let that = this
+				uni.showLoading();
+				uni.request({
+				    url: that.commonUrl + '/order/head/page/auth',
+					header: {
+						'token':uni.getStorageSync('token'),
+					},
+				    data: {
+						curr: 1,
+						limit: 100000,
+						// parentId: parentId
+				    },
+					header: {
+						'token':uni.getStorageSync('token'),
+					},
+					success(result) {
+						console.log(result)
+						that.tag = null
+						that.data = null
+						var res = result.data
+						if (res.code === 200) {
+							if (res.data != null && res.data.records.length > 0) {
+								that.tag = res.data.records
+							} else {
+								that.showMat(parentId)
+							}
+						} 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'})
+						}
+						uni.hideLoading();
+					}
+				});
+			},
+			showTag(parentId) {
+				let that = this
+				uni.showLoading();
+				uni.request({
+				    url: that.commonUrl + '/orderDetl/list/auth',
+					header: {
+						'token':uni.getStorageSync('token'),
+					},
+				    data: {
+						curr: 1,
+						limit: 100000,
+						order_id: parentId
+				    },
+					header: {
+						'token':uni.getStorageSync('token'),
+					},
+					success(result) {
+						console.log(result)
+						that.tag = null
+						that.data = null
+						var res = result.data
+						if (res.code === 200) {
+							if (res.data != null && res.data.records.length > 0) {
+								that.data = res.data.records
+							} else {
+								that.showMat(parentId)
+							}
+						} 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'})
+						}
+						uni.hideLoading();
+					}
+				});
+			},
+			showMat(tagId) {
+				uni.vibrateShort();
+				return
+				let that = this
+				if (tagId == null || tagId == '' || tagId == undefined) {
+					return;
+				}
+				uni.request({
+				    url: that.commonUrl + '/order/head/page/auth',
+				    data: {
+						curr: 1,
+						limit: 100000,
+				    },
+					method:"GET",
+				    header: {
+						'token':uni.getStorageSync('token'),
+				    },
+					success(result) {
+						console.log(result)
+						that.tag = null
+						var res = result.data
+						if (res.code === 200) {
+							if (res.data != null && res.data.length > 0) {
+								uni.showLoading();
+								that.data = res.data.records
+								uni.hideLoading();
+							} else {
+								// that.tagId = parentId
+							}
+						} 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'})
+						}
+						
+					}
+				});
+			},
+			findBySelect(item) {
+				console.log(item);
+				this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: item});
+				uni.vibrateShort();
+				uni.navigateBack({
+					
+				})
+				
+			}
 		}
 	}
 </script>
 
 <style>
-
+	.matnr {
+		margin-left: 60rpx;
+	}
+	.matnr:last-child {
+		margin-top: 0rpx;
+	}
+	.tag {
+		padding-left: 50rpx;
+		padding-top: 10rpx;
+		width: 100%;
+		border-bottom: 1px solid #ebebeb;
+	}
+	.search-box {
+		position: fixed;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 100rpx;
+		background-color: #FFF;
+		border-bottom: 1px solid #d8d8d8;
+		border-radius: 0 0 20rpx 20rpx;
+		z-index: 1;
+	}
+	/*#ifdef H5 */
+	.search-box {
+		position: fixed;
+		left: 0;
+		top: 89rpx;
+		width: 100%;
+		height: 100rpx;
+		background-color: #ffffff;
+		border-bottom: 1px solid #d8d8d8;
+		border-radius: 0 0 20rpx 20rpx;
+		z-index: 1;
+	}
+	/* #endif */
+	.search-area {
+		display: inline-block;
+		background-color: #F1F1F1;
+		width: 75%;
+		height: 70%;
+		margin: 15rpx;
+		border-radius: 15rpx;
+	}
+	.search-area input {
+		display: inline-block;
+		height: 70rpx;
+		width: 70%;
+		line-height: 70rpx;
+		font-size: 25rpx;
+		font-weight: 400;
+	}
+	.search-btn {
+		display: inline-block;
+		float: right;
+		margin-right: 30rpx;
+		margin-top: 15rpx;
+	}
+	.search-icon {
+		display: inline-block;
+		float: left;
+		width: 70rpx;
+		height: 70rpx;
+		text-align: center;
+		line-height: 70rpx;
+		
+	}
+	.close-icon {
+		display: inline-block;
+		float: right;
+		width: 70rpx;
+		height: 70rpx;
+		text-align: center;
+		line-height: 70rpx;
+	}
+	.bg-false {
+		background-color: #FFFFFF;
+	}
+	.bg-true {
+		background-color: #ebebeb;
+	}
+	.demo-list {
+		border-bottom: 1px solid #d8d8d8;
+		height: 220rpx;
+		margin: 15rpx;
+		border-radius: 20rpx;
+	}
+	.demo-list:first-child {
+		margin-top: 120rpx;
+	}
+	.demo-list:last-child {
+		margin-bottom: 120rpx;
+	}
+	label {
+		display: block;
+	}
+	.demo-list-left {
+		display: inline-block;
+		float: left;
+		text-align: center;
+		width: 100rpx;
+		height: 220rpx;
+		line-height: 220rpx;
+	}
+	.demo-list-right {
+		float: left;
+		width: 100%;
+		height: 220rpx;
+		color: #828282;
+		/* background-color: #3b3b3b; */
+	}
+	.order-ditel {
+		margin-top: 30rpx;
+		height: 60rpx;
+		width: 600rpx;
+		line-height: 60rpx;
+	}
+	
+	.demo-list-right .index {
+		width: 120rpx;
+		height: 25rpx;
+		line-height: 25rpx;
+		font-size: 40rpx;
+		border-right: 4rpx solid #6f6f6f;
+		padding-left: 0px;
+		padding-right: 10rpx;
+		color: #3b3b3b;
+		/* background-color: #007AFF; */
+	}
+	.demo-list-right .orderNo {
+		padding-left: 30rpx;
+		font-size: 35rpx;
+		width: 400rpx;
+		color: #3b3b3b;
+		/* background-color: #0A98D5; */
+	}
+	.demo-list-right .vertical-bar { // 绔栨潬
+		/* background-color: #6739B6; */
+		width: 50rpx;
+		font-size: 30rpx;
+		text-align: center;
+	}
+	.demo-list-right text {
+		display: inline-block;
+		width: 250rpx;
+		font-size: 25rpx;
+	}
+	.color-red {
+		width: auto;
+		font-weight: 700;
+		color: #e74f4f;
+	}
+	
+	
+	.label-btn {
+		width: 150rpx;
+	}
+	checkbox {
+		/* transform:scale(0.7) */
+	}
 </style>

--
Gitblit v1.9.1