From 80236f6445e1b4f4c32dc7d6b015359dec82a5f7 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期二, 19 十一月 2024 16:23:55 +0800
Subject: [PATCH] #

---
 pages/warehouse/orderList.vue |   11 
 pages/home/home.vue           |    2 
 pages.json                    |   22 ++
 pages/warehouse/outMats.vue   |  283 +++++++++++++++++++++++++++++++++++
 pages/warehouse/outLocs.vue   |  128 ++++++++++++++++
 5 files changed, 439 insertions(+), 7 deletions(-)

diff --git a/pages.json b/pages.json
index 49aeec6..853f6cf 100644
--- a/pages.json
+++ b/pages.json
@@ -292,7 +292,7 @@
 			}
 		},
 		{
-			"path" : "pages/order/orderList",
+			"path" : "pages/warehouse/orderList",
 			"style" : 
 			{
 				"navigationBarTitleText" : "骞冲簱涓嬫灦",
@@ -368,6 +368,26 @@
             }
             
         }
+        ,{
+            "path" : "pages/warehouse/outLocs",
+            "style" :                                                                                    
+            {
+                // "navigationBarTitleText": "鍏宠仈搴撲綅",
+                // "enablePullDownRefresh": false
+				"navigationStyle": "custom"
+            }
+            
+        }
+        ,{
+            "path" : "pages/warehouse/outMats",
+            "style" :                                                                                    
+            {
+                // "navigationBarTitleText": "涓嬫灦鐗╂枡",
+                // "enablePullDownRefresh": false
+				"navigationStyle": "custom"
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 4126ada..76a342f 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -67,7 +67,7 @@
 						name: 'orderPutOn',
 						color: 'yellow',
 						cuIcon: 'pullup',
-						url: '/order/orderList'
+						url: '/warehouse/orderList'
 					},
 					{
 						title: '璁㈠崟缁勬墭',
diff --git a/pages/order/orderList.vue b/pages/warehouse/orderList.vue
similarity index 90%
rename from pages/order/orderList.vue
rename to pages/warehouse/orderList.vue
index 665abc1..3813d29 100644
--- a/pages/order/orderList.vue
+++ b/pages/warehouse/orderList.vue
@@ -16,10 +16,10 @@
 		 </uni-nav-bar>
 		<!-- 鎼滅储妗� -->
 		<view class="search-bar">
-			<uni-search-bar v-model="orderNo" placeholder=" 杈撳叆璁㈠崟鍙�" bgColor="#EEEEEE" @input="search" />
+			<uni-search-bar v-model="orderNo" placeholder=" 杈撳叆璁㈠崟鍙�" bgColor="#EEEEEE" @confirm="search" />
 		</view>
 		<view class="card" v-for="item in menuList" @click="chose(item)">
-			{{item}}
+			{{item.orderNo}}
 		</view>
 	</view>
 </template>
@@ -70,9 +70,10 @@
 				let that = this
 				uni.request({
 					url: this.baseUrl + '/outOrder/list/all',
-					data: that.orderNo,
+					data: {orderNo:that.orderNo},
 					header: {
-						'token': uni.getStorageSync('token')
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
 					},
 					method: 'POST',
 					success(res) {
@@ -84,7 +85,7 @@
 			chose(item) {
 				let that = this
 				uni.navigateTo({
-					url: "./orderDetlList",
+					url: "./outLocs",
 					success: function(res) {
 						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
 						res.eventChannel.emit('order', {
diff --git a/pages/warehouse/outLocs.vue b/pages/warehouse/outLocs.vue
new file mode 100644
index 0000000..4635ed7
--- /dev/null
+++ b/pages/warehouse/outLocs.vue
@@ -0,0 +1,128 @@
+<template>
+	<view>
+		<view class="status_bar">
+			<!-- 杩欓噷鏄姸鎬佹爮 -->
+		</view>
+		<uni-nav-bar left-icon="left" background-color="#f8f8f8" title="鍏宠仈搴撲綅" @clickLeft="back"  :fixed="true"
+			:border="false" rightWidth="160rpx" leftWidth="160rpx"
+			>
+			<block slot="right">
+				<view class="city">
+					<view>
+						<text class="uni-nav-bar-text">{{store}}</text>
+					</view>
+				</view>
+			</block>
+		 </uni-nav-bar>
+		<!-- 鎼滅储妗� -->
+		<!-- <view class="search-bar">
+			<uni-search-bar v-model="searchVal" placeholder=" 杈撳叆搴撲綅鍙�" bgColor="#EEEEEE" @input="search" />
+		</view> -->
+		<view style="margin: 0;background-color: aliceblue;text-align: center;height: 30px;">
+			褰撳墠璁㈠崟鍙凤細 {{order.orderNo}}
+		</view>
+		<view class="card" v-for="item in menuList" @click="chose(item)">
+			{{item}}
+		</view>
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				baseUrl: '',
+				token: '',
+				storeId: 0,
+				store: '',
+				orderNo: '',
+				searchVal: '',
+				orderId: 0,
+				menuList: [],
+				order: {orderNo: '--'},
+				orNo: ''
+			}
+		},
+		onShow() {
+			this.baseUrl = uni.getStorageSync('baseUrl');
+			this.token = uni.getStorageSync('token');
+			this.storeId = uni.getStorageSync('store')
+			if (this.storeId == 1) {
+				this.store = '瀹佹尝浠�'
+			}
+			if (this.storeId == 2) {
+				this.store = '鏂版槍浠�'
+			}
+			let that = this
+			const eventChannel = that.getOpenerEventChannel();
+			eventChannel.on('order', function(data) {
+				// console.log(data)
+				that.orderId = data.orderNo.id
+				that.order = data.orderNo
+				that.getOrderNoList(that.orderId)
+			})
+		},
+		methods: {
+			back() {
+				uni.navigateBack({})
+			},
+			getOrderNoList(orderId) {
+				let that = this
+				uni.request({
+					url: that.baseUrl + '/mobile/pda/OutLocNo',
+					data: {orderId:orderId},
+					header: {
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
+					},
+					method: 'POST',
+					success(res) {
+						res = res.data
+						that.menuList = res.data
+					}
+				})
+			},
+			search() {
+				let baseList = [...this.menuList]
+				this.menuList = this.fuzzySearch(baseList,this.searchVal)
+			},
+			
+			fuzzySearch(array, query) {
+			  const regex = new RegExp(query, 'i'); // 'i' 琛ㄧず涓嶅尯鍒嗗ぇ灏忓啓
+			  return array.filter(num => regex.test(num.toString()));
+			},
+			chose(item) {
+				let that = this
+				uni.navigateTo({
+					url: "./outMats",
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+						res.eventChannel.emit('order', {
+							locNo: item,
+							orderId: that.orderId,
+							orderNo: that.order
+						})
+					},
+					events: {
+						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+						matList: function(data) {
+							// that.matnr = data.data
+							that.getOrderNoList(that.orderId)
+						},
+					},
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+	@import url('../../static/css/wms.css/wms.css');
+	.card {
+		margin: 20rpx;
+		padding: 30rpx;
+		background-color: #157ec1;
+		border-radius: 20rpx;
+		color: #FFF;
+	}
+</style>
+
diff --git a/pages/warehouse/outMats.vue b/pages/warehouse/outMats.vue
new file mode 100644
index 0000000..ca39b00
--- /dev/null
+++ b/pages/warehouse/outMats.vue
@@ -0,0 +1,283 @@
+<template>
+	<view>
+		<view class="status_bar">
+			<!-- 杩欓噷鏄姸鎬佹爮 -->
+		</view>
+		<uni-nav-bar left-icon="left" background-color="#f8f8f8" title="涓嬫灦鐗╂枡" @clickLeft="back"  :fixed="true"
+			:border="false" rightWidth="160rpx" leftWidth="160rpx"
+			>
+			<block slot="right">
+				<view class="city">
+					<view>
+						<text class="uni-nav-bar-text">{{store}}</text>
+					</view>
+				</view>
+			</block>
+		 </uni-nav-bar>
+		<!-- 鎼滅储妗� -->
+		<!-- <view class="search-bar">
+			<uni-search-bar v-model="orderNo" placeholder=" 杈撳叆" bgColor="#EEEEEE" @input="search" />
+		</view> -->
+		<view class="mat-list-title">
+			<view style="width: 200rpx;"></view>
+			<view style="-webkit-flex: 1;flex: 1;">搴撲綅鍙凤細{{locNo}}</view>
+			<view style="width: 200rpx;"><button size="mini" type="primary" @click="allSelect()">{{seltitle}}</button></view>
+		</view>
+		
+		<view style="height: 60px;"></view>
+		
+		<view>
+			<!-- 鐗╂枡鍚嶇О 鐗╂枡鍙� 鎵瑰彿 鍏宠仈鍗曞彿 搴撳瓨鏁伴噺 鍑哄簱鏁伴噺-->
+			<view class="list_item" v-for="(item,index) in dataList">
+				<view class="list_check_box">
+					<label @click="checkboxChange(item)">
+						<checkbox :value="item.matnr" :checked="item.checked" style="transform:scale(0.7)" /><text></text>
+					</label>
+				</view>
+				<view class="list_main">
+					<view>
+						<text class="desc_name">鐗╂枡鍙凤細</text>
+						<text class="desc_connect">{{item.matnr}}</text>
+					</view>
+					<view>
+						<text class="desc_name">鐗╂枡鍚嶇О锛�</text>
+						<text class="desc_connect">{{item.maktx}}</text>
+					</view>
+					<view>
+						<text class="desc_name">璁㈠崟鍙凤細</text>
+						<text class="desc_connect">{{item.orderNo}}</text>
+					</view>
+					<view>
+						<text class="desc_name">鏁伴噺锛�</text>
+						<text class="desc_connect">{{item.anfme}}</text>
+					</view>
+				</view>
+				<view class="list_fix">
+					<uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
+				</view>
+			</view>
+		</view>
+		
+		<view style="margin: 8px;text-align: center;color: #777;" v-if="dataList.length == 0">
+			娌℃湁鏁版嵁
+		</view>
+		
+		<view style="height: 60px;"></view>
+		
+		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+		<view class="buttom">
+			<button size="mini" type="primary" @click="combConfirm('warn')">涓嬫灦</button>
+		</view>
+		
+		
+		<!-- 纭缁勬墭 -->
+		<view>
+			<uni-popup ref="combConfirm" type="dialog">
+				<uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
+					@confirm="comb" @close="combClose"></uni-popup-dialog>
+			</uni-popup>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				baseUrl: '',
+				token: '',
+				storeId: 0,
+				store: '',
+				orderNo: '',
+				locNo: '--',
+				seltitle: '鍙栨秷鍏ㄩ��',
+				dataList: [],
+				msgType: 'success',
+				messageText: '',
+				content: '',
+				title: ''
+			}
+		},
+		onShow() {
+			this.baseUrl = uni.getStorageSync('baseUrl');
+			this.token = uni.getStorageSync('token');
+			this.storeId = uni.getStorageSync('store')
+			if (this.storeId == 1) {
+				this.store = '瀹佹尝浠�'
+			}
+			if (this.storeId == 2) {
+				this.store = '鏂版槍浠�'
+			}
+			let that = this
+			const eventChannel = that.getOpenerEventChannel();
+			eventChannel.on('order', function(data) {
+				that.locNo = data.locNo
+				that.orderNo = data.orderNo.orderNo
+				console.log(that.orderNo);
+				that.getLocInfo(data.locNo,data.orderId)
+			})
+		},
+		methods: {
+			back() {
+				uni.navigateBack({})
+			},
+			checkboxChange(e) {
+				let items = this.dataList,
+				values = e.matnr;
+				if (e.checked) {
+					this.$set(e,'checked',false)
+				} else {
+					this.$set(e,'checked',true)
+				}
+				console.log(this.dataList);
+			},
+			getLocInfo(locNo,orderId) {
+				let _this = this
+				uni.request({
+					url: _this.baseUrl + '/mobile/pda/OrderDetlContrastLocDetl',
+					data: {locNo: locNo,orderId: orderId},
+					header: {
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
+					},
+					method: 'POST',
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							for (let k of res.data) {
+								k['checked'] = true
+							}
+							_this.dataList = res.data
+						}
+					}
+				})
+			},
+			allSelect() {
+				if (this.seltitle == '鍏ㄩ��') {
+					for (let k of this.dataList) {
+						k.checked = true
+					}
+					this.seltitle = '鍙栨秷鍏ㄩ��'
+				} else {
+					for (let k of this.dataList) {
+						k.checked = false
+					}
+					this.seltitle = '鍏ㄩ��'
+				}
+				
+			},
+			combConfirm(type) {
+				this.msgType = type
+				this.title = '璀﹀憡'
+				this.content = '鏄惁鐜板湪涓嬫灦!'
+				this.$refs.combConfirm.open()
+			},
+			combClose() {
+				this.$refs.combConfirm.close()
+			},
+			// 涓嬫灦
+			comb() {
+				let that = this;
+				if (that.locNo === '') {
+					this.messageText = "璇锋壂鎻忓簱浣嶅彿"
+					this.messageToggle('error')
+					return;
+				}
+				if (that.dataList.length === 0) {
+					this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
+					this.messageToggle('error')
+					return;
+				}
+				let optDataList = []
+				for (let k of that.dataList) {
+					console.log(k);
+					if (k.checked) {
+						optDataList.push(k)
+					}
+				}
+				uni.request({
+					url: that.baseUrl + '/mobile/pda/WarehouseOut',
+					data: JSON.stringify({
+						orderNo: that.orderNo,
+						locno: that.locNo,
+						combMats: optDataList
+					}),
+					method: 'POST',
+					header: {
+						'token': uni.getStorageSync('token')
+					},
+					success(result) {
+						var res = result.data
+						if (res.code === 200) {
+							uni.showToast({ title: res.msg, icon: "success", position: 'top' })
+							setTimeout(()=>{
+								that.getOpenerEventChannel().emit('matList', {});
+								uni.navigateBack({
+									delta: 1, // 杩斿洖涓婁竴椤甸潰
+								})
+							},1500)
+						} else if (res.code == 403) {
+							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+						}
+					}
+				});
+			},
+		}
+	}
+</script>
+
+<style>
+	@import url('../../static/css/wms.css/wms.css');
+	.mat-list-title {
+		display: flex;
+		align-items: center;
+		height: 80rpx;
+		width: 100%;
+		background-color: white;
+		position: fixed;
+		margin-top: 0;
+		z-index: 9;
+		/* border-top: 1px solid #DCDFE6; */
+		text-align: center;
+		box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.1);
+	}
+	.list_item {
+		margin: 8px;
+		min-height: 40px;
+		border-radius: 8px;
+		display: flex;
+		background-color: #ffffff;
+	}
+	.list_check_box {
+		border-right: 1px solid #e5e5e5;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		padding: 8px;
+	}
+	.list_main {
+		padding: 8px;
+		flex: 1;
+	}
+	.list_fix {
+		border-left: 1px solid #e5e5e5;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		padding: 8px;
+	}
+	.desc_name {
+		font-weight: bold;
+		color: #222;
+	}
+	.desc_connect {
+		color: #333;
+	}
+</style>

--
Gitblit v1.9.1