Browse Source

固资台账

main
kkerwin 2 years ago
parent
commit
e5deff6fce
  1. 22
      web-admin-app/README.md
  2. 109
      web-admin-app/src/app/app.routes.ts
  3. 8
      web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.html
  4. 7
      web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.ts
  5. 8
      web-admin-app/src/app/components/asset-business-borrow-form/asset-business-borrow-form.component.html
  6. 5
      web-admin-app/src/app/components/asset-business-borrow-form/asset-business-borrow-form.component.ts
  7. 8
      web-admin-app/src/app/components/asset-business-collection/asset-business-collection.component.html
  8. 12
      web-admin-app/src/app/components/asset-business-collection/asset-business-collection.component.ts
  9. 18
      web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.html
  10. 17
      web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.ts
  11. 10
      web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.html
  12. 13
      web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.ts
  13. 8
      web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.html
  14. 13
      web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.ts
  15. 10
      web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.html
  16. 10
      web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.ts
  17. 16
      web-admin-app/src/app/components/asset-select/asset-select.component.ts
  18. 2
      web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.html
  19. 70
      web-admin-app/src/app/components/component-org-tree/component-org-tree.component.ts
  20. 2
      web-admin-app/src/app/components/index.ts
  21. 1
      web-admin-app/src/app/components/org-select/org-select.component.ts
  22. 37
      web-admin-app/src/app/components/position-tree/position-tree.component.html
  23. 0
      web-admin-app/src/app/components/position-tree/position-tree.component.less
  24. 73
      web-admin-app/src/app/components/position-tree/position-tree.component.ts
  25. 2
      web-admin-app/src/app/components/repair-fault-form/repair-fault-form.component.ts
  26. 2
      web-admin-app/src/app/components/repair-form/repair-form.component.ts
  27. 33
      web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.html
  28. 0
      web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.less
  29. 61
      web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.ts
  30. 44
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.html
  31. 0
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.less
  32. 56
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.ts
  33. 44
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.html
  34. 0
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.less
  35. 56
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.ts
  36. 44
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.html
  37. 0
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.less
  38. 56
      web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.ts
  39. 44
      web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.html
  40. 0
      web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.less
  41. 55
      web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.ts
  42. 90
      web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html
  43. 6
      web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.ts
  44. 226
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.html
  45. 123
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.ts
  46. 233
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.html
  47. 158
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.ts
  48. 2
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-employee/fixed-asset-employee.component.ts
  49. 18
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.html
  50. 22
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.less
  51. 8
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.ts
  52. 194
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.html
  53. 103
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.ts
  54. 233
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.html
  55. 146
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.ts
  56. 231
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.html
  57. 147
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.ts
  58. 218
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.html
  59. 103
      web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.ts
  60. 9
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-allot/fixed-asset-manage-allot.component.ts
  61. 3
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.html
  62. 13
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.ts
  63. 6
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.html
  64. 8
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.ts
  65. 6
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-entry/fixed-asset-manage-entry.component.ts
  66. 8
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-return/fixed-asset-manage-return.component.ts
  67. 10
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-revert/fixed-asset-manage-revert.component.ts
  68. 2
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-scrap/fixed-asset-manage-scrap.component.ts
  69. 8
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-transfer/fixed-asset-manage-transfer.component.ts
  70. 6
      web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage/fixed-asset-manage.component.ts
  71. 6
      web-admin-app/src/app/pages/org-setting/org-setting.component.html
  72. 10
      web-admin-app/src/app/pages/profile-account/profile-account.component.ts
  73. 8
      web-admin-app/src/app/pages/profile-basic/profile-basic.component.ts
  74. 54
      web-admin-app/src/app/pages/profile/profile.component.html
  75. 14
      web-admin-app/src/app/pages/system/index/system.component.html
  76. 11
      web-admin-app/src/app/pages/system/index/system.component.ts
  77. 97
      web-admin-app/src/app/pages/system/system-role/system-role.component.html
  78. 0
      web-admin-app/src/app/pages/system/system-role/system-role.component.less
  79. 107
      web-admin-app/src/app/pages/system/system-role/system-role.component.ts
  80. 2
      web-admin-app/src/app/services/api.dto.ts
  81. 70
      web-admin-app/src/app/services/api.service.ts
  82. 8
      web-admin-app/src/app/services/local-http-interceptor.service.ts
  83. 10
      web-admin-app/src/app/shared/components/header/header.component.html

22
web-admin-app/README.md

@ -42,5 +42,25 @@
- 【资产入库】 需要添加一个接口,前端提交资产id列表,后端返回对应的资产数据列表 - 【资产入库】 需要添加一个接口,前端提交资产id列表,后端返回对应的资产数据列表
## 05-05 ## 05-05
- 【维修登记】 新增接口报错 500 -【分页】还是有问题
-【维修登记】 新增接口报错 500
- 业务编号 需不需要输入? - 业务编号 需不需要输入?
-【角色】新增、修改报错 提示操作错误 但是能保存
-【维保到期预警接口】 500
-【登录】 需要返回用户头像地址
-【businessGeneratedDate】 是否是领用日期
-【申请人】
# 待解决问题
流程列表 不需要展示
处理流程
- 审批
- 驳回
- 取消

109
web-admin-app/src/app/app.routes.ts

@ -45,6 +45,12 @@ import { StockakingPlanComponent } from './pages/fixed-asset/stocktaking/stockak
import { RepairTypeComponent } from './pages/fixed-asset/repair/repair-type/repair-type.component' import { RepairTypeComponent } from './pages/fixed-asset/repair/repair-type/repair-type.component'
import { RepairListComponent } from './pages/fixed-asset/repair/repair-list/repair-list.component' import { RepairListComponent } from './pages/fixed-asset/repair/repair-list/repair-list.component'
import { RepairFaultComponent } from './pages/fixed-asset/repair/repair-fault/repair-fault.component' import { RepairFaultComponent } from './pages/fixed-asset/repair/repair-fault/repair-fault.component'
import { SystemRoleComponent } from './pages/system/system-role/system-role.component'
import { AlertBorrowComponent } from './pages/fixed-asset/alert/alert-borrow/alert-borrow.component'
import { AlertMaintenanceComponent } from './pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component'
import { AlertInventorySafetyComponent } from './pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component'
import { AlertInventoryUpComponent } from './pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component'
import { AlertInventoryDownComponent } from './pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component'
export const routes: Routes = [ export const routes: Routes = [
{ {
@ -73,7 +79,7 @@ export const routes: Routes = [
{ {
path: 'profile', path: 'profile',
component: ProfileComponent, component: ProfileComponent,
title: '个人中心',
children: [ children: [
{ {
path: '', path: '',
@ -83,16 +89,19 @@ export const routes: Routes = [
{ {
path: 'basic', path: 'basic',
component: ProfileBasicComponent, component: ProfileBasicComponent,
title: '基础信息',
}, },
{ {
path: 'account', path: 'account',
component: ProfileAccountComponent, component: ProfileAccountComponent,
title: '账号密码',
}, },
], ],
}, },
{ {
path: 'system', path: 'system',
component: SystemComponent, component: SystemComponent,
title: '系统管理',
children: [ children: [
{ {
path: '', path: '',
@ -101,36 +110,42 @@ export const routes: Routes = [
}, },
{ {
path: 'user', path: 'user',
component: SystemUserComponent,
canActivate: [permissionGuard],
data: {
permission: 'user',
},
},
],
},
{
path: 'org',
component: OrgComponent,
title: '人事管理',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'setting',
},
{
path: 'setting',
component: OrgSettingComponent, component: OrgSettingComponent,
canActivate: [permissionGuard],
title: '组织架构', title: '组织架构',
data: {},
}, },
{ {
path: 'employee', path: 'role',
component: OrgEmployeeComponent, component: SystemRoleComponent,
title: '员工管理', canActivate: [permissionGuard],
title: '角色管理',
data: {},
}, },
], ],
}, },
// {
// path: 'org',
// component: OrgComponent,
// title: '人事管理',
// children: [
// {
// path: '',
// pathMatch: 'full',
// redirectTo: 'setting',
// },
// {
// path: 'setting',
// component: OrgSettingComponent,
// title: '组织架构',
// },
// {
// path: 'employee',
// component: OrgEmployeeComponent,
// title: '员工管理',
// },
// ],
// },
{ {
path: 'fixed-asset', path: 'fixed-asset',
title: '固资管理', title: '固资管理',
@ -337,6 +352,52 @@ export const routes: Routes = [
}, },
], ],
}, },
{
path: 'alert',
title: '预警中心',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'borrow',
},
{
path: 'borrow',
component: AlertBorrowComponent,
title: '借用预警',
},
{
path: 'maintenance',
component: AlertMaintenanceComponent,
title: '维保到期预警',
},
{
path: 'inventory',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'safety',
},
{
path: 'safety',
component: AlertInventorySafetyComponent,
title: '安全库存预警',
},
{
path: 'up',
component: AlertInventoryUpComponent,
title: '安全库存上限',
},
{
path: 'down',
component: AlertInventoryDownComponent,
title: '安全库存下限',
},
],
},
],
},
], ],
}, },
], ],

8
web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.html

@ -26,6 +26,14 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<!-- <div nz-col [nzSpan]="6"> <!-- <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label>调拨管理员</nz-form-label> <nz-form-label>调拨管理员</nz-form-label>

7
web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.ts

@ -58,6 +58,8 @@ export class AssetBusinessAllotFormComponent {
attach: this.fb.control('', []), attach: this.fb.control('', []),
assetIdList: this.fb.control([], []), assetIdList: this.fb.control([], []),
applicant: this.fb.control({ value: '', disabled: true }, []),
}) })
this.patchValues() this.patchValues()
@ -72,6 +74,9 @@ export class AssetBusinessAllotFormComponent {
useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], useUserId: data._useUser?.userId ? [data._useUser?.userId] : [],
positionId: data._position?.positionId + '', positionId: data._position?.positionId + '',
useOrganizationId: data._useOrganization?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '',
inWarehouseId: data._inWarehouse?.warehouseId,
outWarehouseId: data._outWarehouse?.warehouseId,
applicant: data._applicant?.userName,
}) })
} }
if (preview) { if (preview) {
@ -92,7 +97,7 @@ export class AssetBusinessAllotFormComponent {
ownCompanyId: v.ownCompanyId?.[0], ownCompanyId: v.ownCompanyId?.[0],
positionId: Number(v.positionId?.[0]), positionId: Number(v.positionId?.[0]),
useOrganizationId: Number(v.useOrganizationId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]),
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
} }
} }
return values return values

8
web-admin-app/src/app/components/asset-business-borrow-form/asset-business-borrow-form.component.html

@ -26,6 +26,14 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label nzRequired>借出日期</nz-form-label> <nz-form-label nzRequired>借出日期</nz-form-label>

5
web-admin-app/src/app/components/asset-business-borrow-form/asset-business-borrow-form.component.ts

@ -55,6 +55,8 @@ export class AssetBusinessBorrowFormComponent {
attach: this.fb.control('', []), attach: this.fb.control('', []),
assetIdList: this.fb.control([], []), assetIdList: this.fb.control([], []),
applicant: this.fb.control({ value: '', disabled: true }, []),
}) })
this.patchValues() this.patchValues()
@ -69,6 +71,7 @@ export class AssetBusinessBorrowFormComponent {
useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], useUserId: data._useUser?.userId ? [data._useUser?.userId] : [],
positionId: data._position?.positionId + '', positionId: data._position?.positionId + '',
useOrganizationId: data._useOrganization?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '',
applicant: data._applicant?.userName,
}) })
} }
if (preview) { if (preview) {
@ -89,7 +92,7 @@ export class AssetBusinessBorrowFormComponent {
ownCompanyId: v.ownCompanyId?.[0], ownCompanyId: v.ownCompanyId?.[0],
positionId: Number(v.positionId?.[0]), positionId: Number(v.positionId?.[0]),
useOrganizationId: Number(v.useOrganizationId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]),
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
} }
} }
return values return values

8
web-admin-app/src/app/components/asset-business-collection/asset-business-collection.component.html

@ -26,6 +26,14 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label nzRequired>领用日期</nz-form-label> <nz-form-label nzRequired>领用日期</nz-form-label>

12
web-admin-app/src/app/components/asset-business-collection/asset-business-collection.component.ts

@ -57,6 +57,7 @@ export class AssetBusinessCollectionComponent {
positionId: this.fb.control(null, []), positionId: this.fb.control(null, []),
attach: this.fb.control('', []), attach: this.fb.control('', []),
positionDetail: this.fb.control('', []), positionDetail: this.fb.control('', []),
applicant: this.fb.control({ value: '', disabled: true }, []),
assetIdList: this.fb.control([], []), assetIdList: this.fb.control([], []),
}) })
@ -71,8 +72,16 @@ export class AssetBusinessCollectionComponent {
...data, ...data,
useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], useUserId: data._useUser?.userId ? [data._useUser?.userId] : [],
manager: data._manager?.userId ? [data._manager?.userId] : [],
responsiblePerson: data._responsiblePerson?.userId ? [data._responsiblePerson?.userId] : [],
categoryId: data._category?.categoryId + '',
positionId: data._position?.positionId + '', positionId: data._position?.positionId + '',
ownCompanyId: data._ownCompany?.organizationId + '',
useOrganizationId: data._useOrganization?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '',
maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId,
warehouseId: data._warehouse?.warehouseId,
manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId,
applicant: data._applicant?.userName,
}) })
} }
if (preview) { if (preview) {
@ -93,7 +102,8 @@ export class AssetBusinessCollectionComponent {
ownCompanyId: v.ownCompanyId?.[0], ownCompanyId: v.ownCompanyId?.[0],
positionId: Number(v.positionId?.[0]), positionId: Number(v.positionId?.[0]),
useOrganizationId: Number(v.useOrganizationId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]),
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
// assetIdList: typeof v.assetIdList === 'string' ? v.assetIdList : JSON.stringify(v.assetIdList),
} }
} }
return values return values

18
web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.html

@ -10,6 +10,14 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>仓库</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-warehouse-select formControlName="warehouseId" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label nzRequired>退库后公司/部门</nz-form-label> <nz-form-label nzRequired>退库后公司/部门</nz-form-label>
@ -18,13 +26,21 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6"> <!-- <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label nzRequired>使用人员</nz-form-label> <nz-form-label nzRequired>使用人员</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl"> <nz-form-control [nzErrorTip]="errorTpl">
<app-select-user-by-org formControlName="useUserId" /> <app-select-user-by-org formControlName="useUserId" />
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> -->
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>

17
web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.ts

@ -11,6 +11,7 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component' import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component' import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
@Component({ @Component({
selector: 'app-asset-business-return-form', selector: 'app-asset-business-return-form',
@ -22,6 +23,7 @@ import { AssetSelectComponent } from '../asset-select/asset-select.component'
AssetSelectComponent, AssetSelectComponent,
OrgSelectComponent, OrgSelectComponent,
PositionSelectComponent, PositionSelectComponent,
WarehouseSelectComponent,
], ],
templateUrl: './asset-business-return-form.component.html', templateUrl: './asset-business-return-form.component.html',
styleUrl: './asset-business-return-form.component.less', styleUrl: './asset-business-return-form.component.less',
@ -45,9 +47,10 @@ export class AssetBusinessReturnFormComponent {
this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
id: this.fb.control(null, []), id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]), name: this.fb.control('', [FormValidators.required('请输入')]),
useUserId: this.fb.control(null, [FormValidators.required('请选择')]), // useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]), useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]),
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]), businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
warehouseId: this.fb.control(null, [FormValidators.required('请选择')]),
notes: this.fb.control(null, []), notes: this.fb.control(null, []),
positionId: this.fb.control(null, []), positionId: this.fb.control(null, []),
@ -55,6 +58,8 @@ export class AssetBusinessReturnFormComponent {
positionDetail: this.fb.control('', []), positionDetail: this.fb.control('', []),
assetIdList: this.fb.control([], []), assetIdList: this.fb.control([], []),
applicant: this.fb.control({ value: '', disabled: true }, []),
}) })
this.patchValues() this.patchValues()
@ -67,8 +72,16 @@ export class AssetBusinessReturnFormComponent {
...data, ...data,
useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], useUserId: data._useUser?.userId ? [data._useUser?.userId] : [],
manager: data._manager?.userId ? [data._manager?.userId] : [],
responsiblePerson: data._responsiblePerson?.userId ? [data._responsiblePerson?.userId] : [],
categoryId: data._category?.categoryId + '',
positionId: data._position?.positionId + '', positionId: data._position?.positionId + '',
ownCompanyId: data._ownCompany?.organizationId + '',
useOrganizationId: data._useOrganization?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '',
maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId,
warehouseId: data._warehouse?.warehouseId,
manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId,
applicant: data._applicant?.userName,
}) })
} }
if (preview) { if (preview) {
@ -89,7 +102,7 @@ export class AssetBusinessReturnFormComponent {
ownCompanyId: v.ownCompanyId?.[0], ownCompanyId: v.ownCompanyId?.[0],
positionId: Number(v.positionId?.[0]), positionId: Number(v.positionId?.[0]),
useOrganizationId: Number(v.useOrganizationId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]),
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
} }
} }
return values return values

10
web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.html

@ -19,13 +19,21 @@
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<!-- <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label>归还后公司/部门</nz-form-label> <nz-form-label>归还后公司/部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl"> <nz-form-control [nzErrorTip]="errorTpl">
<app-org-select [company]="true" formControlName="useOrganizationId" /> <app-org-select [company]="true" formControlName="useOrganizationId" />
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div> -->
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label>管理人</nz-form-label> <nz-form-label>管理人</nz-form-label>

13
web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.ts

@ -48,7 +48,7 @@ export class AssetBusinessRevertFormComponent {
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]), businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
manager: this.fb.control(null, []), manager: this.fb.control(null, []),
useUserId: this.fb.control(null, []), useUserId: this.fb.control(null, []),
useOrganizationId: this.fb.control(null, []), // useOrganizationId: this.fb.control(null, []),
notes: this.fb.control(null, []), notes: this.fb.control(null, []),
positionId: this.fb.control(null, []), positionId: this.fb.control(null, []),
@ -56,6 +56,7 @@ export class AssetBusinessRevertFormComponent {
positionDetail: this.fb.control('', []), positionDetail: this.fb.control('', []),
assetIdList: this.fb.control([], []), assetIdList: this.fb.control([], []),
applicant: this.fb.control({ value: '', disabled: true }, []),
}) })
this.patchValues() this.patchValues()
@ -68,8 +69,16 @@ export class AssetBusinessRevertFormComponent {
...data, ...data,
useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], useUserId: data._useUser?.userId ? [data._useUser?.userId] : [],
manager: data._manager?.userId ? [data._manager?.userId] : [],
responsiblePerson: data._responsiblePerson?.userId ? [data._responsiblePerson?.userId] : [],
categoryId: data._category?.categoryId + '',
positionId: data._position?.positionId + '', positionId: data._position?.positionId + '',
ownCompanyId: data._ownCompany?.organizationId + '',
useOrganizationId: data._useOrganization?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '',
maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId,
warehouseId: data._warehouse?.warehouseId,
manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId,
applicant: data._applicant?.userName,
}) })
} }
if (preview) { if (preview) {
@ -90,7 +99,7 @@ export class AssetBusinessRevertFormComponent {
ownCompanyId: v.ownCompanyId?.[0], ownCompanyId: v.ownCompanyId?.[0],
positionId: Number(v.positionId?.[0]), positionId: Number(v.positionId?.[0]),
useOrganizationId: Number(v.useOrganizationId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]),
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
} }
} }
return values return values

8
web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.html

@ -10,6 +10,14 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>仓库</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-warehouse-select formControlName="warehouseId" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label>管理人员</nz-form-label> <nz-form-label>管理人员</nz-form-label>

13
web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.ts

@ -15,11 +15,18 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component' import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component' import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
@Component({ @Component({
selector: 'app-asset-business-storage', selector: 'app-asset-business-storage',
standalone: true, standalone: true,
imports: [SharedModule, SelectUserByOrgComponent, SupplierSelectComponent, AssetSelectComponent], imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
WarehouseSelectComponent,
],
templateUrl: './asset-business-storage-form.component.html', templateUrl: './asset-business-storage-form.component.html',
styleUrl: './asset-business-storage-form.component.less', styleUrl: './asset-business-storage-form.component.less',
}) })
@ -42,6 +49,7 @@ export class AssetBusinessStorageFormComponent {
this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
id: this.fb.control(null, []), id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]), name: this.fb.control('', [FormValidators.required('请输入')]),
warehouseId: this.fb.control('', [FormValidators.required('请输入')]),
manager: this.fb.control(null, []), manager: this.fb.control(null, []),
createTime: this.fb.control(null, []), createTime: this.fb.control(null, []),
supplierVendorId: this.fb.control(null, []), supplierVendorId: this.fb.control(null, []),
@ -67,6 +75,7 @@ export class AssetBusinessStorageFormComponent {
ownCompanyId: data._ownCompany?.organizationId + '', ownCompanyId: data._ownCompany?.organizationId + '',
useOrganizationId: data._useOrganization?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '',
maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId, maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId,
warehouseId: data._warehouse?.warehouseId,
manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId, manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId,
}) })
} }
@ -89,7 +98,7 @@ export class AssetBusinessStorageFormComponent {
positionId: v.positionId?.[0], positionId: v.positionId?.[0],
useOrganizationId: v.useOrganizationId?.[0], useOrganizationId: v.useOrganizationId?.[0],
responsiblePerson: v.responsiblePerson?.[0], responsiblePerson: v.responsiblePerson?.[0],
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
} }
} }
return values return values

10
web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.html

@ -36,12 +36,20 @@
</div> </div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label>使用人员</nz-form-label> <nz-form-label nzRequired>使用人员</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl"> <nz-form-control [nzErrorTip]="errorTpl">
<app-select-user-by-org formControlName="useUserId" /> <app-select-user-by-org formControlName="useUserId" />
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6"> <div nz-col [nzSpan]="6">
<nz-form-item> <nz-form-item>
<nz-form-label>存放位置</nz-form-label> <nz-form-label>存放位置</nz-form-label>

10
web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.ts

@ -47,7 +47,7 @@ export class AssetBusinessTransferFormComponent {
this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
id: this.fb.control(null, []), id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]), name: this.fb.control('', [FormValidators.required('请输入')]),
useUserId: this.fb.control(null, []), useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
// useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]), // useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]), // businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
@ -61,6 +61,7 @@ export class AssetBusinessTransferFormComponent {
positionDetail: this.fb.control('', []), positionDetail: this.fb.control('', []),
assetIdList: this.fb.control([], []), assetIdList: this.fb.control([], []),
applicant: this.fb.control({ value: '', disabled: true }, []),
}) })
this.patchValues() this.patchValues()
@ -75,6 +76,7 @@ export class AssetBusinessTransferFormComponent {
useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], useUserId: data._useUser?.userId ? [data._useUser?.userId] : [],
positionId: data._position?.positionId + '', positionId: data._position?.positionId + '',
useOrganizationId: data._useOrganization?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '',
applicant: data._applicant?.userName,
}) })
} }
if (preview) { if (preview) {
@ -90,12 +92,14 @@ export class AssetBusinessTransferFormComponent {
values = { values = {
...v, ...v,
useUserId: v.useUserId?.[0], useUserId: v.useUserId?.[0],
manager: v.manager?.[0], managerId: v.managerId?.[0],
categoryId: v.categoryId?.[0], categoryId: v.categoryId?.[0],
ownCompanyId: v.ownCompanyId?.[0], ownCompanyId: v.ownCompanyId?.[0],
positionId: Number(v.positionId?.[0]), positionId: Number(v.positionId?.[0]),
useOrganizationId: Number(v.useOrganizationId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]),
assetIdList: JSON.stringify(v.assetIdList), inUseOrganizationId: Number(v.inUseOrganizationId?.[0]),
outUseOrganizationId: Number(v.outUseOrganizationId?.[0]),
assetIdList: v.assetIdList,
} }
} }
return values return values

16
web-admin-app/src/app/components/asset-select/asset-select.component.ts

@ -142,6 +142,7 @@ export class AssetSelectComponent {
onRemove() { onRemove() {
this.selectedDataList = this.selectedDataList.filter((i) => !this.setOfCheckedId.has(i.assetId)) this.selectedDataList = this.selectedDataList.filter((i) => !this.setOfCheckedId.has(i.assetId))
this.refreshCheckedStatus() this.refreshCheckedStatus()
this.onChange(this.selectedDataList.map((i) => i.assetId))
} }
updateCheckedSet(id: number, checked: boolean): void { updateCheckedSet(id: number, checked: boolean): void {
@ -176,7 +177,20 @@ export class AssetSelectComponent {
onChange(v: NzSafeAny[]) {} onChange(v: NzSafeAny[]) {}
writeValue(v: NzSafeAny): void { writeValue(v: NzSafeAny): void {
this.selectedDataList = [] let vals = []
if (typeof v === 'string') {
try {
vals = JSON.parse(v) ?? []
} catch (error) {}
}
if (Array.isArray(vals) && vals.length > 0) {
this.api.getAssetListByIds(vals).subscribe((res) => {
this.selectedDataList = res.body.map((item: NzSafeAny) => {
this.allGetedDataMap.set(item.assetId, item)
return item
})
})
}
} }
registerOnChange(fn: any): void { registerOnChange(fn: any): void {

2
web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.html

@ -1,4 +1,4 @@
<div class="w-60 overflow-auto"> <div class="w-full overflow-auto">
<div class="flex items-center"> <div class="flex items-center">
<div class="flex-1 pr-2"> <div class="flex-1 pr-2">
<nz-input-group [nzSuffix]="suffixIcon"> <nz-input-group [nzSuffix]="suffixIcon">

70
web-admin-app/src/app/components/component-org-tree/component-org-tree.component.ts

@ -2,54 +2,13 @@ import { Component, EventEmitter, Input, OnInit, Output, TemplateRef } from '@an
import { FormBuilder, FormGroup } from '@angular/forms' import { FormBuilder, FormGroup } from '@angular/forms'
import { ApiService } from 'app/services' import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { FormValidators } from 'app/utils' import { FormValidators, Utils } from 'app/utils'
import { NzSafeAny } from 'ng-zorro-antd/core/types' import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer' import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer'
import { NzMessageService } from 'ng-zorro-antd/message' import { NzMessageService } from 'ng-zorro-antd/message'
import { NzModalService } from 'ng-zorro-antd/modal' import { NzModalService } from 'ng-zorro-antd/modal'
import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree' import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'
interface Organization {
depth: string
orderNum: number
organizationId: number
organizationName: string
organizationType: string
parentId: number
status: string
}
function buildTree(organizations: Organization[]): NzTreeNodeOptions[] {
const map: { [parentId: number]: NzTreeNodeOptions[] } = {}
organizations.forEach((org) => {
if (!map[org.parentId]) {
map[org.parentId] = []
}
const treeNode: NzTreeNodeOptions = {
...org,
title: org.organizationName,
key: org.organizationId.toString(),
}
map[org.parentId].push(treeNode)
})
const build = (parentId: number): NzTreeNodeOptions[] => {
if (!map[parentId]) {
return []
}
return map[parentId].map((node) => {
const children = build(parseInt(node.key))
return {
...node,
isLeaf: children.length === 0,
children,
}
})
}
return build(0)
}
@Component({ @Component({
selector: 'app-component-org-tree', selector: 'app-component-org-tree',
standalone: true, standalone: true,
@ -68,6 +27,10 @@ export class ComponentOrgTreeComponent implements OnInit {
@Input() createable = true @Input() createable = true
@Input() company: boolean = false
@Input() companyAndOrg: boolean = false
@Output() onOrgSelectedChange = new EventEmitter<NzSafeAny>() @Output() onOrgSelectedChange = new EventEmitter<NzSafeAny>()
drawerRef?: NzDrawerRef drawerRef?: NzDrawerRef
@ -78,6 +41,8 @@ export class ComponentOrgTreeComponent implements OnInit {
parentId?: number parentId?: number
originTreeData: NzSafeAny[] = []
nodes: NzSafeAny[] = [] nodes: NzSafeAny[] = []
expandedKeys: string[] = [] expandedKeys: string[] = []
@ -95,7 +60,26 @@ export class ComponentOrgTreeComponent implements OnInit {
initTree() { initTree() {
this.api.getOrgTree().subscribe((res) => { this.api.getOrgTree().subscribe((res) => {
this.nodes = buildTree(res.body) this.originTreeData = res.body
let c: NzSafeAny[] = res.body
if (this.company) {
c = []
res.body.forEach((i: NzSafeAny) => {
if (i.organizationType === '0') {
c.push(i)
}
})
}
if (this.companyAndOrg) {
c = []
res.body.forEach((i: NzSafeAny) => {
if (['1', '0'].includes(i.organizationType)) {
c.push(i)
}
})
}
this.nodes = Utils.buildTree(c, 'organizationId', 'organizationName')
this.expandedKeys = [...this.expandedKeys] this.expandedKeys = [...this.expandedKeys]
}) })
} }

2
web-admin-app/src/app/components/index.ts

@ -22,3 +22,5 @@ export * from './asset-business-transfer-form/asset-business-transfer-form.compo
export * from './repair-form/repair-form.component' export * from './repair-form/repair-form.component'
export * from './repair-fault-form/repair-fault-form.component' export * from './repair-fault-form/repair-fault-form.component'
export * from './position-tree/position-tree.component'

1
web-admin-app/src/app/components/org-select/org-select.component.ts

@ -48,7 +48,6 @@ export class OrgSelectComponent implements ControlValueAccessor, OnInit {
ngOnInit(): void { ngOnInit(): void {
this.api.getOrgTree().subscribe((res) => { this.api.getOrgTree().subscribe((res) => {
this.originTreeData = res.body this.originTreeData = res.body
const c: NzSafeAny[] = [] const c: NzSafeAny[] = []
res.body.forEach((i: NzSafeAny) => { res.body.forEach((i: NzSafeAny) => {
if (this.company) { if (this.company) {

37
web-admin-app/src/app/components/position-tree/position-tree.component.html

@ -0,0 +1,37 @@
<div class="overflow-auto">
<div class="flex items-center">
<div class="flex-1">
<nz-input-group [nzSuffix]="suffixIcon">
<input type="text" nz-input placeholder="请输入关键字" [(ngModel)]="searchValue" />
</nz-input-group>
<ng-template #suffixIcon>
<span nz-icon nzType="search"></span>
</ng-template>
</div>
</div>
<div class="py-4">
<nz-tree
class="tree"
nzBlockNode
[nzData]="nodes"
[nzExpandedKeys]="expandedKeys"
[nzSearchValue]="searchValue"
(nzClick)="nzEvent($event)"
(nzExpandChange)="onExpandChange($event)"
[nzTreeTemplate]="nzTreeTemplate"
>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="custom-node flex items-center overflow-hidden">
<div class="flex-1">
<span class="ml-2 overflow-hidden text-ellipsis">{{ node.title }}</span>
</div>
@if (createable) {
<button nz-button nzType="text" onclick="event.stopPropagation()">
<span nz-icon nzType="more"></span>
</button>
}
</div>
</ng-template>
</nz-tree>
</div>
</div>

0
web-admin-app/src/app/components/position-tree/position-tree.component.less

73
web-admin-app/src/app/components/position-tree/position-tree.component.ts

@ -0,0 +1,73 @@
import { Component, EventEmitter, Input, OnInit, Output, TemplateRef } from '@angular/core'
import { FormBuilder, FormGroup } from '@angular/forms'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { FormValidators, Utils } from 'app/utils'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer'
import { NzMessageService } from 'ng-zorro-antd/message'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree'
@Component({
selector: 'app-position-tree',
standalone: true,
imports: [SharedModule],
templateUrl: './position-tree.component.html',
styleUrl: './position-tree.component.less',
})
export class PositionTreeComponent {
constructor(
private api: ApiService,
private drawer: NzDrawerService,
private fb: FormBuilder,
private msg: NzMessageService,
private modal: NzModalService,
) {}
@Input() createable = true
@Output() onSelectedChange = new EventEmitter<NzSafeAny>()
drawerRef?: NzDrawerRef
searchValue = ''
parentId?: number
originTreeData: NzSafeAny[] = []
nodes: NzSafeAny[] = []
expandedKeys: string[] = []
form!: FormGroup
initTree() {
this.api.getBasicPositionTree().subscribe((res) => {
this.originTreeData = res.body
this.nodes = Utils.buildTree(res.body, 'positionId', 'name')
this.expandedKeys = [...this.expandedKeys]
})
}
ngOnInit(): void {
this.initTree()
}
nzEvent(event: NzFormatEmitEvent): void {
if (event.eventName === 'click') {
const { node } = event
this.onSelectedChange.emit(event.keys?.length === 0 ? null : node?.origin)
}
}
onExpandChange(e: NzFormatEmitEvent) {
this.expandedKeys = e.keys ?? []
}
onSelectedKeysChange(e: string[]) {
console.log('e', e)
}
}

2
web-admin-app/src/app/components/repair-fault-form/repair-fault-form.component.ts

@ -96,7 +96,7 @@ export class RepairFaultFormComponent {
positionId: v.positionId?.[0], positionId: v.positionId?.[0],
useOrganizationId: v.useOrganizationId?.[0], useOrganizationId: v.useOrganizationId?.[0],
responsiblePerson: v.responsiblePerson?.[0], responsiblePerson: v.responsiblePerson?.[0],
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
} }
} }
return values return values

2
web-admin-app/src/app/components/repair-form/repair-form.component.ts

@ -93,7 +93,7 @@ export class RepairFormComponent {
positionId: v.positionId?.[0], positionId: v.positionId?.[0],
useOrganizationId: v.useOrganizationId?.[0], useOrganizationId: v.useOrganizationId?.[0],
responsiblePerson: v.responsiblePerson?.[0], responsiblePerson: v.responsiblePerson?.[0],
assetIdList: JSON.stringify(v.assetIdList), assetIdList: v.assetIdList,
} }
} }
return values return values

33
web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.html

@ -0,0 +1,33 @@
<app-page>
<div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
@switch (data) {
@case ('0') {
<nz-badge nzStatus="processing" nzText="正常"></nz-badge>
}
@case ('1') {
<nz-badge nzStatus="error" nzText="停用"></nz-badge>
}
}
}
@default {
{{ data }}
}
}
</ng-template>
<ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container>
<ng-container *appTableForm>
<app-query-item label="资产名称">
<input nz-input placeholder="请输入" formControlName="roleName" />
</app-query-item>
</ng-container>
</app-server-paginated-table>
</div>
</app-page>

0
web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.less

61
web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.ts

@ -0,0 +1,61 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-alert-borrow',
standalone: true,
imports: [SharedModule],
templateUrl: './alert-borrow.component.html',
styleUrl: './alert-borrow.component.less',
})
export class AlertBorrowComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
@ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}>
queryForm = new FormGroup({
roleName: new FormControl(''),
status: new FormControl(''),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: 'roleId', title: '主键', visible: false },
{ key: 'roleName', title: '资产分类', visible: true },
{ key: 'roleSort', title: '资产编号', visible: true },
{ key: 'roleSort', title: '名称', visible: true },
{ key: 'roleSort', title: '规格型号', visible: true },
{ key: 'status', title: '状态', visible: true },
{ key: 'remark', title: '备注', visible: true },
// { key: 'createTime', title: '创建时间', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getAlertBorrow({ ...p, ...q })
}
}

44
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.html

@ -0,0 +1,44 @@
<app-page>
<div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container>
<ng-container *appTableForm>
<app-query-item label="资产名称">
<input nz-input placeholder="请输入" formControlName="roleName" />
</app-query-item>
</ng-container>
</app-server-paginated-table>
</div>
</app-page>

0
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.less

56
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.ts

@ -0,0 +1,56 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-alert-inventory-down',
standalone: true,
imports: [SharedModule],
templateUrl: './alert-inventory-down.component.html',
styleUrl: './alert-inventory-down.component.less',
})
export class AlertInventoryDownComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({
roleName: new FormControl(''),
status: new FormControl(''),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: '_category', title: '资产分类', visible: true },
{ key: 'assetCode', title: '资产编号', visible: true },
{ key: 'name', title: '名称', visible: true },
{ key: 'model', title: '规格型号', visible: true },
{ key: '_warehouse', title: '仓库', visible: true },
// { key: 'createTime', title: '创建时间', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getAlertSafetyDown({ ...p, ...q })
}
}

44
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.html

@ -0,0 +1,44 @@
<app-page>
<div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container>
<ng-container *appTableForm>
<app-query-item label="资产名称">
<input nz-input placeholder="请输入" formControlName="roleName" />
</app-query-item>
</ng-container>
</app-server-paginated-table>
</div>
</app-page>

0
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.less

56
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.ts

@ -0,0 +1,56 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-alert-inventory-safety',
standalone: true,
imports: [SharedModule],
templateUrl: './alert-inventory-safety.component.html',
styleUrl: './alert-inventory-safety.component.less',
})
export class AlertInventorySafetyComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({
roleName: new FormControl(''),
status: new FormControl(''),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: '_category', title: '资产分类', visible: true },
{ key: 'assetCode', title: '资产编号', visible: true },
{ key: 'name', title: '名称', visible: true },
{ key: 'model', title: '规格型号', visible: true },
{ key: '_warehouse', title: '仓库', visible: true },
// { key: 'createTime', title: '创建时间', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getAlertSafety({ ...p, ...q })
}
}

44
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.html

@ -0,0 +1,44 @@
<app-page>
<div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container>
<ng-container *appTableForm>
<app-query-item label="资产名称">
<input nz-input placeholder="请输入" formControlName="roleName" />
</app-query-item>
</ng-container>
</app-server-paginated-table>
</div>
</app-page>

0
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.less

56
web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.ts

@ -0,0 +1,56 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-alert-inventory-up',
standalone: true,
imports: [SharedModule],
templateUrl: './alert-inventory-up.component.html',
styleUrl: './alert-inventory-up.component.less',
})
export class AlertInventoryUpComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({
roleName: new FormControl(''),
status: new FormControl(''),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: '_category', title: '资产分类', visible: true },
{ key: 'assetCode', title: '资产编号', visible: true },
{ key: 'name', title: '名称', visible: true },
{ key: 'model', title: '规格型号', visible: true },
{ key: '_warehouse', title: '仓库', visible: true },
// { key: 'createTime', title: '创建时间', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getAlertSafetyUp({ ...p, ...q })
}
}

44
web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.html

@ -0,0 +1,44 @@
<app-page>
<div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container>
<ng-container *appTableForm>
<app-query-item label="资产名称">
<input nz-input placeholder="请输入" formControlName="roleName" />
</app-query-item>
</ng-container>
</app-server-paginated-table>
</div>
</app-page>

0
web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.less

55
web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.ts

@ -0,0 +1,55 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-alert-maintenance',
standalone: true,
imports: [SharedModule],
templateUrl: './alert-maintenance.component.html',
styleUrl: './alert-maintenance.component.less',
})
export class AlertMaintenanceComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({
roleName: new FormControl(''),
status: new FormControl(''),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: '_category', title: '资产分类', visible: true },
{ key: 'assetCode', title: '资产编号', visible: true },
{ key: 'name', title: '名称', visible: true },
{ key: 'model', title: '规格型号', visible: true },
{ key: '_warehouse', title: '仓库', visible: true },
// { key: 'createTime', title: '创建时间', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getAlertMaintenance({ ...p, ...q })
}
}

90
web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html

@ -5,8 +5,7 @@
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/ledger']" nzMatchRouter>固资台账</li> <li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/ledger']" nzMatchRouter>固资台账</li>
<li <li
nz-submenu nz-submenu
(nzOpenChange)="onMenuOpenChange($event, 'manage')" [nzOpen]="openedSubmenu.startsWith('/fixed-asset/manage/')"
[nzOpen]="openedSubmenu === 'manage'"
[nzPaddingLeft]="12" [nzPaddingLeft]="12"
nzTitle="固资管理" nzTitle="固资管理"
> >
@ -69,7 +68,13 @@
</li> --> </li> -->
</ul> </ul>
</li> </li>
<li nzMatchRouter [nzPaddingLeft]="12" nz-submenu nzTitle="维护维保" [nzOpen]="openedSubmenu === 'repair'"> <li
nzMatchRouter
[nzPaddingLeft]="12"
nz-submenu
nzTitle="维护维保"
[nzOpen]="openedSubmenu.startsWith('/fixed-asset/repair/')"
>
<ul> <ul>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/repair/type']" nzMatchRouter> <li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/repair/type']" nzMatchRouter>
维修类型 维修类型
@ -82,22 +87,83 @@
</li> </li>
</ul> </ul>
</li> </li>
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/flow']" nzMatchRouter>固资流程</li> <!-- <li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/flow']" nzMatchRouter>固资流程</li>
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/kucun']" nzMatchRouter>库存物品</li> <li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/kucun']" nzMatchRouter>库存物品</li> -->
<li nzMatchRouter [nzPaddingLeft]="12" nz-submenu nzTitle="盘点管理" [nzOpen]="openedSubmenu === 'stocktaking'"> <li
nzMatchRouter
[nzPaddingLeft]="12"
nz-submenu
nzTitle="盘点管理"
[nzOpen]="openedSubmenu.startsWith('/fixed-asset/stocktaking/')"
>
<ul> <ul>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/stocktaking/job']" nzMatchRouter>
盘点任务
</li>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/stocktaking/plan']" nzMatchRouter> <li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/stocktaking/plan']" nzMatchRouter>
盘点计划 盘点计划
</li> </li>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/stocktaking/job']" nzMatchRouter>
盘点任务
</li>
</ul> </ul>
</li> </li>
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/alert']" nzMatchRouter>预警中心</li> <li
nzMatchRouter
[nzPaddingLeft]="12"
nz-submenu
nzTitle="预警中心"
[nzOpen]="openedSubmenu.startsWith('/fixed-asset/alert/')"
>
<ul>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/alert/borrow']" nzMatchRouter>
借用预警
</li>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/alert/maintenance']" nzMatchRouter>
维保到期预警
</li>
<li
nzMatchRouter
[nzPaddingLeft]="24"
nz-submenu
nzTitle="库存安全预警"
[nzOpen]="openedSubmenu.startsWith('/fixed-asset/alert/inventory')"
>
<ul>
<li
nz-menu-item
[nzPaddingLeft]="36"
[routerLink]="['/fixed-asset/alert/inventory/safety']"
nzMatchRouter
>
安全库存
</li>
<li
nz-menu-item
[nzPaddingLeft]="36"
[routerLink]="['/fixed-asset/alert/inventory/up']"
nzMatchRouter
>
安全库存上限
</li>
<li
nz-menu-item
[nzPaddingLeft]="36"
[routerLink]="['/fixed-asset/alert/inventory/down']"
nzMatchRouter
>
安全库存下限
</li>
</ul>
</li>
</ul>
</li>
<li nzMatchRouter [nzPaddingLeft]="12" nz-submenu nzTitle="基础数据" [nzOpen]="openedSubmenu === 'basic'"> <li
nzMatchRouter
[nzPaddingLeft]="12"
nz-submenu
nzTitle="基础数据"
[nzOpen]="openedSubmenu.startsWith('/fixed-asset/basic/')"
>
<ul> <ul>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/basic/goods-stock']" nzMatchRouter> <li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/basic/goods-stock']" nzMatchRouter>
物品档案 物品档案
@ -123,7 +189,7 @@
</ul> </ul>
</li> </li>
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/system']" nzMatchRouter>系统设置</li> <!-- <li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/system']" nzMatchRouter>系统设置</li> -->
</ul> </ul>
</div> </div>

6
web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.ts

@ -11,7 +11,7 @@ import { SharedModule } from 'app/shared/shared.module'
}) })
export class FixedAssetComponent implements OnInit { export class FixedAssetComponent implements OnInit {
constructor(private router: Router) { constructor(private router: Router) {
this.openedSubmenu = this.router.url.split('/')[2] ?? '' this.openedSubmenu = this.router.url
} }
openedSubmenu = '' openedSubmenu = ''
@ -20,7 +20,7 @@ export class FixedAssetComponent implements OnInit {
console.log('this.openedSubmenu', this.openedSubmenu) console.log('this.openedSubmenu', this.openedSubmenu)
} }
onMenuOpenChange(open: boolean, v: string) { onMenuOpenChange(open: boolean) {
this.openedSubmenu = open ? v : '' this.openedSubmenu = open ? this.router.url : ''
} }
} }

226
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.html

@ -1,74 +1,198 @@
<div class="flex h-full"> <div class="flex flex-1 overflow-hidden h-full">
<div class="mr-3 p-3 bg-white shadow rounded"> <div class="mr-3 p-3 bg-white shadow rounded">
<div class="w-56"> <div class="w-56">
<app-component-org-tree [createable]="false" /> <app-component-org-tree
[createable]="false"
[company]="false"
(onOrgSelectedChange)="onOrgSelectedChange($event)"
/>
</div> </div>
</div> </div>
<div> <div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm"> <app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
<nz-tag>
{{ ASSET_STATUS_MAP[data] }}
</nz-tag>
}
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<!-- <ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link">资产确认</button>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container> -->
<ng-container *appTableForm> <ng-container *appTableForm>
<app-query-item label="资产状态"> <app-query-item label="资产名称">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="闲置"></nz-option>
<nz-option nzValue="22" nzLabel="在用"></nz-option>
<nz-option nzValue="2211" nzLabel="借用中"></nz-option>
<nz-option nzValue="2221" nzLabel="维修中"></nz-option>
<nz-option nzValue="2231" nzLabel="调拨中"></nz-option>
<nz-option nzValue="2241" nzLabel="待作废"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="位置">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="位置1"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="name" />
</app-query-item> </app-query-item>
<app-query-item label="名称"> <app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="assetCode" />
</app-query-item> </app-query-item>
<app-query-item label="规格型号"> <app-query-item label="规格型号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="model" />
</app-query-item> </app-query-item>
<app-query-item label="序列号"> <app-query-item label="序列号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="serialNumber" />
</app-query-item> </app-query-item>
<app-query-item label="厂商"> <app-query-item label="资产状态">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="status"
>
@for (item of ASSET_STATUS_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="维保商"> <app-query-item label="资产来源">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="sourceId"
>
@for (item of ASSET_SOURCE_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="采购日期"> <app-query-item label="位置">
<app-date-query></app-date-query> <app-position-select formControlName="positionId" />
</app-query-item>
<app-query-item label="所属公司">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<app-query-item label="管理人员"> <app-query-item label="生产厂商">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <app-manufacturer-select class="block w-36" formControlName="manufacturersVendorId" />
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<!-- <app-query-item label="设备标签">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="管理IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="运行环境">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="营业"></nz-option>
<nz-option nzValue="22" nzLabel="办公"></nz-option>
<nz-option nzValue="2211" nzLabel="生产"></nz-option>
<nz-option nzValue="2221" nzLabel="测试"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="来源">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="捐赠"></nz-option>
<nz-option nzValue="22" nzLabel="赠送"></nz-option>
<nz-option nzValue="2211" nzLabel="采购"></nz-option>
<nz-option nzValue="2221" nzLabel="自建"></nz-option>
<nz-option nzValue="2221" nzLabel="自购"></nz-option>
<nz-option nzValue="2221" nzLabel="其他"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="厂商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="维保商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="采购日期">
<app-date-query></app-date-query>
</app-query-item>
<app-query-item label="所属公司">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> -->
</ng-container> </ng-container>
</app-server-paginated-table> </app-server-paginated-table>
</div> </div>

123
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.ts

@ -1,77 +1,110 @@
import { Component } from '@angular/core' import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms' import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ComponentOrgTreeComponent } from 'app/components/component-org-tree/component-org-tree.component'
import { ApiService } from 'app/services' import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns' import { format } from 'date-fns'
import { of } from 'rxjs' import { lastValueFrom, of } from 'rxjs'
import {
AssetFormComponent,
ComponentOrgTreeComponent,
ManufacturerSelectComponent,
PositionSelectComponent,
} from 'app/components'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants'
import { Utils } from 'app/utils'
@Component({ @Component({
selector: 'app-fixed-asset-belong', selector: 'app-fixed-asset-belong',
standalone: true, standalone: true,
imports: [SharedModule, ComponentOrgTreeComponent], imports: [
SharedModule,
AssetFormComponent,
ComponentOrgTreeComponent,
PositionSelectComponent,
ManufacturerSelectComponent,
],
templateUrl: './fixed-asset-belong.component.html', templateUrl: './fixed-asset-belong.component.html',
styleUrl: './fixed-asset-belong.component.less', styleUrl: './fixed-asset-belong.component.less',
}) })
export class FixedAssetBelongComponent { export class FixedAssetBelongComponent {
constructor(private api: ApiService) {} constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({ queryForm = new FormGroup({
name: new FormControl(''), name: new FormControl(),
type: new FormControl(''), model: new FormControl(),
status: new FormControl(''), status: new FormControl(),
date: new FormControl(''), assetCode: new FormControl(),
serialNumber: new FormControl(),
sourceId: new FormControl(),
positionId: new FormControl(),
manufacturersVendorId: new FormControl(),
}) })
@ViewChild('copyTpl') copyTpl!: TemplateRef<NzSafeAny>
ASSET_STATUS_MAP = ASSET_STATUS_MAP()
ASSET_SOURCE_MAP = ASSET_SOURCE_MAP
table = new TableOption(this.fetchData.bind(this)) table = new TableOption(this.fetchData.bind(this))
organizationId: number | null = null
copyNum = 1
ngOnInit(): void { ngOnInit(): void {
this.table this.table
.setConfig({ .setConfig({
selectable: true, rowKey: 'assetId',
}) })
.setColumn([ .setColumn([
{ key: '资产编号', title: '资产编号', visible: true }, { key: 'assetCode', title: '资产编号', visible: true },
{ key: '资产分类', title: '资产分类', visible: true }, { key: 'name', title: '资产名称', visible: true },
{ key: '资产状态', title: '资产状态', visible: true }, { key: '_category', title: '资产分类', visible: true },
{ key: '资产名称', title: '资产名称', visible: true }, { key: 'status', title: '资产状态', visible: true },
{ key: '规格型号', title: '规格型号', visible: true }, { key: '_ownCompany', title: '所属公司', visible: true },
{ key: '序列号', title: '序列号', visible: true }, { key: '_useOrganization', title: '使用组织', visible: true },
{ key: '使用人员', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '所属公司', title: '所属公司', visible: true }, ])
{ key: '使用组织', title: '使用组织', visible: true }, .setRowOperate([
{ key: '存放位置', title: '存放位置', visible: true }, {
{ key: '资产标签', title: '资产标签', visible: true }, title: '查看',
onClick: (v) => {
this.onCreate(v, true)
},
},
]) ])
.setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }])
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
if (Array.isArray(q['createTime'])) { return this.api.getAssetPage({ ...p, ...q, ownCompanyId: this.organizationId })
const createTimeStart = q['createTime']?.[0] }
const createTimeEnd = q['createTime']?.[1]
q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' onCreate(data?: NzSafeAny, preview?: boolean) {
q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' this.modal.create({
} nzTitle: '查看资产',
return of({ nzContent: AssetFormComponent,
data: { nzWidth: '80vw',
total: 5, nzWrapClassName: 'modal-lg',
records: [ nzData: {
{ value: data,
id: 1, preview,
name: '沙滩',
price: 590,
type: 0,
lifespan: 6,
number: 20,
max: 20,
status: 1,
createTime: '2024-05-01',
},
],
}, },
nzFooter: null,
}) })
return this.api.getEntityPage(p, q) }
onOrgSelectedChange(e: NzSafeAny) {
this.organizationId = e ? e.organizationId : null
this.table.ref.search()
} }
} }

233
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.html

@ -1,81 +1,194 @@
<div class="flex h-full"> <div class="flex flex-1 overflow-hidden h-full">
<div class="mr-3 p-3 bg-white shadow rounded"> <div class="mr-3 p-3 bg-white shadow rounded">
<div class="w-56"> <div class="w-56 overflow-hidden">
<nz-tree <app-component-basic-category-tree [createable]="false" (onSelectedChange)="onSelectedChange($event)" />
nzBlockNode
[nzData]="nodes"
(nzClick)="nzEvent($event)"
(nzExpandChange)="nzEvent($event)"
(nzSearchValueChange)="nzEvent($event)"
>
</nz-tree>
</div> </div>
</div> </div>
<div> <div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm"> <app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
<nz-tag>
{{ ASSET_STATUS_MAP[data] }}
</nz-tag>
}
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<!-- <ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link">资产确认</button>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container> -->
<ng-container *appTableForm> <ng-container *appTableForm>
<app-query-item label="资产状态"> <app-query-item label="资产名称">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="闲置"></nz-option>
<nz-option nzValue="22" nzLabel="在用"></nz-option>
<nz-option nzValue="2211" nzLabel="借用中"></nz-option>
<nz-option nzValue="2221" nzLabel="维修中"></nz-option>
<nz-option nzValue="2231" nzLabel="调拨中"></nz-option>
<nz-option nzValue="2241" nzLabel="待作废"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="位置">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="位置1"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="name" />
</app-query-item> </app-query-item>
<app-query-item label="名称"> <app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="assetCode" />
</app-query-item> </app-query-item>
<app-query-item label="规格型号"> <app-query-item label="规格型号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="model" />
</app-query-item> </app-query-item>
<app-query-item label="序列号"> <app-query-item label="序列号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="serialNumber" />
</app-query-item> </app-query-item>
<app-query-item label="厂商"> <app-query-item label="资产状态">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="status"
>
@for (item of ASSET_STATUS_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="维保商"> <app-query-item label="资产来源">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="sourceId"
>
@for (item of ASSET_SOURCE_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="采购日期"> <!-- <app-query-item label="位置">
<app-date-query></app-date-query> <app-position-select formControlName="positionId" />
</app-query-item> </app-query-item> -->
<app-query-item label="所属公司"> <app-query-item label="生产厂商">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <app-manufacturer-select class="block w-36" formControlName="manufacturersVendorId" />
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<!-- <app-query-item label="设备标签">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="管理IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="运行环境">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="营业"></nz-option>
<nz-option nzValue="22" nzLabel="办公"></nz-option>
<nz-option nzValue="2211" nzLabel="生产"></nz-option>
<nz-option nzValue="2221" nzLabel="测试"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="来源">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="捐赠"></nz-option>
<nz-option nzValue="22" nzLabel="赠送"></nz-option>
<nz-option nzValue="2211" nzLabel="采购"></nz-option>
<nz-option nzValue="2221" nzLabel="自建"></nz-option>
<nz-option nzValue="2221" nzLabel="自购"></nz-option>
<nz-option nzValue="2221" nzLabel="其他"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="厂商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="维保商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="采购日期">
<app-date-query></app-date-query>
</app-query-item>
<app-query-item label="所属公司">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> -->
</ng-container> </ng-container>
</app-server-paginated-table> </app-server-paginated-table>
</div> </div>

158
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.ts

@ -1,115 +1,111 @@
import { Component } from '@angular/core' import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms' import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services' import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns' import { format } from 'date-fns'
import { NzFormatEmitEvent } from 'ng-zorro-antd/tree' import { lastValueFrom, of } from 'rxjs'
import { of } from 'rxjs' import {
AssetFormComponent,
ComponentBasicCategoryTreeComponent,
ComponentOrgTreeComponent,
ManufacturerSelectComponent,
PositionTreeComponent,
} from 'app/components'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants'
@Component({ @Component({
selector: 'app-fixed-asset-category', selector: 'app-fixed-asset-category',
standalone: true, standalone: true,
imports: [SharedModule], imports: [
SharedModule,
AssetFormComponent,
ComponentOrgTreeComponent,
PositionTreeComponent,
ManufacturerSelectComponent,
ComponentBasicCategoryTreeComponent,
],
templateUrl: './fixed-asset-category.component.html', templateUrl: './fixed-asset-category.component.html',
styleUrl: './fixed-asset-category.component.less', styleUrl: './fixed-asset-category.component.less',
}) })
export class FixedAssetCategoryComponent { export class FixedAssetCategoryComponent {
constructor(private api: ApiService) {} constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({ queryForm = new FormGroup({
name: new FormControl(''), name: new FormControl(),
type: new FormControl(''), model: new FormControl(),
status: new FormControl(''), status: new FormControl(),
date: new FormControl(''), assetCode: new FormControl(),
serialNumber: new FormControl(),
sourceId: new FormControl(),
positionId: new FormControl(),
manufacturersVendorId: new FormControl(),
}) })
@ViewChild('copyTpl') copyTpl!: TemplateRef<NzSafeAny>
ASSET_STATUS_MAP = ASSET_STATUS_MAP()
ASSET_SOURCE_MAP = ASSET_SOURCE_MAP
table = new TableOption(this.fetchData.bind(this)) table = new TableOption(this.fetchData.bind(this))
nodes = [ categoryId: number | null = null
{
title: '数据中心设备',
key: '0-0',
children: [
{
title: '组织1',
key: '0-0-0',
isLeaf: true,
},
],
},
{
title: '办公设备',
key: '0-1',
isLeaf: true,
},
{
title: '办公家具',
key: '0-2',
isLeaf: true,
},
{
title: '特种设备',
key: '0-21',
isLeaf: true,
},
{
title: '车辆资产',
key: '0-21',
isLeaf: true,
},
]
nzEvent(event: NzFormatEmitEvent): void { copyNum = 1
console.log(event)
}
ngOnInit(): void { ngOnInit(): void {
this.table this.table
.setConfig({ .setConfig({
selectable: true, rowKey: 'assetId',
}) })
.setColumn([ .setColumn([
{ key: '资产编号', title: '资产编号', visible: true }, { key: 'assetCode', title: '资产编号', visible: true },
{ key: '资产分类', title: '资产分类', visible: true }, { key: 'name', title: '资产名称', visible: true },
{ key: '资产状态', title: '资产状态', visible: true }, { key: '_category', title: '资产分类', visible: true },
{ key: '资产名称', title: '资产名称', visible: true }, { key: 'status', title: '资产状态', visible: true },
{ key: '规格型号', title: '规格型号', visible: true }, { key: '_ownCompany', title: '所属公司', visible: true },
{ key: '序列号', title: '序列号', visible: true }, { key: '_useOrganization', title: '使用组织', visible: true },
{ key: '使用人员', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '所属公司', title: '所属公司', visible: false }, ])
{ key: '使用组织', title: '使用组织', visible: false }, .setRowOperate([
{ key: '存放位置', title: '存放位置', visible: false }, {
{ key: '资产标签', title: '资产标签', visible: false }, title: '查看',
onClick: (v) => {
this.onCreate(v, true)
},
},
]) ])
.setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }])
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
if (Array.isArray(q['createTime'])) { return this.api.getAssetPage({ ...p, ...q, categoryId: this.categoryId })
const createTimeStart = q['createTime']?.[0] }
const createTimeEnd = q['createTime']?.[1]
q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' onCreate(data?: NzSafeAny, preview?: boolean) {
q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' this.modal.create({
} nzTitle: '查看资产',
return of({ nzContent: AssetFormComponent,
data: { nzWidth: '80vw',
total: 5, nzWrapClassName: 'modal-lg',
records: [ nzData: {
{ value: data,
id: 1, preview,
name: '沙滩',
price: 590,
type: 0,
lifespan: 6,
number: 20,
max: 20,
status: 1,
createTime: '2024-05-01',
},
],
}, },
nzFooter: null,
}) })
return this.api.getEntityPage(p, q) }
onSelectedChange(e: NzSafeAny) {
this.categoryId = e ? e.categoryId : null
this.table.ref.search()
} }
} }

2
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-employee/fixed-asset-employee.component.ts

@ -98,6 +98,6 @@ export class FixedAssetEmployeeComponent {
], ],
}, },
}) })
return this.api.getEntityPage(p, q) // return this.api.getEntityPage(p, q)
} }
} }

18
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.html

@ -1,10 +1,22 @@
<app-page> <app-page class="ledger">
<div class="mb-3"> <div class="mb-3">
<nz-radio-group [(ngModel)]="tab" (ngModelChange)="onTabChange($event)" nzButtonStyle="solid"> <!-- <nz-radio-group [(ngModel)]="tab" (ngModelChange)="onTabChange($event)" nzButtonStyle="solid">
@for (t of tabs; track $index) { @for (t of tabs; track $index) {
<label nz-radio-button [nzValue]="t.path">{{ t.title }}</label> <label nz-radio-button [nzValue]="t.path">{{ t.title }}</label>
} }
</nz-radio-group> </nz-radio-group> -->
<!-- <nz-tabset>
@for (t of tabs; track $index) {
<nz-tab [nzTitle]="t.title"> 1313 </nz-tab>
}
</nz-tabset> -->
<ul class="flex bg-white tabs">
@for (t of tabs; track $index) {
<li [ngClass]="{ active: tab === t.path }">
<button nz-button nzType="text" [routerLink]="t.path">{{ t.title }}</button>
</li>
}
</ul>
</div> </div>
<router-outlet /> <router-outlet />
</app-page> </app-page>

22
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.less

@ -0,0 +1,22 @@
.tabs {
li {
border-bottom: 2px solid transparent;
}
.active {
border-color: #40a9ff;
button {
color: #40a9ff;
}
}
}
.ledger {
::ng-deep {
.formgroup-container {
padding: 12px 12px 0;
}
}
}

8
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.ts

@ -21,10 +21,10 @@ const tabs = [
path: 'asset-position', path: 'asset-position',
title: '存放位置台账', title: '存放位置台账',
}, },
{ // {
path: 'asset-employee', // path: 'asset-employee',
title: '员工查询台账', // title: '员工查询台账',
}, // },
{ {
path: 'asset-category', path: 'asset-category',
title: '分类查询台账', title: '分类查询台账',

194
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.html

@ -1,26 +1,188 @@
<div class="flex flex-1"> <div class="flex-1 overflow-hidden bg-white">
<app-server-paginated-table [options]="table" [formGroup]="queryForm"> <app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
<nz-tag>
{{ ASSET_STATUS_MAP[data] }}
</nz-tag>
}
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<!-- <ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link">资产确认</button>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container> -->
<ng-container *appTableForm> <ng-container *appTableForm>
<app-query-item label="资产名称">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="assetCode" />
</app-query-item>
<app-query-item label="规格型号">
<input nz-input placeholder="请输入" formControlName="model" />
</app-query-item>
<app-query-item label="序列号">
<input nz-input placeholder="请输入" formControlName="serialNumber" />
</app-query-item>
<app-query-item label="资产状态"> <app-query-item label="资产状态">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="闲置"></nz-option> nzPlacement="bottomRight"
<nz-option nzValue="22" nzLabel="在用"></nz-option> class="!w-24"
<nz-option nzValue="2211" nzLabel="借用中"></nz-option> [nzDropdownMatchSelectWidth]="false"
<nz-option nzValue="2221" nzLabel="维修中"></nz-option> formControlName="status"
<nz-option nzValue="2231" nzLabel="调拨中"></nz-option> >
<nz-option nzValue="2241" nzLabel="待作废"></nz-option> @for (item of ASSET_STATUS_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="资产来源">
<app-query-item label="资产编号"> <nz-select
<input nz-input placeholder="请输入" formControlName="name" /> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="sourceId"
>
@for (item of ASSET_SOURCE_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select>
</app-query-item> </app-query-item>
<app-query-item label="名称">
<input nz-input placeholder="请输入" formControlName="name" /> <app-query-item label="位置">
<app-position-select formControlName="positionId" />
</app-query-item> </app-query-item>
<app-query-item label="规格型号"> <app-query-item label="生产厂商">
<input nz-input placeholder="请输入" formControlName="name" /> <app-manufacturer-select class="block w-36" formControlName="manufacturersVendorId" />
</app-query-item> </app-query-item>
<!-- <app-query-item label="设备标签">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="管理IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="运行环境">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="营业"></nz-option>
<nz-option nzValue="22" nzLabel="办公"></nz-option>
<nz-option nzValue="2211" nzLabel="生产"></nz-option>
<nz-option nzValue="2221" nzLabel="测试"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="来源">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="捐赠"></nz-option>
<nz-option nzValue="22" nzLabel="赠送"></nz-option>
<nz-option nzValue="2211" nzLabel="采购"></nz-option>
<nz-option nzValue="2221" nzLabel="自建"></nz-option>
<nz-option nzValue="2221" nzLabel="自购"></nz-option>
<nz-option nzValue="2221" nzLabel="其他"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="厂商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="维保商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="采购日期">
<app-date-query></app-date-query>
</app-query-item>
<app-query-item label="所属公司">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> -->
</ng-container> </ng-container>
</app-server-paginated-table> </app-server-paginated-table>
</div> </div>

103
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.ts

@ -1,77 +1,92 @@
import { Component } from '@angular/core' import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms' import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services' import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns' import { format } from 'date-fns'
import { of } from 'rxjs' import { lastValueFrom, of } from 'rxjs'
import { AssetFormComponent, ManufacturerSelectComponent, PositionSelectComponent } from 'app/components'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants'
import { Utils } from 'app/utils'
@Component({ @Component({
selector: 'app-fixed-asset-myown', selector: 'app-fixed-asset-myown',
standalone: true, standalone: true,
imports: [SharedModule], imports: [SharedModule, AssetFormComponent, PositionSelectComponent, ManufacturerSelectComponent],
templateUrl: './fixed-asset-myown.component.html', templateUrl: './fixed-asset-myown.component.html',
styleUrl: './fixed-asset-myown.component.less', styleUrl: './fixed-asset-myown.component.less',
}) })
export class FixedAssetMyownComponent { export class FixedAssetMyownComponent {
constructor(private api: ApiService) {} constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({ queryForm = new FormGroup({
name: new FormControl(''), name: new FormControl(),
type: new FormControl(''), model: new FormControl(),
status: new FormControl(''), status: new FormControl(),
date: new FormControl(''), assetCode: new FormControl(),
serialNumber: new FormControl(),
sourceId: new FormControl(),
positionId: new FormControl(),
manufacturersVendorId: new FormControl(),
}) })
@ViewChild('copyTpl') copyTpl!: TemplateRef<NzSafeAny>
ASSET_STATUS_MAP = ASSET_STATUS_MAP()
ASSET_SOURCE_MAP = ASSET_SOURCE_MAP
table = new TableOption(this.fetchData.bind(this)) table = new TableOption(this.fetchData.bind(this))
copyNum = 1
ngOnInit(): void { ngOnInit(): void {
this.table this.table
.setConfig({ .setConfig({
selectable: true, rowKey: 'assetId',
}) })
.setColumn([ .setColumn([
{ key: '资产编号', title: '资产编号', visible: true }, { key: 'assetCode', title: '资产编号', visible: true },
{ key: '资产分类', title: '资产分类', visible: true }, { key: 'name', title: '资产名称', visible: true },
{ key: '资产状态', title: '资产状态', visible: true }, { key: '_category', title: '资产分类', visible: true },
{ key: '资产名称', title: '资产名称', visible: true }, { key: 'status', title: '资产状态', visible: true },
{ key: '规格型号', title: '规格型号', visible: true }, { key: '_ownCompany', title: '所属公司', visible: true },
{ key: '序列号', title: '序列号', visible: true }, { key: '_useOrganization', title: '使用组织', visible: true },
{ key: '使用人员', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '所属公司', title: '所属公司', visible: true }, ])
{ key: '使用组织', title: '使用组织', visible: true }, .setRowOperate([
{ key: '存放位置', title: '存放位置', visible: true }, {
{ key: '资产标签', title: '资产标签', visible: true }, title: '查看',
onClick: (v) => {
this.onCreate(v, true)
},
},
]) ])
.setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }])
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
if (Array.isArray(q['createTime'])) { return this.api.getAssetPage({ ...p, ...q })
const createTimeStart = q['createTime']?.[0] }
const createTimeEnd = q['createTime']?.[1]
q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' onCreate(data?: NzSafeAny, preview?: boolean) {
q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' this.modal.create({
} nzTitle: '查看资产',
return of({ nzContent: AssetFormComponent,
data: { nzWidth: '80vw',
total: 5, nzWrapClassName: 'modal-lg',
records: [ nzData: {
{ value: data,
id: 1, preview,
name: '沙滩',
price: 590,
type: 0,
lifespan: 6,
number: 20,
max: 20,
status: 1,
createTime: '2024-05-01',
},
],
}, },
nzFooter: null,
}) })
return this.api.getEntityPage(p, q)
} }
} }

233
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.html

@ -1,81 +1,198 @@
<div class="flex h-full"> <div class="flex flex-1 overflow-hidden h-full">
<div class="mr-3 p-3 bg-white shadow rounded"> <div class="mr-3 p-3 bg-white shadow rounded">
<div class="w-56"> <div class="w-56">
<nz-tree <app-component-org-tree
nzBlockNode [createable]="false"
[nzData]="nodes" [company]="false"
(nzClick)="nzEvent($event)" (onOrgSelectedChange)="onOrgSelectedChange($event)"
(nzExpandChange)="nzEvent($event)" />
(nzSearchValueChange)="nzEvent($event)"
>
</nz-tree>
</div> </div>
</div> </div>
<div> <div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm"> <app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
<nz-tag>
{{ ASSET_STATUS_MAP[data] }}
</nz-tag>
}
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<!-- <ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link">资产确认</button>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container> -->
<ng-container *appTableForm> <ng-container *appTableForm>
<app-query-item label="资产状态"> <app-query-item label="资产名称">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="闲置"></nz-option>
<nz-option nzValue="22" nzLabel="在用"></nz-option>
<nz-option nzValue="2211" nzLabel="借用中"></nz-option>
<nz-option nzValue="2221" nzLabel="维修中"></nz-option>
<nz-option nzValue="2231" nzLabel="调拨中"></nz-option>
<nz-option nzValue="2241" nzLabel="待作废"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="位置">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="位置1"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="name" />
</app-query-item> </app-query-item>
<app-query-item label="名称"> <app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="assetCode" />
</app-query-item> </app-query-item>
<app-query-item label="规格型号"> <app-query-item label="规格型号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="model" />
</app-query-item> </app-query-item>
<app-query-item label="序列号"> <app-query-item label="序列号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="serialNumber" />
</app-query-item> </app-query-item>
<app-query-item label="厂商"> <app-query-item label="资产状态">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="status"
>
@for (item of ASSET_STATUS_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="维保商"> <app-query-item label="资产来源">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="sourceId"
>
@for (item of ASSET_SOURCE_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="采购日期"> <app-query-item label="位置">
<app-date-query></app-date-query> <app-position-select formControlName="positionId" />
</app-query-item>
<app-query-item label="所属公司">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<app-query-item label="管理人员"> <app-query-item label="生产厂商">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <app-manufacturer-select class="block w-36" formControlName="manufacturersVendorId" />
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<!-- <app-query-item label="设备标签">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="管理IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="运行环境">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="营业"></nz-option>
<nz-option nzValue="22" nzLabel="办公"></nz-option>
<nz-option nzValue="2211" nzLabel="生产"></nz-option>
<nz-option nzValue="2221" nzLabel="测试"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="来源">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="捐赠"></nz-option>
<nz-option nzValue="22" nzLabel="赠送"></nz-option>
<nz-option nzValue="2211" nzLabel="采购"></nz-option>
<nz-option nzValue="2221" nzLabel="自建"></nz-option>
<nz-option nzValue="2221" nzLabel="自购"></nz-option>
<nz-option nzValue="2221" nzLabel="其他"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="厂商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="维保商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="采购日期">
<app-date-query></app-date-query>
</app-query-item>
<app-query-item label="所属公司">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> -->
</ng-container> </ng-container>
</app-server-paginated-table> </app-server-paginated-table>
</div> </div>

146
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.ts

@ -1,105 +1,109 @@
import { Component } from '@angular/core' import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms' import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services' import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns' import { format } from 'date-fns'
import { NzFormatEmitEvent } from 'ng-zorro-antd/tree' import { lastValueFrom, of } from 'rxjs'
import { of } from 'rxjs' import {
AssetFormComponent,
ComponentOrgTreeComponent,
ManufacturerSelectComponent,
PositionSelectComponent,
} from 'app/components'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants'
@Component({ @Component({
selector: 'app-fixed-asset-org', selector: 'app-fixed-asset-org',
standalone: true, standalone: true,
imports: [SharedModule], imports: [
SharedModule,
AssetFormComponent,
ComponentOrgTreeComponent,
PositionSelectComponent,
ManufacturerSelectComponent,
],
templateUrl: './fixed-asset-org.component.html', templateUrl: './fixed-asset-org.component.html',
styleUrl: './fixed-asset-org.component.less', styleUrl: './fixed-asset-org.component.less',
}) })
export class FixedAssetOrgComponent { export class FixedAssetOrgComponent {
constructor(private api: ApiService) {} constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({ queryForm = new FormGroup({
name: new FormControl(''), name: new FormControl(),
type: new FormControl(''), model: new FormControl(),
status: new FormControl(''), status: new FormControl(),
date: new FormControl(''), assetCode: new FormControl(),
serialNumber: new FormControl(),
sourceId: new FormControl(),
positionId: new FormControl(),
manufacturersVendorId: new FormControl(),
}) })
@ViewChild('copyTpl') copyTpl!: TemplateRef<NzSafeAny>
ASSET_STATUS_MAP = ASSET_STATUS_MAP()
ASSET_SOURCE_MAP = ASSET_SOURCE_MAP
table = new TableOption(this.fetchData.bind(this)) table = new TableOption(this.fetchData.bind(this))
nodes = [ organizationId: number | null = null
{
title: '科技部',
key: '0-0',
children: [
{
title: '组织1',
key: '0-0-0',
isLeaf: true,
},
],
},
{
title: '组织2',
key: '0-1',
isLeaf: true,
},
{
title: '组织3',
key: '0-2',
isLeaf: true,
},
]
nzEvent(event: NzFormatEmitEvent): void { copyNum = 1
console.log(event)
}
ngOnInit(): void { ngOnInit(): void {
this.table this.table
.setConfig({ .setConfig({
selectable: true, rowKey: 'assetId',
}) })
.setColumn([ .setColumn([
{ key: '资产编号', title: '资产编号', visible: true }, { key: 'assetCode', title: '资产编号', visible: true },
{ key: '资产分类', title: '资产分类', visible: true }, { key: 'name', title: '资产名称', visible: true },
{ key: '资产状态', title: '资产状态', visible: true }, { key: '_category', title: '资产分类', visible: true },
{ key: '资产名称', title: '资产名称', visible: true }, { key: 'status', title: '资产状态', visible: true },
{ key: '规格型号', title: '规格型号', visible: true }, { key: '_ownCompany', title: '所属公司', visible: true },
{ key: '序列号', title: '序列号', visible: true }, { key: '_useOrganization', title: '使用组织', visible: true },
{ key: '使用人员', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '所属公司', title: '所属公司', visible: true }, ])
{ key: '使用组织', title: '使用组织', visible: true }, .setRowOperate([
{ key: '存放位置', title: '存放位置', visible: true }, {
{ key: '资产标签', title: '资产标签', visible: true }, title: '查看',
onClick: (v) => {
this.onCreate(v, true)
},
},
]) ])
.setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }])
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
if (Array.isArray(q['createTime'])) { return this.api.getAssetPage({ ...p, ...q, ownCompanyId: this.organizationId })
const createTimeStart = q['createTime']?.[0] }
const createTimeEnd = q['createTime']?.[1]
q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' onCreate(data?: NzSafeAny, preview?: boolean) {
q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' this.modal.create({
} nzTitle: '查看资产',
return of({ nzContent: AssetFormComponent,
data: { nzWidth: '80vw',
total: 5, nzWrapClassName: 'modal-lg',
records: [ nzData: {
{ value: data,
id: 1, preview,
name: '沙滩',
price: 590,
type: 0,
lifespan: 6,
number: 20,
max: 20,
status: 1,
createTime: '2024-05-01',
},
],
}, },
nzFooter: null,
}) })
return this.api.getEntityPage(p, q) }
onOrgSelectedChange(e: NzSafeAny) {
this.organizationId = e ? e.organizationId : null
this.table.ref.search()
} }
} }

231
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.html

@ -1,81 +1,194 @@
<div class="flex h-full"> <div class="flex flex-1 overflow-hidden h-full">
<div class="mr-3 p-3 bg-white shadow rounded"> <div class="mr-3 p-3 bg-white shadow rounded">
<div class="w-56"> <div class="w-56">
<nz-tree <app-position-tree (onSelectedChange)="onSelectedChange($event)" />
nzBlockNode
[nzData]="nodes"
(nzClick)="nzEvent($event)"
(nzExpandChange)="nzEvent($event)"
(nzSearchValueChange)="nzEvent($event)"
>
</nz-tree>
</div> </div>
</div> </div>
<div> <div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [formGroup]="queryForm"> <app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
<nz-tag>
{{ ASSET_STATUS_MAP[data] }}
</nz-tag>
}
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<!-- <ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link">资产确认</button>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container> -->
<ng-container *appTableForm> <ng-container *appTableForm>
<app-query-item label="资产状态"> <app-query-item label="资产名称">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="闲置"></nz-option>
<nz-option nzValue="22" nzLabel="在用"></nz-option>
<nz-option nzValue="2211" nzLabel="借用中"></nz-option>
<nz-option nzValue="2221" nzLabel="维修中"></nz-option>
<nz-option nzValue="2231" nzLabel="调拨中"></nz-option>
<nz-option nzValue="2241" nzLabel="待作废"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="位置">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="位置1"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="name" />
</app-query-item> </app-query-item>
<app-query-item label="名称"> <app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="assetCode" />
</app-query-item> </app-query-item>
<app-query-item label="规格型号"> <app-query-item label="规格型号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="model" />
</app-query-item> </app-query-item>
<app-query-item label="序列号"> <app-query-item label="序列号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="serialNumber" />
</app-query-item> </app-query-item>
<app-query-item label="厂商"> <app-query-item label="资产状态">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="status"
>
@for (item of ASSET_STATUS_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="维保商"> <app-query-item label="资产来源">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="sourceId"
>
@for (item of ASSET_SOURCE_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="采购日期"> <!-- <app-query-item label="位置">
<app-date-query></app-date-query> <app-position-select formControlName="positionId" />
</app-query-item> </app-query-item> -->
<app-query-item label="所属公司"> <app-query-item label="生产厂商">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <app-manufacturer-select class="block w-36" formControlName="manufacturersVendorId" />
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select nzPlacement="bottomRight" class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<!-- <app-query-item label="设备标签">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="管理IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="运行环境">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="营业"></nz-option>
<nz-option nzValue="22" nzLabel="办公"></nz-option>
<nz-option nzValue="2211" nzLabel="生产"></nz-option>
<nz-option nzValue="2221" nzLabel="测试"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="来源">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="捐赠"></nz-option>
<nz-option nzValue="22" nzLabel="赠送"></nz-option>
<nz-option nzValue="2211" nzLabel="采购"></nz-option>
<nz-option nzValue="2221" nzLabel="自建"></nz-option>
<nz-option nzValue="2221" nzLabel="自购"></nz-option>
<nz-option nzValue="2221" nzLabel="其他"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="厂商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="维保商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="采购日期">
<app-date-query></app-date-query>
</app-query-item>
<app-query-item label="所属公司">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> -->
</ng-container> </ng-container>
</app-server-paginated-table> </app-server-paginated-table>
</div> </div>

147
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.ts

@ -1,105 +1,108 @@
import { Component } from '@angular/core' import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms' import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services' import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns' import { format } from 'date-fns'
import { NzFormatEmitEvent } from 'ng-zorro-antd/tree' import { lastValueFrom, of } from 'rxjs'
import { of } from 'rxjs' import {
AssetFormComponent,
ComponentOrgTreeComponent,
ManufacturerSelectComponent,
PositionTreeComponent,
} from 'app/components'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants'
@Component({ @Component({
selector: 'app-fixed-asset-position', selector: 'app-fixed-asset-position',
standalone: true, standalone: true,
imports: [SharedModule], imports: [
SharedModule,
AssetFormComponent,
ComponentOrgTreeComponent,
PositionTreeComponent,
ManufacturerSelectComponent,
],
templateUrl: './fixed-asset-position.component.html', templateUrl: './fixed-asset-position.component.html',
styleUrl: './fixed-asset-position.component.less', styleUrl: './fixed-asset-position.component.less',
}) })
export class FixedAssetPositionComponent { export class FixedAssetPositionComponent {
constructor(private api: ApiService) {} constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({ queryForm = new FormGroup({
name: new FormControl(''), name: new FormControl(),
type: new FormControl(''), model: new FormControl(),
status: new FormControl(''), status: new FormControl(),
date: new FormControl(''), assetCode: new FormControl(),
serialNumber: new FormControl(),
sourceId: new FormControl(),
positionId: new FormControl(),
manufacturersVendorId: new FormControl(),
}) })
@ViewChild('copyTpl') copyTpl!: TemplateRef<NzSafeAny>
ASSET_STATUS_MAP = ASSET_STATUS_MAP()
ASSET_SOURCE_MAP = ASSET_SOURCE_MAP
table = new TableOption(this.fetchData.bind(this)) table = new TableOption(this.fetchData.bind(this))
nodes = [ positionId: number | null = null
{
title: '位置1',
key: '0-0',
children: [
{
title: '位置1-1',
key: '0-0-0',
isLeaf: true,
},
],
},
{
title: '位置2',
key: '0-1',
isLeaf: true,
},
{
title: '位置3',
key: '0-2',
isLeaf: true,
},
]
nzEvent(event: NzFormatEmitEvent): void { copyNum = 1
console.log(event)
}
ngOnInit(): void { ngOnInit(): void {
this.table this.table
.setConfig({ .setConfig({
selectable: true, rowKey: 'assetId',
}) })
.setColumn([ .setColumn([
{ key: '资产编号', title: '资产编号', visible: true }, { key: 'assetCode', title: '资产编号', visible: true },
{ key: '资产分类', title: '资产分类', visible: true }, { key: 'name', title: '资产名称', visible: true },
{ key: '资产状态', title: '资产状态', visible: true }, { key: '_category', title: '资产分类', visible: true },
{ key: '资产名称', title: '资产名称', visible: true }, { key: 'status', title: '资产状态', visible: true },
{ key: '规格型号', title: '规格型号', visible: true }, { key: '_ownCompany', title: '所属公司', visible: true },
{ key: '序列号', title: '序列号', visible: true }, { key: '_useOrganization', title: '使用组织', visible: true },
{ key: '使用人员', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '所属公司', title: '所属公司', visible: true }, ])
{ key: '使用组织', title: '使用组织', visible: true }, .setRowOperate([
{ key: '存放位置', title: '存放位置', visible: true }, {
{ key: '资产标签', title: '资产标签', visible: true }, title: '查看',
onClick: (v) => {
this.onCreate(v, true)
},
},
]) ])
.setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }])
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
if (Array.isArray(q['createTime'])) { return this.api.getAssetPage({ ...p, ...q, positionId: this.positionId })
const createTimeStart = q['createTime']?.[0] }
const createTimeEnd = q['createTime']?.[1]
q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' onCreate(data?: NzSafeAny, preview?: boolean) {
q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' this.modal.create({
} nzTitle: '查看资产',
return of({ nzContent: AssetFormComponent,
data: { nzWidth: '80vw',
total: 5, nzWrapClassName: 'modal-lg',
records: [ nzData: {
{ value: data,
id: 1, preview,
name: '沙滩',
price: 590,
type: 0,
lifespan: 6,
number: 20,
max: 20,
status: 1,
createTime: '2024-05-01',
},
],
}, },
nzFooter: null,
}) })
return this.api.getEntityPage(p, q) }
onSelectedChange(e: NzSafeAny) {
this.positionId = e ? e.positionId : null
this.table.ref.search()
} }
} }

218
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.html

@ -1,68 +1,188 @@
<div class="flex flex-1"> <div class="flex-1 overflow-hidden bg-white">
<app-server-paginated-table [options]="table" [formGroup]="queryForm"> <app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
<nz-tag>
{{ ASSET_STATUS_MAP[data] }}
</nz-tag>
}
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_warehouse') {
{{ data?.name ?? '-' }}
}
@case ('_position') {
{{ data?.name ?? '-' }}
}
@case ('_head') {
{{ data?.userName ?? '-' }}
}
@case ('_ownCompany') {
{{ data?.organizationName ?? '-' }}
}
@case ('_useOrganization') {
{{ data?.organizationName ?? '-' }}
}
@case ('_category') {
{{ data?.categoryName ?? '-' }}
}
@default {
{{ data }}
}
}
</ng-template>
<!-- <ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link">资产确认</button>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container> -->
<ng-container *appTableForm> <ng-container *appTableForm>
<app-query-item label="资产状态"> <app-query-item label="资产名称">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="闲置"></nz-option>
<nz-option nzValue="22" nzLabel="在用"></nz-option>
<nz-option nzValue="2211" nzLabel="借用中"></nz-option>
<nz-option nzValue="2221" nzLabel="维修中"></nz-option>
<nz-option nzValue="2231" nzLabel="调拨中"></nz-option>
<nz-option nzValue="2241" nzLabel="待作废"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="位置">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="位置1"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="name" />
</app-query-item> </app-query-item>
<app-query-item label="名称"> <app-query-item label="资产编号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="assetCode" />
</app-query-item> </app-query-item>
<app-query-item label="规格型号"> <app-query-item label="规格型号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="model" />
</app-query-item> </app-query-item>
<app-query-item label="序列号"> <app-query-item label="序列号">
<input nz-input placeholder="请输入" formControlName="name" /> <input nz-input placeholder="请输入" formControlName="serialNumber" />
</app-query-item> </app-query-item>
<app-query-item label="厂商"> <app-query-item label="资产状态">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="status"
>
@for (item of ASSET_STATUS_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="维保商"> <app-query-item label="资产来源">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <nz-select
<nz-option nzValue="123" nzLabel="11"></nz-option> nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="sourceId"
>
@for (item of ASSET_SOURCE_MAP | keyvalue; track $index) {
<nz-option [nzLabel]="item.value" [nzValue]="item.key"></nz-option>
}
</nz-select> </nz-select>
</app-query-item> </app-query-item>
<app-query-item label="采购日期"> <app-query-item label="位置">
<app-date-query></app-date-query> <app-position-select formControlName="positionId" />
</app-query-item>
<app-query-item label="所属公司">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false">
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<app-query-item label="使用人员"> <app-query-item label="生产厂商">
<nz-select nzPlacement="bottomRight" nzBorderless class="!w-auto" [nzDropdownMatchSelectWidth]="false"> <app-manufacturer-select class="block w-36" formControlName="manufacturersVendorId" />
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> </app-query-item>
<!-- <app-query-item label="设备标签">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="管理IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="设备IP">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
<app-query-item label="运行环境">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="营业"></nz-option>
<nz-option nzValue="22" nzLabel="办公"></nz-option>
<nz-option nzValue="2211" nzLabel="生产"></nz-option>
<nz-option nzValue="2221" nzLabel="测试"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="来源">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="捐赠"></nz-option>
<nz-option nzValue="22" nzLabel="赠送"></nz-option>
<nz-option nzValue="2211" nzLabel="采购"></nz-option>
<nz-option nzValue="2221" nzLabel="自建"></nz-option>
<nz-option nzValue="2221" nzLabel="自购"></nz-option>
<nz-option nzValue="2221" nzLabel="其他"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="厂商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="维保商">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="采购日期">
<app-date-query></app-date-query>
</app-query-item>
<app-query-item label="所属公司">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用组织">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="管理人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item>
<app-query-item label="使用人员">
<nz-select
nzPlacement="bottomRight"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false"
>
<nz-option nzValue="123" nzLabel="11"></nz-option>
</nz-select>
</app-query-item> -->
</ng-container> </ng-container>
</app-server-paginated-table> </app-server-paginated-table>
</div> </div>

103
web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.ts

@ -1,77 +1,92 @@
import { Component } from '@angular/core' import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms' import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services' import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns' import { format } from 'date-fns'
import { of } from 'rxjs' import { lastValueFrom, of } from 'rxjs'
import { AssetFormComponent, ManufacturerSelectComponent, PositionSelectComponent } from 'app/components'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants'
import { Utils } from 'app/utils'
@Component({ @Component({
selector: 'app-fixed-asset-search', selector: 'app-fixed-asset-search',
standalone: true, standalone: true,
imports: [SharedModule], imports: [SharedModule, AssetFormComponent, PositionSelectComponent, ManufacturerSelectComponent],
templateUrl: './fixed-asset-search.component.html', templateUrl: './fixed-asset-search.component.html',
styleUrl: './fixed-asset-search.component.less', styleUrl: './fixed-asset-search.component.less',
}) })
export class FixedAssetSearchComponent { export class FixedAssetSearchComponent {
constructor(private api: ApiService) {} constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
queryForm = new FormGroup({ queryForm = new FormGroup({
name: new FormControl(''), name: new FormControl(),
type: new FormControl(''), model: new FormControl(),
status: new FormControl(''), status: new FormControl(),
date: new FormControl(''), assetCode: new FormControl(),
serialNumber: new FormControl(),
sourceId: new FormControl(),
positionId: new FormControl(),
manufacturersVendorId: new FormControl(),
}) })
@ViewChild('copyTpl') copyTpl!: TemplateRef<NzSafeAny>
ASSET_STATUS_MAP = ASSET_STATUS_MAP()
ASSET_SOURCE_MAP = ASSET_SOURCE_MAP
table = new TableOption(this.fetchData.bind(this)) table = new TableOption(this.fetchData.bind(this))
copyNum = 1
ngOnInit(): void { ngOnInit(): void {
this.table this.table
.setConfig({ .setConfig({
selectable: true, rowKey: 'assetId',
}) })
.setColumn([ .setColumn([
{ key: '资产编号', title: '资产编号', visible: true }, { key: 'assetCode', title: '资产编号', visible: true },
{ key: '资产分类', title: '资产分类', visible: true }, { key: 'name', title: '资产名称', visible: true },
{ key: '资产状态', title: '资产状态', visible: true }, { key: '_category', title: '资产分类', visible: true },
{ key: '资产名称', title: '资产名称', visible: true }, { key: 'status', title: '资产状态', visible: true },
{ key: '规格型号', title: '规格型号', visible: true }, { key: '_ownCompany', title: '所属公司', visible: true },
{ key: '序列号', title: '序列号', visible: true }, { key: '_useOrganization', title: '使用组织', visible: true },
{ key: '使用人员', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '所属公司', title: '所属公司', visible: true }, ])
{ key: '使用组织', title: '使用组织', visible: true }, .setRowOperate([
{ key: '存放位置', title: '存放位置', visible: true }, {
{ key: '资产标签', title: '资产标签', visible: true }, title: '查看',
onClick: (v) => {
this.onCreate(v, true)
},
},
]) ])
.setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }])
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
if (Array.isArray(q['createTime'])) { return this.api.getAssetPage({ ...p, ...q })
const createTimeStart = q['createTime']?.[0] }
const createTimeEnd = q['createTime']?.[1]
q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' onCreate(data?: NzSafeAny, preview?: boolean) {
q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' this.modal.create({
} nzTitle: '查看资产',
return of({ nzContent: AssetFormComponent,
data: { nzWidth: '80vw',
total: 5, nzWrapClassName: 'modal-lg',
records: [ nzData: {
{ value: data,
id: 1, preview,
name: '沙滩',
price: 590,
type: 0,
lifespan: 6,
number: 20,
max: 20,
status: 1,
createTime: '2024-05-01',
},
],
}, },
nzFooter: null,
}) })
return this.api.getEntityPage(p, q)
} }
} }

9
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-allot/fixed-asset-manage-allot.component.ts

@ -52,7 +52,7 @@ export class FixedAssetManageAllotComponent {
{ key: 'inWarehouseId', title: '调入仓库', visible: true }, { key: 'inWarehouseId', title: '调入仓库', visible: true },
// { key: '_manager', title: '管理人员', visible: true }, // { key: '_manager', title: '管理人员', visible: true },
// { key: '_position', title: '存放位置', visible: true }, // { key: '_position', title: '存放位置', visible: true },
// { key: '_position', title: '详细位置', visible: true }, // { key: 'positionDetail', title: '详细位置', visible: true },
{ key: 'businessGeneratedDate', title: '调拨日期', visible: true }, { key: 'businessGeneratedDate', title: '调拨日期', visible: true },
{ key: 'notes', title: '备注', visible: true }, { key: 'notes', title: '备注', visible: true },
]) ])
@ -75,8 +75,13 @@ export class FixedAssetManageAllotComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产调拨' : '添加资产调拨'
if (preview) {
nzTitle = '预览资产调拨'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产调拨' : '添加资产调拨', nzTitle,
nzContent: AssetBusinessAllotFormComponent, nzContent: AssetBusinessAllotFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

3
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.html

@ -38,6 +38,9 @@
@case ('_useOrganization') { @case ('_useOrganization') {
{{ data?.organizationName ?? '-' }} {{ data?.organizationName ?? '-' }}
} }
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_category') { @case ('_category') {
{{ data?.categoryName ?? '-' }} {{ data?.categoryName ?? '-' }}
} }

13
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.ts

@ -48,10 +48,9 @@ export class FixedAssetManageBorrowComponent {
{ key: 'businessId', title: '业务编号', visible: true, width: '350px' }, { key: 'businessId', title: '业务编号', visible: true, width: '350px' },
{ key: 'name', title: '业务名称', visible: true }, { key: 'name', title: '业务名称', visible: true },
{ key: 'status', title: '办理状态', visible: true }, { key: 'status', title: '办理状态', visible: true },
{ key: '_supplierVendor', title: '借用人', visible: true }, { key: '_useUser', title: '借用人', visible: true },
{ key: '_manager', title: '借出时间', visible: true }, { key: 'businessGeneratedDate', title: '借出时间', visible: true },
{ key: '_manager', title: '预计归还时间', visible: true }, { key: 'returnTime', title: '预计归还时间', visible: true },
{ key: '_manager', title: '归还时间', visible: true },
{ key: 'notes', title: '备注', visible: true }, { key: 'notes', title: '备注', visible: true },
]) ])
@ -74,8 +73,12 @@ export class FixedAssetManageBorrowComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产借用' : '添加资产借用'
if (preview) {
nzTitle = '预览资产借用'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产借用' : '添加资产借用', nzTitle,
nzContent: AssetBusinessBorrowFormComponent, nzContent: AssetBusinessBorrowFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

6
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.html

@ -35,6 +35,12 @@
@case ('_ownCompany') { @case ('_ownCompany') {
{{ data?.organizationName ?? '-' }} {{ data?.organizationName ?? '-' }}
} }
@case ('_useUser') {
{{ data?.userName ?? '-' }}
}
@case ('_applicant') {
{{ data?.userName ?? '-' }}
}
@case ('_useOrganization') { @case ('_useOrganization') {
{{ data?.organizationName ?? '-' }} {{ data?.organizationName ?? '-' }}
} }

8
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.ts

@ -51,7 +51,7 @@ export class FixedAssetManageDistributionComponent {
{ key: '_useOrganization', title: '领用后公司/部门', visible: true }, { key: '_useOrganization', title: '领用后公司/部门', visible: true },
{ key: '_useUser', title: '使用人员', visible: true }, { key: '_useUser', title: '使用人员', visible: true },
{ key: '_position', title: '存放位置', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '_position', title: '详细位置', visible: true }, { key: 'positionDetail', title: '详细位置', visible: true },
{ key: 'businessGeneratedDate', title: '领用日期', visible: true }, { key: 'businessGeneratedDate', title: '领用日期', visible: true },
{ key: 'notes', title: '备注', visible: true }, { key: 'notes', title: '备注', visible: true },
]) ])
@ -74,8 +74,12 @@ export class FixedAssetManageDistributionComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产领用' : '添加资产领用'
if (preview) {
nzTitle = '预览资产领用'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产领用' : '添加资产领用', nzTitle,
nzContent: AssetBusinessCollectionComponent, nzContent: AssetBusinessCollectionComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

6
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-entry/fixed-asset-manage-entry.component.ts

@ -74,8 +74,12 @@ export class FixedAssetManageEntryComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产入库' : '添加资产入库'
if (preview) {
nzTitle = '预览资产入库'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产入库' : '添加资产入库', nzTitle,
nzContent: AssetBusinessStorageFormComponent, nzContent: AssetBusinessStorageFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

8
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-return/fixed-asset-manage-return.component.ts

@ -51,7 +51,7 @@ export class FixedAssetManageReturnComponent {
{ key: '_useOrganization', title: '退库后公司/部门', visible: true }, { key: '_useOrganization', title: '退库后公司/部门', visible: true },
{ key: '_manager', title: '管理人员', visible: true }, { key: '_manager', title: '管理人员', visible: true },
{ key: '_position', title: '存放位置', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '_position', title: '详细位置', visible: true }, { key: 'positionDetail', title: '详细位置', visible: true },
{ key: 'businessGeneratedDate', title: '退库日期', visible: true }, { key: 'businessGeneratedDate', title: '退库日期', visible: true },
{ key: 'notes', title: '备注', visible: true }, { key: 'notes', title: '备注', visible: true },
]) ])
@ -74,8 +74,12 @@ export class FixedAssetManageReturnComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产退库' : '添加资产退库'
if (preview) {
nzTitle = '预览资产退库'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产退库' : '添加资产退库', nzTitle,
nzContent: AssetBusinessReturnFormComponent, nzContent: AssetBusinessReturnFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

10
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-revert/fixed-asset-manage-revert.component.ts

@ -48,10 +48,10 @@ export class FixedAssetManageRevertComponent {
{ key: 'businessId', title: '业务编号', visible: true, width: '350px' }, { key: 'businessId', title: '业务编号', visible: true, width: '350px' },
{ key: 'name', title: '业务名称', visible: true }, { key: 'name', title: '业务名称', visible: true },
{ key: 'status', title: '办理状态', visible: true }, { key: 'status', title: '办理状态', visible: true },
{ key: '_useOrganization', title: '归还后公司/部门', visible: true }, // { key: '_useOrganization', title: '归还后公司/部门', visible: true },
{ key: '_manager', title: '管理人员', visible: true }, { key: '_manager', title: '管理人员', visible: true },
{ key: '_position', title: '存放位置', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '_position', title: '详细位置', visible: true }, { key: 'positionDetail', title: '详细位置', visible: true },
{ key: 'businessGeneratedDate', title: '归还日期', visible: true }, { key: 'businessGeneratedDate', title: '归还日期', visible: true },
{ key: 'notes', title: '备注', visible: true }, { key: 'notes', title: '备注', visible: true },
]) ])
@ -74,8 +74,12 @@ export class FixedAssetManageRevertComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产归还' : '添加资产归还'
if (preview) {
nzTitle = '预览资产归还'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产归还' : '添加资产归还', nzTitle,
nzContent: AssetBusinessRevertFormComponent, nzContent: AssetBusinessRevertFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

2
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-scrap/fixed-asset-manage-scrap.component.ts

@ -81,6 +81,6 @@ export class FixedAssetManageScrapComponent {
], ],
}, },
}) })
return this.api.getEntityPage(p, q) // return this.api.getEntityPage(p, q)
} }
} }

8
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-transfer/fixed-asset-manage-transfer.component.ts

@ -53,7 +53,7 @@ export class FixedAssetManageTransferComponent {
{ key: '_manager', title: '管理人员', visible: true }, { key: '_manager', title: '管理人员', visible: true },
{ key: '_useUser', title: '使用人员', visible: true }, { key: '_useUser', title: '使用人员', visible: true },
{ key: '_position', title: '存放位置', visible: true }, { key: '_position', title: '存放位置', visible: true },
{ key: '_position', title: '详细位置', visible: true }, { key: 'positionDetail', title: '详细位置', visible: true },
{ key: 'businessGeneratedDate', title: '转移日期', visible: true }, { key: 'businessGeneratedDate', title: '转移日期', visible: true },
{ key: 'notes', title: '备注', visible: true }, { key: 'notes', title: '备注', visible: true },
]) ])
@ -76,8 +76,12 @@ export class FixedAssetManageTransferComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产转移' : '添加资产转移'
if (preview) {
nzTitle = '预览资产转移'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产转移' : '添加资产转移', nzTitle,
nzContent: AssetBusinessTransferFormComponent, nzContent: AssetBusinessTransferFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

6
web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage/fixed-asset-manage.component.ts

@ -100,8 +100,12 @@ export class FixedAssetManageComponent {
} }
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产' : '添加资产'
if (preview) {
nzTitle = '预览资产'
}
this.modal.create({ this.modal.create({
nzTitle: data ? '编辑资产' : '添加资产', nzTitle,
nzContent: AssetFormComponent, nzContent: AssetFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',

6
web-admin-app/src/app/pages/org-setting/org-setting.component.html

@ -71,8 +71,7 @@
<app-query-item label="状态"> <app-query-item label="状态">
<nz-select <nz-select
nzPlacement="bottomRight" nzPlacement="bottomRight"
nzBorderless class="!w-40"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false" [nzDropdownMatchSelectWidth]="false"
formControlName="status" formControlName="status"
nzAllowClear nzAllowClear
@ -84,8 +83,7 @@
<app-query-item label="性别"> <app-query-item label="性别">
<nz-select <nz-select
nzPlacement="bottomRight" nzPlacement="bottomRight"
nzBorderless class="!w-40"
class="!w-auto"
[nzDropdownMatchSelectWidth]="false" [nzDropdownMatchSelectWidth]="false"
formControlName="sex" formControlName="sex"
nzAllowClear nzAllowClear

10
web-admin-app/src/app/pages/profile-account/profile-account.component.ts

@ -20,12 +20,10 @@ export class ProfileAccountComponent {
) {} ) {}
formGroup = new FormGroup({ formGroup = new FormGroup({
// id: new FormControl(this.api.authInfo.id), id: new FormControl(),
// username: new FormControl({ value: this.api.authInfo.username, disabled: true }, [ username: new FormControl({ value: '', disabled: true }, [FormValidators.required('请输入用户名')]),
// FormValidators.required('请输入用户名'), password: new FormControl('', [FormValidators.required('请输入密码')]),
// ]), confirmPassword: new FormControl('', [FormValidators.required('请再次输入密码')]),
// password: new FormControl('', [FormValidators.required('请输入密码')]),
// confirmPassword: new FormControl('', [FormValidators.required('请再次输入密码')]),
}) })
onSubmit() { onSubmit() {

8
web-admin-app/src/app/pages/profile-basic/profile-basic.component.ts

@ -23,10 +23,10 @@ export class ProfileBasicComponent implements OnInit, OnDestroy {
formGroup!: FormGroup formGroup!: FormGroup
ngOnInit(): void { ngOnInit(): void {
// this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
// name: new FormControl(this.api.authInfo.name, [FormValidators.required('请输入姓名')]), name: new FormControl('', [FormValidators.required('请输入姓名')]),
// remark: new FormControl(this.api.authInfo.remark), remark: new FormControl(''),
// }) })
} }
ngOnDestroy(): void {} ngOnDestroy(): void {}

54
web-admin-app/src/app/pages/profile/profile.component.html

@ -1,25 +1,29 @@
<div> <app-page>
<nz-card [nzBordered]="false"> <div>
<nz-descriptions class="ml-16"> <nz-card [nzBordered]="false">
<nz-descriptions-item nzTitle="用户名"> <nz-descriptions class="ml-16">
{{ api.authInfo?.loginName }} <nz-descriptions-item nzTitle="用户名">
</nz-descriptions-item> {{ api.authInfo?.loginName }}
<nz-descriptions-item nzTitle="姓名"> </nz-descriptions-item>
{{ api.authInfo?.userName }} <nz-descriptions-item nzTitle="姓名">
</nz-descriptions-item> {{ api.authInfo?.userName }}
</nz-descriptions> </nz-descriptions-item>
</nz-card> </nz-descriptions>
</div> </nz-card>
<div class="mt-4"> </div>
<nz-card [nzBordered]="false"> <div class="mt-4">
<div class="nav-bar"> <nz-card [nzBordered]="false">
<ul> <div class="nav-bar">
<li class="cursor-pointer" [routerLink]="['/profile/basic']" routerLinkActive="active">基础信息</li> <ul>
<li class="cursor-pointer" [routerLink]="['/profile/account']" routerLinkActive="active">账号密码</li> <li class="cursor-pointer" [routerLink]="['/profile/basic']" routerLinkActive="active">基础信息</li>
</ul> <li class="cursor-pointer" [routerLink]="['/profile/account']" routerLinkActive="active">
</div> 账号密码
<div class="py-4"> </li>
<router-outlet></router-outlet> </ul>
</div> </div>
</nz-card> <div class="py-4">
</div> <router-outlet></router-outlet>
</div>
</nz-card>
</div>
</app-page>

14
web-admin-app/src/app/pages/system/index/system.component.html

@ -1,2 +1,12 @@
<div>ad</div> <div
<router-outlet /> class="menu bg-white shadow fixed left-0 top-12 bottom-0 z-20 w-48 flex-shrink-0 py-3 overflow-y-auto overflow-x-hidden"
>
<ul nz-menu nzMode="inline">
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/system/user']" nzMatchRouter>组织架构</li>
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/system/role']" nzMatchRouter>角色管理</li>
</ul>
</div>
<div class="pl-48 overflow-hidden">
<router-outlet></router-outlet>
</div>

11
web-admin-app/src/app/pages/system/index/system.component.ts

@ -13,13 +13,14 @@ const pathTabs = ['/system/global-config', '/system/log', '/system/bill']
}) })
export class SystemComponent { export class SystemComponent {
constructor(private router: Router) { constructor(private router: Router) {
this.tab = pathTabs.findIndex((path) => this.router.url.includes(path)) this.openedSubmenu = this.router.url.split('/')[2] ?? ''
} }
tab = 0 openedSubmenu = ''
onTabChange(i: number) { ngOnInit(): void {}
const url = pathTabs[i]
this.router.navigate([url]) onMenuOpenChange(open: boolean, v: string) {
this.openedSubmenu = open ? v : ''
} }
} }

97
web-admin-app/src/app/pages/system/system-role/system-role.component.html

@ -0,0 +1,97 @@
<app-page>
<ng-template #actionTpl>
<nz-space>
<button *nzSpaceItem nz-button nzType="primary" (click)="onCreate()">
<span>新建</span>
</button>
</nz-space>
</ng-template>
<div class="flex-1 overflow-hidden">
<app-server-paginated-table
[options]="table"
[tableAction]="actionTpl"
[formGroup]="queryForm"
[renderColumn]="renderColumnTpl"
>
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
@switch (data) {
@case ('0') {
<nz-badge nzStatus="processing" nzText="正常"></nz-badge>
}
@case ('1') {
<nz-badge nzStatus="error" nzText="停用"></nz-badge>
}
}
}
@default {
{{ data }}
}
}
</ng-template>
<ng-container *appTableAction>
<nz-space>
<button *nzSpaceItem nz-button nzType="link" nzDanger="">删除</button>
</nz-space>
</ng-container>
<ng-container *appTableForm>
<app-query-item label="角色名称">
<input nz-input placeholder="请输入" formControlName="roleName" />
</app-query-item>
<app-query-item label="状态">
<nz-select nzPlaceHolder="请选择" nzAllowClear class="w-40" formControlName="status">
<nz-option nzValue="0" nzLabel="正常"></nz-option>
<nz-option nzValue="1" nzLabel="停用"></nz-option>
</nz-select>
</app-query-item>
</ng-container>
</app-server-paginated-table>
</div>
</app-page>
<ng-template #createFormTpl>
<form nz-form [formGroup]="createForm" [nzLayout]="'vertical'">
<nz-form-item>
<nz-form-label nzRequired>名称</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入名称" formControlName="roleName" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label>权限菜单</nz-form-label>
<nz-form-control> 《权限菜单》 </nz-form-control>
</nz-form-item>
<!-- <nz-form-item>
<nz-form-label>备注</nz-form-label>
<nz-form-control>
<input nz-input nzPlaceHolder="请输入备注" formControlName="roleKey" />
</nz-form-control>
</nz-form-item> -->
<nz-form-item>
<nz-form-label>显示顺序</nz-form-label>
<nz-form-control>
<nz-input-number nzPlaceHolder="请输入" class="!w-full" formControlName="roleSort" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label>状态</nz-form-label>
<nz-form-control>
<nz-radio-group formControlName="status">
<label nz-radio nzValue="0">正常</label>
<label nz-radio nzValue="1">停用</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label>备注</nz-form-label>
<nz-form-control>
<input nz-input nzPlaceHolder="请输入备注" formControlName="remark" />
</nz-form-control>
</nz-form-item>
</form>
</ng-template>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>

0
web-admin-app/src/app/pages/system/system-role/system-role.component.less

107
web-admin-app/src/app/pages/system/system-role/system-role.component.ts

@ -0,0 +1,107 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-system-role',
standalone: true,
imports: [SharedModule],
templateUrl: './system-role.component.html',
styleUrl: './system-role.component.less',
})
export class SystemRoleComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
@ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}>
queryForm = new FormGroup({
roleName: new FormControl(''),
status: new FormControl(''),
})
createForm = new FormGroup({
roleId: new FormControl(),
roleName: new FormControl('', [FormValidators.required('请输入')]),
roleKey: new FormControl(''),
roleSort: new FormControl(0),
status: new FormControl('0'),
remark: new FormControl(''),
menuIdList: new FormControl([]),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: 'roleId', title: '主键', visible: false },
{ key: 'roleName', title: '名称', visible: true },
{ key: 'roleSort', title: '显示顺序', visible: true },
{ key: 'status', title: '状态', visible: true },
{ key: 'remark', title: '备注', visible: true },
// { key: 'createTime', title: '创建时间', visible: true },
])
.setRowOperate([
{ title: '修改', onClick: this.onCreate.bind(this) },
{ title: '删除', onClick: this.deleteItem.bind(this) },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getRolePage({ ...p, ...q })
}
onCreate(data?: NzSafeAny) {
if (data) {
this.createForm.patchValue(data)
}
this.modal.create({
nzTitle: data ? '编辑角色' : '添加角色',
nzContent: this.createFormTpl,
nzOnOk: async () => {
if (FormValidators.validateFormGroup(this.createForm)) {
const vals = this.createForm.value
const res = await lastValueFrom(this.api.saveRole(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
})
}
deleteItem(item?: NzSafeAny) {
const ids = [item.roleId]
this.modal.confirm({
nzTitle: '警告',
nzContent: `是否要删除${ids.length}个角色?`,
nzOnOk: async () => {
const res = await lastValueFrom(this.api.deleteRole(ids))
this.msg.success(res.desc)
this.table.ref.reload()
},
})
}
}

2
web-admin-app/src/app/services/api.dto.ts

@ -4,7 +4,7 @@ export type AuthDTO = {
permissions: string[] permissions: string[]
roles: string[] roles: string[]
userName: string userName: string
} } & Record<string, any>
export type AuthorityDTO = { authority: string } export type AuthorityDTO = { authority: string }

70
web-admin-app/src/app/services/api.service.ts

@ -1,23 +1,9 @@
import { HttpClient, HttpParams } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { JwResponse, NullableProps } from 'app/types' import { JwResponse } from 'app/types'
import { Utils } from 'app/utils' import { Utils } from 'app/utils'
import { NzTreeNodeOptions } from 'ng-zorro-antd/tree' import { of, tap } from 'rxjs'
import { BehaviorSubject, map, of, tap } from 'rxjs' import { AuthDTO } from './api.dto'
import {
AuthDTO,
AuthorizeItemDTO,
ConsoleClientTopDTO,
ConsoleCountDTO,
ConsoleExpireDTO,
EntityDTO,
EntityDetailDTO,
PermissionDTO,
ProductDTO,
RoleFormDTO,
RoleListDTO,
UserDTO,
} from './api.dto'
import { PermissionService } from 'app/shared/permission/permission.service' import { PermissionService } from 'app/shared/permission/permission.service'
import { NzSafeAny } from 'ng-zorro-antd/core/types' import { NzSafeAny } from 'ng-zorro-antd/core/types'
@ -103,10 +89,29 @@ export class ApiService {
} }
return this.http.post<JwResponse>('/api/umsUser/update', data) return this.http.post<JwResponse>('/api/umsUser/update', data)
} }
getRolePage(data: {}) {
return this.http.post<JwResponse>('/api/umsRole/list', data)
}
getRoleDetail(id: number) {
return this.http.post<JwResponse>(`/api/umsRole/query?roleId=${id}`, null)
}
deleteRole(ids: number[]) {
return this.http.post<JwResponse>(`/api/umsRole/delete`, ids)
}
saveRole(data: NzSafeAny) {
if (Utils.isEmpty(data.roleId)) {
return this.http.post<JwResponse>('/api/umsRole/add', data)
}
return this.http.post<JwResponse>('/api/umsRole/update', data)
}
getAssetPage(data: {}) { getAssetPage(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/list', data) return this.http.post<JwResponse>('/api/eamAsset/list', data)
} }
getAssetListByIds(ids: number[]) {
return this.http.post<JwResponse>('/api/eamAsset/queryByIds', ids)
}
getAssetLog(data: {}) { getAssetLog(data: {}) {
return this.http.post<JwResponse>('/api/eamAssetLog/list', data) return this.http.post<JwResponse>('/api/eamAssetLog/list', data)
} }
@ -147,6 +152,22 @@ export class ApiService {
return this.http.post<JwResponse>('/api/eamAsset/update', data) return this.http.post<JwResponse>('/api/eamAsset/update', data)
} }
getAlertBorrow(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/borrow', data)
}
getAlertMaintenance(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/maintenance', data)
}
getAlertSafety(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/safety', data)
}
getAlertSafetyUp(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/up', data)
}
getAlertSafetyDown(data: {}) {
return this.http.post<JwResponse>('/api/eamAsset/warning/down', data)
}
getBasicPositionPage(data: {}) { getBasicPositionPage(data: {}) {
return this.http.post<JwResponse>('/api/eamBasicPosition/list', data) return this.http.post<JwResponse>('/api/eamBasicPosition/list', data)
} }
@ -409,17 +430,4 @@ export class ApiService {
deleteRepairFault(ids: number[]) { deleteRepairFault(ids: number[]) {
return this.http.post<JwResponse>(`/api/eamRepairFault/delete`, ids) return this.http.post<JwResponse>(`/api/eamRepairFault/delete`, ids)
} }
/**
*
*
* -------------------------------
*
*
*/
getEntityPage(p: {}, q: {}) {
const params = Utils.objectToURLSearchParams({ ...p, ...q })
return this.http.get<JwResponse>(`/api/client/pages?${params}`)
}
} }

8
web-admin-app/src/app/services/local-http-interceptor.service.ts

@ -3,6 +3,7 @@ import {
HttpEvent, HttpEvent,
HttpHandler, HttpHandler,
HttpInterceptor, HttpInterceptor,
HttpParams,
HttpRequest, HttpRequest,
HttpResponse, HttpResponse,
} from '@angular/common/http' } from '@angular/common/http'
@ -12,6 +13,7 @@ import { catchError, filter, tap } from 'rxjs/operators'
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router' import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'
import { NzMessageService } from 'ng-zorro-antd/message' import { NzMessageService } from 'ng-zorro-antd/message'
import { ApiService } from './api.service' import { ApiService } from './api.service'
import { Utils } from 'app/utils'
function uintToString(uintArray: Uint8Array) { function uintToString(uintArray: Uint8Array) {
const encodedString = String.fromCharCode.apply(null, uintArray as any) const encodedString = String.fromCharCode.apply(null, uintArray as any)
@ -86,11 +88,17 @@ export class LocalHttpInterceptorService implements HttpInterceptor {
} }
const Authorization: Record<string, string> = token ? { Authorization: token } : {} const Authorization: Record<string, string> = token ? { Authorization: token } : {}
const params = Object.create(null)
if (!Utils.isEmpty(req.body?.pageSize) && !Utils.isEmpty(req.body?.pageNum)) {
params['pageSize'] = req.body.pageSize
params['pageNum'] = req.body.pageNum
}
const newRequest = req.clone({ const newRequest = req.clone({
...req, ...req,
setHeaders: Authorization, setHeaders: Authorization,
url, url,
setParams: params,
}) })
return this.handleResult(next, newRequest) return this.handleResult(next, newRequest)
} }

10
web-admin-app/src/app/shared/components/header/header.component.html

@ -12,9 +12,9 @@
<li class="nav-item"> <li class="nav-item">
<a routerLink="/fixed-asset" routerLinkActive="active">固资管理</a> <a routerLink="/fixed-asset" routerLinkActive="active">固资管理</a>
</li> </li>
<li class="nav-item"> <!-- <li class="nav-item">
<a routerLink="/org" routerLinkActive="active">人事管理</a> <a routerLink="/org" routerLinkActive="active">人事管理</a>
</li> </li> -->
<li class="nav-item"> <li class="nav-item">
<a routerLink="/system" routerLinkActive="active">系统管理</a> <a routerLink="/system" routerLinkActive="active">系统管理</a>
</li> </li>
@ -64,7 +64,11 @@
<div class="ml-auto flex items-center"> <div class="ml-auto flex items-center">
<a nz-button nzType="text" nz-dropdown [nzDropdownMenu]="menu"> <a nz-button nzType="text" nz-dropdown [nzDropdownMenu]="menu">
<nz-avatar nzSrc="/assets/images/avatar4.png" /> @if (api.authInfo?.['avatar']) {
<nz-avatar [nzSrc]="api.authInfo?.['avatar']" />
} @else {
<nz-avatar [nzText]="api.authInfo?.userName?.slice(0, 2)" class="!bg-orange-300" />
}
<span class="ml-2"> <span class="ml-2">
{{ api.authInfo?.userName ?? '-' }} {{ api.authInfo?.userName ?? '-' }}
</span> </span>

Loading…
Cancel
Save