From 1e7de5b9103999800062f1e6b18d94fd93f3ef06 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期五, 23 九月 2022 14:21:03 +0800
Subject: [PATCH] #可回退版本

---
 pages/basics/putOnSale.vue |  126 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 109 insertions(+), 17 deletions(-)

diff --git a/pages/basics/putOnSale.vue b/pages/basics/putOnSale.vue
index 09fe957..a3ad205 100644
--- a/pages/basics/putOnSale.vue
+++ b/pages/basics/putOnSale.vue
@@ -17,6 +17,23 @@
 		<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="matnrFocus" placeholder-style="line-height:  85rpx;">
+					<uni-icons v-show="matnr" 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">
@@ -25,7 +42,7 @@
 					<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">
@@ -39,7 +56,7 @@
 		</view>
 		
 		<!-- 鍟嗗搧鍒楄〃 -->
-		<checkbox-group >
+		<!-- <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>
@@ -49,6 +66,26 @@
 				</view>
 				<view class="list-right">
 					<uni-icons type="trash" size="20" color="#a5a5a5" @click="removeItem(item,index)"></uni-icons>
+				</view>
+			</view>
+		</checkbox-group> -->
+		
+		<checkbox-group>
+			<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>
 		</checkbox-group>
@@ -76,6 +113,26 @@
 			</uni-popup>
 		</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>
 
@@ -92,7 +149,8 @@
 				listNum:1,
 				msgType: 'success',
 				messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�',
-				
+				count:'',
+				rowNum:'',
 			}
 		},
 		mounted(){
@@ -146,8 +204,8 @@
 								events: {
 								    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
 								    matList: function(data) {
+										console.log(data)
 										that.matList.push(data.data)
-										console.log(that.matList)
 									},
 								},
 								success: function(res) {
@@ -179,25 +237,59 @@
 					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))
+				var combMats = []
+				var combParam = {}
+				combParam['locno'] = that.locno
+				combParam['combMats'] = that.matList
 				uni.request({
 					url: that.commonUrl + '/mobile/mat/onSale/auth',
-					data: {
-						combParam:JSON.stringify(combList)
-					},
-					header: { 'token':uni.getStorageSync('token') },
-					method:'GET',
+					data: JSON.stringify(combParam),
+					header: { 'token':uni.getStorageSync('token'),},
+					method:'POST',
 					success(result) {
 						console.log(result)
-						
 					}
 				})
-			}
+			},
+			// 鎻愬彇鍟嗗搧
+			selectMat() {
+				let that = this
+				uni.vibrateShort();
+				uni.navigateTo({
+					url: "matSelect",
+					events: {
+					    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+					    acceptDataFromOpenedPage: function(data) {
+							that.matnr = data.data
+							that.findMat(that.matnr)
+					    },
+					},
+					success: function(res) {
+					    // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+					    res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
+					},
+					
+				});
+				that.matnr = ''
+			},
+			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() // 寮哄埗鍒锋柊
+			},
 			
 		}
 	 }

--
Gitblit v1.9.1