| | |
| | | </view> |
| | | </view> |
| | | <view class="onve-right"> |
| | | <u-button class='greens' size="mini" v-if="current == 0">开始任务</u-button> |
| | | <u-button class='greens' size="mini" v-if="current == 1">完成任务</u-button> |
| | | <u-button class='o-r-down' plain type="error" size="mini" v-if="current == 1">事件上报 |
| | | <u-button class='greens' size="mini" v-if="current == 0" @click="startTask(item)">开始任务</u-button> |
| | | <u-button class='greens' size="mini" v-if="current == 1" @click="finishTask(item)">完成任务</u-button> |
| | | <u-button class='o-r-down' plain type="error" size="mini" v-if="current == 1" @click="goToEventsReported">事件上报 |
| | | </u-button> |
| | | </view> |
| | | </view> |
| | |
| | | |
| | | <script> |
| | | import { |
| | | getList |
| | | getList,update |
| | | } from "@/api/taskinfo/list.js"; |
| | | export default { |
| | | data() { |
| | |
| | | this.page.total = data.total; |
| | | this.taskinfoList = this.taskinfoList.concat(data.records) |
| | | }) |
| | | }, |
| | | //任务开始事件 |
| | | startTask(item){ |
| | | item.state = '1' |
| | | item.routeRange = '\'' + item.routeRange + '\'' |
| | | update(item).then(res=>{ |
| | | if(res.code == 200){ |
| | | this.page.currentPage = 1 |
| | | this.getList() |
| | | } |
| | | }) |
| | | }, |
| | | //任务结束事件 |
| | | finishTask(item){ |
| | | item.state = '2' |
| | | item.routeRange = '\'' + item.routeRange + '\'' |
| | | update(item).then(res=>{ |
| | | if(res.code == 200){ |
| | | this.page.currentPage = 1 |
| | | this.getList() |
| | | } |
| | | }) |
| | | }, |
| | | //事件上报 |
| | | goToEventsReported(){ |
| | | uni.navigateTo({ |
| | | url:"../taskinfo/eventsReported" |
| | | }) |
| | | } |
| | | } |
| | | } |