From c612912d4132e4d7b4a58279071fac837891c381 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期五, 27 九月 2024 17:08:25 +0800
Subject: [PATCH] feat:库管确认装卸毛重净重按条件显示,司机填原发信息增加限制

---
 pages/public-page/forward/forward.vue |   52 +++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue
index 85a8fae..db7585b 100644
--- a/pages/public-page/forward/forward.vue
+++ b/pages/public-page/forward/forward.vue
@@ -73,7 +73,9 @@
 												</u-checkbox-group>
 											</view>
 										</u-form-item>
+										
 									</u--form>
+									<view><u-button v-if="/鑱氭隘涔欑儻鏍戣剛/.test(this.productName) &&  isShow" text="鍒嗛厤鏃ヨ鍒掑惃鏁�" type="primary" :plain="true" @click="todoFenPei(val)"></u-button></view>
 								</view>
 							</view>
 						</view>
@@ -162,6 +164,9 @@
 			console.log(params, '杞彂椤甸潰鐨勫弬鏁�');
 			let reg=RegExp(/閿�/)
 			this.isshow=!reg.test(params.orderType)
+			this.productName = params.productName;
+			this.customerId = params.customerId;
+			this.pvcPlanMeasure = params.pvcPlanMeasure;
 			// 瀹㈡埛
 			this.cars2 = Number(params.cars2);
 			this.tempcarNumSurplus1 = this.carNumSurplus1 = Number(params.carNumSurplus1 || 0);
@@ -192,8 +197,11 @@
 		data() {
 			return {
 				isshow:false,
+				pvcPlanMeasure:'',
 				forwardSurplus: 0,
 				paramsName: {},
+				productName:'',
+				customerId:'',
 				huoDaiData: [],
 				isClickFlag:true,// true 鍙互 or false for forward and back to the direction of the car direction (default	 	
 				fleetData: [],
@@ -233,6 +241,7 @@
 				}],
 				loading: false, //鎻愪氦loading
 				originForwardName: '', //鍘熻浆鍙戝璞�
+				isShow:false,
 				laterForwardName: '', //鍚庤浆鍙戝璞�
 				errorDataList: [], // 閿欒鏁版嵁
 				isDirectAdd: false, // 鏄惁鏄湪鍘熸潵鏈夊璞$殑item淇敼 鏄殑涓簍rue
@@ -241,6 +250,8 @@
 		},
 		onShow() {
 			this.init();
+			this.getBuild();
+			// this.getOrderPlan();
 			if (this.roleType == 2) {
 				this.list1.splice(1, 1);
 				this.tabHuoDai = false;
@@ -264,6 +275,12 @@
 				})
 				this.$reqGet('forwardList', { OrderPlanId: this.orderPlanId }).then(res => {
 					uni.hideLoading()
+					if(res.data.length){
+						this.isShow = true;
+					}else{
+						this.isShow =  false;
+
+					}
 					if (res.data.length !== 0 && this.roleType == 1) {
 						this.jhOrderPlanForwardList = res.data.map((item, index) => {
 							return {
@@ -305,6 +322,15 @@
 				}).catch(e => {
 					uni.hideLoading()
 				})
+			},
+			getBuild(){
+				console.log(this.productName,'opr')
+				if(/鑱氭隘涔欑儻鏍戣剛/.test(this.productName)){
+					this.$reqGet('getBuildList',{orderPlanId:this.orderPlanId,customerId:this.customerId}).then(res=>{
+					console.log(res,'resss')
+				})
+				}
+				
 			},
 			// 杩斿洖涓婁竴椤�
 			back() {
@@ -471,6 +497,7 @@
 					// 	this.selectPopupShow = true;
 					// }
 					// } else {
+					console.log(this.jhOrderPlanForwardList,item,'jhOrderPlanForwardList')
 					let isableAdd = this.jhOrderPlanForwardList.filter(v => item.name === v.name);
 					if (isableAdd.length > 0) {
 						this.$u.toast('瀛樺湪閲嶅娣诲姞');
@@ -607,6 +634,7 @@
 			},
 			// 鎻愪氦
 			submitForm() {
+				//杞︽暟 * 鍚ㄦ暟 <  璁″垝鍚ㄦ暟
 				let isPass = false;
 				if (this.jhOrderPlanForwardList.length === 0) {
 					this.$u.toast('璇疯嚦灏戦�夋嫨涓�缁勮浆鍙戝璞�');
@@ -615,6 +643,10 @@
 				this.jhOrderPlanForwardList.forEach(v => {
 					if (!reg.test(v.carNum) || Number(v.carNum) <= 0) {
 						this.$u.toast('璇疯緭鍏ュ悎娉曟暟瀛�');
+						isPass = false;
+						return isPass;
+					} else if (!v.name){
+						this.$u.toast('璇烽�夋嫨杞﹂槦');
 						isPass = false;
 						return isPass;
 					} else {
@@ -628,12 +660,22 @@
 					this.$reqPost('forward', this.jhOrderPlanForwardList, 'json').then(res => {
 						console.log(res, 'zh');
 						// res.data.length == 0 鎻愪氦鎴愬姛 鍚﹀垯鎻愪氦澶辫触
-						if (res.data.length == 0) {
+						if (res.code === 0) {
 							this.loading = false
 							this.$u.toast('鎻愪氦鎴愬姛');
-							setTimeout(() => {
+							if(/鑱氭隘涔欑儻鏍戣剛/.test(this.productName)){
+								setTimeout(()=>{
+									uni
+					.navigateTo({ url: `/subPages/allocaTetonnage/index?orderPlanId=${this.orderPlanId}&customerId=${this.customerId}&status=${1}&pvcPlanMeasure=${this.pvcPlanMeasure}`});
+
+								},500)
+					
+							}else{
+								setTimeout(() => {
 								uni.navigateBack({ delta: 1 });
 							}, 1000);
+							}
+						
 						} else {
 							this.loading = false
 							this.errorDataList = res.data
@@ -651,6 +693,10 @@
 					this.tabHuoDai = false;
 				}
 			},
+			todoFenPei(val){
+				uni
+					.navigateTo({ url: `/subPages/allocaTetonnage/index?orderPlanId=${this.orderPlanId}&customerId=${this.customerId}&fleetId=${val.fleetId}&pvcPlanMeasure=${this.pvcPlanMeasure}`});
+			}
 		}
 	};
 </script>
@@ -744,7 +790,7 @@
 				.forward-card {
 					margin-top: vww(10);
 					width: 690rpx;
-					height: 275rpx;
+					height: 400rpx;
 					background: #ffffff;
 					box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15);
 					border-radius: 20rpx;

--
Gitblit v1.9.1