修改优惠券绑定个问题

pull/1/head
袁野 4 years ago
parent 61d7d2f9b5
commit ecedf9c217
  1. 39
      src/app/admin/agent/agent-list/agent-list.component.html
  2. 5
      src/app/admin/agent/agent-list/agent-list.component.ts
  3. 2
      src/app/admin/discount/discount-edit/discount-edit.component.html
  4. 2
      src/app/admin/merchant/merchant-edit/merchant-edit.component.ts

@ -101,22 +101,25 @@
</div> </div>
<nz-modal [(nzVisible)]="isVisible" nzTitle="分配优惠券" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> <nz-modal [(nzVisible)]="isVisible" nzTitle="分配优惠券" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [formGroup]="validateForm" class="login-form"> <nz-spin [nzSpinning]="isSpinning">
<nz-form-item> <form nz-form [formGroup]="validateForm" class="login-form">
<nz-form-label [nzSpan]="6" nzRequired>优惠券</nz-form-label> <nz-form-item>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券!"> <nz-form-label [nzSpan]="6" nzRequired>优惠券</nz-form-label>
<nz-select nzShowSearch nzAllowClear formControlName="discountId" nzPlaceHolder="请选择优惠券"> <nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券!">
<nz-option *ngFor="let item of discountList" nzLabel="{{item.discountName}}" nzValue="{{item.id}}"></nz-option> <nz-select nzShowSearch nzAllowClear formControlName="discountId" nzPlaceHolder="请选择优惠券">
</nz-select> <nz-option *ngFor="let item of discountList" nzLabel="{{item.discountName}}" nzValue="{{item.id}}"></nz-option>
</nz-form-control> </nz-select>
</nz-form-item> </nz-form-control>
<nz-form-item> </nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>分配优惠券数量</nz-form-label> <nz-form-item>
<nz-form-control [nzSpan]="16" nzErrorTip="分配优惠券数量!"> <nz-form-label [nzSpan]="6" nzRequired>分配优惠券数量</nz-form-label>
<input [type]="'number'" nz-input formControlName="stockCount"/> <nz-form-control [nzSpan]="16" nzErrorTip="分配优惠券数量!">
</nz-form-control> <input [type]="'number'" nz-input formControlName="stockCount"/>
</nz-form-item> </nz-form-control>
</form> </nz-form-item>
</form>
</nz-spin>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleDiscount" nzWidth="1000" nzTitle="分配优惠券列表" (nzOnCancel)="handleCancelDiscount()" (nzOnOk)="handleCancelDiscount()"> <nz-modal [(nzVisible)]="isVisibleDiscount" nzWidth="1000" nzTitle="分配优惠券列表" (nzOnCancel)="handleCancelDiscount()" (nzOnOk)="handleCancelDiscount()">
@ -142,7 +145,6 @@
<th nzWidth="70px">有效天数</th> <th nzWidth="70px">有效天数</th>
<th nzWidth="100px">截止日期</th> <th nzWidth="100px">截止日期</th>
<th nzWidth="100px">库存数量</th> <th nzWidth="100px">库存数量</th>
<th nzRight nzWidth="100px">二维码</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -164,9 +166,6 @@
<td>{{data['highDiscount'].effectiveDay}}</td> <td>{{data['highDiscount'].effectiveDay}}</td>
<td>{{data['highDiscount'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td> <td>{{data['highDiscount'].salesEndTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>{{data.stockCount}}</td> <td>{{data.stockCount}}</td>
<td nzRight>
<img class="head_img" src="{{WEB_SERVE_URL + 'agentQrCode/' + data.qrCode}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt="">
</td>
</tbody> </tbody>
</nz-table> </nz-table>
</nz-modal> </nz-modal>

@ -28,7 +28,7 @@ export class AgentListComponent implements OnInit {
isVisible = false; isVisible = false;
isVisibleDiscount = false; isVisibleDiscount = false;
id: number; id: number;
isSpinning = false;
requestDataDiscount = []; // 列表数据 requestDataDiscount = []; // 列表数据
totalDiscount: number; // 页码 totalDiscount: number; // 页码
pageNumDiscount = 1; // 页码 pageNumDiscount = 1; // 页码
@ -143,14 +143,15 @@ export class AgentListComponent implements OnInit {
return; return;
} }
} }
this.isSpinning = true;
this.validateForm.value['agentId'] = this.id; this.validateForm.value['agentId'] = this.id;
this.agent.insertDiscountAgent(this.validateForm.value , data => { this.agent.insertDiscountAgent(this.validateForm.value , data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
console.log(data);
this.isVisible = false; this.isVisible = false;
} else { } else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
} }
this.isSpinning = false;
}); });
} }

@ -67,7 +67,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzFor]="'effectiveDay'" nzRequired>领取有效天数</nz-form-label> <nz-form-label [nzFor]="'effectiveDay'" nzRequired>领取有效天数</nz-form-label>
<nz-form-control nzErrorTip="请输入领取有效天数!"> <nz-form-control nzErrorTip="请输入领取有效天数!">
<nz-input-number [formControlName]="'effectiveDay'" [nzMin]="1" [nzMax]="100" [nzStep]="1"></nz-input-number> <nz-input-number [formControlName]="'effectiveDay'" [nzMin]="1" [nzStep]="1"></nz-input-number>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>

@ -51,7 +51,7 @@ export class MerchantEditComponent implements OnInit {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
loginTelephone: [null, [Validators.required, ValidatorsService.mobile]], loginTelephone: [null, [Validators.required, ValidatorsService.mobile]],
password: [null, [Validators.required, ValidatorsService.minLength(6)]], password: [null, [Validators.required, ValidatorsService.minLength(6)]],
merchantName: [null, [Validators.required, ValidatorsService.pwdLength(2, 5)]], merchantName: [null, [Validators.required]],
telephone: [null, [Validators.required]], telephone: [null, [Validators.required]],
address: [null, [Validators.required]], address: [null, [Validators.required]],
bankName: [null], bankName: [null],

Loading…
Cancel
Save