123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530 |
- <template>
- <view>
- <u-popup :show="isShow" @close="close" :closeOnClickOverlay="true" :overlay="false" :closeable="true">
-
- <view class="container" v-if="codeType == 'vehicle'">
-
- <template v-if="renderItem(item,'vehTypeName') == '矿卡'">
- <u--form label-width="auto" labelAlign="right"
- :labelStyle="{
- fontSize: '28rpx',
- fontWeight: '700',
- }"
- >
- <u-row>
- <u-col :span="8">
- <u-form-item label="车牌号:" >
- {{renderItem(item,'label','--')}}
- </u-form-item>
- </u-col>
- <!-- <u-col :span="4">
- <u-form-item label="速度:" >
- {{renderItem(item,'speed','--')}}km/h
- </u-form-item>
-
- </u-col> -->
- </u-row>
-
- <u-row>
- <u-col :span="6">
- <u-form-item label="驾驶员:" >
- {{renderItem(item,'driverName','--')}}
- </u-form-item>
- </u-col>
- <u-col :span="6">
- <u-form-item label="联系方式:" >
- {{renderItem(item,'driverTel','--')}}
- </u-form-item>
- </u-col>
- </u-row>
-
- <u-row>
- <u-col :span="6">
- <u-form-item label="所属单位:" >
- {{renderItem(item,'deptName','--')}}
- </u-form-item>
- </u-col>
- <u-col :span="6">
- <u-form-item label="车型:" >
- {{renderItem(item,'vehTypeName','--')}}
- </u-form-item>
- </u-col>
- </u-row>
-
-
- <u-form-item label="当前载重:" >
- {{renderItem(item,'','--')}}
- </u-form-item>
- <u-form-item label="位置:" >
- {{renderItem(item,'location','--')}}
- </u-form-item>
- </u--form>
-
- <u-row style="margin: 20rpx 0;">
- <u-col :span="2.5">
- <u-button type="primary" :plain="false"
- text="今日轨迹" size="small" shape="circle"
- @click="goHistory(item,'vehicle','today')"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4">
- <u-button type="primary" :plain="false"
- text="近5h轨迹" size="small" shape="circle"
- @click="goHistory(item,'vehicle','five')"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4" v-if="renderItem(item,'isVideo','') == 1">
- <u-button type="primary" :plain="false"
- text="实时监控" size="small" shape="circle"
- @click="goVideo(item)"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4" v-if="renderItem(item,'isVideo','') == 1">
- <u-button type="primary" :plain="false"
- text="视频回放" size="small" shape="circle"
- @click="goBackVideo(item)"
- >
- </u-button>
- </u-col>
- </u-row>
- </template>
- <template v-else-if="renderItem(item,'vehTypeName') == '挖机'">
- <u--form label-width="auto" labelAlign="right"
- :labelStyle="{
- fontSize: '28rpx',
- fontWeight: '700',
- }"
- >
- <u-row>
- <u-col :span="8">
- <u-form-item label="车牌号:" >
- {{renderItem(item,'label','--')}}
- </u-form-item>
- </u-col>
- <!-- <u-col :span="4">
- <u-form-item label="速度:" >
- {{renderItem(item,'speed','--')}}km/h
- </u-form-item>
-
- </u-col> -->
- </u-row>
-
- <u-row>
- <u-col :span="6">
- <u-form-item label="驾驶员:" >
- {{renderItem(item,'driverName','--')}}
- </u-form-item>
- </u-col>
- <u-col :span="6">
- <u-form-item label="联系方式:" >
- {{renderItem(item,'driverTel','--')}}
- </u-form-item>
- </u-col>
- </u-row>
-
- <u-row>
- <u-col :span="6">
- <u-form-item label="所属单位:" >
- {{renderItem(item,'deptName','--')}}
- </u-form-item>
- </u-col>
- <u-col :span="6">
- <u-form-item label="车型:" >
- {{renderItem(item,'vehTypeName','--')}}
- </u-form-item>
- </u-col>
- </u-row>
-
- <u-row>
- <u-col :span="6">
- <u-form-item label="需等待时长:" >
- {{renderItem(info,'needTime','--')}}
- </u-form-item>
- </u-col>
- <u-col :span="6">
- <u-form-item label="附近等待车数:" >
- <div class="hover-click" @click="openWaitCarList(info,true)">
- {{renderItem(info,'waitNum','--')}}
- </div>
- </u-form-item>
- </u-col>
- </u-row>
-
-
- </u--form>
-
- <u-row style="margin: 20rpx 0;">
- <u-col :span="2.5">
- <u-button type="primary" :plain="false"
- text="今日轨迹" size="small" shape="circle"
- @click="goHistory(item,'vehicle','today')"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4">
- <u-button type="primary" :plain="false"
- text="近5h轨迹" size="small" shape="circle"
- @click="goHistory(item,'vehicle','five')"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4" v-if="renderItem(item,'isVideo','') == 1">
- <u-button type="primary" :plain="false"
- text="实时监控" size="small" shape="circle"
- @click="goVideo(item)"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4" v-if="renderItem(item,'isVideo','') == 1">
- <u-button type="primary" :plain="false"
- text="视频回放" size="small" shape="circle"
- @click="goBackVideo(item)"
- >
- </u-button>
- </u-col>
- </u-row>
- </template>
- <template v-else>
- <u--form label-width="auto" labelAlign="right"
- :labelStyle="{
- fontSize: '28rpx',
- fontWeight: '700',
- }"
- >
- <u-row>
- <u-col :span="8">
- <u-form-item label="车牌号:" >
- {{renderItem(item,'label','--')}}
- </u-form-item>
- </u-col>
- <u-col :span="4">
- <u-form-item label="速度:" >
- {{renderItem(item,'speed','--')}}km/h
- </u-form-item>
-
- </u-col>
- </u-row>
-
- <u-row>
- <u-col :span="6">
- <u-form-item label="司机:" >
- {{renderItem(item,'driverName','--')}}
- <view class="my-col" style="width: 50%;display: flex;justify-content: flex-end" @click="callPhone">
- <image
- src="@/static/icon/phone.png"
- style="width: 30rpx; height: 30rpx"
- ></image>
-
-
- <!-- <text
- class="routine-text"
- @click="callPhone(item)"
- style="font-size: 32rpx"
- >{{ item.driverTel }}</text
- > -->
- </view>
- </u-form-item>
- </u-col>
-
- <u-col :span="3" :offset="2">
-
- <u-button type="primary" :plain="false" v-if="!intercomState"
- text="对讲" size="small" shape="circle"
- @click="handleTask(item)"
- >
- </u-button>
-
- <u-button type="warning " :plain="false" v-if="intercomState"
- text="挂断" size="small" shape="circle"
- @click="handleTask(item)"
- >
- </u-button>
-
-
- </u-col>
-
- </u-row>
-
- <u-form-item label="最新回传:" >
- {{renderItem(item,'gspTime','--')}}
- </u-form-item>
- <u-form-item label="备注:" >
- {{renderItem(item,'remark','--')}}
- <view class="my-col" style="margin-left: 20rpx; display: flex;align-items: center;">
- <image
- src="@/static/icon/edit.png"
- style="width: 30rpx; height: 30rpx"
- ></image>
- <text
- class="routine-text"
- style="margin-left: 5rpx;font-size: 28rpx; color: #498cff"
- @click="remarkEdit"
- >编辑</text>
- </view>
- </u-form-item>
- <u-form-item label="位置:" >
- {{renderItem(item,'location','--')}}
- </u-form-item>
- </u--form>
-
- <u-row style="margin: 20rpx 0;">
- <u-col :span="2.5">
- <u-button type="primary" :plain="false"
- text="今日轨迹" size="small" shape="circle"
- @click="goHistory(item,'vehicle','today')"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4">
- <u-button type="primary" :plain="false"
- text="近5h轨迹" size="small" shape="circle"
- @click="goHistory(item,'vehicle','five')"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4" v-if="renderItem(item,'isVideo','') == 1">
- <u-button type="primary" :plain="false"
- text="实时监控" size="small" shape="circle"
- @click="goVideo(item)"
- >
- </u-button>
- </u-col>
- <u-col :span="2.5" :offset="0.4" v-if="renderItem(item,'isVideo','') == 1">
- <u-button type="primary" :plain="false"
- text="视频回放" size="small" shape="circle"
- @click="goBackVideo(item)"
- >
- </u-button>
- </u-col>
- </u-row>
- </template>
-
- </view>
-
- <view class="container" v-if="codeType == 'people'">
- <u--form label-width="auto" labelAlign="right"
- :labelStyle="{
- fontSize: '28rpx',
- fontWeight: '700',
- }"
- >
- <u-row>
- <u-col :span="8">
- <u-form-item label="姓名:" >
- {{renderItem(item,'label','--')}}
- </u-form-item>
- </u-col>
- <u-col :span="4">
- <u-form-item label="速度:" >
- {{renderItem(item,'speed','--')}}m/h
- </u-form-item>
-
- </u-col>
- </u-row>
-
-
- <u-form-item label="最新回传:" >
- {{renderItem(item,'gspTime','--')}}
- </u-form-item>
- <u-form-item label="备注:" >
- {{renderItem(item,'remark','--')}}
- </u-form-item>
- <u-form-item label="位置:" >
- {{renderItem(item,'location','--')}}
- </u-form-item>
- </u--form>
-
- <u-row style="margin: 20rpx 0;">
- <u-col :span="3" :offset="1">
- <u-button type="primary" :plain="false"
- text="今日轨迹" size="small" shape="circle"
- @click="goHistory(item,'personnel','today')"
- >
- </u-button>
- </u-col>
- <u-col :span="3" :offset="1">
- <u-button type="primary" :plain="false"
- text="近5h轨迹" size="small" shape="circle"
- @click="goHistory(item,'personnel','five')"
- >
- </u-button>
- </u-col>
-
- </u-row>
- </view>
-
-
- </u-popup>
- <u-modal
- :show="remarkShow"
- title="备注信息"
- show-cancel-button
- @confirm="updateRemark"
- @cancel="cancelRemark"
- >
- <view class="slot-content">
- <u--textarea v-model="remarkValue" placeholder="请输入备注信息" class="text-warp"></u--textarea>
- </view>
- </u-modal>
-
- <vehList ref="vehListRef"></vehList>
-
- <intercom ref="intercom" @oNstate="(e)=>intercomState=e"></intercom>
- </view>
- </template>
- <script>
- import {isArray,clone,isObject } from 'lodash'
- import {getImages} from '@/plugins/images'
- import {copyProps,clearProps} from '@/utils/gdtq.js'
- import vehList from './vehList.vue'
- import { queryRangeVeh, updateVehRemark, updateCleanRemark } from '@/api/realtimeWatch.js'
- import Intercom from '@/components/Intercom'
- export default {
- components: {
- vehList,
- Intercom,
- },
- data() {
- return {
- isShow: false,
- item: null,
- codeType: 'vehicle',
- info: null,
- remarkShow: false,
- remarkValue: "",
- intercomState:false,//对接状态
- }
- },
- mounted() {
-
- },
-
- methods: {
- handleTask(item) {
- this.$refs.intercom.toIntercom(item.deviceId);//13306349381
- },
- openWaitCarList(info) {
- this.$refs.vehListRef.show(info)
- },
- show(e) {
- console.log(e,'e')
- let {id} = e
- this.getVehicleDetail(id)
- setTimeout(() => {
- this.isShow= true;
- this.item = e
- this.codeType = e.code;
- },50)
- },
- close() {
- this.isShow = false
- },
-
- /* 获取车辆详情 */
- async getVehicleDetail(vehicleId) {
- let {data} = await queryRangeVeh({vehicleId})
- this.info = data
- },
-
-
- // 跳到历史轨迹
- goHistory(item,tabStyleType,time) {
- let params = {
- tabStyleType
- }
- if (tabStyleType == 'vehicle') {
- params.vehicleId = item.id
- } else if (tabStyleType == 'personnel') {
- params.userId = item.id
- }
- if (time=='today') {
- let s_time = this.dayjs().format('YYYY-MM-DD')
- let startTime = `${s_time} 00:00`;
- let endTime = `${s_time} 23:59`;
- params.time = [startTime,endTime]
- } else if (time=='five') {
- let startTime = this.dayjs().subtract(5, 'hour').format('YYYY-MM-DD HH:mm');
- let endTime = this.dayjs().format('YYYY-MM-DD HH:mm');
- params.time = [startTime,endTime]
- }
-
-
- this.$store.dispatch('setParams',params)
-
- uni.navigateTo({
- url: '/pagesMap/pastRoute/pastRoute',
- });
-
- },
- goVideo(item) {
- const {id} = item;
- uni.navigateTo({
- url: `/pagesVideo/monitor/monitor?id=${id}`,
- });
- },
- goBackVideo(item) {
- const {id} = item;
- uni.navigateTo({
- url: `/pagesVideo/h5playback/index?vehicleId=${id}`,
- });
- },
- callPhone(){
- if(!this.info.driverTel){
- uni.$u.toast('号码不能为空')
- return;
- }
- uni.makePhoneCall({
- phoneNumber: this.info.driverTel //仅为示例
- });
- },
- remarkEdit(){
- // 备注编辑
- this.remarkShow = true;
- this.remarkValue = this.item.remark;
- },
- async updateRemark() {
- let obj = {
- vehicleId: this.item.id,
- remark: this.remarkValue,
- };
- let res = await updateVehRemark(obj)
- if (res.code == "0") {
- uni.$u.toast("修改备注成功");
- this.item.remark = this.remarkValue;
- this.cancelRemark()
- }
- },
- cancelRemark(){
- this.remarkShow = false;
- this.remarkValue=''
- }
-
- },
- }
- </script>
- <style lang="scss" scoped>
- .hover-click {
- cursor: pointer;
- color: #05C0F1;
- text-decoration: underline;
- }
-
- .container {
- background: #fff;
- padding: 60rpx 0 0 20rpx;
-
- font-size: 28rpx;
- }
- .slot-content{
- width: 100%;
- }
-
- </style>
|