提交代码

pull/1/head
胡锐 2 years ago
parent 2eb859db4d
commit c84d06741e
  1. 19
      src/app/admin/system/oils-discount/oils-discount.component.html
  2. 53
      src/app/admin/system/oils-discount/oils-discount.component.ts
  3. 6
      src/app/services/commons.service.ts
  4. 8
      src/environments/environment.ts

@ -31,6 +31,7 @@
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="showConfigOilMerNum()" ><i nz-icon nzType="plus" nzTheme="outline"></i>配置商户号</button>
<button nz-button nzType="primary" class="right-btn" (click)="getAdd()" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
</div>
<nz-table
@ -68,6 +69,7 @@
<nz-divider nzType="vertical"></nz-divider>
<a (click)='getForbiddenUser(data.id)'>删除</a>
</td>
</tr>
</tbody>
</nz-table>
</div>
@ -99,3 +101,20 @@
</div>
</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>

@ -3,8 +3,8 @@ import {environment} from '../../../../environments/environment';
import {CompanyService} from '../../../services/company.service';
import {IconService} from '../../../services/icon.service';
import {CommonsService} from '../../../services/commons.service';
import {FormBuilder, FormGroup} from '@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
@Component({
@ -25,8 +25,12 @@ export class OilsDiscountComponent implements OnInit {
isVisible = false;
roleTypeArray;
configOilMerNumModal = false;
configOilMerNumForm: FormGroup;
constructor(
private form: FormBuilder,
private modal: NzModalService,
private company: CompanyService,
private iconService: IconService,
private message: NzMessageService,
@ -50,6 +54,12 @@ export class OilsDiscountComponent implements OnInit {
oilNo: [null],
priceRate: [null],
});
this.configOilMerNumForm = this.form.group({
codeType: ['OIL_WX_MER'],
codeValue: [null, [Validators.required]],
});
this.getRequest(true, this.searchForm.value);
}
@ -118,5 +128,44 @@ export class OilsDiscountComponent implements OnInit {
this.isVisible = false;
}
showConfigOilMerNum() {
this.common.mappingSysNameOl('OIL_WX_MER', data => {
this.configOilMerNumForm.patchValue(data['return_data']);
});
this.configOilMerNumModal = true;
}
closeConfigOilMerNum() {
this.configOilMerNumModal = false;
}
submitConfigOilMerNum() {
for (const i in this.configOilMerNumForm.controls) {
this.configOilMerNumForm.controls[i].markAsDirty();
this.configOilMerNumForm.controls[i].updateValueAndValidity();
}
if (this.configOilMerNumForm.status == null || this.configOilMerNumForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有必填项',
});
return;
}
this.common.editConfig(this.configOilMerNumForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '操作成功',
});
this.closeConfigOilMerNum();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
}

@ -201,6 +201,12 @@ export class CommonsService {
});
}
public editConfig(param: object, callback): any {
this.http.post(environment.baseUrl + '/common/editConfig', param).subscribe( data => {
callback(data);
});
}
/**
*
*

@ -4,10 +4,10 @@
export const environment = {
production: false,
// baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'http://localhost:9302/filesystem/',
baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsg.dctpay.com/filesystem/',
baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'http://localhost:9302/filesystem/',
/* baseUrl: 'https://hsg.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsg.dctpay.com/filesystem/',*/
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
};

Loading…
Cancel
Save