提交修改

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

@ -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;
});
}

@ -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);

@ -36,12 +36,22 @@
<nz-form-item>
<nz-form-label [nzFor]="'usingScope'" nzRequired>优惠券使用范围</nz-form-label>
<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-select>
</nz-form-control>
</nz-form-item>
</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'">
<nz-form-item>
<nz-form-label [nzFor]="'discountCondition'" nzRequired>满减条件价格</nz-form-label>

@ -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 => {

Loading…
Cancel
Save