Commit ac336ff4 authored by wangqinghua's avatar wangqinghua

update

parent c661abcd
......@@ -56,7 +56,7 @@
></nz-date-picker>
</ng-container>
</div>
<div nz-col nzSpan="3">
<div nz-col nzSpan="3" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search" style="color: #6097b7"></i>搜索</button>
</div>
</div>
......@@ -71,7 +71,6 @@
<th>状态</th>
<th>发送方式</th>
<th>发送对象</th>
<!--<th>操作</th>-->
</tr>
</thead>
<tbody>
......@@ -101,9 +100,6 @@
<td>
{{data.sendto}}
</td>
<!--<td class="handle main-color">-->
<!--<span (click)="deleteLog(data)">删除</span>-->
<!--</td>-->
</tr>
</tbody>
</nz-table>
......
......@@ -169,6 +169,7 @@ export class AlarmLogComponent implements OnInit {
this.obj.time_from = new Date(this.startTime).getTime();
this.obj.time_till = new Date(this.endTime).getTime();
}
this.pageNum = 1;
this.getList();
}
......
......@@ -20,7 +20,7 @@
<div nz-row class="search-form">
<div nz-col nzSpan="12">
<nz-select style="width: 200px;" nzPlaceHolder="选择告警组" [(ngModel)]="alertGroupId" (ngModelChange)="getList()">
<nz-select style="width: 200px;" nzPlaceHolder="选择告警组" [(ngModel)]="alertGroupId" (ngModelChange)="search()">
<ng-container *ngFor="let item of groupList;let i = index;">
<nz-option nzLabel="{{item.name}}" nzValue="{{item.id}}"></nz-option>
</ng-container>
......
......@@ -30,6 +30,11 @@ export class AlarmSetComponent implements OnInit {
this.getGroupAlarm();
}
search(){
this.pageNum = 1;
this.getList();
}
//获取推送设置列表
getList() {
this.isLoading = true;
......@@ -86,6 +91,7 @@ export class AlarmSetComponent implements OnInit {
this.alarmSer.alertGroupDelete(arr).subscribe(
(res) => {
if (res.errCode == 10000) {
this.search();
this.message.info('删除成功');
} else {
this.message.info(res.errMsg);
......@@ -114,6 +120,8 @@ export class AlarmSetComponent implements OnInit {
}
change(e) {
this.pageNum = e;
this.getList();
}
//新增告警推送
......@@ -138,7 +146,7 @@ export class AlarmSetComponent implements OnInit {
(res) => {
if (res.errCode == 10000) {
this.message.info(title + '成功');
this.getList();
this.search();
} else {
this.message.info(res.errMsg);
}
......@@ -150,7 +158,6 @@ export class AlarmSetComponent implements OnInit {
});
}
//删除告警
deleteAlarm(item) {
this.modalSer.confirm({
......@@ -167,7 +174,7 @@ export class AlarmSetComponent implements OnInit {
(res) => {
if (res.errCode == 10000) {
this.message.info('删除成功');
this.getList();
this.search();
} else {
this.message.info(res.errMsg);
}
......
......@@ -23,7 +23,7 @@
</div>
<div nz-col nzSpan="8" class="text-right">
<input style="width: 50%;" nz-input placeholder="姓名/手机号码" [(ngModel)]="name">
<button (click)="getUser()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
</div>
</div>
<div nz-row [nzGutter]="12">
......
......@@ -85,6 +85,11 @@ export class GroupComponent implements OnInit {
);
}
search(){
this.pageNum = 1;
this.getUser();
}
changePage(e) {
this.pageNum = e;
this.getUser();
......
......@@ -57,7 +57,7 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let data of childrenList">
<tr *ngFor="let data of nzTable.data">
<td class="round-tag tag-form main-font-color cursor">
<span (click)="showCEditModal(data.id)">{{data.name}}</span>
</td>
......
......@@ -206,9 +206,7 @@
</div>
</nz-tab>
<nz-tab #thirdTabs nzTitle="关联事件">
<nz-table #nzTable [nzData]="thingList" [nzFrontPagination]="false" [nzTotal]="totalNum"
[nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)"
[nzLoading]="loading">
<nz-table #nzTable [nzData]="thingList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead>
<tr>
<th nzShowSort>时间</th>
......@@ -222,7 +220,7 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let data of thingList">
<tr *ngFor="let data of nzTable.data">
<td class="table-timeline">
<nz-timeline-item>{{data.createTime | date:"yyyy-MM-dd HH:mm:ss"}}</nz-timeline-item>
</td>
......
......@@ -52,8 +52,8 @@ export class AssetsDetailComponent implements OnInit {
getEventList(){
this.loading = true;
const data = {
pageCount: this.pageCount,
pageNum: this.pageNum,
"pageCount": this.pageCount,
"pageNum": this.pageNum,
"inventoryId":this.invertoryId
};
this.workSer.find(data).subscribe(
......
......@@ -35,7 +35,7 @@
</div>
</div>
<nz-table #nzTable [nzData]="childrenList">
<nz-table #nzTable [nzData]="childrenList" [nzShowPagination]="true">
<thead>
<tr>
<th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked" (nzCheckedChange)="checkAll($event)"></th>
......@@ -52,26 +52,16 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let data of childrenList">
<tr *ngFor="let data of nzTable.data">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td class="round-tag tag-form">
{{data.inventoryNo}}
</td>
<td>
{{data.name}}
</td>
<td class="round-tag tag-form">{{data.inventoryNo}}</td>
<td>{{data.name}}</td>
<td>{{data.inventorycount}}</td>
<td>{{data.stock}}</td>
<td>
{{data.usedcount}}
</td>
<td>{{data.usedcount}}</td>
<td>{{data.lendcount}}</td>
<td>
{{data.repaircount}}
</td>
<td>
{{data.scrapcount}}
</td>
<td>{{data.repaircount}}</td>
<td>{{data.scrapcount}}</td>
<td>{{data.eventSum}}</td>
<td class="handle text-center main-color">
<span (click)="goToDetail(data)">查看</span>
......
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
import {WorkService} from '../../work.service';
import {NzMessageService} from 'ng-zorro-antd';
import {DatePipe} from '@angular/common';
......@@ -20,17 +20,19 @@ export class AssetsComponent implements OnInit {
parentTypeList;
typeList;
invertoryId //资产Id
invertoryId; //资产Id
constructor(private workSer:WorkService,private fb:FormBuilder,private datePipe:DatePipe,
private message:NzMessageService) {
}
ngOnInit() {
this.getParentType();
this.initForm();
}
initForm(){
this.invertoryId = null;
this.validateForm = this.fb.group({
serialnoA:[null],
invertoryname:[null],
......@@ -76,17 +78,19 @@ export class AssetsComponent implements OnInit {
showAddModal(title) {
this.title = title;
this.isVisible = true;
this.getParentType();
}
showEditModal(title,id) {
this.title = title;
this.invertoryId = id;
this.isVisible = true;
this.getParentType();
this.workSer.selectByPrimaryKey(this.invertoryId).subscribe(
(res)=>{
this.parentId = res.data.typeparentid;
this.validateForm.patchValue( res.data );
if(res.data.typeparentid){
this.getTypeByParent(res.data.typeparentid);
}
}
)
}
......@@ -114,6 +118,7 @@ export class AssetsComponent implements OnInit {
this.message.success("添加资产成功");
this.isVisible = false;
this.done.emit();
this.initForm();
}else{
this.message.error(res.errMsg);
}
......@@ -122,13 +127,16 @@ export class AssetsComponent implements OnInit {
}
update(){
this.validateForm.value.id = this.invertoryId;
this.validateForm.value.maintenanceExpiration = this.datePipe.transform(this.validateForm.value.maintenanceExpiration,"yyyy-MM-dd HH:mm:ss");
this.validateForm.addControl('id',new FormControl(this.invertoryId));
this.validateForm.patchValue({
maintenanceExpiration:this.datePipe.transform(this.validateForm.value.maintenanceExpiration,"yyyy-MM-dd HH:mm:ss")
})
this.workSer.updateInventory(this.validateForm.value).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("编辑资产成功");
this.isVisible = false;
this.initForm();
this.done.emit();
}else{
this.message.error(res.errMsg);
......@@ -138,6 +146,7 @@ export class AssetsComponent implements OnInit {
}
handleEditCancel() {
this.initForm();
this.isVisible = false;
}
......
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