|
@@ -2995,7 +2995,7 @@ export default {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
const length = this.goodsActives === 'gift'? this.contactsData.length: this.goodsShowData.length
|
|
|
- const length1 = this.goodsActives === 'goods'? this.giftData.length: this.goodsShowData.length
|
|
|
+ const length1 = this.goodsActives === 'goods'? this.giftData: this.goodsShowData
|
|
|
for (let i = 0;i < length;i++) {
|
|
|
const data = this.goodsActives === 'gift'? this.contactsData: this.goodsShowData;
|
|
|
if (Number(data[i].orderQuantity) > Number(data[i].storageQuantity)) {
|
|
@@ -3003,10 +3003,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
let integral = 0;//积分
|
|
|
- length1.forEach(item => {
|
|
|
- integral += Number(item.integral)
|
|
|
- })
|
|
|
- if (Number(this.form.pointMutiple) > Number(integral)) return this.$message.error('积分余额不足')
|
|
|
+ if (length1) {
|
|
|
+ length1.forEach(item => {
|
|
|
+ integral += Number(item.integral)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (Number(this.form.pointMutiple) < Number(integral)) return this.$message.error('积分余额不足')
|
|
|
//商品信息
|
|
|
if (this.goodsActives == 'gift') {
|
|
|
this.form.orderItemsList = this.goodsShowData.concat(this.contactsData)
|