You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
848 B
35 lines
848 B
4 years ago
|
import { Component, OnInit, Inject } from '@angular/core';
|
||
|
import { HttpClient } from '@angular/common/http';
|
||
|
import {MatDialogRef} from '@angular/material/dialog';
|
||
|
|
||
|
|
||
|
|
||
|
@Component({
|
||
|
selector: 'addenterpriseuser',
|
||
|
templateUrl: './addenterpriseuser.component.html',
|
||
|
styleUrls: ['./enterpriseuser.component.scss']
|
||
|
})
|
||
|
export class AddEnterpriserUser {
|
||
|
|
||
|
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddEnterpriserUser>) {}
|
||
|
|
||
|
errmsg:any; //捕获错误信息
|
||
|
//提交创建表单
|
||
|
onSubmit (e) {
|
||
|
let date = new Date()
|
||
|
this.http.post('/api/CompanyUsers',{
|
||
|
name:e.loginName,
|
||
|
phone:e.tel,
|
||
|
enabled:true,
|
||
|
creationTime:date,
|
||
|
usci:e.creditcode,
|
||
|
companyName:e.unitname
|
||
|
}).subscribe(data=>{
|
||
|
this.dialogRef.close(data)},
|
||
|
error=>{this.errmsg=error}
|
||
|
)
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|