|
|
|
@ -1,7 +1,8 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view class="search"> |
|
|
|
<u-search placeholder="输入供应商/商品名称/货号查询" v-model="keyword" @search="searchList" bg-color="#fff" |
|
|
|
<view class="search" v-if="inStorageStatus != 0"> |
|
|
|
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" @change="getList" type="daterange" /> |
|
|
|
<u-search placeholder="输入供应商/商品名称/货号查询" v-model="searchStr" @search="getList" bg-color="#fff" |
|
|
|
:show-action="false" border-color="#afd9ee"></u-search> |
|
|
|
</view> |
|
|
|
<u-alert description="点击可跳转至入库单" type="primary"></u-alert> |
|
|
|
@ -46,7 +47,7 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
keyword: '', |
|
|
|
searchStr: '', |
|
|
|
list: [], |
|
|
|
inStorageStatus: '', |
|
|
|
supplierName: '', |
|
|
|
@ -55,7 +56,8 @@ |
|
|
|
type: '', |
|
|
|
pages: 1, |
|
|
|
pageNum:1, |
|
|
|
status: 'loadmore' |
|
|
|
status: 'loadmore', |
|
|
|
range:[] |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
@ -71,39 +73,42 @@ |
|
|
|
this.pageNum += 1; |
|
|
|
this.getList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getList() { |
|
|
|
this.tui.request("/app/purchase/list", "POST", { |
|
|
|
inStorageStatus: this.inStorageStatus, |
|
|
|
supplierName: this.supplierName, |
|
|
|
startDate: this.startDate, |
|
|
|
endDate: this.endDate, |
|
|
|
pageNum:this.pageNum, |
|
|
|
pageSize:10, |
|
|
|
}, false, false).then((res) => { |
|
|
|
methods: { |
|
|
|
searchList() { |
|
|
|
this.pages = 1; |
|
|
|
this.list = []; |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
getList() { |
|
|
|
var url,data |
|
|
|
if(this.inStorageStatus == 0){ |
|
|
|
url = "/app/purchase/list"; |
|
|
|
data = { |
|
|
|
inStorageStatus: this.inStorageStatus |
|
|
|
} |
|
|
|
}else{ |
|
|
|
url = "/app/purchase/getPurchaseList"; |
|
|
|
data = { |
|
|
|
inStorageStatus: this.inStorageStatus, |
|
|
|
supplierName: this.supplierName, |
|
|
|
startDate: this.range[0], |
|
|
|
endDate: this.range[1], |
|
|
|
pageNum:this.pageNum, |
|
|
|
pageSize:10, |
|
|
|
} |
|
|
|
} |
|
|
|
this.tui.request(url, "POST", data, false, false).then((res) => { |
|
|
|
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) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
//搜索 |
|
|
|
searchList() { |
|
|
|
this.tui.request("/app/purchase/getPurchaseList", "POST", { |
|
|
|
searchStr:this.keyword |
|
|
|
}, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.list = res.result |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
returnPrice(item) { |
|
|
|
uni.navigateTo({ |
|
|
|
|