From 4c9d218bf8742f22276245e7d623ff823d13758d Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期三, 12 二月 2025 18:27:56 +0800 Subject: [PATCH] ll --- h5/pages.json | 2 h5/pages/driver/taskDetail.vue | 8 + h5/pages/driver/index.vue | 2 admin/src/views/platform/components/PlatformSign.vue | 14 ++- h5/pages/staff/index.vue | 2 pda/pages/index/center.vue | 203 +++++++++++++++++++++++++++++++++----------------- h5/pages/driver/taskConfirm.vue | 6 + 7 files changed, 152 insertions(+), 85 deletions(-) diff --git a/admin/src/views/platform/components/PlatformSign.vue b/admin/src/views/platform/components/PlatformSign.vue index d357401..871adb6 100644 --- a/admin/src/views/platform/components/PlatformSign.vue +++ b/admin/src/views/platform/components/PlatformSign.vue @@ -96,21 +96,23 @@ handleCall(item) { // const activePlatform = this.activePlat platformJobSign({ jobId: item.id, signType: '2' }).then(res => { - Message.success('绛惧埌鎴愬姛') - this.$emit('success') - this.getList() + if (res.code == 200) { + Message.success('绛惧埌鎴愬姛') + this.$emit('success') + this.getList() + } }) }, getList(page) { const { activePlat, pagination, carCodeFront } = this - if(page){ + if (page) { pagination.page = page - } + } platformJobPage({ model: { platformGroupId: activePlat.id, queryStatus: '0,1', carCodeFront }, page: pagination.page, capacity: pagination.pageSize - }).then(res => { + }).then(res => { this.dataList = res.records this.pagination.total = res.total }) diff --git a/h5/pages.json b/h5/pages.json index 7db0f08..149b228 100644 --- a/h5/pages.json +++ b/h5/pages.json @@ -317,7 +317,7 @@ { "path": "pages/driver/reserved", "style": { - "navigationBarTitleText": "鍏ュ洯棰勭害", + "navigationBarTitleText": "鍏ュ洯鍗歌揣棰勭害", "enablePullDownRefresh": false } }, diff --git a/h5/pages/driver/index.vue b/h5/pages/driver/index.vue index 74e5e30..db7e113 100644 --- a/h5/pages/driver/index.vue +++ b/h5/pages/driver/index.vue @@ -64,7 +64,7 @@ <view class="left"> <view class="img_wrap img1" @click="jump('/pages/driver/notice')"> <image src="@/static/driver/wuliu_ic_ruyuanyuyue@2x.png" class="img"></image> - <view class="h1">鍏ュ洯棰勭害</view> + <view class="h1">鍏ュ洯鍗歌揣棰勭害</view> <view class="h2">RESERVATION</view> </view> <view class="img_wrap img2" @click="jump('/pages/driver/reservedGuide?str=bookingTips')"> diff --git a/h5/pages/driver/taskConfirm.vue b/h5/pages/driver/taskConfirm.vue index f8327f9..966c2c5 100644 --- a/h5/pages/driver/taskConfirm.vue +++ b/h5/pages/driver/taskConfirm.vue @@ -156,8 +156,10 @@ carCodeBack: param.carCodeBack, arriveDate: param.date + ':59' }).then(res =>{ - this.showToast('纭鎴愬姛') - this.$goBack() + if(res && res.code == 200){ + this.showToast('纭鎴愬姛') + this.$goBack() + } }) }, getDetail(jobId) { diff --git a/h5/pages/driver/taskDetail.vue b/h5/pages/driver/taskDetail.vue index 7484ad8..a5229da 100644 --- a/h5/pages/driver/taskDetail.vue +++ b/h5/pages/driver/taskDetail.vue @@ -232,9 +232,11 @@ lat, lnt, signType: 0 - }).then(res => { - this.showToast('绛惧埌鎴愬姛') - this.getDetail() + }).then(res => { + if (res && res.code == 200) { + this.showToast('绛惧埌鎴愬姛') + this.getDetail() + } }) }, getDetail() { diff --git a/h5/pages/staff/index.vue b/h5/pages/staff/index.vue index 17ea5a9..6cb007b 100644 --- a/h5/pages/staff/index.vue +++ b/h5/pages/staff/index.vue @@ -145,7 +145,7 @@ } else if (yw == 7) { this.jump('/pages/staff/task/driver?id=' + ywinfo.ywid) } else if (yw == 5) { - this.jump('/pages/staff/vehicle/sendACarDetail') + this.jump('/pages/staff/vehicle/sendACarDetail?id=' + ywinfo.ywid) } }, 100) } diff --git a/pda/pages/index/center.vue b/pda/pages/index/center.vue index 0bd09a4..c07d174 100644 --- a/pda/pages/index/center.vue +++ b/pda/pages/index/center.vue @@ -39,7 +39,7 @@ </view> <view class="line" v-else> <text class="label">鍚堝悓鍗曞彿</text> - <text class="value">{{ item.contractNum }}</text> + <text class="value">{{ item.contractNum }}</text> <text class="primaryColor" @click="subDetail(item)">棰勭害璇︽儏</text> </view> <view class="line"> @@ -104,7 +104,7 @@ </view> <view class="line" v-else> <text class="label">鍚堝悓鍗曞彿</text> - <text class="value">{{ item.contractNum }}</text> + <text class="value">{{ item.contractNum }}</text> <text class="primaryColor" @click="subDetail(item)">棰勭害璇︽儏</text> </view> <view class="line"> @@ -182,8 +182,7 @@ <view class="TransformModal"> <view class="title">杞Щ鏈堝彴</view> <view class="transform_list"> - <view class="line" @click="transformPlatClick(item)" v-for="item in TransferList" - :key="item.id"> + <view class="line" @click="transformPlatClick(item)" v-for="item in TransferList" :key="item.id"> <view class="name">{{ item.name || item.platformName}}</view> <view class="status" :class="{ green: item.workStatus == 1 }">({{ item.workStatus == 0 ? "绌洪棽" : "浣滀笟涓�" }}) </view> @@ -245,10 +244,11 @@ callType: 1, transformPlatId: '', // 杞Щ璁板綍鏈堝彴id - transformId: '', // 杞Щ璁板綍浠诲姟id + transformId: '', // 杞Щ璁板綍浠诲姟id TransferList: [], - wmsInfo: {}, - timer: null + wmsInfo: {}, + timer: null, + timer1: null, } }, onLoad() { @@ -256,20 +256,38 @@ // setInterval(() => { // this.getPlatformGroup() // }, 1000 * 30) + }, + onHide(){ + if(this.timer1){ + clearInterval(this.timer1) + } + if(this.timer){ + clearInterval(this.timer) + } + }, + onUnload(){ + if(this.timer1){ + clearInterval(this.timer1) + } + if(this.timer){ + clearInterval(this.timer) + } }, - 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 || [] - } - }) + 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({ @@ -280,42 +298,57 @@ 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.timer = setInterval(() => { - this.getPlatformTask() + this.activePlatform = this.activePlatformGroup.platformList[0] + this.getPlatformTask() + this.timer = setInterval(() => { + this.getPlatformTask() }, 120 * 1000) } } }) }, - getPlatformTask() { + getPlatformTask() { + if(this.timer1){ + clearInterval(this.timer1) + } getPlatformWorkData({ platformId: this.activePlatform.id }).then(res => { - this.platformTaskInfo = res.data - this.circulInitTaskList() - setInterval(() => { - this.circulInitTaskList() + this.platformTaskInfo = res.data + this.currentDate = new Date(res.data.currentDate).getTime() + this.circulInitTaskList() + this.currentDate = this.currentDate + 1000 + this.timer1 = setInterval(() => { + this.circulInitTaskList() + this.currentDate = this.currentDate + 1000 }, 1000) - }, () => { - }) + }, () => {}) }, - circulInitTaskList() { + circulInitTaskList() { + let time = this.currentDate if (this.platformTaskInfo && this.platformTaskInfo.platformJobList && this.platformTaskInfo.platformJobList .length > 0) { - let time = new Date() this.platformTaskInfo.platformJobList.forEach(item => { - if (item.newCallDate) { - let timeNum = time.getTime() - new Date(item.newCallDate).getTime() + if (item.newCallDate) { + let timeNum = 0 + if(time > new Date(item.newCallDate).getTime()){ + timeNum = time - new Date(item.newCallDate).getTime() + }else{ + timeNum = 0 + } if (timeNum > 3600000) { item.callDateTemp = dayjs.duration(timeNum).format('H灏忔椂m鍒唖绉�') } else { item.callDateTemp = dayjs.duration(timeNum).format('m鍒唖绉�') } } - if (item.newStartDate) { - let timeNum = time.getTime() - new Date(item.newStartDate).getTime() + if (item.newStartDate) { + let timeNum = 0 + if(time > new Date(item.newStartDate).getTime()){ + timeNum = time - new Date(item.newStartDate).getTime() + }else{ + timeNum = 0 + } if (timeNum > 3600000) { item.startDateTemp = dayjs.duration(timeNum).format('H灏忔椂m鍒唖绉�') } else { @@ -330,11 +363,11 @@ 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() - clearInterval(this.timer) - this.timer = setInterval(() => { - this.getPlatformTask() + this.activePlatform = this.activePlatformGroup.platformList[0] + this.getPlatformTask() + clearInterval(this.timer) + this.timer = setInterval(() => { + this.getPlatformTask() }, 60 * 1000) } this.showPlatformgroup = false @@ -350,26 +383,30 @@ this.wmsInfo = res.data this.showDetail = true }) - }, - subDetail(item) { - uni.navigateTo({ - url: `/pages/index/SubDetail?id=${item.bookId}` - }) + }, + subDetail(item) { + uni.navigateTo({ + url: `/pages/index/SubDetail?id=${item.bookId}` + }) }, handleFinish(item) { finishWork({ jobId: item.id }).then(res => { - this.showToast('瀹屾垚浣滀笟') - this.getPlatformTask() + if (res && res.code == 200) { + this.showToast('瀹屾垚浣滀笟') + this.getPlatformTask() + } }) }, handleWork(item) { // 寮�濮嬩綔涓� beginWork({ jobId: item.id }).then(res => { - this.showToast('宸插紑濮嬩綔涓�') - this.getPlatformTask() + if (res && res.code == 200) { + this.showToast('宸插紑濮嬩綔涓�') + this.getPlatformTask() + } }) }, handlePass(item) { @@ -400,18 +437,24 @@ platformInPark({ jobId: item.id, platformId: activePlatform.id - }).then(res => { - this.showToast('鍙彿鎴愬姛') - this.getPlatformCallList() + }).then(res => { + if (res && res.code == 200) { + this.showToast('鍙彿鎴愬姛') + this.getPlatformCallList() + } + }) } else { // 鏈堝彴鍙彿 platformCallNumber({ platformId: activePlatform.id, jobId: item.id - }).then(res => { - this.showToast('鍙彿鎴愬姛') - this.getPlatformCallList() - this.getPlatformTask() + }).then(res => { + if (res && res.code == 200) { + this.showToast('鍙彿鎴愬姛') + this.getPlatformCallList() + this.getPlatformTask() + } + }) } }, @@ -485,7 +528,7 @@ activePlatform } = this this.transformId = item.id - this.transformPlatId = activePlatform.id + this.transformPlatId = activePlatform.id this.getTransferList() this.showTransform = true }, @@ -508,6 +551,10 @@ } </script> <style lang="scss"> + page { + background-color: #f1f2f2; + } + .main_app { padding: 0rpx; height: calc(100vh - 44px); @@ -526,8 +573,8 @@ .item { width: 220rpx; - height: 80rpx; - line-height: 80rpx; + height: 80rpx; + line-height: 80rpx; text-align: center; background: #ffffff; border-radius: 8rpx; @@ -536,9 +583,10 @@ color: #222222; margin-bottom: 15rpx; margin-right: 15rpx; - white-space: nowrap; - overflow: hidden; + white-space: nowrap; + overflow: hidden; text-overflow: ellipsis; + &:nth-of-type(3n) { margin-right: 0; } @@ -615,6 +663,7 @@ justify-content: center; align-items: center; height: 100%; + &:nth-of-type(1) { background: #e9f5f6; padding: 0 12rpx; @@ -718,7 +767,7 @@ .PlatformCallModal { height: calc(100vh - 44px); padding: 30rpx; - + .title { text-align: center; margin: 0 0 30rpx; @@ -737,6 +786,7 @@ .order_list { height: calc(100% - 160rpx); margin-top: 20rpx; + .scroll_view { height: 100%; } @@ -744,7 +794,8 @@ .platform_ing { border-radius: 8rpx; border: 1rpx solid #dfe2e8; - &:nth-of-type(1){ + + &:nth-of-type(1) { margin-top: 0; } } @@ -903,6 +954,7 @@ padding: 36rpx 30rpx; border-radius: 12rpx; box-shadow: 0 0 6rpx rgba(0, 0, 0, 0.5); + .modal_title { font-weight: 600; font-size: 32rpx; @@ -911,37 +963,46 @@ text-align: center; margin-bottom: 36rpx; } - .contract_wrap{ - height: calc( 100% - 400rpx ); + + .contract_wrap { + height: calc(100% - 400rpx); overflow-y: auto; } + .contract_list { border-top: 1rpx solid #E5E5E5; margin-bottom: 30rpx; padding-top: 30rpx; - &:nth-last-child(1){ + + &:nth-last-child(1) { margin-bottom: 0; } + .list { background: #f7f7f7; border-radius: 8rpx; padding: 20rpx; - .item{ + + .item { border-bottom: 1rpx solid #e5e5e5; padding-bottom: 20rpx; margin-bottom: 20rpx; - &:nth-last-child(1){ + + &:nth-last-child(1) { border: none; padding-bottom: 0; margin-bottom: 0; } } + .line { display: flex; margin-bottom: 20rpx; - &:nth-last-child(1){ + + &:nth-last-child(1) { margin-bottom: 0rpx; } + .label { color: #666666; width: 92rpx; -- Gitblit v1.9.3