<template>
|
<view class="punish_index">
|
<view class="punish_header">
|
<u--input placeholder="请输入姓名" clearable placeholderStyle="color:#999999" v-model="search.realName" border="none"></u--input>
|
<view style="display: flex;">
|
<view @click="startClick()" style="width:50%;margin-right: 10px;">
|
<u--input placeholder="起始时间" disabled disabledColor="#F6FAFF" placeholderStyle="color:#999999" v-model="search.strTime" border="none" suffixIcon="calendar" suffixIconStyle="color: #666666;font-size:30px;"></u--input>
|
</view>
|
<view @click="endClick()" style="width:50%">
|
<u--input placeholder="截止时间" disabled disabledColor="#F6FAFF" width="80%" placeholderStyle="color:#999999" v-model="search.endTime" border="none" suffixIcon="calendar" suffixIconStyle="color: #666666;font-size:30px;"></u--input>
|
</view>
|
</view>
|
<view class="punish_btns">
|
<view style="width:100%">
|
<u-button type="primary" color="#1977FF" text="查询" @click="searchRecordList"></u-button>
|
</view>
|
</view>
|
</view>
|
<view class="punish_main">
|
<view class="punish_main_btn" @click="goAdd">
|
<u-button type="primary" :plain="true" icon="plus" color="#1977FF" text="新增"></u-button>
|
</view>
|
<view class="punish_main_record">
|
<scroll-view
|
scroll-y="true"
|
class="punish_index_scroll"
|
:scroll-top="scrollTop"
|
refresher-enabled="true"
|
refresher-background="#EAEAEA"
|
:refresher-triggered="triggered"
|
@refresherpulling="refresherrefresh"
|
@scrolltolower="scrolltoLower">
|
<view class="punish_main_list" v-for="(item,index) in punishLists" :key="index">
|
<view class="punish_main_left">
|
<view class="punish_main_text"><span style="color:#1977FF;">{{item.realName}}</span><span style="color: #eaeaea;">一</span>{{item.encourageName}}</view>
|
<view class="punish_main_times">{{item.createTime}}</view>
|
</view>
|
<view :class="{'punish_main_right':item.matterType === '2','punish_main_right1':item.matterType === '1'}">{{item.matterType==='1'?'+'+item.integral:item.matterType==='2'?'-'+item.integral:item.integral}}</view>
|
</view>
|
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
|
</scroll-view>
|
</view>
|
</view>
|
<u-datetime-picker
|
:show="showStart"
|
v-model="startTime"
|
mode="date"
|
@confirm="changeStart"
|
@cancel="showStart = false"
|
></u-datetime-picker>
|
<u-datetime-picker
|
:show="showEnd"
|
v-model="endTime"
|
mode="date"
|
@confirm="changeEnd"
|
@cancel="showEnd = false"
|
></u-datetime-picker>
|
</view>
|
</template>
|
|
<script>
|
import {changeTime,throttle} from '@/plugins/public.js'
|
export default{
|
data(){
|
return{
|
search:{},//查询条件
|
showStart:false,//是否显示起始时间
|
showEnd:false,//是否展示截止时间弹框
|
startTime:Number(new Date()),//起始时间默认当天
|
endTime:Number(new Date()),//截止时间默认当天
|
punishLists:[
|
],//奖惩记录列表
|
pageNum: 1,
|
pageSize: 10,
|
loadPage: 0,
|
scrollTop: 0,
|
triggered: true,
|
status: 'loading',
|
loadText: {
|
loading: '努力加载中',
|
nomore: '没有更多数据了'
|
},
|
}
|
},
|
onLoad() {
|
this.searchRecordList()
|
},
|
methods:{
|
//跳转添加页面
|
goAdd(){
|
uni.navigateTo({
|
url: `./punishAdd`
|
})
|
},
|
//查询列表
|
searchRecordList(){
|
this.triggered = true;
|
this.punishLists = [];
|
let params = {
|
realName:this.search.realName,
|
strTime:this.search.strTime ===undefined?'':this.search.strTime ===''?'':(this.search.strTime+' 00:00:00'),
|
endTime:this.search.endTime===undefined?'':this.search.endTime ===''?'':(this.search.endTime+' 23:59:59')
|
}
|
this.$api.reboSystem.punishRecordLists(params).then(res=>{
|
if(res.statusMsg === 'ok'){
|
this.punishLists = res.data
|
this.triggered = false;
|
this.status = 'nomore';
|
}else{
|
uni.$u.toast(res.statusMsg);
|
}
|
}).catch((err) => {
|
uni.$u.toast('请检查网络服务或联系管理员!')
|
})
|
},
|
//自定义下拉刷新
|
refresherrefresh: throttle(function() {
|
this.status = 'loading';
|
this.pageNum = 1;
|
this.searchRecordList();
|
uni.$u.toast('刷新成功');
|
}, 500),
|
//触底刷新
|
scrolltoLower: throttle(function() {
|
this.status = 'loading';
|
this.pageNum = 1;
|
this.searchRecordList();
|
}, 1500),
|
//点击弹出选择起始时间
|
startClick(){
|
this.showStart = true
|
this.$set(this.search,'strTime','')
|
},
|
//确定选择的起始时间
|
changeStart({value}){
|
this.showStart = false
|
this.$set(this.search,'strTime',changeTime(value))
|
},
|
//点击弹出选择截止时间
|
endClick(){
|
this.showEnd = true
|
this.$set(this.search,'endTime','')
|
},
|
//确定选择的起始时间
|
changeEnd({value}){
|
this.showEnd = false
|
this.$set(this.search,'endTime',changeTime(value))
|
}
|
}
|
}
|
</script>
|
|
<style scoped lang="scss">
|
.punish_index{
|
height: 100vh;
|
background-color: #F6F6F6;
|
overflow: hidden;
|
.punish_header{
|
height: 25vh;
|
padding: 10px 15px;
|
background-color: #FFFFFF;
|
margin-bottom: 8px;
|
|
.punish_btns{
|
display: flex;
|
align-items: center;
|
}
|
}
|
.punish_main{
|
height: calc(100% - 220px);
|
padding: 10px 15px;
|
background-color: #FFFFFF;
|
overflow: auto;
|
|
.punish_main_btn{
|
height: 40px;
|
}
|
.punish_main_record{
|
height: calc(100% - 40px);
|
margin-top: 10px;
|
.punish_index_scroll{
|
height: 90%;
|
|
.punish_main_list{
|
line-height: 25px;
|
margin-bottom: 10px;
|
display: flex;
|
border-bottom: 1px solid #EAEAEA;
|
justify-content: space-between;
|
align-items: center;
|
.punish_main_left{
|
.punish_main_text{
|
font-size: 16px;
|
color: #333333;
|
}
|
.punish_main_times{
|
font-size: 12px;
|
color: #999999;
|
}
|
}
|
.punish_main_right{
|
font-size: 16px;
|
color: #999999;
|
}
|
.punish_main_right1{
|
font-size: 16px;
|
color: #1977FF;
|
}
|
}
|
}
|
}
|
}
|
}
|
::v-deep .u-input {
|
margin: 10px 0 !important;
|
padding: 9px 10px !important;
|
background-color: #F6FAFF;
|
border-radius: 0px;
|
}
|
</style>
|
<style scoped>
|
.punish_main_btn /deep/.u-button__text {
|
font-size: 17px!important;
|
}
|
.punish_main_btn /deep/.u-button--plain {
|
border: dashed!important;
|
}
|
</style>
|