接口
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 任务管理 -->
|
||||
<!-- 作业管理 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
@@ -47,12 +47,12 @@
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
|
||||
<!-- <uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/> -->
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<button class="zd-col-7 button-primary" @tap="searchList">查询</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">完成</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">强制完成</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_againTask">重新下发</button>
|
||||
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_forceConfirm">强制完成</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -60,7 +60,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {schBaseTask, saveCheckTask} from '@/utils/getData2.js'
|
||||
import {queryTask, againTask, forceConfirm} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -82,7 +82,8 @@
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
disabled: false
|
||||
disabled: false,
|
||||
disabled2: false,
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
@@ -92,23 +93,24 @@
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._schBaseTask()
|
||||
this._queryTask()
|
||||
},
|
||||
async _schBaseTask () {
|
||||
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, this.val1)
|
||||
async _queryTask () {
|
||||
let res = await queryTask(this.val1)
|
||||
if (res.code === '200') {
|
||||
this.totalCount = res.totalElements
|
||||
if (res.totalElements > 0) {
|
||||
const dataMap = res.content
|
||||
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
this.reload = false
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
if (this.totalCount == this.dataList.length) {
|
||||
this.reload = false
|
||||
this.status = 'noMore'
|
||||
}
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
// const dataMap = res.content
|
||||
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
// this.reload = false
|
||||
// } else {
|
||||
// this.dataList = []
|
||||
// }
|
||||
// if (this.totalCount == this.dataList.length) {
|
||||
// this.reload = false
|
||||
// this.status = 'noMore'
|
||||
// }
|
||||
}
|
||||
},
|
||||
onReachBottom () {
|
||||
@@ -116,7 +118,7 @@
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._schBaseTask()
|
||||
this._queryTask()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
@@ -125,16 +127,15 @@
|
||||
toCheck (e) {
|
||||
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
|
||||
},
|
||||
async toSure (status) {
|
||||
async _againTask () {
|
||||
this.disabled = true
|
||||
if (!this.pkId) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await saveCheckTask(this.pkId, status)
|
||||
let res = await againTask(this.pkId)
|
||||
if (res.code === '200') {
|
||||
this.index = ''
|
||||
this.val1 = ''
|
||||
this.dataList = []
|
||||
this.pkId = ''
|
||||
@@ -152,6 +153,33 @@
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _forceConfirm () {
|
||||
this.disabled2 = true
|
||||
if (!this.pkId) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await forceConfirm(this.pkId)
|
||||
if (res.code === '200') {
|
||||
this.val1 = ''
|
||||
this.dataList = []
|
||||
this.pkId = ''
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.disabled2 = false
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user