From c84d06741e4d35e6b1e8b7200dcccb892798b0bb Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 15 Jun 2022 14:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oils-discount.component.html | 19 +++++++ .../oils-discount/oils-discount.component.ts | 53 ++++++++++++++++++- src/app/services/commons.service.ts | 6 +++ src/environments/environment.ts | 8 +-- 4 files changed, 80 insertions(+), 6 deletions(-) diff --git a/src/app/admin/system/oils-discount/oils-discount.component.html b/src/app/admin/system/oils-discount/oils-discount.component.html index ee2e6f6..aaa052a 100644 --- a/src/app/admin/system/oils-discount/oils-discount.component.html +++ b/src/app/admin/system/oils-discount/oils-discount.component.html @@ -31,6 +31,7 @@
共计 {{total}} 条数据
+
删除 +
@@ -99,3 +101,20 @@ + + +
+
+
+ + 商户号 + + + + + + +
+
+
+
diff --git a/src/app/admin/system/oils-discount/oils-discount.component.ts b/src/app/admin/system/oils-discount/oils-discount.component.ts index 7843a9b..063221e 100644 --- a/src/app/admin/system/oils-discount/oils-discount.component.ts +++ b/src/app/admin/system/oils-discount/oils-discount.component.ts @@ -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'], + }); + } + }); + } } diff --git a/src/app/services/commons.service.ts b/src/app/services/commons.service.ts index b6f2d36..c05a870 100644 --- a/src/app/services/commons.service.ts +++ b/src/app/services/commons.service.ts @@ -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); + }); + } + /** * * 获取全部职位类型 diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 5a795b3..c29ae5b 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -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=', };