329 lines
8.9 KiB
Vue
329 lines
8.9 KiB
Vue
<template>
|
||
<view class="page">
|
||
<view class="uni-flex uni-row mb">
|
||
<!-- <sl-filter :ref="'slFilter'" :menuList.sync="menuList" @result="filterConfirm"></sl-filter> -->
|
||
<view class="otherFixed99">
|
||
<view class="text " @click="selectOperater">{{createBy.name}}</view>
|
||
<view class="text " @click="selectOperater1">{{heldPerson.name}}</view>
|
||
<view class="text" @click="filterDate">{{timeData.begin==''?'申请时间':(timeData.begin+'~'+timeData.end)}}</view>
|
||
</view>
|
||
</view>
|
||
<view class="mybox" v-if="listCards.length>0">
|
||
<view v-for="(item,index) in listCards" :key="index" class="example-box" @click="clickDetail(item)">
|
||
<repair-block :title="item.title" :titleNumber="item.titleNumber" :note="item.note"
|
||
:extra="item.extra" :tagType="item.tagType"
|
||
:contentList="item.contentList"></repair-block>
|
||
</view>
|
||
<uni-load-more :status="loading_status" ></uni-load-more>
|
||
</view>
|
||
<view class="mybox" v-else>
|
||
<no-record ></no-record>
|
||
</view>
|
||
<uni-calendar ref="calendar" :lunar="false" :range="true" @confirm="confirmDate" @cancel='cancleData'/>
|
||
<view class="goHome" @click='goMain()'>
|
||
<img src="../../static/img/gohome.png">
|
||
</view>
|
||
<view class="mysearchlist" style="z-index: 10000;">
|
||
<chooseUserSingle ref="mysearchlist"
|
||
:showsearch.sync="show_search_user"
|
||
:itemInfo_.sync="search_value_user">
|
||
</chooseUserSingle>
|
||
</view>
|
||
<view class="mysearchlist" style="z-index: 10000;">
|
||
<chooseUserSingle ref="mysearchlist"
|
||
:showsearch.sync="show_search_user1"
|
||
:itemInfo_.sync="search_value_user1">
|
||
</chooseUserSingle>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import slFilter from '@/components/xinsoft-sl-filter/xinsoft-sl-filter.vue';
|
||
import repairBlock from '@/components/xinsoft-dev-repair/xinsoft-dev-repair.vue'
|
||
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
|
||
import noRecord from '@/components/xinsoft-no-record/xinsoft-no-record';
|
||
import uniCalendar from '@/components/uni-calendar/uni-calendar.vue'
|
||
import chooseUserSingle from '@/components/xinsoft-search-list/chooseUserSingle.vue';
|
||
import chooseUserSingle1 from '@/components/xinsoft-search-list/chooseUserSingle.vue';
|
||
export default {
|
||
components: {
|
||
chooseUserSingle,chooseUserSingle1,repairBlock,uniLoadMore,noRecord,uniCalendar,slFilter
|
||
},
|
||
data() {
|
||
return {
|
||
show_search_user:false,
|
||
search_value_user:"",
|
||
show_search_user1:false,
|
||
search_value_user1:"",
|
||
current_num:1,
|
||
listCards: [],
|
||
menuList: [{
|
||
'title': '发起人',
|
||
'isMutiple': false,
|
||
'key': 'createBy',
|
||
'detailList': [],
|
||
'defaultSelectedIndex':[0]
|
||
},
|
||
{
|
||
'title': '责任人',
|
||
'isMutiple': false,
|
||
'key': 'heldPerson',
|
||
'detailList': [],
|
||
'defaultSelectedIndex':[]
|
||
}
|
||
],
|
||
loading_status: 'more',//more(loading前)、loading(loading中)、noMore(没有更多了)
|
||
pageSize:5,
|
||
page:1,
|
||
filter:{},
|
||
timeData:{
|
||
begin:"",
|
||
end:''
|
||
},
|
||
createBy:{
|
||
value:'',
|
||
name:'发起人'
|
||
},
|
||
heldPerson:{
|
||
value:'',
|
||
name:'责任人'
|
||
},
|
||
}
|
||
},
|
||
onLoad() {
|
||
var _this = this;
|
||
var userInfo = uni.getStorageSync('userInfo');
|
||
this.filter = {
|
||
heldPerson: userInfo.name
|
||
}
|
||
//人员
|
||
// this.$http.request({
|
||
// url: '/apis/common/getUsers',
|
||
// params:{
|
||
// deptId:userInfo.deptId
|
||
// }
|
||
// }).then(res=>{
|
||
// if(res.statusCode == '200'){
|
||
// _this.menuList[0].detailList = [
|
||
// {
|
||
// 'title': '不限',
|
||
// 'value': ''
|
||
// }
|
||
// ];
|
||
// var useType = res.data.datas;
|
||
// for (let i = 0; i < useType.length; i++) {
|
||
// var myVal=
|
||
// {
|
||
// 'title': useType[i].name,
|
||
// 'value': useType[i].name
|
||
// }
|
||
// _this.menuList[0].detailList.push(myVal);
|
||
// }
|
||
// }
|
||
// }).catch(err=>{
|
||
// });
|
||
|
||
// this.$http.request({
|
||
// url: '/apis/common/getUsers',
|
||
// params:{
|
||
// deptId:userInfo.deptId
|
||
// }
|
||
// }).then(res=>{
|
||
// if(res.statusCode == '200'){
|
||
// _this.menuList[1].detailList = [
|
||
// {
|
||
// 'title': '不限',
|
||
// 'value': ''
|
||
// }
|
||
// ];
|
||
// var useType = res.data.datas;
|
||
// var j = 0;
|
||
// for (let i = 0; i < useType.length; i++) {
|
||
// //判断当前当前登陆人的姓名。
|
||
// if(useType[i].name == userInfo.name){
|
||
// //记录当前的 j.
|
||
// j = i+1; //因为多了一个不限,所有序号加1
|
||
// }
|
||
// var myVal=
|
||
// {
|
||
// 'title': useType[i].name,
|
||
// // 'value': useType[i].id,
|
||
// 'value': useType[i].name
|
||
// }
|
||
// _this.menuList[1].detailList.push(myVal);
|
||
// }
|
||
// _this.menuList[1].defaultSelectedIndex[0] = j;
|
||
// }
|
||
// }).catch(err=>{
|
||
// });
|
||
//初始化当前列表。
|
||
this.dataList();
|
||
},
|
||
onReachBottom: function() {
|
||
//下拉刷新的时候请求一次数据
|
||
if(this.loading_status=='noMore'){
|
||
return false;
|
||
}
|
||
this.page++;
|
||
this.dataList();
|
||
},
|
||
onPullDownRefresh: function() {
|
||
this.listCards=[];
|
||
this.page=1;
|
||
this.loading_status="more";
|
||
//触底的时候请求数据,即为上拉加载更多
|
||
this.dataListMore();
|
||
},
|
||
watch:{
|
||
search_value_user(newv){
|
||
// this.$set(this.dataList[this.currentIndex],'operator',newv.userId);
|
||
this.$set(this.createBy,'name',newv.NAME);
|
||
this.filter.createBy = newv.NAME;
|
||
this.listCards=[];
|
||
this.page=1;
|
||
this.loading_status="more";
|
||
this.dataList();
|
||
},
|
||
search_value_user1(newv){
|
||
// this.$set(this.dataList[this.currentIndex],'operator',newv.userId);
|
||
this.$set(this.heldPerson,'name',newv.NAME);
|
||
this.filter.heldPerson = newv.NAME;
|
||
this.listCards=[];
|
||
this.page=1;
|
||
this.loading_status="more";
|
||
this.dataList();
|
||
},
|
||
},
|
||
methods: {
|
||
// 选择发起人
|
||
selectOperater(){
|
||
this.show_search_user=true;
|
||
},
|
||
// 选择责任人
|
||
selectOperater1(){
|
||
this.show_search_user1=true;
|
||
},
|
||
// filterConfirm(f){
|
||
// this.filter = f;
|
||
// this.listCards=[];
|
||
// this.page=1;
|
||
// this.loading_status="more";
|
||
// this.dataList();
|
||
// },
|
||
|
||
dataList(){
|
||
this.loading_status="loading";
|
||
|
||
var filterRes = this.filter;
|
||
filterRes.pageno = this.page;
|
||
filterRes.pagesize = this.pageSize;
|
||
filterRes.startTime = this.timeData.begin;
|
||
filterRes.endTime = this.timeData.end;
|
||
filterRes.singleStatus = '56';
|
||
this.$http.request({
|
||
url: '/apis/taskMain/list',
|
||
params:filterRes,
|
||
}).then(res=>{
|
||
uni.stopPullDownRefresh();
|
||
if(!res.data.data){
|
||
this.loading_status="noMore";
|
||
}else if(res.data.data.datas.length<this.pagesize){
|
||
this.loading_status="noMore";
|
||
}else{
|
||
this.loading_status="more";
|
||
}
|
||
if(res.data.code == 0){
|
||
if(res.data.data.datas.length>0){
|
||
this.listCards = this.listCards.concat(this.formaterData(res.data.data.datas));
|
||
}
|
||
}
|
||
}).catch(err=>{
|
||
this.loading_status="noMore";
|
||
});
|
||
},
|
||
clickDetail(item){
|
||
//点击详情
|
||
uni.navigateTo({
|
||
url: 'taskDetail?id='+item.id
|
||
});
|
||
},
|
||
formaterData(data){
|
||
var resData = [];
|
||
data.forEach((vals,index)=>{
|
||
var combineJSON = {
|
||
id: vals.id,
|
||
title: vals.statusName,
|
||
contentList: [
|
||
{
|
||
id:1,
|
||
isDouble:false,
|
||
labelName:'发起人',
|
||
labelContent:vals.applyPersonName
|
||
},
|
||
{
|
||
id:2,
|
||
isDouble:false,
|
||
labelName:'任务编号',
|
||
labelContent:vals.taskNo||''
|
||
},
|
||
{
|
||
id:3,
|
||
isDouble:false,
|
||
labelName:'责任人',
|
||
labelContent:vals.heldPersonName||''
|
||
},
|
||
{
|
||
id:4,
|
||
isDouble:false,
|
||
labelName:'任务主题',
|
||
labelContent:vals.title||''
|
||
},
|
||
],
|
||
note: vals.createTime,
|
||
status:vals.status
|
||
}
|
||
resData.push(combineJSON);
|
||
});
|
||
return resData;
|
||
},
|
||
filterDate() {
|
||
//关闭之前filter。
|
||
// document.getElementById("popupRef").style.display="none";
|
||
this.$refs.calendar.open();
|
||
},
|
||
confirmDate(e){
|
||
if(e.range.begin && e.range.end){
|
||
this.timeData = {
|
||
begin:e.range.begin+' 00:00:00',
|
||
end:e.range.end+' 00:00:00'
|
||
}
|
||
this.listCards=[];
|
||
this.page=1;
|
||
this.loading_status="more";
|
||
this.dataList();
|
||
}
|
||
}
|
||
},
|
||
onBackPress(options) { //取消默认的返回事件.
|
||
uni.switchTab({
|
||
url: "../main/main"
|
||
});
|
||
return true;
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
>>>.dev-repair__header{
|
||
border-bottom: 1px solid #EDEDED;
|
||
}
|
||
>>>.select-tab-fixed-top{
|
||
left: 0;
|
||
width:67%;
|
||
}
|
||
.mb {
|
||
margin-bottom: 50px;
|
||
}
|
||
</style>
|