You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
189 lines
4.8 KiB
189 lines
4.8 KiB
<template>
|
|
<view>
|
|
<view class="search" style="position: fixed;top: 0;z-index: 99;">
|
|
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="getList" type="daterange" />
|
|
<uni-search-bar class="uni-mt-10" radius="5" placeholder="输入供应商/商品名称/货号查询" cancelButton="none"
|
|
@confirm="searchList" />
|
|
</view>
|
|
<u-alert description="点击可跳转至入库单" type="primary"></u-alert>
|
|
<view class="ulList" v-if="list.length > 0" style="overflow: scroll;margin-top:300rpx;">
|
|
<ul>
|
|
<li v-for="(item,index) in list" @tap="returnPrice(item)" :key="index">
|
|
<uni-card :title="'供应商:'+(item.supplierName == null ?'暂无':item.supplierName)"
|
|
:sub-title="item.createTime == null ?'暂无':item.createTime"
|
|
:extra="'共'+(item.totalAmount == null ?'暂无':item.totalAmount) + '件'"
|
|
thumbnail="/static/images/dingdan/dd1.png">
|
|
<view class="uni-body"><text class="cardText">
|
|
入库人:</text>{{item.createByName == null ?'暂无':item.createByName}}
|
|
</view>
|
|
<view class="uni-body" v-if="type==0">
|
|
<text class="cardText">总成本:</text>
|
|
<text class="priceText">{{item.shouldPay == null ?'暂无':item.shouldPay}} </text>
|
|
<text decode class="cardText">{{' 欠款: '}} </text>
|
|
<text class="priceText">{{item.noPay == null ?'暂无':item.noPay}}</text>
|
|
</view>
|
|
<view class="uni-body">
|
|
<text class="cardText">订单状态:</text>{{item.inStorageStatus == 0 ?'未入库' :'已入库'}}
|
|
</view>
|
|
<view v-if="item.inStorageStatus== 0 && type==0" class="return-price" @tap.stop="returnPrice(item)">更新</view>
|
|
</uni-card>
|
|
</li>
|
|
</ul>
|
|
|
|
</view>
|
|
<u-loadmore :status="status" />
|
|
<!-- <u-empty v-else mode="order" margin-top="200"></u-empty> -->
|
|
</view>
|
|
</template>
|
|
<script>
|
|
import color from "../../uni_modules/uview-ui/libs/config/color";
|
|
|
|
export default {
|
|
name: "uparrears",
|
|
computed: {
|
|
color() {
|
|
return color
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
searchStr: '',
|
|
list: [],
|
|
inStorageStatus: '',
|
|
supplierName: '',
|
|
startDate: '',
|
|
endDate: '',
|
|
type: '',
|
|
pages: 1,
|
|
pageNum:1,
|
|
status: 'loadmore',
|
|
range:[]
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
this.inStorageStatus = option.inStorageStatus || ''
|
|
this.type = uni.getStorageSync('type')
|
|
},
|
|
onShow(){
|
|
this.list = []
|
|
this.pageNum = 1
|
|
this.getList()
|
|
},
|
|
onReachBottom() {
|
|
if(this.inStorageStatus != 0){
|
|
if (this.pageNum >= this.pages) return;
|
|
this.status = 'loading';
|
|
this.pageNum += 1;
|
|
this.getList();
|
|
}
|
|
},
|
|
methods: {
|
|
searchList(res) {
|
|
this.searchStr = res.value
|
|
this.pages = 1;
|
|
this.pageNum = 1;
|
|
this.list = [];
|
|
this.getList()
|
|
},
|
|
getList() {
|
|
var url,data;
|
|
if(this.inStorageStatus == 0){
|
|
this.tui.request("/app/purchase/list", "POST", {
|
|
inStorageStatus: this.inStorageStatus
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
this.pages = res.result.pages
|
|
if (this.pages == 1) {
|
|
this.list = res.result.records
|
|
} else {
|
|
this.list = [...this.list, ...res.result.records]
|
|
}
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
}else{
|
|
this.tui.request("/app/purchase/getPurchaseList", "POST", {
|
|
inStorageStatus: this.inStorageStatus,
|
|
searchStr: this.searchStr,
|
|
startDate: this.range[0],
|
|
endDate: this.range[1],
|
|
pageNum:this.pageNum,
|
|
pageSize:10,
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
// this.list = []
|
|
this.pages = res.result.pages
|
|
if (this.pages == 1) {
|
|
this.list = res.result.records
|
|
} else {
|
|
this.list = [...this.list, ...res.result.records]
|
|
}
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
}
|
|
},
|
|
returnPrice(item) {
|
|
uni.navigateTo({
|
|
url: '/pages/index/waitStorageDetail?id=' + item.id
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style lang="scss">
|
|
.u-transition{
|
|
width: 100%;
|
|
position: fixed;
|
|
top: 226rpx;
|
|
z-index: 99;
|
|
}
|
|
.uni-searchbar{
|
|
padding: 20rpx 0 !important;
|
|
}
|
|
.ulList {
|
|
ul {
|
|
li {
|
|
font-size: 12px;
|
|
|
|
.floatRight {
|
|
float: right;
|
|
padding: 14rpx;
|
|
color: $u-primary;
|
|
font-size: 26upx;
|
|
}
|
|
|
|
.cardText {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.priceText {
|
|
color: $u-primary;
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.return-price {
|
|
position: absolute;
|
|
bottom: 30rpx;
|
|
right: 30rpx;
|
|
background: #5fd9ee;
|
|
color: #fff;
|
|
width: 80rpx;
|
|
height: 60rpx;
|
|
line-height: 60rpx;
|
|
text-align: center;
|
|
border-radius: 10px;
|
|
}
|
|
.search {
|
|
padding: 20upx;
|
|
background-color: #fff;
|
|
width: 100%;
|
|
}
|
|
</style>
|