This commit is contained in:
wangshiming
2022-05-11 15:30:45 +08:00
parent 2579a38d01
commit c95afd09f7

View File

@ -3,7 +3,6 @@ import { ActivatedRoute } from '@angular/router';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { RecordedService } from '../../services/recorded.service'; import { RecordedService } from '../../services/recorded.service';
@Component({ @Component({
selector: 'app-partner-recored-detail', selector: 'app-partner-recored-detail',
templateUrl: './detail.component.html', templateUrl: './detail.component.html',
@ -21,7 +20,7 @@ export class PartnerRecordedDetailComponent implements OnInit {
this.getRecordedDetail(this.id); this.getRecordedDetail(this.id);
} }
ngOnInit(): void { } ngOnInit(): void {}
getRecordedDetail(id: string) { getRecordedDetail(id: string) {
this.service.request(this.service.$api_get_recorded_record_detail, { id }).subscribe(res => { this.service.request(this.service.$api_get_recorded_record_detail, { id }).subscribe(res => {
@ -87,18 +86,28 @@ export class PartnerRecordedDetailComponent implements OnInit {
this.service.msgSrv.warning('请填写拒绝原因 '); this.service.msgSrv.warning('请填写拒绝原因 ');
return; return;
} }
this.audit({ ids: params, rejectReason: this.msg, sts: '3' }, () => { this.audit(
modal.destroy(true); { ids: params, rejectReason: this.msg, sts: '3' },
}, '审核拒绝成功'); () => {
modal.destroy(true);
},
'审核拒绝成功'
);
} }
}, },
{ {
label: '通过', label: '通过',
type: 'primary', type: 'primary',
onClick: () => { onClick: () => {
this.audit({ ids: params, rejectReason: this.msg, sts: this.formData?.sts === '0' ? 1 : 2 }, () => { console.log(this.formData?.sts);
modal.destroy(true);
}, `${this.formData?.sts === '1' ? '审核' : '复审'}通过成功`); this.audit(
{ ids: params, rejectReason: this.msg, sts: this.formData?.sts === '0' ? 1 : 2 },
() => {
modal.destroy(true);
},
`${this.formData?.sts === '1' ? '审核' : '复审'}通过成功`
);
} }
} }
] ]
@ -117,13 +126,11 @@ export class PartnerRecordedDetailComponent implements OnInit {
* 审核 * 审核
*/ */
audit(params: any, callback: Function, msg = '成功') { audit(params: any, callback: Function, msg = '成功') {
this.service this.service.request(this.service.$api_audit_recored, {...params}).subscribe(res => {
.request(this.service.$api_audit_recored, ...params) if (res) {
.subscribe(res => { this.service.msgSrv.success(msg);
if (res) { callback();
this.service.msgSrv.success(msg); }
callback(); });
}
});
} }
} }