【修改】项目字段修改
This commit is contained in:
@@ -74,6 +74,7 @@ Page({
|
||||
})
|
||||
},
|
||||
loadData(){
|
||||
const that = this
|
||||
wx.showToast({
|
||||
title: '加载中...',
|
||||
icon: 'loading'
|
||||
@@ -82,14 +83,14 @@ Page({
|
||||
UserApi.projectList(this.data.searchParams).then(res=>{
|
||||
if(res.success){
|
||||
// 搜索时,把原数据清空,重新筛选
|
||||
if(this.data.searchParams.pageNo === 1) {
|
||||
this.setData({
|
||||
if(that.data.searchParams.pageNo === 1) {
|
||||
that.setData({
|
||||
list: []
|
||||
})
|
||||
}
|
||||
if(res.result.records && res.result.records.length){
|
||||
this.setData({
|
||||
list: [...this.data.list, ...res.result.records]
|
||||
that.setData({
|
||||
list: [...that.data.list, ...res.result.records]
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -103,17 +104,27 @@ Page({
|
||||
}else if(this.data.type == 'work'){
|
||||
UserApi.workList(this.data.searchParams).then(res=>{
|
||||
if(res.success){
|
||||
// 这里没有返回负责人的id
|
||||
// 后端直接返回
|
||||
// res.result.records.map(async tt => {
|
||||
// // tt.principalIdA
|
||||
// let userInfo = await this.getUserInfoById('1432214744864772098')
|
||||
// tt.userInfo = userInfo
|
||||
// tt.name = userInfo.username
|
||||
// })
|
||||
console.log(res.result.records);
|
||||
// 搜索时,把原数据清空,重新筛选
|
||||
if(this.data.searchParams.pageNo === 1) {
|
||||
this.setData({
|
||||
if(that.data.searchParams.pageNo === 1) {
|
||||
that.setData({
|
||||
list: []
|
||||
})
|
||||
}
|
||||
if(res.result.records && res.result.records.length){
|
||||
this.setData({
|
||||
list: [...this.data.list, ...res.result.records]
|
||||
that.setData({
|
||||
list: [...that.data.list, ...res.result.records]
|
||||
})
|
||||
}
|
||||
console.log(that.data.list,'this.data.list');
|
||||
}
|
||||
}).catch(err=>{
|
||||
wx.showToast({
|
||||
@@ -146,6 +157,23 @@ Page({
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @description 通过用户id获取用户信息
|
||||
* @param: id 用户id
|
||||
*/
|
||||
getUserInfoById(id){
|
||||
return new Promise(resolve => {
|
||||
let result = {}
|
||||
UserApi.getUserInfoNolimit({id:id}).then(res => {
|
||||
if(res.success){
|
||||
result = res.result
|
||||
}
|
||||
}).finally( () => {
|
||||
resolve(result)
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
|
||||
@@ -38,12 +38,22 @@
|
||||
<text>{{item.chargeProject || item.projectName}}</text>
|
||||
<text>{{item.year || item.particularYear}}年</text>
|
||||
</view>
|
||||
<view class="content-text">
|
||||
<!-- 工作组项目展示begin -->
|
||||
<block>
|
||||
<view class="item-content">项目负责人:{{item.name || item.directorName}}</view>
|
||||
<view class="item-content">负责人电话:{{item.phone}}</view>
|
||||
<view class="item-content">负责人邮箱:{{item.userInfo.email}}</view>
|
||||
<view class="item-content">运行周期:</view>
|
||||
<view class="item-content">缴费凭证:</view>
|
||||
</block>
|
||||
<!-- 工作组项目展示end -->
|
||||
<!-- 应该是不要了 -->
|
||||
<!-- <view class="content-text">
|
||||
<text class="{{item.needInvoice === 0 ? '' : 'all'}}">{{item.needInvoice === 0 ? '不需要发票' : '需要发票'}}</text>
|
||||
<text class="{{item.inAccount === 0 ? '' : item.inAccount === 2 ? 'half' : 'all'}}">到账</text>
|
||||
<text class="{{item.makeInvoice === 0 ? '' : item.makeInvoice === 2 ? 'half' : 'all'}}">开票</text>
|
||||
<text class="{{item.mail === 0 ? '' : 'all'}}">邮寄</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{list.length === 0}}" class="no-data">
|
||||
|
||||
@@ -30,7 +30,7 @@ page {
|
||||
padding: 15px;
|
||||
}
|
||||
.list-item{
|
||||
height: 90px;
|
||||
height: auto;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
padding: 10px 15px;
|
||||
@@ -63,6 +63,12 @@ page {
|
||||
text-align: right;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.item-content {
|
||||
width: 100%;
|
||||
padding: 10rpx 0;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
}
|
||||
.content-text{
|
||||
width: 100%;
|
||||
color: #999;
|
||||
|
||||
Reference in New Issue
Block a user