|
|
@@ -297,74 +297,54 @@
|
|
|
this.resetList()
|
|
|
},
|
|
|
sayPrice: function (purchaseMan, index) {
|
|
|
- let _this = this
|
|
|
- for (let i = 0; i < this.purchaseManList.content.length; i++) {
|
|
|
- _this.purchaseManList.content[i].active = false
|
|
|
+// let _this = this
|
|
|
+// for (let i = 0; i < this.purchaseManList.content.length; i++) {
|
|
|
+// _this.purchaseManList.content[i].active = false
|
|
|
+// }
|
|
|
+ if (this.user.logged) {
|
|
|
+ if (this.user.data.enterprise.uu) {
|
|
|
+ this.resetSayPrice()
|
|
|
+ purchaseMan.active = true
|
|
|
+ this.currentSayPriceIndex = index
|
|
|
+ } else {
|
|
|
+ this.$message.error('个人账户不可报价')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$router.push('/auth/login?returnUrl=' + window.location.href)
|
|
|
}
|
|
|
- this.resetSayPrice()
|
|
|
- purchaseMan.active = true
|
|
|
- this.currentSayPriceIndex = index
|
|
|
},
|
|
|
cancelSayPrice: function () {
|
|
|
this.purchaseManList.content[this.currentSayPriceIndex].active = false
|
|
|
this.currentSayPriceIndex = -1
|
|
|
},
|
|
|
commitSayPrice: function () {
|
|
|
- if (this.user.logged) {
|
|
|
- if (this.user.data.enterprise.uu) {
|
|
|
- if (this.checkValid()) {
|
|
|
- let purchaseMan = this.purchaseManList.content[this.currentSayPriceIndex]
|
|
|
- this.showLoading = true
|
|
|
- purchaseMan.leadtime = this.sayPriceObj.leadtime
|
|
|
- purchaseMan.replies = this.sayPriceObj.replies
|
|
|
- purchaseMan.vendUU = this.user.data.enterprise.uu
|
|
|
- purchaseMan.vendorUserUU = this.user.data.userUU
|
|
|
- purchaseMan.qutoApp = 'MALL'
|
|
|
- if (!purchaseMan.currency) {
|
|
|
- purchaseMan.currency = this.sayPriceObj.currency
|
|
|
- }
|
|
|
- this.$http.post('/inquiry/sale/item/save', purchaseMan).then(response => {
|
|
|
- this.showLoading = false
|
|
|
- if (response.data.success === false) {
|
|
|
- this.$message.error(response.data.message)
|
|
|
- } else {
|
|
|
- this.$message.success('报价成功')
|
|
|
- this.resetSayPrice()
|
|
|
- this.resetList()
|
|
|
- }
|
|
|
- }, error => {
|
|
|
- console.log(error)
|
|
|
- this.$message.error('请勿重复报价或报价自己的求购')
|
|
|
- this.showLoading = false
|
|
|
- })
|
|
|
+ if (this.checkValid()) {
|
|
|
+ let purchaseMan = this.purchaseManList.content[this.currentSayPriceIndex]
|
|
|
+ this.showLoading = true
|
|
|
+ purchaseMan.leadtime = this.sayPriceObj.leadtime
|
|
|
+ purchaseMan.replies = this.sayPriceObj.replies
|
|
|
+ purchaseMan.vendUU = this.user.data.enterprise.uu
|
|
|
+ purchaseMan.vendorUserUU = this.user.data.userUU
|
|
|
+ purchaseMan.qutoApp = 'MALL'
|
|
|
+ if (!purchaseMan.currency) {
|
|
|
+ purchaseMan.currency = this.sayPriceObj.currency
|
|
|
+ }
|
|
|
+ this.$http.post('/inquiry/sale/item/save', purchaseMan).then(response => {
|
|
|
+ this.showLoading = false
|
|
|
+ if (response.data.success === false) {
|
|
|
+ this.$message.error(response.data.message)
|
|
|
} else {
|
|
|
- this.$message.error('请输入正确的报价信息')
|
|
|
+ this.$message.success('报价成功')
|
|
|
+ this.resetSayPrice()
|
|
|
+ this.resetList()
|
|
|
}
|
|
|
- } else {
|
|
|
- this.$message.error('个人账户不可报价')
|
|
|
- }
|
|
|
-// if (this.checkAllSayPrice()) {
|
|
|
-// } else {
|
|
|
-// if (!this.validSayPrice.unitPrice) {
|
|
|
-// if (!this.sayPriceObj.unitPrice) {
|
|
|
-// this.$message.error('单价不能为空')
|
|
|
-// } else {
|
|
|
-// this.$message.error('单价必须是大于0的数字')
|
|
|
-// }
|
|
|
-// } else if (!this.validSayPrice.minDay || !this.validSayPrice.maxDay) {
|
|
|
-// if ((!this.sayPriceObj.minDay && this.sayPriceObj.minDay !== 0) || (!this.sayPriceObj.maxDay && this.sayPriceObj.maxDay !== 0)) {
|
|
|
-// this.$message.error('交期不能为空')
|
|
|
-// } else {
|
|
|
-// if (this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay.toString().indexOf('.') !== -1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay.toString().indexOf('.') !== -1) {
|
|
|
-// this.$message.error('交期只能填写1-31之间的整数值')
|
|
|
-// } else {
|
|
|
-// this.$message.error('最短交期应小于等于最长交期')
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ }, error => {
|
|
|
+ console.log(error)
|
|
|
+ this.$message.error('请勿重复报价或报价自己的求购')
|
|
|
+ this.showLoading = false
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.$router.push('/auth/login?returnUrl=' + window.location.href)
|
|
|
+ this.$message.error('请输入正确的报价信息')
|
|
|
}
|
|
|
},
|
|
|
resetList: function () {
|
|
|
@@ -1065,6 +1045,7 @@
|
|
|
border: 1px solid #bfbfbf;
|
|
|
border-radius: 2px;
|
|
|
height: 28px;
|
|
|
+ padding: 0 8px;
|
|
|
}
|
|
|
&.form-left {
|
|
|
span {
|
|
|
@@ -1074,6 +1055,7 @@
|
|
|
}
|
|
|
input {
|
|
|
width: 64px;
|
|
|
+ padding: 0 8px;
|
|
|
}
|
|
|
}
|
|
|
&.form-upload {
|
|
|
@@ -1123,6 +1105,7 @@
|
|
|
position: relative;
|
|
|
input {
|
|
|
width: 101px;
|
|
|
+ padding: 0 8px;
|
|
|
}
|
|
|
select {
|
|
|
position: absolute;
|