master
parent
e623aec473
commit
4b28a7bb0b
|
|
@ -49,9 +49,6 @@
|
|||
stm: '',
|
||||
etm: ''
|
||||
},
|
||||
customStyle: {
|
||||
background: '#000'
|
||||
},
|
||||
list: [
|
||||
]
|
||||
};
|
||||
|
|
|
|||
|
|
@ -70,9 +70,6 @@
|
|||
stm:'',
|
||||
etm:'',
|
||||
userList: uni.getStorageSync('value').data,
|
||||
customStyle: {
|
||||
background: '#000'
|
||||
},
|
||||
list: []
|
||||
};
|
||||
},
|
||||
|
|
|
|||
|
|
@ -43,14 +43,15 @@
|
|||
</view>
|
||||
<view class="itemNo" style="flex-direction: column;">
|
||||
<text>巡检图片</text>
|
||||
<view class="">
|
||||
|
||||
<view class="" v-for="item in queItem.inspectPics">
|
||||
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;" @click="previewImage(item)"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="itemNo" style="flex-direction: column;">
|
||||
<text>巡检视频</text>
|
||||
<view class="">
|
||||
|
||||
<view class="" v-for="item in queItem.inspectVideos">
|
||||
<video :src="item.url" style="width: 80px;height: 80px;margin: 5px;" show-fullscreen-btn></video>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -118,6 +119,14 @@
|
|||
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
|
||||
return item1
|
||||
})
|
||||
this.queItem.inspectVideos?.map(item1=>{
|
||||
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
|
||||
return item1
|
||||
})
|
||||
this.queItem.inspectPics?.map(item1=>{
|
||||
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
|
||||
return item1
|
||||
})
|
||||
console.log(this.queItem);
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@
|
|||
<u-form-item label="内容说明" prop="maintainContent" borderBottom labelPosition='top' required labelWidth="100px">
|
||||
<u--textarea v-model="model1.maintainContent" placeholder="请输入内容" disabled></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item label="现场图片" prop="fileListpics" borderBottom labelPosition='top' labelWidth="100px">
|
||||
<u-upload :fileList="fileListpics" @afterRead="afterRead" @delete="deletePic" name="pics" multiple disabled
|
||||
<u-form-item label="现场图片" prop="pics" borderBottom labelPosition='top' labelWidth="100px">
|
||||
<u-upload :fileList="model1.pics" name="pics" multiple disabled
|
||||
multiple accept='image' :maxCount="10"></u-upload>
|
||||
|
||||
</u-form-item>
|
||||
<u-form-item label="现场视频" prop="fileListvideos" borderBottom labelPosition='top' labelWidth="100px">
|
||||
<u-upload :fileList="fileListvideos" @afterRead="afterRead" @delete="deletePic" name="videos" multiple disabled
|
||||
<u-form-item label="现场视频" prop="videos" borderBottom labelPosition='top' labelWidth="100px">
|
||||
<u-upload :fileList="model1.videos" name="videos" multiple disabled
|
||||
multiple accept='video' :maxCount="10"></u-upload>
|
||||
|
||||
</u-form-item>
|
||||
|
|
@ -74,78 +74,18 @@
|
|||
mounted() {
|
||||
this.model1 = this.formData
|
||||
this.model1.maintainName = this.actions.find(item=>item.value == this.formData.maintainType).name
|
||||
this.model1.fileListpics = this.formData.pic
|
||||
this.model1.fileListvideos = this.formData.videos
|
||||
this.model1.pics?.map(item1=>{
|
||||
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
|
||||
return item1
|
||||
})
|
||||
this.model1.videos?.map(item1=>{
|
||||
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
|
||||
return item1
|
||||
})
|
||||
console.log(this.model1,'83498943r80432',this.formData);
|
||||
},
|
||||
methods: {
|
||||
sexSelect(e) {
|
||||
this.model1.maintainType = e.name
|
||||
this.$refs.uForm.validateField('maintainType')
|
||||
},
|
||||
submit() {
|
||||
this.$refs.uForm.validate().then(res => {
|
||||
|
||||
let params = {
|
||||
...this.model1,
|
||||
maintainType: this.actions.find(item => item.name == this.model1.maintainType).value,
|
||||
}
|
||||
|
||||
this.$emit('submitForm', params)
|
||||
}).catch(errors => {
|
||||
uni.$u.toast('校验失败')
|
||||
})
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this[`fileList${event.name}`].splice(event.index, 1)
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
let lists = [].concat(event.file)
|
||||
console.log(`fileList${event.name}`,event);
|
||||
let fileListLen = this[`fileList${event.name}`].length
|
||||
lists.map((item) => {
|
||||
this[`fileList${event.name}`].push({
|
||||
...item,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
})
|
||||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url,event.name)
|
||||
let item = this[`fileList${event.name}`][fileListLen]
|
||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||
status: 'success',
|
||||
message: '',
|
||||
url: result
|
||||
}))
|
||||
fileListLen++
|
||||
}
|
||||
},
|
||||
uploadFilePromise(url,name) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uni.uploadFile({
|
||||
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', // 仅为示例,非真实的接口地址
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
formData: {
|
||||
user: 'test'
|
||||
},
|
||||
success: (res) => {
|
||||
setTimeout(() => {
|
||||
// const obj = this.model1[name].find(item=>item.fileId==res.data.data.fileId)
|
||||
// if(obj){
|
||||
|
||||
// }
|
||||
console.log(JSON.parse(res.data),this.model1,name);
|
||||
this.model1[name].push({fileId:JSON.parse(res.data).data.fileId})
|
||||
resolve(res.data.data)
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
},
|
||||
onReady() {
|
||||
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ export default {
|
|||
},
|
||||
onLoad(options) {
|
||||
this.formData=JSON.parse(options.item)
|
||||
console.log(this.formData,JSON.parse(options.item));
|
||||
},
|
||||
methods: {
|
||||
submitForm(params) {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,9 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
searchTm(){
|
||||
this.getList()
|
||||
},
|
||||
toDetail(item){
|
||||
uni.navigateTo({
|
||||
url:'/pages/mypage/compents/wxyh/formZdy/index?item='+JSON.stringify(item)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
</view>
|
||||
<view style="display: flex;" class="itemEve">
|
||||
<text>问题描述:</text>
|
||||
<text>{{o.itemProblemDesc}}</text>
|
||||
<text>{{o.problemDesc}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="o.isHandle == 1">
|
||||
|
|
@ -243,7 +243,8 @@
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.contentItem {
|
||||
height: 340px;
|
||||
height: 100%;
|
||||
// overflow: auto;
|
||||
overflow: auto;
|
||||
|
||||
.itemC {
|
||||
|
|
@ -281,8 +282,8 @@
|
|||
}
|
||||
|
||||
.xj-content {
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
// height: 300px;
|
||||
// overflow-y: auto;
|
||||
}
|
||||
|
||||
.xj-text {
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
fontSize:'18px'
|
||||
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
|
||||
</u-navbar>
|
||||
<view class=""
|
||||
<!-- <view class=""
|
||||
style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0; height:calc(100vh - 44px)">
|
||||
<view style="margin: 10px;background-color: #fff;padding: 10px;">
|
||||
<view class="item">
|
||||
<!-- <view class="item">
|
||||
<view class="blueTiao"></view>
|
||||
<view class="title">
|
||||
基本信息
|
||||
|
|
@ -35,20 +35,18 @@
|
|||
<text>结束日期</text>
|
||||
<text>{{endDate}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view v-show="status == 0 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;">
|
||||
<view class="circle-btn" @click="startXc">开始巡查</view>
|
||||
</view> -->
|
||||
<view style="margin: 10px;background-color: #fff;padding: 10px;">
|
||||
|
||||
<!-- </view> -->
|
||||
|
||||
<view style="margin: 10px;background-color: #fff;padding: 10px; height:calc(100vh - 50px);margin-top: 50px;">
|
||||
<view class="item">
|
||||
<view class="blueTiao"></view>
|
||||
<view class="title">
|
||||
巡检项
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentItem">
|
||||
<view class="contentItem" style="height: calc(100% - 50px);">
|
||||
<db-form :xjItem="xjItem"></db-form>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@
|
|||
</view>
|
||||
<view class="contentItem">
|
||||
<view class="itemC">
|
||||
<text>开始日期</text>
|
||||
<text>{{item.startDate}}</text>
|
||||
<text>接收时间</text>
|
||||
<text>{{item.receiveTime}}</text>
|
||||
</view>
|
||||
<view class="itemC">
|
||||
<text>结束日期</text>
|
||||
<text>{{item.endDate}}</text>
|
||||
<text>完成时间</text>
|
||||
<text>{{item.finishTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -96,8 +96,8 @@
|
|||
this.getData()
|
||||
},
|
||||
handleStartTime(e){
|
||||
let time = moment(e.value).format("YYYY-MM-DD")
|
||||
this.stm = time
|
||||
let time = moment(e.value).format("YYYY-MM-D")
|
||||
this.stm = time;
|
||||
this.showTime = false
|
||||
},
|
||||
handleEndTime(e){
|
||||
|
|
@ -110,8 +110,8 @@
|
|||
const userId = uni.getStorageSync('value')?.userId
|
||||
const params = {
|
||||
dateRangeSo:{
|
||||
start:moment(this.stm).format("YYYY-MM-DD"),
|
||||
end:moment(this.etm).format("YYYY-MM-DD"),
|
||||
start:moment(this.stm).format("YYYY-MM-DD 00:00:00"),
|
||||
end:moment(this.etm).format("YYYY-MM-DD 23:59:59"),
|
||||
},
|
||||
inspectUserId:userId,
|
||||
statusList:[2]
|
||||
|
|
|
|||
|
|
@ -43,20 +43,21 @@
|
|||
</view>
|
||||
<view class="itemNo" style="flex-direction: column;">
|
||||
<text>巡检图片</text>
|
||||
<view class="">
|
||||
|
||||
<view class="" v-for="item in queItem.inspectPics">
|
||||
<image :src="item.url" style="width: 80px;height: 80px;margin: 5px;" @click="previewImage(item)"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="itemNo" style="flex-direction: column;">
|
||||
<text>巡检视频</text>
|
||||
<view class="">
|
||||
|
||||
<view class="" v-for="item in queItem.inspectVideos">
|
||||
<video :src="item.url" style="width: 80px;height: 80px;margin: 5px;" show-fullscreen-btn></video>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin: 10px;background-color: #fff;padding: 10px;" class="">
|
||||
<u--form labelPosition="left" :model="o" ref="uForm" label-width='80px'>
|
||||
<u--form labelPosition="left" :model="queItem" ref="uForm" label-width='80px'>
|
||||
<view class="itemCc">
|
||||
<u-form-item label="处理人" prop="handleUserName" borderBottom required >
|
||||
<u--input v-model="queItem.handleUserName" disabled disabledColor="#ffffff"
|
||||
|
|
@ -102,9 +103,6 @@
|
|||
stm: '',
|
||||
etm: ''
|
||||
},
|
||||
customStyle: {
|
||||
background: '#000'
|
||||
},
|
||||
queItem:{},
|
||||
list: [{
|
||||
title: '5-29日常巡检',
|
||||
|
|
@ -129,7 +127,15 @@
|
|||
this.queItem.handleUserName = uni.getStorageSync('value').nickName
|
||||
this.queItem.handleTime = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
this.queItem.handleUserId = uni.getStorageSync('value').userId
|
||||
this.queItem.handlePics.map(item=>{
|
||||
// this.queItem.handlePics.map(item=>{
|
||||
// item.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item.filePath
|
||||
// return item
|
||||
// })
|
||||
this.queItem.inspectPics.map(item=>{
|
||||
item.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item.filePath
|
||||
return item
|
||||
})
|
||||
this.queItem.inspectVideos.map(item=>{
|
||||
item.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item.filePath
|
||||
return item
|
||||
})
|
||||
|
|
@ -146,9 +152,7 @@
|
|||
uni.$http.post('/gunshiApp/xyt/inspect/detail/handle', this.queItem).then(res => {
|
||||
uni.$showMsg(res.data.description);
|
||||
if(res.data.code == 200){
|
||||
uni.redirectTo({
|
||||
url:'/pages/wtcl/index'
|
||||
})
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
</view>
|
||||
<view class="titleRight" @click="toDetail(item)">
|
||||
<view class="border">
|
||||
{{isHandle==0?'已处理':'待处理'}}
|
||||
{{item.isHandle==0?'待处理':'已处理'}}
|
||||
</view>
|
||||
<u-icon name="arrow-right" size="20"></u-icon>
|
||||
</view>
|
||||
|
|
@ -76,14 +76,11 @@
|
|||
end: '请选择结束时间',
|
||||
stm:moment().startOf('year').format('YYYY-MM-DD'),
|
||||
etm:moment().format('YYYY-MM-DD'),
|
||||
customStyle: {
|
||||
background: '#000'
|
||||
},
|
||||
list: [
|
||||
]
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
onShow() {
|
||||
this.getList()
|
||||
},
|
||||
computed:{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<view class="contentItem" style="height: calc(100% - 350px);">
|
||||
<view class="contentItem" >
|
||||
<uni-collapse>
|
||||
<uni-collapse-item title-border="none" v-for="(item,index) in listData" :key="index" :border="false"
|
||||
:show-animation="true">
|
||||
|
|
@ -33,8 +33,8 @@
|
|||
@delete="(e)=>deletePic(e,o,index,i)" name="inspectVideos" multiple
|
||||
:maxCount="10"></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="问题描述" prop="itemProblemDesc" borderBottom required>
|
||||
<u--textarea v-model="o.itemProblemDesc" placeholder="请输入内容"></u--textarea>
|
||||
<u-form-item label="问题描述" prop="problemDesc" borderBottom required>
|
||||
<u--textarea v-model="o.problemDesc" placeholder="请输入内容"></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item label="处理状态" prop="isHandle" borderBottom required>
|
||||
<u-subsection :list="listStatus" :current="getHandle(o.isHandle)"
|
||||
|
|
@ -261,9 +261,7 @@
|
|||
console.log(data,'2121');
|
||||
if(data.code==200){
|
||||
uni.$showMsg('提交成功');
|
||||
uni.redirectTo({
|
||||
url:'/pages/xcrw/index'
|
||||
})
|
||||
uni.navigateBack()
|
||||
}
|
||||
} catch (error) {
|
||||
uni.$showMsg();
|
||||
|
|
@ -280,7 +278,7 @@
|
|||
this.listData.forEach(item => {
|
||||
item.ab = item.children.filter(i => {
|
||||
if (i.isNormal == 0) {
|
||||
if (i.inspectPics?.length && i.itemProblemDesc) {
|
||||
if (i.inspectPics?.length && i.problemDesc) {
|
||||
tigger = true
|
||||
} else {
|
||||
tigger = false
|
||||
|
|
@ -377,8 +375,8 @@
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.contentItem {
|
||||
// height: 260px;
|
||||
// overflow: auto;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
|
||||
.itemC {
|
||||
display: flex;
|
||||
|
|
@ -415,8 +413,8 @@
|
|||
}
|
||||
|
||||
.xj-content {
|
||||
height: 300px;
|
||||
overflow-y: auto;
|
||||
// height: 300px;
|
||||
// overflow-y: auto;
|
||||
}
|
||||
|
||||
.xj-text {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
fontSize:'18px'
|
||||
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
|
||||
</u-navbar>
|
||||
<view class="" style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0; height:calc(100vh - 44px)">
|
||||
<view style="margin: 10px;background-color: #fff;padding: 10px;">
|
||||
<view class=""
|
||||
style="margin-top: 44px;;background-color: #f0f0f0;border-top: 1px solid #f0f0f0; height:calc(100vh - 44px)">
|
||||
<view style="margin: 10px;background-color: #fff;padding: 10px;" v-show="btnStatus == 0">
|
||||
<view class="item">
|
||||
<view class="blueTiao"></view>
|
||||
<view class="title">
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="contentItem">
|
||||
<view class="itemC">
|
||||
<view class="itemC">
|
||||
<text>任务标题</text>
|
||||
<text>{{taskTitle}}</text>
|
||||
</view>
|
||||
|
|
@ -37,24 +38,25 @@
|
|||
</view>
|
||||
|
||||
</view>
|
||||
<view v-show="status !== 2 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;">
|
||||
<view v-show="status !== 2 && btnStatus == 0" class="circle-btn" @click="startXc">{{statusType[status]}}</view>
|
||||
<view v-show="status !== 2 && btnStatus == 0" style="display:flex;justify-content: center;margin-top: 20%;">
|
||||
<view v-show="status !== 2 && btnStatus == 0" class="circle-btn" @click="startXc">{{statusType[status]}}
|
||||
</view>
|
||||
<view class="" style="height: calc(100vh - 311px);overflow: auto;">
|
||||
</view>
|
||||
<view class="" style="height: calc(100vh - 50px);overflow: auto;">
|
||||
|
||||
|
||||
<view v-show="btnStatus != 0" style="margin: 10px;background-color: #fff;padding: 10px;">
|
||||
<view v-show="btnStatus != 0" style="margin: 10px;background-color: #fff;padding: 10px;height: calc(100% - 40px);">
|
||||
<view class="item">
|
||||
<view class="blueTiao"></view>
|
||||
<view class="title">
|
||||
巡检项
|
||||
<view class="blueTiao"></view>
|
||||
<view class="title">
|
||||
巡检项
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentItem1" style="height: calc(100% - 32px);">
|
||||
<db-form :xjItem="xjItem"></db-form>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentItem1" style="height: 100%;">
|
||||
<db-form :xjItem="xjItem"></db-form>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -63,40 +65,42 @@
|
|||
import moment from 'moment'
|
||||
import DbForm from './dbForm.vue'
|
||||
export default {
|
||||
components:{
|
||||
components: {
|
||||
DbForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
taskTitle:'',
|
||||
taskType:'',
|
||||
taskContent:'',
|
||||
startDate:'',
|
||||
endDate:'',
|
||||
status:'',
|
||||
id:'',
|
||||
taskTitle: '',
|
||||
taskType: '',
|
||||
taskContent: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
status: '',
|
||||
id: '',
|
||||
btnStatus: 0,
|
||||
xjItem:[],
|
||||
list:["正常","异常"],
|
||||
current:3,
|
||||
statusType:{
|
||||
0:'开始巡查',
|
||||
1:'继续巡查',
|
||||
2:'已完成'
|
||||
xjItem: [],
|
||||
list: ["正常", "异常"],
|
||||
current: 3,
|
||||
statusType: {
|
||||
0: '开始巡查',
|
||||
1: '继续巡查',
|
||||
2: '已完成'
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 开始巡查
|
||||
async startXc(){
|
||||
async startXc() {
|
||||
try {
|
||||
if(this.status == 0){
|
||||
const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/task/startInspect/${this.id}`)
|
||||
if(data.code == 200){
|
||||
if (this.status == 0) {
|
||||
const {
|
||||
data
|
||||
} = await uni.$http.get(`/gunshiApp/xyt/inspect/task/startInspect/${this.id}`)
|
||||
if (data.code == 200) {
|
||||
this.btnStatus = 1;
|
||||
this.getXjItem(this.id)
|
||||
}
|
||||
}else if(this.status == 1){
|
||||
} else if (this.status == 1) {
|
||||
this.btnStatus = 1;
|
||||
this.getXjItem(this.id)
|
||||
}
|
||||
|
|
@ -106,11 +110,13 @@
|
|||
uni.$showMsg();
|
||||
}
|
||||
},
|
||||
// 获取巡查项
|
||||
async getXjItem(id){
|
||||
// 获取巡查项
|
||||
async getXjItem(id) {
|
||||
try {
|
||||
const {data} = await uni.$http.get(`/gunshiApp/xyt/inspect/detail/info?taskId=${id}`)
|
||||
if(data.code == 200){
|
||||
const {
|
||||
data
|
||||
} = await uni.$http.get(`/gunshiApp/xyt/inspect/detail/info?taskId=${id}`)
|
||||
if (data.code == 200) {
|
||||
this.xjItem = data.data
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
@ -121,7 +127,7 @@
|
|||
getLocationWithInterval() {
|
||||
this.getLocation(); // 首次获取经纬度信息
|
||||
// 设置定时器,每隔5秒获取一次经纬度信息
|
||||
let timer= setInterval(() => {
|
||||
let timer = setInterval(() => {
|
||||
this.getLocation();
|
||||
}, 300000); // 五分钟
|
||||
uni.setStorageSync("timer", timer);
|
||||
|
|
@ -133,7 +139,7 @@
|
|||
success: (res) => {
|
||||
this.latitude = res.latitude;
|
||||
this.longitude = res.longitude;
|
||||
this.sendLocation(res.latitude,res.longitude)
|
||||
this.sendLocation(res.latitude, res.longitude)
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('Failed to get location:', err);
|
||||
|
|
@ -142,25 +148,27 @@
|
|||
},
|
||||
// 将经纬度传给服务器
|
||||
async sendLocation(latitude, longitude) {
|
||||
try {
|
||||
const { data } = await uni.$http.post(`/gunshiApp/xyt/inspectTaskTrack/insert`, {
|
||||
taskId: this.id,
|
||||
lttd: latitude,
|
||||
lgtd: longitude
|
||||
})
|
||||
if (data.code == 200) {
|
||||
console.log('Location sent successfully')
|
||||
}
|
||||
} catch (error) {
|
||||
uni.$showMsg();
|
||||
}
|
||||
}
|
||||
try {
|
||||
const {
|
||||
data
|
||||
} = await uni.$http.post(`/gunshiApp/xyt/inspectTaskTrack/insert`, {
|
||||
taskId: this.id,
|
||||
lttd: latitude,
|
||||
lgtd: longitude
|
||||
})
|
||||
if (data.code == 200) {
|
||||
console.log('Location sent successfully')
|
||||
}
|
||||
} catch (error) {
|
||||
uni.$showMsg();
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onLoad(option){
|
||||
onLoad(option) {
|
||||
this.taskTitle = option.taskTitle
|
||||
this.taskType = option.taskType
|
||||
this.taskContent = option.taskContent== "null" ? null:option.taskContent
|
||||
this.taskContent = option.taskContent == "null" ? null : option.taskContent
|
||||
this.startDate = (option.startDate)
|
||||
this.endDate = option.endDate == "null" ? "" : option.endDate
|
||||
this.status = option.status
|
||||
|
|
@ -183,27 +191,31 @@
|
|||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.circle-btn{
|
||||
|
||||
.circle-btn {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
background-color: #007aff;
|
||||
border-radius: 50%;
|
||||
color:#fff;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 120px;
|
||||
}
|
||||
|
||||
.item {
|
||||
|
||||
padding-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
// justify-content: space-between;
|
||||
.blueTiao{
|
||||
.blueTiao {
|
||||
background-color: #007aff;
|
||||
width: 5px;
|
||||
height: 16px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
border-width: 0px;
|
||||
font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
|
||||
|
|
@ -215,6 +227,7 @@
|
|||
|
||||
.titleRight {
|
||||
display: flex;
|
||||
|
||||
.border {
|
||||
border-width: 0px;
|
||||
background-color: rgba(236, 245, 255, 1);
|
||||
|
|
@ -232,8 +245,9 @@
|
|||
}
|
||||
|
||||
}
|
||||
.contentItem{
|
||||
.itemC{
|
||||
|
||||
.contentItem {
|
||||
.itemC {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
display: flex;
|
||||
|
|
@ -241,7 +255,8 @@
|
|||
padding: 10px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
.itemNo{
|
||||
|
||||
.itemNo {
|
||||
color: #666666;
|
||||
padding: 10px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
},
|
||||
mounted() {
|
||||
|
||||
this.getData()
|
||||
|
||||
},
|
||||
methods: {
|
||||
searchHandle() {
|
||||
|
|
@ -109,8 +109,8 @@
|
|||
const userId = uni.getStorageSync('value')?.userId
|
||||
const params = {
|
||||
dateRangeSo: {
|
||||
start: moment(this.stm).format("YYYY-MM-DD"),
|
||||
end: moment(this.etm).format("YYYY-MM-DD"),
|
||||
start: moment(this.stm).format("YYYY-MM-DD 00:00:00"),
|
||||
end: moment(this.etm).format("YYYY-MM-DD 23:59:59"),
|
||||
},
|
||||
inspectUserId: userId,
|
||||
statusList: [0, 1]
|
||||
|
|
@ -130,8 +130,8 @@
|
|||
}
|
||||
},
|
||||
onShow(){
|
||||
this.getData()
|
||||
const timer =uni.getStorageSync('timer');
|
||||
console.log(timer);
|
||||
if(timer){
|
||||
clearInterval(timer);
|
||||
uni.removeStorageSync('timer');
|
||||
|
|
|
|||
|
|
@ -40,9 +40,6 @@
|
|||
start: moment().subtract(1,'day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
end: moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
},
|
||||
customStyle: {
|
||||
background: '#000'
|
||||
},
|
||||
mapType:{
|
||||
aiWarnCount:'AI告警',
|
||||
rzWarn:"水位告警",
|
||||
|
|
|
|||
Loading…
Reference in New Issue