<template>
|
<view class="daily-list">
|
<view class="search">
|
<u-search placeholder="请输入工作站名称搜索" v-model="keyword" bgColor="#fff"
|
placeholderColor="#999999" :showAction="false" style="margin: 35rpx;"
|
searchIconColor="#6A6A6A" height="74" @search="search" @change="search"></u-search>
|
</view>
|
<scroll-view class="scroll-list" scroll-y="true" @scrolltolower="loadMore">
|
<view v-for="(item,index) in list" :key="'item'+index" class="list-item">
|
<h4>
|
<u-icon class="icon_1" size="24rpx"/>
|
<text selectable class="list-item-num">{{ item.dutyNo }}</text>
|
</h4>
|
<view class="item-box" @click="goHome(item)">
|
<p>
|
<u-icon class="icon_2" size="24rpx"/>
|
<span class="item-box-title">工作站:</span>
|
<span class="item-box-info">{{item.workstationName}}</span>
|
</p>
|
<p>
|
<u-icon class="icon_3" size="24rpx"/>
|
<span class="item-box-title">生产人员:</span>
|
<span class="item-box-info">{{item.productionUser}}</span>
|
</p>
|
<p style="margin-bottom: 0;">
|
<u-icon class="icon_4" size="24rpx"/>
|
<span class="item-box-title">日期:</span>
|
<span class="item-box-info">{{item.createTime}}</span>
|
</p>
|
</view>
|
</view>
|
<view class="loadmore" @click="loadMore">
|
<u-loadmore :status="loadStatus"></u-loadmore>
|
</view>
|
</scroll-view>
|
</view>
|
</template>
|
|
<script>
|
import UIcon from "../../../uview-ui/components/u-icon/u-icon.vue";
|
|
export default {
|
components: {UIcon},
|
data() {
|
return {
|
keyword:'',
|
loadStatus: 'loadmore',
|
total:0,
|
query:{
|
current:1,
|
size:10,
|
workstationName: ''
|
|
},
|
list:[]
|
}
|
},
|
onLoad() {
|
this.loadList();
|
},
|
methods: {
|
loadMore() {
|
this.loadStatus = "loading";
|
setTimeout(() => {
|
this.query.current += 1;
|
this.loadList();
|
}, 100);
|
},
|
// 在此加载列表
|
loadList(){
|
this.$u.api.dailyPaper.dutyRecordPage(this.query).then(res => {
|
if (res.code === 0) {
|
if (!res.data.records || res.data.records.length === 0) {
|
this.loadStatus = "nomore";
|
return;
|
}
|
if (this.query.current === 1) {
|
this.list = res.data.records
|
} else {
|
this.list = this.list.concat(res.data.records);
|
}
|
this.list.forEach(item => {
|
item.createTime = item.createTime.slice(0,10)
|
})
|
this.total = res.data.total;
|
this.query.current = res.data.current;
|
this.query.size = res.data.size;
|
this.loadStatus = "loadmore";
|
}
|
});
|
},
|
// 搜索
|
search(e){
|
this.query = {
|
current:1,
|
size:10,
|
workstationName: e
|
}
|
this.loadList()
|
},
|
// 跳转到日报首页
|
goHome (info) {
|
uni.$emit('dailyListInfo',info)
|
uni.switchTab({
|
url: '/pages/sys/home/index?info='
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.daily-list{
|
width: 100%;
|
height: calc(100vh - 88rpx);
|
background: #E6EFFF;
|
overflow-y: auto;
|
box-sizing: border-box;
|
padding-bottom: 24rpx;
|
position: relative;
|
.search{
|
position: fixed;
|
width: 100%;
|
z-index: 99;
|
height: 120rpx;
|
background: #E6EFFF;
|
}
|
.scroll-list{
|
top: 120rpx;
|
overflow-y: auto;
|
position: absolute;
|
box-sizing: border-box;
|
padding: 0 32rpx;
|
.list-item{
|
background: #FFFFFF;
|
border-radius: 10rpx;
|
box-sizing: border-box;
|
padding: 32rpx 16rpx;
|
margin-bottom: 20rpx;
|
position: relative;
|
h4{
|
display: flex;
|
align-items: center;
|
font-weight: bold;
|
font-size: 28rpx;
|
color: #333333;
|
margin-bottom: 25rpx;
|
.icon_1 {
|
background-image: url('~@/static/custom/daily/icon_1.png');
|
background-repeat: no-repeat;
|
background-size: cover;
|
height: 24rpx;
|
width: 24rpx;
|
margin-right: 8rpx;
|
position: relative;
|
}
|
.list-item-num {
|
font-weight: bold;
|
font-size: 28rpx;
|
color: #333333;
|
}
|
}
|
.item-box{
|
background: #F5F9FF;
|
border-radius: 10rpx;
|
box-sizing: border-box;
|
padding: 30rpx 24rpx;
|
p{
|
font-weight: 500;
|
font-size: 26rpx;
|
color: #333333;
|
margin-bottom: 24rpx;
|
.icon_2 {
|
background-image: url('~@/static/custom/daily/icon_2.png');
|
background-repeat: no-repeat;
|
background-size: cover;
|
height: 24rpx;
|
width: 24rpx;
|
margin-right: 12rpx;
|
position: relative;
|
margin-bottom: 6rpx;
|
vertical-align: middle;
|
}
|
.icon_3 {
|
background-image: url('~@/static/custom/daily/icon_3.png');
|
background-repeat: no-repeat;
|
background-size: cover;
|
height: 24rpx;
|
width: 24rpx;
|
margin-right: 12rpx;
|
position: relative;
|
margin-bottom: 6rpx;
|
vertical-align: middle;
|
}
|
.icon_4 {
|
background-image: url('~@/static/custom/daily/icon_4.png');
|
background-repeat: no-repeat;
|
background-size: cover;
|
height: 24rpx;
|
width: 24rpx;
|
margin-right: 12rpx;
|
position: relative;
|
margin-bottom: 6rpx;
|
vertical-align: middle;
|
}
|
.item-box-title {
|
margin-right: 20rpx;
|
display: inline-block;
|
text-align-last: justify;
|
width: 120rpx;
|
font-weight: 500;
|
font-size: 26rpx;
|
color: #333333;
|
}
|
.item-box-info {
|
font-weight: 500;
|
font-size: 26rpx;
|
color: #333333;
|
}
|
}
|
}
|
}
|
.loadmore {
|
height: 60rpx;
|
}
|
}
|
}
|
</style>
|