|
@@ -127,6 +127,24 @@
|
|
|
mSearch
|
|
|
},
|
|
|
methods: {
|
|
|
+ //详情
|
|
|
+ navToDetailPage(item) {
|
|
|
+ let id = item.id;
|
|
|
+ if (item.unitPrice === 0) {
|
|
|
+ this.contactUs();
|
|
|
+ } else {
|
|
|
+ if (this.TabCur == 0) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pageA/product/detail?id=${id}`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pageA/product/sales_detail?id=${id}`
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
init() {
|
|
|
this.loadDefaultKeyword();
|
|
|
this.loadOldKeyword();
|
|
@@ -245,10 +263,20 @@
|
|
|
},
|
|
|
//执行搜索
|
|
|
doSearch(e) {
|
|
|
- if(e.detail.value.length>0){
|
|
|
- this.isShowKeywordList=true
|
|
|
- }else{
|
|
|
- this.isShowKeywordList=false
|
|
|
+ if(e.detail){
|
|
|
+ if(e.detail.value.length>0){
|
|
|
+ this.isShowKeywordList=true
|
|
|
+ }else{
|
|
|
+ this.isShowKeywordList=false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(e){
|
|
|
+ if(e.length>0){
|
|
|
+ this.isShowKeywordList=true
|
|
|
+ this.searchKeyWord = e
|
|
|
+ }else{
|
|
|
+ this.isShowKeywordList=false
|
|
|
+ }
|
|
|
}
|
|
|
uni.showLoading({
|
|
|
title: '正在加载',
|
|
@@ -256,22 +284,23 @@
|
|
|
})
|
|
|
var param1=''
|
|
|
if (this.TabCur == 0) {
|
|
|
- param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
|
|
|
- } else {
|
|
|
- param1 = 'buy'
|
|
|
- }
|
|
|
- this.$api.doRequest('get', param1,{pageSize:this.pageSize,
|
|
|
+ param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
|
|
|
+ } else {
|
|
|
+ param1 = '/salePlanInfo/selectSalePlanInfo'
|
|
|
+ }
|
|
|
+ this.$api.doRequest('get', param1,{pageSize:this.pageSize,
|
|
|
currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
- uni.hideLoading()
|
|
|
- this.keywordList=res.data.data.records
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.errmsg,
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- });
|
|
|
+ uni.hideLoading()
|
|
|
+ this.keywordList=res.data.data.records
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title: res.errmsg,
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ });
|
|
|
// console.log(key)
|
|
|
// console.log(this.keyword)
|
|
|
// key = key ? key : this.keyword ? this.keyword : this.defaultKeyword;
|
|
@@ -284,15 +313,15 @@
|
|
|
},
|
|
|
tabcarchange(status){
|
|
|
this.TabCur=status
|
|
|
+ var param1 = ''
|
|
|
if (this.TabCur == 0) {
|
|
|
- param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
|
|
|
- } else {
|
|
|
- param1 = 'buy'
|
|
|
- }
|
|
|
- this.$api.doRequest('get', param1,{pageSize:this.pageSize,
|
|
|
+ param1 = '/procurementPlanInfo/selectProcurementPlanInfo'
|
|
|
+ } else {
|
|
|
+ param1 = '/salePlanInfo/selectSalePlanInfo'
|
|
|
+ }
|
|
|
+ this.$api.doRequest('get', param1,{pageSize:this.pageSize,
|
|
|
currentPage:this.currentPage,searchKeyWord:this.searchKeyWord}).then(res => {
|
|
|
if(res.data.code==200){
|
|
|
- uni.hideLoading()
|
|
|
this.keywordList=res.data.data.records
|
|
|
}else{
|
|
|
uni.showToast({
|
|
@@ -300,16 +329,18 @@
|
|
|
icon:'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- uni.showToast({
|
|
|
- title: res.errmsg,
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- });
|
|
|
+ uni.hideLoading()
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title: res.errmsg,
|
|
|
+ icon:'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ });
|
|
|
},
|
|
|
//保存关键字到历史记录
|
|
|
saveKeyword(keyword) {
|