|
|
@ -42,7 +42,7 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
agentName: null, |
|
|
|
agentName: null, |
|
|
|
prizeNum: null, |
|
|
|
prizeNum: null, |
|
|
|
prizeId: null, |
|
|
|
prizeId: null, |
|
|
|
discountName: null, |
|
|
|
prizeName: null, |
|
|
|
loading : false |
|
|
|
loading : false |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
FILE_URL = environment.imageUrl; |
|
|
|
FILE_URL = environment.imageUrl; |
|
|
@ -59,8 +59,6 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
private activatedRoute: ActivatedRoute, |
|
|
|
private activatedRoute: ActivatedRoute, |
|
|
|
private agent: AgentService, |
|
|
|
private agent: AgentService, |
|
|
|
private discount: DiscountService, |
|
|
|
|
|
|
|
private msg: NzMessageService, |
|
|
|
|
|
|
|
) { } |
|
|
|
) { } |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
@ -81,7 +79,6 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
this.validateFormAward = this.fb.group({ |
|
|
|
this.validateFormAward = this.fb.group({ |
|
|
|
name: [null, [Validators.required]], |
|
|
|
name: [null, [Validators.required]], |
|
|
|
img: [null, [Validators.required]], |
|
|
|
|
|
|
|
num: [null, [Validators.required]], |
|
|
|
num: [null, [Validators.required]], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -134,7 +131,7 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getDiscountName(id: number , i ) { |
|
|
|
getDiscountName(id: number , i ) { |
|
|
|
this.listOfControl[i].discountName = this.discountList.find(item => { |
|
|
|
this.listOfControl[i].prizeName = this.discountList.find(item => { |
|
|
|
return item['highDiscount'].id == id; |
|
|
|
return item['highDiscount'].id == id; |
|
|
|
})['highDiscount'].discountName; |
|
|
|
})['highDiscount'].discountName; |
|
|
|
console.log(this.listOfControl); |
|
|
|
console.log(this.listOfControl); |
|
|
@ -255,7 +252,7 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
agentName: null, |
|
|
|
agentName: null, |
|
|
|
prizeNum: null, |
|
|
|
prizeNum: null, |
|
|
|
prizeId: null, |
|
|
|
prizeId: null, |
|
|
|
discountName: null, |
|
|
|
prizeName: null, |
|
|
|
loading : false |
|
|
|
loading : false |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.listOfControl.push(control); |
|
|
|
this.listOfControl.push(control); |
|
|
@ -299,13 +296,24 @@ export class ActivateEditComponent implements OnInit { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.validateForm.value.ruleArray = [{ |
|
|
|
this.validateFormAward.value.activityPrizes = this.listOfControl; |
|
|
|
partakeMode: 1, |
|
|
|
this.validateFormAward.value.activityInfoId = 7; |
|
|
|
productType: 1 , |
|
|
|
if (this.logoFile.length !== 0) { |
|
|
|
productIdArray: this.validateForm.value.productIdArray |
|
|
|
if (this.logoFile[0]['response'] != null) { |
|
|
|
}]; |
|
|
|
this.validateFormAward.value.img = this.logoFile[0]['response']['return_data'][0]; |
|
|
|
|
|
|
|
} else { |
|
|
|
console.log(this.listOfControl); |
|
|
|
this.validateFormAward.value.img = this.logoFile[0].name; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log(this.validateFormAward.value); |
|
|
|
|
|
|
|
this.activate.editActivityAward(this.validateFormAward.value , data => { |
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
|
|
|
this.message.success('编辑成功'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.create('error', '编辑失败'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|