<template>
|
<view class="main_app">
|
<view class="head_wrap">
|
<view class="search_wrap">
|
<image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
|
<input v-model="param.name" @confirm="handleQuery" type="text" placeholder="搜索盘点单名称"
|
placeholder-class="placeholder9" />
|
</view>
|
</view>
|
<!-- -->
|
<scroll-view scroll-y="true" class="scroll_Y" @scrolltolower="scrolltolower">
|
<view class="list">
|
<view class="item" @click="itemClick(item)" v-for="item in list">
|
<image v-if="item.status == 0 || item.status == 1" class="img" src="@/static/side/ic_pandian@2x.png" mode="">
|
</image>
|
<image v-else class="img" src="@/static/side/ic_pandian_grey@2x.png" mode=""></image>
|
<view class="content">
|
<view class="head">
|
<view class="title">{{item.name}}</view>
|
<view class="status" v-if="item.status == 0">未开始</view>
|
<view class="status green" v-if="item.status == 1">盘点中</view>
|
<view class="status gray" v-if="item.status == 2">已完成</view>
|
<view class="status gray" v-if="item.status == 3">已取消</view>
|
</view>
|
<view class="line">盘点日期:{{item.planDate}}</view>
|
<view class="line">盘点仓库:{{item.warehouseName}}</view>
|
<view class="line">
|
<view class="">盘点人员:{{item.userName}}</view>
|
<view class="btn" v-if="item.status == 0 && item.timeFlag" @click="startHandle(item)">开始盘点</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</scroll-view>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getYwStocktaking,
|
ywStocktakingBegin
|
} from '@/api'
|
import dayjs from 'dayjs';
|
export default {
|
data() {
|
return {
|
param: {},
|
list: [],
|
page: 0,
|
total: 0,
|
};
|
},
|
onShow() {
|
this.handleQuery()
|
},
|
methods: {
|
getList() {
|
const {
|
page,
|
param
|
} = this
|
getYwStocktaking({
|
capacity: 20,
|
page,
|
model: {
|
...param
|
}
|
}).then(res => {
|
this.list = [...this.list, ...res.data.records]
|
let date = dayjs().format('YYYY-MM-DD')
|
this.list.forEach(item => {
|
item.timeFlag = new Date(item.planDate).getTime() <= new Date(date+' 23:59:59').getTime()
|
})
|
this.total = res.data.total
|
})
|
},
|
itemClick(item) {
|
if (item.status != 0) {
|
uni.navigateTo({
|
url: '/pages/inventory/detail?id=' + item.id
|
})
|
}
|
},
|
startHandle(item) {
|
uni.showModal({
|
content: '盘点期间不可进行出入库操作',
|
success: (res) => {
|
if (res.confirm) {
|
ywStocktakingBegin(item.id).then(() => {
|
uni.navigateTo({
|
url: '/pages/inventory/detail?id=' + item.id
|
})
|
})
|
|
}
|
}
|
})
|
},
|
handleQuery() {
|
this.list = []
|
this.page = 1
|
this.getList()
|
},
|
scrolltolower() {
|
const {
|
total,
|
list
|
} = this
|
if (list.length < total) {
|
this.page = this.page + 1
|
this.getList()
|
} else {
|
this.showToast('暂无更多数据')
|
}
|
},
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.main_app {
|
padding: 0rpx 30rpx 0;
|
font-size: 28rpx;
|
}
|
|
.head_wrap {
|
display: flex;
|
align-items: center;
|
height: 110rpx;
|
.search_wrap {
|
display: flex;
|
align-items: center;
|
width: 100%;
|
height: 76rpx;
|
background: #F7F7F7;
|
border-radius: 38rpx;
|
padding-left: 30rpx;
|
|
input {
|
flex: 1;
|
}
|
|
.search {
|
width: 28rpx;
|
height: 28rpx;
|
}
|
}
|
|
}
|
.scroll_Y{
|
height: calc(100vh - 126rpx);
|
}
|
.list {
|
.item {
|
display: flex;
|
border-bottom: 1rpx solid #E5E5E5;
|
padding-bottom: 28rpx;
|
margin-bottom: 20rpx;
|
|
.img {
|
width: 80rpx;
|
height: 80rpx;
|
background: rgba(0, 104, 255, 0.08);
|
border-radius: 12rpx;
|
margin-right: 24rpx;
|
}
|
|
.content {
|
flex: 1;
|
|
.head {
|
display: flex;
|
// align-items: center;
|
justify-content: space-between;
|
margin-bottom: 12rpx;
|
|
.title {
|
font-weight: 600;
|
font-size: 34rpx;
|
color: #222222;
|
flex: 1;
|
}
|
|
.status {
|
color: $primaryColor;
|
width: 96rpx;
|
padding-top: 3rpx;
|
}
|
|
.green {
|
color: #0ADE79;
|
}
|
|
.gray {
|
color: #AAAAAA;
|
}
|
}
|
|
.line {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
color: #666666;
|
height: 60rpx;
|
|
.btn {
|
width: 144rpx;
|
height: 60rpx;
|
background: $primaryColor;
|
box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(0, 104, 255, 0.3);
|
border-radius: 30rpx;
|
color: #fff;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
font-size: 26rpx;
|
}
|
}
|
}
|
}
|
}
|
</style>
|