From 7986bc00e330411ffc73da24fdd168c6af8cf295 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期一, 27 三月 2023 10:46:12 +0800
Subject: [PATCH] 0327测试

---
 pages/public-page/forward/forward.vue                                          |   13 +++
 api/publicInterface.js                                                         |    3 
 api/request.js                                                                 |    7 +
 pages.json                                                                     |   10 +-
 pages/customer-page/customer-index/customer-index.vue                          |   51 +++++++++++++---
 pages/customer-page/fleet-management/fleet-management.vue                      |   16 ++++-
 pages/tabbar-page/index-tabbar/index-tabbar.vue                                |   23 ++++++-
 pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue |    4 
 pages/driver-page/driver-index/driver-index.vue                                |   28 +++++----
 9 files changed, 112 insertions(+), 43 deletions(-)

diff --git a/api/publicInterface.js b/api/publicInterface.js
index cb9197f..9d4e0c7 100644
--- a/api/publicInterface.js
+++ b/api/publicInterface.js
@@ -6,7 +6,8 @@
 	BaseUrl as wrBaseUrl
 } from '@/api/request.js'
 // const BaseUrl = "http://192.168.0.120:9999"
-const BaseUrl = "http://192.168.3.109:9999"
+const BaseUrl = "http://192.168.0.144:9999"
+// const BaseUrl = "http://10.101.33.114:9999"
 
 // 鐧诲綍
 // function apiLogin({
diff --git a/api/request.js b/api/request.js
index ed6e018..da0f940 100644
--- a/api/request.js
+++ b/api/request.js
@@ -80,9 +80,12 @@
 
 // const BaseUrl = "http://192.168.0.120:9997"
 // const webSocketUrl = "ws://192.168.0.120:9997/wrzs/ws/info"
-const BaseUrl = "http://192.168.3.109:9997";
-const webSocketUrl = "ws://192.168.3.109:9997/wrzs/ws/info"
 
+// const BaseUrl = "http://192.168.3.109:9997";
+const BaseUrl = "http://192.168.0.144:9997";
+
+const webSocketUrl = "ws://192.168.3.109:9997/wrzs/ws/info"
+// const webSocketUrl = "ws://10.101.33.114:9997/wrzs/ws/info"
 // 璇锋眰鎷︽埅
 const fetch = (url, opt) => {
 	// 鏌ユ壘瀵瑰簲鍦板潃
diff --git a/pages.json b/pages.json
index 200f5c4..b3d3053 100644
--- a/pages.json
+++ b/pages.json
@@ -25,7 +25,7 @@
 			"path": "pages/tabbar-page/index-tabbar/index-tabbar",
 			"style": {
 				"navigationBarTitleText": "棣栭〉",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true
 			}
 
 		}, {
@@ -40,7 +40,7 @@
 			"path": "pages/customer-page/customer-index/customer-index",
 			"style": {
 				"navigationBarTitleText": "棣栭〉",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true
 			}
 
 		}, {
@@ -54,7 +54,7 @@
 			"path": "pages/driver-page/driver-index/driver-index",
 			"style": {
 				"navigationBarTitleText": "棣栭〉",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true
 			}
 
 		}, {
@@ -68,7 +68,7 @@
 			"path": "pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index",
 			"style": {
 				"navigationBarTitleText": "棣栭〉",
-				"enablePullDownRefresh": false
+				"enablePullDownRefresh": true
 			}
 
 		}, {
@@ -204,4 +204,4 @@
 			"query": "" //鍚姩鍙傛暟锛屽湪椤甸潰鐨刼nLoad鍑芥暟閲岄潰寰楀埌
 		}]
 	}
-}
\ No newline at end of file
+}
diff --git a/pages/customer-page/customer-index/customer-index.vue b/pages/customer-page/customer-index/customer-index.vue
index 58d8c57..cce6dc0 100644
--- a/pages/customer-page/customer-index/customer-index.vue
+++ b/pages/customer-page/customer-index/customer-index.vue
@@ -48,7 +48,7 @@
 		</view>
 		<view class="history-numbers">
 			<combined-title title="鍘嗗彶鎻愮叅鍗�"></combined-title>
-			<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y">
+			<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="historyScrolltolower">
 				<uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁" :loading="loading">
 					<uni-tr>
 						<uni-th width="100" align="center">鍙戣繍鏃ユ湡</uni-th>
@@ -69,8 +69,8 @@
 						<uni-td align="center">{{ item.tmCount }}</uni-td>
 					</uni-tr>
 				</uni-table>
+				<view class="more_text" v-if="showMoreData">娌℃湁鏁版嵁浜�...</view>
 			</scroll-view>
-			<view class="uni-pagination-box"><uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total" @change="change2" /></view>
 		</view>
 		<!-- 棰嗗彇寮瑰嚭妗� -->
 		<u-popup :show="show" @close="close" @open="open" mode="center" round="10">
@@ -88,9 +88,23 @@
 import combinedTitle from '@/components/combined-title/combined-title.vue';
 import { customerId } from '@/utils/status';
 export default {
+	props: {
+		orderPlanDataStore: {
+			type: Array,
+			default: []
+		}
+	},
 	components: {
 		card,
 		combinedTitle
+	},
+	watch: {
+		orderPlanDataStore(v) {
+			if (v.length > 0) {
+				console.log(v, 'props');
+				this.orderPlanData = v;
+			}
+		}
 	},
 	data() {
 		return {
@@ -110,7 +124,9 @@
 			// 褰撳墠椤�
 			pageCurrent: 1,
 			// 鏁版嵁鎬婚噺
-			total: 0
+			total: 0,
+			// 鏄惁鏄剧ず鏇村鏁版嵁
+			showMoreData: false
 		};
 	},
 	onLoad() {},
@@ -121,6 +137,7 @@
 		init() {
 			this.GetOrderPlan();
 			this.getJhOrderPlanDataPage();
+			if (this.pageCurrent * this.pageSize >= this.total) return (this.showMoreData = true);
 		},
 		// 鑾峰彇鍙戣繍璁″垝鍒楄〃
 		GetOrderPlan() {
@@ -128,22 +145,31 @@
 				title: '鍔犺浇涓�...'
 			});
 			this.$reqGet('GetOrderPlan').then(res => {
-				this.orderPlanData = res.data;
-				uni.hideLoading();
+				if (res.data) {
+					this.orderPlanData = res.data;
+					uni.hideLoading();
+				}
 			});
 		},
 		// 鑾峰彇鍘嗗彶鎻愮叅鍗�
 		getJhOrderPlanDataPage() {
 			this.loading = true;
 			this.$reqGet('getJhOrderPlanDataPage', { current: this.pageCurrent, size: this.pageSize }).then(res => {
-				this.historyCoalData = res.data.records;
-				this.total = res.data.total;
-				this.loading = false;
+				if (res.data.records) {
+					this.historyCoalData = [...this.historyCoalData, ...res.data.records];
+					this.total = res.data.total;
+					this.loading = false;
+				}
 			});
 		},
 		change2(e) {
-			console.log(e, '椤电爜鏀瑰彉');
 			this.pageCurrent = e.current;
+			this.getJhOrderPlanDataPage();
+		},
+		// 涓婃媺鍔犺浇
+		historyScrolltolower() {
+			if (this.pageCurrent * this.pageSize >= this.total) return (this.showMoreData = true);
+			this.pageCurrent++;
 			this.getJhOrderPlanDataPage();
 		},
 		popupDetermineClick() {
@@ -217,7 +243,12 @@
 	height: 60rpx;
 }
 .scroll-Y {
-	height: 600rpx;
+	height: 300rpx;
+	.more_text {
+		color: #999;
+		font-size: 24rpx;
+		text-align: center;
+	}
 }
 ::v-deep.customer-index {
 	width: 94%;
diff --git a/pages/customer-page/fleet-management/fleet-management.vue b/pages/customer-page/fleet-management/fleet-management.vue
index 5d3a8ef..b290840 100644
--- a/pages/customer-page/fleet-management/fleet-management.vue
+++ b/pages/customer-page/fleet-management/fleet-management.vue
@@ -2,13 +2,20 @@
 	<view class="fleet-management">
 		<view><u-notice-bar mode="closable" fontSize="25" :text="text1"></u-notice-bar></view>
 		<view class="groupCars" v-if="groupCarsShow">
-			<u-collapse @change="change" @close="close" @open="open" accordion :border="false">
+			<u-collapse @change="change" @close="close" @open="open" :border="false" :value="['0']">
 				<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" v-if="fleetDriverData.length == 0" width="400" height="400" textSize="18"></u-empty>
-				<u-collapse-item :title="fleetDriverData[0].fleetName" name="杞﹂槦" v-if="fleetDriverData.length != 0">
+				<u-collapse-item :title="fleetDriverData[0].fleetName" v-if="fleetDriverData.length != 0" name="0">
 					<view class="myCarContainer">
 						<u-swipe-action>
 							<u-cell-group>
-								<u-swipe-action-item :options="options1" v-for="(item, index) in fleetDriverData" :key="index" :index="item.id" :name="item.userId" @click="deleteGroupClick">
+								<u-swipe-action-item
+									:options="options1"
+									v-for="(item, index) in fleetDriverData"
+									:key="index"
+									:index="item.id"
+									:name="item.userId"
+									@click="deleteGroupClick"
+								>
 									<u-cell icon="car" iconStyle="font-size:20px;" :title="item.carNo" :value="item.name"></u-cell>
 								</u-swipe-action-item>
 							</u-cell-group>
@@ -59,7 +66,8 @@
 			// 鍒犻櫎灏忕粍妯℃�佹
 			title: '鎻愮ず',
 			content: '',
-			deleteGroupShow: false // 鍒犻櫎灏忕粍妯℃�佹,
+			deleteGroupShow: false, // 鍒犻櫎灏忕粍妯℃�佹,
+			value: ['0']
 		};
 	},
 	onShow() {
diff --git a/pages/driver-page/driver-index/driver-index.vue b/pages/driver-page/driver-index/driver-index.vue
index 34a11e5..630c030 100644
--- a/pages/driver-page/driver-index/driver-index.vue
+++ b/pages/driver-page/driver-index/driver-index.vue
@@ -22,10 +22,10 @@
 					<view class="right-top">
 						<view class="card-right-top-row">
 							<view>
-								<text>{{ item.deptName ||''}}</text>
+								<text>{{ item.deptName || '' }}</text>
 							</view>
 							<view>
-								<text>{{ item.coalName ||''}}</text>
+								<text>{{ item.coalName || '' }}</text>
 							</view>
 						</view>
 						<view class="card-right-top-row">
@@ -35,12 +35,12 @@
 						</view>
 						<view class="card-right-top-row">
 							<view>
-								<text>{{item.filedName||''}}</text>
+								<text>{{ item.filedName || '' }}</text>
 							</view>
 						</view>
 						<view class="card-right-top-row">
 							<view>
-								<text>{{item.orderCode||''}}</text>
+								<text>{{ item.orderCode || '' }}</text>
 							</view>
 						</view>
 					</view>
@@ -137,7 +137,8 @@
 			qiangDanShow: false,
 			qiangDanTitle: '鎶㈠崟鎻愮ず',
 			qiangDanContent: '',
-			qiangDanOrderPlanId: null
+			qiangDanOrderPlanId: null,
+			fleetId: ''
 		};
 	},
 	onShow() {
@@ -160,9 +161,10 @@
 		// 鎶㈠崟鎸夐挳
 		qiangDanBtn(value) {
 			if (value.tmcCount == '0') {
-				this.qiangDan(value.orderPlanId);
+				this.qiangDan(value.orderPlanId, value.fleetId);
 			} else {
 				this.qiangDanOrderPlanId = value.orderPlanId;
+				this.fleetId = value.fleetId;
 				this.qiangDanShow = true;
 				this.qiangDanContent = `宸叉姠${value.tmcCount}鍗曪紝纭畾鎶㈠崟锛焋;
 			}
@@ -170,20 +172,22 @@
 		// 鎶㈠崟妯℃�佹
 		qiangDanConfirm() {
 			this.qiangDanContent = '';
-			this.qiangDan(this.qiangDanOrderPlanId);
+			this.qiangDan(this.qiangDanOrderPlanId, this.fleetId);
 		},
 		qiangDanCancel() {
 			this.qiangDanShow = false;
 		},
 		// 鎶㈠崟璇锋眰
-		qiangDan(id) {
-			this.$reqPost('qiangDan', { orderPlanId: id }, 'params').then(res => {
+		qiangDan(id, fleetId) {
+			this.$reqPost('qiangDan', { orderPlanId: id, fleetId: fleetId }, 'params').then(res => {
 				if (res.code == 0) {
 					this.$u.toast('鎶㈠崟鎴愬姛');
+					this.qiangDanShow = false;
+					this.qiangDanList();
 				} else {
 					this.$u.toast(res.data ? res.data : '鎶㈠崟澶辫触');
+					this.qiangDanShow = false;
 				}
-				this.qiangDanList();
 			});
 		},
 		list3CardIconClick(value) {
@@ -267,11 +271,11 @@
 			}
 			&Table {
 				.uni-table {
-					min-width: 94%!important;
+					min-width: 94% !important;
 					.uni-table-tr {
 						padding: 0;
 						.uni-table-th {
-							width:33.3%;
+							width: 33.3%;
 							line-height: 58rpx;
 							padding: vww(5) vww(10);
 							color: #111111;
diff --git a/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue b/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue
index eaec294..57ba501 100644
--- a/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue
+++ b/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue
@@ -14,7 +14,7 @@
 					<view class="right-top">
 						<view class="card-right-top-row">
 							<view>
-								<text>杞彂鍓╀綑锛歿{ item.carNumSurplusHuodai || '' }}</text>
+								<text>杞彂鍓╀綑锛歿{ item.carNumSurplusHuodai || 0 }}</text>
 							</view>
 							<view>
 								<text>{{ item.coalName || '' }}</text>
@@ -70,7 +70,7 @@
 		// 杞彂
 		forwardClick(value) {
 			uni.navigateTo({
-				url: `/pages/public-page/forward/forward?orderPlanId=${value.orderPlanId}&carNumSurplusHuodai=${value.carNumSurplusHuodai}`
+				url: `/pages/public-page/forward/forward?orderPlanId=${value.orderPlanId}&carNumSurplusHuodai=${value.carNumSurplusHuodai}&carNum=${value.carNum}`
 			});
 		}
 	}
diff --git a/pages/public-page/forward/forward.vue b/pages/public-page/forward/forward.vue
index e10f843..9b1f156 100644
--- a/pages/public-page/forward/forward.vue
+++ b/pages/public-page/forward/forward.vue
@@ -1,7 +1,8 @@
 <template>
 	<!-- 杞彂 -->
 	<view class="forward">
-		<view><u-notice-bar :text="text" :fontSize="30" mode="link"></u-notice-bar></view>
+		<view v-if="roleType == 1"><u-notice-bar :text="text" :fontSize="30" mode="link"></u-notice-bar></view>
+		<view v-else-if="roleType == 2"><u-notice-bar :text="text1" :fontSize="30" mode="link"></u-notice-bar></view>
 		<view class="forward-card" v-for="(val, index) in jhOrderPlanForwardList">
 			<u--form labelPosition="top" :model="forwardForm" ref="form1">
 				<u-form-item label="杞彂瀵硅薄" labelWidth="20%" ref="item1" @click="forwardObjectClick(index)">
@@ -53,8 +54,12 @@
 
 export default {
 	onLoad(params) {
+		// 瀹㈡埛
 		this.cars2 = Number(params.cars2);
 		this.carNumSurplus1 = Number(params.carNumSurplus1);
+		// 璐т唬
+		this.carNum = Number(params.carNum);
+		this.carNumSurplusHuodai = Number(params.carNumSurplusHuodai);
 		if (params.carNumSurplus1 || params.carNumSurplusHuodai) {
 			if (params.carNumSurplus1 != 0) {
 				this.forwardSurplus = params.carNumSurplus1;
@@ -76,7 +81,6 @@
 						checkboxValue1: ''
 					};
 				});
-				console.log(this.jhOrderPlanForwardList, '鍒楄〃');
 			} else {
 				this.jhOrderPlanForwardList = this.jhOrderPlanForwardList.map(v => {
 					if (!v.orderPlanId) {
@@ -122,6 +126,8 @@
 			tabHuoDai: false,
 			carNumSurplus1: '',
 			cars2: '',
+			carNum: '',
+			carNumSurplusHuodai: '',
 			formNum: 1
 		};
 	},
@@ -138,6 +144,9 @@
 		},
 		text() {
 			return `宸查鍙�${this.cars2}寮犳棩璁″垝鍗�,鍓╀綑${this.carNumSurplus1}寮犳棩璁″垝鍗昤;
+		},
+		text1() {
+			return `宸叉嫢鏈�${this.carNum}寮犳棩璁″垝鍗�,鍓╀綑${this.carNumSurplusHuodai}寮犳棩璁″垝鍗昤;
 		}
 	},
 	methods: {
diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue
index aa804f7..5d9d6d6 100644
--- a/pages/tabbar-page/index-tabbar/index-tabbar.vue
+++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<customer-index v-if="roleType == 1" ref="customerIndexRef"></customer-index>
+		<customer-index v-if="roleType == 1" ref="customerIndexRef" :orderPlanDataStore="orderPlanDataStore"></customer-index>
 		<freight-forwarder-index v-if="roleType == 2" ref="freightForwarderIndexRef"></freight-forwarder-index>
 		<driver-index v-if="roleType == 3" ref="driverIndexRef"></driver-index>
 		<tab-bar :current="0"></tab-bar>
@@ -11,19 +11,31 @@
 import customerIndex from '@/pages/customer-page/customer-index/customer-index.vue';
 import driverIndex from '@/pages/driver-page/driver-index/driver-index.vue';
 import freightForwarderIndex from '@/pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue';
-
+import { mapState } from 'vuex';
 export default {
 	components: {
 		customerIndex,
 		driverIndex,
 		freightForwarderIndex
 	},
-	onLoad(){
+	onPullDownRefresh() {
+		uni.showLoading({
+			title: '鍔犺浇涓�...'
+		});
+		this.$reqGet('GetOrderPlan').then(res => {
+			if (res.data) {
+				this.orderPlanDataStore = res.data;
+				uni.hideLoading();
+				uni.stopPullDownRefresh();
+			}
+		});
+	},
+	onLoad() {
 		// 寮�鍚弻浜洪�氳瘽
 		wx.setEnable1v1Chat({
 			enable: true,
 			backgroundType: 1,
-			minWindowType:2,
+			minWindowType: 2,
 			success() {
 				console.log('寮�鍚弻浜洪�氳瘽鎴愬姛');
 			},
@@ -37,7 +49,8 @@
 	},
 	data() {
 		return {
-			roleType: null
+			roleType: null,
+			orderPlanDataStore: []
 		};
 	},
 	onShow() {

--
Gitblit v1.9.1