From eed846f7b4d8b8dfc253dd583ee2bbb45c4d4f7d Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 18 九月 2023 17:06:16 +0800
Subject: [PATCH] #

---
 pages/mat/matSelected.vue        |   12 +++--
 pages/mat/matQuery.vue           |    2 
 pages/stock/stockCheck_merge.vue |   95 +++++++++++++++++++++++++++--------------------
 3 files changed, 62 insertions(+), 47 deletions(-)

diff --git a/pages/mat/matQuery.vue b/pages/mat/matQuery.vue
index 08f968d..dbed4ba 100644
--- a/pages/mat/matQuery.vue
+++ b/pages/mat/matQuery.vue
@@ -15,7 +15,7 @@
 			</view>
 		</scroll-view>
 		<view>
-			<view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item.matnr)">
+			<view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item.matNo)">
 				<view class="tag">
 					<view style="display: flex;">
 						<view class="wms-tag" :style="baColor" >鍟嗗搧</view>
diff --git a/pages/mat/matSelected.vue b/pages/mat/matSelected.vue
index 295fdd3..c9e866a 100644
--- a/pages/mat/matSelected.vue
+++ b/pages/mat/matSelected.vue
@@ -13,17 +13,17 @@
 				<view class="form-item-desc"><text>瑙勬牸</text></view>
 				<view class="form-item-content"><text>{{mat.str2}}</text></view>
 			</view>
-			<view class="form-item">
+			<!-- <view class="form-item">
 				<view class="form-item-desc"><text>鎵瑰彿</text></view>
 				<view class="form-item-content">
 					<view class="form-input">
 						<input type="text" v-model="mat.batch">
 					</view>
 				</view>
-			</view>
+			</view> -->
 			<view class="form-item">
 				<view class="form-item-desc"><text>鏃堕棿</text></view>
-				<uni-datetime-picker type="datetime" v-model="mat.appeTime$" />
+				<uni-datetime-picker type="date" v-model="mat.date" @change="changeLog"/>
 			</view>
 			<view class="form-item">
 				<view class="form-item-desc"><text>鏁伴噺</text></view>
@@ -48,7 +48,7 @@
 					matName: null,
 					str2: null,
 					batch: null,
-					appeTime: null,
+					date: '',
 					anfme: 0,
 				},
 				baseIP:'',
@@ -66,7 +66,6 @@
 			
 			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
 			eventChannel.on('mat', function(data) {
-				console.log(data.data);
 				that.mat = data.data
 				that.mat.anfme = 0
 			})
@@ -80,6 +79,9 @@
 			focus() {
 				
 			},
+			changeLog(value) {
+				this.mat.date = value
+			},
 			changeValue(value) {
 				this.mat.anfme = value
 			},
diff --git a/pages/stock/stockCheck_merge.vue b/pages/stock/stockCheck_merge.vue
index 614db9d..3b0e840 100644
--- a/pages/stock/stockCheck_merge.vue
+++ b/pages/stock/stockCheck_merge.vue
@@ -29,26 +29,20 @@
 					<view class="list-left-item">
 						<view class="desc">缂栫爜锛�</view>
 						<view class="left-item">
-							<uni-tag :text="item.matnr" type="primary"></uni-tag>
+							<uni-tag :text="item.matNo" type="primary"></uni-tag>
 						</view>
 					</view>
 					<view class="list-left-item">
 						<view class="desc">鍝佸悕锛�</view>
-						<view class="left-item">{{item.maktx}}</view>
+						<view class="left-item">{{item.matName}}</view>
 					</view>
 					<view class="list-left-item">
-						<view class="desc">瑙勬牸锛�</view>
-						<view class="left-item">{{item.specs}}</view>
-					</view>
-					<view class="list-left-item">
-						<view class="desc">鎵瑰彿锛�</view>
-						<view class="left-item">
-							<uni-tag :text="item.batch" type="warning"></uni-tag>
-						</view>
+						<view class="desc">鏃ユ湡锛�</view>
+						<view class="left-item">{{item.date}}</view>
 					</view>
 					<view class="list-left-item">
 						<view class="desc">鏁伴噺锛�</view>
-						<view class="left-item">{{item.anfme}}</view>
+						<view class="left-item">{{item.count}}</view>
 					</view>
 				</view>
 				<view class="list-right">
@@ -77,8 +71,10 @@
 						</view>
 					</view>
 					<view class="popup-item">
-						<view class="popup-item-left">鎵瑰彿:</view>
-						<view class="popup-item-right"><input type="text" v-model="batch"></view>
+						<view class="popup-item-left">鏃ユ湡:</view>
+						<view class="popup-item-right">
+							<uni-datetime-picker type="date" v-model="date" />
+						</view>
 					</view>
 					<view class="popup-item">
 						<view class="popup-item-left">鏁伴噺:</view>
@@ -143,8 +139,8 @@
 				content: '',
 				barcodeFocus: true,
 				matFocus: false,
-				matData: ''
-
+				matData: '',
+				date: ''
 			}
 		},
 		onLoad() {
@@ -163,31 +159,41 @@
 			search() {
 				let that = this
 				uni.request({
-					url: that.baseUrl + '/mobile/checkDetl/auth2',
-					header: {
-						'token':uni.getStorageSync('token')
-					},
-					data: {barcode: that.barcode},
-					method:'GET',
+					url: that.baseUrl + '/mobile/comb/form/barcode',
+					header: { 'token': uni.getStorageSync('token') },
+					data: { barcode: that.barcode },
+					method: 'GET',
 					success(res) {
-						console.log(res);
 						res = res.data
-						if(res.code === 200){
-							for(var i = 0; i < res.data.length;i++){
+						if (res.code === 200) {
+							for (var i = 0; i < res.data.length; i++) {
+								res.data[i]['maxAnfme'] = res.data[i].anfme
+								res.data[i]['matNo'] = res.data[i].matnr
+								res.data[i]['matName'] = res.data[i].maktx
+								res.data[i]['count'] = res.data[i].anfme
+								res.data[i]['date'] = res.data[i].date ? res.data[i].date : ''
 								that.dataList.push(res.data[i])
 							}
 						} else if (res.code == 403) {
-							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							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.showToast({
+								title: res.msg,
+								icon: "none",
+								position: 'top'
+							})
 						}
 					}
-					
+			
 				})
 			},
 			
@@ -215,9 +221,9 @@
 			findMat() {
 				let that = this
 				uni.request({
-					url: that.baseUrl + '/mat/auth',
+					url: that.baseUrl + '/matCode/list/auth',
 					data: {
-						matnr: that.matnr
+						mat_no: that.matnr
 					},
 					header: {
 						'token': uni.getStorageSync('token')
@@ -233,19 +239,20 @@
 								// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
 								success: function(res) {
 									res.eventChannel.emit('mat', {
-										data: result.data
+										data: result.data.records[0]
 									})
 								},
 								// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
 								events: {
 									matList: function(data) {
+										data.data['count'] = data.data.anfme
 										that.checkMat(data.data)
 									},
 								},
 							});
-						} else if (res.code == 403) {
+						} else if (result.code == 403) {
 							uni.showToast({
-								title: res.msg,
+								title: result.msg,
 								icon: "none",
 								position: 'top'
 							})
@@ -256,7 +263,7 @@
 							}, 1000);
 						} else {
 							uni.showToast({
-								title: res.msg,
+								title: result.msg,
 								icon: "none",
 								position: 'top'
 							})
@@ -292,7 +299,7 @@
 				var len = this.dataList.length
 				var add = true ,sameItem = false
 				for (var i = 0; i < len; i++) {
-					if (mat.matnr == this.dataList[i].matnr) {
+					if (mat.matNo == this.dataList[i].matNo) {
 						for (var j = 0; j < len; j++) {
 							if (mat.batch == this.dataList[j].batch) {
 								sameItem = true
@@ -309,7 +316,7 @@
 							
 						} else {
 							// 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
-							this.dataList[i].anfme += mat.anfme
+							this.dataList[i].count += mat.count
 							this.$forceUpdate() // 寮哄埗鍒锋柊
 							add = false
 						}
@@ -318,13 +325,14 @@
 				if (add) {
 					this.dataList.unshift(mat)
 				}
-				console.log(len);
 			},
 			// 淇敼鎵瑰彿
 			revise(item, i) {
 				this.matnr = this.dataList[i].matnr
-				this.count = this.dataList[i].anfme
+				this.count = this.dataList[i].count
 				this.batch = this.dataList[i].batch
+				this.maxAnfme = this.dataList[i].maxAnfme
+				this.date = this.dataList[i].date
 				this.rowNum = i
 				this.eject()
 			},
@@ -350,13 +358,15 @@
 				this.$refs.alertDialog.close()
 			},
 			reviseConfirm() {
-				this.dataList[this.rowNum].anfme = this.count
-				this.dataList[this.rowNum].batch = this.batch
+				this.dataList[this.rowNum].count = this.count
+				this.dataList[this.rowNum].date = this.date
+				this.matnr = ''
 				this.messageText = "淇敼鎴愬姛"
 				this.messageToggle('success')
 				this.$refs.revise.close()
 			},
 			reviseClose() {
+				this.matnr = ''
 				this.$refs.revise.close()
 			},
 			changeValue(value) {
@@ -399,9 +409,9 @@
 				var combMats = []
 				var combParam = {}
 				combParam['barcode'] = that.barcode
-				combParam['wrkDetls'] = that.dataList
+				combParam['combMats'] = that.dataList
 				uni.request({
-					url: that.baseUrl + '/mobile/adjustNew/auth',
+					url: that.baseUrl + '/mobile/comb/form/mergeBoard',
 					method: 'POST',
 					data: JSON.stringify(combParam),
 					header: {
@@ -433,6 +443,9 @@
 <style>
 	@import url('../../static/css/wms.css/wms.css');
 
+	.list:first-child {
+		margin-top: 320rpx;
+	}
 	.code {
 		width: 100%;
 		position: fixed;

--
Gitblit v1.9.1