From 19f0eca493f7e17ab7b67d28cf77d80de364576c Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 28 十月 2024 15:00:57 +0800
Subject: [PATCH] ll

---
 pda/pages/index/center.vue |   62 +++++++++++++++++++++---------
 1 files changed, 43 insertions(+), 19 deletions(-)

diff --git a/pda/pages/index/center.vue b/pda/pages/index/center.vue
index 1452c7a..1e91669 100644
--- a/pda/pages/index/center.vue
+++ b/pda/pages/index/center.vue
@@ -32,9 +32,9 @@
 					<view class="status" v-if="item.status == 4">鍙彿涓� {{ item.callDateTemp }}</view>
 					<view class="status scs" v-if="item.status == 5">宸蹭綔涓� {{ item.startDateTemp }}</view>
 				</view>
-				<view class="line" v-if="item.code">
+				<view class="line" v-if="item.billCode">
 					<text class="label">杩愯緭鍗曞彿</text>
-					<text class="value">{{ item.code }}</text>
+					<text class="value">{{ item.billCode }}</text>
 					<text class="primaryColor" @click="handleDetail(item)">杩愬崟璇︽儏</text>
 				</view>
 				<view class="line" v-else>
@@ -50,7 +50,7 @@
 					<text class="label">鎬昏繍杈撻噺</text>
 					<text class="value">{{ item.totalNum }}涓囨敮</text>
 				</view>
-				<view class="line" v-if="item.type != 4">
+				<view class="line" v-if="item.carrierName">
 					<text class="label">杩愯緭鍏徃</text>
 					<text class="value">{{ item.carrierName }}</text>
 				</view>
@@ -115,7 +115,7 @@
 								<text class="label">鎬昏繍杈撻噺</text>
 								<text class="value">{{ item.totalNum }}涓囨敮</text>
 							</view>
-							<view class="line" v-if="item.type != 4">
+							<view class="line" v-if="item.carrierName">
 								<text class="label">杩愯緭鍏徃</text>
 								<text class="value">{{ item.carrierName }}</text>
 							</view>
@@ -182,9 +182,9 @@
 			<view class="TransformModal">
 				<view class="title">杞Щ鏈堝彴</view>
 				<view class="transform_list">
-					<view class="line" @click="transformPlatClick(item)" v-for="item in activePlatformGroup.platformList"
+					<view class="line" @click="transformPlatClick(item)" v-for="item in TransferList"
 						:key="item.id">
-						<view class="name">{{ item.name }}</view>
+						<view class="name">{{ item.name  || item.platformName}}</view>
 						<view class="status" :class="{ green: item.workStatus == 1 }">({{ item.workStatus == 0 ? "绌洪棽" : "浣滀笟涓�" }})
 						</view>
 						<image v-if="transformPlatId == item.id" src="@/static/ic_select@2x.png" class="checked" />
@@ -245,28 +245,46 @@
 				callType: 1,
 
 				transformPlatId: '', // 杞Щ璁板綍鏈堝彴id
-				transformId: '', // 杞Щ璁板綍浠诲姟id
-				wmsInfo: {}
+				transformId: '', // 杞Щ璁板綍浠诲姟id
+				TransferList: [],
+				wmsInfo: {},
+				timer: null
 			}
 		},
 		onLoad() {
 			this.getPlatformGroup()
-			setInterval(() => {
-				this.getPlatformGroup()
-			}, 1000 * 30)
+			// setInterval(() => {
+			// 	this.getPlatformGroup()
+			// }, 1000 * 30)
 		},
-		methods: {
+		methods: {
+			getTransferList() {
+				getPlatformGroupList({
+					queryData: 1,
+					queryType: 1
+				}).then(res => {
+					const platformGroupList = res.data || []
+					if (platformGroupList.length > 0) {
+						const { activePlatformGroup } = this
+						const temp = platformGroupList.find(i => i.id === activePlatformGroup.id)
+						this.TransferList = temp.platformList || []
+					}
+				})
+			},
 			getPlatformGroup() {
 				getPlatformGroupList({
 					queryData: 1,
-					queryType: 0
+					queryType: 1
 				}).then(res => {
 					this.platformGroupList = res.data || []
 					if (this.platformGroupList.length > 0) {
 						this.activePlatformGroup = this.platformGroupList[0]
 						if (this.activePlatformGroup.platformList && this.activePlatformGroup.platformList.length > 0) {
-							this.activePlatform = this.activePlatformGroup.platformList[0]
-							this.getPlatformTask()
+							this.activePlatform = this.activePlatformGroup.platformList[0]
+							this.getPlatformTask()
+							this.timer = setInterval(() => {	
+								this.getPlatformTask()
+							}, 120 * 1000)
 						}
 					}
 				})
@@ -280,6 +298,7 @@
 					setInterval(() => {
 						this.circulInitTaskList()
 					}, 1000)
+				}, () => {
 				})
 			},
 			circulInitTaskList() {
@@ -298,7 +317,7 @@
 						if (item.newStartDate) {
 							let timeNum = time.getTime() - new Date(item.newStartDate).getTime()
 							if (timeNum > 3600000) {
-								item.startDateTemp = dayjs.duration(timeNum).format('H灏忔椂m鍒唖s绉�')
+								item.startDateTemp = dayjs.duration(timeNum).format('H灏忔椂m鍒唖绉�')
 							} else {
 								item.startDateTemp = dayjs.duration(timeNum).format('m鍒唖绉�')
 							}
@@ -311,8 +330,12 @@
 				const index = e.indexs[0]
 				this.activePlatformGroup = this.platformGroupList[index]
 				if (this.activePlatformGroup.platformList && this.activePlatformGroup.platformList.length > 0) {
-					this.activePlatform = this.activePlatformGroup.platformList[0]
-					this.getPlatformTask()
+					this.activePlatform = this.activePlatformGroup.platformList[0]
+					this.getPlatformTask()
+					clearInterval(this.timer)
+					this.timer = setInterval(() => {
+						this.getPlatformTask()
+					}, 60 * 1000)
 				}
 				this.showPlatformgroup = false
 			},
@@ -462,7 +485,8 @@
 					activePlatform
 				} = this
 				this.transformId = item.id
-				this.transformPlatId = activePlatform.id
+				this.transformPlatId = activePlatform.id
+				this.getTransferList()
 				this.showTransform = true
 			},
 			handleErr(item) {

--
Gitblit v1.9.3