diff --git a/src/app/admin/navigation/navigation.component.html b/src/app/admin/navigation/navigation.component.html
index 5af70ef..a85efac 100644
--- a/src/app/admin/navigation/navigation.component.html
+++ b/src/app/admin/navigation/navigation.component.html
@@ -38,9 +38,6 @@
修改密码
-
- 二级密码
-
退出
@@ -105,96 +102,3 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/app/admin/navigation/navigation.component.ts b/src/app/admin/navigation/navigation.component.ts
index 2b489ac..e583df5 100644
--- a/src/app/admin/navigation/navigation.component.ts
+++ b/src/app/admin/navigation/navigation.component.ts
@@ -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 {};
- }
}
diff --git a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
index dd88428..9642fb3 100644
--- a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
+++ b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.html
@@ -122,7 +122,7 @@
-
+
@@ -186,6 +186,7 @@
变更记录
油卡账单
消费订单
+
回收余额
@@ -240,13 +241,13 @@
充值金额
-
+
- 二级密码
+ 支付密码
-
+
@@ -254,3 +255,29 @@
+
+
+
+
diff --git a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
index 4d2fa90..2a057ab 100644
--- a/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
+++ b/src/app/admin/oil-card/oil-card-list/oil-card-list.component.ts
@@ -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;
+ });
+ }
+
/**
* 导出油卡
*/
diff --git a/src/app/admin/oil-card/oil-card-order/oil-card-order.component.ts b/src/app/admin/oil-card/oil-card-order/oil-card-order.component.ts
index 3283393..71649e2 100644
--- a/src/app/admin/oil-card/oil-card-order/oil-card-order.component.ts
+++ b/src/app/admin/oil-card/oil-card-order/oil-card-order.component.ts
@@ -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',
diff --git a/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts b/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts
index e09f987..d95af63 100644
--- a/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts
+++ b/src/app/pipes/company-amount/company-amount-record-source-type.pipe.ts
@@ -11,6 +11,8 @@ export class CompanyAmountRecordSourceTypePipe implements PipeTransform {
return '金额充值';
case 2:
return '油卡充值';
+ case 3:
+ return '回收余额';
}
}
diff --git a/src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts b/src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts
index 88bb28e..3a82515 100644
--- a/src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts
+++ b/src/app/pipes/oil-card/oil-card-record-source-type.pipe.ts
@@ -11,6 +11,10 @@ export class OilCardRecordSourceTypePipe implements PipeTransform {
return '充值金额';
case 2:
return '订单消费';
+ case 3:
+ return '订单退款';
+ case 4:
+ return '回收余额';
}
}
diff --git a/src/app/services/oil-card.service.ts b/src/app/services/oil-card.service.ts
index ff80a0c..80d3951 100644
--- a/src/app/services/oil-card.service.ts
+++ b/src/app/services/oil-card.service.ts
@@ -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);
+ });
+ }
+
/**
* 生成油卡
*
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 21ad46f..a2d6d6f 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://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=',
};
diff --git a/src/index.html b/src/index.html
index 268e126..7e90525 100644
--- a/src/index.html
+++ b/src/index.html
@@ -2,7 +2,7 @@
-
嗨商城
+
嗨森逛