提交修改

pull/1/head
袁野 3 years ago
parent d3ebf33fae
commit 0659d5a62d
  1. 12
      src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.html
  2. 21
      src/app/admin/discount-package/discount-package-edit/discount-package-edit.component.ts
  3. 6
      src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts
  4. 12
      src/app/admin/discount/discount-edit/discount-edit.component.html
  5. 12
      src/app/admin/discount/discount-edit/discount-edit.component.ts

@ -175,18 +175,18 @@
<div class="title">基本信息</div> <div class="title">基本信息</div>
<form nz-form [formGroup]="validateFormAward" class="login-form"> <form nz-form [formGroup]="validateFormAward" class="login-form">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>优惠券范围</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>代理商</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券范围"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择代理商">
<nz-select formControlName="usingScope" (ngModelChange)="getDiscountPackageByList($event)" nzAllowClear nzPlaceHolder="请选择优惠券使用范围"> <nz-select nzShowSearch nzAllowClear formControlName="agentId" (ngModelChange)="getDiscountPackageByList($event)" nzPlaceHolder="请选择代理商">
<nz-option *ngFor="let item of usingScope" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> <nz-option *ngFor="let item of agentData" nzLabel="{{item.agentName}}" nzValue="{{item.id}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>优惠券</nz-form-label> <nz-form-label [nzSpan]="6" nzRequired>优惠券</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券">
<nz-select formControlName="discountId" (ngModelChange)="getDiscountPackageByList($event)" nzAllowClear nzPlaceHolder="请选择优惠券"> <nz-select formControlName="discountId" nzAllowClear nzPlaceHolder="请选择优惠券">
<nz-option *ngFor="let item of discountList" nzValue="{{item.id}}" nzLabel="{{item.discountName}}"></nz-option> <nz-option *ngFor="let item of discountList" nzLabel="{{item['highDiscount'].discountName}}" nzValue="{{item['highDiscount'].id}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

@ -41,7 +41,7 @@ export class DiscountPackageEditComponent implements OnInit {
previewImage: string | undefined = ''; previewImage: string | undefined = '';
previewVisible = false; previewVisible = false;
discountList = []; // 列表数据 discountList = []; // 列表数据
usingScope = []; // 列表数据 agentData = []; // 列表数据
listImg = []; listImg = [];
bannerImg = []; bannerImg = [];
detailsImg = []; detailsImg = [];
@ -63,8 +63,17 @@ export class DiscountPackageEditComponent implements OnInit {
this.commonsService.getDictionary('USING_ATTRIBUTION', data => { this.commonsService.getDictionary('USING_ATTRIBUTION', data => {
this.usingAttribution = data['return_data']; this.usingAttribution = data['return_data'];
}); });
this.commonsService.getDictionary('USING_RANGE', data => { const whereObject = {
this.usingScope = data['return_data']; 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 => { this.activatedRoute.queryParams.subscribe(queryParams => {
if (queryParams.id != null) { if (queryParams.id != null) {
@ -84,7 +93,7 @@ export class DiscountPackageEditComponent implements OnInit {
this.validateFormAward = this.fb.group({ this.validateFormAward = this.fb.group({
discountId: [null, [Validators.required]], discountId: [null, [Validators.required]],
num: [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 = { const params = {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
useScope: e agentId: e
}; };
this.discount.getDiscountList(params , data => { this.agent.getDiscountAgentList(params , data => {
this.discountList = data['return_data'].list; this.discountList = data['return_data'].list;
}); });
} }

@ -83,7 +83,7 @@ export class DiscountPackageListComponent implements OnInit {
// 活动开始 // 活动开始
public upDiscountPackage(id: number): void { public upDiscountPackage(id: number): void {
this.discountPackage.upDiscountPackage({discountId : id}, data => { this.discountPackage.upDiscountPackage({discountPackageId : id}, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.success('上架成功'); this.message.success('上架成功');
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
@ -95,7 +95,7 @@ export class DiscountPackageListComponent implements OnInit {
// 活动结束 // 活动结束
public downDiscountPackage(id: number): void { public downDiscountPackage(id: number): void {
this.discountPackage.downDiscountPackage({discountId : id}, data => { this.discountPackage.downDiscountPackage({discountPackageId : id}, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.success('下架成功'); this.message.success('下架成功');
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
@ -109,7 +109,7 @@ export class DiscountPackageListComponent implements OnInit {
public deleteDiscountPackage(id: number): void { public deleteDiscountPackage(id: number): void {
this.commonsService.showConfirm('是否确认删除', isDelete => { this.commonsService.showConfirm('是否确认删除', isDelete => {
if (isDelete) { if (isDelete) {
this.discountPackage.deleteDiscountPackage({discountId : id}, data => { this.discountPackage.deleteDiscountPackage({discountPackageId : id}, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.message.success('删除成功'); this.message.success('删除成功');
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);

@ -36,12 +36,22 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzFor]="'usingScope'" nzRequired>优惠券使用范围</nz-form-label> <nz-form-label [nzFor]="'usingScope'" nzRequired>优惠券使用范围</nz-form-label>
<nz-form-control nzErrorTip="请选择优惠券使用范围!"> <nz-form-control nzErrorTip="请选择优惠券使用范围!">
<nz-select formControlName="usingScope" nzAllowClear nzPlaceHolder="请选择优惠券使用范围"> <nz-select formControlName="useScope" nzAllowClear nzPlaceHolder="请选择优惠券使用范围">
<nz-option *ngFor="let item of usingScope" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option> <nz-option *ngFor="let item of usingScope" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label [nzFor]="'usingRange'" >优惠券使用归属</nz-form-label>
<nz-form-control nzErrorTip="请选择优惠券使用范围!">
<nz-select formControlName="usingRange" nzAllowClear nzPlaceHolder="请选择优惠券使用范围">
<nz-option *ngFor="let item of usingRange" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8" *ngIf="validateForm.value.discountType === '1'"> <div nz-col [nzSpan]="8" *ngIf="validateForm.value.discountType === '1'">
<nz-form-item> <nz-form-item>
<nz-form-label [nzFor]="'discountCondition'" nzRequired>满减条件价格</nz-form-label> <nz-form-label [nzFor]="'discountCondition'" nzRequired>满减条件价格</nz-form-label>

@ -58,9 +58,10 @@ 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]],
usingScope: [null, [Validators.required]], useScope: [null, [Validators.required]],
effectiveDay: [1, [Validators.required]], effectiveDay: [1, [Validators.required]],
status: [null], status: [null],
usingRange: [null],
createTime: [null], createTime: [null],
secUser: {}, secUser: {},
}); });
@ -68,6 +69,10 @@ export class DiscountEditComponent implements OnInit {
this.commonsService.getDictionary('USING_RANGE', data => { this.commonsService.getDictionary('USING_RANGE', data => {
this.usingScope = data['return_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; 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 => {

Loading…
Cancel
Save