From d36eb757af8867278125c6999fcaa5bdb902151c Mon Sep 17 00:00:00 2001
From: 付延余 <f-yanyu@outlook.com>
Date: 星期二, 21 三月 2023 17:38:45 +0800
Subject: [PATCH] 司机称重页面,签到页面
---
pages/public-page/forward/forward.vue | 40 +++++++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue
index c3d81d6..a8f43a6 100644
--- a/pages/public-page/forward/forward.vue
+++ b/pages/public-page/forward/forward.vue
@@ -48,15 +48,21 @@
export default {
onLoad(params) {
console.log('杞彂鐨勬彁鐓ゅ崟id', params.orderPlanId, params.carNum);
+ if (params.carNumSurplus1 || params.carNumSurplusHuodai) {
+ if (params.carNumSurplus1 != 0) {
+ this.forwardSurplus = params.carNumSurplus1;
+ } else if (params.carNumSurplusHuodai != 0) {
+ this.forwardSurplus = params.carNumSurplusHuodai;
+ }
+ }
this.forwardForm.orderPlanId = params.orderPlanId;
- this.carNumTatal = params.carNum;
},
data() {
return {
+ forwardSurplus: 0,
paramsName: {},
huoDaiData: [],
fleetData: [],
- carNumTatal: null,
name: '',
forwardForm: {
orderPlanId: null,
@@ -107,7 +113,7 @@
checkboxChange(value) {
console.log('澶嶉�夋鍙樺寲', value);
if (value.length != 0) {
- this.forwardForm.nums = this.carNumTatal;
+ this.forwardForm.nums = this.forwardSurplus;
} else {
this.forwardForm.nums = null;
}
@@ -141,9 +147,8 @@
// 杞彂閫夋嫨璐т唬
forwardHuoDaiObjectSelect(item) {
this.selectPopupShow = false;
- this.forwardForm.userId = item.id;
- // this.forwardForm.name = item.huoDaiName;
- this.name = item.huoDaiName;
+ this.forwardForm.userId = item.userId;
+ this.name = item.name;
this.forwardForm.fleetId = 0;
console.log('璐т唬閫夋嫨', this.forwardForm);
},
@@ -151,21 +156,26 @@
forwardFleetObjectSelect(item) {
this.selectPopupShow = false;
this.forwardForm.fleetId = item.id;
- // this.forwardForm.name = item.name;
this.name = item.name;
this.forwardForm.userId = 0;
console.log('杞﹂槦閫夋嫨', this.forwardForm);
},
// 鎻愪氦
submitForm() {
- this.$reqPost('forward', this.forwardForm, 'params').then(res => {
- if (res.code == 0) {
- this.$u.toast('鎻愪氦鎴愬姛');
- setTimeout(() => {
- uni.navigateBack({ delta: 1 });
- }, 1000);
- }
- });
+ if (isNaN(Number(this.forwardForm.nums)) || Number(this.forwardForm.nums) <= 0) {
+ this.$u.toast('璇疯緭鍏ュ悎娉曟暟瀛�');
+ } else if (Number(this.forwardForm.nums) > Number(this.forwardSurplus)) {
+ this.$u.toast('瓒呰繃鏈�澶ц鍗曞墿浣欓噺');
+ } else {
+ this.$reqPost('forward', this.forwardForm, 'params').then(res => {
+ if (res.code == 0) {
+ this.$u.toast('鎻愪氦鎴愬姛');
+ setTimeout(() => {
+ uni.navigateBack({ delta: 1 });
+ }, 1000);
+ }
+ });
+ }
},
tabClick(item) {
console.log('tab鐐瑰嚮', item);
--
Gitblit v1.9.1