|  |  | 
 |  |  |    import {
 | 
 |  |  |       uploadUrl,
 | 
 |  |  |       ywDevicePost,
 | 
 |  |  |       ywDeviceCreate, | 
 |  |  |       getPointRecordByCode
 | 
 |  |  |       ywDeviceCreate,
 | 
 |  |  |       getFindByCode
 | 
 |  |  |    } from '@/api'
 | 
 |  |  |    import dayjs from 'dayjs';
 | 
 |  |  |    import {
 | 
 |  |  | 
 |  |  |          },
 | 
 |  |  |          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() {
 | 
 |  |  | 
 |  |  |                      },
 | 
 |  |  |                      (decodeText, decodeResult) => {
 | 
 |  |  |                         if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容
 | 
 |  |  |                            this.$set(this.param, 'deviceCode', decodeText) | 
 |  |  |                            this.stopScan(); //关闭扫码功能 | 
 |  |  |                            getPointRecordByCode({ | 
 |  |  |                               // taskId: this.id, | 
 |  |  |                               pointCode: decodeText | 
 |  |  |                            }).then(ress => { | 
 |  |  |                               if (ress.data) { | 
 |  |  |                                  console.log('ress', ress.data); | 
 |  |  |                               } else { | 
 |  |  |                                  this.showToast('未匹配到巡检点,请重新扫描') | 
 |  |  |                               } | 
 |  |  |                            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) => {
 |