diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.html b/src/app/admin/merchant-store/store-edit/store-edit.component.html index 5777f41..fcbdfde 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.html +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.html @@ -46,6 +46,22 @@ +
+ + 分账商户号 + + + + +
+
+ + 分账比例(%) + + + + +
门店类型 diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.scss b/src/app/admin/merchant-store/store-edit/store-edit.component.scss index 800400d..f8e0222 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.scss +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.scss @@ -5,3 +5,7 @@ button { background-color: #ffffff; } #container {width:800px; height: 500px; } + +nz-input-number { + width: 100%; +} diff --git a/src/app/admin/merchant-store/store-edit/store-edit.component.ts b/src/app/admin/merchant-store/store-edit/store-edit.component.ts index 32b53e4..2797ce7 100644 --- a/src/app/admin/merchant-store/store-edit/store-edit.component.ts +++ b/src/app/admin/merchant-store/store-edit/store-edit.component.ts @@ -61,6 +61,9 @@ export class StoreEditComponent implements OnInit { address: [null, [Validators.required]], contactName: [null, [Validators.required]], prestoreType: [null, [Validators.required]], + splitType: [1], + splitAccountNo: [null], + splitRate: [null], telephone: [null, [Validators.required]], latitude: [29.553134, [Validators.required]], longitude: [106.565428, [Validators.required]], @@ -109,6 +112,15 @@ export class StoreEditComponent implements OnInit { return; } } + if (this.validateForm.value.prestoreType === '0') { + if (this.validateForm.value.splitAccountNo == null || this.validateForm.value.splitRate == null) { + this.message.error('必填项不能为空'); + return; + } + this.validateForm.value.splitAccounts = { type: this.validateForm.value.splitType, + accountNo: this.validateForm.value.splitAccountNo, + rate: this.validateForm.value.splitRate }; + } if (this.logoFile.length !== 0) { if (this.logoFile[0]['response'] != null) { this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0]; @@ -116,6 +128,7 @@ export class StoreEditComponent implements OnInit { this.validateForm.value.storeLogo = this.logoFile[0].name; } } + if (this.editFlag) { this.validateForm.value.id = this.id; this.merchantStore.updateMerchantStore(this.validateForm.value, data => { @@ -145,6 +158,7 @@ export class StoreEditComponent implements OnInit { console.log(data); data['return_data']['brandId'] = String(data['return_data']['brandId']); data['return_data']['type'] = String(data['return_data']['type']); + data['return_data']['prestoreType'] = String(data['return_data']['prestoreType']); if (data['return_data']['storeLogo'] != null && data['return_data']['storeLogo'] !== '') { const logo = String(data['return_data']['storeLogo']); const logoArray = []; @@ -157,6 +171,11 @@ export class StoreEditComponent implements OnInit { }); this.logoFile = logoArray; } + if (data['return_data']['splitAccounts'] != null) { + data['return_data']['splitType'] = data['return_data']['splitAccounts']['type']; + data['return_data']['splitAccountNo'] = data['return_data']['splitAccounts']['accountNo']; + data['return_data']['splitRate'] = data['return_data']['splitAccounts']['rate']; + } this.validateForm.patchValue(data['return_data']); this.getMap(); } else {