From aeaace1cf0c48cc9b2dffbc5d5ab9eb4ecfad4a1 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期二, 16 八月 2022 19:30:19 +0800
Subject: [PATCH] Merge branch 'hylywms' of http://47.97.1.152:5880/r/~whycq/wms-app into hylywms

---
 pages/basics/putOnSale.vue |  181 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 176 insertions(+), 5 deletions(-)

diff --git a/pages/basics/putOnSale.vue b/pages/basics/putOnSale.vue
index d2fdec6..9200821 100644
--- a/pages/basics/putOnSale.vue
+++ b/pages/basics/putOnSale.vue
@@ -8,8 +8,8 @@
 			</view>
 			<view class="square-content">
 				<view class="content-input">
-					<input type="text" v-model="yyds" placeholder="鎵爜 / 杈撳叆" @input="find" :focus="focus">
-					<uni-icons type="closeempty" size="20" color="#dadada"></uni-icons>
+					<input type="text" v-model="locno" placeholder="鎵爜 / 杈撳叆" :focus="locnoFocus">
+					<uni-icons v-show="locno" type="closeempty" size="20" color="#dadada" @click="remove('locno')"></uni-icons>
 				</view>
 			</view>
 		</view>
@@ -21,17 +21,188 @@
 			</view>
 			<view class="square-content">
 				<view class="content-input">
-					<input type="text" v-model="yyds" placeholder="鎵爜 / 杈撳叆" @input="find" :focus="focus">
-					<uni-icons type="closeempty" size="20" color="#dadada"></uni-icons>
+					<input type="text" v-model="matnr" placeholder="鎵爜 / 杈撳叆" @input="findMat" :focus="matnrFocus">
+					<uni-icons v-show="matnr" type="closeempty" size="20" color="#dadada" @click="remove('matnr')"></uni-icons>
 				</view>
 			</view>
 		</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">
+			<view class="v-show" v-show="matList.length == 0">鏆傛棤鏇村鏁版嵁...</view>
+		</view>
+		
+		<!-- 鍟嗗搧鍒楄〃 -->
+		<checkbox-group >
+			<view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
+				<view class="list-left">
+					<view class="lists-item">No:{{listNum}}</view>
+					<view class="lists-item">鍟嗗搧缂栫爜锛歿{item.matnr}}</view>
+					<view class="lists-item">鍟嗗搧鎵瑰彿锛歿{item.batch}}</view>
+					<view class="lists-item">涓婃灦鏁伴噺锛歿{item.anfme}}</view>
+				</view>
+				<view class="list-right">
+					<uni-icons type="trash" size="20" color="#a5a5a5" @click="removeItem(item,index)"></uni-icons>
+				</view>
+			</view>
+		</checkbox-group>
+		
+		<!-- 搴曢儴鎸夐挳 -->
+		<view class="footer flex justify-around">
+			<!-- <label class="label-btn" style="width: 170rpx;">
+				<checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
+			</label>
+			<label class="label-btn" style="width: 100rpx;">
+				<text  @click="reChecked()">鍙嶉��</text>
+			</label> -->
+			
+			<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>
+		<view>
+			<!-- 鎻愮ず淇℃伅寮圭獥 -->
+			<uni-popup ref="message" type="message">
+				<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
+			</uni-popup>
+		</view>
 	
+	</view>
 </template>
 
 <script>
+	 export default {
+		data() {
+		 	return {
+				locno:'', // 搴撲綅鍙�
+				matnr:'', // 鍟嗗搧鐮�
+				locnoFocus:true,
+				matnrFocus:true,
+				matList:[], // 鍟嗗搧鍒楄〃
+				listLen:0,
+				listNum:1,
+				msgType: 'success',
+				messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�',
+				
+			}
+		},
+		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()
+		},
+		methods:{
+			// 鑾峰彇url
+			getUrl() {
+				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
+			},
+			// 娑堟伅鎻愮ず寮圭獥
+			messageToggle(type) {
+				this.msgType = type
+				this.messageText = ''
+				this.$refs.message.open()
+			},
+			// 娓呯┖input
+			remove(e) {
+				this[e] = ''
+			},
+			// 閲嶇疆
+			resst() {
+				this.locno = ''
+				this.matnr = ''
+				this.matList = []
+			},
+			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) {
+										console.log(data)
+										that.matList.push(data.data)
+									},
+								},
+								success: function(res) {
+									// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+									res.eventChannel.emit('matData', { data: that.matData })
+								},
+							});
+						}
+						
+					}
+				});
+				
+			},
+			// 绉婚櫎鐗╂枡
+			removeItem(item,index) {
+				this.matList.splice(index,1)
+				// this.listLen = this.matList.length
+				this.messageToggle('success')
+				this.messageText = '绉婚櫎鎴愬姛'
+			},
+			// 涓婃灦
+			comb() {
+				let that = this
+				if(that.locno === '') {
+					uni.showToast({title: '璇锋坊鍔犲簱浣嶇爜', icon: "none", position: 'top'});
+					return;
+				}
+				if(that.matList.length === 0) {
+					uni.showToast({title: '璇锋坊鍔犲晢鍝�', icon: "none", position: 'top'});
+					return;
+				}
+				var combList = {}
+				var matList = []
+				combList['locno'] = that.locno
+				combList['combMats'] = that.matList
+				matList['matnr'] = that.matList
+				console.log(JSON.stringify(combList))
+				uni.request({
+					url: that.commonUrl + '/mobile/mat/onSale/auth',
+					data: {
+						combParam:JSON.stringify(combList)
+					},
+					header: { 'token':uni.getStorageSync('token') },
+					method:'GET',
+					success(result) {
+						console.log(result)
+						
+					}
+				})
+			}
+			
+		}
+	 }
 </script>
 
 <style>
+	@import url(@/static/css/putOnSale.css);
 </style>
\ No newline at end of file

--
Gitblit v1.9.1