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.
330 lines
9.2 KiB
330 lines
9.2 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="searchList" type="daterange" />
|
|
<view style="display: flex;">
|
|
<view style="width: 80%;" :style="{'width':inStorageStatus!= 0?'80%':'100%'}">
|
|
<uni-search-bar class="uni-mt-10" radius="5" placeholder="输入供应商名称搜索" cancelButton="none"
|
|
@confirm="searchList" />
|
|
</view>
|
|
<view style="width: 20%;" v-if="inStorageStatus!= 0">
|
|
<view style="width: 80%;height: 70rpx;background: #5fd9ee;text-align: center;line-height: 70rpx;border-radius: 10px;margin: 10px;color: #fff;" @tap="changeSort('paixu')">
|
|
查看
|
|
<uni-icons type="down" color="#fff" size="11" v-if="noDaysort == false"></uni-icons>
|
|
<uni-icons type="up" color="#fff" size="11" v-if="noDaysort"></uni-icons>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="nahuo-mask" v-if="noDaysort">
|
|
<view style="width: 100%;margin: 0 auto;background: #fff;height: 200rpx;border: 1px solid #eee;border-bottom-left-radius: 10px;border-bottom-right-radius: 10px;">
|
|
<view @tap="getCancelOrder()" class="paixu-content" style="border-bottom: 1px solid #eee;">
|
|
查看全部订单
|
|
</view>
|
|
<view @tap="getCancelOrder('1')" class="paixu-content">
|
|
查看已作废状态的订单
|
|
</view>
|
|
</view>
|
|
</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="goDetail(item)" :key="index">
|
|
<uni-card :title="'供应商:'+(item.supplierName == null ?'暂无':item.supplierName)"
|
|
:sub-title="'操作时间:'+(item.purchaseTime == null ?'暂无':item.purchaseTime)"
|
|
:extra="'共'+(item.totalAmount == null ?'暂无':item.totalAmount) + '件'"
|
|
thumbnail="/static/images/dingdan/dd1.png">
|
|
<view class="uni-body"><text class="cardText">
|
|
入库时间:</text>{{item.createTime == null ?'暂无':item.createTime}}
|
|
</view>
|
|
<view class="uni-body"><text class="cardText">
|
|
入库人:</text>{{item.createByName == null ?'暂无':item.createByName}}
|
|
</view>
|
|
<view class="uni-body" v-if="item.inStorageStatus != 0 && type==0">
|
|
<text class="cardText">总成本:</text>
|
|
<text class="priceText">{{item.shouldPay == null ?'暂无':item.shouldPay}} </text>
|
|
<text decode class="cardText">{{' 欠款: '}} </text>
|
|
<text class="priceText" style="color:red">{{item.noPay == null ?'暂无':item.noPay}}</text>
|
|
</view>
|
|
<view class="uni-body">
|
|
<text class="cardText">订单状态:</text>{{item.delFlag == 1 ?'已撤销':item.inStorageStatus == 0 ?'未入库' :item.inStorageStatus == 1 ?'已入库':item.inStorageStatus == 2 ?'AI识别-识别中...':item.inStorageStatus == 3 || (item.inStorageStatus == 4 && item.ocrCount > 0) ?'AI识别-识别完成':item.ocrCount == 0 && item.inStorageStatus == 4?'AI识别-识别失败':'暂无'}}
|
|
</view>
|
|
<view v-if="item.inStorageStatus== 0 && type==0" class="return-price" @tap.stop="returnPrice(item)">更新</view>
|
|
<view v-if="item.delFlag != 1 && type==0" class="return-price" @tap.stop="returnPrice(item,index)">撤销</view>
|
|
<view v-if="item.inStorageStatus == 2 || item.inStorageStatus == 3 || item.inStorageStatus == 4" class="return-price" style="width:105rpx;" @tap.stop="returnPrice(item)">AI入库</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: '',
|
|
noDaysort:false,
|
|
type: '',
|
|
cancel:false,
|
|
pages: 1,
|
|
pageNum:1,
|
|
status: 'loadmore',
|
|
range:[]
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
this.inStorageStatus = option.inStorageStatus || ''
|
|
this.type = uni.getStorageSync('type')
|
|
},
|
|
onShow(){
|
|
|
|
if(uni.getStorageSync('noReload') == true){
|
|
uni.removeStorageSync('noReload')
|
|
}else{
|
|
this.list = []
|
|
this.pageNum = 1
|
|
this.getList()
|
|
}
|
|
|
|
},
|
|
onReachBottom() {
|
|
if(this.inStorageStatus != 0){
|
|
if (this.pageNum >= this.pages) return;
|
|
this.status = 'loading';
|
|
this.pageNum += 1;
|
|
|
|
if(this.cancel == true){
|
|
this.getList("1");
|
|
}else{
|
|
this.getList();
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
searchTime(res){
|
|
console.log(res)
|
|
if(res == ''){
|
|
this.range = []
|
|
}
|
|
this.pages = 1;
|
|
this.pageNum = 1;
|
|
this.list = [];
|
|
if(this.cancel == true){
|
|
this.getList("1");
|
|
}else{
|
|
this.getList();
|
|
}
|
|
},
|
|
searchList(res) {
|
|
this.searchStr = res.value
|
|
this.pages = 1;
|
|
this.pageNum = 1;
|
|
this.list = [];
|
|
if(this.cancel == true){
|
|
this.getList("1");
|
|
}else{
|
|
this.getList();
|
|
}
|
|
},
|
|
getList(type) {
|
|
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]
|
|
}
|
|
this.searchStr = ""
|
|
this.noDaysort = false
|
|
} 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],
|
|
delFlag:type,
|
|
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]
|
|
}
|
|
// this.searchStr = ""
|
|
this.noDaysort = false
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
}
|
|
},
|
|
getCancelOrder(type){
|
|
this.pageNum =1
|
|
this.list = []
|
|
if(type == "1"){
|
|
this.cancel = true
|
|
}else{
|
|
this.cancel = false
|
|
}
|
|
this.getList(type)
|
|
},
|
|
changeSort(type){
|
|
this.nahuoDay = false
|
|
this.noDaysort = !this.noDaysort
|
|
|
|
},
|
|
paixuChange(text){
|
|
this.sort = text
|
|
this.popleList = []
|
|
this.pages = 1
|
|
this.searchName = ""
|
|
this.noDaysort = false
|
|
this.khOrGysList()
|
|
},
|
|
goDetail(item){
|
|
uni.setStorageSync('noReload',true)
|
|
uni.navigateTo({
|
|
url: '/package1/index/waitStorageDetail?id=' + item.id
|
|
})
|
|
},
|
|
returnPrice(item,index) {
|
|
let that = this;
|
|
if(item.inStorageStatus == 2 || item.inStorageStatus == 3 || item.inStorageStatus == 4){
|
|
uni.navigateTo({
|
|
url: '/package1/AI/AIInventoryList'
|
|
})
|
|
}else if(item.inStorageStatus == 1){
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定撤销该采购单吗?",
|
|
success: function(res) {
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
})
|
|
if (res.confirm) {
|
|
that.tui.request("/app/purchase/cancelPurchase", "POST", {
|
|
id: item.id,
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
// that.pages = 1;
|
|
// that.pageNum = 1;
|
|
// that.list = [];
|
|
that.list[index].delFlag = 1
|
|
that.$forceUpdate()
|
|
// that.getList()
|
|
that.tui.toast("撤销成功!")
|
|
} else {
|
|
that.tui.toast(res.message)
|
|
}
|
|
})
|
|
}
|
|
setTimeout(res => {
|
|
uni.hideLoading();
|
|
}, 500)
|
|
}
|
|
})
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</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%;
|
|
}
|
|
.paixu-content{
|
|
height: 100rpx;
|
|
line-height: 100rpx;
|
|
text-align: center;
|
|
font-size: 30rpx;
|
|
font-weight: bold;
|
|
}
|
|
.nahuo-mask{
|
|
height: 1200rpx;
|
|
background: rgba(0, 0, 0, 0.6);
|
|
position: fixed;
|
|
top: 100px;
|
|
right: 0;
|
|
z-index: 100;
|
|
width: 100%;
|
|
}
|
|
</style>
|