|
|
|
@ -28,6 +28,7 @@ export class DiscountEditComponent implements OnInit { |
|
|
|
|
editFlag = false; |
|
|
|
|
id: number; |
|
|
|
|
discountImg = []; |
|
|
|
|
usingRange = []; |
|
|
|
|
WEB_SERVE_URL = environment.baseUrl; |
|
|
|
|
previewImage: string | undefined = ''; |
|
|
|
|
previewVisible = false; |
|
|
|
@ -36,6 +37,7 @@ export class DiscountEditComponent implements OnInit { |
|
|
|
|
private fb: FormBuilder, |
|
|
|
|
private discount: DiscountService, |
|
|
|
|
private common: CommonsService, |
|
|
|
|
private commonsService: CommonsService, |
|
|
|
|
private message: NzMessageService, // 信息提示
|
|
|
|
|
private activatedRoute: ActivatedRoute, |
|
|
|
|
) { |
|
|
|
@ -55,11 +57,16 @@ export class DiscountEditComponent implements OnInit { |
|
|
|
|
discountType: [null, [Validators.required]], |
|
|
|
|
discountPrice: [null, [Validators.required]], |
|
|
|
|
salesEndTime: [null, [Validators.required]], |
|
|
|
|
usingRange: [null, [Validators.required]], |
|
|
|
|
effectiveDay: [1, [Validators.required]], |
|
|
|
|
status: [null], |
|
|
|
|
createTime: [null], |
|
|
|
|
secUser: {}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.commonsService.getDictionary('USING_RANGE', data => { |
|
|
|
|
this.usingRange = data['return_data']; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -93,9 +100,10 @@ export class DiscountEditComponent implements OnInit { |
|
|
|
|
this.validateForm.value.discountImg = this.discountImg[0].name; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.message.error('请上传卡券图片'); |
|
|
|
|
return; |
|
|
|
|
// this.message.error('请上传卡券图片');
|
|
|
|
|
// return;
|
|
|
|
|
} |
|
|
|
|
this.validateForm.value.discountImg = 'img'; |
|
|
|
|
|
|
|
|
|
if (this.editFlag) { |
|
|
|
|
this.common.showConfirm('是否确定修改,确定将下架', dataR => { |
|
|
|
|