|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="total-page page-box page-env-20 scroll_content">
|
|
|
+ <view class="total-page page-box page-env-20 scroll_content task-bg">
|
|
|
<Nav :title="'任务'" :genre="1" :back="false" :fixedHeight="105"></Nav>
|
|
|
<view class="task-tabs" :style="{top:`${$tools.topHeight()}px`}">
|
|
|
<Search :placeholder="'贷款人姓名或电话'"></Search>
|
|
|
@@ -8,18 +8,19 @@
|
|
|
:bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
|
|
|
:current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
|
|
|
</view>
|
|
|
- </view> <view class="task-tabs m-t30">
|
|
|
- <!-- <TaskImgTab @setProductId="setProductId"></TaskImgTab>-->
|
|
|
- <task-ima-tab @setProductId="setProductId"></task-ima-tab>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ <view class="task-tabs m-t30">
|
|
|
+ <!-- <TaskImgTab @setProductId="setProductId"></TaskImgTab>-->
|
|
|
+ <task-ima-tab @setProductId="setProductId"></task-ima-tab>
|
|
|
+ </view>
|
|
|
|
|
|
<EnScroll ref="scroll" :navHeight="105" is_tabHeight @onRefresh="onRefresh" @onScrollBottom="onScrollBottom">
|
|
|
- <view v-if="current===1">
|
|
|
- <TaskItem :type="1" is_bottom :task-list="backlogList"></TaskItem>
|
|
|
- </view>
|
|
|
- <view v-else>
|
|
|
- <TaskItem :type="1" is_bottom :task-list="taskList"></TaskItem>
|
|
|
- </view>
|
|
|
+ <view v-if="current===1">
|
|
|
+ <TaskItem :type="1" is_bottom :task-list="backlogList"></TaskItem>
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <TaskItem :type="1" is_bottom :task-list="taskList"></TaskItem>
|
|
|
+ </view>
|
|
|
|
|
|
</EnScroll>
|
|
|
<Tab :tab-index="1"></Tab>
|
|
|
@@ -28,12 +29,15 @@
|
|
|
<script>
|
|
|
// 任务列表
|
|
|
import TaskItem from "@/common/task/task-item.vue";
|
|
|
- import TaskImaTab from "@/common/task/task_ima_tab.vue";
|
|
|
- import {getDayBacklogList, getTaskList} from "@/api/task";
|
|
|
+ import TaskImaTab from "@/common/task/task_ima_tab.vue";
|
|
|
+ import {
|
|
|
+ getDayBacklogList,
|
|
|
+ getTaskList
|
|
|
+ } from "@/api/task";
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- TaskImaTab,
|
|
|
+ TaskImaTab,
|
|
|
TaskItem,
|
|
|
},
|
|
|
data() {
|
|
|
@@ -45,100 +49,102 @@
|
|
|
name: '全部',
|
|
|
dot_color: 'red',
|
|
|
disabled: false,
|
|
|
- 'id': 0,
|
|
|
+ 'id': 0,
|
|
|
}, {
|
|
|
name: '新进',
|
|
|
dot_color: 'yellow',
|
|
|
disabled: false,
|
|
|
- 'id': 6,
|
|
|
+ 'id': 6,
|
|
|
}, {
|
|
|
- 'id': 1,
|
|
|
+ 'id': 1,
|
|
|
name: '待办',
|
|
|
dot_color: '',
|
|
|
disabled: false
|
|
|
}, {
|
|
|
- 'id': 2,
|
|
|
+ 'id': 2,
|
|
|
name: '完成',
|
|
|
dot_color: '',
|
|
|
disabled: false
|
|
|
}, {
|
|
|
- 'id': 3,
|
|
|
+ 'id': 3,
|
|
|
name: '拒绝',
|
|
|
dot_color: '',
|
|
|
disabled: false
|
|
|
}],
|
|
|
- selectStr: '',
|
|
|
- startDate: '',
|
|
|
- endDate: '',
|
|
|
- phone: '',
|
|
|
- name: '',
|
|
|
- productId: 0,
|
|
|
- stageId: [],
|
|
|
- departmentId: [],
|
|
|
- totalNum: 99999,
|
|
|
- taskList: [],
|
|
|
- page: 1,
|
|
|
- isAjax: false,
|
|
|
- backlogList: [],
|
|
|
+ selectStr: '',
|
|
|
+ startDate: '',
|
|
|
+ endDate: '',
|
|
|
+ phone: '',
|
|
|
+ name: '',
|
|
|
+ productId: 0,
|
|
|
+ stageId: [],
|
|
|
+ departmentId: [],
|
|
|
+ totalNum: 99999,
|
|
|
+ taskList: [],
|
|
|
+ page: 1,
|
|
|
+ isAjax: false,
|
|
|
+ backlogList: [],
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.startList()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- setProductId(productId){
|
|
|
- console.log('productId:'+productId)
|
|
|
- this.productId=productId
|
|
|
- this.startList()
|
|
|
- },
|
|
|
- startList() {
|
|
|
- if(this.current===1){
|
|
|
- this.getDayBacklogList()
|
|
|
- }else {
|
|
|
- this.totalNum = 999;
|
|
|
- this.taskList = [];
|
|
|
- this.page = 1;
|
|
|
- this.isAjax = false;
|
|
|
- this.getTaskReceiving();
|
|
|
- }
|
|
|
+ mounted() {
|
|
|
+ this.startList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ setProductId(productId) {
|
|
|
+ console.log('productId:' + productId)
|
|
|
+ this.productId = productId
|
|
|
+ this.startList()
|
|
|
+ },
|
|
|
+ startList() {
|
|
|
+ if (this.current === 1) {
|
|
|
+ this.getDayBacklogList()
|
|
|
+ } else {
|
|
|
+ this.totalNum = 999;
|
|
|
+ this.taskList = [];
|
|
|
+ this.page = 1;
|
|
|
+ this.isAjax = false;
|
|
|
+ this.getTaskReceiving();
|
|
|
+ }
|
|
|
|
|
|
- },
|
|
|
- getDayBacklogList(){
|
|
|
- getDayBacklogList({'selectStr':this.selectStr}).then((res)=>{
|
|
|
- if(res.code===1){
|
|
|
- this.backlogList=res.data
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- getTaskReceiving() {
|
|
|
- if (this.isAjax || (this.totalNum <= this.taskList.length)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.isAjax = true;
|
|
|
- getTaskList({
|
|
|
- 'status': this.tabsList[this.current].id,
|
|
|
- 'selectStr': this.selectStr,
|
|
|
- 'phone': this.phone,
|
|
|
- 'name': this.name,
|
|
|
- 'productId': this.productId,
|
|
|
- 'stageId': this.stageId,
|
|
|
- 'departmentId': this.departmentId,
|
|
|
- 'startDate': this.startDate,
|
|
|
- 'endDate': this.endDate,
|
|
|
- 'page': this.page,
|
|
|
- }).then((res) => {
|
|
|
- this.isAjax = false;
|
|
|
- if (res.code === 1) {
|
|
|
- this.totalNum = res.data.totalNum
|
|
|
- this.taskList.push(...res.data.items)
|
|
|
- ++this.page;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+ },
|
|
|
+ getDayBacklogList() {
|
|
|
+ getDayBacklogList({
|
|
|
+ 'selectStr': this.selectStr
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code === 1) {
|
|
|
+ this.backlogList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTaskReceiving() {
|
|
|
+ if (this.isAjax || (this.totalNum <= this.taskList.length)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.isAjax = true;
|
|
|
+ getTaskList({
|
|
|
+ 'status': this.tabsList[this.current].id,
|
|
|
+ 'selectStr': this.selectStr,
|
|
|
+ 'phone': this.phone,
|
|
|
+ 'name': this.name,
|
|
|
+ 'productId': this.productId,
|
|
|
+ 'stageId': this.stageId,
|
|
|
+ 'departmentId': this.departmentId,
|
|
|
+ 'startDate': this.startDate,
|
|
|
+ 'endDate': this.endDate,
|
|
|
+ 'page': this.page,
|
|
|
+ }).then((res) => {
|
|
|
+ this.isAjax = false;
|
|
|
+ if (res.code === 1) {
|
|
|
+ this.totalNum = res.data.totalNum
|
|
|
+ this.taskList.push(...res.data.items)
|
|
|
+ ++this.page;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
tabsChange(index) {
|
|
|
- if(index!==this.current){
|
|
|
- this.current = index;
|
|
|
- }
|
|
|
+ if (index !== this.current) {
|
|
|
+ this.current = index;
|
|
|
+ }
|
|
|
},
|
|
|
// 下拉刷新
|
|
|
onRefresh() {
|
|
|
@@ -153,18 +159,18 @@
|
|
|
// this.$refs.scroll.onEndPulling()
|
|
|
// }, 1000)
|
|
|
console.log("下拉刷新");
|
|
|
- this.startList()
|
|
|
+ this.startList()
|
|
|
},
|
|
|
// 滚动到底部
|
|
|
onScrollBottom() {
|
|
|
// uni.showLoading({
|
|
|
// title: '数据加载中'
|
|
|
// })
|
|
|
- if(this.current===1){
|
|
|
- this.getDayBacklogList()
|
|
|
- }else {
|
|
|
- this.getTaskReceiving();
|
|
|
- }
|
|
|
+ if (this.current === 1) {
|
|
|
+ this.getDayBacklogList()
|
|
|
+ } else {
|
|
|
+ this.getTaskReceiving();
|
|
|
+ }
|
|
|
// setTimeout(() => {
|
|
|
// uni.showToast({
|
|
|
// title: '加载完成',
|