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