|
|
|
@ -6,6 +6,8 @@ import {ValidatorsService} from '../../../services/validators.service'; |
|
|
|
|
import {StoreDiscountActivityService} from '../../../services/store-discount-activity.service'; |
|
|
|
|
import {StoreService} from '../../../services/store.service'; |
|
|
|
|
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace'; |
|
|
|
|
import {MerService} from '../../../services/mer.service'; |
|
|
|
|
import {CommonsService} from '../../../services/commons.service'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-store-discount-activity-edit', |
|
|
|
@ -18,10 +20,14 @@ export class StoreDiscountActivityEditComponent implements OnInit { |
|
|
|
|
btnLoading = false; |
|
|
|
|
|
|
|
|
|
storeArray = []; |
|
|
|
|
merArray = []; |
|
|
|
|
discountActivityPartakeWayArray = []; |
|
|
|
|
|
|
|
|
|
constructor(private form: FormBuilder, |
|
|
|
|
private modal: NzModalService, |
|
|
|
|
private commonsService: CommonsService, |
|
|
|
|
private storeDiscountActivityService: StoreDiscountActivityService, |
|
|
|
|
private merService: MerService, |
|
|
|
|
private storeService: StoreService, |
|
|
|
|
private activatedRoute: ActivatedRoute, |
|
|
|
|
private router: Router) { } |
|
|
|
@ -29,7 +35,9 @@ export class StoreDiscountActivityEditComponent implements OnInit { |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.dataForm = this.form.group({ |
|
|
|
|
id: [null], |
|
|
|
|
storeId: [null, [Validators.required]], |
|
|
|
|
merId: [null, [Validators.required]], |
|
|
|
|
storeId: [null], |
|
|
|
|
partakeWay: ['1', [Validators.required]], |
|
|
|
|
name: [null, [Validators.required]], |
|
|
|
|
discountType: [1, [Validators.required]], |
|
|
|
|
discountCondition: [0, [Validators.required]], |
|
|
|
@ -38,6 +46,10 @@ export class StoreDiscountActivityEditComponent implements OnInit { |
|
|
|
|
endTime: [null, [Validators.required]], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.commonsService.getDictionary('DISCOUNT_ACTIVITY_PARTAKE_WAY', data => { |
|
|
|
|
this.discountActivityPartakeWayArray = data['return_data']; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.activatedRoute.queryParams.subscribe(queryParams => { |
|
|
|
|
if (queryParams['id'] != null) { |
|
|
|
|
this.storeDiscountActivityService.getActivityDetail(queryParams['id'], data => { |
|
|
|
@ -48,8 +60,8 @@ export class StoreDiscountActivityEditComponent implements OnInit { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.storeService.getStoreList({pageNum: 1, pageSize: 99999}, data => { |
|
|
|
|
this.storeArray = data['return_data']['list']; |
|
|
|
|
this.merService.getMerList({pageNum: 1, pageSize: 99999}, data => { |
|
|
|
|
this.merArray = data['return_data']['list']; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -83,4 +95,9 @@ export class StoreDiscountActivityEditComponent implements OnInit { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getStore(merId: number) { |
|
|
|
|
this.storeService.getStoreListByMer({ merId: merId, pageNum: 1, pageSize: 99999}, data => { |
|
|
|
|
this.storeArray = data['return_data']['list']; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|