|
|
|
@ -3,8 +3,8 @@ import {environment} from '../../../../environments/environment'; |
|
|
|
|
import {CompanyService} from '../../../services/company.service'; |
|
|
|
|
import {IconService} from '../../../services/icon.service'; |
|
|
|
|
import {CommonsService} from '../../../services/commons.service'; |
|
|
|
|
import {FormBuilder, FormGroup} from '@angular/forms'; |
|
|
|
|
import {NzMessageService} from 'ng-zorro-antd'; |
|
|
|
|
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
|
|
|
|
import {NzMessageService, NzModalService} from 'ng-zorro-antd'; |
|
|
|
|
import {Router} from '@angular/router'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@ -25,8 +25,12 @@ export class OilsDiscountComponent implements OnInit { |
|
|
|
|
isVisible = false; |
|
|
|
|
roleTypeArray; |
|
|
|
|
|
|
|
|
|
configOilMerNumModal = false; |
|
|
|
|
configOilMerNumForm: FormGroup; |
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
|
private form: FormBuilder, |
|
|
|
|
private modal: NzModalService, |
|
|
|
|
private company: CompanyService, |
|
|
|
|
private iconService: IconService, |
|
|
|
|
private message: NzMessageService, |
|
|
|
@ -50,6 +54,12 @@ export class OilsDiscountComponent implements OnInit { |
|
|
|
|
oilNo: [null], |
|
|
|
|
priceRate: [null], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.configOilMerNumForm = this.form.group({ |
|
|
|
|
codeType: ['OIL_WX_MER'], |
|
|
|
|
codeValue: [null, [Validators.required]], |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.getRequest(true, this.searchForm.value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -118,5 +128,44 @@ export class OilsDiscountComponent implements OnInit { |
|
|
|
|
this.isVisible = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
showConfigOilMerNum() { |
|
|
|
|
this.common.mappingSysNameOl('OIL_WX_MER', data => { |
|
|
|
|
this.configOilMerNumForm.patchValue(data['return_data']); |
|
|
|
|
}); |
|
|
|
|
this.configOilMerNumModal = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
closeConfigOilMerNum() { |
|
|
|
|
this.configOilMerNumModal = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
submitConfigOilMerNum() { |
|
|
|
|
for (const i in this.configOilMerNumForm.controls) { |
|
|
|
|
this.configOilMerNumForm.controls[i].markAsDirty(); |
|
|
|
|
this.configOilMerNumForm.controls[i].updateValueAndValidity(); |
|
|
|
|
} |
|
|
|
|
if (this.configOilMerNumForm.status == null || this.configOilMerNumForm.status !== 'VALID') { |
|
|
|
|
this.modal.warning({ |
|
|
|
|
nzTitle: '提示', |
|
|
|
|
nzContent: '请填写所有必填项', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.common.editConfig(this.configOilMerNumForm.value, data => { |
|
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
|
this.modal.success({ |
|
|
|
|
nzTitle: '提示', |
|
|
|
|
nzContent: '操作成功', |
|
|
|
|
}); |
|
|
|
|
this.closeConfigOilMerNum(); |
|
|
|
|
} else { |
|
|
|
|
this.modal.error({ |
|
|
|
|
nzTitle: '提示', |
|
|
|
|
nzContent: data['return_msg'], |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|