Commit b3c43f0b authored by wangqinghua's avatar wangqinghua

modal update

parent 654873f4
......@@ -129,9 +129,9 @@ import {CreateCompanyComponent} from './project-manager/modal/create-company/cre
import {TrackInfoComponent} from './project-manager/modal/track-info/track-info.component';
import {CreateProjectComponent} from './project-manager/modal/create-project/create-project.component';
import {CreateTeamComponent} from './project-manager/modal/create-team/create-team.component';
import {ProjectModalComponent} from './project-modal/project-modal.component';
import {TeamModalComponent} from './team-modal/team-modal.component';
import {CompanyModalComponent} from './company-modal/company-modal.component';
import {ProjectModalComponent} from './project-manager/modal/project-modal/project-modal.component';
import {TeamModalComponent} from './project-manager/modal/team-modal/team-modal.component';
import {CompanyModalComponent} from './project-manager/modal/company-modal/company-modal.component';
@NgModule({
imports: [
......
......@@ -32,6 +32,10 @@ export class CompanyModalComponent implements OnInit {
this.getList();
}
showModal(){
this.isVisiable = true;
}
getList() {
this.page.isLoading = true;
const obj = {
......@@ -39,7 +43,7 @@ export class CompanyModalComponent implements OnInit {
pageNum: this.page.pageNum,
pageCount: this.page.pageCount
};
this.projectSer.selectMaintainTeam(obj).subscribe(
this.projectSer.selectMaintainCompany(obj).subscribe(
(res) => {
if (res.errCode == 10000) {
this.page.list = res.data.data;
......@@ -60,13 +64,14 @@ export class CompanyModalComponent implements OnInit {
}
selectItem(item, e) {
console.log(e);
if (e) {
const arr = this.page.list.map(data => {
return data.itemId;
return data.id;
});
const old = this.inSelect;
if (old) {
const index = arr.indexOf(old.itemId);
const index = arr.indexOf(old.id);
this.page.list[index].checked = false;
}
this.inSelect = item;
......
......@@ -92,3 +92,4 @@
</nz-tab>
</nz-tabset>
</nz-modal>
<smart-company-modal #smartCompanyModal (done)="getCompany($event)"></smart-company-modal>
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
import {NzMessageService, UploadFile} from 'ng-zorro-antd';
import {opr_company_type, project_type} from '../../project.constants';
import {SystemService} from '../../../system/system.service';
import {ProjectService} from '../../project.service';
import {CompanyModalComponent} from '../company-modal/company-modal.component';
@Component({
selector: 'smart-create-project',
......@@ -11,6 +12,7 @@ import {ProjectService} from '../../project.service';
styles: []
})
export class CreateProjectComponent implements OnInit {
@ViewChild('smartCompanyModal') smartCompanyModal: CompanyModalComponent;
@Output() done = new EventEmitter<any>();
tabNum = 0; //tabs面板的序列号
timeFormat = 'yyyy-MM-dd';
......@@ -40,9 +42,12 @@ export class CreateProjectComponent implements OnInit {
aPrincipal: [null],
amount: [null],
type: [null],
companyId: [null],
teamId: [null],
principal: [null],
startDate: [null],
endDate: [null],
status: [0],
});
}
......@@ -134,7 +139,15 @@ export class CreateProjectComponent implements OnInit {
}
//showProjectmodal
showProjectmodal(){
showProjectmodal() {
this.smartCompanyModal.showModal();
}
getCompany(e) {
console.log(e);
const d = {
companyId: e.id
};
this.validateForm.patchValue(d);
}
}
......@@ -13,6 +13,7 @@
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="companyId">所在公司</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input id="companyId">
<button nz-button nzType="primary" (click)="showCompany()">选择</button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
......@@ -28,7 +29,8 @@
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="projectId">关联项目</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<input nz-input id="projectId">
<input nz-input id="projectId" formControlName="projectId">
<button nz-button nzType="primary" (click)="showProjectmodal()">选择</button>
</nz-form-control>
</nz-form-item>
<nz-form-item>
......@@ -68,3 +70,7 @@
</nz-tab>
</nz-tabset>
</nz-modal>
<smart-project-modal #smartProjectModal (done)="getProject($event)"></smart-project-modal>
<smart-company-modal #smartCompanyModal (done)="getCompany($event)"></smart-company-modal>
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {Component, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
import {NzMessageService, UploadFile} from 'ng-zorro-antd';
import {opr_company_type, opr_team_type} from '../../project.constants';
import {SystemService} from '../../../system/system.service';
import {ProjectService} from '../../project.service';
import {ProjectModalComponent} from '../project-modal/project-modal.component';
import {CompanyModalComponent} from '../company-modal/company-modal.component';
@Component({
selector: 'smart-create-team',
......@@ -11,6 +13,9 @@ import {ProjectService} from '../../project.service';
styles: []
})
export class CreateTeamComponent implements OnInit {
@ViewChild('smartProjectModal') smartProjectModal:ProjectModalComponent;
@ViewChild('smartCompanyModal') smartCompanyModal:CompanyModalComponent;
@Output() done = new EventEmitter<any>();
tabNum = 0; //tabs面板的序列号
......@@ -126,4 +131,23 @@ export class CreateTeamComponent implements OnInit {
tabsChange(num) {
this.tabNum = num;
}
// 选择的项目
showProjectmodal(){
}
//获取选择的项目
getProject(e){
}
//选择公司
showCompany(){
this.smartCompanyModal.showModal();
}
getCompany(e){
}
}
......@@ -32,6 +32,10 @@ export class ProjectModalComponent implements OnInit {
this.getList();
}
showModal(){
this.isVisiable = true;
}
getList() {
this.page.isLoading = true;
const obj = {
......@@ -39,7 +43,7 @@ export class ProjectModalComponent implements OnInit {
pageNum: this.page.pageNum,
pageCount: this.page.pageCount
};
this.projectSer.selectMaintainTeam(obj).subscribe(
this.projectSer.selectMaintainProject(obj).subscribe(
(res) => {
if (res.errCode == 10000) {
this.page.list = res.data.data;
......
......@@ -32,6 +32,10 @@ export class TeamModalComponent implements OnInit {
this.getList();
}
showModal(){
this.isVisiable = true;
}
getList() {
this.page.isLoading = true;
const obj = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment