|
|
@ -61,6 +61,9 @@ export class StoreEditComponent implements OnInit { |
|
|
|
address: [null, [Validators.required]], |
|
|
|
address: [null, [Validators.required]], |
|
|
|
contactName: [null, [Validators.required]], |
|
|
|
contactName: [null, [Validators.required]], |
|
|
|
prestoreType: [null, [Validators.required]], |
|
|
|
prestoreType: [null, [Validators.required]], |
|
|
|
|
|
|
|
splitType: [1], |
|
|
|
|
|
|
|
splitAccountNo: [null], |
|
|
|
|
|
|
|
splitRate: [null], |
|
|
|
telephone: [null, [Validators.required]], |
|
|
|
telephone: [null, [Validators.required]], |
|
|
|
latitude: [29.553134, [Validators.required]], |
|
|
|
latitude: [29.553134, [Validators.required]], |
|
|
|
longitude: [106.565428, [Validators.required]], |
|
|
|
longitude: [106.565428, [Validators.required]], |
|
|
@ -109,6 +112,15 @@ export class StoreEditComponent implements OnInit { |
|
|
|
return; |
|
|
|
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.length !== 0) { |
|
|
|
if (this.logoFile[0]['response'] != null) { |
|
|
|
if (this.logoFile[0]['response'] != null) { |
|
|
|
this.validateForm.value.storeLogo = this.logoFile[0]['response']['return_data'][0]; |
|
|
|
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; |
|
|
|
this.validateForm.value.storeLogo = this.logoFile[0].name; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.editFlag) { |
|
|
|
if (this.editFlag) { |
|
|
|
this.validateForm.value.id = this.id; |
|
|
|
this.validateForm.value.id = this.id; |
|
|
|
this.merchantStore.updateMerchantStore(this.validateForm.value, data => { |
|
|
|
this.merchantStore.updateMerchantStore(this.validateForm.value, data => { |
|
|
@ -145,6 +158,7 @@ export class StoreEditComponent implements OnInit { |
|
|
|
console.log(data); |
|
|
|
console.log(data); |
|
|
|
data['return_data']['brandId'] = String(data['return_data']['brandId']); |
|
|
|
data['return_data']['brandId'] = String(data['return_data']['brandId']); |
|
|
|
data['return_data']['type'] = String(data['return_data']['type']); |
|
|
|
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'] !== '') { |
|
|
|
if (data['return_data']['storeLogo'] != null && data['return_data']['storeLogo'] !== '') { |
|
|
|
const logo = String(data['return_data']['storeLogo']); |
|
|
|
const logo = String(data['return_data']['storeLogo']); |
|
|
|
const logoArray = []; |
|
|
|
const logoArray = []; |
|
|
@ -157,6 +171,11 @@ export class StoreEditComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.logoFile = logoArray; |
|
|
|
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.validateForm.patchValue(data['return_data']); |
|
|
|
this.getMap(); |
|
|
|
this.getMap(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|