| | |
| | | import {
|
| | | uploadUrl,
|
| | | ywDevicePost,
|
| | | ywDeviceCreate, |
| | | ywDeviceCreate,
|
| | | getFindByCode
|
| | | } from '@/api'
|
| | | import dayjs from 'dayjs';
|
| | |
| | | },
|
| | | handleP() {
|
| | | const {
|
| | | param, |
| | | param,
|
| | | fileList
|
| | | } = this
|
| | | ywDeviceCreate({
|
| | |
| | | dealDate: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
| | | multifileList: fileList
|
| | | }).then(res => {
|
| | | if (param.status != 0) {
|
| | | uni.showModal({
|
| | | title: '温馨提示',
|
| | | content: '设备运维结果异常,是否前往提交工单?',
|
| | | success: function(res) {
|
| | | if (res.confirm) {
|
| | | uni.redirectTo({ |
| | | url: '/pages/workOrder/edit' |
| | | })
|
| | | } else if (res.cancel) { |
| | | uni.navigateBack() |
| | | if (res && res.code == 200) {
|
| | | if (param.status != 0) {
|
| | | uni.showModal({
|
| | | title: '温馨提示',
|
| | | content: '设备运维结果异常,是否前往提交工单?',
|
| | | success: function(res) {
|
| | | if (res.confirm) {
|
| | | uni.redirectTo({
|
| | | url: '/pages/workOrder/edit'
|
| | | })
|
| | | } else if (res.cancel) {
|
| | | uni.navigateBack()
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | }else{ |
| | | this.showToast('提交成功') |
| | | uni.navigateBack() |
| | | });
|
| | | } else {
|
| | | this.showToast('提交成功')
|
| | | uni.navigateBack()
|
| | | }
|
| | | }
|
| | |
|
| | | })
|
| | | },
|
| | | getDevice() {
|
| | |
| | | qrbox: 280 //设置二维码扫描框大小
|
| | | },
|
| | | (decodeText, decodeResult) => {
|
| | | if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容 |
| | | this.stopScan(); //关闭扫码功能 |
| | | getFindByCode(decodeText).then(ress => { |
| | | if (ress.data) { |
| | | console.log('ress', ress.data); |
| | | this.$set(this.param, 'deviceCode', ress.data.code) |
| | | this.$set(this.param, 'deviceId', ress.data.id) |
| | | this.$set(this.param, 'deviceName', ress.data.name) |
| | | } else { |
| | | this.showToast('未匹配到巡检点,请重新扫描') |
| | | } |
| | | if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容
|
| | | this.stopScan(); //关闭扫码功能
|
| | | getFindByCode(decodeText).then(ress => {
|
| | | if (ress.data) {
|
| | | console.log('ress', ress.data);
|
| | | this.$set(this.param, 'deviceCode', ress.data.code)
|
| | | this.$set(this.param, 'deviceId', ress.data.id)
|
| | | this.$set(this.param, 'deviceName', ress.data.name)
|
| | | } else {
|
| | | this.showToast('未匹配到巡检点,请重新扫描')
|
| | | }
|
| | | })
|
| | | |
| | |
|
| | | }
|
| | | },
|
| | | (err) => {
|
| | |
| | | id: '',
|
| | | info: {},
|
| | | list: [],
|
| | | flag: false,
|
| | | flag: false, |
| | | userInfo: uni.getStorageSync('userInfo') || {},
|
| | | statusM: [{
|
| | | color: '#4593f7',
|
| | | name: '待开始'
|
| | |
| | | ywPatrolDetail(id).then(res => {
|
| | | this.info = res.data
|
| | | let time = new Date(res.data.startDate).getTime()
|
| | | console.log('res.data.startDate', new Date().getTime());
|
| | | this.flag = new Date().getTime() > time && (this.info.status == 0 || this.info.status == 1 || this.info.status == 2)
|
| | | console.log('res.data.startDate', new Date().getTime()); |
| | | if(res.data.userIds.indexOf(this.userInfo.id) > -1){ |
| | | this.flag = new Date().getTime() > time && (this.info.status == 0 || this.info.status == 1 || this.info.status == 2) |
| | | }
|
| | | })
|
| | | ywPatrolTaskRecord({
|
| | | capacity: 999,
|
| | |
| | | <template v-if="info.status == 1">
|
| | | <view class="line">
|
| | | <div class="la">巡检结果:</div>
|
| | | <div class="val primaryColor" :class="{red: info.dealStatus == 1}">{{ info.dealStatus == 0 ? '正常' : info.dealStatus == 1 ? '异常' : '-' }}
|
| | | <div class="val primaryColor" :class="{red: info.dealStatus == 1}">
|
| | | {{ info.dealStatus == 0 ? '正常' : info.dealStatus == 1 ? '异常' : '-' }}
|
| | | </div>
|
| | | </view>
|
| | | <view class="line">
|
| | |
| | | <view class="files">
|
| | | <view class="adduser_list_item_ipt1_upload" v-for="(item, i) in info.multifileList" :key="i">
|
| | | <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
|
| | | <!-- <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video> --> |
| | | <view v-if="item.type == 1" @click="videoClick(item)" class="video_wrap"> |
| | | <video :src="item.fileurlFull" initial-time="0.01" :show-center-play-btn="false" :controls="false" |
| | | class="video" :enable-progress-gesture="false" muted /> |
| | | <image src="@/static/play.png" class="play" mode=""></image> |
| | | <!-- <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video> -->
|
| | | <view v-if="item.type == 1" @click="videoClick(item)" class="video_wrap">
|
| | | <video :src="item.fileurlFull" initial-time="0.01" :show-center-play-btn="false" :controls="false"
|
| | | class="video" :enable-progress-gesture="false" muted />
|
| | | <image src="@/static/play.png" class="play" mode=""></image>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
| | | @cancel="isShowHandleDate = false" mode="datetime"></u-datetime-picker>
|
| | | <u-picker :show="isShowRes" keyName="name" @cancel="isShowRes = false" @confirm='confirmRes'
|
| | | :columns="columns"></u-picker>
|
| | | <!-- --> |
| | | <view v-if="videoPlay" class="video_app"> |
| | | <video controls autoplay muted x5-video-player-type="h5" x5-video-player-fullscreen="true" id="myvideo" |
| | | :src="videoUrl" @fullscreenchange="screenChange"></video> |
| | | <view class="bg" @click="closeVideo"></view> |
| | | </view> |
| | | <!-- -->
|
| | | <!-- -->
|
| | | <view v-if="videoPlay" class="video_app">
|
| | | <video controls autoplay muted x5-video-player-type="h5" x5-video-player-fullscreen="true" id="myvideo"
|
| | | :src="videoUrl" @fullscreenchange="screenChange"></video>
|
| | | <view class="bg" @click="closeVideo"></view>
|
| | | </view>
|
| | | <!-- -->
|
| | | </view>
|
| | | </template>
|
| | |
|
| | |
| | | // name: '跳过'
|
| | | // },
|
| | | ]
|
| | | ], |
| | | |
| | | videoPlay: false, |
| | | videoContext: null, |
| | | videoUrl: '' |
| | | ],
|
| | |
|
| | | videoPlay: false,
|
| | | videoContext: null,
|
| | | videoUrl: ''
|
| | | };
|
| | | },
|
| | | onLoad(option) {
|
| | |
| | | multifileList: fileList,
|
| | | id,
|
| | | }).then(res => {
|
| | | if (handleParam.dealStatus == 1) {
|
| | | return uni.showModal({
|
| | | title: '温馨提示',
|
| | | content: '巡检结果异常,是否前往提交工单?',
|
| | | success: (res) => {
|
| | | if (res.confirm) {
|
| | | this.showToast('操作成功') |
| | | setTimeout(() => { |
| | | uni.redirectTo({ |
| | | url: '/pages/workOrder/edit' |
| | | }) |
| | | }, 300)
|
| | | }else{ |
| | | this.showToast('操作成功') |
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300) |
| | | if (res.code == 200) {
|
| | | if (handleParam.dealStatus == 1) {
|
| | | return uni.showModal({
|
| | | title: '温馨提示',
|
| | | content: '巡检结果异常,是否前往提交工单?',
|
| | | success: (res) => {
|
| | | if (res.confirm) {
|
| | | this.showToast('操作成功')
|
| | | setTimeout(() => {
|
| | | uni.redirectTo({
|
| | | url: '/pages/workOrder/edit'
|
| | | })
|
| | | }, 300)
|
| | | } else {
|
| | | this.showToast('操作成功')
|
| | | setTimeout(() => {
|
| | | uni.navigateBack()
|
| | | }, 300)
|
| | | }
|
| | | }
|
| | | }
|
| | | });
|
| | | } else {
|
| | | this.showToast('操作成功')
|
| | | setTimeout(() => { |
| | | uni.navigateBack() |
| | | }, 300)
|
| | | });
|
| | | } else {
|
| | | this.showToast('操作成功')
|
| | | setTimeout(() => {
|
| | | uni.navigateBack()
|
| | | }, 300)
|
| | | }
|
| | | }
|
| | |
|
| | | })
|
| | | },
|
| | | getDetail() {
|
| | |
| | | this.$set(this.handleParam, 'dealStatus', e.value[0].id)
|
| | | this.$set(this.handleParam, 'dealName', e.value[0].name)
|
| | | this.isShowRes = false
|
| | | }, |
| | | videoClick(item) { |
| | | this.videoPlay = true; |
| | | this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 必传 |
| | | this.videoUrl = item.fileurlFull; |
| | | this.videoContext.requestFullScreen(); |
| | | this.$nextTick(() => { |
| | | this.videoContext.play(); |
| | | }) |
| | | }, |
| | | screenChange(e) { |
| | | let fullScreen = e.detail.fullScreen // 值true为进入全屏,false为退出全屏 |
| | | if (!fullScreen) { |
| | | //退出全屏 |
| | | this.videoPlay = false // 隐藏播放盒子 |
| | | } |
| | | }, |
| | | closeVideo() { |
| | | this.videoPlay = false |
| | | this.videoContext = null |
| | | },
|
| | | videoClick(item) {
|
| | | this.videoPlay = true;
|
| | | this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 必传
|
| | | this.videoUrl = item.fileurlFull;
|
| | | this.videoContext.requestFullScreen();
|
| | | this.$nextTick(() => {
|
| | | this.videoContext.play();
|
| | | })
|
| | | },
|
| | | screenChange(e) {
|
| | | let fullScreen = e.detail.fullScreen // 值true为进入全屏,false为退出全屏
|
| | | if (!fullScreen) {
|
| | | //退出全屏
|
| | | this.videoPlay = false // 隐藏播放盒子
|
| | | }
|
| | | },
|
| | | closeVideo() {
|
| | | this.videoPlay = false
|
| | | this.videoContext = null
|
| | | },
|
| | | fileDel(str, i) {
|
| | | this[str].splice(i, 1);
|
| | |
| | | image {
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | } |
| | | video { |
| | | width: 100%; |
| | | height: 100%; |
| | | }
|
| | | .video_wrap { |
| | | position: relative; |
| | | border: 1px solid; |
| | | width: 156rpx; |
| | | height: 156rpx; |
| | | border-radius: 4rpx; |
| | | |
| | | .play { |
| | | width: 60rpx !important; |
| | | height: 60rpx !important; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | |
|
| | | video {
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | }
|
| | | } |
| | | |
| | | .video_app { |
| | | overflow: hidden; |
| | | position: fixed; |
| | | left: 0; |
| | | top: 0; |
| | | width: 100vw; |
| | | height: 100vh; |
| | | display: flex; |
| | | align-items: center; |
| | | z-index: 9990; |
| | | |
| | | .bg { |
| | | background-color: rgba(0, 0, 0, .6); |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | | z-index: -1; |
| | | } |
| | | |
| | | video { |
| | | width: 100%; |
| | | height: 42vh; |
| | | } |
| | |
|
| | | .video_wrap {
|
| | | position: relative;
|
| | | border: 1px solid;
|
| | | width: 156rpx;
|
| | | height: 156rpx;
|
| | | border-radius: 4rpx;
|
| | |
|
| | | .play {
|
| | | width: 60rpx !important;
|
| | | height: 60rpx !important;
|
| | | position: absolute;
|
| | | top: 50%;
|
| | | left: 50%;
|
| | | transform: translate(-50%, -50%);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .video_app {
|
| | | overflow: hidden;
|
| | | position: fixed;
|
| | | left: 0;
|
| | | top: 0;
|
| | | width: 100vw;
|
| | | height: 100vh;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | z-index: 9990;
|
| | |
|
| | | .bg {
|
| | | background-color: rgba(0, 0, 0, .6);
|
| | | position: absolute;
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | z-index: -1;
|
| | | }
|
| | |
|
| | | video {
|
| | | width: 100%;
|
| | | height: 42vh;
|
| | | }
|
| | | }
|
| | | </style> |
| | |
| | | this.list = [...this.list, ...res.data.records] |
| | | this.list.forEach(item => { |
| | | let time = new Date(item.startDate).getTime() |
| | | item.flag = new Date().getTime() > time |
| | | let userInfo = uni.getStorageSync('userInfo') || {} |
| | | item.flag = new Date().getTime() > time && item.userIds.indexOf(userInfo.id) > -1 |
| | | })
|
| | | this.total = res.data.total
|
| | | })
|
| | |
| | | <view class="la"><text class="red">*</text>工单分类</view>
|
| | | <view class="line sel_wrap" @click="showCate1 = true">
|
| | | <view class="left" :class="param.cateName ? '' : 'placeholder9'">
|
| | | {{ param.cateName ? param.cateName : '请选择' }}</view>
|
| | | {{ param.cateName ? param.cateName : '请选择' }}
|
| | | </view>
|
| | | <u-icon name="arrow-right" color="#999999" size="15"></u-icon>
|
| | | </view>
|
| | | </view>
|
| | |
| | | <u-icon class="close" size="20" name="close-circle-fill" color="red"
|
| | | @click="fileDel('fileList', i)"></u-icon>
|
| | | <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
|
| | | <video v-if="item.type == 1" :show-center-play-btn="false" :src="item.fileurlFull" :controls="false"></video>
|
| | | <video v-if="item.type == 1" :show-center-play-btn="false" :src="item.fileurlFull"
|
| | | :controls="false"></video>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
| | | const {
|
| | | param,
|
| | | fileList
|
| | | } = this |
| | | if (!param.projectId) return this.showToast('请选择完整的区域') |
| | | if (!param.buildingId) return this.showToast('请选择完整的区域') |
| | | if (!param.floorName && !param.roomNum) return this.showToast('请选择完整的区域') |
| | | } = this
|
| | | if (!param.projectId) return this.showToast('请选择完整的区域')
|
| | | if (!param.buildingId) return this.showToast('请选择完整的区域')
|
| | | if (!param.floorName && !param.roomNum) return this.showToast('请选择完整的区域')
|
| | | if (!param.cateName) return this.showToast('请选择工单分类')
|
| | | ywWorkorderCreate({
|
| | | ...param,
|
| | | // roomId: '',
|
| | | fileList
|
| | | }).then(res => {
|
| | | this.showToast('提交成功')
|
| | | uni.redirectTo({
|
| | | url: '/pages/workOrder/list'
|
| | | })
|
| | | if (res && res.code == 200) {
|
| | | this.showToast('提交成功')
|
| | | uni.redirectTo({
|
| | | url: '/pages/workOrder/list'
|
| | | })
|
| | | }
|
| | | })
|
| | | },
|
| | | changeHandler(e) {
|
| | |
| | | // 微信小程序无法将picker实例传出来,只能通过ref操作
|
| | | picker = this.$refs.uPicker
|
| | | } = e
|
| | | // 当第一列值发生变化时,变化第二列(后一列)对应的选项 |
| | | console.log(index); |
| | | // 当第一列值发生变化时,变化第二列(后一列)对应的选项
|
| | | console.log(index);
|
| | | console.log(index);
|
| | | if (columnIndex === 0) {
|
| | | // picker为选择器this实例,变化第二列对应的选项
|
| | |
| | | }
|
| | | },
|
| | | confirmCate1(e) {
|
| | | console.log(e.value[1]); |
| | | if(e.value.length == 2){ |
| | | this.$set(this.param, 'cateId', e.value[1].id) |
| | | this.$set(this.param, 'cateName', e.value[1].name) |
| | | this.showCate1 = false |
| | | } |
| | | |
| | | console.log(e.value[1]);
|
| | | if (e.value.length == 2) {
|
| | | this.$set(this.param, 'cateId', e.value[1].id)
|
| | | this.$set(this.param, 'cateName', e.value[1].name)
|
| | | this.showCate1 = false
|
| | | }
|
| | |
|
| | | },
|
| | | confirm0(e) {
|
| | | const item = e.value[0]
|
| | |
| | | position: absolute;
|
| | | right: -20rpx;
|
| | | top: -20rpx;
|
| | | z-index: 9999; |
| | | background-color: #fff; |
| | | border-radius: 50%; |
| | | z-index: 9999;
|
| | | background-color: #fff;
|
| | | border-radius: 50%;
|
| | | overflow: hidden;
|
| | | }
|
| | |
|
| | |
| | | // bottom: 68rpx;
|
| | | // left: 40rpx;
|
| | | width: 670rpx;
|
| | | height: 88rpx; |
| | | height: 88rpx;
|
| | | margin-top: 80rpx;
|
| | | background: $primaryColor;
|
| | | box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
|
| | |
| | | ywProblemCreate({
|
| | | ...param,
|
| | | fileList
|
| | | }).then(res => {
|
| | | this.showToast('提交成功')
|
| | | this.param = {} |
| | | uni.navigateTo({ |
| | | url: '/pages/workOrder/result' |
| | | })
|
| | | }).then(res => { |
| | | if(res && res.code == 200){ |
| | | this.showToast('提交成功') |
| | | this.param = {} |
| | | uni.navigateTo({ |
| | | url: '/pages/workOrder/result' |
| | | }) |
| | | }
|
| | | })
|
| | | },
|
| | | fileDel(str, i) {
|