kely 1 year ago
parent
commit
8d681a42d8
  1. 2
      web-admin-app/src/app/app.config.ts
  2. 75
      web-admin-app/src/app/app.routes.ts
  3. 59
      web-admin-app/src/app/components/apply-asset-flow/asset-employee-apply/asset-employee-apply.component.html
  4. 104
      web-admin-app/src/app/components/apply-asset-flow/asset-employee-apply/asset-employee-apply.component.ts
  5. 67
      web-admin-app/src/app/components/apply-asset-flow/asset-employee-loss/asset-employee-loss.component.html
  6. 103
      web-admin-app/src/app/components/apply-asset-flow/asset-employee-loss/asset-employee-loss.component.ts
  7. 91
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component.html
  8. 0
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component.less
  9. 110
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component.ts
  10. 83
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-repair/eam-asset-employee-repair.component.html
  11. 0
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-repair/eam-asset-employee-repair.component.less
  12. 109
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-repair/eam-asset-employee-repair.component.ts
  13. 0
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-scrap/eam-asset-employee-scrap.component.less
  14. 110
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-scrap/eam-asset-employee-scrap.component.ts
  15. 108
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component.html
  16. 0
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component.less
  17. 115
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component.ts
  18. 142
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component.html
  19. 0
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component.less
  20. 117
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component.ts
  21. 60
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component.html
  22. 0
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component.less
  23. 106
      web-admin-app/src/app/components/apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component.ts
  24. 54
      web-admin-app/src/app/components/apply-asset-flow/flow-result/flow-result.component.html
  25. 1
      web-admin-app/src/app/components/apply-asset-flow/flow-result/flow-result.component.ts
  26. 9
      web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.html
  27. 4
      web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.ts
  28. 9
      web-admin-app/src/app/components/asset-business-borrow-form/asset-business-borrow-form.component.html
  29. 4
      web-admin-app/src/app/components/asset-business-borrow-form/asset-business-borrow-form.component.ts
  30. 9
      web-admin-app/src/app/components/asset-business-collection/asset-business-collection.component.html
  31. 8
      web-admin-app/src/app/components/asset-business-collection/asset-business-collection.component.ts
  32. 46
      web-admin-app/src/app/components/asset-business-outbound-form/asset-business-outbound-form.component.html
  33. 0
      web-admin-app/src/app/components/asset-business-outbound-form/asset-business-outbound-form.component.less
  34. 122
      web-admin-app/src/app/components/asset-business-outbound-form/asset-business-outbound-form.component.ts
  35. 9
      web-admin-app/src/app/components/asset-business-retirement/asset-business-retirement.component.html
  36. 4
      web-admin-app/src/app/components/asset-business-retirement/asset-business-retirement.component.ts
  37. 28
      web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.html
  38. 20
      web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.ts
  39. 36
      web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.html
  40. 25
      web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.ts
  41. 6
      web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.html
  42. 4
      web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.less
  43. 4
      web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.ts
  44. 9
      web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.html
  45. 4
      web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.ts
  46. 5
      web-admin-app/src/app/components/asset-form/asset-form.component.html
  47. 6
      web-admin-app/src/app/components/asset-select/asset-select.component.html
  48. 27
      web-admin-app/src/app/components/asset-select/asset-select.component.ts
  49. 20
      web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.html
  50. 9
      web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.ts
  51. 3
      web-admin-app/src/app/components/component-org-tree/component-org-tree.component.html
  52. 15
      web-admin-app/src/app/components/component-org-tree/component-org-tree.component.ts
  53. 18
      web-admin-app/src/app/components/flow-form-v2/flow-form-v2.component.html
  54. 10
      web-admin-app/src/app/components/flow-form-v2/flow-form-v2.component.ts
  55. 18
      web-admin-app/src/app/components/flow-list-by-type/flow-list-by-type.component.html
  56. 8
      web-admin-app/src/app/components/flow-list-by-type/flow-list-by-type.component.less
  57. 270
      web-admin-app/src/app/components/flow-list-by-type/flow-list-by-type.component.ts
  58. 62
      web-admin-app/src/app/components/flow-status-tag/flow-status-tag.component.html
  59. 5
      web-admin-app/src/app/components/flow-status-tag/flow-status-tag.component.less
  60. 17
      web-admin-app/src/app/components/flow-status-tag/flow-status-tag.component.ts
  61. 12
      web-admin-app/src/app/components/index.ts
  62. 4
      web-admin-app/src/app/components/maintain-record-form/maintain-record-form.component.html
  63. 2
      web-admin-app/src/app/components/permissions-select/permissions-select.component.html
  64. 88
      web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.html
  65. 14
      web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.ts
  66. 72
      web-admin-app/src/app/components/plan-task/handle-task/handle-task.component.html
  67. 17
      web-admin-app/src/app/components/plan-task/handle-task/handle-task.component.ts
  68. 71
      web-admin-app/src/app/components/plan-task/plan-form/plan-form.component.html
  69. 13
      web-admin-app/src/app/components/plan-task/plan-form/plan-form.component.ts
  70. 3
      web-admin-app/src/app/components/plan-task/plan-list/plan-list.component.html
  71. 27
      web-admin-app/src/app/components/plan-task/plan-list/plan-list.component.ts
  72. 25
      web-admin-app/src/app/components/plan-task/repair-task-form/repair-task-form.component.html
  73. 5
      web-admin-app/src/app/components/plan-task/repair-task-form/repair-task-form.component.ts
  74. 50
      web-admin-app/src/app/components/plan-task/task-form/task-form.component.html
  75. 14
      web-admin-app/src/app/components/plan-task/task-form/task-form.component.ts
  76. 34
      web-admin-app/src/app/components/plan-task/task-list/task-list.component.html
  77. 12
      web-admin-app/src/app/components/plan-task/task-list/task-list.component.ts
  78. 14
      web-admin-app/src/app/components/position-select/position-select.component.html
  79. 42
      web-admin-app/src/app/components/position-select/position-select.component.ts
  80. 2
      web-admin-app/src/app/components/repair-fault-form/repair-fault-form.component.html
  81. 2
      web-admin-app/src/app/components/repair-form/repair-form.component.html
  82. 56
      web-admin-app/src/app/components/select-asset-flow/select-asset-flow.component.html
  83. 0
      web-admin-app/src/app/components/select-asset-flow/select-asset-flow.component.less
  84. 125
      web-admin-app/src/app/components/select-asset-flow/select-asset-flow.component.ts
  85. 2
      web-admin-app/src/app/components/stocktaking-detail-form/stocktaking-detail-form.component.html
  86. 2
      web-admin-app/src/app/constants/index.ts
  87. 16
      web-admin-app/src/app/pages/dashboard/dashboard.component.html
  88. 2
      web-admin-app/src/app/pages/dashboard/dashboard.component.less
  89. 10
      web-admin-app/src/app/pages/dashboard/dashboard.component.ts
  90. 12
      web-admin-app/src/app/pages/fixed-asset/asset-management/asset-management.component.html
  91. 63
      web-admin-app/src/app/pages/fixed-asset/asset-management/asset-management.component.ts
  92. 77
      web-admin-app/src/app/pages/fixed-asset/basic/basic-category/basic-category.component.html
  93. 39
      web-admin-app/src/app/pages/fixed-asset/basic/basic-category/basic-category.component.ts
  94. 46
      web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form-manage/basic-flow-form-manage.component.html
  95. 4
      web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form-manage/basic-flow-form-manage.component.less
  96. 168
      web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form-manage/basic-flow-form-manage.component.ts
  97. 13
      web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form/basic-flow-form.component.html
  98. 11
      web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form/basic-flow-form.component.less
  99. 36
      web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form/basic-flow-form.component.ts
  100. 41
      web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html

2
web-admin-app/src/app/app.config.ts

@ -26,7 +26,7 @@ const disabledLog = () => {
}
}
// disabledLog()
disabledLog()
export function initializeApp(configService: ServerPaginatedTableService) {
return () => {

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

@ -209,14 +209,23 @@ export const routes: Routes = [
canActivate: [permissionGuard],
title: '展示设置',
data: {
// permission: {
// only: ['system-display:view'],
// },
permission: {
only: ['api:sysConfig:updateDisplaySettings'],
},
},
},
{
path: 'place',
title: '场所地址',
data: {
permission: {
only: [
'api:eamBasicWarehouse:add',
'api:eamBasicWarehouse:update',
'api:eamBasicWarehouse:delete',
],
},
},
children: [
{
path: '',
@ -227,11 +236,29 @@ export const routes: Routes = [
path: 'warehouse',
title: '仓库管理',
component: SystemWarehouseComponent,
data: {
permission: {
only: [
'api:eamBasicWarehouse:add',
'api:eamBasicWarehouse:update',
'api:eamBasicWarehouse:delete',
],
},
},
},
{
path: 'address',
title: '地址管理',
component: SystemAddressComponent,
data: {
permission: {
only: [
'api:eamBasicPosition:add',
'api:eamBasicPosition:update',
'api:eamBasicPosition:delete',
],
},
},
},
],
},
@ -384,28 +411,28 @@ export const routes: Routes = [
component: AssetManagementComponent,
title: '资产管理',
},
{
path: 'repair',
title: '维护维保',
children: [
{
path: '',
redirectTo: 'list',
pathMatch: 'full',
},
// {
// path: 'repair',
// title: '维护维保',
// children: [
// {
// path: '',
// redirectTo: 'list',
// pathMatch: 'full',
// },
{
path: 'list',
component: RepairListComponent,
title: '维修登记',
},
{
path: 'fault',
component: RepairFaultComponent,
title: '故障登记',
},
],
},
// {
// path: 'list',
// component: RepairListComponent,
// title: '维修登记',
// },
// {
// path: 'fault',
// component: RepairFaultComponent,
// title: '故障登记',
// },
// ],
// },
{
path: 'manage',
// title: '固资管理',

59
web-admin-app/src/app/components/apply-asset-flow/asset-employee-apply/asset-employee-apply.component.html

@ -1,59 +0,0 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-org-select formControlName="applyDepartmentId" />
</nz-form-control>
</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 placeholder="请输入申请人" formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">原因</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</div>

104
web-admin-app/src/app/components/apply-asset-flow/asset-employee-apply/asset-employee-apply.component.ts

@ -1,104 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../flow-result/flow-result.component'
@Component({
selector: 'app-asset-employee-apply',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-employee-apply.component.html',
styleUrl: './asset-employee-apply.component.less',
})
export class AssetEmployeeApplyComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]),
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
FormValidators.required('请选择'),
]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
notes: this.fb.control(null, [FormValidators.required('请输入')]),
urgency: this.fb.control(1, []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.formGroup.patchValue({
...data.procVars,
applyDepartmentId: data.procVars?.applyDepartmentId + '',
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
applyDepartmentId: Number(v.applyDepartmentId),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('attach')?.setValue(res.body.fileName)
})
}
}

67
web-admin-app/src/app/components/apply-asset-flow/asset-employee-loss/asset-employee-loss.component.html

@ -1,67 +0,0 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-org-select formControlName="applyDepartmentId" />
</nz-form-control>
</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 placeholder="请输入申请人" formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">原因</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
<!-- @if (data?.preview) {
<app-flow-result />
} -->
</div>
</form>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</div>

103
web-admin-app/src/app/components/apply-asset-flow/asset-employee-loss/asset-employee-loss.component.ts

@ -1,103 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
@Component({
selector: 'app-asset-employee-loss',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
],
templateUrl: './asset-employee-loss.component.html',
styleUrl: './asset-employee-loss.component.less',
})
export class AssetEmployeeLossComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]),
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
FormValidators.required('请选择'),
]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
notes: this.fb.control(null, [FormValidators.required('请输入')]),
urgency: this.fb.control(1, []),
assetIdList: this.fb.control([], []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.formGroup.patchValue({
...data.procVars,
applyDepartmentId: data.procVars?.applyDepartmentId + '',
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
applyDepartmentId: Number(v.applyDepartmentId?.[0]),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('attach')?.setValue(res.body.fileName)
})
}
}

91
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component.html

@ -1,91 +0,0 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-org-select formControlName="applyDepartmentId" />
</nz-form-control>
</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 placeholder="请输入申请人" formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>交接部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-org-select formControlName="handoverDepartmentId" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>交接人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-select-user-by-org formControlName="handoverUserId" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">内容</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入内容" formControlName="content"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>备注</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入备注" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</div>

0
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component.less

110
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component.ts

@ -1,110 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../flow-result/flow-result.component'
@Component({
selector: 'app-eam-asset-employee-handover',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './eam-asset-employee-handover.component.html',
styleUrl: './eam-asset-employee-handover.component.less',
})
export class EamAssetEmployeeHandoverComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]),
handoverDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]),
handoverUserId: this.fb.control(null, [FormValidators.required('请选择')]),
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
FormValidators.required('请选择'),
]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
content: this.fb.control(null, [FormValidators.required('请输入')]),
notes: this.fb.control(null, []),
urgency: this.fb.control(1, []),
assetIdList: this.fb.control([], []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.formGroup.patchValue({
...data.procVars,
handoverUserId: data.procVars?.handoverUserId ? [data.procVars?.handoverUserId] : [],
applyDepartmentId: data.procVars?.applyDepartmentId + '',
handoverDepartmentId: data.procVars?.handoverDepartmentId + '',
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
handoverUserId: Number(v.handoverUserId?.[0]),
applyDepartmentId: Number(v.applyDepartmentId?.[0]),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('attach')?.setValue(res.body.fileName)
})
}
}

83
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-repair/eam-asset-employee-repair.component.html

@ -1,83 +0,0 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-org-select formControlName="applyDepartmentId" />
</nz-form-control>
</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 placeholder="请输入申请人" formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">原因</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>图片</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input type="hidden" nz-input formControlName="img" />
<div class="mb-2" *ngIf="iconPreview">
<img [src]="iconPreview" class="h-20 w-20" />
</div>
<button class="upload-btn" nz-button [nzLoading]="uploadLoading">
<i nz-icon nzType="upload"></i>
上传图片
<input type="file" (change)="onFileChange($event)" accept=".jpg,.jpeg,.png" />
</button>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</div>

0
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-repair/eam-asset-employee-repair.component.less

109
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-repair/eam-asset-employee-repair.component.ts

@ -1,109 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../flow-result/flow-result.component'
@Component({
selector: 'app-eam-asset-employee-repair',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './eam-asset-employee-repair.component.html',
styleUrl: './eam-asset-employee-repair.component.less',
})
export class EamAssetEmployeeRepairComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
iconPreview = ''
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]),
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
FormValidators.required('请选择'),
]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
notes: this.fb.control(null, [FormValidators.required('请输入')]),
urgency: this.fb.control(1, []),
assetIdList: this.fb.control([], []),
img: this.fb.control(null, []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.iconPreview = data.procVars?.img
this.formGroup.patchValue({
...data.procVars,
applyDepartmentId: data.procVars?.applyDepartmentId + '',
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
applyDepartmentId: Number(v.applyDepartmentId?.[0]),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('img')?.setValue(res.body.fileName)
})
}
}

0
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-scrap/eam-asset-employee-scrap.component.less

110
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-scrap/eam-asset-employee-scrap.component.ts

@ -1,110 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../flow-result/flow-result.component'
@Component({
selector: 'app-eam-asset-employee-scrap',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './eam-asset-employee-scrap.component.html',
styleUrl: './eam-asset-employee-scrap.component.less',
})
export class EamAssetEmployeeScrapComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
iconPreview = ''
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
scrapType: this.fb.control(null, [FormValidators.required('请选择')]),
scrapTime: this.fb.control(null, [FormValidators.required('请选择')]),
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
FormValidators.required('请选择'),
]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
notes: this.fb.control(null, [FormValidators.required('请输入')]),
urgency: this.fb.control(1, []),
assetIdList: this.fb.control([], []),
attach: this.fb.control(null, []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.iconPreview = data.procVars?.img
this.formGroup.patchValue({
...data.procVars,
applyDepartmentId: data.procVars?.applyDepartmentId + '',
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
// applyDepartmentId: Number(v.applyDepartmentId?.[0]),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('attach')?.setValue(res.body.fileName)
})
}
}

108
web-admin-app/src/app/components/apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component.html

@ -1,108 +0,0 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>报修部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-org-select formControlName="repairDepartmentId" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>报修人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-select-user-by-org formControlName="repairer" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>维修类型</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="repairType">
<label nz-radio [nzValue]="1">自修</label>
<label nz-radio [nzValue]="2">外部维修</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>计划完成时间</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-date-picker
class="w-full"
nzPlaceHolder="请选择计划完成时间"
formControlName="planCompleteTime"
/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">报修内容</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入报修内容" formControlName="content"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>图片</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input type="hidden" nz-input formControlName="img" />
<div class="mb-2" *ngIf="iconPreview">
<img [src]="iconPreview" class="h-20 w-20" />
</div>
<button class="upload-btn" nz-button [nzLoading]="uploadLoading">
<i nz-icon nzType="upload"></i>
上传图片
<input type="file" (change)="onFileChange($event)" accept=".jpg,.jpeg,.png" />
</button>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</div>

0
web-admin-app/src/app/components/apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component.less

115
web-admin-app/src/app/components/apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component.ts

@ -1,115 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../flow-result/flow-result.component'
@Component({
selector: 'app-eam-asset-equipment-repair',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './eam-asset-equipment-repair.component.html',
styleUrl: './eam-asset-equipment-repair.component.less',
})
export class EamAssetEquipmentRepairComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
iconPreview = ''
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
repairDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]),
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
FormValidators.required('请选择'),
]),
urgency: this.fb.control(1, []),
assetIdList: this.fb.control([], []),
img: this.fb.control(null, []),
planCompleteTime: this.fb.control(null),
content: this.fb.control(null, [FormValidators.required('请输入')]),
repairer: this.fb.control(null, [FormValidators.required('请选择')]),
repairType: this.fb.control(1, [FormValidators.required('请选择')]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
notes: this.fb.control(null, []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.iconPreview = data.procVars?.img
this.formGroup.patchValue({
...data.procVars,
repairDepartmentId: data.procVars?.repairDepartmentId + '',
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
repairer: Number(v.repairer?.[0]),
applyDepartmentId: Number(v.applyDepartmentId?.[0]),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('img')?.setValue(res.body.fileName)
})
}
}

142
web-admin-app/src/app/components/apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component.html

@ -1,142 +0,0 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请部门</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-org-select formControlName="applyDepartmentId" />
</nz-form-control>
</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 placeholder="请输入申请人" formControlName="applicant" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</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 placeholder="请输入业务名称" formControlName="businessName" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>采购人</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-select-user-by-org formControlName="purchase" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>采购日期</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-date-picker
class="w-full"
nzPlaceHolder="请选择采购日期"
formControlName="purchaseTime"
/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>供应商</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-supplier-select formControlName="supplier" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>到货日期</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-date-picker
class="w-full"
nzPlaceHolder="请选择到货日期"
formControlName="arrivalTime"
/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">说明</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入说明" formControlName="desc"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>备注</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>附件</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<button class="upload-btn" nz-button [nzLoading]="uploadLoading">
<i nz-icon nzType="upload"></i>
选择文件
<input type="file" (change)="onFileChange($event)" />
</button>
@if (formGroup.get('attach')?.value) {
<div class="mt-1">
<nz-tag class="break-words w-full !whitespace-pre-wrap">
{{ formGroup.get('attach')?.value }}
</nz-tag>
</div>
}
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" [buy]="true" [storage]="true" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</div>

0
web-admin-app/src/app/components/apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component.less

117
web-admin-app/src/app/components/apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component.ts

@ -1,117 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../flow-result/flow-result.component'
@Component({
selector: 'app-eam-asset-purchase-apply',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './eam-asset-purchase-apply.component.html',
styleUrl: './eam-asset-purchase-apply.component.less',
})
export class EamAssetPurchaseApplyComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
iconPreview = ''
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
businessName: this.fb.control('', [FormValidators.required('请输入')]),
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
purchaseTime: this.fb.control(null, []),
purchase: this.fb.control(null, []),
arrivalTime: this.fb.control(null),
supplier: this.fb.control(null),
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
FormValidators.required('请选择'),
]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
desc: this.fb.control(null, [FormValidators.required('请输入')]),
notes: this.fb.control(null, []),
urgency: this.fb.control(1, []),
assetIdList: this.fb.control([], []),
attach: this.fb.control(null, []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.iconPreview = data.procVars?.img
this.formGroup.patchValue({
...data.procVars,
applyDepartmentId: data.procVars?.applyDepartmentId ? data.procVars?.applyDepartmentId + '' : null,
purchase: data.procVars?.purchase ? [data.procVars?.purchase + ''] : null,
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
purchase: Number(v.purchase?.[0]) ? Number(v.purchase?.[0]) : null,
applyDepartmentId: Number(v.applyDepartmentId?.[0]),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('attach')?.setValue(res.body.fileName)
})
}
}

60
web-admin-app/src/app/components/apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component.html

@ -1,60 +0,0 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>业务日期</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-date-picker class="w-full" formControlName="businessDate"></nz-date-picker>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">领用说明</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入领用说明" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</div>

0
web-admin-app/src/app/components/apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component.less

106
web-admin-app/src/app/components/apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component.ts

@ -1,106 +0,0 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { OrgSelectComponent } from '../../org-select/org-select.component'
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component'
import { PositionSelectComponent } from '../../position-select/position-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../flow-result/flow-result.component'
@Component({
selector: 'app-eam-asset-stock-goods-use',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './eam-asset-stock-goods-use.component.html',
styleUrl: './eam-asset-stock-goods-use.component.less',
})
export class EamAssetStockGoodsUseComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
ngOnInit(): void {
console.log('this.data', this.data)
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
businessDate: this.fb.control(null, [FormValidators.required('请选择')]),
// applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
// FormValidators.required('请选择'),
// ]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
notes: this.fb.control(null, [FormValidators.required('请输入')]),
urgency: this.fb.control(1, []),
assetIdList: this.fb.control([], []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.formGroup.patchValue({
...data.procVars,
applyDepartmentId: data.procVars?.applyDepartmentId + '',
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
applyDepartmentId: Number(v.applyDepartmentId?.[0]),
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('attach')?.setValue(res.body.fileName)
})
}
}

54
web-admin-app/src/app/components/apply-asset-flow/flow-result/flow-result.component.html

@ -1,30 +1,34 @@
<div>
<h2>流程记录</h2>
<div class="mt-4 p-3">
<nz-timeline>
@for (item of flowRecords; track $index) {
<nz-timeline-item [nzDot]="item.finishTime ? undefined : dotTemplate">
<div>
{{ item.createTime }}
</div>
<div>任务名称:{{ item.taskName }}</div>
<div>审批人:{{ item?.assigneeName ?? '-' }}</div>
<div>
审批意见:<span>
{{ item.comment?.comment ?? '-' }}
</span>
</div>
@if (item.finishTime) {
@if (flowRecords.length) {
<div class="mt-4 p-3">
<nz-timeline>
@for (item of flowRecords; track $index) {
<nz-timeline-item [nzDot]="item.finishTime ? undefined : dotTemplate">
<div>
<span> 流程完成时间:{{ item.finishTime }} </span>
<span> 用时:{{ item.duration }} </span>
{{ item.createTime }}
</div>
}
</nz-timeline-item>
}
</nz-timeline>
<ng-template #dotTemplate>
<span nz-icon nzType="clock-circle-o" style="font-size: 16px"></span>
</ng-template>
</div>
<div>任务名称:{{ item.taskName }}</div>
<div>审批人:{{ item?.assigneeName ?? '-' }}</div>
<div>
审批意见:<span>
{{ item.comment?.comment ?? '-' }}
</span>
</div>
@if (item.finishTime) {
<div>
<span> 流程完成时间:{{ item.finishTime }} </span>
<span> 用时:{{ item.duration }} </span>
</div>
}
</nz-timeline-item>
}
</nz-timeline>
<ng-template #dotTemplate>
<span nz-icon nzType="clock-circle-o" style="font-size: 16px"></span>
</ng-template>
</div>
} @else {
<nz-empty />
}
</div>

1
web-admin-app/src/app/components/apply-asset-flow/flow-result/flow-result.component.ts

@ -19,6 +19,7 @@ export class FlowResultComponent implements OnInit {
ngOnInit(): void {
if (this.flow) {
console.log('this.flow', this.flow)
this.api.getFlowRecord(this.flow.deployId, this.flow.procInsId).subscribe((res) => {
this.flowRecords = res.body.flowList
})

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

@ -26,14 +26,14 @@
</nz-form-control>
</nz-form-item>
</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> -->
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>调拨日期</nz-form-label>
@ -84,11 +84,14 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="ALLOCATE" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

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

@ -12,6 +12,7 @@ import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-allot-form',
@ -24,6 +25,7 @@ import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.c
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-allot-form.component.html',
styleUrl: './asset-business-allot-form.component.less',
@ -46,7 +48,7 @@ export class AssetBusinessAllotFormComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('调拨'), [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
// useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]),
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),

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

@ -26,14 +26,14 @@
</nz-form-control>
</nz-form-item>
</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> -->
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>借出日期</nz-form-label>
@ -93,11 +93,14 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select [type]="'BORROW'" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

4
web-admin-app/src/app/components/asset-business-borrow-form/asset-business-borrow-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 { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-return-form',
@ -22,6 +23,7 @@ import { AssetSelectComponent } from '../asset-select/asset-select.component'
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-borrow-form.component.html',
styleUrl: './asset-business-borrow-form.component.less',
@ -44,7 +46,7 @@ export class AssetBusinessBorrowFormComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('借用'), [FormValidators.required('请输入')]),
useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
// useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]),
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),

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

@ -26,14 +26,14 @@
</nz-form-control>
</nz-form-item>
</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> -->
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>领用日期</nz-form-label>
@ -100,11 +100,14 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="COLLECTION" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

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

@ -6,7 +6,7 @@ import { FormValidators, Utils } from 'app/utils'
import { NzMessageService } from 'ng-zorro-antd/message'
import { AssetCategorySelectComponent } from '../asset-category-select/asset-category-select.component'
import { OrgSelectComponent } from '../org-select/org-select.component'
import { ASSET_SOURCE_MAP, ASSET_STATUS, MAINTENANCE_STATUS, MAINTENANCE_TYPE } from 'app/constants'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_V2, MAINTENANCE_STATUS, MAINTENANCE_TYPE } from 'app/constants'
import { SelectUserByOrgComponent } from '../select-user-by-org/select-user-by-org.component'
import { ManufacturerSelectComponent } from '../manufacturer-select/manufacturer-select.component'
import { PositionSelectComponent } from '../position-select/position-select.component'
@ -15,6 +15,7 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-collection',
@ -26,6 +27,7 @@ import { AssetSelectComponent } from '../asset-select/asset-select.component'
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-collection.component.html',
styleUrl: './asset-business-collection.component.less',
@ -48,7 +50,7 @@ export class AssetBusinessCollectionComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('领用'), [FormValidators.required('请输入')]),
useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]),
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
@ -66,6 +68,8 @@ export class AssetBusinessCollectionComponent {
this.patchValues()
}
ASSET_STATUS_V2 = ASSET_STATUS_V2
patchValues() {
const { value: data, preview } = this.data
if (data) {

46
web-admin-app/src/app/components/apply-asset-flow/eam-asset-employee-scrap/eam-asset-employee-scrap.component.html → web-admin-app/src/app/components/asset-business-outbound-form/asset-business-outbound-form.component.html

@ -1,46 +1,44 @@
<div class="modal-lg-container">
<div class="modal">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>流程标题</nz-form-label>
<nz-form-label nzRequired>业务名称</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入流程标题" formControlName="title" />
<input nz-input placeholder="请输入业务名称" formControlName="name" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>报废方式</nz-form-label>
<nz-form-label>管理人员</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-select nzPlaceHolder="请选择报废方式" formControlName="scrapType">
<nz-option nzLabel="损坏" [nzValue]="1"></nz-option>
<nz-option nzLabel="过期" [nzValue]="2"></nz-option>
<nz-option nzLabel="丢失" [nzValue]="3"></nz-option>
</nz-select>
<app-select-user-by-org formControlName="manager" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>报废时间</nz-form-label>
<nz-form-label>使用人员</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-date-picker class="w-full" nzPlaceHolder="请选择报废时间" formControlName="scrapTime" />
<app-select-user-by-org formControlName="useUserId" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>申请人</nz-form-label>
<nz-form-label>业务日期</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入申请人" formControlName="applicant" />
<nz-date-picker class="w-full" formControlName="businessGeneratedDate" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-label>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
@ -49,15 +47,6 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">原因</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>附件</nz-form-label>
@ -77,15 +66,24 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="18">
<nz-form-item>
<nz-form-label>出库说明</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input placeholder="请输入出库说明" formControlName="notes"></textarea>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="OUTBOUND" formControlName="assetIdList" [storage]="true" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}

0
web-admin-app/src/app/components/apply-asset-flow/asset-employee-apply/asset-employee-apply.component.less → web-admin-app/src/app/components/asset-business-outbound-form/asset-business-outbound-form.component.less

122
web-admin-app/src/app/components/asset-business-outbound-form/asset-business-outbound-form.component.ts

@ -0,0 +1,122 @@
import { Component, Input, OnInit, inject } 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 { NzMessageService } from 'ng-zorro-antd/message'
import { AssetCategorySelectComponent } from '../asset-category-select/asset-category-select.component'
import { OrgSelectComponent } from '../org-select/org-select.component'
import { ASSET_SOURCE_MAP, ASSET_STATUS, MAINTENANCE_STATUS, MAINTENANCE_TYPE } from 'app/constants'
import { SelectUserByOrgComponent } from '../select-user-by-org/select-user-by-org.component'
import { ManufacturerSelectComponent } from '../manufacturer-select/manufacturer-select.component'
import { PositionSelectComponent } from '../position-select/position-select.component'
import { MaintenanceSelectComponent } from '../maintenance-select/maintenance-select.component'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-outbound-form',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-outbound-form.component.html',
styleUrl: './asset-business-outbound-form.component.less',
})
export class AssetBusinessOutboundFormComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
uploadLoading = false
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control(this.api.genFlowName('出库'), [FormValidators.required('请输入')]),
useUserId: this.fb.control(null, []),
manager: this.fb.control(null, []),
urgency: this.fb.control(1, []),
businessGeneratedDate: this.fb.control(null, []),
supplierVendorId: this.fb.control(null, []),
notes: this.fb.control(null, []),
assetIdList: this.fb.control([], []),
attach: this.fb.control('', []),
})
this.patchValues()
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
this.formGroup.patchValue({
...data,
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 + '',
// ownCompanyId: data._ownCompany?.organizationId + '',
// useOrganizationId: data._useOrganization?.organizationId + '',
maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId,
warehouseId: data._warehouse?.warehouseId,
// manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId,
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
useUserId: v.useUserId?.[0],
manager: v.manager?.[0],
categoryId: v.categoryId?.[0],
ownCompanyId: v.ownCompanyId?.[0],
positionId: v.positionId,
useOrganizationId: v.useOrganizationId?.[0],
responsiblePerson: v.responsiblePerson?.[0],
assetIdList: v.assetIdList,
}
}
return values
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('attach')?.setValue(res.body.fileName)
})
}
}

9
web-admin-app/src/app/components/asset-business-retirement/asset-business-retirement.component.html

@ -37,14 +37,14 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<!-- <div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>申请人</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">
<nz-form-item>
<nz-form-label>紧急程度</nz-form-label>
@ -87,11 +87,14 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="RETIREMENT" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

4
web-admin-app/src/app/components/asset-business-retirement/asset-business-retirement.component.ts

@ -15,6 +15,7 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-retirement',
@ -26,6 +27,7 @@ import { AssetSelectComponent } from '../asset-select/asset-select.component'
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-retirement.component.html',
styleUrl: './asset-business-retirement.component.less',
@ -48,7 +50,7 @@ export class AssetBusinessRetirementComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('报废'), [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
type: this.fb.control(null, []),
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),

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

@ -34,14 +34,14 @@
</nz-form-control>
</nz-form-item>
</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> -->
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>退库日期</nz-form-label>
@ -96,6 +96,19 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>领用流程</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-select-asset-flow
type="tuiku"
[defaultValue]="data.value?.foreignBody"
(onSelect)="onFlowSelect($event)"
formControlName="foreignKey"
/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>退库说明</nz-form-label>
@ -104,15 +117,24 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" [storage]="true" />
<app-asset-select
type="RETURN_INVENTORY"
countText="退库数量"
formControlName="assetIdList"
[storage]="true"
/>
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

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

@ -12,6 +12,8 @@ import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
import { SelectAssetFlowComponent } from '../select-asset-flow/select-asset-flow.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-return-form',
@ -24,6 +26,8 @@ import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.c
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
SelectAssetFlowComponent,
FlowResultComponent,
],
templateUrl: './asset-business-return-form.component.html',
styleUrl: './asset-business-return-form.component.less',
@ -46,7 +50,7 @@ export class AssetBusinessReturnFormComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('退库'), [FormValidators.required('请输入')]),
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]),
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
@ -58,6 +62,8 @@ export class AssetBusinessReturnFormComponent {
attach: this.fb.control('', []),
positionDetail: this.fb.control('', []),
foreignKey: this.fb.control('', []),
assetIdList: this.fb.control([], []),
applicant: this.fb.control({ value: '', disabled: true }, []),
@ -109,6 +115,18 @@ export class AssetBusinessReturnFormComponent {
return values
}
onFlowSelect(e: any) {
const flowed = e?.assetIdListLog ?? []
this.formGroup.get('assetIdList')?.setValue(
e.assetIdList.map((i: any) => {
return {
...i,
_count: i.count - (flowed.find((i2: any) => String(i2.assetId) === String(i.assetId))?.count ?? 0),
}
}),
)
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]

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

@ -18,14 +18,14 @@
</nz-form-control>
</nz-form-item>
</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> -->
<!-- <div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>归还后公司/部门</nz-form-label>
@ -50,7 +50,14 @@
</nz-form-control>
</nz-form-item>
</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">
<nz-form-item>
<nz-form-label>存放位置</nz-form-label>
@ -98,6 +105,19 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>借用流程</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-select-asset-flow
type="guihuan"
[defaultValue]="data.value?.foreignBody"
(onSelect)="onFlowSelect($event)"
formControlName="foreignKey"
/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>归还说明</nz-form-label>
@ -110,11 +130,19 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" [storage]="true" />
<app-asset-select
type="RETURN"
countText="归还数量"
formControlName="assetIdList"
[storage]="true"
/>
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

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

@ -11,6 +11,9 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { SelectAssetFlowComponent } from '../select-asset-flow/select-asset-flow.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-return-form',
@ -22,6 +25,9 @@ import { AssetSelectComponent } from '../asset-select/asset-select.component'
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
SelectAssetFlowComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-revert-form.component.html',
styleUrl: './asset-business-revert-form.component.less',
@ -44,12 +50,13 @@ export class AssetBusinessRevertFormComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('归还'), [FormValidators.required('请输入')]),
businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
// warehouseId: this.fb.control(null, [FormValidators.required('请选择')]),
manager: this.fb.control(null, []),
useUserId: this.fb.control(null, []),
// useOrganizationId: this.fb.control(null, []),
foreignKey: this.fb.control('', []),
notes: this.fb.control(null, []),
positionId: this.fb.control(null, []),
attach: this.fb.control('', []),
@ -76,7 +83,7 @@ export class AssetBusinessRevertFormComponent {
ownCompanyId: data._ownCompany?.organizationId + '',
useOrganizationId: data._useOrganization?.organizationId + '',
maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId,
warehouseId: data._warehouse?.warehouseId,
// warehouseId: data._warehouse?.warehouseId,
manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId,
applicant: data._applicant?.userName,
})
@ -104,7 +111,17 @@ export class AssetBusinessRevertFormComponent {
}
return values
}
onFlowSelect(e: any) {
const flowed = e?.assetIdListLog ?? []
this.formGroup.get('assetIdList')?.setValue(
e.assetIdList.map((i: any) => {
return {
...i,
_count: i.count - (flowed.find((i2: any) => String(i2.assetId) === String(i.assetId))?.count ?? 0),
}
}),
)
}
onFileChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]

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

@ -84,11 +84,15 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" [storage]="true" />
<app-asset-select type="STORAGE" formControlName="assetIdList" [storage]="true" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

4
web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.less

@ -1,4 +0,0 @@
.modal {
height: 70vh;
overflow-y: auto;
}

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

@ -16,6 +16,7 @@ import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-storage',
@ -26,6 +27,7 @@ import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.c
SupplierSelectComponent,
AssetSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-storage-form.component.html',
styleUrl: './asset-business-storage-form.component.less',
@ -48,7 +50,7 @@ export class AssetBusinessStorageFormComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('入库'), [FormValidators.required('请输入')]),
warehouseId: this.fb.control('', [FormValidators.required('请输入')]),
manager: this.fb.control(null, []),
urgency: this.fb.control(1, []),

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

@ -42,14 +42,14 @@
</nz-form-control>
</nz-form-item>
</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> -->
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label>存放位置</nz-form-label>
@ -108,11 +108,14 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="TRANSFER" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
</div>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
</div>
</form>

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

@ -12,6 +12,7 @@ import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component'
import { AssetSelectComponent } from '../asset-select/asset-select.component'
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component'
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-asset-business-transfer-form',
@ -24,6 +25,7 @@ import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.c
OrgSelectComponent,
PositionSelectComponent,
WarehouseSelectComponent,
FlowResultComponent,
],
templateUrl: './asset-business-transfer-form.component.html',
styleUrl: './asset-business-transfer-form.component.less',
@ -46,7 +48,7 @@ export class AssetBusinessTransferFormComponent {
ngOnInit(): void {
this.formGroup = this.fb.group({
id: this.fb.control(null, []),
name: this.fb.control('', [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('转移'), [FormValidators.required('请输入')]),
useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
// useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]),
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),

5
web-admin-app/src/app/components/asset-form/asset-form.component.html

@ -469,14 +469,14 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<!-- <div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>客户信息</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="customerInfo" placeHolder="请输入客户信息" />
</nz-form-control>
</nz-form-item>
</div>
</div> -->
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>未税成本</nz-form-label>
@ -524,6 +524,7 @@
<nz-input-number
class="!w-full"
[nzMin]="0"
[nzDisabled]="true"
formControlName="residualsRate"
nzPlaceHolder="请输入残值率"
/>

6
web-admin-app/src/app/components/asset-select/asset-select.component.html

@ -119,8 +119,9 @@
<th>资产编号</th>
<th>资产状态</th>
<th>资产名称</th>
<th>{{ buy ? '采购' : '库存' }}数量</th>
<th>{{ countText ? countText : '数量' }}</th>
<th>规格型号</th>
<th>仓库</th>
<th>资产序列号</th>
</tr>
</thead>
@ -143,13 +144,14 @@
<td>
<nz-input-number
[nzMin]="0"
[nzMax]="storage ? undefined : data.max"
[nzMax]="data._max ? data._max : storage ? undefined : data.max"
[nzDisabled]="disabled"
[(ngModel)]="data.count"
(ngModelChange)="onCountChange()"
/>
</td>
<td>{{ data.model }}</td>
<td>{{ data.warehouseName }}</td>
<td>{{ data.serialNumber }}</td>
</tr>
</tbody>

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

@ -53,10 +53,14 @@ export class AssetSelectComponent {
@Input() storage: boolean = false
@Input() type: string = ''
@Input() buy: boolean = false
@Output() onSelected = new EventEmitter<NzSafeAny>()
@Input() countText: string = ''
allGetedDataMap = new Map<number, NzSafeAny>()
originData: NzSafeAny[] = []
@ -109,11 +113,15 @@ export class AssetSelectComponent {
{ key: 'status', title: '资产状态', visible: true },
{ key: 'count', title: '库存数量', visible: true },
{ key: 'warehouseName', title: '仓库', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
const fn = this.storage ? 'getAeamBusinessStorageList' : 'getAssetStroagePage'
let fn: keyof ApiService = this.storage ? 'getAeamBusinessStorageList' : 'getAssetStroagePage'
if (['BORROW', 'COLLECTION', 'RETURN', 'TRANSFER', 'RETIREMENT', 'repair', 'task'].includes(this.type)) {
fn = 'getAssetDevicePage'
}
return this.api[fn]({ ...p, ...q }).pipe(
map((res) => {
res.body.rows.forEach((item: NzSafeAny) => {
@ -123,6 +131,16 @@ export class AssetSelectComponent {
return res
}),
)
// const fn = this.storage ? 'getAeamBusinessStorageList' : 'getAssetStroagePage'
// return this.api[fn]({ ...p, ...q }).pipe(
// map((res) => {
// res.body.rows.forEach((item: NzSafeAny) => {
// item['key'] = item.assetId + '_' + item.warehouseId
// this.allGetedDataMap.set(item.key, item)
// })
// return res
// }),
// )
}
onTrigger(nzContent: TemplateRef<{}>) {
@ -196,11 +214,18 @@ export class AssetSelectComponent {
vals = JSON.parse(v) ?? []
} catch (error) {}
}
console.log('vals', vals)
if (Array.isArray(vals) && vals.length > 0) {
// const ids = vals.map((i: NzSafeAny) => i.assetId)
this.api.getAssetStorageListByIds(vals).subscribe((res) => {
this.selectedDataList = res.body.rows.map((item: NzSafeAny) => {
item['key'] = item.assetId + '_' + item.warehouseId
const v = vals.find((f: any) => f.assetId === item.assetId)
if (v?._count) {
item['_max'] = v._count
item['count'] = v._count
}
console.log('v', v, item)
this.allGetedDataMap.set(item.assetId, item)
return item
})

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

@ -9,7 +9,7 @@
</ng-template>
</div>
@if (createable) {
<button nz-button nzType="primary" (click)="onCreate(0)">添加</button>
<button nz-button nzType="primary" [disabled]="selectedKeys.length === 0" (click)="onCreate()">添加</button>
}
</div>
<div class="py-4">
@ -25,7 +25,7 @@
[nzTreeTemplate]="nzTreeTemplate"
>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="custom-node flex items-center overflow-hidden">
<div class="custom-node py-1 flex items-center overflow-hidden">
<div class="flex-1">
@switch (origin.organizationType) {
@case ('0') {
@ -40,24 +40,18 @@
}
<span class="ml-2 overflow-hidden text-ellipsis">{{ node.title }}</span>
</div>
@if (createable) {
<button
nz-button
nz-dropdown
[nzDropdownMenu]="menu"
nzType="text"
onclick="event.stopPropagation()"
>
<span nz-icon nzType="more"></span>
@if (createable && node.level !== 0) {
<button nz-button nzType="text" (click)="onDelete($event, origin.categoryId)">
<span nz-icon nzType="delete"></span>
</button>
<nz-dropdown-menu #menu="nzDropdownMenu">
<!-- <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu>
<li nz-menu-item (click)="onCreate(origin.parentId)">添加同级分类</li>
<li nz-menu-item (click)="onCreate(origin.categoryId)">添加下级分类</li>
<li nz-menu-divider></li>
<li nz-menu-item (click)="onDelete(origin.categoryId)">删除</li>
</ul>
</nz-dropdown-menu>
</nz-dropdown-menu> -->
}
</div>
</ng-template>

9
web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.ts

@ -134,7 +134,11 @@ export class ComponentBasicCategoryTreeComponent {
console.log('e', e)
}
onCreate(parentId: number) {
onCreate() {
if (this.selectedKeys.length === 0) {
return
}
const parentId = this.selectedKeys[0]
this.api
.addBasicCategoryTree({
depth: '',
@ -151,7 +155,8 @@ export class ComponentBasicCategoryTreeComponent {
})
}
onDelete(id: number) {
onDelete(e: Event, id: number) {
e.stopPropagation()
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否要删除该分类?',

3
web-admin-app/src/app/components/component-org-tree/component-org-tree.component.html

@ -9,7 +9,7 @@
</ng-template>
</div>
@if (createable) {
<button nz-button class="pl-2" nzType="primary" nz-dropdown [nzDropdownMenu]="createMenu">添加</button>
<button nz-button class="ml-2" nzType="primary" nz-dropdown [nzDropdownMenu]="createMenu">添加</button>
<nz-dropdown-menu #createMenu="nzDropdownMenu">
<ul nz-menu>
<li nz-menu-item (click)="onCreate(true, orgFormTpl, confirmTpl)">添加组织</li>
@ -26,6 +26,7 @@
[nzExpandedKeys]="expandedKeys"
[nzSearchValue]="searchValue"
(nzClick)="nzEvent($event)"
[nzSelectedKeys]="selectedKeys"
(nzExpandChange)="onExpandChange($event)"
[nzTreeTemplate]="nzTreeTemplate"
>

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

@ -33,6 +33,8 @@ export class ComponentOrgTreeComponent implements OnInit {
@Input() selectUer = false
@Input() autoSelect = false
@Output() onOrgSelectedChange = new EventEmitter<NzSafeAny>()
drawerRef?: NzDrawerRef
@ -49,6 +51,8 @@ export class ComponentOrgTreeComponent implements OnInit {
expandedKeys: string[] = []
selectedKeys: string[] = []
form!: FormGroup
initForm() {
@ -85,6 +89,10 @@ export class ComponentOrgTreeComponent implements OnInit {
? [{ title: '全部', key: 'all' }, ...Utils.buildTree(c, 'organizationId', 'organizationName')]
: [...Utils.buildTree(c, 'organizationId', 'organizationName')]
this.expandedKeys = [...this.expandedKeys]
if (this.autoSelect) {
this.selectedKeys = [String(this.nodes[0]?.key)]
this.onOrgSelectedChange.emit(this.nodes[0])
}
})
}
@ -96,7 +104,12 @@ export class ComponentOrgTreeComponent implements OnInit {
nzEvent(event: NzFormatEmitEvent): void {
if (event.eventName === 'click') {
const { node } = event
this.onOrgSelectedChange.emit(event.keys?.length === 0 ? null : node?.origin)
if (event.keys && event.keys?.length > 0) {
this.selectedKeys = event.keys
this.onOrgSelectedChange.emit(event.keys?.length === 0 ? null : node?.origin)
} else {
this.selectedKeys = [...this.selectedKeys]
}
}
}

18
web-admin-app/src/app/components/flow-form-v2/flow-form-v2.component.html

@ -48,14 +48,16 @@
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>自动指派</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-switch formControlName="autoAssign" />
</nz-form-control>
</nz-form-item>
</div>
@if (!data.type?.includes('资管')) {
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>自动指派</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-switch formControlName="autoAssign" />
</nz-form-control>
</nz-form-item>
</div>
}
<div nz-col [nzSpan]="24">
<nz-form-item>

10
web-admin-app/src/app/components/flow-form-v2/flow-form-v2.component.ts

@ -52,7 +52,7 @@ export class FlowFormV2Component {
this.formGroup = this.fb.group({
status: this.fb.control(null, [FormValidators.required('请选择')]),
autoAssign: this.fb.control(null, [FormValidators.required('请输入')]),
autoAssign: this.fb.control(false, [FormValidators.required('请输入')]),
remark: this.fb.control(null, []),
name: this.fb.control({ value: null, disabled: true }, [FormValidators.required('请输入')]),
formKey: this.fb.control({ value: null, disabled: true }, [FormValidators.required('请输入')]),
@ -74,7 +74,7 @@ export class FlowFormV2Component {
addNode() {
this.nodes.push(
this.fb.group({
id: this.fb.control(null, [FormValidators.required('请输入')]),
id: this.fb.control('id_' + (this.nodes.length + 1), [FormValidators.required('请输入')]),
isDefault: this.fb.control(false),
name: this.fb.control(null, [FormValidators.required('请输入')]),
remark: this.fb.control(null),
@ -90,9 +90,9 @@ export class FlowFormV2Component {
this.nodes.clear()
nodes.forEach((node: NzSafeAny) => {
const fg = this.fb.group({
id: this.fb.control(node.id),
id: this.fb.control({ value: node.id, disabled: node.isDefault }),
isDefault: this.fb.control(node.isDefault),
name: this.fb.control(node.name),
name: this.fb.control({ value: node.name, disabled: node.isDefault }),
remark: this.fb.control(node.remark),
roleIds: this.fb.control(node.roleIds),
userIds: this.fb.control(node.userIds),
@ -120,7 +120,7 @@ export class FlowFormV2Component {
// this.msg.error('请完善节点信息')
// return
// }
const v = this.formGroup.value
const v = this.formGroup.getRawValue()
values = {
...v,
nodes: v.nodes.map((i: NzSafeAny) => {

18
web-admin-app/src/app/components/flow-list-by-type/flow-list-by-type.component.html

@ -10,13 +10,25 @@
@case ('_assignee') {
<nz-tag> {{ data.userName }} </nz-tag>
}
@case ('assigneeNameArr') {
<a [nz-popover]="'审批人'" [nzPopoverContent]="nzPopoverContent">
{{ data[0] }}<span *ngIf="data.length > 1">...</span>
</a>
<ng-template #nzPopoverContent>
@for (item of data; track $index) {
<nz-tag> {{ item }} </nz-tag>
}
</ng-template>
}
@case ('procVars') {
{{ data?.title ?? data?.name ?? '-' }}
}
@case ('status') {
<nz-tag nzColor="blue">
<!-- <nz-tag nzColor="blue">
{{ FLOW_STATUS.get(data) }}
</nz-tag>
</nz-tag> -->
<app-flow-status-tag [status]="data"></app-flow-status-tag>
}
@case ('urgency') {
<nz-tag [nzColor]="row.procVars.urgency === 2 ? 'error' : ''">
@ -47,7 +59,7 @@
<nz-form-item>
<nz-form-label nzRequired> 任务处置人员 </nz-form-label>
<nz-form-control>
<nz-cascader [nzOptions]="teamList" [(ngModel)]="assignee" />
<nz-cascader [nzOptions]="teamListAfterFilter" [(ngModel)]="assignee" />
</nz-form-control>
</nz-form-item>
</div>

8
web-admin-app/src/app/components/flow-list-by-type/flow-list-by-type.component.less

@ -0,0 +1,8 @@
::ng-deep .modal-for-btn {
.ant-modal-footer .ant-btn[ng-reflect-nz-type="reject"] {
background-color: #f59a23 !important;
border-color: #f59a23 !important;
color: #fff !important;
}
}

270
web-admin-app/src/app/components/flow-list-by-type/flow-list-by-type.component.ts

@ -10,16 +10,16 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { FormValidators, Utils } from 'app/utils'
import { AssetEmployeeApplyComponent } from 'app/components'
import { FLOW_STATUS, flowIntStatus, flowIntStatusToStr } from 'app/constants'
import { comsMap } from 'app/pages/flow/flow-main/flow-main.component'
import { TaskFormComponent } from '../plan-task/task-form/task-form.component'
import { HandleTaskComponent } from '../plan-task/handle-task/handle-task.component'
import { FlowStatusTagComponent } from '../flow-status-tag/flow-status-tag.component'
@Component({
selector: 'app-flow-list-by-type',
standalone: true,
imports: [SharedModule],
imports: [SharedModule, FlowStatusTagComponent],
templateUrl: './flow-list-by-type.component.html',
styleUrl: './flow-list-by-type.component.less',
})
@ -57,27 +57,50 @@ export class FlowListByTypeComponent {
FLOW_STATUS = flowIntStatus
ngOnInit(): void {
let cols = [
{ key: 'procVars', title: '名称', width: '300px', visible: true },
{ key: 'status', title: '流程状态', visible: true, width: '100px' },
{ key: 'urgency', title: '紧急程度', visible: true, width: '100px' },
{ key: 'procDefName', title: '流程类型', visible: true, width: '120px' },
{ key: 'assigneeNameArr', title: '当前审批人', visible: true },
{ key: 'startUserName', title: '发起人', visible: true },
{ key: 'createTime', title: '提交时间', visible: true },
{ key: 'finishTime', title: '完成时间', visible: true },
// { key: 'createTime', title: '作废时间', visible: true },
// { key: 'createTime', title: '完成时间', visible: true },
]
cols = cols.filter((f) => f.key !== (this.page === 'apply' ? 'startUserName' : 'assigneeNameArr'))
cols = cols.map((f) => {
if (this.page === 'todo' && f.key === 'finishTime') {
return { ...f, visible: false }
}
if (this.page === 'finished' && f.key === 'createTime') {
return { ...f, visible: false }
}
return f
})
this.table
.setConfig({
cacheKey: this.page + '_' + this.type,
})
.setColumn([
{ key: 'procVars', title: '名称', visible: true },
{ key: 'status', title: '流程状态', visible: true },
{ key: 'urgency', title: '紧急程度', visible: true },
{ key: 'procDefName', title: '流程类型', visible: true },
{ key: 'assigneeName', title: '审批人', visible: true },
{ key: 'createTime', title: '提交时间', visible: true },
// { key: 'createTime', title: '作废时间', visible: true },
// { key: 'createTime', title: '完成时间', visible: true },
])
.setColumn(cols)
.setRowOperate([
{ title: '查看', onClick: this.onDetail.bind(this) },
{
title: '审批',
visible: (v) => {
return this.page === 'todo' && this.type === 'asset'
},
onClick: (v) => {
this.onDetail(v, true, true)
},
},
{
title: '撤回',
onClick: this.cancleFlow.bind(this),
visible: (v) => {
return this.page === 'apply' && [2, 9].includes(v.status)
return this.page === 'apply' && [2, 7, 9].includes(v.status)
},
},
{
@ -89,6 +112,33 @@ export class FlowListByTypeComponent {
return this.page === 'apply' && [1, 4, 5].includes(v.status)
},
},
{
title: '发起审批',
onClick: (v) => {
this.onReShenpi(v)
},
visible: (v) => {
return this.page === 'apply' && [1].includes(v.status)
},
},
// {
// title: '通过',
// onClick: (v) => {
// this.completeFlow(v)
// },
// visible: (v) => {
// return this.page === 'todo' && this.type === 'asset'
// },
// },
// {
// title: '驳回',
// onClick: (v) => {
// this.rejectProcessFlow(v)
// },
// visible: (v) => {
// return this.page === 'todo' && this.type === 'asset'
// },
// },
{
title: '删除',
onClick: (v) => {
@ -103,7 +153,9 @@ export class FlowListByTypeComponent {
title: '受理',
onClick: this.shouli.bind(this),
visible: (v) => {
return this.page === 'todo' && this.type === 'device' && v.status === 'TO_BE_ASSIGNED'
return (
this.page === 'todo' && this.type === 'device' && ['TO_BE_ASSIGNED', 7].includes(v.status)
)
},
},
{
@ -121,6 +173,20 @@ export class FlowListByTypeComponent {
return this.page === 'todo' && this.type === 'device' && v.status === 9
},
},
// {
// title: '挂起',
// onClick: this.onGuaQi.bind(this),
// visible: (v) => {
// return this.page === 'todo' && this.type === 'device' && v.status === 9
// },
// },
// {
// title: '激活',
// onClick: this.onGuaQi.bind(this),
// visible: (v) => {
// return this.page === 'todo' && this.type === 'device' && v.status === 8
// },
// },
{
title: '审批',
onClick: this.onHandle.bind(this, false),
@ -132,7 +198,7 @@ export class FlowListByTypeComponent {
title: '报表',
onClick: this.onReport.bind(this),
visible: (v) => {
return this.page === 'todo' && this.type === 'device' && v.status === 3
return v.status === 3
},
},
])
@ -161,16 +227,22 @@ export class FlowListByTypeComponent {
}
zhipai(item?: NzSafeAny) {
// console.log('item', item)
this.teamListAfterFilter = this.teamList.filter((f) => String(f.teamId) === String(item.procVars?.teamId))
this.modal.create({
nzTitle: '任务指派',
nzContent: this.zhipaiTpl,
nzOnOk: async () => {
if (!this.assignee) {
if (!this.assignee || this.assignee.length !== 2) {
this.msg.error('请选择处理人')
return false
}
const res = await lastValueFrom(
this.api.assignTask({ instanceId: item.procInsId, taskId: item.taskId, assignee: this.assignee }),
this.api.assignTask({
instanceId: item.procInsId,
taskId: item.taskId,
assignee: this.assignee[1],
}),
)
this.msg.success(res.desc)
this.table.ref.reload()
@ -193,9 +265,22 @@ export class FlowListByTypeComponent {
modalRef?: NzModalRef
assignee?: string
assignee: number[] = []
shenhe = false
onGuaQi(d: NzSafeAny) {
const text = d.status === 8 ? '激活' : '挂起'
this.modal.confirm({
nzTitle: '警告',
nzContent: `是否要${text}当前流程?`,
nzOnOk: async () => {
const res = await lastValueFrom(this.api.updateFlowInstanceState(d.status === 8 ? 1 : 2, d.procInsId))
this.msg.success(res.desc)
this.table.ref.reload()
},
})
}
onHandle(chuzhi: boolean, d: NzSafeAny) {
// console.log('chuzhi', chuzhi, data)
let nzTitle = chuzhi ? '处置任务' : '任务审批'
@ -216,8 +301,8 @@ export class FlowListByTypeComponent {
...data,
...vals,
},
taskId: data.taskId,
instanceId: data.procInsId,
taskId: d.taskId,
instanceId: d.procInsId,
}),
)
this.msg.success(res.desc)
@ -232,7 +317,7 @@ export class FlowListByTypeComponent {
onClick: async (e: HandleTaskComponent) => {
const vals = e.getValues()
if (vals) {
console.log('data', data, d)
// console.log('data', data, d)
const res = await lastValueFrom(
this.api.handleTaskAssetItem(
{
@ -258,7 +343,7 @@ export class FlowListByTypeComponent {
onClick: async (e: HandleTaskComponent) => {
this.shenhe = false
this.onShenpi(data)
this.onShenpi(d)
},
},
{
@ -266,7 +351,7 @@ export class FlowListByTypeComponent {
type: 'primary',
onClick: async (e: HandleTaskComponent) => {
this.shenhe = true
this.onShenpi(data)
this.onShenpi(d)
},
},
]
@ -298,11 +383,17 @@ export class FlowListByTypeComponent {
@ViewChild('shenheTpl') shenheTpl!: TemplateRef<NzSafeAny>
teamList: NzSafeAny[] = []
teamListAfterFilter: NzSafeAny[] = []
onShenpi(item: NzSafeAny) {
const nzTitle = this.shenhe ? '请填写审批意见' : '请填写驳回意见'
// console.log('item', item)
this.modal.create({
nzTitle,
nzContent: this.shenheTpl,
nzOnCancel: () => {
this.comment = ''
},
nzOnOk: async () => {
if (!this.comment) {
this.msg.error(nzTitle)
@ -313,7 +404,7 @@ export class FlowListByTypeComponent {
this.api.completeProcessFlow({
instanceId: item.procInsId,
taskId: item.taskId,
assignee: this.assignee,
comment: this.comment,
}),
)
@ -323,13 +414,13 @@ export class FlowListByTypeComponent {
this.api.rejectProcessFlow({
instanceId: item.procInsId,
taskId: item.taskId,
assignee: this.assignee,
comment: this.comment,
}),
)
this.msg.success(res.desc)
}
this.comment = ''
this.table.ref.reload()
this.modalRef?.close()
return true
@ -338,7 +429,8 @@ export class FlowListByTypeComponent {
}
onReport(i: NzSafeAny) {
this.msg.loading('下载中...')
this.api.downloadTaskReport(i.id).subscribe((res) => {
this.api.downloadTaskReport(i.procInsId).subscribe((res) => {
Utils.downLoadFile(
res,
'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=utf-8',
@ -354,49 +446,119 @@ export class FlowListByTypeComponent {
tap((res) => {
this.onLoad.emit(res.body.total)
}),
map((res) => {
res.body.records = res.body.records.map((i: any) => {
i.assigneeNameArr = this.parseStringToArray(i.assigneeName)
// console.log('i.assigneeNameArr', i.assigneeNameArr)
return i
})
return res
}),
)
} else if (this.page === 'finished') {
return this.api.getMyFinishedAssetFlow({ ...p, ...q, type: this.type }).pipe(
tap((res) => {
this.onLoad.emit(res.body.total)
}),
map((res) => {
res.body.records = res.body.records.map((i: any) => {
i.assigneeNameArr = this.parseStringToArray(i.assigneeName)
return i
})
return res
}),
)
} else {
return this.api.getMyTodoAssetFlow({ ...p, ...q, type: this.type }).pipe(
tap((res) => {
this.onLoad.emit(res.body.total)
}),
map((res) => {
res.body.records = res.body.records.map((i: any) => {
i.assigneeNameArr = this.parseStringToArray(i.assigneeName)
return i
})
return res
}),
)
}
}
parseStringToArray(s: string) {
if (!s) {
return []
}
if (s.startsWith('[') && s.endsWith(']')) {
// 去掉首尾的 '[' 和 ']'
s = s.slice(1, -1)
// 将字符串中的元素用引号包围
return s.split(', ')
} else {
// 如果不是以 '[' 开头和 ']' 结尾,直接返回包含该字符串的数组
return [s]
}
}
onDelete(model: NzSafeAny) {
this.modal.confirm({
nzTitle: '删除',
nzContent: '是否要删除该申请?',
nzOnOk: async () => {
const res = await lastValueFrom(
this.api.deleteAssetFlow({
instanceId: model.procInsId,
taskId: model.taskId,
const res = await lastValueFrom(this.api.deleteAssetFlow(model.procInsId))
this.msg.success('删除成功')
this.table.ref.reload()
},
})
}
onReShenpi(v: any) {
this.modal.confirm({
nzTitle: '警告',
nzContent: '是否要重新发起审批?',
nzOnOk: async () => {
const res2 = await lastValueFrom(
this.api.completeProcessFlow({
variables: v,
taskId: v.taskId,
instanceId: v.procInsId,
}),
)
this.msg.success('删除成功')
this.msg.success(res2.desc)
this.table.ref.reload()
},
})
}
onDetail(model: NzSafeAny, preview = true) {
onDetail(model: NzSafeAny, preview = true, shenpi = false) {
const editFooter: any = [
{
label: '保存',
type: 'primary',
onClick: async (e: any) => {
const vals = e.getValues()
if (vals) {
// const res = await lastValueFrom(this.api.startFlow(vals, model.procDefKey))
const res1 = await lastValueFrom(this.api.handleTaskAssetItem(vals, model.taskId))
this.msg.success(res1.desc)
this.table.ref.reload()
this.detailRef?.close()
}
},
},
{
label: '取消',
onClick: () => {
this.detailRef?.close()
},
},
]
if (this.type === 'asset') {
// console.log('model', model, comsMap[model.category])
let footer: any = null
if (this.page === 'apply') {
if (!preview) {
footer = void 0
} else {
}
}
if (this.page === 'todo') {
if (this.page === 'todo' && shenpi) {
footer = [
{
label: '通过',
@ -414,7 +576,12 @@ export class FlowListByTypeComponent {
},
},
]
} else {
if (!preview) {
footer = editFooter
}
}
this.detailRef = this.modal.create({
nzTitle: preview ? '查看' : '编辑',
nzContent: comsMap[model.category ?? model.procDefKey],
@ -423,7 +590,11 @@ export class FlowListByTypeComponent {
// nzFooter: preview ? null : void 0,
nzFooter: footer,
nzData: {
value: model,
value: {
...model.procVars,
deployId: model.deployId,
procInsId: model.procInsId,
},
preview,
},
nzOnOk: async (e: NzSafeAny) => {
@ -431,7 +602,7 @@ export class FlowListByTypeComponent {
if (vals) {
const res = await lastValueFrom(this.api.startFlow(vals, model.procDefKey))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
@ -441,22 +612,23 @@ export class FlowListByTypeComponent {
let assetIdList = []
try {
assetIdList = JSON.parse(model?.procVars?.defects)
assetIdList = model?.procVars?.assetIdList ?? []
} catch (error) {}
this.modal.create({
nzTitle: '查看',
this.detailRef = this.modal.create({
nzTitle: preview ? '查看' : '编辑',
nzContent: TaskFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: {
...model,
...model.procVars,
assetIdList,
},
preview: true,
preview,
type: model.procVars.jobType,
},
nzFooter: null,
nzFooter: preview ? null : editFooter,
})
}
}
@ -488,6 +660,9 @@ export class FlowListByTypeComponent {
this.modal.create({
nzTitle: '驳回',
nzContent: this.commentTpl,
nzOnCancel: () => {
this.comment = ''
},
nzOnOk: async () => {
if (!this.comment) {
this.msg.error('请输入驳回意见')
@ -504,6 +679,7 @@ export class FlowListByTypeComponent {
this.msg.success('驳回成功')
this.table.ref.reload()
this.detailRef?.close()
this.comment = ''
return true
},
})

62
web-admin-app/src/app/components/flow-status-tag/flow-status-tag.component.html

@ -0,0 +1,62 @@
@switch (status) {
@case ('APPROVAL') {
<nz-tag nzColor="blue" data-color="text-blue-500">待审批</nz-tag>
}
@case (2) {
<nz-tag nzColor="blue" data-color="text-blue-500">待审批</nz-tag>
}
@case ('TO_BE_ASSIGNED') {
<nz-tag nzColor="blue" data-color="text-yellow-500">待指派</nz-tag>
}
@case (7) {
<nz-tag nzColor="blue" data-color="text-yellow-500">待指派</nz-tag>
}
@case ('DISPOSE') {
<nz-tag nzColor="blue" data-color="text-blue-500">待处置</nz-tag>
}
@case (9) {
<nz-tag nzColor="blue" data-color="text-blue-500">待处置</nz-tag>
}
@case ('COMPLETED') {
<nz-tag nzColor="green" data-color="text-green-500">已完结</nz-tag>
}
@case (3) {
<nz-tag nzColor="green" data-color="text-green-500">已完结</nz-tag>
}
@case ('EXCEPTION') {
<nz-tag nzColor="red" data-color="text-red-500">异常</nz-tag>
}
@case (6) {
<nz-tag nzColor="red" data-color="text-red-500">异常</nz-tag>
}
@case ('SUSPENDED') {
<nz-tag nzColor="red" data-color="text-yellow-500">已挂起</nz-tag>
}
@case (8) {
<nz-tag nzColor="red" data-color="text-yellow-500">已挂起</nz-tag>
}
@case ('DISCARDED') {
<nz-tag class="dark" data-color="text-gray-500">废弃</nz-tag>
}
@case (5) {
<nz-tag class="dark" data-color="text-gray-500">废弃</nz-tag>
}
@case ('DRAFTING') {
<nz-tag class="dark" data-color="text-yellow-500">草稿</nz-tag>
}
@case (1) {
<nz-tag class="dark" data-color="text-yellow-500">草稿</nz-tag>
}
@case ('REJECTED') {
<nz-tag class="dark" data-color="text-red-500">被驳回</nz-tag>
}
@case (4) {
<nz-tag class="dark" data-color="text-red-500">被驳回</nz-tag>
}
@default {
{{ status }}
}
}

5
web-admin-app/src/app/components/flow-status-tag/flow-status-tag.component.less

@ -0,0 +1,5 @@
.dark {
background-color: transparent !important;
color: #333;
border-color: #333;
}

17
web-admin-app/src/app/components/flow-status-tag/flow-status-tag.component.ts

@ -0,0 +1,17 @@
import { Component, Input } from '@angular/core'
import { SharedModule } from 'app/shared/shared.module'
@Component({
selector: 'app-flow-status-tag',
standalone: true,
imports: [SharedModule],
templateUrl: './flow-status-tag.component.html',
styleUrl: './flow-status-tag.component.less',
})
export class FlowStatusTagComponent {
constructor() {}
@Input() status!: string | number
ngOnInit() {}
}

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

@ -30,14 +30,10 @@ export * from './repair-fault-form/repair-fault-form.component'
export * from './position-tree/position-tree.component'
export * from './stocktaking-detail-form/stocktaking-detail-form.component'
export * from './apply-asset-flow/asset-employee-apply/asset-employee-apply.component'
export * from './apply-asset-flow/asset-employee-loss/asset-employee-loss.component'
export * from './apply-asset-flow/eam-asset-employee-repair/eam-asset-employee-repair.component'
export * from './apply-asset-flow/eam-asset-employee-scrap/eam-asset-employee-scrap.component'
export * from './apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component'
export * from './apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component'
export * from './apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component'
export * from './apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component'
// export * from './apply-asset-flow/eam-asset-purchase-apply/eam-asset-purchase-apply.component'
// export * from './apply-asset-flow/eam-asset-employee-handover/eam-asset-employee-handover.component'
// export * from './apply-asset-flow/eam-asset-equipment-repair/eam-asset-equipment-repair.component'
// export * from './apply-asset-flow/eam-asset-stock-goods-use/eam-asset-stock-goods-use.component'
export * from './status-tag/status-tag.component'
export * from './flow-form-create/flow-form-create.component'

4
web-admin-app/src/app/components/maintain-record-form/maintain-record-form.component.html

@ -32,7 +32,7 @@
</div>
<div nz-col [nzSpan]="6">
<nz-form-item>
<nz-form-label nzRequired>计划完成时间</nz-form-label>
<nz-form-label nzRequired>维修完成时间</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-date-picker class="w-full" formControlName="plannedDate" />
</nz-form-control>
@ -70,7 +70,7 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="maintain" countText="维修数量" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>

2
web-admin-app/src/app/components/permissions-select/permissions-select.component.html

@ -13,7 +13,7 @@
<div class="h-64 overflow-y-auto p-3">
<div nz-row [nzGutter]="[12, 12]">
@for (item of menus; track $index) {
<div nz-col nzSpan="8">
<div nz-col nzSpan="6">
<label
nz-checkbox
[nzValue]="item.menuId"

88
web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.html

@ -48,10 +48,10 @@
</nz-form-item>
</div>
}
@if (type === 'maintenance') {
@if (['maintenance', 'repair'].includes(type)) {
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>保养成本</nz-form-label>
<nz-form-label nzRequired>{{ type === 'maintenance' ? '保养' : '维修' }}成本</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-group nzAddOnAfter="元">
<nz-input-number class="!w-full" nzPlaceHolder="请输入" formControlName="cost" />
@ -88,7 +88,21 @@
</div>
<div formArrayName="_extInfo">
@if (extraFields.length > 0) {
<div class="text-lg mb-6">{{ data.title }}项目</div>
<div class="mb-6">
<span class="text-lg">
@if (type === 'repair') {
处置详情
} @else {
{{ data.title }}项目
}
</span>
@if (data.formName) {
<span class="ml-1">
表单来源 <a nz-button nzType="link">{{ data.formName }}</a>
</span>
}
</div>
<div nz-row [nzGutter]="24">
@for (item of extraFields; track item.key; let fid = $index) {
<div nz-col [nzSpan]="item.type === 'LIST' ? 24 : 8" [formGroupName]="fid">
@ -197,62 +211,22 @@
}
</div>
@if (type === 'maintenance') {
@if (['maintenance', 'repair'].includes(type)) {
<div class="text-lg mb-6">备件损耗</div>
<asset-select-beijian formControlName="sparePartsList" />
<!-- <div formArrayName="sparePartsList" class="hidden">
<div nz-row [nzGutter]="24">
<nz-table nzTemplateMode class="w-full" [nzBordered]="true" nzSize="small">
<thead>
<tr>
<th>编号</th>
<th>备件名称</th>
<th>备件型号</th>
<th>数量</th>
<th>备注</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@for (item of sparePartsList.controls; track $index) {
<tr nz-col nzSpan="8" [formGroupName]="$index">
<td>
<input nz-input formControlName="assetId" />
</td>
<td>
<input nz-input formControlName="name" />
</td>
<td>
<input nz-input formControlName="model" />
</td>
<td>
<input nz-input formControlName="model" />
</td>
<td>
<input nz-input formControlName="count" />
</td>
<td>
<input nz-input formControlName="remark" />
</td>
<td>
<button nz-button nzDanger nzType="link" (click)="removeSpareParts($index)">
<i nz-icon nzType="delete"></i>
</button>
</td>
</tr>
}
<tr>
<td [colSpan]="7">
<button nz-button nzType="dashed" nzBlock (click)="addSpareParts()">
<i nz-icon nzType="plus"></i>
新增备件
</button>
</td>
</tr>
</tbody>
</nz-table>
</div>
</div> -->
}
@if (data?.repairShenhe) {
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label nzRequired>
<div>审批意见</div>
<div>(使用部门)</div>
</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<textarea nz-input formControlName="opinion" placeholder="请输入审批意见"></textarea>
</nz-form-control>
</nz-form-item>
</div>
}
<ng-template #errorTpl let-control>

14
web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.ts

@ -25,7 +25,7 @@ export const defectStatusText: Record<PlanTaskType, string[]> = {
inspection: ['待检', '正常', '异常', '取消'], // 巡检
stocktaking: ['待盘点', '正常', '盘赢', '盘亏'], // 盘点
maintenance: ['待保养', '正常', '异常', '取消'], // 保养
repair: ['待保养', '正常', '异常', '取消'],
repair: ['待维修', '完成', '未完成', '取消'],
}
@Component({
selector: 'app-asset-form',
@ -86,6 +86,7 @@ export class HandleTaskAssetItemComponent {
defectStatus: this.fb.control(null, [FormValidators.required('请选择')]),
img: this.fb.control(null, []),
opinion: this.fb.control(null, []),
attachment: this.fb.control(null, []),
notes: this.fb.control(null, []),
autoRepair: this.fb.control(false, []),
@ -94,7 +95,6 @@ export class HandleTaskAssetItemComponent {
sparePartsList: this.fb.control([], []),
})
console.log('this.data', this.data)
this.patchValues()
this.api.getBasicFinancialCategory({}).subscribe((res) => {
@ -216,6 +216,7 @@ export class HandleTaskAssetItemComponent {
patchValues() {
const { asset: data, preview, type } = this.data
if (data) {
this.type = type
this.formGroup.patchValue({
@ -226,13 +227,20 @@ export class HandleTaskAssetItemComponent {
if (preview) {
this.formGroup.disable()
}
if (this.data?.repairShenhe) {
this.formGroup.disable()
this.formGroup.get('opinion')?.enable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.getRawValue()
if (this.data?.repairShenhe && !v.opinion) {
this.msg.error('请填写审核意见')
return
}
values = {
...v,

72
web-admin-app/src/app/components/plan-task/handle-task/handle-task.component.html

@ -77,39 +77,7 @@
<nz-form-item>
<nz-form-label nzRequired>任务状态</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
@switch (data.value.status) {
<!-- APPROVAL,COMPLETED,DISCARDED,DRAFTING,EXCEPTION,REJECTED,SUSPENDED,TO_BE_ASSIGNED -->
@case ('APPROVAL') {
<span class="text-blue-500">待处理</span>
}
@case ('COMPLETED') {
<span class="text-green-500">已完成</span>
}
@case ('DISCARDED') {
<span class="text-gray-500">已废弃</span>
}
@case ('DRAFTING') {
<span class="text-yellow-500">草稿中</span>
}
@case ('EXCEPTION') {
<span class="text-red-500">异常</span>
}
@case ('REJECTED') {
<span class="text-red-500">已驳回</span>
}
@case ('DISPOSE') {
<span class="text-blue-500">待处置</span>
}
@case ('SUSPENDED') {
<span class="text-yellow-500">已挂起</span>
}
@case ('TO_BE_ASSIGNED') {
<span class="text-yellow-500">待分配</span>
}
@default {
{{ data.value.status | json }}
}
}
<app-flow-status-tag [status]="data.value.status"></app-flow-status-tag>
</nz-form-control>
</nz-form-item>
</div>
@ -141,7 +109,7 @@
<nz-table nzTemplateMode [nzBordered]="true" nzSize="small">
<thead>
<tr>
<th>序号</th>
<th nzWidth="100px">序号</th>
<th>设备编号</th>
<th>设备名称</th>
<th>设备分类</th>
@ -153,7 +121,8 @@
@for (item of data.value.defects; track $index) {
<tr>
<td>
{{ item.assetId }}
<!-- {{ item.assetId }} -->
{{ $index + 1 }}
</td>
<td>
{{ item.assetCode }}
@ -172,22 +141,37 @@
</td>
<td>
<nz-space>
@if (item.defectStatus == 0 && !data.preview) {
@if (item.defectStatus == 0) {
<a
*nzSpaceItem
nz-button
nzType="link"
(click)="handleItem(item)"
>执行</a
>
执行
</a>
} @else {
<a
*nzSpaceItem
nz-button
nzType="link"
(click)="handlePreview(item)"
>查看</a
>
@if (data.preview) {
<a
*nzSpaceItem
nz-button
nzType="link"
(click)="handlePreview(item)"
>
查看
</a>
}
@if (data.type === 'repair') {
<a
*nzSpaceItem
nz-button
nzType="link"
(click)="handleItem(item, false, true)"
>
审批
</a>
}
}
</nz-space>
</td>

17
web-admin-app/src/app/components/plan-task/handle-task/handle-task.component.ts

@ -24,6 +24,7 @@ import {
} from '../handle-task-asset-item/handle-task-asset-item.component'
import { lastValueFrom } from 'rxjs'
import { PlanTaskType } from 'app/types'
import { FlowStatusTagComponent } from 'app/components/flow-status-tag/flow-status-tag.component'
@Component({
selector: 'app-stocktaking-detail-form',
@ -36,6 +37,7 @@ import { PlanTaskType } from 'app/types'
OrgSelectComponent,
PositionSelectComponent,
UploadComponent,
FlowStatusTagComponent,
],
templateUrl: './handle-task.component.html',
styleUrl: './handle-task.component.less',
@ -110,9 +112,13 @@ export class HandleTaskComponent {
modal = inject(NzModalService)
tempData: NzSafeAny = null
handleItem(asset: NzSafeAny, preview?: boolean) {
handleItem(asset: NzSafeAny, preview?: boolean, repairShenhe = false) {
let nzTitle = this.title + '执行详情'
if (repairShenhe) {
nzTitle = '维修审批详情'
}
this.modal.create({
nzTitle: this.title + '执行详情',
nzTitle,
nzContent: HandleTaskAssetItemComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
@ -121,7 +127,9 @@ export class HandleTaskComponent {
task: this.data.value,
title: this.title,
type: this.data.type,
formName: this.data.value?.formName,
preview,
repairShenhe,
},
nzFooter: preview ? null : void 0,
nzOnOk: async (e) => {
@ -155,7 +163,7 @@ export class HandleTaskComponent {
patchValues() {
const { value: data, preview, type } = this.data
this.title = taskTypeTitle.get(type)
console.log('type====', data)
this.defectStatusTextOnThis = this.defectStatusText[type as PlanTaskType]
if (data) {
this.formGroup.patchValue({
@ -169,10 +177,11 @@ export class HandleTaskComponent {
public getValues() {
let values = null
console.log('this.formGroup', this.formGroup)
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...this.data.value,
...v,
assetIdList: v.assetIdList.map((i: NzSafeAny) => {
return {

71
web-admin-app/src/app/components/plan-task/plan-form/plan-form.component.html

@ -1,4 +1,4 @@
<div class="modal-container">
<div>
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div class="text-lg mb-2">基本信息</div>
@ -35,7 +35,7 @@
<nz-form-item>
<nz-form-label nzRequired>计划类型</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="cycleType">
<nz-radio-group formControlName="cycleType" (ngModelChange)="cycleTypeChange($event)">
<label nz-radio nzValue="day">日循环计划 </label>
<label nz-radio nzValue="week">周循环计划 </label>
<label nz-radio nzValue="month">月循环计划</label>
@ -78,19 +78,54 @@
</nz-form-control>
</nz-form-item>
</div>
@if (['day', 'month'].includes(formGroup.get('cycleType')?.value)) {
<div nz-col [nzSpan]="8">
@if (formGroup.get('cycleType')?.value === 'day') {
<nz-form-item>
<nz-form-label>重复间隔</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-group nzAddOnAfter="天">
<nz-input-number class="!w-full" [nzMin]="0" formControlName="interval" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
} @else {
<nz-form-item>
<nz-form-label>执行月份</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-select nzMode="multiple" formControlName="interval" nzPlaceHolder="请选择月份">
<nz-option nzLabel="1月" [nzValue]="1" />
<nz-option nzLabel="2月" [nzValue]="2" />
<nz-option nzLabel="3月" [nzValue]="3" />
<nz-option nzLabel="4月" [nzValue]="4" />
<nz-option nzLabel="5月" [nzValue]="5" />
<nz-option nzLabel="6月" [nzValue]="6" />
<nz-option nzLabel="7月" [nzValue]="7" />
<nz-option nzLabel="8月" [nzValue]="8" />
<nz-option nzLabel="9月" [nzValue]="9" />
<nz-option nzLabel="10月" [nzValue]="10" />
<nz-option nzLabel="11月" [nzValue]="11" />
<nz-option nzLabel="12月" [nzValue]="12" />
</nz-select>
</nz-form-control>
</nz-form-item>
}
</div>
}
@if (formGroup.get('cycleType')?.value === 'day') {
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>跳过周末</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-switch formControlName="skipWeekend" />
</nz-form-control>
</nz-form-item>
</div>
}
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>重复间隔</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-group nzAddOnAfter="天">
<nz-input-number class="!w-full" [nzMin]="0" formControlName="interval" />
</nz-input-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>顺序巡检</nz-form-label>
<nz-form-label nzRequired>顺序执行</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-switch formControlName="order" />
</nz-form-control>
@ -106,14 +141,6 @@
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>跳过周末</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-switch formControlName="skipWeekend" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>计划备注</nz-form-label>
@ -149,7 +176,7 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select [storage]="true" formControlName="assetIdList" />
<app-asset-select type="plan" [storage]="true" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>

13
web-admin-app/src/app/components/plan-task/plan-form/plan-form.component.ts

@ -80,12 +80,12 @@ export class PlanFormComponent {
limit: this.fb.control(false, [FormValidators.required('请选择')]),
order: this.fb.control(false, [FormValidators.required('请选择')]),
skipWeekend: this.fb.control(false, [FormValidators.required('请选择')]),
skipWeekend: this.fb.control(false, []),
photo: this.fb.control(false, []),
businessId: this.fb.control(null, []),
remark: this.fb.control(null, []),
interval: this.fb.control(0, []),
interval: this.fb.control(null, []),
formTempId: this.fb.control(null, [FormValidators.required('请选择')]),
@ -95,6 +95,15 @@ export class PlanFormComponent {
this.patchValues()
}
cycleTypeChange(e: any) {
const interval = this.formGroup.get('interval')
if (e === 'month') {
interval?.patchValue([])
} else {
interval?.patchValue(null)
}
}
patchValues() {
const { value: data, preview } = this.data
if (data) {

3
web-admin-app/src/app/components/plan-task/plan-list/plan-list.component.html

@ -4,6 +4,9 @@
<button *nzSpaceItem nz-button nzType="primary" (click)="onCreate()">
<span>新建计划</span>
</button>
<button *nzSpaceItem nz-button [disabled]="table.ref.selected.size < 1" (click)="export()">
<span>导出计划</span>
</button>
</nz-space>
</ng-template>
<div class="flex-1 overflow-hidden">

27
web-admin-app/src/app/components/plan-task/plan-list/plan-list.component.ts

@ -47,18 +47,21 @@ export class PlanListComponent {
ngOnInit(): void {
this.table
.setConfig({
rowKey: 'jobId',
selectable: true,
})
.setColumn([
{ key: 'businessId', title: '计划编号', width: '170px', visible: true },
{ key: 'name', title: '计划名称', visible: true },
{ key: 'status', title: '计划状态', width: '100px', visible: true },
{ key: 'teamName', title: '执行班组', visible: true },
{ key: 'expectedStartTime', title: '开始时间', visible: true },
{ key: 'expectedFinishTime', title: '截止时间', visible: true },
{ key: 'expectedStartTime', title: '开始日期', visible: true },
{ key: 'expectedFinishTime', title: '截止日期', visible: true },
{ key: 'cycleType', title: '执行周期', width: '100px', visible: true },
{ key: 'nextExecuteTime', title: '下次执行', width: '150px', visible: true },
{ key: 'count', title: '巡检设备数', width: '100px', visible: true },
{ key: 'nextExecuteTime', title: '下次执行', width: '180px', visible: true },
{ key: 'count', title: '关联设备数', width: '100px', visible: true },
])
.setRowOperate([
{
@ -118,6 +121,20 @@ export class PlanListComponent {
})
}
export() {
const ids = Array.from(this.table.ref.selected).map((i) => Number(i))
if (ids.length === 0) {
return
}
this.msg.loading('Excel生成中...')
this.api.exportPlan(ids, this.type).subscribe((res) => {
Utils.downLoadFile(res, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8')
this.msg.remove()
this.msg.success('Excel生成成功')
})
}
onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑计划' : '添加计划'
if (preview) {

25
web-admin-app/src/app/components/plan-task/repair-task-form/repair-task-form.component.html

@ -27,6 +27,29 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>执行班组</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-select nzPlaceHolder="请选择" formControlName="teamId" nzAllowClear nzShowSearch>
@for (item of teamList; track $index) {
<nz-option [nzLabel]="item.teamName" [nzValue]="item.teamId" />
}
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>故障说明</nz-form-label>
@ -59,7 +82,7 @@
<nz-form-item>
<!-- <nz-form-label>资产列表</nz-form-label> -->
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select [storage]="true" formControlName="assetIdList" />
<app-asset-select type="repair" [storage]="true" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>

5
web-admin-app/src/app/components/plan-task/repair-task-form/repair-task-form.component.ts

@ -70,11 +70,12 @@ export class RepairTaskFormComponent {
})
this.formGroup = this.fb.group({
name: this.fb.control(null, [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName('报修'), [FormValidators.required('请输入')]),
remark: this.fb.control(null, []),
plannedDate: this.fb.control(null, [FormValidators.required('请选择')]),
teamId: this.fb.control(null, [FormValidators.required('请选择')]),
urgency: this.fb.control(1, []),
businessId: this.fb.control(null, []),
attachment: this.fb.control(null, []),
img: this.fb.control(null, []),

50
web-admin-app/src/app/components/plan-task/task-form/task-form.component.html

@ -1,6 +1,6 @@
<div class="modal-lg-container">
<div class="overflow-hidden">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div>
<div class="text-lg mb-2">基本信息</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
@ -58,7 +58,7 @@
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>顺序巡检</nz-form-label>
<nz-form-label nzRequired>顺序执行</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-switch formControlName="order" />
</nz-form-control>
@ -83,27 +83,45 @@
</nz-form-item>
</div>
} -->
<div nz-col [nzSpan]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>任务备注</nz-form-label>
<nz-form-label nzRequired>紧急程度</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入" formControlName="remark" />
<nz-radio-group formControlName="urgency">
<label nz-radio [nzValue]="1">普通</label>
<label nz-radio [nzValue]="2">紧急</label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">任务单据</nz-form-label>
<nz-form-label>任务备注</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-select nzPlaceHolder="请选择" formControlName="formTempId" nzAllowClear nzShowSearch>
@for (item of flowForms; track $index) {
<nz-option [nzLabel]="item.formName" [nzValue]="item.formTempId" />
}
</nz-select>
<input nz-input placeholder="请输入" formControlName="remark" />
</nz-form-control>
</nz-form-item>
</div>
@if (data.type !== 'stocktaking') {
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label [nzRequired]="true">任务单据</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-select
nzPlaceHolder="请选择"
formControlName="formTempId"
nzAllowClear
nzShowSearch
>
@for (item of flowForms; track $index) {
<nz-option [nzLabel]="item.formName" [nzValue]="item.formTempId" />
}
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
}
<div nz-col nzSpan="24">
<div class="text-lg mb-2">{{ title }}设备</div>
</div>
@ -111,7 +129,7 @@
<nz-form-item>
<!-- <nz-form-label>资产列表</nz-form-label> -->
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select [storage]="true" formControlName="assetIdList" />
<app-asset-select type="task" [storage]="true" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>
@ -119,6 +137,10 @@
</div>
</form>
@if (data?.value) {
<app-flow-result [flow]="data.value" />
}
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>

14
web-admin-app/src/app/components/plan-task/task-form/task-form.component.ts

@ -18,6 +18,7 @@ import {
SupplierSelectComponent,
} from 'app/components'
import { UploadComponent } from '../../../shared/components/upload/upload.component'
import { FlowResultComponent } from 'app/components/apply-asset-flow/flow-result/flow-result.component'
@Component({
selector: 'app-stocktaking-detail-form',
@ -30,6 +31,7 @@ import { UploadComponent } from '../../../shared/components/upload/upload.compon
OrgSelectComponent,
PositionSelectComponent,
UploadComponent,
FlowResultComponent,
],
templateUrl: './task-form.component.html',
styleUrl: './task-form.component.less',
@ -68,18 +70,20 @@ export class TaskFormComponent {
this.api.getFlowFormList().subscribe((res) => {
this.flowForms = res.body
})
this.formGroup = this.fb.group({
teamId: this.fb.control(null, [FormValidators.required('请选择')]),
name: this.fb.control(null, [FormValidators.required('请输入')]),
name: this.fb.control(this.api.genFlowName(taskTypeTitle.get(this.data.type)!), [
FormValidators.required('请输入'),
]),
remark: this.fb.control(null, []),
formTempId: this.fb.control(null, [FormValidators.required('请选择')]),
formTempId: this.fb.control(null, []),
// plannedDate: this.fb.control(null, [FormValidators.required('请选择')]),
actualStartTime: this.fb.control(null, []),
businessId: this.fb.control(null, []),
urgency: this.fb.control(1, []),
attachment: this.fb.control(null, []),
duration: this.fb.control(null, [FormValidators.required('请输入')]),
order: this.fb.control(false, []),
@ -115,8 +119,8 @@ export class TaskFormComponent {
const form = this.flowForms.find((i) => i.formTempId === v.formTempId)
values = {
...v,
formName: form.formName,
formValue: form.formValue,
formName: form?.formName,
formValue: form?.formValue,
teamName: this.teamList.find((i) => i.teamId === v.teamId).teamName,
assetIdList: v.assetIdList.map((i: NzSafeAny) => {
return {

34
web-admin-app/src/app/components/plan-task/task-list/task-list.component.html

@ -10,39 +10,7 @@
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
@switch (data) {
<!-- APPROVAL,COMPLETED,DISCARDED,DRAFTING,EXCEPTION,REJECTED,SUSPENDED,TO_BE_ASSIGNED -->
@case ('APPROVAL') {
<span class="text-blue-500">审批中</span>
}
@case ('COMPLETED') {
<span class="text-green-500">已完成</span>
}
@case ('DISCARDED') {
<span class="text-gray-500">已废弃</span>
}
@case ('DRAFTING') {
<span class="text-yellow-500">草稿中</span>
}
@case ('EXCEPTION') {
<span class="text-red-500">异常</span>
}
@case ('REJECTED') {
<span class="text-red-500">已驳回</span>
}
@case ('DISPOSE') {
<span class="text-blue-500">待处置</span>
}
@case ('SUSPENDED') {
<span class="text-yellow-500">已挂起</span>
}
@case ('TO_BE_ASSIGNED') {
<span class="text-yellow-500">待分配</span>
}
@default {
{{ data }}
}
}
<app-flow-status-tag [status]="data"></app-flow-status-tag>
}
@case ('finished') {
{{ (row.total ?? 0) - (row.unfinished ?? 0) }}

12
web-admin-app/src/app/components/plan-task/task-list/task-list.component.ts

@ -18,11 +18,12 @@ import { PlanFormComponent } from '../plan-form/plan-form.component'
import { TaskFormComponent } from '../task-form/task-form.component'
import { HandleTaskComponent } from '../handle-task/handle-task.component'
import { Utils } from 'app/utils'
import { FlowStatusTagComponent } from 'app/components/flow-status-tag/flow-status-tag.component'
@Component({
selector: 'app-task-list',
standalone: true,
imports: [SharedModule, StatusTagComponent],
imports: [SharedModule, FlowStatusTagComponent],
templateUrl: './task-list.component.html',
styleUrl: './task-list.component.less',
})
@ -264,7 +265,6 @@ export class TaskListComponent {
// console.log('chuzhi', chuzhi, data)
let nzTitle = chuzhi ? '处置任务' : '任务审批'
console.log('data', data)
const footer: NzSafeAny[] = chuzhi
? [
{
@ -295,6 +295,14 @@ export class TaskListComponent {
onClick: async (e: HandleTaskComponent) => {
const vals = e.getValues()
if (vals) {
console.log(data, vals, {
...data,
...vals,
taskId: data.taskId,
instanceId: data.procInsId,
})
const res = await lastValueFrom(
this.api.handleTaskAssetItem(
{

14
web-admin-app/src/app/components/position-select/position-select.component.html

@ -1,4 +1,4 @@
<nz-tree-select
<!-- <nz-tree-select
[nzNodes]="positionTree"
[nzPlaceHolder]="placeholder"
[(ngModel)]="value"
@ -6,4 +6,14 @@
(ngModelChange)="onChange($event)"
[nzDropdownMatchSelectWidth]="false"
>
</nz-tree-select>
</nz-tree-select> -->
<nz-cascader
[nzOptions]="positionTree"
[nzPlaceHolder]="placeholder"
[(ngModel)]="value"
[disabled]="disabled"
[nzChangeOnSelect]="true"
(ngModelChange)="onValueChange($event)"
>
</nz-cascader>

42
web-admin-app/src/app/components/position-select/position-select.component.ts

@ -48,23 +48,57 @@ export class PositionSelectComponent {
positionTree: NzSafeAny[] = []
value?: string
value?: number[]
tempValue?: number
disabled = false
ngOnInit(): void {
this.api.getDict().subscribe((res) => {})
this.api.getBasicPositionTree().subscribe((res) => {
this.originData = res.body
this.positionTree = Utils.buildTree(res.body, 'positionId', 'name')
this.positionTree = Utils.arrayToTree(res.body, 'parentId', 'positionId', (item) => {
return {
label: item.name,
value: item.positionId,
}
})
if (this.tempValue) {
const ids = this.getAllParentIds(this.tempValue)
console.log('ids', ids, this.tempValue)
this.value = ids
}
})
}
getAllParentIds(id: number): number[] {
const ids: number[] = []
const findParent = (id: number) => {
const parent = this.originData.find((item) => String(item.positionId) === String(id))
if (parent) {
ids.unshift(parent.positionId)
if (parent.parentId) {
findParent(parent.parentId)
}
}
}
findParent(id)
return ids
}
onValueChange(event: number[]): void {
this.onChange(event[event.length - 1])
}
onTouched = () => {}
onChange(v: NzSafeAny[]) {}
onChange(v: NzSafeAny) {}
writeValue(v: NzSafeAny): void {
this.value = v
this.tempValue = v
}
registerOnChange(fn: any): void {

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

@ -60,7 +60,7 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="repairFault" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>

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

@ -70,7 +70,7 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select formControlName="assetIdList" />
<app-asset-select type="repair" formControlName="assetIdList" />
</nz-form-control>
</nz-form-item>
</div>

56
web-admin-app/src/app/components/select-asset-flow/select-asset-flow.component.html

@ -0,0 +1,56 @@
<button nz-button nzBlock (click)="onTriggerClick(selectUserModalTpl)" [disabled]="disabled">
@if (selected || defaultValue) {
<span class="text-left !w-full">
{{ selected.name || defaultValue?.name }}
</span>
} @else {
<i nz-icon nzType="plus"></i>
请选择
}
</button>
<ng-template #selectUserModalTpl>
<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_V2_MAP(data) }}
</nz-tag>
}
@case ('type') {
<nz-tag nzColor="teal">
{{ businessType.get(data) }}
</nz-tag>
}
@case ('urgency') {
<nz-tag [nzColor]="data === 2 ? 'error' : ''">
{{ data === 2 ? '紧急' : '普通' }}
</nz-tag>
}
@default {
{{ data }}
}
}
</ng-template>
<ng-container *appTableForm>
<app-query-item label="流程状态">
<nz-select
nzPlaceHolder="请选择"
nzPlacement="bottomRight"
class="!w-24"
[nzDropdownMatchSelectWidth]="false"
formControlName="status"
nzAllowClear
>
<nz-option *ngFor="let item of ASSET_STATUS" [nzLabel]="item.label" [nzValue]="item.value" />
</nz-select>
</app-query-item>
<app-query-item label="流程名称">
<input nz-input placeholder="请输入" formControlName="name" />
</app-query-item>
</ng-container>
</app-server-paginated-table>
</ng-template>

0
web-admin-app/src/app/components/apply-asset-flow/asset-employee-loss/asset-employee-loss.component.less → web-admin-app/src/app/components/select-asset-flow/select-asset-flow.component.less

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

@ -0,0 +1,125 @@
import { Component, EventEmitter, forwardRef, inject, Input, OnInit, Output, TemplateRef } from '@angular/core'
import { ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms'
import { ASSET_STATUS_MAP, ASSET_STATUS_V2, businessType } from 'app/constants'
import { ApiService } from 'app/services'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { SharedModule } from 'app/shared/shared.module'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { tap } from 'rxjs'
@Component({
selector: 'app-select-asset-flow',
standalone: true,
imports: [SharedModule],
templateUrl: './select-asset-flow.component.html',
styleUrl: './select-asset-flow.component.less',
providers: [
{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef(() => SelectAssetFlowComponent),
},
],
})
export class SelectAssetFlowComponent implements ControlValueAccessor, OnInit {
constructor(private api: ApiService) {}
@Input() type: 'tuiku' | 'guihuan' = 'tuiku' // 退库 | 归还
@Input() defaultValue: any
@Output() onSelect = new EventEmitter()
queryForm = new FormGroup({
name: new FormControl(),
type: new FormControl(),
status: new FormControl(),
})
modal = inject(NzModalService)
selected: NzSafeAny | null
disabled = false
ASSET_STATUS_MAP = ASSET_STATUS_MAP()
ASSET_STATUS = ASSET_STATUS_V2
businessType = businessType
allData = []
ASSET_STATUS_V2_MAP(v: number) {
return ASSET_STATUS_V2.find((f) => f.value === v)?.label ?? '-'
}
table = new TableOption(this.fetchData.bind(this), {
cacheKey: 'accccc',
})
ngOnInit() {
this.table
.setConfig({
selectable: true,
radio: true,
disbale(v) {
console.log('v', v)
return v.logStatus === 1
},
})
.setColumn([
{ key: 'businessId', title: '业务编号', visible: true },
{ key: 'name', title: '流程名称', visible: true },
{ key: 'status', title: '流程状态', visible: true, width: '100px' },
{ key: 'urgency', title: '紧急程度', visible: true, width: '100px' },
{ key: 'applicant', title: '发起人', visible: true },
{ key: 'createTime', title: '创建时间', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
const type = this.type === 'tuiku' ? 'COLLECTION' : 'BORROW'
return this.api.getAssetManagerPage({ ...p, ...q, type }).pipe(
tap((res) => {
this.allData = this.allData.concat(...(res.body?.rows ?? []))
}),
)
}
onTriggerClick(nzContent: TemplateRef<NzSafeAny>) {
const title = this.type === 'tuiku' ? '领用流程' : '借用流程'
this.modal.create({
nzTitle: `选择${title}流程`,
nzContent,
nzWidth: '80vw',
nzOnOk: () => {
this.selected = this.allData.find((f: any) => this.table.ref.selected.has(String(f.id)))
this.onChange(this.selected?.id)
this.onSelect.emit(this.selected)
},
nzOnCancel: () => {
this.selected = null
},
})
}
onTouched = () => {}
onChange(v: NzSafeAny[]) {}
writeValue(obj: any): void {
this.selected = obj
}
registerOnChange(fn: any): void {
this.onChange = fn
}
registerOnTouched(fn: any): void {
this.onTouched = fn
}
setDisabledState?(isDisabled: boolean): void {
this.disabled = isDisabled
}
}

2
web-admin-app/src/app/components/stocktaking-detail-form/stocktaking-detail-form.component.html

@ -75,7 +75,7 @@
<nz-form-item>
<nz-form-label>资产列表</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-asset-select [radio]="true" formControlName="assetId" />
<app-asset-select type="stocktaking" [radio]="true" formControlName="assetId" />
</nz-form-control>
</nz-form-item>
</div>

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

@ -73,7 +73,7 @@ export const ASSET_TYPE = [
{ label: '资产调拨', value: 'ALLOCATE' },
{ label: '资产转移', value: 'TRANSFER' },
{ label: '资产报废', value: 'RETIREMENT' },
// { label: '资产出库', value: 'OUTBOUND' },
{ label: '资产出库', value: 'OUTBOUND' },
// { label: '故障登记', value: 'REPAIR_FAULT' },
// { label: '设备报修', value: 'REPAIR' },
// { label: '资产清理', value: 'CLEAN' },

16
web-admin-app/src/app/pages/dashboard/dashboard.component.html

@ -116,7 +116,7 @@
</nz-card>
<div class="mt-4"></div>
<div nz-row [nzGutter]="[16, 16]">
<div nz-row [nzGutter]="[16, 16]" id="chartWrapper">
<div nz-col [nzSpan]="8">
<nz-card [nzBordered]="false" nzTitle="资产状态分布" [nzExtra]="extraStatusTpl">
<ng-template #extraStatusTpl>
@ -129,7 +129,7 @@
]"
/>
</ng-template>
<div class="h-72" #chart1Tpl></div>
<div class="h-max-auto" [ngStyle]="{ height: chartHeight }" #chart1Tpl></div>
</nz-card>
</div>
<div nz-col [nzSpan]="8">
@ -144,7 +144,7 @@
]"
/>
</ng-template>
<div class="h-72" #chart2Tpl></div>
<div class="h-max-auto" [ngStyle]="{ height: chartHeight }" #chart2Tpl></div>
</nz-card>
</div>
<div nz-col [nzSpan]="8">
@ -159,7 +159,7 @@
]"
/>
</ng-template>
<div class="h-72" #chart3Tpl></div>
<div class="h-max-auto" [ngStyle]="{ height: chartHeight }" #chart3Tpl></div>
</nz-card>
</div>
<div nz-col [nzSpan]="8">
@ -174,7 +174,7 @@
]"
/>
</ng-template>
<div class="h-72" #chart4Tpl></div>
<div class="h-max-auto" [ngStyle]="{ height: chartHeight }" #chart4Tpl></div>
</nz-card>
</div>
<div nz-col [nzSpan]="8">
@ -190,7 +190,7 @@
/>
</ng-template>
<div class="h-72" #chart5Tpl></div>
<div class="h-max-auto" [ngStyle]="{ height: chartHeight }" #chart5Tpl></div>
</nz-card>
</div>
<div nz-col [nzSpan]="8">
@ -205,7 +205,7 @@
]"
/>
</ng-template>
<div class="h-72" #chart6Tpl></div>
<div class="h-max-auto" [ngStyle]="{ height: chartHeight }" #chart6Tpl></div>
</nz-card>
</div>
</div>
@ -274,7 +274,7 @@
</button>
</ng-template>
<div class="-mt-4 h-[530px] overflow-auto">
<div class="-mt-4 overflow-auto" [ngStyle]="{ height: newHeight }">
<nz-list [nzBordered]="false">
@for (item of data.recentlyAddedAssets; track item) {
<nz-list-item>

2
web-admin-app/src/app/pages/dashboard/dashboard.component.less

@ -63,6 +63,8 @@
font-size: 14px;
}
.cdk-drag-preview {
box-sizing: border-box;
border-radius: 4px;

10
web-admin-app/src/app/pages/dashboard/dashboard.component.ts

@ -124,6 +124,7 @@ export class DashboardComponent implements OnInit, AfterViewInit {
@HostListener('window:resize')
onResize() {
this.pageReseize()
// this.echartRef1?.resize();
this.echartRef1?.resize()
this.echartRef2?.resize()
@ -156,12 +157,21 @@ export class DashboardComponent implements OnInit, AfterViewInit {
// this.count = res.body
// })
this.initQuickAction()
this.pageReseize()
}
ngAfterViewInit(): void {
this.domMap = [this.chart1, this.chart2, this.chart3, this.chart4, this.chart5, this.chart6]
}
chartHeight = '0px'
newHeight = '0px'
pageReseize() {
const top = 510
this.chartHeight = (window.innerHeight - top) / 2 + 'px'
this.newHeight = window.innerHeight - 560 + 'px'
}
onSort(nzContent: TemplateRef<{}>) {
this.modal.create({
nzTitle: '快捷操作排序',

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

@ -8,6 +8,7 @@
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item (click)="onEntry()">资产入库</li>
<li nz-menu-item (click)="onOutbound()">资产出库</li>
<li nz-menu-item (click)="onDistribution()">资产领用</li>
<li nz-menu-item (click)="onReturn()">资产退库</li>
<li nz-menu-item (click)="onBorrow()">资产借用</li>
@ -17,6 +18,9 @@
<li nz-menu-item (click)="onScrap()">资产报废</li>
</ul>
</nz-dropdown-menu>
<button *nzSpaceItem nz-button [disabled]="table.ref.selected.size < 1" (click)="export()">
<span>导出</span>
</button>
</nz-space>
</ng-template>
<div class="flex-1 overflow-hidden">
@ -29,14 +33,10 @@
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('status') {
<nz-tag>
{{ ASSET_STATUS_V2_MAP(data) }}
</nz-tag>
<app-flow-status-tag [status]="data"></app-flow-status-tag>
}
@case ('type') {
<nz-tag nzColor="teal">
{{ businessType.get(data) }}
</nz-tag>
{{ businessType.get(data) }}
}
@case ('urgency') {
<nz-tag [nzColor]="data === 2 ? 'error' : ''">

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

@ -24,11 +24,19 @@ import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_STATUS, ASSET_STATUS_MAP, ASSET_STATUS_V2, ASSET_TYPE, businessType } from 'app/constants'
import { Utils } from 'app/utils'
import { FlowStatusTagComponent } from 'app/components/flow-status-tag/flow-status-tag.component'
import { AssetBusinessOutboundFormComponent } from 'app/components/asset-business-outbound-form/asset-business-outbound-form.component'
@Component({
selector: 'app-asset-management',
standalone: true,
imports: [SharedModule, AssetFormComponent, PositionSelectComponent, ManufacturerSelectComponent],
imports: [
SharedModule,
FlowStatusTagComponent,
AssetFormComponent,
PositionSelectComponent,
ManufacturerSelectComponent,
],
templateUrl: './asset-management.component.html',
styleUrl: './asset-management.component.less',
})
@ -70,11 +78,10 @@ export class AssetManagementComponent {
this.table
.setConfig({
selectable: true,
rowKey: 'assetId',
})
.setColumn([
{ key: 'businessId', title: '业务编号', visible: true },
{ key: 'name', title: '流程名称', visible: true },
{ key: 'name', title: '流程名称', width: '250px', visible: true },
{ key: 'type', title: '流程类型', visible: true, width: '120px' },
{ key: 'status', title: '流程状态', visible: true, width: '100px' },
{ key: 'urgency', title: '紧急程度', visible: true, width: '100px' },
@ -108,6 +115,9 @@ export class AssetManagementComponent {
case 'STORAGE':
this.onEntry(data, type === 'preview')
break
case 'OUTBOUND':
this.onOutbound(data, type === 'preview')
break
case 'RETURN':
this.onRevert(data, type === 'preview')
break
@ -124,6 +134,20 @@ export class AssetManagementComponent {
return this.api.getAssetManagerPage({ ...p, ...q })
}
export() {
const ids = Array.from(this.table.ref.selected).map((i) => Number(i))
if (ids.length === 0) {
return
}
this.msg.loading('Excel生成中...')
this.api.exportManageFlow(ids).subscribe((res) => {
Utils.downLoadFile(res, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8')
this.msg.remove()
this.msg.success('Excel生成成功')
})
}
onEntry(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产入库' : '添加资产入库'
if (preview) {
@ -155,6 +179,39 @@ export class AssetManagementComponent {
},
})
}
onOutbound(data?: any, preview?: boolean) {
let nzTitle = data ? '编辑资产出库' : '添加资产出库'
if (preview) {
nzTitle = '预览资产出库'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessOutboundFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: void 0,
preview: false,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(
this.api.assetAddByFlow({
...vals,
type: 'OUTBOUND',
}),
)
this.msg.success(res.desc)
return true
}
return false
},
})
}
onDistribution(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产领用' : '添加资产领用'
if (preview) {

77
web-admin-app/src/app/pages/fixed-asset/basic/basic-category/basic-category.component.html

@ -24,39 +24,42 @@
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label> 安全库存 </nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-number
nzPlaceHolder="请输入"
[nzMin]="0"
class="!w-full"
formControlName="safetyLimit"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label> 安全库存上限 </nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-number
nzPlaceHolder="请输入"
[nzMin]="0"
class="!w-full"
formControlName="upperLimit"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label> 安全库存下限 </nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-number
nzPlaceHolder="请输入"
[nzMin]="0"
class="!w-full"
formControlName="lowerLimit"
/>
</nz-form-control>
</nz-form-item>
@if (yihaopin) {
<nz-form-item>
<nz-form-label> 安全库存 </nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-number
nzPlaceHolder="请输入"
[nzMin]="0"
class="!w-full"
formControlName="safetyLimit"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label> 安全库存上限 </nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-number
nzPlaceHolder="请输入"
[nzMin]="0"
class="!w-full"
formControlName="upperLimit"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label> 安全库存下限 </nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-input-number
nzPlaceHolder="请输入"
[nzMin]="0"
class="!w-full"
formControlName="lowerLimit"
/>
</nz-form-control>
</nz-form-item>
}
<nz-form-item>
<nz-form-control> </nz-form-control>
</nz-form-item>
@ -91,10 +94,10 @@
<tr>
<th>序号</th>
<th>标识符</th>
<th>检查内容</th>
<th>字段名</th>
<th>类型</th>
<th>结果</th>
<th>默认值</th>
<th>备注</th>
<th>操作</th>
</tr>
@ -108,7 +111,9 @@
<nz-input-number
[nzStep]="1"
placeholder="请输入"
formControlName="sort"
[disabled]="true"
[ngModel]="$index + 1"
[ngModelOptions]="{ standalone: true }"
/>
</td>
<td>

39
web-admin-app/src/app/pages/fixed-asset/basic/basic-category/basic-category.component.ts

@ -40,6 +40,8 @@ export class BasicCategoryComponent {
drawerRef?: NzDrawerRef
yihaopin = false
@ViewChild('drawerFooterTpl') drawerFooterTpl!: TemplateRef<NzSafeAny>
@ViewChild('formContentTpl') formContentTpl!: TemplateRef<NzSafeAny>
@ -55,6 +57,7 @@ export class BasicCategoryComponent {
_assetExtTemp: this.fb.array([]),
})
}
initQueryForm() {
this.queryForm = this.fb.group({
name: [''],
@ -68,8 +71,12 @@ export class BasicCategoryComponent {
onSelectedChange(v: NzSafeAny) {
const { _assetExtTemp, ...r } = v
this.createForm.patchValue(r)
this.patchFormValue(_assetExtTemp ?? [])
console.log('v', v, this.createForm.getRawValue())
this.yihaopin = v?.safetyLimit !== void 0
}
get formValue(): FormArray {
@ -79,11 +86,12 @@ export class BasicCategoryComponent {
onConfirm() {
if (FormValidators.validateFormGroup(this.createForm)) {
const { value } = this.createForm
console.log('value', value)
const v = this.formValue.getRawValue()
this.api
.updateBasicCategoryTree({
...value,
_assetExtTemp: this.formValue.value.map((v: any) => {
_assetExtTemp: v.map((v: any) => {
if (v.type === 'RADIO' || v.type === 'LIST') {
return {
...v,
@ -140,17 +148,17 @@ export class BasicCategoryComponent {
this.formValue.push(
this.fb.group({
key: this.fb.control(v.key, []),
key: this.fb.control({ value: v.key, disabled: true }, []),
value: this.fb.control(value, []),
name: this.fb.control(v.name, []),
type: this.fb.control(v.type, []),
remark: this.fb.control(v.remark, []),
sort: this.fb.control(v.sort ?? 0, []),
sort: this.fb.control({ value: v.sort ?? 0, disabled: true }, []),
fields: fieldsArrays,
}),
)
})
console.log('this.formValue', this.formValue)
// console.log('this.formValue', this.formValue)
}
formatRadioValue(fields: string[], value: string) {}
@ -171,32 +179,21 @@ export class BasicCategoryComponent {
this.getRadioFieldsFormArray(idx).push(new FormControl())
}
addFormItem() {
const idx = this.formValue.length
const randomKey = Math.random().toString(36).substring(7) + idx
this.formValue.push(
new FormGroup({
key: new FormControl(null, []),
key: new FormControl({ value: randomKey, disabled: true }, []),
value: new FormControl(null, []),
name: new FormControl(null, []),
type: new FormControl(null, []),
type: new FormControl('STRING', []),
remark: new FormControl(null, []),
sort: new FormControl(null, []),
sort: new FormControl({ value: idx, disabled: true }, []),
fields: this.fb.array([]),
}),
)
}
addFormValue() {
this.formValue.push(
new FormGroup({
key: new FormControl(),
value: new FormControl(),
name: new FormControl(),
type: new FormControl(),
remark: new FormControl(),
sort: new FormControl(0),
}),
)
}
removeFormItem(idx: number) {
this.formValue.removeAt(idx)
}

46
web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form-manage/basic-flow-form-manage.component.html

@ -72,12 +72,12 @@
<tr>
<th>序号</th>
<th>标识符</th>
<th>检查内容</th>
<th>字段名</th>
<th>类型</th>
<th>结果</th>
<th>默认值</th>
<th>备注</th>
<th>操作</th>
<!-- <th>操作</th> -->
</tr>
</thead>
<tbody>
@ -86,7 +86,13 @@
*ngFor="let item of formValue.controls; let $index = index"
>
<td>
<nz-input-number [nzStep]="1" placeholder="请输入" formControlName="sort" />
<nz-input-number
[nzStep]="1"
placeholder="请输入"
[disabled]="true"
[ngModel]="$index + 1"
[ngModelOptions]="{ standalone: true }"
/>
</td>
<td>
<input nz-input placeholder="请输入" formControlName="key" />
@ -124,7 +130,7 @@
nzSize="small"
[formControlName]="i"
/>
<button
<!-- <button
nz-button
nzType="text"
nzSize="small"
@ -133,17 +139,17 @@
(click)="removeRadioItem($index, i)"
>
<i nz-icon nzType="delete"></i>
</button>
</button> -->
</div>
</div>
</nz-radio-group>
</ng-container>
<div class="mt-2">
<!-- <div class="mt-2">
<button nz-button nzSize="small" (click)="addRadioItem($index)">
<span nz-icon nzType="plus" nzTheme="outline"></span>
新增选项
</button>
</div>
</div> -->
}
@case ('RADIO') {
<ng-container *ngIf="getRadioFields($index) as fields">
@ -153,13 +159,14 @@
class="flex mb-2 items-center"
*ngFor="let f of fields; let i = index"
>
<label nz-radio [nzValue]="fields[i].value"></label>
<input
class="flex-1"
nz-input
nzSize="small"
[formControlName]="i"
/>
<button
<!-- <button
nz-button
nzType="text"
nzSize="small"
@ -168,17 +175,17 @@
(click)="removeRadioItem($index, i)"
>
<i nz-icon nzType="delete"></i>
</button>
</button> -->
</div>
</div>
</nz-radio-group>
</ng-container>
<div class="mt-2">
<!-- <div class="mt-2">
<button nz-button nzSize="small" (click)="addRadioItem($index)">
<span nz-icon nzType="plus" nzTheme="outline"></span>
新增选项
</button>
</div>
</div> -->
}
@case ('NUMBER') {
<nz-input-number
@ -201,7 +208,7 @@
<td>
<input nz-input placeholder="请输入" formControlName="remark" />
</td>
<td>
<!-- <td>
<button
nz-button
nzShape="circle"
@ -211,24 +218,27 @@
>
<span nz-icon nzType="delete" nzTheme="outline"></span>
</button>
</td>
</td> -->
</tr>
<tr>
<!-- <tr>
<td colspan="6" class="text-right"></td>
<td>
<button nz-button nzType="primary" nzShape="circle" (click)="addFormItem()">
<span nz-icon nzType="plus" nzTheme="outline"></span>
</button>
</td>
</tr>
</tr> -->
</tbody>
</nz-table>
</div>
</div>
</ng-template>
<ng-template #step3>
<nz-form-item>
<div class="pdfPreview">
<iframe [attr.src]="pdfUrl" class="pdfIframe" width="100%" height="100%"></iframe>
</div>
<!-- <nz-form-item>
<nz-form-label nzSpan="5" nzRequired>模板预览</nz-form-label>
<nz-form-control nzSpan="14" [nzErrorTip]="formErrorTpl">
<a nz-button nzType="link" (click)="previewTpl()">
@ -236,7 +246,7 @@
点击下载预览
</a>
</nz-form-control>
</nz-form-item>
</nz-form-item> -->
<!-- <nz-form-item>
<nz-form-label nzSpan="5" [nzRequired]="true">上传模板</nz-form-label>
<nz-form-control nzSpan="14" [nzErrorTip]="formErrorTpl">

4
web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form-manage/basic-flow-form-manage.component.less

@ -5,4 +5,8 @@
line-height: 32px;
}
}
.pdfPreview {
height: 100vh;
}

168
web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form-manage/basic-flow-form-manage.component.ts

@ -1,5 +1,6 @@
import { Component, inject } from '@angular/core'
import { Component, inject, TemplateRef, ViewChild } from '@angular/core'
import { FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms'
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
import { ActivatedRoute, Router } from '@angular/router'
import { FLOW_FORM_TYPES } from 'app/constants'
import { ApiService } from 'app/services'
@ -85,6 +86,9 @@ export class BasicFlowFormManageComponent {
fb = inject(FormBuilder)
onTplupload(e: NzSafeAny) {
this.patchFormValue(e?._formValue ?? [])
this.formGroup.patchValue({
templatePath: e.fileName,
})
}
patchFormValue(e: NzSafeAny[]) {
@ -102,17 +106,16 @@ export class BasicFlowFormManageComponent {
fieldsArrays.push(this.fb.control(i))
})
value = val?.value
// console.log('fieldsArrays', val)
}
console.log('fieldsArrays', v, value)
this.formValue.push(
new FormGroup({
key: new FormControl(v.key, []),
key: this.fb.control({ value: v.key, disabled: true }, []),
value: new FormControl(value, []),
name: new FormControl(v.name, []),
type: new FormControl(v.type, []),
remark: new FormControl(v.remark, []),
sort: new FormControl(v.sort ?? 0, []),
sort: this.fb.control({ value: v.sort ?? 0, disabled: true }, []),
fields: fieldsArrays,
}),
)
@ -137,68 +140,84 @@ export class BasicFlowFormManageComponent {
handleSubmit() {
if (FormValidators.validateFormGroup(this.formGroup)) {
const vals = this.formGroup.value
const v = this.formValue.getRawValue()
const _formValue = v!.map((i: any) => {
let value = i.value
if (i.type === 'RADIO' || i.type === 'LIST') {
value = { fields: i.fields, value: i.value }
}
return {
...i,
value,
}
})
if (
!_formValue.every((s: any) => {
let res = false
if (s.name && s.type) {
res = true
}
if (s.type === 'RADIO') {
res = !!s.value?.value
} else {
res = !!s.value
}
return res
})
) {
this.msg.error('请完善表单信息')
return
}
// if(this.formValue.value)
this.modal.confirm({
nzTitle: '提交表单',
nzContent: '确定提交表单?',
nzOnOk: async () => {
const vals = this.formGroup.value
const _formValue = vals._formValue!.map((i: any) => {
return {
...i,
value: ['RADIO', 'LIST'].includes(i.type) ? { fields: i.fields, value: i.value } : i.value,
}
})
const finalVal = {
...vals,
_formValue,
id: this.id,
formTempId: this.id,
}
const res = await lastValueFrom(
this.id
? this.api.updateFlowForm({
? this.api.updateFlowForm(finalVal)
: this.api.addFlowForm({
...vals,
_formValue,
id: this.id,
formTempId: this.id,
})
: this.api.addFlowForm(vals),
}),
)
this.msg.success(res.desc)
if (!this.id) {
this.id = res.body.formTempId
}
this.onPreview()
// this.router.navigate(['/fixed-asset/basic/flow-form/list'])
this.step = 2
},
})
}
}
handleConfirm() {
if (FormValidators.validateFormGroup(this.formGroup)) {
if (!this.formGroup.value?.templatePath) {
this.msg.error('请先上传模板')
return
}
this.modal.confirm({
nzTitle: '确认上传',
nzContent: '确认上传模板?',
nzOnOk: async () => {
const vals = this.formGroup.value
const res = await lastValueFrom(
this.id
? this.api.confirmFlowForm({
...vals,
id: this.id,
formTempId: this.id,
})
: this.api.addFlowForm(vals),
)
this.msg.success(res.desc)
this.router.navigate(['/fixed-asset/basic/flow-form/list'])
},
})
}
}
getRadioFieldsFormArray(index: number): FormArray {
return this.formValue.at(index).get('fields') as FormArray
san = inject(DomSanitizer)
@ViewChild('pdfPreviewEl') pdfPreviewEl!: TemplateRef<{}>
pdfUrl: SafeResourceUrl | undefined
onPreview() {
this.msg.loading('正在下载...', { nzDuration: 0 })
this.api.preview(this.id!).subscribe((res) => {
const blob = new Blob([res.body as any], { type: 'application/pdf;charset=utf-8' })
const url = URL.createObjectURL(blob)
this.pdfUrl = this.san.bypassSecurityTrustResourceUrl(url)
setTimeout(() => URL.revokeObjectURL(url), 10000)
this.msg.remove()
})
}
previewTpl() {
@ -217,6 +236,41 @@ export class BasicFlowFormManageComponent {
this.msg.success('下载成功')
})
}
handleConfirm() {
if (FormValidators.validateFormGroup(this.formGroup)) {
this.router.navigate(['/fixed-asset/basic/flow-form/list'])
return
// if (!this.formGroup.value?.templatePath) {
// this.msg.error('请先上传模板')
// return
// }
// if(!this.id){
// this.modal.confirm({
// nzTitle: '确认上传',
// nzContent: '确认上传模板?',
// nzOnOk: async () => {
// const vals = this.formGroup.value
// const res = await lastValueFrom(
// this.id
// ? this.api.confirmFlowForm({
// ...vals,
// id: this.id,
// formTempId: this.id,
// })
// : this.api.addFlowForm(vals),
// )
// this.msg.success('操作成功')
// this.router.navigate(['/fixed-asset/basic/flow-form/list'])
// },
// })
// }
}
}
getRadioFieldsFormArray(index: number): FormArray {
return this.formValue.at(index).get('fields') as FormArray
}
getRadioFields(index: number): any[] {
// console.log('this.getRadioFieldsFormArray(index).controls', this.getRadioFieldsFormArray(index).controls)
return this.getRadioFieldsFormArray(index).controls
@ -233,38 +287,28 @@ export class BasicFlowFormManageComponent {
this.getRadioFieldsFormArray(idx).push(new FormControl())
}
addFormItem() {
const idx = this.formValue.length
const randomKey = Math.random().toString(36).substring(7) + idx
this.formValue.push(
new FormGroup({
key: new FormControl(null, []),
key: new FormControl({ value: randomKey, disabled: true }, []),
value: new FormControl(null, []),
name: new FormControl(null, []),
type: new FormControl(null, []),
type: new FormControl('STRING', []),
remark: new FormControl(null, []),
sort: new FormControl(null, []),
sort: new FormControl({ value: idx, disabled: true }, []),
fields: this.fb.array([]),
}),
)
}
addFormValue() {
this.formValue.push(
new FormGroup({
key: new FormControl(),
value: new FormControl(),
name: new FormControl(),
type: new FormControl(),
remark: new FormControl(),
sort: new FormControl(0),
}),
)
}
removeFormItem(idx: number) {
this.formValue.removeAt(idx)
// console.log('this.formValue', this.formValue.controls, idx)
}
removeRadioItem(idx: number, idx2: number) {
console.log('this.getRadioFieldsFormArray(idx)', this.getRadioFieldsFormArray(idx))
this.getRadioFieldsFormArray(idx).removeAt(idx2)
}
}

13
web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form/basic-flow-form.component.html

@ -16,6 +16,12 @@
</nz-space>
</ng-template>
<div class="flex-1 overflow-hidden">
<ng-template #pdfPreviewEl>
<div class="pdfPreview">
<iframe [attr.src]="pdfUrl" class="pdfIframe" width="100%" height="100%"></iframe>
</div>
</ng-template>
<app-server-paginated-table
[options]="table"
[tableAction]="actionsTpl"
@ -34,13 +40,6 @@
<app-query-item label="表单名称">
<input nz-input placeholder="请输入" class="w-60" formControlName="name" />
</app-query-item>
<app-query-item label="巡检班组">
<nz-select nzPlaceHolder="请选择" class="w-40">
<nz-option nzValue="1" nzLabel="所有类型"></nz-option>
<nz-option nzValue="2" nzLabel="物品领用"></nz-option>
<nz-option nzValue="3" nzLabel="设备报修"></nz-option>
</nz-select>
</app-query-item>
</ng-container>
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {

11
web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form/basic-flow-form.component.less

@ -0,0 +1,11 @@
::ng-deep {
.pdfPreview {
width: 100%;
height: 80vh;
overflow: hidden;
// .pdfIframe {
// margin-top: -58px;
// }
}
}

36
web-admin-app/src/app/pages/fixed-asset/basic/basic-flow-form/basic-flow-form.component.ts

@ -1,5 +1,7 @@
import { Component, ElementRef, inject, TemplateRef, ViewChild } from '@angular/core'
import { sanitizeIdentifier } from '@angular/compiler'
import { Component, ElementRef, inject, Sanitizer, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
import { Router } from '@angular/router'
import { StatusTagComponent } from 'app/components'
import { ApiService } from 'app/services'
@ -64,11 +66,11 @@ export class BasicFlowFormComponent {
.setColumn([
{ key: 'formKey', title: '表单编号', visible: true },
{ key: 'formName', title: '表单名称', visible: true },
{ key: 'formStatus', title: '表单状态', visible: true },
{ key: 'formStatus', title: '表单状态', width: '100px', visible: true },
{ key: 'createUserName', title: '创建人', visible: true },
{ key: 'createTime', title: '创建时间', visible: true },
{ key: 'updateTime', title: '最后修改时间', visible: true },
{ key: 'count', title: '项目数量', visible: true },
{ key: 'createTime', title: '创建时间', width: '170px', visible: true },
{ key: 'updateTime', title: '最后修改时间', width: '170px', visible: true },
{ key: 'count', title: '项目数量', width: '100px', visible: true },
])
.setRowOperate([
{ title: '编辑', onClick: this.onEdit.bind(this) },
@ -100,20 +102,28 @@ export class BasicFlowFormComponent {
return this.api.getFlowFormsList({ ...p, ...q }).pipe()
}
pdfUrl?: SafeResourceUrl
san = inject(DomSanitizer)
@ViewChild('pdfPreviewEl') pdfPreviewEl!: TemplateRef<{}>
onPreview(data?: NzSafeAny) {
this.msg.loading('正在下载...', { nzDuration: 0 })
this.api.preview(data.formTempId).subscribe((res) => {
Utils.downLoadFile(res, 'application/pdf;charset=utf-8')
// const blob = new Blob([res as any], { type: 'application/pdf;charset=utf-8' })
// const url = URL.createObjectURL(blob)
const blob = new Blob([res.body as any], { type: 'application/pdf;charset=utf-8' })
const url = URL.createObjectURL(blob)
// // 在新窗口打开 PDF 预览
// window.open(url, '_blank')
this.pdfUrl = this.san.bypassSecurityTrustResourceUrl(url)
// // 释放 URL 资源,避免内存泄漏(延迟一点时间释放以确保预览完成)
// setTimeout(() => URL.revokeObjectURL(url), 10000)
setTimeout(() => URL.revokeObjectURL(url), 10000)
this.msg.remove()
this.msg.success('下载成功')
this.modal.create({
nzTitle: '预览',
nzContent: this.pdfPreviewEl,
nzBodyStyle: { padding: '0' },
nzWidth: '80vw',
nzFooter: null,
})
})
}
onSetApprover(data?: NzSafeAny) {

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

@ -19,7 +19,21 @@
>
资产台账
</li>
<li nz-menu-item [nzPaddingLeft]="12" [routerLink]="['/fixed-asset/registration']" nzMatchRouter>资产登记</li>
<li
nz-menu-item
*appPermission="[
'api:eamAsset:add',
'api:eamAsset:update',
'api:eamAsset:delete',
'api:eamAsset:copyByNum',
'api:eamAsset:importData'
]"
[nzPaddingLeft]="12"
[routerLink]="['/fixed-asset/registration']"
nzMatchRouter
>
资产登记
</li>
<!-- nz-submenu
[nzOpen]="openedSubmenu.startsWith('/fixed-asset/manage/')" -->
<li
@ -28,6 +42,7 @@
[routerLink]="['/fixed-asset/management']"
nzMatchRouter
*appPermission="[
'api:eamManager:add',
'fixed-asset-manage:view',
'fixed-asset-manage-entry:view',
'fixed-asset-manage-distribution:view',
@ -46,14 +61,27 @@
[nzPaddingLeft]="12"
nz-submenu
nzTitle="运维管理"
*appPermission="['api:device:on', 'api:device:off', 'fixed-asset-repair-list:view']"
[nzOpen]="openedSubmenu.startsWith('/fixed-asset/maintain/')"
>
<!-- *appPermission="['maintain-record:view', 'maintain-on-off:view']" -->
<ul>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/maintain/record']" nzMatchRouter>
<li
*appPermission="['fixed-asset-repair-list:view']"
nz-menu-item
[nzPaddingLeft]="24"
[routerLink]="['/fixed-asset/maintain/record']"
nzMatchRouter
>
维修登记
</li>
<li nz-menu-item [nzPaddingLeft]="24" [routerLink]="['/fixed-asset/maintain/on-off']" nzMatchRouter>
<li
*appPermission="['api:device:on', 'api:device:off']"
nz-menu-item
[nzPaddingLeft]="24"
[routerLink]="['/fixed-asset/maintain/on-off']"
nzMatchRouter
>
开关机
</li>
</ul>
@ -264,7 +292,10 @@
'basic-maintainer:view',
'basic-save-position:view',
'basic-warehouse:view',
'fixed-asset-repair-type:view'
'fixed-asset-repair-type:view',
'api:eamBasicTeam:add',
'api:eamBasicTeam:update',
'api:eamBasicTeam:delete'
]"
>
<ul>
@ -345,7 +376,7 @@
</li>
<li
*appPermission="['fixed-asset-repair-type:view']"
*appPermission="['api:eamBasicTeam:add', 'api:eamBasicTeam:update', 'api:eamBasicTeam:delete']"
nz-menu-item
[nzPaddingLeft]="24"
[routerLink]="['/fixed-asset/basic/team']"

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save