<template>
|
<view class="page">
|
<view class="inventory-list-bg"/>
|
<u-navbar title="盘点列表" :background="background" :border-bottom="false" :title-bold="true" title-color="#000" back-icon-color="#000"/>
|
<view class="inventory-list-search">
|
<u-search v-model="query.inyNo" shape="square" bg-color="rgba(250,252,255,0.36)" :show-action="false" placeholder="盘点编号" @clear="search" @custom="search" @search="search">
|
</u-search>
|
</view>
|
<view class="wrap">
|
<scroll-view class="inventory-list-scroll-list" scroll-y="true" @scrolltolower="loadMore">
|
<u-cell-group class="inventory-list-scroll-list-group" :border="false">
|
<view class="content" v-for="(item, index) in list" :key="index" :index="index"
|
@click="goDetail(item)">
|
<view class="content-header">
|
<view class="content-header-left">
|
<view class="content-header-icon"></view>
|
<view class="content-header-title">盘点编号:{{ item.inyNo }}</view>
|
</view>
|
<view class="content-header-right">
|
{{item.inyStatus=='finished'?'已完成':'草稿'}}
|
</view>
|
</view>
|
<view class="content-body">
|
<view class="row-list">
|
<view class="_label">
|
<view class="_label-icon-1">
|
</view>
|
<view class="_label-name">盘点描述:</view>
|
</view>
|
<view class="_content">
|
{{ item.inyDesc||'无' }}
|
</view>
|
</view>
|
<view class="row-list">
|
<view class="_label">
|
<view class="_label-icon-2">
|
</view>
|
<view class="_label-name">创 建 人:</view>
|
</view>
|
<view class="_content">
|
{{ item.createUser }}
|
</view>
|
</view>
|
<view class="row-list">
|
<view class="_label">
|
<view class="_label-icon-3">
|
</view>
|
<view class="_label-name">创建时间:</view>
|
</view>
|
<view class="_content">
|
{{ item.createTime }}
|
</view>
|
</view>
|
</view>
|
</view>
|
</u-cell-group>
|
<view class="loadmore" @click="loadMore">
|
<u-loadmore :status="loadStatus"></u-loadmore>
|
</view>
|
</scroll-view>
|
</view>
|
</view>
|
</template>
|
<script>
|
import content_bg from '@/static/custom/inventory/locNoBg.png'
|
export default {
|
data() {
|
return {
|
background:{
|
backgroundImage: `url(${content_bg})`,
|
backgroundAttachment: 'fixed',
|
backgroundSize: '100% auto',
|
backgroundRepeat: 'no-repeat',
|
},
|
keywords: '',
|
query: {
|
current: 1,
|
size: 20,
|
criteria:JSON.stringify({
|
orderBy:{
|
column:'createTime',
|
direction:'desc'
|
}
|
})
|
},
|
list: [],
|
count: 0,
|
loadStatus: 'loading'
|
};
|
},
|
onLoad() {
|
this.loadList();
|
},
|
onShow() {
|
|
},
|
filters: {
|
inyStatus(val) {
|
let inyStatus = {
|
finished: '已完成',
|
draft: '草稿',
|
}
|
return inyStatus[val]
|
}
|
},
|
methods: {
|
loadMore() {
|
if(this.loadStatus == "nomore"){
|
return
|
}
|
this.loadStatus = "loading";
|
setTimeout(() => {
|
this.query.current += 1;
|
this.loadList();
|
}, 100);
|
},
|
loadList() {
|
this.$u.api.inventory.getMain(this.query).then(res => {
|
this.list = this.list.concat(res.data.records);
|
//this.total = res.data.total;
|
this.query.current = res.data.current;
|
this.query.size = res.data.size;
|
this.loadStatus = "loadmore";
|
if (!res.data.records || res.data.records.length < this.query.size) {
|
this.loadStatus = "nomore";
|
}
|
});
|
},
|
search(value) {
|
this.list = [];
|
this.query.current = 1;
|
this.loadList();
|
},
|
goDetail(item) {
|
if(item.inyStatus === 'finished'){
|
uni.showToast({
|
title: "盘点已完成。",
|
icon: "none"
|
});
|
return
|
}
|
uni.navigateTo({
|
url: `/pages/wareHouse/inventory/detail?id=${item.id}&no=${item.inyNo}`
|
})
|
}
|
}
|
};
|
</script>
|
<style scoped lang="scss">
|
.inventory-list-bg{
|
background-color: #F6F9FF;
|
background-image: url('~@/static/custom/inventory/locNoBg.png');
|
// background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
|
padding: 0 20rpx;
|
background-attachment: fixed;
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
position: fixed;
|
top: 0;
|
bottom: 0;
|
width: 100%;
|
z-index: -1;
|
}
|
|
.inventory-list-search{
|
padding: 40rpx 30rpx 20rpx 30rpx;
|
}
|
.wrap .inventory-list-scroll-list{
|
height:calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
|
width:100%;
|
}
|
.inventory-list-scroll-list-group{
|
::v-deep .u-cell-item-box {
|
background-color:rgba(250,252,255,0.36) !important;
|
padding:0rpx 30rpx ;
|
}
|
.content {
|
font-size: 12px;
|
background-color: #FFFFFF;
|
box-sizing: border-box;
|
border-radius: 10rpx;
|
margin: 0rpx 0rpx 16rpx;
|
height: 298rpx;
|
padding: 10rpx 20rpx;
|
box-shadow: none;
|
.content-header{
|
height: 90rpx;
|
display: flex;
|
align-items:center;
|
justify-content: space-between;
|
.content-header-left{
|
display: flex;
|
align-items:center;
|
.content-header-icon{
|
background-image: url('~@/static/custom/inventory/icon_5.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height:28rpx;
|
width:28rpx;
|
}
|
.content-header-title{
|
margin-left: 11rpx;
|
font-size: 28rpx;
|
font-weight: bold;
|
color: #333333;
|
}
|
}
|
.content-header-right{
|
text-align: right;
|
font-weight: bold;
|
color: #FB5B25;
|
}
|
}
|
.content-body{
|
height:184rpx;
|
background: #F5F9FF;
|
border-radius: 10rpx;
|
padding: 0rpx 23rpx;
|
.row-list {
|
height: 60rpx;
|
display: flex;
|
flex-direction: row;
|
padding: 0px;
|
align-items: center;
|
}
|
.row-list ._label {
|
display: flex;
|
flex: 0.6;
|
color: #909399;
|
align-items: center;
|
._label-icon-1{
|
background-image: url('~@/static/custom/inventory/label-icon-1.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height:26rpx;
|
width:26rpx;
|
}
|
._label-icon-2{
|
background-image: url('~@/static/custom/inventory/icon3.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height:26rpx;
|
width:26rpx;
|
}
|
._label-icon-3{
|
background-image: url('~@/static/custom/inventory/icon4.png');
|
background-size: 100% auto;
|
background-repeat: no-repeat;
|
height:26rpx;
|
width:26rpx;
|
}
|
._label-name{
|
margin-left: 11rpx;
|
font-size: 26rpx;
|
font-weight: 500;
|
color: #909399;
|
|
}
|
}
|
|
.row-list ._content {
|
flex: 1.5;
|
color: #666666;
|
font-size: 24rpx;
|
}
|
.row-list .s1 {
|
color:#D35651;
|
}
|
}
|
}
|
}
|
</style>
|