@@ -124,6 +126,54 @@
+
+
+
+
diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.scss b/src/app/admin/merchant/merchant-list/merchant-list.component.scss
index 8bee3fb..0325db1 100644
--- a/src/app/admin/merchant/merchant-list/merchant-list.component.scss
+++ b/src/app/admin/merchant/merchant-list/merchant-list.component.scss
@@ -2,3 +2,6 @@
height: 60px;
width: 60px;
}
+nz-input-number {
+ width: 100%;
+}
diff --git a/src/app/admin/merchant/merchant-list/merchant-list.component.ts b/src/app/admin/merchant/merchant-list/merchant-list.component.ts
index 3737264..e7f8f2b 100644
--- a/src/app/admin/merchant/merchant-list/merchant-list.component.ts
+++ b/src/app/admin/merchant/merchant-list/merchant-list.component.ts
@@ -6,7 +6,8 @@ import {CommonsService} from '../../../services/commons.service';
import {MerchantService} from '../../../services/merchant.service';
import {Router} from '@angular/router';
import {environment} from '../../../../environments/environment';
-import {MerAmountService} from "../../../services/mer-amount.service";
+import {MerAmountService} from '../../../services/mer-amount.service';
+import {MerchantTripartitePlatformService} from '../../../services/merchant-tripartite-platform.service';
@Component({
selector: 'app-merchant-list',
@@ -25,12 +26,16 @@ export class MerchantListComponent implements OnInit {
rechargeModal = false;
rechargeForm: FormGroup; // 充值模态框
+ tripartitePlatformModal = false;
+ tripartitePlatformForm: FormGroup; // 充值模态框
+
constructor(
private form: FormBuilder,
private merchant: MerchantService,
private iconService: IconService,
private message: NzMessageService,
private merAmountService: MerAmountService,
+ private tripartitePlatformService: MerchantTripartitePlatformService,
private router: Router,
private common: CommonsService,
private modal: NzModalService,
@@ -53,6 +58,15 @@ export class MerchantListComponent implements OnInit {
merId: [null],
amount: [null, [Validators.required]],
});
+
+ this.tripartitePlatformForm = this.form.group({
+ merId: [null],
+ platformType: ['1', [Validators.required]],
+ platformMerName: [null, [Validators.required]],
+ platformMerNumber: [null, [Validators.required]],
+ profitSharingStatus: ['false', [Validators.required]],
+ profitSharingRatio: [null],
+ });
this.getRequest(true, this.searchForm.value);
}
@@ -145,7 +159,7 @@ export class MerchantListComponent implements OnInit {
showRechargeModal(merId: number) {
- this.rechargeForm.patchValue({ merId: merId});
+ this.rechargeForm.patchValue({ merId});
this.rechargeModal = true;
}
@@ -182,5 +196,52 @@ export class MerchantListComponent implements OnInit {
});
}
+
+ showTripartitePlatformModal(merId: number) {
+ this.tripartitePlatformService.getDetail(merId, 1, data => {
+ if (data['return_data'] != null) {
+ data['return_data']['platformType'] = String(data['return_data']['platformType']);
+ data['return_data']['profitSharingStatus'] = String(data['return_data']['profitSharingStatus']);
+ this.tripartitePlatformForm.patchValue(data['return_data']);
+ } else {
+ this.tripartitePlatformForm.patchValue( { merId: merId, platformType: '1', profitSharingStatus: 'false' });
+ }
+ });
+ this.tripartitePlatformModal = true;
+ }
+
+ closeTripartitePlatformModal() {
+ this.tripartitePlatformForm.reset();
+ this.tripartitePlatformModal = false;
+ }
+
+ submitTripartitePlatform() {
+ for (const i in this.tripartitePlatformForm.controls) {
+ this.tripartitePlatformForm.controls[i].markAsDirty();
+ this.tripartitePlatformForm.controls[i].updateValueAndValidity();
+ }
+ if (this.tripartitePlatformForm.status == null || this.tripartitePlatformForm.status !== 'VALID') {
+ this.modal.warning({
+ nzTitle: '提示',
+ nzContent: '请填写所有必填项',
+ });
+ return;
+ }
+ this.tripartitePlatformService.editTripartitePlatform(this.tripartitePlatformForm.value, data => {
+ if (data['return_code'] === '000000') {
+ this.modal.success({
+ nzTitle: '提示',
+ nzContent: '保存成功',
+ });
+ this.closeTripartitePlatformModal();
+ } else {
+ this.modal.error({
+ nzTitle: '提示',
+ nzContent: data['return_msg'],
+ });
+ }
+ });
+ }
+
}
diff --git a/src/app/services/merchant-tripartite-platform.service.ts b/src/app/services/merchant-tripartite-platform.service.ts
new file mode 100644
index 0000000..58cf088
--- /dev/null
+++ b/src/app/services/merchant-tripartite-platform.service.ts
@@ -0,0 +1,39 @@
+import { Injectable } from '@angular/core';
+import {HttpClient} from '_@angular_common@9.0.7@@angular/common/http';
+import {CommonsService} from './commons.service';
+import {environment} from '../../environments/environment';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class MerchantTripartitePlatformService {
+
+ constructor(
+ private http: HttpClient,
+ private common: CommonsService
+ ) { }
+
+ /**
+ * 查询商户列表
+ *
+ * @param paramsObject 对象
+ * @param callBack 回调
+ */
+ public editTripartitePlatform(paramsObject: object, callBack) {
+ this.http.post(environment.baseUrl + 'merchantTripartitePlatform/editTripartitePlatform', paramsObject).subscribe(data => {
+ callBack(data);
+ });
+ }
+
+ /**
+ * 查询详情
+ *
+ * @param paramsObject 对象
+ * @param callBack 回调
+ */
+ public getDetail(merId: number, platformType: number, callBack) {
+ this.http.get(environment.baseUrl + 'merchantTripartitePlatform/getDetail?merId=' + merId + '&platformType=' + platformType).subscribe(data => {
+ callBack(data);
+ });
+ }
+}