From 37d10e0e7acafb50c7d4bd3a8fedd515faf5b155 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Fri, 15 Sep 2023 15:51:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=9A=E6=A0=B9=E6=8D=AE=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=88=97=E8=A1=A8=EF=BC=8C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?name=E6=94=B9=E4=B8=BAtitle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/admin/goods/list/list.component.html | 2 +- src/app/admin/goods/list/list.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/admin/goods/list/list.component.html b/src/app/admin/goods/list/list.component.html index 58eaacd..486c7a7 100644 --- a/src/app/admin/goods/list/list.component.html +++ b/src/app/admin/goods/list/list.component.html @@ -10,7 +10,7 @@ 商品名称 - + diff --git a/src/app/admin/goods/list/list.component.ts b/src/app/admin/goods/list/list.component.ts index adb2072..06f5506 100644 --- a/src/app/admin/goods/list/list.component.ts +++ b/src/app/admin/goods/list/list.component.ts @@ -110,7 +110,7 @@ export class ListComponent implements OnInit { // 初始化搜索表单 this.searchForm = this.form.group({ - name: [null], + title: [null], status: [null], goodsLabel: [null], }); From 16e91c481cd872cb8c13de6a7658259737b24a60 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Thu, 21 Sep 2023 13:36:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=90=86=E5=95=86=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=9A=E5=88=97=E8=A1=A8=E6=93=8D=E4=BD=9C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A01=EF=BC=9A=E5=88=86=E5=8F=91=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=8C=85=E3=80=822=EF=BC=9A=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E5=8C=85=E5=88=86=E5=8F=91=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent-list/agent-list.component.html | 85 +++++++++++++++ .../agent/agent-list/agent-list.component.ts | 102 ++++++++++++++++++ src/app/services/agent.service.ts | 34 ++++++ 3 files changed, 221 insertions(+) diff --git a/src/app/admin/agent/agent-list/agent-list.component.html b/src/app/admin/agent/agent-list/agent-list.component.html index 47bc361..639c67b 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.html +++ b/src/app/admin/agent/agent-list/agent-list.component.html @@ -109,9 +109,11 @@ 分发卡券 + 分发优惠券包 生成二维码 绑定优惠券 优惠券列表 + 优惠券包分发列表 优惠券使用 分发列表 {{data.status === 1 ? '禁用': '启用'}} @@ -231,6 +233,29 @@ + + + + + 优惠券包 + + + + + + + + 数量 + + + + + + + + + + + + + + + 优惠券包名称 + + 代理商名称 + 库存数量 + 销售数量 + 分发时间 + 操作 + + + + + + {{data.discountPackageTitle}} + {{data.agentName}} + {{data.stockCount}} + {{data.salesCount}} + {{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}} + + 分发历史 + + + + + + + + + + + + + + 优惠券包名称 + 代理商名称 + 分发数量 + 分发前数量 + 分发后数量 + 分发时间 + + + + + {{data.discountPackageTitle}} + {{data.agentName}} + {{data.frontCount}} + {{data.frontCount}} + {{data.afterCount}} + {{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}} + + + + + + + diff --git a/src/app/admin/agent/agent-list/agent-list.component.ts b/src/app/admin/agent/agent-list/agent-list.component.ts index 004e658..f250d3e 100644 --- a/src/app/admin/agent/agent-list/agent-list.component.ts +++ b/src/app/admin/agent/agent-list/agent-list.component.ts @@ -23,10 +23,15 @@ export class AgentListComponent implements OnInit { searchForm: FormGroup; // 搜索框 validateForm: FormGroup; // 搜索框 validateFormDistribute: FormGroup; // 搜索框 + validateFormDiscountPackage:FormGroup;//搜索框 + requestData = []; // 列表数据 discountList = []; // 列表数据 couponList = []; // 列表数据 distributeList = []; // 列表数据 + discountPackageList=[];//优惠券包列表 + distributeCouponsList=[];//优惠券包分发列表 + packageAgentRecordList=[];//优惠券包分发记录列表 total: number; // 页码 pageNum = 1; // 页码 pageSize = 10; // 条码 @@ -34,10 +39,14 @@ export class AgentListComponent implements OnInit { isVisible = false; isVisibleDiscount = false; isVisibleDistribute = false; + isVisibleDistributeCoupons=false; + isVisibleDistributeCouponsList=false; + isVisibleAgentRecordList=false; isVisibleList = false; id: number; isSpinning = false; isSpinningDistribute = false; + isSpinningDistributeCoupons=false; requestDataDiscount = []; // 列表数据 totalDiscount: number; // 页码 pageNumDiscount = 1; // 页码 @@ -49,7 +58,9 @@ export class AgentListComponent implements OnInit { pageNumList = 1; // 页码 pageSizeList = 10; // 条码 loadingList = true; + loadingCouponsList=false; isOkLoading = false; + isOkCouponsLoading=false; isVisibleShow = false; dataSet; constructor( @@ -86,6 +97,12 @@ export class AgentListComponent implements OnInit { type: [null, [Validators.required]], stockCount: [null, [Validators.required]], }); + + this.validateFormDiscountPackage=this.form.group({ + discountPackageId:[null,[Validators.required]], + num:[null, [Validators.required,Validators.min(1)]] + }) + this.getRequest(true, this.searchForm.value); this.coupon.getCouponListByAll({} , data => { @@ -341,6 +358,91 @@ export class AgentListComponent implements OnInit { }); } + // 获取优惠券包列表 + public getDistributeCoupons(id: number): void{ + this.validateFormDiscountPackage.reset(); + this.isSpinningDistributeCoupons = true; + this.agentId = id; + const whereObject = {}; + whereObject['pageNum'] = 1; + whereObject['pageSize'] = 10000; + whereObject['status']=1; + this.agent.getDiscountPackageList(whereObject,(data)=>{ + if (data['return_code'] === '000000') { + this.discountPackageList = data['return_data'].list; + } else { + this.message.error(data['return_msg']); + } + this.isSpinningDistributeCoupons=false; + }) + this.isVisibleDistributeCoupons=true; + } + + //分发优惠券包 确定 + public addDisCoupon(): void{ + for (const i in this.validateFormDiscountPackage.controls) { + this.validateFormDiscountPackage.controls[i].markAsDirty(); + this.validateFormDiscountPackage.controls[i].updateValueAndValidity(); + if (this.validateFormDiscountPackage.controls[i].errors != null) { + this.message.error('必填项不能为空'); + return; + } + } + this.isOkCouponsLoading=true; + this.validateFormDiscountPackage.value['agentId'] = this.agentId; + this.agent.distribute(this.validateFormDiscountPackage.value,(data)=>{ + this.isOkCouponsLoading=false; + if (data['return_code'] === '000000') { + this.validateFormDiscountPackage.reset(); + this.message.success('分发成功'); + this.isVisibleDistributeCoupons = false; + } else { + this.message.error(data['return_msg']); + } + + }) + + } + + + // 优惠券包分发列表 + public getDistributeCouponsList(id:number):void{ + this.agentId = id; + this.isVisibleDistributeCouponsList=true; + this.loadingCouponsList=true; + this.distributeCouponsList=[]; + this.agent.getDiscountPackageAgentRelList(this.agentId,(data)=>{ + this.loadingCouponsList=false; + if (data['return_code'] === '000000') { + this.distributeCouponsList = data['return_data']; + + } else { + this.message.error(data['return_msg']); + } + }) + + } + + // 获取优惠券包代理商分发记录列表 + public getRecordList(discountPackageId:number):void{ + + const params={}; + params["discountPackageId"]=discountPackageId; + params["agentId"]=this.agentId; + + this.isVisibleAgentRecordList=true; + this.packageAgentRecordList=[]; + this.agent.getDiscountPackageAgentRecord(params,(data)=>{ + if (data['return_code'] === '000000') { + this.packageAgentRecordList = data['return_data']; + + } else { + this.message.error(data['return_msg']); + } + }) + } + + public getList(id: number): void { const whereObject = {}; whereObject['pageNum'] = 1; diff --git a/src/app/services/agent.service.ts b/src/app/services/agent.service.ts index a904939..f1cf4f1 100644 --- a/src/app/services/agent.service.ts +++ b/src/app/services/agent.service.ts @@ -191,4 +191,38 @@ export class AgentService { callBack(data); }); } + + + /* + 分发优惠券 + */ + public distribute(params: object, callBack) { + this.http.post(environment.baseUrl + 'discountPackageAgent/distribute', params).subscribe(data => { + callBack(data); + }); + + } + + /* + 获取优惠券包列表 + */ + public getDiscountPackageList(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'highDiscountPackage/getDiscountPackageList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } + + /* 获取优惠券包代理商关联列表 */ + public getDiscountPackageAgentRelList(agentId: number, callBack) { + this.http.get(environment.baseUrl + 'discountPackageAgent/getDiscountPackageAgentRelList?agentId=' + agentId).subscribe(data => { + callBack(data); + }); + } + + /* 获取优惠券包代理商分发记录列表 */ + public getDiscountPackageAgentRecord(paramsObject: object, callBack) { + this.http.get(environment.baseUrl + 'discountPackageAgent/getDiscountPackageAgentRecord?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { + callBack(data); + }); + } }