首页消息,首页来款项目,工作组,列表详情
This commit is contained in:
+76
-108
@@ -5,9 +5,8 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
visible: false,
|
||||
visibleDate: false,
|
||||
index: 0,
|
||||
type: '', // project 是来款项目 work 是工作组
|
||||
list: [], // 项目列表
|
||||
searchParams: {
|
||||
pageNo: 1,
|
||||
@@ -15,141 +14,110 @@ Page({
|
||||
needInvoice: '', // 是否需要发票 0 4
|
||||
pack: '', // 是否打包 0 1
|
||||
year: '', // 运行年份
|
||||
},
|
||||
selects: [ // 自定义选择框参数
|
||||
{
|
||||
select: '发票',
|
||||
active: false,
|
||||
tabIndex: 1
|
||||
},
|
||||
{
|
||||
select: '打包',
|
||||
active: false,
|
||||
tabIndex: 2
|
||||
},
|
||||
{
|
||||
select: '时间',
|
||||
active: false,
|
||||
tabIndex: 3
|
||||
}
|
||||
],
|
||||
data: [
|
||||
{
|
||||
label: '需要',
|
||||
value: 4
|
||||
},{
|
||||
label: '不需要',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
// 搜索筛选
|
||||
changeTab(e){
|
||||
this.data.index = e.currentTarget.dataset.index
|
||||
if(this.data.index === 0){
|
||||
// 发票改变
|
||||
bindNeedInvoiceChange(e){
|
||||
console.log(e.detail.value)
|
||||
this.data.searchParams.pageNo = 1
|
||||
if(e.detail.value == 0) {
|
||||
this.setData({
|
||||
visible: true
|
||||
})
|
||||
this.setData({
|
||||
data: [
|
||||
{
|
||||
label: '需要',
|
||||
value: 4
|
||||
},{
|
||||
label: '不需要',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
})
|
||||
}else if(this.data.index === 1){
|
||||
this.setData({
|
||||
visible: true
|
||||
})
|
||||
this.setData({
|
||||
data: [
|
||||
{
|
||||
label: '是',
|
||||
value: 1
|
||||
},{
|
||||
label: '否',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
"searchParams.needInvoice": 1,
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
visibleDate: true
|
||||
"searchParams.needInvoice": 0,
|
||||
})
|
||||
}
|
||||
this.loadData()
|
||||
},
|
||||
// 打包改变
|
||||
bindPackChange(e){
|
||||
this.data.searchParams.pageNo = 1
|
||||
if(e.detail.value == 0) {
|
||||
this.setData({
|
||||
"searchParams.pack": 1,
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
"searchParams.pack": 0,
|
||||
})
|
||||
}
|
||||
},
|
||||
// 关闭发票和打包的弹出层
|
||||
close() {
|
||||
this.setData({
|
||||
visible: false
|
||||
})
|
||||
},
|
||||
// 日期选中
|
||||
dateOk(value){
|
||||
this.data.pageNo = 1
|
||||
this.setData({
|
||||
"searchParams.year": value.detail,
|
||||
visibleDate: false
|
||||
})
|
||||
this.loadData()
|
||||
},
|
||||
ok(e){
|
||||
this.data.pageNo = 1
|
||||
if(this.data.index === 0){
|
||||
this.setData({
|
||||
'searchParams.needInvoice': e.detail
|
||||
})
|
||||
}else if(this.data.index === 1){
|
||||
this.setData({
|
||||
'searchParams.pack': e.detail
|
||||
})
|
||||
}
|
||||
bindDateChange(e){
|
||||
this.data.searchParams.pageNo = 1
|
||||
this.setData({
|
||||
"searchParams.year": e.detail.value
|
||||
})
|
||||
this.loadData()
|
||||
},
|
||||
// 项目详情
|
||||
projectDetail(){
|
||||
projectDetail(e){
|
||||
console.log(e)
|
||||
wx.navigateTo({
|
||||
url: '../projectDetail/projectDetail',
|
||||
url: `../projectDetail/projectDetail?id=${e.currentTarget.dataset.project.id}`,
|
||||
})
|
||||
},
|
||||
loadData(){
|
||||
UserApi.projectList(this.data.searchParams).then(res=>{
|
||||
if(res.success){
|
||||
// 搜索时,把原数据清空,重新筛选
|
||||
if(this.data.pageNo === 1) {
|
||||
this.setData({
|
||||
list: []
|
||||
})
|
||||
if(this.data.type == 'project'){
|
||||
UserApi.projectList(this.data.searchParams).then(res=>{
|
||||
if(res.success){
|
||||
// 搜索时,把原数据清空,重新筛选
|
||||
if(this.data.searchParams.pageNo === 1) {
|
||||
this.setData({
|
||||
list: []
|
||||
})
|
||||
}
|
||||
if(res.result.records && res.result.records.length){
|
||||
this.setData({
|
||||
list: [...this.data.list, ...res.result.records]
|
||||
})
|
||||
}
|
||||
}
|
||||
if(res.result.records && res.result.records.length){
|
||||
this.setData({
|
||||
list: [...this.data.list, ...res.result.records]
|
||||
})
|
||||
}
|
||||
}
|
||||
}).catch(err=>{
|
||||
wx.showToast({
|
||||
title: '加载失败',
|
||||
icon: 'fail',
|
||||
duration: 2000
|
||||
}).catch(err=>{
|
||||
wx.showToast({
|
||||
title: '加载失败',
|
||||
icon: 'fail',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
})
|
||||
}else if(this.data.type == 'work'){
|
||||
UserApi.workList(this.data.searchParams).then(res=>{
|
||||
if(res.success){
|
||||
// 搜索时,把原数据清空,重新筛选
|
||||
if(this.data.searchParams.pageNo === 1) {
|
||||
this.setData({
|
||||
list: []
|
||||
})
|
||||
}
|
||||
if(res.result.records && res.result.records.length){
|
||||
this.setData({
|
||||
list: [...this.data.list, ...res.result.records]
|
||||
})
|
||||
}
|
||||
}
|
||||
}).catch(err=>{
|
||||
wx.showToast({
|
||||
title: '加载失败',
|
||||
icon: 'fail',
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.data.type = options.type
|
||||
this.loadData()
|
||||
},
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
this.data.pageNo++
|
||||
this.data.searchParams.pageNo++
|
||||
this.loadData()
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,19 +1,44 @@
|
||||
<!--pages/meeting/meeting.wxml首页会议活动-->
|
||||
<view class="select-list">
|
||||
<view class="select-item" bindtap="changeTab" data-index="{{index}}" wx:for="{{selects}}" wx:for-item="select" wx:key="tabIndex">
|
||||
<!-- <view class="select-item" bindtap="changeTab" data-index="{{index}}" wx:for="{{selects}}" wx:for-item="select" wx:key="tabIndex">
|
||||
<text>{{select.select}}</text>
|
||||
<image wx:if="{{!select.active}}" src="../../assets/images/toTop.png"></image>
|
||||
<image wx:if="{{select.active}}" src="../../assets/images/toBottom.png"></image>
|
||||
</view> -->
|
||||
<!-- 发票 -->
|
||||
<view class="select-item">
|
||||
<picker bindchange="bindNeedInvoiceChange" value="{{searchParams.needInvoice}}" range="{{['是','否']}}">
|
||||
<view class="picker">
|
||||
<text>发票{{searchParams.needInvoice == '' ? '' : searchParams.needInvoice == 1 ? ' :是' : ' :否'}}</text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<!-- 打包 -->
|
||||
<view class="select-item">
|
||||
<picker bindchange="bindPackChange" value="{{searchParams.pack}}" range="{{['是','否']}}">
|
||||
<view class="picker">
|
||||
<text>打包{{searchParams.pack == '' ? '' : searchParams.pack == 1 ? ' :是' : ' :否'}}</text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<!-- 年份 -->
|
||||
<view class="select-item">
|
||||
<picker mode="date" fields="year" value="{{searchParams.year}}" start="2021" end="2030" bindchange="bindDateChange">
|
||||
<view class="picker">
|
||||
<text wx:if="{{!searchParams.year}}">时间</text>
|
||||
<text wx:if="{{searchParams.year}}">时间:{{searchParams.year}}年</text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="list-item" wx:for="{{list}}" bindtap="projectDetail" wx:key="item">
|
||||
<view class="list-item" wx:for="{{list}}" bindtap="projectDetail" wx:key="item" data-project="{{item}}">
|
||||
<view class="title">
|
||||
<text>{{item.chargeUse_dictText}}</text>
|
||||
<text>{{item.chargeProject}}</text>
|
||||
<text>{{item.year}}年</text>
|
||||
</view>
|
||||
<view class="content-text">
|
||||
<text class="all">{{item.needInvoice === 0 ? '不需要发票' : '需要发票'}}</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 ? '' : item.mail === 2 ? 'half' : 'all'}}">邮寄</text>
|
||||
@@ -24,4 +49,4 @@
|
||||
<text>暂无数据</text>
|
||||
</view>
|
||||
<popup visible="{{visible}}" bindclose="close" outClickCanClose="true" bindok="ok" data="{{data}}"></popup>
|
||||
<dateMonth visible="{{visibleDate}}" mode="year" bindok="dateOk"></dateMonth>
|
||||
<dateMonth visible="{{visibleDate}}" mode="year" outClickCanClose="true" bindok="dateOk" bindclose="close"></dateMonth>
|
||||
Reference in New Issue
Block a user