| | |
| | | code: ''
|
| | | },
|
| | | downTime: 0,
|
| | | code: '111' |
| | | code: '' |
| | | // code: ''
|
| | | }
|
| | | },
|
| | |
| | | } = this
|
| | |
|
| | | if (!param.deviceId) return this.showToast('请先选择要维护的设备')
|
| | | if (param.status != 0) {
|
| | | uni.showModal({
|
| | | title: '温馨提示',
|
| | | content: '设备运维结果异常,是否前往提交工单?',
|
| | | success: function(res) {
|
| | | if (res.confirm) {
|
| | | this.handleP()
|
| | | } else if (res.cancel) {}
|
| | | }
|
| | | });
|
| | | }else{ |
| | | this.handleP() |
| | | }
|
| | | },
|
| | | handleP() {
|
| | | const {
|
| | |
| | | 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() |
| | | }
|
| | | }
|
| | | });
|
| | | }else{ |
| | | this.showToast('提交成功')
|
| | | uni.navigateBack()
|
| | | }
|
| | | })
|
| | | },
|
| | | getDevice() {
|
| | |
| | | this.$eventBus.$on('memberSel', (option) => {
|
| | | this.$set(this.param, 'userName', option.realname)
|
| | | this.$set(this.param, 'userId', option.id) |
| | | this.list = [] |
| | | this.page = 1 |
| | | this.getList()
|
| | | }) |
| | |
|
| | |
| | | <image v-if="info.status == 3" class="icon" src="@/static/side/ic_dabiao.png" mode=""></image>
|
| | | <view class="head">
|
| | | <view class="name">{{ info.title || info.planTitle }}</view>
|
| | | <view class="status" v-if="info.status || info.status == 0" :style="{color: statusM[info.status].color}">{{statusM[info.status].name}}</view>
|
| | | <view class="status" v-if="info.status || info.status == 0" :style="{color: statusM[info.status].color}">
|
| | | {{statusM[info.status].name}}
|
| | | </view>
|
| | | </view>
|
| | | <view class="line">
|
| | | <view class="la">任务日期:</view>
|
| | |
| | | <view class="line">
|
| | | <view class="la">执行时间:</view>
|
| | | <view class="val" v-if="info.startDate && info.endDate">{{ info.startDate.slice(11,16) }} 至
|
| | | {{ info.endDate.slice(11, 16) }}</view>
|
| | | {{ info.endDate.slice(11, 16) }}
|
| | | </view>
|
| | | </view>
|
| | | <view class="line">
|
| | | <view class="la">完成情况:</view>
|
| | |
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | | <view class="footer" v-if="flag">
|
| | | <view class="footer" @click="openSc" v-if="flag">
|
| | | <view class="sub_btn">扫码巡检</view>
|
| | | </view> |
| | | <!-- --> |
| | | <view class="reader-box" @click="stopScan" v-if="isScaning"> |
| | | <view class="reader" id="reader"></view> |
| | | </view>
|
| | | </view>
|
| | | </template>
|
| | |
| | | <script>
|
| | | import {
|
| | | ywPatrolDetail,
|
| | | ywPatrolTaskRecord
|
| | | ywPatrolTaskRecord, |
| | | getPointRecordByCode
|
| | | } from '@/api' |
| | | import dayjs from 'dayjs';
|
| | | import {
|
| | | Html5Qrcode
|
| | | } from 'html5-qrcode';
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | |
| | | info: {},
|
| | | list: [], |
| | | flag: false, |
| | | statusM: [ |
| | | { color: '#4593f7', name: '待开始' }, |
| | | { color: '#73e09a', name: '进行中' }, |
| | | { color: '#f1a93f', name: '已超期' }, |
| | | { color: '#b9b9b9', name: '已处理' }, |
| | | ]
|
| | | statusM: [{
|
| | | color: '#4593f7',
|
| | | name: '待开始'
|
| | | },
|
| | | {
|
| | | color: '#73e09a',
|
| | | name: '进行中'
|
| | | },
|
| | | {
|
| | | color: '#f1a93f',
|
| | | name: '已超期'
|
| | | },
|
| | | {
|
| | | color: '#b9b9b9',
|
| | | name: '已处理'
|
| | | },
|
| | | ],
|
| | | html5Qrcode: null,
|
| | | isScaning: false,
|
| | | };
|
| | | },
|
| | | onLoad(option) {
|
| | |
| | | // this.getDetail() |
| | | // },
|
| | | methods: {
|
| | | openSc() {
|
| | | this.isScaning = true;
|
| | | Html5Qrcode.getCameras().then((devices) => {
|
| | | if (devices && devices.length) {
|
| | | this.html5Qrcode = new Html5Qrcode('reader');
|
| | | this.html5Qrcode.start({
|
| | | facingMode: 'environment'
|
| | | }, {
|
| | | focusMode: 'continuous', //设置连续聚焦模式
|
| | | fps: 5, //设置扫码识别速度
|
| | | qrbox: 280 //设置二维码扫描框大小
|
| | | },
|
| | | (decodeText, decodeResult) => {
|
| | | if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容
|
| | | this.stopScan(); //关闭扫码功能
|
| | | getPointRecordByCode({
|
| | | taskId: this.id,
|
| | | pointCode: decodeText
|
| | | }).then(ress => {
|
| | | if (ress.data) {
|
| | | uni.navigateTo({
|
| | | url: '/pages/polling/point?id=' + ress.data.id
|
| | | })
|
| | | } else {
|
| | | this.showToast('未匹配到巡检点,请重新扫描')
|
| | | }
|
| | | })
|
| | | }
|
| | | },
|
| | | (err) => {
|
| | | // console.log(err); //错误信息
|
| | | }
|
| | | );
|
| | | }
|
| | | });
|
| | | },
|
| | |
|
| | | stopScan() {
|
| | | console.log('停止扫码')
|
| | | this.isScaning = false;
|
| | | if (this.html5Qrcode) {
|
| | | this.html5Qrcode.stop();
|
| | | }
|
| | | },
|
| | | itemClick(item) { |
| | | if(!this.flag) return
|
| | | uni.navigateTo({
|
| | |
| | | async startScan() { |
| | | try { |
| | | const video = document.getElementById('video'); |
| | | const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: "environment" } }); |
| | | const stream = await navigator.mediaDevices.getUserMedia({
|
| | | video: {
|
| | | facingMode: "environment"
|
| | | }
|
| | | });
|
| | | video.srcObject = stream; |
| | | |
| | | // 使用 QrScanner 解析 |
| | |
| | | .status {
|
| | | color: $primaryColor;
|
| | | } |
| | |
|
| | | .gray{ |
| | | color: gray; |
| | | }
|
| | |
| | | display: flex;
|
| | | padding: 20rpx 30rpx 0 16rpx;
|
| | | margin-bottom: 20rpx;
|
| | |
|
| | | .line{ |
| | | margin-bottom: 10rpx; |
| | | }
|
| | |
|
| | | .icon {
|
| | | width: 10rpx;
|
| | | height: 148rpx;
|
| | |
| | | color: $primaryColor;
|
| | | font-weight: 400;
|
| | | } |
| | |
|
| | | .gray{ |
| | | color: #999999; |
| | | }
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | |
| | | .reader-box { |
| | | position: fixed; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | } |
| | | |
| | | .reader { |
| | | width: 100%; |
| | | // width: 540rpx; |
| | | // height: 540rpx; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | </style> |
| | |
| | | </scroll-view>
|
| | |
|
| | | <!-- --> |
| | | |
| | | <!-- --> |
| | | <view class="reader-box" @click="stopScan" v-if="isScaning"> |
| | | <view class="reader" id="reader"></view> |
| | | </view>
|
| | | </view>
|
| | | </template>
|
| | |
|
| | |
| | | }, |
| | | html5Qrcode: null, |
| | | isScaning: false, |
| | | activeItem: {}
|
| | | // activeItem: {}
|
| | | };
|
| | | },
|
| | | onLoad() {
|
| | |
| | | },
|
| | | methods: { |
| | | openSc(item) { |
| | | this.activeItem = item |
| | | this.isScaning = true; |
| | | Html5Qrcode.getCameras().then((devices) => { |
| | | if (devices && devices.length) { |
| | |
| | | pointCode: decodeText |
| | | }).then(ress=> { |
| | | if(ress.data){ |
| | | |
| | | uni.navigateTo({ |
| | | url: '/pages/polling/point?id=' + ress.data.id |
| | | }) |
| | | }else{ |
| | | this.showToast('未匹配到巡检点,请重新扫描') |
| | | } |
| | | }) |
| | | } |
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | .reader-box { |
| | | position: fixed; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | } |
| | | |
| | | .reader { |
| | | width: 100%; |
| | | // width: 540rpx; |
| | | // height: 540rpx; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | </style> |
| | |
| | | export const baseUrl = 'gateway_interface/' |
| | | // export const baseUrl = 'gateway_interface/' |
| | | // export const baseUrl = 'http://192.168.0.173/gateway_interface/' |
| | | // export const baseUrl = 'https://zhcg.fnwtzx.com/gateway_interface/' |
| | | export const baseUrl = 'https://zhcg.fnwtzx.com/gateway_interface/' |
| | | |
| | | export const uploadAvatar = `${baseUrl}visitsAdmin/cloudService/web/public/uploadFtp.do` |
| | | export const uploadUrl = `${baseUrl}visitsAdmin/cloudService/public/uploadBatch` |