Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
smart
Commits
f378c4a2
Commit
f378c4a2
authored
Dec 14, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commonService
parent
15fe5653
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
128 additions
and
42 deletions
+128
-42
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+2
-0
app.route.ts
src/main/webapp/app/app.route.ts
+1
-1
asset-part.component.html
...main/webapp/app/work/asset-part/asset-part.component.html
+7
-5
asset-part.component.ts
src/main/webapp/app/work/asset-part/asset-part.component.ts
+14
-2
assets-detail.component.html
...ork/asset-part/assets-detail/assets-detail.component.html
+36
-23
assets-detail.component.ts
.../work/asset-part/assets-detail/assets-detail.component.ts
+20
-1
child-assets.component.html
.../work/asset-part/child-assets/child-assets.component.html
+1
-1
child-assets.component.ts
...pp/work/asset-part/child-assets/child-assets.component.ts
+12
-2
type-asets.component.ts
.../webapp/app/work/modal/type-asets/type-asets.component.ts
+25
-6
work.service.ts
src/main/webapp/app/work/work.service.ts
+10
-1
No files found.
src/main/webapp/app/app.main.module.ts
View file @
f378c4a2
...
@@ -81,6 +81,7 @@ import {TypeAsetsComponent} from './work/modal/type-asets/type-asets.component';
...
@@ -81,6 +81,7 @@ import {TypeAsetsComponent} from './work/modal/type-asets/type-asets.component';
import
{
AssetsDetailComponent
}
from
'./work/asset-part/assets-detail/assets-detail.component'
;
import
{
AssetsDetailComponent
}
from
'./work/asset-part/assets-detail/assets-detail.component'
;
import
{
AssetsComponent
}
from
'./work/modal/assets/assets.component'
;
import
{
AssetsComponent
}
from
'./work/modal/assets/assets.component'
;
import
{
ChildAssetsComponent
}
from
'./work/asset-part/child-assets/child-assets.component'
;
import
{
ChildAssetsComponent
}
from
'./work/asset-part/child-assets/child-assets.component'
;
import
{
UploadComponent
}
from
'./work/modal/upload/upload.component'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
@@ -162,6 +163,7 @@ import {ChildAssetsComponent} from './work/asset-part/child-assets/child-assets.
...
@@ -162,6 +163,7 @@ import {ChildAssetsComponent} from './work/asset-part/child-assets/child-assets.
AssetsDetailComponent
,
AssetsDetailComponent
,
AssetsComponent
,
AssetsComponent
,
ChildAssetsComponent
,
ChildAssetsComponent
,
UploadComponent
,
],
],
providers
:[
providers
:[
OverAllService
,
OverAllService
,
...
...
src/main/webapp/app/app.route.ts
View file @
f378c4a2
...
@@ -56,7 +56,7 @@ export const route: Routes = [
...
@@ -56,7 +56,7 @@ export const route: Routes = [
{
path
:
'inspectPlan'
,
component
:
InspectPlanComponent
},
{
path
:
'inspectPlan'
,
component
:
InspectPlanComponent
},
{
path
:
'assetPart'
,
component
:
AssetPartComponent
},
{
path
:
'assetPart'
,
component
:
AssetPartComponent
},
{
path
:
'assetChild'
,
component
:
ChildAssetsComponent
},
{
path
:
'assetChild'
,
component
:
ChildAssetsComponent
},
{
path
:
'assetDetail'
,
component
:
AssetsDetailComponent
},
{
path
:
'asset
s
Detail'
,
component
:
AssetsDetailComponent
},
]
]
},
},
]
]
...
...
src/main/webapp/app/work/asset-part/asset-part.component.html
View file @
f378c4a2
...
@@ -27,14 +27,14 @@
...
@@ -27,14 +27,14 @@
</nz-select>
</nz-select>
</div>
</div>
<div
nz-col
nzSpan=
"3"
>
<div
nz-col
nzSpan=
"3"
>
<button
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
导入资产
</button>
<button
(
click
)="
showUploadModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
导入资产
</button>
</div>
</div>
<div
nz-col
nzSpan=
"3"
>
<div
nz-col
nzSpan=
"3"
>
<button
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
下载
</button>
<button
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
下载
</button>
</div>
</div>
<div
nz-col
nzSpan=
"6"
>
<div
nz-col
nzSpan=
"6"
>
<button
(
click
)="
showAddModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
添加
</button>
<button
(
click
)="
showAddModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
添加
</button>
<button
(
click
)="
show
A
EditModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
编辑
</button>
<button
(
click
)="
show
P
EditModal
()"
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
编辑
</button>
<button
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
删除
</button>
<button
nz-button
nzType=
"default"
><i
class=
"anticon anticon-plus"
></i>
删除
</button>
</div>
</div>
</div>
</div>
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<tbody>
<tbody>
<tr
*
ngFor=
"let data of childrenList"
>
<tr
*
ngFor=
"let data of childrenList"
>
<td
class=
"round-tag tag-form"
>
<td
class=
"round-tag tag-form"
>
{{data.name}}
<span
(
click
)="
showCEditModal
(
data
.
id
)"
>
{{data.name}}
</span>
</td>
</td>
<td>
<td>
{{data.inventorycount}}
{{data.inventorycount}}
...
@@ -83,4 +83,6 @@
...
@@ -83,4 +83,6 @@
</nz-table>
</nz-table>
<!--新增分类-->
<!--新增分类-->
<smart-type-asets
#
smartTypeAsets
(
done
)="
getList
()"
></smart-type-asets>
<smart-type-asets
#
smartTypeAsets
(
done
)="
getList
()"
></smart-type-asets>
\ No newline at end of file
<!--倒入资产-->
<smart-upload
#
smartUpload
></smart-upload>
\ No newline at end of file
src/main/webapp/app/work/asset-part/asset-part.component.ts
View file @
f378c4a2
...
@@ -4,6 +4,7 @@ import {pageSize} from '../../app.constants';
...
@@ -4,6 +4,7 @@ import {pageSize} from '../../app.constants';
import
{
Router
}
from
'@angular/router'
;
import
{
Router
}
from
'@angular/router'
;
import
{
TypeAsetsComponent
}
from
'../modal/type-asets/type-asets.component'
;
import
{
TypeAsetsComponent
}
from
'../modal/type-asets/type-asets.component'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
UploadComponent
}
from
'../modal/upload/upload.component'
;
@
Component
({
@
Component
({
selector
:
'smart-asset-part'
,
selector
:
'smart-asset-part'
,
...
@@ -12,6 +13,7 @@ import {NzMessageService} from 'ng-zorro-antd';
...
@@ -12,6 +13,7 @@ import {NzMessageService} from 'ng-zorro-antd';
})
})
export
class
AssetPartComponent
implements
OnInit
{
export
class
AssetPartComponent
implements
OnInit
{
@
ViewChild
(
'smartTypeAsets'
)
smartTypeAsets
:
TypeAsetsComponent
;
@
ViewChild
(
'smartTypeAsets'
)
smartTypeAsets
:
TypeAsetsComponent
;
@
ViewChild
(
'smartUpload'
)
smartUpload
:
UploadComponent
;
timeFormat
=
'yyyy-MM-dd'
;
timeFormat
=
'yyyy-MM-dd'
;
parentList
;
parentList
;
...
@@ -77,8 +79,18 @@ export class AssetPartComponent implements OnInit {
...
@@ -77,8 +79,18 @@ export class AssetPartComponent implements OnInit {
this
.
smartTypeAsets
.
showAddModal
(
"新增分类"
);
this
.
smartTypeAsets
.
showAddModal
(
"新增分类"
);
}
}
showAEditModal
(){
//编辑父级分类
this
.
smartTypeAsets
.
showEditModal
(
"编辑分类"
);
showPEditModal
(){
this
.
smartTypeAsets
.
showEditModal
(
"编辑分类"
,
this
.
obj
.
type
);
}
}
//编辑子级分类
showCEditModal
(
id
){
this
.
smartTypeAsets
.
showEditModal
(
"编辑分类"
,
id
);
}
//导入资产
showUploadModal
(){
this
.
smartUpload
.
showModal
();
}
}
}
src/main/webapp/app/work/asset-part/assets-detail/assets-detail.component.html
View file @
f378c4a2
...
@@ -28,13 +28,35 @@
...
@@ -28,13 +28,35 @@
<nz-tabset
class=
"tabs-smart "
>
<nz-tabset
class=
"tabs-smart "
>
<nz-tab
#
thirdTabs
nzTitle=
"资产信息"
>
<nz-tab
#
thirdTabs
nzTitle=
"资产信息"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"equipmentTypeid"
>
资产编号
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
{{inventoryExtend?.name}}
</nz-form-control>
</nz-form-item>
</div>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
>
负责人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
{{inventoryExtend?.person}}
</nz-form-control>
</nz-form-item>
</div>
</div>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<div
nz-col
[
nzSpan
]="
12
"
>
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"equipmentTypeid"
>
资产名称
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"equipmentTypeid"
>
资产名称
</nz-form-label>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"资产名称"
name=
"name"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
name
"
>
{{inventoryExtend?.name}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -43,7 +65,7 @@
...
@@ -43,7 +65,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
>
负责人
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
>
负责人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"负责人"
name=
"person"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
person
"
>
{{inventoryExtend?.person}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -55,7 +77,7 @@
...
@@ -55,7 +77,7 @@
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
资产数量
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
nzFor=
"secondLevelType"
>
资产数量
</nz-form-label>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"资产数量"
name=
"inventorycount"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
inventorycount
"
>
{{inventoryExtend?.inventorycount}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -64,7 +86,7 @@
...
@@ -64,7 +86,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"invertoryname"
>
品牌
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"invertoryname"
>
品牌
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"品牌"
name=
"invertoryname"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
invertoryname
"
>
{{inventoryExtend?.invertoryname}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -75,7 +97,7 @@
...
@@ -75,7 +97,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
库存
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
库存
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"库存"
name=
"stock"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
stock
"
>
{{inventoryExtend?.stock}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -84,7 +106,7 @@
...
@@ -84,7 +106,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
>
型号
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
>
型号
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"型号"
name=
"serialnoA"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
serialnoA
"
>
{{inventoryExtend?.serialnoA}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -95,7 +117,7 @@
...
@@ -95,7 +117,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
使用
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
使用
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"使用"
name=
"usedcount"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
usedcount
"
>
{{inventoryExtend?.usedcount}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -104,7 +126,7 @@
...
@@ -104,7 +126,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
>
MAC地址
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
>
MAC地址
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"MAC地址"
name=
"mac"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
mac
"
>
{{inventoryExtend?.mac}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -114,7 +136,7 @@
...
@@ -114,7 +136,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
借出
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
借出
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"借出"
name=
"lendcount"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
lendcount
"
>
{{inventoryExtend?.lendcount}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -123,7 +145,7 @@
...
@@ -123,7 +145,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
>
维保到期
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
>
维保到期
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"维保到期"
name=
"maintenanceExpiration"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
maintenanceExpiration
"
>
{{inventoryExtend?.maintenanceExpiration}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -134,7 +156,7 @@
...
@@ -134,7 +156,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
维修
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
维修
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"维修"
name=
"repaircount"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
repaircount
"
>
{{inventoryExtend?.repaircount}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -143,7 +165,7 @@
...
@@ -143,7 +165,7 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzSpan
]="
6
"
>
存放地点
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
>
存放地点
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"存放地点"
name=
"storageLocation"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
storageLocation
"
>
{{inventoryExtend?.storageLocation}}
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -154,7 +176,8 @@
...
@@ -154,7 +176,8 @@
<nz-form-item
nzFlex
>
<nz-form-item
nzFlex
>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
报废
</nz-form-label>
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
报废
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
nz-input
placeholder=
"报废"
name=
"scrapcount"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
scrapcount
"
>
{{inventoryExtend?.scrapcount}}
<!--<input nz-input placeholder="报废" name="scrapcount" [(ngModel)]="inventoryExtend?.scrapcount">-->
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -165,11 +188,6 @@
...
@@ -165,11 +188,6 @@
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
父分类
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
父分类
</nz-form-label>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"secondLevelType"
nzPlaceHolder=
"选择父分类"
(
nzListOfSelectedValueChange
)="
getTypeByParent
($
event
)"
>
<ng-container
*
ngFor=
"let item of parentTypeList"
>
<nz-option
[
nzLabel
]="
item
.
name
"
[
nzValue
]="
item
.
id
"
></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
@@ -181,11 +199,6 @@
...
@@ -181,11 +199,6 @@
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
子分类
<nz-form-label
[
nzOffset
]="
4
"
[
nzSpan
]="
6
"
nzRequired
>
子分类
</nz-form-label>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"secondLevelType"
nzPlaceHolder=
"选择子分类"
[(
ngModel
)]="
validateForm
.
inventoryExtend
.
inventoryTypeid
"
>
<ng-container
*
ngFor=
"let item of typeList"
>
<nz-option
[
nzLabel
]="
item
.
name
"
[
nzValue
]="
item
.
id
"
></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
</div>
</div>
...
...
src/main/webapp/app/work/asset-part/assets-detail/assets-detail.component.ts
View file @
f378c4a2
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
}
from
'@angular/router'
;
import
{
WorkService
}
from
'../../work.service'
;
@
Component
({
@
Component
({
selector
:
'smart-assets-detail'
,
selector
:
'smart-assets-detail'
,
...
@@ -7,9 +9,26 @@ import { Component, OnInit } from '@angular/core';
...
@@ -7,9 +9,26 @@ import { Component, OnInit } from '@angular/core';
})
})
export
class
AssetsDetailComponent
implements
OnInit
{
export
class
AssetsDetailComponent
implements
OnInit
{
constructor
()
{
}
invertoryId
;
inventoryExtend
;
constructor
(
private
routerInfo
:
ActivatedRoute
,
private
workSer
:
WorkService
)
{
this
.
routerInfo
.
queryParams
.
subscribe
(
(
res
)
=>
{
this
.
invertoryId
=
res
.
invertoryId
;
}
)
}
ngOnInit
()
{
ngOnInit
()
{
this
.
getDetail
();
}
}
getDetail
(){
this
.
workSer
.
selectByPrimaryKey
(
this
.
invertoryId
).
subscribe
(
(
res
)
=>
{
this
.
inventoryExtend
=
res
.
data
;
}
)
}
}
}
src/main/webapp/app/work/asset-part/child-assets/child-assets.component.html
View file @
f378c4a2
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
</td>
</td>
<td>
关联事件
</td>
<td>
关联事件
</td>
<td
class=
"handle text-center"
>
<td
class=
"handle text-center"
>
<span
(
click
)="
showEditModa
l
(
data
)"
>
查看
</span>
<span
(
click
)="
goToDetai
l
(
data
)"
>
查看
</span>
<span
(
click
)="
deleteInVentory
(
data
)"
>
删除
</span>
<span
(
click
)="
deleteInVentory
(
data
)"
>
删除
</span>
</td>
</td>
</tr>
</tr>
...
...
src/main/webapp/app/work/asset-part/child-assets/child-assets.component.ts
View file @
f378c4a2
...
@@ -16,7 +16,7 @@ export class ChildAssetsComponent implements OnInit {
...
@@ -16,7 +16,7 @@ export class ChildAssetsComponent implements OnInit {
childId
;
childId
;
childrenList
;
childrenList
;
constructor
(
private
workSer
:
WorkService
,
private
routerInfo
:
ActivatedRoute
,
constructor
(
private
workSer
:
WorkService
,
private
routerInfo
:
ActivatedRoute
,
private
router
:
Router
,
private
conmonSer
:
CommonService
,
private
message
:
NzMessageService
)
{
private
conmonSer
:
CommonService
,
private
message
:
NzMessageService
)
{
this
.
routerInfo
.
queryParams
.
subscribe
(
this
.
routerInfo
.
queryParams
.
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
...
@@ -62,8 +62,18 @@ export class ChildAssetsComponent implements OnInit {
...
@@ -62,8 +62,18 @@ export class ChildAssetsComponent implements OnInit {
this
.
smartAssets
.
showAddModal
(
"添加资产"
);
this
.
smartAssets
.
showAddModal
(
"添加资产"
);
}
}
showEditModal
(){
//编辑资产
showEditModal
(
id
){
this
.
smartAssets
.
showEditModal
(
"编辑资产"
);
this
.
smartAssets
.
showEditModal
(
"编辑资产"
);
}
}
//查看详情
goToDetail
(
data
){
this
.
router
.
navigate
([
'app/main/assetsDetail'
],{
queryParams
:{
invertoryId
:
data
.
id
}
})
}
}
}
src/main/webapp/app/work/modal/type-asets/type-asets.component.ts
View file @
f378c4a2
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
timeEnd
}
from
'@ngtools/webpack/src/benchmark'
;
import
{
timeEnd
}
from
'@ngtools/webpack/src/benchmark'
;
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
import
{
FormBuilder
,
Form
Control
,
Form
Group
,
Validators
}
from
'@angular/forms'
;
import
{
WorkService
}
from
'../../work.service'
;
import
{
WorkService
}
from
'../../work.service'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
...
@@ -18,6 +18,8 @@ export class TypeAsetsComponent implements OnInit {
...
@@ -18,6 +18,8 @@ export class TypeAsetsComponent implements OnInit {
isChildren
=
false
;
isChildren
=
false
;
validateForm
:
FormGroup
;
validateForm
:
FormGroup
;
updateId
;
constructor
(
private
fb
:
FormBuilder
,
private
workSer
:
WorkService
,
constructor
(
private
fb
:
FormBuilder
,
private
workSer
:
WorkService
,
private
message
:
NzMessageService
)
{
private
message
:
NzMessageService
)
{
}
}
...
@@ -50,6 +52,7 @@ export class TypeAsetsComponent implements OnInit {
...
@@ -50,6 +52,7 @@ export class TypeAsetsComponent implements OnInit {
}
}
initForm
(){
initForm
(){
this
.
isChildren
=
false
;
this
.
validateForm
=
this
.
fb
.
group
(
this
.
validateForm
=
this
.
fb
.
group
(
{
{
parentid
:[
null
],
parentid
:[
null
],
...
@@ -66,13 +69,17 @@ export class TypeAsetsComponent implements OnInit {
...
@@ -66,13 +69,17 @@ export class TypeAsetsComponent implements OnInit {
this
.
getParentList
();
this
.
getParentList
();
}
}
showEditModal
(
title
)
{
showEditModal
(
title
,
id
)
{
this
.
isVisible
=
true
;
this
.
isVisible
=
true
;
this
.
title
=
title
;
this
.
title
=
title
;
this
.
getParentList
();
this
.
getParentList
();
this
.
workSer
.
findType
(
""
).
subscribe
(
this
.
updateId
=
id
;
this
.
workSer
.
findType
(
id
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
if
(
res
.
data
.
parentid
){
this
.
isChildren
=
true
;
}
this
.
validateForm
.
patchValue
(
res
.
data
);
}
}
)
)
}
}
...
@@ -92,7 +99,7 @@ export class TypeAsetsComponent implements OnInit {
...
@@ -92,7 +99,7 @@ export class TypeAsetsComponent implements OnInit {
if
(
this
.
title
==
"新增分类"
){
if
(
this
.
title
==
"新增分类"
){
this
.
create
();
this
.
create
();
}
}
if
(
this
.
title
==
"编辑分类
分类
"
){
if
(
this
.
title
==
"编辑分类"
){
this
.
update
();
this
.
update
();
}
}
}
}
...
@@ -113,6 +120,18 @@ export class TypeAsetsComponent implements OnInit {
...
@@ -113,6 +120,18 @@ export class TypeAsetsComponent implements OnInit {
}
}
update
(){
update
(){
this
.
validateForm
.
addControl
(
"id"
,
new
FormControl
(
this
.
updateId
));
this
.
workSer
.
updateType
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
isVisible
=
false
;
this
.
done
.
emit
();
this
.
initForm
();
this
.
message
.
success
(
"修改分类成功"
);
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
}
}
}
}
src/main/webapp/app/work/work.service.ts
View file @
f378c4a2
...
@@ -96,7 +96,7 @@ export class WorkService {
...
@@ -96,7 +96,7 @@ export class WorkService {
//根据主键id查询资产类型
//根据主键id查询资产类型
findType
(
params
):
Observable
<
any
>
{
findType
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/inventory/findType/'
,
params
);
return
this
.
http
.
get
(
SERVER_API_URL
+
'/inventory/findType/'
+
params
);
}
}
//根据资产类型id 查询没有配置主机的资产
//根据资产类型id 查询没有配置主机的资产
...
@@ -129,4 +129,13 @@ export class WorkService {
...
@@ -129,4 +129,13 @@ export class WorkService {
return
this
.
http
.
post
(
SERVER_API_URL
+
'/inventory/deleteInventory'
,
data
);
return
this
.
http
.
post
(
SERVER_API_URL
+
'/inventory/deleteInventory'
,
data
);
}
}
//导入资产
importInventory
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/inventory/import'
,
data
);
}
//根据资产类型id查询资产
selectByPrimaryKey
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/inventory/selectByPrimaryKey/'
+
params
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment