From 1c3348591f1529df57a844385af0ade821e67566 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 18 八月 2022 13:53:09 +0800
Subject: [PATCH] #

---
 pages/basics/pakin.vue       |    3 
 manifest.json                |    2 
 pages.json                   |   18 +
 pages/basics/pakMatQuery.vue |   42 ++++
 pages/basics/pakStore.vue    |  411 +++++++++++++++++++++++++++++++++++++++++++++
 pages/basics/matSelect.vue   |    6 
 pages/index/index.vue        |    6 
 7 files changed, 479 insertions(+), 9 deletions(-)

diff --git a/manifest.json b/manifest.json
index 714328d..9fc9c77 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,7 +2,7 @@
     "name" : "涓壃WMS",
     "appid" : "__UNI__DA5854D",
     "description" : "",
-    "versionName" : "20220817A",
+    "versionName" : "20220818A",
     "versionCode" : 103,
     "transformPx" : false,
     /* 5+App鐗规湁鐩稿叧 */
diff --git a/pages.json b/pages.json
index 2f9b681..e10f2ad 100644
--- a/pages.json
+++ b/pages.json
@@ -149,7 +149,23 @@
                 "enablePullDownRefresh": false
 				
             }
-        }
+        },{
+            "path" : "pages/basics/pakStore",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "鍟嗗搧鍏ュ簱",
+                "enablePullDownRefresh": false
+				
+            }
+        },{
+		    "path" : "pages/basics/pakMatQuery",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "閫夋嫨鍟嗗搧",
+		        "enablePullDownRefresh": false
+				
+		    }
+		}
 		
 		
 		
diff --git a/pages/basics/matSelect.vue b/pages/basics/matSelect.vue
index d98b6a2..a8b6db0 100644
--- a/pages/basics/matSelect.vue
+++ b/pages/basics/matSelect.vue
@@ -46,10 +46,6 @@
 				condition:null,
 				tag: [],
 				data: [],
-				baseHttp:'http://',
-				baseIP:'',
-				basePORT:'',
-				baseUrl:'/lywms'
 			}
 		},
 		onLoad() {
@@ -58,7 +54,7 @@
 			const eventChannel = this.getOpenerEventChannel();
 			
 			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
-			eventChannel.on('acceptDataFromOpenerPage', function(data) {
+			eventChannel.on('commonUrl', function(data) {
 				that.commonUrl = data.commonUrl
 				that.showTag(1)
 			})
diff --git a/pages/basics/pakMatQuery.vue b/pages/basics/pakMatQuery.vue
new file mode 100644
index 0000000..19a6244
--- /dev/null
+++ b/pages/basics/pakMatQuery.vue
@@ -0,0 +1,42 @@
+<template>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				commonUrl:null,
+			}
+		},
+		onLoad(option) {
+			let that = this
+			const eventChannel = this.getOpenerEventChannel();
+			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+			eventChannel.on('commonUrl', function(data) {
+				that.commonUrl = data.commonUrl
+				that.matQuery()
+			})
+		},
+		methods: {
+			// 鐗╂枡鏌ヨ鏁版嵁琛�
+			matQuery() {
+				let that = this
+				uni.request({
+					url: that.commonUrl + '/mat/list/auth',
+					header: {'token':uni.getStorageSync('token')},
+					data: {
+						curr:1,
+						limit:7,
+					},
+					success(result) {
+						console.log(result)
+					}
+				})
+			}
+			
+		},
+	}	
+</script>
+
+<style>
+</style>
\ No newline at end of file
diff --git a/pages/basics/pakStore.vue b/pages/basics/pakStore.vue
new file mode 100644
index 0000000..a9d1695
--- /dev/null
+++ b/pages/basics/pakStore.vue
@@ -0,0 +1,411 @@
+<template>
+    <view>
+		<view class="square-2">
+			<view class="square-title">
+				<view class="title-sign"><view class="sign"></view></view>
+				<view class="title-text"><text>鎻愬彇鍟嗗搧</text></view>
+			</view>
+			<view class="square-content">
+				<view class="content-input-btn">
+					<input v-model="matnr" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()"
+					:focus="focus" placeholder-style="line-height:  85rpx;">
+					<uni-icons type="closeempty" size="20" color="#dadada" @click="remove('matnr')"></uni-icons>
+				</view>
+				<view class="content-btn">
+					<button class="cu-btn bg-blue pda-btn" @click="selectMat()">+鎻愬彇</button>
+				</view>
+			</view>
+		</view>
+		<!-- <view class="square-2">
+			<view class="square-title">
+				<view class="title-sign"><view class="sign"></view></view>
+				<view class="title-text"><text>搴撲綅鍙风爜</text></view>
+			</view>
+			<view class="square-content">
+				<view class="content-input">
+					<input type="text" v-model="locNo" placeholder="鎵爜 / 杈撳叆" @input="searchLocNo" placeholder-style="line-height:  85rpx;">
+					<uni-icons type="closeempty" size="20" color="#dadada" @click="removeLocNo"></uni-icons>
+				</view>
+			</view>
+		</view> -->
+		<view class="square-2">
+			<view class="square-title">
+				<view class="title-sign"><view class="sign"></view></view>
+				<view class="title-text"><text>鍏ュ簱鍙�</text></view>
+				
+			</view>
+				<view class="content-combox">
+					<uni-combox  emptyTips="鏆傛棤鏁版嵁" 
+						:candidates="sites" v-model="siteId"  @click="staNoSelect()" placeholder="璇烽�夋嫨鍑哄簱绔欑偣">
+					</uni-combox>
+				</view>
+		</view>
+		
+		<view class="square-1">
+			<view class="square-title">
+				<view class="title-sign"><view class="sign"></view></view>
+				<view class="title-text"><text>鍟嗗搧鍒楄〃</text></view>
+			</view>
+			
+		</view>
+		
+		<view class="square-none" v-show="matList.length === 0">
+			<view class="v-show">鏆傛棤鏇村鏁版嵁...</view>
+		</view>
+		
+		<view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
+			<view class="data-list-left">
+				<!-- <view>
+					<checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
+				</view> -->
+				<view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matnr}}</text></view>
+				<view><text style="width: 400rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
+				<view><text style="width: 400rpx;">鎵瑰彿锛歿{item.batch}}</text></view>
+				<view>
+					<text style="width: 400rpx;">鏁伴噺锛歿{item.anfme}}</text>
+				</view>
+			</view>
+			<view class="data-list-right">
+				<label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
+				<label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label>
+			</view>
+		</view>
+        <!-- 搴曢儴鎸夐挳 -->
+        <view class="footer flex justify-around">
+        	<label class="label-btn" style="width: 150rpx;">
+        		<button class="cu-btn" @click="resst()">閲嶇疆</button>
+        	</label>
+        	<label class="label-btn">
+        		<button class="cu-btn bg-blue " @click="comb()">鍚姩鍏ュ簱</button>
+        	</label>
+        </view>
+        <!-- 寮圭獥 -->
+        <!-- 淇敼鏁伴噺 -->
+        <uni-popup ref="revise" background-color="#fff">
+        	<view class="revise-box">
+        		<view class="revise-box-top">
+        			<view class="color-block-blue"></view>
+        			<text class="title">淇敼鏁伴噺</text>
+        		</view>
+        		<view class="changeBox">
+        			<view class="num-box">
+        				<uni-number-box :value="count" :max="9999" color="#747474"  @change="changeValue"/>
+        			</view> 
+        		</view>
+        		<view class="revise-box-buttom">
+        			<view>
+        				<button class="cu-btn bg-blue" @click="confirm()">纭</button>
+        			</view>
+        		</view>
+        	</view>
+        </uni-popup>
+    </view>
+</template>
+ 
+<script>
+    export default {
+        data() {
+            return {
+				commonUrl:null,
+				matnr:'',
+				focus: true,
+                matList: [],
+                sites: [],
+                siteId: '',
+				count:0
+            }
+        },
+        mounted(){
+            const UIP = uni.getStorageSync('UIP');
+            this.baseIP = UIP;
+            const UPORT = uni.getStorageSync('UPORT');
+            this.basePORT = UPORT
+            const PROJ = uni.getStorageSync('UPROJ');
+            this.baseUrl = PROJ
+            this.getUrl()
+            this.getInBound();
+        },
+        methods: {
+			// 鑾峰彇url
+			getUrl() {
+				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
+			},
+			// 娓呯┖input
+			remove(e) {
+				this[e] = ''
+			},
+			// 鎼滅储鐗╂枡
+			findMat() {
+				let that = this
+					uni.request({
+					url: that.commonUrl + '/mat/auth',
+					data: {
+						matnr:that.matnr
+					},
+					header: {
+						'token':uni.getStorageSync('token')
+					},
+					success(result) {
+						uni.vibrateShort();
+						let res = result.data
+						if (res.code === 200 && res.data) {
+							that.matData = res.data
+							that.matnr = ''
+							uni.navigateTo({
+								url: "matQuery",
+								events: {
+									// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+									matList: function(data) {
+										that.checkMat(data.data)
+										// that.matList.push(data.data)
+									},
+								},
+								success: function(res) {
+									// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+									res.eventChannel.emit('matData', { data: that.matData })
+								},
+							});
+						} 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'})
+						}
+						
+					}
+				});
+			},
+			// 娣诲姞鍟嗗搧
+			addMat(mat) {
+				this.matList.unshift(mat)
+			},
+			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)
+				}
+			},
+			// 鎻愬彇鍟嗗搧
+			selectMat() {
+				let that = this
+				uni.navigateTo({
+					url: "matSelect",
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+						res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
+					},
+					events: {
+						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+						acceptDataFromOpenedPage: function(data) {
+							that.matnr = data.data
+							that.findMat(that.matnr)
+						},
+					},
+				});
+			},
+			// 鑾峰彇鍙敤鍏ュ簱绔欑偣
+            getInBound() {
+                let that = this;
+                uni.request({
+                    url: that.commonUrl + "/available/put/site",
+                    header: {'token':uni.getStorageSync('token')},
+                    success(result) {
+                        let res = result.data
+                        if (res.code === 200 ) {
+                            that.sites = [];
+                            for (var i = 0; i < res.data.length; i++) {
+                                that.sites.push(res.data[i])
+                            }
+                        } 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'})
+                        }
+                    }
+                })
+            },
+            // 鍚姩鍏ュ簱
+			comb() {
+                let that = this
+                if (that.matList.length === 0) {
+					uni.showToast({title: "璇峰厛鎻愬彇鍟嗗搧", icon: "none",position: 'top'})
+					return;
+                } 
+				if (that.siteId == '') {
+				    uni.showToast({title: "璇烽�夋嫨鍑哄簱鍙�", icon: "none",position: 'top'})
+				    return;
+				}
+                var list = [];
+                let param = {
+                    devpNo: that.siteId,
+                    list: that.matList
+                }
+                uni.request({
+                    url: that.commonUrl + "/full/store/put/start",
+                    header: {
+                        'token':uni.getStorageSync('token')},
+                    data: JSON.stringify(param),
+                    method:"POST",
+                    success(result) {
+						var res = result.data
+                        if (result.data.code === 200) {
+                            uni.showToast({title: "鍏ュ簱鍚姩鎴愬姛锛岀洰鏍囧簱浣嶏細" + res.data, icon: "none",position: 'top'})
+                            that.resst()
+                        } else {
+                            uni.showToast({title: result.data.msg, icon: "none",position: 'top'})
+                        }
+                    }
+                })
+            },
+            resst() {
+                this.matnr = '';
+                this.siteId = '';
+				this.matList = [];
+            },
+			// 淇敼鏁伴噺
+			revise(item,index) {
+				this.count = this.matList[index].anfme
+				this.rowNum = index
+				this.eject()
+			},
+			eject(type) {
+				this.type = type
+				// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴��
+				this.$refs.revise.open(type)
+			},
+			changeValue(value) {
+				this.count = value
+			},
+			confirm() {
+				this.matList[this.rowNum].anfme = this.count
+				this.$refs.revise.close()
+				this.$forceUpdate() // 寮哄埗鍒锋柊
+			},
+        }
+    }
+</script>
+ 
+<style>
+	.color-block-blue {
+		background-color: #1E9FFF;
+		display: inline-block;
+		float: left;
+		margin: 15rpx 15rpx 0 15rpx;
+		width: 12rpx;
+		height: 40rpx;
+		border: 5rpx solid #1E9FFF;
+		border-radius: 20rpx;
+	}
+	.title {
+		display: inline-block;
+		float: left;
+		font-size: 34rpx;
+		font-weight: 700;
+		height: 50rpx;
+		line-height: 50rpx;
+		margin-top: 10rpx;
+	}
+    .pda-btn1 {
+        margin-left:260rpx;
+        margin-right: auto;
+        margin-top: 150rpx;
+        width: 200rpx;
+        height: 80rpx;
+        font-size: 30upx;
+        font-weight: bold;
+    }
+    .combox {
+        width: 200px;
+        padding: 12px;
+    }
+	.bg-false {
+		background-color: #FFFFFF;
+	}
+	.bg-true {
+		background-color: #ebebeb;
+	}
+	.data-list {
+		border-bottom: 1px solid #d8d8d8;
+		height: 180rpx;
+		margin: 15rpx;
+		border-radius: 20rpx;
+	}
+	.data-list:first-child {
+		margin-top: 20rpx;
+	}
+	.data-list:last-child {
+		margin-bottom: 120rpx;
+	}
+	/* .data-list-left {
+		display: inline-block;
+		float: left;
+		text-align: center;
+		width: 100rpx;
+		height: 180rpx;
+		line-height: 180rpx;
+	} */
+	.data-list-left {
+		display: inline-block;
+		float: left;
+		margin-left: 6%;
+		height: 180rpx;
+		color: #676767;
+	}
+	.matnr {
+		padding-top: 10rpx;
+	}
+	.data-list-right {
+		display: inline-block;
+		float: right;
+		height: 180rpx;
+		line-height: 180rpx;
+	}
+	/* display: inline-block;
+	float: right;
+	width: 200rpx;
+	height: 180rpx;
+	line-height: 180rpx; */
+	.data-list-right label {
+		display: inline-block;
+		float: left;
+		width: 80rpx;
+		height: 180rpx;
+	}
+	.revise-box {
+		width: 400rpx;
+		height: 300rpx;
+		border-radius: 25px;
+	}
+	.revise-box-top {
+		width: 400rpx;
+		height: 120rpx;
+		border-radius: 25px;
+	}
+	.changeBox {
+		width: 400rpx;
+		height: 100rpx;
+	}
+	.num-box {
+		margin-left: 100rpx;
+	}
+	.revise-box-buttom{
+		margin-left: 130rpx;
+	}
+</style>
\ No newline at end of file
diff --git a/pages/basics/pakin.vue b/pages/basics/pakin.vue
index 9dd2588..7efbb30 100644
--- a/pages/basics/pakin.vue
+++ b/pages/basics/pakin.vue
@@ -280,7 +280,7 @@
 					},
 					success: function(res) {
 					    // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
-					    res.eventChannel.emit('acceptDataFromOpenerPage', {commonUrl:that.commonUrl })
+					    res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
 					},
 					
 				});
@@ -400,7 +400,6 @@
 				this.count = value
 			},
 			confirm() {
-				console.log(this.count)
 				this.matList[this.rowNum].anfme = this.count
 				this.$refs.revise.close()
 				this.$forceUpdate() // 寮哄埗鍒锋柊
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 9c25e4f..340a456 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -67,6 +67,12 @@
 						cuIcon: 'video'
 					},
 					{
+						title: '鍟嗗搧鍏ュ簱',
+						name: 'pakStore',
+						color: 'blue',
+						cuIcon: 'video'
+					},
+					{
 						title: '搴撳瓨鐩樼偣',
 						name: 'stockCheck',
 						color: 'blue',

--
Gitblit v1.9.1