|
|
@@ -1,66 +1,36 @@
|
|
|
<template>
|
|
|
- <div class="seek">
|
|
|
- <div class="com-mobile-header">
|
|
|
- <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
|
|
|
- <p>待报价</p>
|
|
|
- </div>
|
|
|
- <div class="mobile-content">
|
|
|
- <div class="search-content">
|
|
|
- <input type="text" v-model="seekKeyword" placeholder="型号/品牌/类目/规格/公司" @keyup.13="onSearch">
|
|
|
- <span @click="onSearch"><i class="iconfont icon-sousuo"></i></span>
|
|
|
- </div>
|
|
|
- <seek-list v-show="purchaseManListData.length" :userType="userType" :seekType="seekType" :purchaseManList="purchaseManListData" :isDataChange="isDataChange"></seek-list>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <seek :userType="'buyer'" @reloadAction="reloadData"></seek>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { SeekList } from '~components/mobile/applyPurchase'
|
|
|
+ import { Seek } from '~components/mobile/center'
|
|
|
export default {
|
|
|
layout: 'mobileNoHeader',
|
|
|
middleware: 'authenticated',
|
|
|
- data () {
|
|
|
- return {
|
|
|
- seekKeyword: '',
|
|
|
- purchaseManListData: [],
|
|
|
- userType: 'saler',
|
|
|
- isDataChange: false,
|
|
|
- page: 1,
|
|
|
- count: 10,
|
|
|
- isChange: false
|
|
|
- }
|
|
|
- },
|
|
|
- fetch ({ store }) {
|
|
|
+ fetch ({ store, query }) {
|
|
|
let user = store.state.option.user.data
|
|
|
let params = {
|
|
|
pageNumber: 1,
|
|
|
- pageSize: 10,
|
|
|
- state: 'todo'
|
|
|
+ pageSize: 10
|
|
|
}
|
|
|
if (user.enterprise.uu) {
|
|
|
params.enUU = user.enterprise.uu
|
|
|
} else {
|
|
|
params.userUU = user.userUU
|
|
|
}
|
|
|
- return Promise.all([
|
|
|
- store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
|
|
|
- ])
|
|
|
+ if (query.seekType === 'wait') {
|
|
|
+ params.state = 'todo'
|
|
|
+ return Promise.all([
|
|
|
+ store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
|
|
|
+ ])
|
|
|
+ } else {
|
|
|
+ params._state = 'done'
|
|
|
+ return Promise.all([
|
|
|
+ store.dispatch('applyPurchase/loadBuyerPurchaseManList', params)
|
|
|
+ ])
|
|
|
+ }
|
|
|
},
|
|
|
components: {
|
|
|
- SeekList
|
|
|
- },
|
|
|
- watch: {
|
|
|
- '$store.state.applyPurchase.purchaseManList.purchaseManList.data': {
|
|
|
- handler: function (val) {
|
|
|
- let list = val.content ? val.content.slice() : []
|
|
|
- if (this.isChange) {
|
|
|
- this.purchaseManListData = list
|
|
|
- this.isChange = false
|
|
|
- } else {
|
|
|
- this.purchaseManListData = this.purchaseManListData.concat(list)
|
|
|
- }
|
|
|
- },
|
|
|
- immediate: true
|
|
|
- }
|
|
|
+ Seek
|
|
|
},
|
|
|
computed: {
|
|
|
seekType () {
|
|
|
@@ -68,24 +38,24 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onSearch: function () {
|
|
|
- this.page = 1
|
|
|
- this.isChange = true
|
|
|
- this.reloadData()
|
|
|
- },
|
|
|
- reloadData: function () {
|
|
|
+ reloadData: function (page = 1, count = 10, keyword) {
|
|
|
let params = {
|
|
|
- pageNumber: this.page,
|
|
|
- pageSize: this.count,
|
|
|
- state: 'todo',
|
|
|
- keyword: this.seekKeyword
|
|
|
+ pageNumber: page,
|
|
|
+ pageSize: count,
|
|
|
+ keyword: keyword
|
|
|
}
|
|
|
if (this.user.data.enterprise.uu) {
|
|
|
params.enUU = this.user.data.enterprise.uu
|
|
|
} else {
|
|
|
params.userUU = this.user.data.userUU
|
|
|
}
|
|
|
- this.$store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
|
|
|
+ if (this.seekType === 'done') {
|
|
|
+ params._state = 'done'
|
|
|
+ this.$store.dispatch('applyPurchase/loadBuyerPurchaseManList', params)
|
|
|
+ } else {
|
|
|
+ params.state = 'todo'
|
|
|
+ this.$store.dispatch('applyPurchase/loadBuyerUnSayPricePurchaseManList', params)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|