|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view class="page">
|
|
|
|
<view class="search-wrap">
|
|
|
|
<uni-search-bar class="search" radius="30" placeholder="请输入店铺名称、编号" v-model="keyword" clearButton="auto" cancelButton="none" @confirm="initList" />
|
|
|
|
<view>
|
|
|
|
<uni-icons type="notification" size="20"></uni-icons>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<template v-if="list.length">
|
|
|
|
<view class="list">
|
|
|
|
<view class="item" v-for="item in list" @click="toDetail(item)">
|
|
|
|
<view class="metas">
|
|
|
|
<view class="serial">编号:{{ item.orderNumber }}</view>
|
|
|
|
<view class="date">提交时间:</view>
|
|
|
|
</view>
|
|
|
|
<view class="pro-name">
|
|
|
|
<image class="icon" :src="item.logoUrl ? item.logoUrl : 'https://occupationlab.com/images/preschoolEdu/preSchool-icon.png'"></image>
|
|
|
|
{{ item.companyName }}
|
|
|
|
</view>
|
|
|
|
<view class="info">
|
|
|
|
<view class="texts">
|
|
|
|
<view class="meta">
|
|
|
|
采购内容:{{ item.oriPrice || 0 }}
|
|
|
|
</view>
|
|
|
|
<view class="meta">
|
|
|
|
数量:{{ item.totalStocks || 0 }}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="type">组织采购</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<uni-load-more :status="status" />
|
|
|
|
</template>
|
|
|
|
<empty v-else text="暂无线索"></empty>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { myOrder } from '@/apis/modules/order.js'
|
|
|
|
import Goods from '@/config/goods.js'
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
Goods,
|
|
|
|
keyword: '',
|
|
|
|
curTab: '',
|
|
|
|
tabs: [
|
|
|
|
{
|
|
|
|
id: '',
|
|
|
|
name: '全部'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 2,
|
|
|
|
name: '组织'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 1,
|
|
|
|
name: '个人'
|
|
|
|
},
|
|
|
|
],
|
|
|
|
reachBottom: 0, // 是否是上拉加载。0->否,1->是,-1->加载完所有数据
|
|
|
|
status: 'more', // 上拉加载状态 more|loading|noMore
|
|
|
|
searchTimer: null,
|
|
|
|
keyword: '',
|
|
|
|
list: [],
|
|
|
|
page: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
keyword () {
|
|
|
|
clearTimeout(this.searchTimer)
|
|
|
|
this.searchTimer = setTimeout(() => {
|
|
|
|
this.initList()
|
|
|
|
}, 500)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 下拉刷新
|
|
|
|
onPullDownRefresh() {
|
|
|
|
this.initList()
|
|
|
|
setTimeout(() => {
|
|
|
|
uni.stopPullDownRefresh()
|
|
|
|
}, 1500)
|
|
|
|
},
|
|
|
|
// 上拉加载
|
|
|
|
onReachBottom() {
|
|
|
|
if (this.reachBottom >= 0) {
|
|
|
|
this.reachBottom = 1
|
|
|
|
this.status = 'loading'
|
|
|
|
this.getList()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.initList()
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 获取列表
|
|
|
|
getList() {
|
|
|
|
uni.showLoading({
|
|
|
|
title: '加载中'
|
|
|
|
})
|
|
|
|
myOrder({
|
|
|
|
status: this.curTab,
|
|
|
|
page: this.page
|
|
|
|
}).then(({ data }) => {
|
|
|
|
uni.hideLoading()
|
|
|
|
// 未加载完所有数据,并且不是筛选,则拼接list,否则直接赋值
|
|
|
|
const list = data.records
|
|
|
|
this.list = this.reachBottom > 0 ? [...this.list, ...list] : list
|
|
|
|
this.page++ // 每次获取了数据后page+1
|
|
|
|
const noMore = this.list.length === data.total // 是否加载完所有数据
|
|
|
|
this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore
|
|
|
|
this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1
|
|
|
|
}).catch(e => {
|
|
|
|
uni.hideLoading()
|
|
|
|
})
|
|
|
|
},
|
|
|
|
initList() {
|
|
|
|
this.page = 1
|
|
|
|
this.reachBottom = 0
|
|
|
|
this.getList()
|
|
|
|
},
|
|
|
|
// tab切换
|
|
|
|
tabChange(id) {
|
|
|
|
this.curTab = id
|
|
|
|
this.initList()
|
|
|
|
},
|
|
|
|
// 跳转详情
|
|
|
|
toDetail(item) {
|
|
|
|
this.$util.to(`../procureDetail/procureDetail?id=${item.orderNumber}`)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.page {
|
|
|
|
padding-bottom: 90px;
|
|
|
|
}
|
|
|
|
.list {
|
|
|
|
margin-top: 20rpx;
|
|
|
|
padding: 20rpx;
|
|
|
|
.item {
|
|
|
|
padding: 20rpx;
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
|
|
|
.metas {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
}
|
|
|
|
.serial {
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #333;
|
|
|
|
}
|
|
|
|
.date {
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #8e8e8e;
|
|
|
|
}
|
|
|
|
.info {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.pro-name {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 18rpx 0;
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
font-size: 32rpx;
|
|
|
|
font-weight: 600;
|
|
|
|
color: #333;
|
|
|
|
border-bottom: 1px solid #E6E8ED;
|
|
|
|
.icon {
|
|
|
|
width: 66rpx;
|
|
|
|
min-width: 66rpx;
|
|
|
|
height: 66rpx;
|
|
|
|
margin-right: 20rpx;
|
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.meta {
|
|
|
|
margin: 10rpx 0;
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #999;
|
|
|
|
}
|
|
|
|
.type {
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #1fc133;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|