From 0659d5a62dfdcc9418e16f398843c7a93a1c33b4 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Tue, 7 Dec 2021 20:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../discount-package-edit.component.html | 12 +++++------ .../discount-package-edit.component.ts | 21 +++++++++++++------ .../discount-package-list.component.ts | 6 +++--- .../discount-edit.component.html | 12 ++++++++++- .../discount-edit/discount-edit.component.ts | 12 +++++++---- 5 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.html b/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.html index 24cfef6..a1b4812 100644 --- a/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.html +++ b/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.html @@ -175,18 +175,18 @@
基本信息
- 优惠券范围 - - - + 代理商 + + + 优惠券 - - + + diff --git a/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.ts b/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.ts index a300ad1..cbf6f5d 100644 --- a/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.ts +++ b/src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.ts @@ -41,7 +41,7 @@ export class DiscountPackageEditComponent implements OnInit { previewImage: string | undefined = ''; previewVisible = false; discountList = []; // 列表数据 - usingScope = []; // 列表数据 + agentData = []; // 列表数据 listImg = []; bannerImg = []; detailsImg = []; @@ -63,8 +63,17 @@ export class DiscountPackageEditComponent implements OnInit { this.commonsService.getDictionary('USING_ATTRIBUTION', data => { this.usingAttribution = data['return_data']; }); - this.commonsService.getDictionary('USING_RANGE', data => { - this.usingScope = data['return_data']; + const whereObject = { + pageNum: 1 , + pageSize: 800 , + type: 1 + }; + this.agent.getListAgent(whereObject, data => { + if (data['return_code'] === '000000') { + this.agentData = data['return_data'].list; + } else { + this.message.error(data['return_msg']); + } }); this.activatedRoute.queryParams.subscribe(queryParams => { if (queryParams.id != null) { @@ -84,7 +93,7 @@ export class DiscountPackageEditComponent implements OnInit { this.validateFormAward = this.fb.group({ discountId: [null, [Validators.required]], num: [null, [Validators.required]], - usingScope: [null, [Validators.required]], + agentId: [null, [Validators.required]], }); } @@ -329,10 +338,10 @@ export class DiscountPackageEditComponent implements OnInit { const params = { pageNum: 1, pageSize: 10000, - useScope: e + agentId: e }; - this.discount.getDiscountList(params , data => { + this.agent.getDiscountAgentList(params , data => { this.discountList = data['return_data'].list; }); } diff --git a/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts b/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts index ab5c9d2..1e5c09a 100644 --- a/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts +++ b/src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts @@ -83,7 +83,7 @@ export class DiscountPackageListComponent implements OnInit { // 活动开始 public upDiscountPackage(id: number): void { - this.discountPackage.upDiscountPackage({discountId : id}, data => { + this.discountPackage.upDiscountPackage({discountPackageId : id}, data => { if (data['return_code'] === '000000') { this.message.success('上架成功'); this.getRequest(true, this.searchForm.value); @@ -95,7 +95,7 @@ export class DiscountPackageListComponent implements OnInit { // 活动结束 public downDiscountPackage(id: number): void { - this.discountPackage.downDiscountPackage({discountId : id}, data => { + this.discountPackage.downDiscountPackage({discountPackageId : id}, data => { if (data['return_code'] === '000000') { this.message.success('下架成功'); this.getRequest(true, this.searchForm.value); @@ -109,7 +109,7 @@ export class DiscountPackageListComponent implements OnInit { public deleteDiscountPackage(id: number): void { this.commonsService.showConfirm('是否确认删除', isDelete => { if (isDelete) { - this.discountPackage.deleteDiscountPackage({discountId : id}, data => { + this.discountPackage.deleteDiscountPackage({discountPackageId : id}, data => { if (data['return_code'] === '000000') { this.message.success('删除成功'); this.getRequest(true, this.searchForm.value); diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.html b/src/app/admin/discount/discount-edit/discount-edit.component.html index 6e815c1..dd26c7c 100644 --- a/src/app/admin/discount/discount-edit/discount-edit.component.html +++ b/src/app/admin/discount/discount-edit/discount-edit.component.html @@ -36,12 +36,22 @@ 优惠券使用范围 - + +
+ + 优惠券使用归属 + + + + + + +
满减条件价格 diff --git a/src/app/admin/discount/discount-edit/discount-edit.component.ts b/src/app/admin/discount/discount-edit/discount-edit.component.ts index d3dc50e..8a8d5d6 100644 --- a/src/app/admin/discount/discount-edit/discount-edit.component.ts +++ b/src/app/admin/discount/discount-edit/discount-edit.component.ts @@ -58,9 +58,10 @@ export class DiscountEditComponent implements OnInit { discountType: [null, [Validators.required]], discountPrice: [null, [Validators.required]], salesEndTime: [null, [Validators.required]], - usingScope: [null, [Validators.required]], + useScope: [null, [Validators.required]], effectiveDay: [1, [Validators.required]], status: [null], + usingRange: [null], createTime: [null], secUser: {}, }); @@ -68,6 +69,10 @@ export class DiscountEditComponent implements OnInit { this.commonsService.getDictionary('USING_RANGE', data => { this.usingScope = data['return_data']; }); + + this.commonsService.getDictionary('USING_ATTRIBUTION', data => { + this.usingRange = data['return_data']; + }); } @@ -101,10 +106,9 @@ 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 => {