From 21fb37c7162d5b47a14d6438870377c85fcc0b52 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期六, 07 十月 2023 10:23:21 +0800
Subject: [PATCH] 修改装卸员页面 调整websocket逻辑

---
 pages/public-page/forward/forward.vue |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue
index 235afb2..040efbe 100644
--- a/pages/public-page/forward/forward.vue
+++ b/pages/public-page/forward/forward.vue
@@ -37,7 +37,7 @@
 									<u-form-item label="杞彂瀵硅薄"
 										labelWidth="21%"
 										ref="item1"
-										@click="forwardObjectClick(index)">
+										@click="forwardObjectClick(index,val.name)">
 										<u--input v-model="val.name"
 											placeholder="鐐瑰嚮閫夋嫨杞彂瀵硅薄"
 											:readonly="true"
@@ -86,7 +86,8 @@
 					:hairline="false"
 					type="warning"
 					@click.stop="submitForm"
-					:disabled="whetherClick1"></u-button></view>
+					:disabled="whetherClick1"
+					:loading='loading'></u-button></view>
 		</view>
 		<!-- 澧炲姞鎸夐挳 -->
 
@@ -230,7 +231,10 @@
 					style: {
 						backgroundColor: '#FB0101'
 					}
-				}]
+				}],
+				loading: false, //鎻愪氦loading
+				originForwardName: '', //鍘熻浆鍙戝璞�
+				laterForwardName: '', //鍚庤浆鍙戝璞�		
 			};
 		},
 		onShow() {
@@ -332,9 +336,10 @@
 				});
 			},
 			// 杞彂
-			forwardObjectClick(index) {
+			forwardObjectClick(index, name) {
 				this.selectPopupShow = true;
 				this.index = index;
+				this.originForwardName = name || ''
 			},
 			selectPopupClose() {
 				this.selectPopupShow = false;
@@ -352,6 +357,9 @@
 						this.jhOrderPlanForwardList[this.index].xsUserId = item.userId;
 						this.jhOrderPlanForwardList[this.index].name = item.name;
 						this.jhOrderPlanForwardList[this.index].fleetId = 0;
+						if (this.originForwardName) {
+							this.addForm(item.name)
+						}
 					}
 				});
 			},
@@ -367,6 +375,9 @@
 						this.jhOrderPlanForwardList[this.index].fleetId = item.id;
 						this.jhOrderPlanForwardList[this.index].name = item.name;
 						this.jhOrderPlanForwardList[this.index].xsUserId = 0;
+						if (this.originForwardName) {
+							this.addForm(item.name)
+						}
 					}
 				});
 			},
@@ -411,7 +422,7 @@
 							that.calculate(that.jhOrderPlanForwardList);
 							if (that.roleType == 1) {
 								if (that.jhOrderPlanForwardList[index].carNum < Number(that
-									.carNumSurplus1)) {
+										.carNumSurplus1)) {
 									that.$set(that.jhOrderPlanForwardList[index], 'checkboxValue1', '');
 									that.jhOrderPlanForwardList.forEach((v, i) => {
 										if (index != i) {
@@ -442,13 +453,13 @@
 				this.calculate(this.jhOrderPlanForwardList);
 			},
 			// 娣诲姞涓�缁勮〃鍗�
-			addForm() {
+			addForm(name) {
 				// 鍒ゆ柇鏄惁鏈変竴涓閫夛紝濡傛灉鏈夊垯绂佹鏂板姞鐨勫閫夛紝娌℃湁鍒欎笉绂佹
 				let ischeck = this.jhOrderPlanForwardList.some(v => v.ischecked == true);
 				if (!ischeck) {
 					this.jhOrderPlanForwardList.push({
 						orderPlanId: this.orderPlanId,
-						name: '',
+						name: name || '',
 						carNum: null,
 						xsUserId: 0,
 						fleetId: 0,
@@ -460,7 +471,7 @@
 				} else {
 					this.jhOrderPlanForwardList.push({
 						orderPlanId: this.orderPlanId,
-						name: '',
+						name: name || '',
 						carNum: null,
 						xsUserId: 0,
 						fleetId: 0,
@@ -509,14 +520,17 @@
 					}
 				});
 				if (isPass) {
+					this.loading = true;
 					this.$reqPost('forward', this.jhOrderPlanForwardList, 'json').then(res => {
 						console.log(res, 'zh');
 						if (res.code == 0) {
+							this.loading = false
 							this.$u.toast('鎻愪氦鎴愬姛');
 							setTimeout(() => {
 								uni.navigateBack({ delta: 1 });
 							}, 1000);
 						} else {
+							this.loading = false
 							this.$u.toast(res.msg);
 						}
 					});

--
Gitblit v1.9.1