|
|
@@ -132,6 +132,9 @@
|
|
|
},
|
|
|
totalCount () {
|
|
|
return this.purchaseManList.totalElements
|
|
|
+ },
|
|
|
+ user () {
|
|
|
+ return this.$store.state.option.user
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -152,25 +155,29 @@
|
|
|
purchaseMan.active = false
|
|
|
},
|
|
|
commitSayPrice: function (purchaseMan) {
|
|
|
- let valid = this.sayPriceObj.currency && this.sayPriceObj.unitPrice && this.sayPriceObj.minDay && this.sayPriceObj.maxDay
|
|
|
- if (valid) {
|
|
|
- this.sayPriceObj.spId = purchaseMan.id
|
|
|
- this.sayPriceObj.currency = purchaseMan.currency
|
|
|
- this.$http.post('/seek/offer/saveOffer', this.sayPriceObj).then(response => {
|
|
|
- this.$message.success('发布成功')
|
|
|
- this.nowPage = 1
|
|
|
- this.resetSayPrice()
|
|
|
- this.resetList()
|
|
|
- }, error => {
|
|
|
- console.log(error)
|
|
|
- this.$message.error('系统错误')
|
|
|
- })
|
|
|
+ if (this.user.logged) {
|
|
|
+ let valid = this.sayPriceObj.currency && this.sayPriceObj.unitPrice && this.sayPriceObj.minDay && this.sayPriceObj.maxDay
|
|
|
+ if (valid) {
|
|
|
+ this.sayPriceObj.spId = purchaseMan.id
|
|
|
+ this.sayPriceObj.currency = purchaseMan.currency
|
|
|
+ this.$http.post('/seek/offer/saveOffer', this.sayPriceObj).then(response => {
|
|
|
+ this.$message.success('发布成功')
|
|
|
+ this.nowPage = 1
|
|
|
+ this.resetSayPrice()
|
|
|
+ this.resetList()
|
|
|
+ }, error => {
|
|
|
+ console.log(error)
|
|
|
+ this.$message.error('系统错误')
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error('请填写正确的信息')
|
|
|
+ }
|
|
|
} else {
|
|
|
- this.$message.error('请填写正确的信息')
|
|
|
+ this.$router.push('/auth/login')
|
|
|
}
|
|
|
},
|
|
|
resetList: function () {
|
|
|
- this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: this.nowPage, count: this.pageSize, keyWord: this.keyWord, sorting: this.sorting})
|
|
|
+ this.$store.dispatch('applyPurchase/loadPurchaseManList', {page: this.nowPage, count: this.pageSize, keyWord: this.keyWord, sorting: !this.sorting || JSON.stringify(this.sorting) === '{}' ? {releaseDate: 'DESC'} : this.sorting})
|
|
|
},
|
|
|
resetSayPrice: function () {
|
|
|
this.sayPriceObj = {
|