提交代码

pull/1/head
胡锐 3 years ago
parent 0acfbc7a94
commit ae42319586
  1. 20
      src/app/admin/company-amount/company-amount-record/company-amount-record.component.html
  2. 4
      src/app/admin/company-amount/company-amount-record/company-amount-record.component.ts
  3. 6
      src/app/admin/company-amount/company-amount-routing.module.ts
  4. 3
      src/app/admin/company-amount/company-amount.module.ts
  5. 80
      src/app/admin/company-amount/pay-pwd/pay-pwd.component.html
  6. 3
      src/app/admin/company-amount/pay-pwd/pay-pwd.component.scss
  7. 25
      src/app/admin/company-amount/pay-pwd/pay-pwd.component.spec.ts
  8. 139
      src/app/admin/company-amount/pay-pwd/pay-pwd.component.ts
  9. 2
      src/app/admin/login/login/login.component.html
  10. 96
      src/app/admin/navigation/navigation.component.html
  11. 125
      src/app/admin/navigation/navigation.component.ts
  12. 35
      src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
  13. 78
      src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
  14. 2
      src/app/admin/oil-card/oil-card-order/oil-card-order.component.ts
  15. 2
      src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts
  16. 4
      src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts
  17. 12
      src/app/services/oil-card.service.ts
  18. 8
      src/environments/environment.ts
  19. 2
      src/index.html

@ -68,13 +68,13 @@
<div *ngIf="roleType == 5 && adminFlag == 0" style="width: 100%;text-align: center;">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="24">
<nz-statistic [nzValue]="accountObject['amounts']" [nzTitle]="'账户余额'"></nz-statistic>
<nz-statistic [nzValue]="'' + accountObject['amounts']" [nzTitle]="'账户余额'"></nz-statistic>
</nz-col>
</nz-row>
</div>
<span>共计 {{dataObject.total?dataObject.total:0}} 条数据</span>
<div class="operating-button">
<button *ngIf="roleType == 5 && adminFlag == 1" nz-button nzType="primary" class="right-btn" (click)="showRechargeModal()" ><i nz-icon nzType="plus" nzTheme="outline"></i>金额充值</button>
<button *ngIf="roleType == 5 && adminFlag == 1" nz-button nzType="primary" class="right-btn" (click)="showRechargeModal()" ><i nz-icon nzType="plus" nzTheme="outline"></i>账户充值</button>
</div>
<!--数组表格 -->
@ -88,15 +88,15 @@
[nzScroll]="{ x: '1150px'}">
<thead>
<tr>
<th nzWidth="80px" *ngIf="roleType == 5 && adminFlag == 1">部门</th>
<th nzWidth="70px">类型</th>
<th nzWidth="80px">交易金额</th>
<th nzWidth="100px">变更前金额</th>
<th nzWidth="100px">变更后金额</th>
<th nzWidth="80px">来源类型</th>
<th nzWidth="130px" *ngIf="roleType == 5 && adminFlag == 1">部门</th>
<th nzWidth="100px">类型</th>
<th nzWidth="100px">交易金额</th>
<th nzWidth="120px">变更前金额</th>
<th nzWidth="120px">变更后金额</th>
<th nzWidth="100px">来源类型</th>
<th nzWidth="300px">来源内容</th>
<th nzWidth="130px">操作人</th>
<th nzWidth="150px">记录时间</th>
<th nzWidth="200px">记录时间</th>
<!-- <th nzWidth="100px" nzRight="0px">操作</th>-->
</tr>
</thead>
@ -124,7 +124,7 @@
</nz-table>
</div>
<nz-modal [(nzVisible)]="rechargeModal" nzTitle="积分充值" (nzOnCancel)="closeRechargeModal()" nzWidth="500px" [nzFooter]="null">
<nz-modal [(nzVisible)]="rechargeModal" nzTitle="账户充值" (nzOnCancel)="closeRechargeModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="rechargeForm">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >部门</nz-form-label>

@ -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();

@ -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({

@ -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,

@ -0,0 +1,80 @@
<!-- start 面包屑 -->
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<div class="inner-content">
<div class="main">
<form nz-form [formGroup]="updateTwoPwdForm" *ngIf="setPayPwdStatus == true">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>旧密码</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input type="password" formControlName="oldPassword" placeholder="请输入您的旧支付密码" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>
<span> 新密码 </span>
</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-input-group [nzSuffix]="suffixTemplate">
<input nz-input [type]="passwordVisible ? 'text' : 'password'" formControlName="newPassword" placeholder="请输入您的新支付密码" />
</nz-input-group>
<ng-template #suffixTemplate>
<i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>确认新密码</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="errorTpl">
<input nz-input type="password" formControlName="checkNewPassword" placeholder="请再次输入您的新支付密码" />
<ng-template #errorTpl let-control>
<ng-container *ngIf="control.hasError('confirm')">
您输入的两个密码不一致!
</ng-container>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-control [nzSpan]="8" >
<button nz-button nzType="primary" style="margin-left: 130px;width: 200px;" (click)="submitUpdateTowPwd()">提交</button>
</nz-form-control>
</form>
<form nz-form [formGroup]="setTwoPwdForm" *ngIf="setPayPwdStatus == false">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>
<span> 支付密码 </span>
</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-input-group [nzSuffix]="suffixTemplate">
<input nz-input [type]="passwordVisible ? 'text' : 'password'" formControlName="password" placeholder="请输入您的支付密码" />
</nz-input-group>
<ng-template #suffixTemplate>
<i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>确认密码</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="errorTpl">
<input nz-input type="password" formControlName="checkPassword" placeholder="请再次输入您的支付密码" />
<ng-template #errorTpl let-control>
<ng-container *ngIf="control.hasError('confirm')">
您输入的两个密码不一致!
</ng-container>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-control [nzSpan]="8" >
<button nz-button nzType="primary" style="margin-left: 130px;width: 200px;" (click)="submitSetTowPwd()">提交</button>
</nz-form-control>
</form>
</div>
</div>

@ -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<PayPwdComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PayPwdComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PayPwdComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

@ -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 {};
}
}

@ -6,7 +6,7 @@
<div class="login-background">
</div>
<div class="body-content-login">
<div class="body-content-right-title">商城后台登录</div>
<div class="body-content-right-title">森逛后台登录</div>
<form nz-form class="login-form" [formGroup]="loginForm" (ngSubmit)="submitLogin()">
<div class="form-item">

@ -38,9 +38,6 @@
<li nz-menu-item>
<a (click)="openUpdatePwd()">修改密码</a>
</li>
<li *ngIf="userInfo['bsOrganization'] != null" nz-menu-item>
<a (click)="setTowPwd()">二级密码</a>
</li>
<li nz-menu-item>
<a (click)="loginOut()">退出</a>
</li>
@ -105,96 +102,3 @@
</nz-drawer>
<nz-drawer
[nzBodyStyle]="{ height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' }"
[nzWidth]="500"
[nzVisible]="setTwoPwdVisible"
nzTitle="设置二级密码"
[nzMaskClosable] = "true"
(nzOnClose)="closeSetTowPwd()"
>
<form nz-form [formGroup]="setTwoPwdForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>
<span> 密码 </span>
</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-input-group [nzSuffix]="suffixTemplate">
<input nz-input [type]="passwordVisible ? 'text' : 'password'" formControlName="password" placeholder="请输入您的新密码" />
</nz-input-group>
<ng-template #suffixTemplate>
<i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>确认密码</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="errorTpl">
<input nz-input type="password" formControlName="checkPassword" placeholder="请再次输入您的密码" />
<ng-template #errorTpl let-control>
<ng-container *ngIf="control.hasError('confirm')">
您输入的两个密码不一致!
</ng-container>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-control [nzSpan]="8" >
<button nz-button nzType="primary" style="margin-left: 130px;width: 200px;" (click)="submitSetTowPwd()">提交</button>
</nz-form-control>
</form>
</nz-drawer>
<nz-drawer
[nzBodyStyle]="{ height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' }"
[nzWidth]="500"
[nzVisible]="updateTwoPwdVisible"
nzTitle="修改二级密码"
[nzMaskClosable] = "true"
(nzOnClose)="closeUpdateTowPwd()"
>
<form nz-form [formGroup]="updateTwoPwdForm">
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>旧密码</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input type="password" formControlName="oldPassword" placeholder="请输入您的旧密码" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>
<span> 新密码 </span>
</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-input-group [nzSuffix]="suffixTemplate">
<input nz-input [type]="passwordVisible ? 'text' : 'password'" formControlName="newPassword" placeholder="请输入您的新密码" />
</nz-input-group>
<ng-template #suffixTemplate>
<i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>确认新密码</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24" [nzErrorTip]="errorTpl">
<input nz-input type="password" formControlName="checkNewPassword" placeholder="请再次输入您的新密码" />
<ng-template #errorTpl let-control>
<ng-container *ngIf="control.hasError('confirm')">
您输入的两个密码不一致!
</ng-container>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-control [nzSpan]="8" >
<button nz-button nzType="primary" style="margin-left: 130px;width: 200px;" (click)="submitUpdateTowPwd()">提交</button>
</nz-form-control>
</form>
</nz-drawer>

@ -24,12 +24,6 @@ export class NavigationComponent implements OnInit {
validateForm: FormGroup; // 定义表单
passwordVisible = false;
setTwoPwdVisible = false;
setTwoPwdForm: FormGroup; // 定义表单
updateTwoPwdVisible = false;
updateTwoPwdForm: FormGroup; // 定义表单
isCollapsed = false;
userInfo: any;
menuList: any;
@ -55,17 +49,6 @@ export class NavigationComponent implements OnInit {
checkNewPassword: [null, [Validators.required, this.checkPwd]],
});
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]],
});
this.routeName = this.storage.get(ROUTENAME) == null ? 'index' : this.storage.get(ROUTENAME);
this.userInfo = this.storage.getList(ADMIN_INFO_OBJECT);
this.commonsService.mappingSysNameOl('RECHARGE', data => {
@ -187,114 +170,6 @@ export class NavigationComponent implements OnInit {
return {};
}
// 设置密码
setTowPwd() {
this.companyTwoPwdService.isSetTwoPwd(data => {
if (data['return_data'] === true) {
this.openUpdateTowPwd();
} else {
this.openSetTowPwd();
}
});
}
// 打开设置二级密码抽屉
openSetTowPwd(): void {
this.setTwoPwdVisible = true;
}
// 关闭设置二级密码抽屉
closeSetTowPwd(): void {
this.setTwoPwdVisible = false;
this.setTwoPwdForm.reset();
}
// 提交二级密码
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.closeSetTowPwd();
} 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 {};
}
// 打开修改二级密码抽屉
openUpdateTowPwd(): void {
this.updateTwoPwdVisible = true;
}
// 关闭修改二级密码抽屉
closeUpdateTowPwd(): void {
this.updateTwoPwdVisible = false;
this.updateTwoPwdForm.reset();
}
// 提交二级密码
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.closeUpdateTowPwd();
} 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 {};
}
}

@ -122,7 +122,7 @@
<div *ngIf="roleType == 5 && adminFlag == 0" style="width: 100%;text-align: center;">
<nz-row [nzGutter]="16">
<nz-col [nzSpan]="24">
<nz-statistic [nzValue]="accountObject['amounts']" [nzTitle]="'账户余额'"></nz-statistic>
<nz-statistic [nzValue]="'' + accountObject['amounts']" [nzTitle]="'账户余额'"></nz-statistic>
</nz-col>
</nz-row>
</div>
@ -186,6 +186,7 @@
<li nz-menu-item [routerLink]="['/admin/oil-card/record-op-list']" [queryParams]="{ cardNo: data.cardNo}"><a>变更记录</a></li>
<li nz-menu-item [routerLink]="['/admin/oil-card/record-list']" [queryParams]="{ cardNo: data.cardNo}"><a>油卡账单</a></li>
<li nz-menu-item [routerLink]="['/admin/oil-card/order']" [queryParams]="{ cardNo: data.cardNo}"><a>消费订单</a></li>
<li nz-menu-item (click)="showRecycleAmountModal(data)"><a>回收余额</a></li>
</ul>
</nz-dropdown-menu>
</td>
@ -240,13 +241,13 @@
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >充值金额</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number style="width: 100%" formControlName="price" [nzMin]="1" [nzMax]="1000" [nzStep]="1" [nzPrecision]="2"></nz-input-number>
<nz-input-number style="width: 100%" formControlName="price" [nzMin]="0.01" [nzMax]="1000" [nzStep]="1" [nzPrecision]="2"></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >二级密码</nz-form-label>
<nz-form-label [nzSpan]="6" nzRequired >支付密码</nz-form-label>
<nz-form-control [nzSpan]="14">
<input type="password" formControlName="twoPwd" nz-input placeholder="请输入二级密码" />
<input type="password" formControlName="twoPwd" nz-input placeholder="请输入支付密码" />
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
@ -254,3 +255,29 @@
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="recycleAmountModal" nzTitle="油卡余额回收" (nzOnCancel)="closeRecycleAmountModal()" nzWidth="500px" [nzFooter]="null">
<form nz-form [formGroup]="recycleAmountForm">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >卡号</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="cardNo" disabled />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >回收余额</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number style="width: 100%" formControlName="amount"></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >支付密码</nz-form-label>
<nz-form-control [nzSpan]="14">
<input type="password" formControlName="twoPwd" nz-input placeholder="请输入支付密码" />
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" [nzLoading]="recycleAmountBtnLoading" (click)="submitRecycleAmount()">确定</button>
</div>
</form>
</nz-modal>

@ -8,6 +8,8 @@ import {CompanyAccountService} from '../../../services/company-account.service';
import {OrganizationService} from "../../../services/organization.service";
import {NavigationComponent} from "../../navigation/navigation.component";
import {environment} from "../../../../environments/environment";
import {Router} from "_@angular_router@9.0.7@@angular/router";
import {ValidatorsService} from "../../../services/validators.service";
@Component({
selector: 'app-oil-card-list',
@ -40,6 +42,10 @@ export class OilCardListComponent implements OnInit {
rechargeForm: FormGroup;
rechargeBtnLoading = false;
recycleAmountModal = false;
recycleAmountForm: FormGroup;
recycleAmountBtnLoading = false;
orgArray = [];
accountObject = {
amounts: 0
@ -50,8 +56,8 @@ export class OilCardListComponent implements OnInit {
private store: LocalStorageService,
private oilCardService: OilCardService,
private organizationService: OrganizationService,
private navigationComponent: NavigationComponent,
private companyAccountService: CompanyAccountService,
private router: Router,
private form: FormBuilder) {
this.roleType = Number(this.store.get(ADMIN_INFO_OBJECT)['secRole'].roleType);
this.adminFlag = Number(this.store.get(ADMIN_INFO_OBJECT)['secUser'].adminFlag);
@ -77,7 +83,7 @@ export class OilCardListComponent implements OnInit {
this.editContactForm = this.form.group({
cardNo: [null, [Validators.required]],
contactName: [null, [Validators.required]],
contactPhone: [null, [Validators.required]],
contactPhone: [null, [Validators.required, ValidatorsService.mobile]],
});
this.generateCardForm = this.form.group({
@ -90,6 +96,12 @@ export class OilCardListComponent implements OnInit {
twoPwd: [null, [Validators.required]],
});
this.recycleAmountForm = this.form.group({
cardNo: [{ value: null, disabled: true }, [Validators.required]],
amount: [{ value: null, disabled: true }, [Validators.required]],
twoPwd: [null, [Validators.required]],
});
if (this.roleType === 5 && this.adminFlag === 1) {
this.organizationService.getOrganizationList(this.store.get(ADMIN_INFO_OBJECT)['bsCompany']['id'], data => {
this.orgArray = data['return_data'];
@ -383,8 +395,8 @@ export class OilCardListComponent implements OnInit {
nzTitle: '提示',
nzContent: data['return_msg'],
});
this.router.navigateByUrl('admin/company-amount/pay-pwd-config');
this.closeRechargeModal();
this.navigationComponent.openSetTowPwd();
} else {
this.modal.error({
nzTitle: '提示',
@ -395,6 +407,66 @@ export class OilCardListComponent implements OnInit {
});
}
/**
*
*/
showRecycleAmountModal(cardData: object) {
this.recycleAmountForm.patchValue(cardData);
this.recycleAmountModal = true;
}
/**
*
*/
closeRecycleAmountModal() {
this.recycleAmountModal = false;
}
/**
*
*/
submitRecycleAmount() {
for (const i in this.recycleAmountForm.controls) {
this.recycleAmountForm.controls[i].markAsDirty();
this.recycleAmountForm.controls[i].updateValueAndValidity();
}
if (this.recycleAmountForm.status == null || this.recycleAmountForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有必填项',
});
return;
}
this.recycleAmountBtnLoading = true;
this.recycleAmountForm.value['cardNo'] = this.recycleAmountForm.controls['cardNo']['value'];
this.oilCardService.recycleAmount(this.recycleAmountForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '回收成功',
});
this.closeRecycleAmountModal();
this.getAccount();
this.requestData(this.whereObject['pageNum']);
} else if (data['return_code'] === '102136') {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
this.router.navigateByUrl('admin/company-amount/pay-pwd-config');
this.closeRecycleAmountModal();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
this.recycleAmountBtnLoading = false;
});
}
/**
*
*/

@ -8,7 +8,7 @@ import {NavigationComponent} from '../../navigation/navigation.component';
import {CompanyAccountService} from '../../../services/company-account.service';
import {ActivatedRoute} from '_@angular_router@9.0.7@@angular/router';
import {ADMIN_INFO_OBJECT} from '../../../services/local-storage.namespace';
import {environment} from "../../../../environments/environment";
import {environment} from '../../../../environments/environment';
@Component({
selector: 'app-oil-card-order',

@ -11,6 +11,8 @@ export class CompanyAmountRecordSourceTypePipe implements PipeTransform {
return '金额充值';
case 2:
return '油卡充值';
case 3:
return '回收余额';
}
}

@ -11,6 +11,10 @@ export class OilCardRecordSourceTypePipe implements PipeTransform {
return '充值金额';
case 2:
return '订单消费';
case 3:
return '订单退款';
case 4:
return '回收余额';
}
}

@ -25,6 +25,18 @@ export class OilCardService {
});
}
/**
*
*
* @param param
* @param callBack
*/
public recycleAmount(param: object, callBack) {
this.http.post(environment.baseUrl + 'oilCard/recycleAmount', 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://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'http://localhost:9302/filesystem/',
// baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',
inviteUrl: 'https://hsgcs.dctpay.com/wx/?action=ic&id=',
};

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>商城</title>
<title>森逛</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://webapi.amap.com/maps?v=1.4.3&key=3a42e959c2a1e1d76e691bc1cc25a0b0&plugin=AMap.ToolBar,AMap.Autocomplete,AMap.PlaceSearch"></script>

Loading…
Cancel
Save