提交代码

ymt-dev
胡锐 11 months ago
parent 0458abc38f
commit 9f0c1a4304
  1. 39
      src/app/admin/system/oils-discount/oils-discount.component.html
  2. 35
      src/app/admin/system/oils-discount/oils-discount.component.ts

@ -32,6 +32,7 @@
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="showTripartitePlatformModal()" >渠道支付配置</button>
<button nz-button nzType="primary" class="right-btn" (click)="showConfigOilCard()" >油卡充值配置</button>
<button nz-button nzType="primary" class="right-btn" (click)="getAdd()" >添加油品优惠</button>
</div>
<nz-table
@ -181,20 +182,24 @@
</form>
</nz-modal>
<!--
<nz-modal [(nzVisible)]="configOilMerNumModal" nzTitle="配置商户号" (nzOnCancel)="closeConfigOilMerNum()" (nzOnOk)="submitConfigOilMerNum()">
<form nz-form [formGroup]="configOilMerNumForm">
<div nz-row>
<div nz-col [nzSpan]="22">
<nz-form-item>
<nz-form-label nzRequired>商户号</nz-form-label>
<nz-form-control>
<nz-input-group>
<input nz-input formControlName="codeValue" [placeholder]="'加油站订单入账商户号'" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
</nz-modal>-->
<nz-modal [(nzVisible)]="configOilCardRechargeModal" nzTitle="油卡充值配置" (nzOnCancel)="closeConfigOilCard()" (nzOnOk)="submitConfigOilCard()"
[nzBodyStyle]="{ padding: '0px 20px 0px'}" >
<nz-tabset>
<nz-tab nzTitle="充值赠送比例">
<form nz-form [formGroup]="configOilCardRechargeForm">
<div nz-row>
<div nz-col [nzSpan]="22">
<nz-form-item>
<nz-form-label nzRequired>赠送比例</nz-form-label>
<nz-form-control>
<nz-input-group nzAddOnAfter="%">
<nz-input-number [nzPrecision]="2" [nzMax]="500" [nzMin]="0" formControlName="codeValue"></nz-input-number>
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
</div>
</form>
</nz-tab>
</nz-tabset>
</nz-modal>

@ -27,8 +27,8 @@ export class OilsDiscountComponent implements OnInit {
roleTypeArray;
gasChannelConfigChannelArray = [];
configOilMerNumModal = false;
configOilMerNumForm: FormGroup;
configOilCardRechargeModal = false;
configOilCardRechargeForm: FormGroup;
channelId = '1';
tripartitePlatformModal = false;
@ -66,8 +66,8 @@ export class OilsDiscountComponent implements OnInit {
priceRate: [null],
});
this.configOilMerNumForm = this.form.group({
codeType: ['OIL_WX_MER'],
this.configOilCardRechargeForm = this.form.group({
codeType: ['OIL_CARD_RECHARGE_RATIO'],
codeValue: [null, [Validators.required]],
});
@ -149,23 +149,23 @@ export class OilsDiscountComponent implements OnInit {
this.isVisible = false;
}
showConfigOilMerNum() {
this.common.mappingSysNameOl('OIL_WX_MER', data => {
this.configOilMerNumForm.patchValue(data['return_data']);
showConfigOilCard() {
this.common.mappingSysNameOl('OIL_CARD_RECHARGE_RATIO', data => {
this.configOilCardRechargeForm.patchValue(data['return_data']);
});
this.configOilMerNumModal = true;
this.configOilCardRechargeModal = true;
}
closeConfigOilMerNum() {
this.configOilMerNumModal = false;
closeConfigOilCard() {
this.configOilCardRechargeModal = false;
}
submitConfigOilMerNum() {
for (const i in this.configOilMerNumForm.controls) {
this.configOilMerNumForm.controls[i].markAsDirty();
this.configOilMerNumForm.controls[i].updateValueAndValidity();
submitConfigOilCard() {
for (const i in this.configOilCardRechargeForm.controls) {
this.configOilCardRechargeForm.controls[i].markAsDirty();
this.configOilCardRechargeForm.controls[i].updateValueAndValidity();
}
if (this.configOilMerNumForm.status == null || this.configOilMerNumForm.status !== 'VALID') {
if (this.configOilCardRechargeForm.status == null || this.configOilCardRechargeForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有必填项',
@ -173,13 +173,13 @@ export class OilsDiscountComponent implements OnInit {
return;
}
this.common.editConfig(this.configOilMerNumForm.value, data => {
this.common.editConfig(this.configOilCardRechargeForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功',
});
this.closeConfigOilMerNum();
this.closeConfigOilCard();
} else {
this.modal.error({
nzTitle: '提示',
@ -189,6 +189,7 @@ export class OilsDiscountComponent implements OnInit {
});
}
// 打开配置第三方模态框
showTripartitePlatformModal () {
this.selectChannel(this.channelId);

Loading…
Cancel
Save