Commit efc8644b authored by wangqinghua's avatar wangqinghua

bug update

parent faf9b5bd
......@@ -20,7 +20,7 @@
<div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="2">
<button (click)="showModal()"
nz-button nzType="default"><i class="anticon anticon-search"></i>配置
nz-button nzType="default"><i class="anticon anticon-appstore"></i>配置
</button>
</div>
</div>
......@@ -36,7 +36,7 @@
<tr>
<th>事件编号</th>
<th nzWidth="30%">标题</th>
<th nzWidth="15%">处理人</th>
<th nzWidth="20%">处理人</th>
<th>状态</th>
</tr>
</thead>
......@@ -46,7 +46,7 @@
{{data.id}}
</td>
<td>
{{data.title}}
{{data.title | stringSlice:8:8}}
</td>
<td>
<span style="margin-right: 5px;" *ngFor="let item of data?.operators">
......@@ -78,7 +78,7 @@
<tbody>
<tr *ngFor="let data of nzTable2.data">
<td class="round-tag tag-form">
{{data.title}}
{{data.title | stringSlice:8:8}}
</td>
<td>
{{data.typeName}}
......@@ -119,7 +119,7 @@
<tbody>
<tr *ngFor="let data of nzTable3.data">
<td>
{{data.name}}
{{data.name | stringSlice:8:8}}
</td>
<td>
{{data.inventorycount}}
......@@ -128,7 +128,7 @@
<td>
{{data.usedcount}}
</td>
<td>{{data.eventSum}}</td>
<td>{{data.eventSum | stringSlice:8:8}}</td>
</tr>
</tbody>
</nz-table>
......@@ -149,9 +149,9 @@
<tbody>
<tr *ngFor="let data of nzTable4.data">
<td>{{data.inventoryNo}}</td>
<td>{{data.inventoryName}}</td>
<td>{{data.inventoryName | stringSlice:8:8}}</td>
<td>{{data.inventoryType}}</td>
<td>{{data.belongObject}}</td>
<td>{{data.belongObject | stringSlice:8:8}}</td>
</tr>
</tbody>
</nz-table>
......@@ -180,7 +180,7 @@
<span *ngIf="data.type == 2">重大变更</span>
<span *ngIf="data.type == 3">紧急变更</span>
</td>
<td>{{data.description}}</td>
<td>{{data.description | stringSlice:8:8}}</td>
<td>{{data.verifyUserName}}</td>
<td>
<span *ngIf="data.status == 1">待提交</span>
......@@ -211,7 +211,7 @@
<tbody>
<tr *ngFor="let data of nzTable6.data">
<td class="round-tag tag-form">
{{data.officeName}}
{{data.officeName | stringSlice:8:8}}
</td>
<td>{{data.officePrincipal}}</td>
<td>
......@@ -242,7 +242,7 @@
</thead>
<tbody>
<tr *ngFor="let data of nzTable7.data">
<td>{{data.name}}</td>
<td>{{data.name | stringSlice:8:8}}</td>
<td>{{data.principal}}</td>
<td>
<span *ngIf="data.type == 0">中心驻场</span>
......@@ -271,13 +271,12 @@
</thead>
<tbody>
<tr *ngFor="let data of nzTable8.data">
<td>{{data.name}}</td>
<td>{{data.name | stringSlice:8:8}}</td>
<td>
<span *ngIf="data.type == 0">驻场团队</span>
<span *ngIf="data.type == 1">非驻场团队</span>
</td>
<td>{{data.companyName}}</td>
<td>{{data.projectName}}</td>
<td>{{data.companyName | stringSlice:8:8}}</td>
<td>{{data.principal}}</td>
</tr>
</tbody>
......@@ -299,7 +298,7 @@
</thead>
<tbody>
<tr *ngFor="let data of nzTable9.data">
<td>{{data.projectName}}</td>
<td>{{data.projectName | stringSlice:8:8}}</td>
<td>{{data.timeStr | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.people}}</td>
<td>{{data.costdescribe}}</td>
......
......@@ -65,10 +65,10 @@
[nzPageIndex]="page.pageNum" [nzPageSize]="page.pageCount" (nzPageIndexChange)="change($event)">
<thead>
<tr>
<th nzWidth="10%">维护项目</th>
<th nzWidth="20%">维护项目</th>
<th>填报时间</th>
<th>填报人</th>
<th>费用说明</th>
<th nzWidth="20%">费用说明</th>
<th>总费用</th>
<th>备件采购</th>
<th>委外费用</th>
......
......@@ -196,7 +196,7 @@ export class CommonService implements OnInit {
getTimeByType(timeType) {
const nowDate = new Date().getTime();
const now = new Date(); //当前日期
const nowDayOfWeek = now.getDay(); //今天本周的第几天
const nowDayOfWeek = now.getDay() == 0 ? 7 : now.getDay(); //今天本周的第几天
const nowDay = now.getDate(); //当前日
const nowMonth = now.getMonth(); //当前月
const nowYear = now.getFullYear(); //当前年
......
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import {NgModule, CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {UnitConversionPipe} from './unit-conversion/unit-conversion.pipe';
import {StringSlicePipe} from './string-slice/string-slice.pipe';
@NgModule({
imports: [
],
imports: [],
declarations: [
StringSlicePipe,
UnitConversionPipe
],
providers: [
],
providers: [],
entryComponents: [],
exports: [
StringSlicePipe,
UnitConversionPipe
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class PipeModule {}
export class PipeModule {
}
......@@ -78,7 +78,7 @@
{{data.scrapcount}}
</td>
<td>{{data.eventSum}}</td>
<td class="handle text-center main-color">
<td class="handle main-color">
<span (click)="goToChild(data)">明细</span>
<span class="handle-delete" (click)="deleteChildType(data)">删除</span>
</td>
......
......@@ -87,6 +87,7 @@ export class AssetPartComponent implements OnInit {
this.router.navigate(['app/main/assetChild'],
{
queryParams: {
parentId: data.parentid,
id: data.id,
name: data.name
}
......
......@@ -54,7 +54,7 @@
<input type="text" nz-input [(ngModel)]="obj.person" placeholder="负责人">
</div>
<div nz-col nzSpan="6" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>搜索
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索
</button>
</div>
</div>
......
......@@ -15,8 +15,8 @@ import {Location} from '@angular/common';
styles: []
})
export class ChildAssetsComponent implements OnInit {
@ViewChild('smartAssets') smartAssets:AssetsComponent;
@ViewChild('smartUpload') smartUpload:UploadComponent;
@ViewChild('smartAssets') smartAssets: AssetsComponent;
@ViewChild('smartUpload') smartUpload: UploadComponent;
childrenList;
childName;
......@@ -29,26 +29,28 @@ export class ChildAssetsComponent implements OnInit {
indeterminate = false;
obj = {
inventoryTypeid:null,
name:null,
inventorycount:null,
mac:null,
person:null,
inventoryTypeid: null,
name: null,
inventorycount: null,
mac: null,
person: null,
};
parentId;
page = {
pageNum: 1,
totalNum:null,
pageCount:10,
}
totalNum: null,
pageCount: 10,
};
constructor(private workSer: WorkService, private routerInfo: ActivatedRoute,private router:Router,
private message:NzMessageService,private systemSer:SystemService,
private commonSer:CommonService,public location:Location) {
constructor(private workSer: WorkService, private routerInfo: ActivatedRoute, private router: Router,
private message: NzMessageService, private systemSer: SystemService,
private commonSer: CommonService, public location: Location) {
this.routerInfo.queryParams.subscribe(
(res) => {
this.obj.inventoryTypeid = res.id;
this.childName = res.name
this.parentId = res.parentId;
this.childName = res.name;
}
);
}
......@@ -57,7 +59,7 @@ export class ChildAssetsComponent implements OnInit {
this.childrenList.forEach(data => {
data.checked = value;
this.selectList.push(data);
})
});
this.refreshStatus();
}
......@@ -92,10 +94,10 @@ export class ChildAssetsComponent implements OnInit {
getList() {
this.isLoading = true;
const data = {
pageCount:"10",
pageNum:this.page.pageNum,
obj:this.obj
}
pageCount: '10',
pageNum: this.page.pageNum,
obj: this.obj
};
this.workSer.findInventoryPage(data).subscribe(
(res) => {
this.childrenList = res.data.data;
......@@ -105,123 +107,124 @@ export class ChildAssetsComponent implements OnInit {
);
}
search(){
search() {
this.page.pageNum = 1;
this.getList();
}
change(e){
if(e > 0){
change(e) {
if (e > 0) {
this.page.pageNum = e;
this.getList();
}
}
//删除资产--单个
deleteInVentory(item){
deleteInVentory(item) {
const data = {
inventoryIds:[]
inventoryIds: []
};
data.inventoryIds.push(item.id);
this.commonSer.confirmThing("删除","确定删除该资产?",()=>{
this.commonSer.confirmThing('删除', '确定删除该资产?', () => {
this.isLoading = true;
this.workSer.deleteInventory(data).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.getList();
this.message.success("删除资产成功");
this.message.success('删除资产成功');
}
this.isLoading = false;
}
)
})
);
});
}
//批量删除
batchDeleteInventory(){
if(this.selectList.length == 0){
this.message.warning("请选择需要删除的资产");
batchDeleteInventory() {
if (this.selectList.length == 0) {
this.message.warning('请选择需要删除的资产');
return false;
}
this.isLoading = true;
const data = {
inventoryIds:this.selectList.map(e=>{
inventoryIds: this.selectList.map(e => {
return e.id;
})
};
this.commonSer.confirmThing("批量删除","确定删除选择的资产?",()=>{
this.commonSer.confirmThing('批量删除', '确定删除选择的资产?', () => {
this.workSer.deleteInventory(data).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.getList();
this.message.success("删除资产成功");
this.message.success('删除资产成功');
}
this.isLoading = false;
}
)
})
);
});
}
//添加资产
showAddModal() {
this.smartAssets.showAddModal("添加资产");
this.smartAssets.showAddModal('添加资产', {parentId: this.parentId, inventoryTypeid: this.obj.inventoryTypeid});
}
//编辑资产
showEditModal(id){
this.smartAssets.showEditModal("编辑资产",id);
showEditModal(id) {
this.smartAssets.showEditModal('编辑资产', id);
}
//查看详情
goToDetail(data){
this.router.navigate(['app/main/assetsDetail'],{
queryParams:{
invertoryId:data.id
goToDetail(data) {
this.router.navigate(['app/main/assetsDetail'], {
queryParams: {
invertoryId: data.id
}
})
});
}
//导入资产
showUploadModal(){
this.smartUpload.showModal("上传资产文件");
showUploadModal() {
this.smartUpload.showModal('上传资产文件');
}
//下载模版
downLoad(){
this.systemSer.downloadTemplate("inventory",SERVER_API_URL + "/api/template/download/").subscribe(
(data)=>{
this.commonSer.downloadFile("资产模版.xlsx",data);
downLoad() {
this.systemSer.downloadTemplate('inventory', SERVER_API_URL + '/api/template/download/').subscribe(
(data) => {
this.commonSer.downloadFile('资产模版.xlsx', data);
}
)
);
}
//导出资产
downloadInventory(){
downloadInventory() {
let title;
title = this.selectList.length == 0? "确定导出所有的资产?":"确定导出所选择的资产";
this.commonSer.confirmThing("导出",title,()=>{
title = this.selectList.length == 0 ? '确定导出所有的资产?' : '确定导出所选择的资产';
this.commonSer.confirmThing('导出', title, () => {
this.isDownload = true;
const data = {
type:this.obj.inventoryTypeid,
ids: this.selectList.map(e=>{
type: this.obj.inventoryTypeid,
ids: this.selectList.map(e => {
return e.id;
}),
query_name:null
query_name: null
};
this.workSer.getExportUrl(data).subscribe(
(res)=>{
(res) => {
this.isDownload = false;
this.workSer.downloadTemplate("inventory",res.data).subscribe(
(data)=>{
this.commonSer.downloadFile("文件.xlsx",data)
this.workSer.downloadTemplate('inventory', res.data).subscribe(
(data) => {
this.commonSer.downloadFile('文件.xlsx', data);
}
)
);
}
)
);
});
}
//返回上一页
returnBack(){
returnBack() {
this.location.back();
}
}
......@@ -15,15 +15,15 @@ export class AssetsComponent implements OnInit {
isVisible = false;
title;
parentId;
validateForm:FormGroup;
validateForm: FormGroup;
parentTypeList;
typeList;
invertoryId; //资产Id
constructor(private workSer:WorkService,private fb:FormBuilder,private datePipe:DatePipe,
private message:NzMessageService) {
constructor(private workSer: WorkService, private fb: FormBuilder, private datePipe: DatePipe,
private message: NzMessageService) {
}
ngOnInit() {
......@@ -31,114 +31,116 @@ export class AssetsComponent implements OnInit {
this.initForm();
}
initForm(){
initForm() {
this.invertoryId = null;
this.validateForm = this.fb.group({
serialnoA:[null],
invertoryname:[null],
name:[null,[Validators.required,Validators.maxLength(20)]],
hostid:[null],
person:[null],
ip:[null],
equipmentTypeid:[null],
inventorycount:[null],
secondlevelTypeid:[null],
stock:[null],
usedcount:[null],
lendcount:[null],
mac:[null],
repaircount:[null],
maintenanceExpiration:[null],
scrapcount:[null],
storageLocation:[null],
groupid:[null],
inventoryTypeid:[null,[Validators.required]],
serialnoA: [null],
invertoryname: [null],
name: [null, [Validators.required, Validators.maxLength(20)]],
hostid: [null],
person: [null],
ip: [null],
equipmentTypeid: [null],
inventorycount: [null],
secondlevelTypeid: [null],
stock: [null],
usedcount: [null],
lendcount: [null],
mac: [null],
repaircount: [null],
maintenanceExpiration: [null],
scrapcount: [null],
storageLocation: [null],
groupid: [null],
inventoryTypeid: [null, [Validators.required]],
});
}
//父级分类
getParentType(){
getParentType() {
this.workSer.findByParentType().subscribe(
(res)=>{
const data = res.data;
this.parentTypeList = data;
(res) => {
this.parentTypeList = res.data;
}
)
);
}
//通过父级分类查询子级分类
getTypeByParent(parentid){
getTypeByParent(parentid) {
this.workSer.findByParentidCount(parentid).subscribe(
(res)=>{
const data = res.data;
this.typeList = data;
(res) => {
this.typeList = res.data;
}
)
);
}
showAddModal(title) {
showAddModal(title, data) {
this.parentId = data.parentId;
this.getTypeByParent(this.parentId);
this.validateForm.patchValue({inventoryTypeid: data.inventoryTypeid});
this.title = title;
this.isVisible = true;
}
showEditModal(title,id) {
showEditModal(title, id) {
this.title = title;
this.invertoryId = id;
this.isVisible = true;
this.workSer.selectByPrimaryKey(this.invertoryId).subscribe(
(res)=>{
(res) => {
this.parentId = res.data.typeparentid;
this.validateForm.patchValue( res.data );
if(res.data.typeparentid){
this.validateForm.patchValue(res.data);
if (res.data.typeparentid) {
this.getTypeByParent(res.data.typeparentid);
}
}
)
);
}
handEditleOk() {
for(let i in this.validateForm.controls){
for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
}
if(this.validateForm.invalid){
if (this.validateForm.invalid) {
return false;
}
if(this.title == "添加资产"){
if (this.title == '添加资产') {
this.create();
}
if(this.title == "编辑资产"){
if (this.title == '编辑资产') {
this.update();
}
}
create(){
create() {
this.workSer.createInventory(this.validateForm.value).subscribe(
(res)=>{
if(res.errCode == 10000){
this.message.success("添加资产成功");
(res) => {
if (res.errCode == 10000) {
this.message.success('添加资产成功');
this.isVisible = false;
this.done.emit();
this.initForm();
}
}
)
);
}
update(){
this.validateForm.addControl('id',new FormControl(this.invertoryId));
update() {
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")
})
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("编辑资产成功");
(res) => {
if (res.errCode == 10000) {
this.message.success('编辑资产成功');
this.isVisible = false;
this.initForm();
this.done.emit();
}
}
)
);
}
handleEditCancel() {
......
......@@ -8,7 +8,7 @@
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="title">计划标题</nz-form-label>
<nz-form-control [nzSpan]="14">
<input id="title" name="title" nz-input placeholder="计划标题" formControlName="title">
<nz-form-explain *ngIf="validateForm.get('title').dirty && validateForm.get('title').errors">请输入计划标题</nz-form-explain>
<nz-form-explain *ngIf="validateForm.get('title').dirty && validateForm.get('title').errors">请输入计划标题且不超过20字</nz-form-explain>
</nz-form-control>
</nz-form-item>
</div>
......
......@@ -42,7 +42,7 @@ export class PlanModalComponent implements OnInit {
this.participantsList = [];
this.principalsList = [];
this.validateForm = this.fb.group({
title: [null, [Validators.required]],
title: [null, [Validators.required],Validators.maxLength(20)],
typeId: [null, [Validators.required]],
startTime: [null, [Validators.required]],
endTime: [null, [Validators.required]],
......@@ -50,7 +50,7 @@ export class PlanModalComponent implements OnInit {
cycleNum: ['1'],
number: [null, [Validators.required]],
workload: [null],
description: [null],
description: [null,Validators.maxLength(100)],
principals: [null, [Validators.required]], //负责人
participants: [null, [Validators.required]], //参与人
});
......
......@@ -26,7 +26,7 @@
}
.container {
background-color: #ebedf0;
background-color: #ffffff;
}
.search-form {
......
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