| | |
| | | </view> --> |
| | | <!-- --> |
| | | <view class="tabs"> |
| | | <view class="tab" :class="{active: activeTab == 0}" @click="tabsClick(0)"> |
| | | <view class="tab" :class="{active: param.status == 0}" @click="tabsClick(0)"> |
| | | <text>待处理</text> |
| | | <text class="border"></text> |
| | | </view> |
| | | <view class="tab" :class="{active: activeTab == 1}" @click="tabsClick(1)"> |
| | | <view class="tab" :class="{active: param.status == 3}" @click="tabsClick(3)"> |
| | | <text>已处理</text> |
| | | <text class="border"></text> |
| | | </view> |
| | |
| | | </view>
|
| | | <!-- -->
|
| | | <view class="list">
|
| | | <view class="item" v-for="item in 10" @click="itemClick(item)">
|
| | | <image v-if="item.stats == 1" src="@/static/side/xunjianed.png" class="icon"></image> |
| | | <view class="item" v-for="item in list" @click="itemClick(item)">
|
| | | <image v-if="item.status == 0 || item.status == 1" src="@/static/side/xunjianed.png" class="icon"></image> |
| | | <image v-else src="@/static/side/xunjian.png" class="icon"></image>
|
| | | <view class="content">
|
| | | <view class="name_wrap line">
|
| | | <view class="name">巡检酒啊</view>
|
| | | <view class="status">待开始</view>
|
| | | <view class="name">{{item.planTitle}}</view>
|
| | | <view class="status" :class="{ |
| | | green: item.status == 1, |
| | | red: item.status == 2, |
| | | gray: item.status == 3 || item.status == 4 |
| | | }">{{statusM[item.status]}}</view>
|
| | | </view>
|
| | | <view class="line">任务日期:xxx</view>
|
| | | <view class="line">执行时间:121212</view> |
| | | <view class="line" v-if="item.startDate && item.endDate">任务日期:{{ item.startDate.slice(0, 11) }} 至 {{ item.endDate.slice(0, 11) }}</view>
|
| | | <view class="line">执行时间:{{ item.startDate.slice(11, 16) }} - {{ item.endDate.slice(11, 16) }}</view> |
| | | <view class="line"> |
| | | <view>完成情况:121212</view> |
| | | <view>完成情况:{{item.finishNum}}/{{item.patrolNum}}</view> |
| | | <view class="btn"> |
| | | <image src="@/static/side/ic_saoma@2x.png" class="saoma" mode=""></image> |
| | | <view>扫码巡检</view> |
| | |
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | <script> |
| | | import { ywPatrolTaskPost } from '@/api'
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | param: {}, |
| | | param: { |
| | | status: 0 |
| | | }, |
| | | list: [], |
| | | activeTab: 0, |
| | | selectAll: false
|
| | | selectAll: false, |
| | | page: 1, |
| | | |
| | | statusM: { |
| | | 0: '待开始', |
| | | 1: '进行中', |
| | | 2: '已超期', |
| | | 3: '已完成', |
| | | 4: '已取消', |
| | | }
|
| | | };
|
| | | }, |
| | | onLoad() { |
| | | this.getList() |
| | | }, |
| | | onReachBottom() { |
| | | const {total,list} = this |
| | | if (list.length < total) { |
| | | this.page = this.page + 1 |
| | | this.getList() |
| | | } else { |
| | | this.showToast('暂无更多数据') |
| | | } |
| | | },
|
| | | methods: {
|
| | | tabsClick(val) { |
| | | this.activeTab = val |
| | | this.param.status = val |
| | | this.page = 1 |
| | | this.list = [] |
| | | this.getList() |
| | | }, |
| | | allClick() { |
| | | this.selectAll = !this.selectAll |
| | | this.list = [] |
| | | this.page = 1 |
| | | this.getList() |
| | | }, |
| | | itemClick() { |
| | | itemClick(item) { |
| | | uni.navigateTo({ |
| | | url: '/pages/polling/detail' |
| | | url: '/pages/polling/detail?id=' + item.id |
| | | }) |
| | | }, |
| | | getList() { |
| | | console.log('---'); |
| | | const { page, param, selectAll } = this |
| | | ywPatrolTaskPost({ |
| | | model: {...param, dispatchUserId: selectAll ? '' : uni.getStorageSync('userInfo').id, }, |
| | | page, |
| | | capacity: 10 |
| | | }).then(res => { |
| | | this.list = [...this.list, ...res.data.records] |
| | | this.total = res.data.total |
| | | }) |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | .status{ |
| | | color: $primaryColor; |
| | | } |
| | | .green{ |
| | | color: #0ADE79; |
| | | } |
| | | .gray{ |
| | | color: #999999; |
| | | } |
| | | }
|
| | | }
|
| | | }
|