diff --git a/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html b/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html index 92e6c2c..db08176 100644 --- a/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html +++ b/src/app/admin/company-amount/company-amount-record/company-amount-record.component.html @@ -68,13 +68,13 @@
- +
共计 {{dataObject.total?dataObject.total:0}} 条数据
- +
@@ -88,15 +88,15 @@ [nzScroll]="{ x: '1150px'}"> - 部门 - 类型 - 交易金额 - 变更前金额 - 变更后金额 - 来源类型 + 部门 + 类型 + 交易金额 + 变更前金额 + 变更后金额 + 来源类型 来源内容 操作人 - 记录时间 + 记录时间 @@ -124,7 +124,7 @@ - +
部门 diff --git a/src/app/admin/company-amount/company-amount-record/company-amount-record.component.ts b/src/app/admin/company-amount/company-amount-record/company-amount-record.component.ts index 257550c..cad2d28 100644 --- a/src/app/admin/company-amount/company-amount-record/company-amount-record.component.ts +++ b/src/app/admin/company-amount/company-amount-record/company-amount-record.component.ts @@ -185,6 +185,9 @@ export class CompanyAmountRecordComponent implements OnInit { * 发送验证码 */ sendSmsCode() { + this.rechargeForm.controls.orgId.enable(); + this.rechargeForm.controls.amount.enable(); + if (this.rechargeForm.value.orgId == null) { this.modal.warning({ nzTitle: '提示', @@ -199,7 +202,6 @@ export class CompanyAmountRecordComponent implements OnInit { this.rechargeForm.controls.orgId.disable(); this.rechargeForm.controls.amount.disable(); - this.companyAccountService.sendRechargeSmsCode('17726395120', this.rechargeParam.orgId, this.rechargeParam.amount, data => { if (data['return_code'] === '000000') { this.getVerifyCodeCountdown(); diff --git a/src/app/admin/company-amount/company-amount-routing.module.ts b/src/app/admin/company-amount/company-amount-routing.module.ts index 0702a44..dd5efb0 100644 --- a/src/app/admin/company-amount/company-amount-routing.module.ts +++ b/src/app/admin/company-amount/company-amount-routing.module.ts @@ -1,9 +1,15 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; import {CompanyAmountRecordComponent} from './company-amount-record/company-amount-record.component'; +import {OilCardListComponent} from '../oil-card/oil-card-list/oil-card-list.component'; +import {OilCardOrderComponent} from '../oil-card/oil-card-order/oil-card-order.component'; +import {PayPwdComponent} from './pay-pwd/pay-pwd.component'; const routes: Routes = [ { path: 'list', component: CompanyAmountRecordComponent }, + { path: 'oil-card', component: OilCardListComponent }, + { path: 'oil-card-order', component: OilCardOrderComponent }, + { path: 'pay-pwd-config', component: PayPwdComponent }, ]; @NgModule({ diff --git a/src/app/admin/company-amount/company-amount.module.ts b/src/app/admin/company-amount/company-amount.module.ts index 1b1b140..7c4acb8 100644 --- a/src/app/admin/company-amount/company-amount.module.ts +++ b/src/app/admin/company-amount/company-amount.module.ts @@ -8,10 +8,11 @@ import {FormsModule, ReactiveFormsModule} from '_@angular_forms@9.0.7@@angular/f import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; import {AppCommonModule} from '../../app-common.module'; import {NgxEchartsModule} from '_ngx-echarts@4.2.2@ngx-echarts'; +import { PayPwdComponent } from './pay-pwd/pay-pwd.component'; @NgModule({ - declarations: [CompanyAmountRecordComponent], + declarations: [CompanyAmountRecordComponent, PayPwdComponent], imports: [ CommonModule, CompanyAmountRoutingModule, diff --git a/src/app/admin/company-amount/pay-pwd/pay-pwd.component.html b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.html new file mode 100644 index 0000000..fef6b01 --- /dev/null +++ b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.html @@ -0,0 +1,80 @@ + + + +
+
+ + + + 旧密码 + + + + + + + + 新密码 + + + + + + + + + + + + + 确认新密码 + + + + + 您输入的两个密码不一致! + + + + + + + + + + + +
+ + + 支付密码 + + + + + + + + + + + + + 确认密码 + + + + + 您输入的两个密码不一致! + + + + + + + + + +
+
+
diff --git a/src/app/admin/company-amount/pay-pwd/pay-pwd.component.scss b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.scss new file mode 100644 index 0000000..2ca634f --- /dev/null +++ b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.scss @@ -0,0 +1,3 @@ +.main { + width: 500px; +} diff --git a/src/app/admin/company-amount/pay-pwd/pay-pwd.component.spec.ts b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.spec.ts new file mode 100644 index 0000000..25a9426 --- /dev/null +++ b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PayPwdComponent } from './pay-pwd.component'; + +describe('PayPwdComponent', () => { + let component: PayPwdComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PayPwdComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PayPwdComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/admin/company-amount/pay-pwd/pay-pwd.component.ts b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.ts new file mode 100644 index 0000000..ee0c734 --- /dev/null +++ b/src/app/admin/company-amount/pay-pwd/pay-pwd.component.ts @@ -0,0 +1,139 @@ +import { Component, OnInit } from '@angular/core'; +import {FormBuilder, FormControl, FormGroup, Validators} from '_@angular_forms@9.0.7@@angular/forms'; +import {ValidatorsService} from '../../../services/validators.service'; +import {LocalStorageService} from '../../../services/local-storage.service'; +import {LoginService} from '../../../services/login.service'; +import {NzMessageService, NzModalService} from '_ng-zorro-antd@9.3.0@ng-zorro-antd'; +import {CommonsService} from '../../../services/commons.service'; +import {CompanyTwoPwdService} from '../../../services/company-two-pwd.service'; +import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http'; +import {IconService} from '../../../services/icon.service'; + +@Component({ + selector: 'app-pay-pwd', + templateUrl: './pay-pwd.component.html', + styleUrls: ['./pay-pwd.component.scss'] +}) +export class PayPwdComponent implements OnInit { + setPayPwdStatus = false; + passwordVisible = false; + setTwoPwdForm: FormGroup; // 定义表单 + updateTwoPwdForm: FormGroup; // 定义表单 + + constructor( + private storage: LocalStorageService, + private loginService: LoginService, + private message: NzMessageService, + private commonsService: CommonsService, + private companyTwoPwdService: CompanyTwoPwdService, + private http: HttpClient, // http请求 + private iconService: IconService, + private modal: NzModalService, + private fb: FormBuilder, // 表单 + ) { } + + ngOnInit(): void { + this.isSetPayPwd(); + + this.setTwoPwdForm = this.fb.group({ + password: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(16)]], + checkPassword: [null, [Validators.required, this.checkSetTowPwd]], + }); + + this.updateTwoPwdForm = this.fb.group({ + oldPassword: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(16)]], + newPassword: [null, [Validators.required, ValidatorsService.minLength(6), ValidatorsService.maxLength(16)]], + checkNewPassword: [null, [Validators.required, this.checkUpdateTowPwd]], + }); + } + + // 设置密码 + isSetPayPwd() { + this.companyTwoPwdService.isSetTwoPwd(data => { + if (data['return_data'] === true) { + this.setPayPwdStatus = true; + } else { + this.setPayPwdStatus = false; + } + }); + } + + // 设置二级密码 + submitSetTowPwd(): void { + for (const i in this.setTwoPwdForm.controls) { + this.setTwoPwdForm.controls[i].markAsDirty(); + this.setTwoPwdForm.controls[i].updateValueAndValidity(); + } + if (this.setTwoPwdForm.status == null || this.setTwoPwdForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请规范填写所有的必填项信息', + }); + return; + } + this.companyTwoPwdService.setTwoPwd(this.setTwoPwdForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '设置成功', + }); + this.setTwoPwdForm.reset(); + this.isSetPayPwd(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + + checkSetTowPwd = (control: FormControl): { [s: string]: boolean } => { + if (!control.value) { + return { required: true }; + } else if (control.value !== this.setTwoPwdForm.controls.password.value) { + return { confirm: true, error: true }; + } + return {}; + } + + // 修改二级密码 + submitUpdateTowPwd(): void { + for (const i in this.updateTwoPwdForm.controls) { + this.updateTwoPwdForm.controls[i].markAsDirty(); + this.updateTwoPwdForm.controls[i].updateValueAndValidity(); + } + if (this.updateTwoPwdForm.status == null || this.updateTwoPwdForm.status !== 'VALID') { + this.modal.warning({ + nzTitle: '提示', + nzContent: '请规范填写所有的必填项信息', + }); + return; + } + this.companyTwoPwdService.updateTwoPwd(this.updateTwoPwdForm.value, data => { + if (data['return_code'] === '000000') { + this.modal.success({ + nzTitle: '提示', + nzContent: '修改成功', + }); + this.updateTwoPwdForm.reset(); + this.isSetPayPwd(); + } else { + this.modal.error({ + nzTitle: '提示', + nzContent: data['return_msg'], + }); + } + }); + } + + checkUpdateTowPwd = (control: FormControl): { [s: string]: boolean } => { + if (!control.value) { + return { required: true }; + } else if (control.value !== this.updateTwoPwdForm.controls.newPassword.value) { + return { confirm: true, error: true }; + } + return {}; + } + +} diff --git a/src/app/admin/login/login/login.component.html b/src/app/admin/login/login/login.component.html index bfc97e6..40d020c 100644 --- a/src/app/admin/login/login/login.component.html +++ b/src/app/admin/login/login/login.component.html @@ -6,7 +6,7 @@