Commit d4792a52 authored by wangqinghua's avatar wangqinghua

运维

parent 3ead38aa
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
</td> </td>
<td>{{data.projectNum}}</td> <td>{{data.projectNum}}</td>
<td>{{data.totalAmount}}</td> <td>{{data.totalAmount}}</td>
<td>{{data.companyName}}</td>
<td class="handle text-center main-color"> <td class="handle text-center main-color">
<span>编辑</span> <span>编辑</span>
<span>查看</span> <span>查看</span>
......
<p> <div nz-row class="breadcrumbs">
opr-cost works! <div nz-col nzSpan="16">
</p> <nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>项目管理</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
运维费用
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<smart-full-screen></smart-full-screen>
</div>
</div>
<div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="6">
<nz-select nzAllowClear style="width: 100%;" [(ngModel)]="obj.name" nzPlaceHolder="所在项目">
<ng-container *ngFor="let item of statusList">
<nz-option [nzLabel]="item.key" [nzValue]="item.value"></nz-option>
</ng-container>
</nz-select>
</div>
<div nz-col nzSpan="8">
<input type="text" (keyup.enter)="search()" nz-input [(ngModel)]="obj.people" placeholder="填 报 人">
</div>
<div nz-col nzSpan="2">
<button (click)="search()"
nz-button nzType="default"><i class="anticon anticon-search" style="color: #6097b7"></i>搜索
</button>
</div>
</div>
<div nz-row [nzGutter]="4" class="padding-15-0">
<div nz-col nzSpan="12">
&nbsp;&nbsp;&nbsp;&nbsp;间:
<nz-radio-group [(ngModel)]="obj.startTime">
<label *ngFor="let item of statusList" (click)="search()" nz-radio-button
[nzValue]="item.key">{{item.value}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="12">
<nz-date-picker
[nzFormat]="timeFormat"
[(ngModel)]="obj.startTime"
nzPlaceHolder="开始时间"></nz-date-picker>
<nz-date-picker
[nzFormat]="timeFormat"
[(ngModel)]="obj.endTime"
nzPlaceHolder="结束时间"></nz-date-picker>
</div>
</div>
<div nz-row [nzGutter]="4" class="padding-15-0">
<div nz-col nzSpan="18">
费用类型:
<nz-radio-group [(ngModel)]="obj.type">
<label *ngFor="let item of costType" (click)="search()" nz-radio-button
[nzValue]="item.key">{{item.value}}</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="3">
<button (click)="search()"
nz-button nzType="default"><i class="anticon anticon-search" style="color: #6097b7"></i>新增运维费用
</button>
</div>
</div>
<nz-table #nzTable [nzData]="page.list" [nzLoading]="page.isLoading" [nzFrontPagination]="false"
[nzTotal]="page.totalNum"
[nzPageIndex]="page.pageNum" [nzPageSize]="page.pageCount" (nzPageIndexChange)="change($event)">
<thead>
<tr>
<th>维护项目</th>
<th>填报时间</th>
<th>填报人</th>
<th>费用说明</th>
<th>总费用</th>
<th>备件采购</th>
<th>委外费用</th>
<th>其他费用</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of nzTable.data">
<td>{{data.name}}</td>
<td>{{data.timeStr | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.people}}</td>
<td>{{data.costdescribe}}</td>
<td>{{data.total}}</td>
<td>{{data.purchasenum}}项/{{data.purchasemoney}}元</td>
<td>{{data.outsourcingnum}}项/{{data.outsourcingmoney}}元</td>
<td>{{data.othernum}}项/{{data.othermoney}}元</td>
<td class="handle text-center main-color">
<span>查看</span>
</td>
</tr>
</tbody>
</nz-table>
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {opr_cost_type, project_status} from '../project.constants';
import {pageSize} from '../../app.constants';
import {WorkService} from '../../work/work.service';
import {NzMessageService} from 'ng-zorro-antd';
import {ProjectService} from '../project.service';
import {Router} from '@angular/router';
import {CommonService} from '../../shared/common/common.service';
import {DatePipe} from '@angular/common';
@Component({ @Component({
selector: 'app-opr-cost', selector: 'app-opr-cost',
...@@ -6,10 +14,66 @@ import { Component, OnInit } from '@angular/core'; ...@@ -6,10 +14,66 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./opr-cost.component.css'] styleUrls: ['./opr-cost.component.css']
}) })
export class OprCostComponent implements OnInit { export class OprCostComponent implements OnInit {
timeFormat = 'yyyy';
constructor() { } statusList = project_status;
costType = opr_cost_type;
page = {
list: [],
isLoading: false,
pageCount: pageSize,
pageNum: 1,
totalNum: null
};
obj = {
people: '', //填报人
name: '', //费用名称
type: null, //费用类型
startTime: null, //开始时间
endTime: null //结束时间
};
constructor(private workSer: WorkService, private message: NzMessageService,private projectSer:ProjectService,
private router: Router, private commonSer: CommonService, private datePipe: DatePipe) {
}
ngOnInit() { ngOnInit() {
this.getList();
}
//获取列表
getList() {
this.page.isLoading = true;
const obj = {
obj: this.obj,
pageNum: this.page.pageNum,
pageCount: this.page.pageCount
};
this.projectSer.findPageCost(obj).subscribe(
(res) => {
if (res.errCode == 10000) {
this.page.list = res.data.data;
this.page.totalNum = res.data.totalNum;
this.page.isLoading = false;
}
}
);
}
//翻页
change(e) {
this.page.pageNum = e;
this.getList();
}
//搜索
search() {
this.page.pageNum = 1;
// this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss');
// this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss');
this.getList();
} }
} }
...@@ -20,7 +20,7 @@ export class OprProjectComponent implements OnInit { ...@@ -20,7 +20,7 @@ export class OprProjectComponent implements OnInit {
timeFormat = 'yyyy'; timeFormat = 'yyyy';
statusList = [{key: '全部', value: null}, ...project_status]; statusList = project_status;
page = { page = {
list: [], list: [],
......
...@@ -67,6 +67,4 @@ export class OprTeamComponent implements OnInit { ...@@ -67,6 +67,4 @@ export class OprTeamComponent implements OnInit {
this.page.pageNum = 1; this.page.pageNum = 1;
this.getList(); this.getList();
} }
} }
...@@ -119,4 +119,30 @@ export class ProjectService { ...@@ -119,4 +119,30 @@ export class ProjectService {
selectProjectCount1(data): Observable<any> { selectProjectCount1(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/maintainProject/selectProjectCount', data); return this.http.post(SERVER_API_URL + '/maintainProject/selectProjectCount', data);
} }
//费用记录
//修改费用记录
updateCost(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/cost/updateCost', data);
}
//分页筛选费用记录
findPageCost(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/cost/findPage', data);
}
//批量删除费用记录
deleteCost(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/cost/deleteCost', data);
}
//新增费用记录
addCost(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/cost/addCost', data);
}
//根据费用id查询
findById(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/cost/findById', data);
}
} }
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