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