Browse Source

流程

main
kely 1 year ago
parent
commit
d5c6776f9d
  1. 135
      web-admin-app/src/app/app.routes.ts
  2. 31
      web-admin-app/src/app/components/asset-form/asset-form.component.html
  3. 6
      web-admin-app/src/app/components/asset-form/asset-form.component.ts
  4. 6
      web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.ts
  5. 51
      web-admin-app/src/app/components/plan-task/calendar-list/calendar-list.component.html
  6. 26
      web-admin-app/src/app/components/plan-task/plan-list/plan-list.component.html
  7. 24
      web-admin-app/src/app/components/plan-task/plan-list/plan-list.component.ts
  8. 7
      web-admin-app/src/app/components/plan-task/task-form/task-form.component.ts
  9. 44
      web-admin-app/src/app/components/plan-task/task-list/task-list.component.html
  10. 22
      web-admin-app/src/app/components/plan-task/task-list/task-list.component.ts
  11. 2
      web-admin-app/src/app/components/status-tag/status-tag.component.html
  12. 6
      web-admin-app/src/app/components/status-tag/status-tag.component.ts
  13. 35
      web-admin-app/src/app/constants/index.ts
  14. 25
      web-admin-app/src/app/pages/fixed-asset/asset-management/asset-management.component.html
  15. 243
      web-admin-app/src/app/pages/fixed-asset/asset-management/asset-management.component.ts
  16. 10
      web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html
  17. 2
      web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-calendar/maintenance-calendar.component.html
  18. 12
      web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-calendar/maintenance-calendar.component.ts
  19. 2
      web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-plan/maintenance-plan.component.html
  20. 12
      web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-plan/maintenance-plan.component.ts
  21. 2
      web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-task/maintenance-task.component.html
  22. 12
      web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-task/maintenance-task.component.ts
  23. 2
      web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-calendar/stocktaking-calendar.component.html
  24. 12
      web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-calendar/stocktaking-calendar.component.ts
  25. 2
      web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-plan/stocktaking-plan.component.html
  26. 12
      web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-plan/stocktaking-plan.component.ts
  27. 2
      web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-task/stocktaking-task.component.html
  28. 12
      web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-task/stocktaking-task.component.ts
  29. 18
      web-admin-app/src/app/pages/flow/flow-layout/flow-layout.component.html
  30. 5
      web-admin-app/src/app/pages/flow/flow-main/flow-main.component.ts
  31. 1
      web-admin-app/src/app/pages/flow/flow-management/flow-management.component.html
  32. 0
      web-admin-app/src/app/pages/flow/flow-management/flow-management.component.less
  33. 12
      web-admin-app/src/app/pages/flow/flow-management/flow-management.component.ts
  34. 1
      web-admin-app/src/app/pages/flow/flow-report/flow-report.component.html
  35. 0
      web-admin-app/src/app/pages/flow/flow-report/flow-report.component.less
  36. 12
      web-admin-app/src/app/pages/flow/flow-report/flow-report.component.ts
  37. 44
      web-admin-app/src/app/pages/msg/flow-msg/flow-msg.component.html
  38. 0
      web-admin-app/src/app/pages/msg/flow-msg/flow-msg.component.less
  39. 57
      web-admin-app/src/app/pages/msg/flow-msg/flow-msg.component.ts
  40. 67
      web-admin-app/src/app/pages/msg/msg-layout/msg-layout.component.html
  41. 0
      web-admin-app/src/app/pages/msg/msg-layout/msg-layout.component.less
  42. 24
      web-admin-app/src/app/pages/msg/msg-layout/msg-layout.component.ts
  43. 44
      web-admin-app/src/app/pages/msg/system-log/system-log.component.html
  44. 0
      web-admin-app/src/app/pages/msg/system-log/system-log.component.less
  45. 56
      web-admin-app/src/app/pages/msg/system-log/system-log.component.ts
  46. 6
      web-admin-app/src/app/pages/system/system-address/system-address.component.html
  47. 10
      web-admin-app/src/app/services/api.service.ts
  48. 2
      web-admin-app/src/app/shared/components/header/header.component.html
  49. 26
      web-admin-app/src/app/shared/components/upload/upload.component.html
  50. 22
      web-admin-app/src/app/shared/components/upload/upload.component.ts

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

@ -80,6 +80,11 @@ import { MaintenancePlanComponent } from './pages/fixed-asset/plan-task/maintena
import { StocktakingPlanComponent } from './pages/fixed-asset/plan-task/stocktaking-plan/stocktaking-plan.component' import { StocktakingPlanComponent } from './pages/fixed-asset/plan-task/stocktaking-plan/stocktaking-plan.component'
import { StocktakingTaskComponent } from './pages/fixed-asset/plan-task/stocktaking-task/stocktaking-task.component' import { StocktakingTaskComponent } from './pages/fixed-asset/plan-task/stocktaking-task/stocktaking-task.component'
import { StocktakingCalendarComponent } from './pages/fixed-asset/plan-task/stocktaking-calendar/stocktaking-calendar.component' import { StocktakingCalendarComponent } from './pages/fixed-asset/plan-task/stocktaking-calendar/stocktaking-calendar.component'
import { FlowMsgComponent } from './pages/msg/flow-msg/flow-msg.component'
import { SystemLogComponent } from './pages/msg/system-log/system-log.component'
import { MsgLayoutComponent } from './pages/msg/msg-layout/msg-layout.component'
import { FlowManagementComponent } from './pages/flow/flow-management/flow-management.component'
import { FlowReportComponent } from './pages/flow/flow-report/flow-report.component'
export const routes: Routes = [ export const routes: Routes = [
{ {
@ -654,57 +659,11 @@ export const routes: Routes = [
// }, // },
// ], // ],
// }, // },
{
path: 'alert',
title: '预警中心',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'borrow',
},
{
path: 'borrow',
component: AlertBorrowComponent,
title: '借用预警',
},
{
path: 'maintenance',
component: AlertMaintenanceComponent,
title: '维保到期预警',
},
{
path: 'inventory',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'safety',
},
{
path: 'safety',
component: AlertInventorySafetyComponent,
title: '安全库存预警',
},
{
path: 'up',
component: AlertInventoryUpComponent,
title: '安全库存上限',
},
{
path: 'down',
component: AlertInventoryDownComponent,
title: '安全库存下限',
},
],
},
],
},
], ],
}, },
{ {
path: 'asset-flow', path: 'asset-flow',
title: '资流程', title: '资产流程',
component: FlowLayoutComponent, component: FlowLayoutComponent,
data: { data: {
permission: { permission: {
@ -753,6 +712,88 @@ export const routes: Routes = [
title: '我已处理', title: '我已处理',
component: FlowMyFinishedComponent, component: FlowMyFinishedComponent,
}, },
{
path: 'management',
title: '流程管理',
component: FlowManagementComponent,
},
{
path: 'report',
title: '工作报表',
component: FlowReportComponent,
},
],
},
{
path: 'msg',
title: '消息中心',
component: MsgLayoutComponent,
children: [
{
path: '403',
component: ForbiddenComponent,
},
{
path: '',
redirectTo: 'flow',
pathMatch: 'full',
},
{
path: 'flow',
component: FlowMsgComponent,
title: '流程消息',
},
{
path: 'log',
component: SystemLogComponent,
title: '系统日志',
},
{
path: 'alert',
title: '预警中心',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'borrow',
},
{
path: 'borrow',
component: AlertBorrowComponent,
title: '借用超期预警',
},
{
path: 'maintenance',
component: AlertMaintenanceComponent,
title: '维保到期预警',
},
{
path: 'inventory',
children: [
{
path: '',
pathMatch: 'full',
redirectTo: 'safety',
},
{
path: 'safety',
component: AlertInventorySafetyComponent,
title: '安全库存预警',
},
{
path: 'up',
component: AlertInventoryUpComponent,
title: '安全库存上限',
},
{
path: 'down',
component: AlertInventoryDownComponent,
title: '安全库存下限',
},
],
},
],
},
], ],
}, },
], ],

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

@ -12,6 +12,10 @@
<nz-tab nzTitle="巡检记录"></nz-tab> --> <nz-tab nzTitle="巡检记录"></nz-tab> -->
<nz-tab nzTitle="历史记录"></nz-tab> <nz-tab nzTitle="历史记录"></nz-tab>
<nz-tab nzTitle="维修记录"></nz-tab> <nz-tab nzTitle="维修记录"></nz-tab>
<nz-tab nzTitle="巡检记录"></nz-tab>
<nz-tab nzTitle="保养记录"></nz-tab>
<nz-tab nzTitle="盘点记录"></nz-tab>
<nz-tab nzTitle="运行统计"></nz-tab>
} }
</nz-tabset> </nz-tabset>
</nz-card-tab> </nz-card-tab>
@ -186,6 +190,30 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>资产图片</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<app-upload [drag]="true" formControlName="img" />
</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">
<app-upload [drag]="true" formControlName="userManual" />
</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">
<app-upload [drag]="true" formControlName="maintenanceManual" />
</nz-form-control>
</nz-form-item>
</div>
</div> </div>
<div formArrayName="_extInfo"> <div formArrayName="_extInfo">
@if (extraFields.length > 0) { @if (extraFields.length > 0) {
@ -482,6 +510,9 @@
@case (7) { @case (7) {
<app-asset-operation-records /> <app-asset-operation-records />
} }
@case (8) {
<app-asset-operation-records />
}
} }
} }
</nz-card> </nz-card>

6
web-admin-app/src/app/components/asset-form/asset-form.component.ts

@ -15,6 +15,7 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { AssetOperationRecordsComponent } from '../asset-operation-records/asset-operation-records.component' import { AssetOperationRecordsComponent } from '../asset-operation-records/asset-operation-records.component'
import { AssetRepairRecordsComponent } from '../asset-repair-records/asset-repair-records.component' import { AssetRepairRecordsComponent } from '../asset-repair-records/asset-repair-records.component'
import { UploadComponent } from '../../shared/components/upload/upload.component'
@Component({ @Component({
selector: 'app-asset-form', selector: 'app-asset-form',
@ -29,6 +30,7 @@ import { AssetRepairRecordsComponent } from '../asset-repair-records/asset-repai
MaintenanceSelectComponent, MaintenanceSelectComponent,
AssetOperationRecordsComponent, AssetOperationRecordsComponent,
AssetRepairRecordsComponent, AssetRepairRecordsComponent,
UploadComponent,
], ],
templateUrl: './asset-form.component.html', templateUrl: './asset-form.component.html',
styleUrl: './asset-form.component.less', styleUrl: './asset-form.component.less',
@ -108,6 +110,10 @@ export class AssetFormComponent implements OnInit {
totalAmountPrice: this.fb.control(null, []), totalAmountPrice: this.fb.control(null, []),
registerDate: this.fb.control(null, []), registerDate: this.fb.control(null, []),
maintenanceManual: this.fb.control(null, []),
userManual: this.fb.control(null, []),
img: this.fb.control(null, []),
_extInfo: this.fb.array([]), _extInfo: this.fb.array([]),
}) })

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

@ -8,6 +8,7 @@ import { NzButtonModule } from 'ng-zorro-antd/button'
import { NzSafeAny } from 'ng-zorro-antd/core/types' import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer' import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer'
import { NzDropDownModule } from 'ng-zorro-antd/dropdown' import { NzDropDownModule } from 'ng-zorro-antd/dropdown'
import { NzIconModule } from 'ng-zorro-antd/icon'
import { NzInputModule } from 'ng-zorro-antd/input' import { NzInputModule } from 'ng-zorro-antd/input'
import { NzMessageService } from 'ng-zorro-antd/message' import { NzMessageService } from 'ng-zorro-antd/message'
import { NzModalService } from 'ng-zorro-antd/modal' import { NzModalService } from 'ng-zorro-antd/modal'
@ -62,6 +63,7 @@ export function buildCateTree(organizations: CateGoryInterface[]): NzTreeNodeOpt
NzDropDownModule, NzDropDownModule,
NzTreeModule, NzTreeModule,
NzInputModule, NzInputModule,
NzIconModule,
CommonModule, CommonModule,
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
@ -83,6 +85,8 @@ export class ComponentBasicCategoryTreeComponent {
@Output() onSelectedChange = new EventEmitter<NzSafeAny>() @Output() onSelectedChange = new EventEmitter<NzSafeAny>()
@Input() defaultName?: string = '新分类'
drawerRef?: NzDrawerRef drawerRef?: NzDrawerRef
searchValue = '' searchValue = ''
@ -138,7 +142,7 @@ export class ComponentBasicCategoryTreeComponent {
safetyLimit: 0, safetyLimit: 0,
upperLimit: 0, upperLimit: 0,
parentId, parentId,
categoryName: '新分类', categoryName: this.defaultName,
}) })
.subscribe((res) => { .subscribe((res) => {
this.expandedKeys.push(String(parentId)) this.expandedKeys.push(String(parentId))

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

@ -1,4 +1,54 @@
<app-page> <app-page>
<form nz-form>
<div class="flex mt-2">
<div class="flex-1">
<div nz-row [nzGutter]="12">
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label>任务状态</nz-form-label>
<nz-form-control>
<nz-select nzShowSearch nzPlaceHolder="请选择" nzAllowClear>
<nz-option nzLabel="全部" nzValue="全部"></nz-option>
<nz-option nzLabel="审批中" nzValue="审批中"></nz-option>
<nz-option nzLabel="已完结" nzValue="进行中"></nz-option>
<nz-option nzLabel="已挂起" nzValue="已结束/" />
<nz-option nzLabel="被驳回" nzValue="已结束/" />
<nz-option nzLabel="已撤回" nzValue="已结束/" />
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label>计划名称</nz-form-label>
<nz-form-control>
<input nz-input placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<nz-form-item>
<nz-form-label>创建方式</nz-form-label>
<nz-form-control>
<nz-select nzShowSearch nzPlaceHolder="请选择" nzAllowClear>
<nz-option nzLabel="全部" nzValue="全部"></nz-option>
<nz-option nzLabel="计划创建" nzValue="审批中"></nz-option>
<nz-option nzLabel="手动创建" nzValue="进行中"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
</div>
<div class="">
<nz-space>
<button *nzSpaceItem nz-button type="button" nzType="primary">查询</button>
<button *nzSpaceItem nz-button>重置</button>
</nz-space>
</div>
</div>
</form>
<nz-card>
<nz-calendar [(ngModel)]="date" [(nzMode)]="mode" (nzPanelChange)="panelChange($event)"> <nz-calendar [(ngModel)]="date" [(nzMode)]="mode" (nzPanelChange)="panelChange($event)">
<ul *nzDateCell="let date" class="events"> <ul *nzDateCell="let date" class="events">
@switch (date.getDate()) { @switch (date.getDate()) {
@ -34,4 +84,5 @@
} }
</ng-container> </ng-container>
</nz-calendar> </nz-calendar>
</nz-card>
</app-page> </app-page>

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

@ -16,10 +16,30 @@
<ng-template #renderColumnTpl let-data let-key="key" let-row="row"> <ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) { @switch (key) {
@case ('status') { @case ('status') {
<app-status-tag [status]="data" /> @switch (data) {
@case ('1') {
<nz-badge nzText="暂停" nzStatus="default"></nz-badge>
}
@case ('0') {
<nz-badge nzText="正常" nzStatus="success"></nz-badge>
}
}
}
@case ('cycleType') {
@switch (data) {
@case ('day') {
<label>每天 </label>
}
@case ('week') {
<label>每周 </label>
}
@case ('month') {
<label>每月</label>
}
@case ('once') {
<label>单任务</label>
}
} }
@case ('_value') {
{{ data?.length ?? 0 }}
} }
@default { @default {

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

@ -48,16 +48,16 @@ export class PlanListComponent {
this.table this.table
.setColumn([ .setColumn([
{ key: 'teamKey', title: '计划编号', visible: true }, { key: 'businessId', title: '计划编号', width: '170px', visible: true },
{ key: 'teamName', title: '计划名称', visible: true }, { key: 'name', title: '计划名称', visible: true },
{ key: 'status', title: '计划状态', visible: true }, { key: 'status', title: '计划状态', width: '100px', visible: true },
{ key: 'createUser', title: '执行计划', visible: true }, { key: 'teamName', title: '执行班组', visible: true },
{ key: 'createTime', title: '开始时间', visible: true }, { key: 'expectedStartTime', title: '开始时间', visible: true },
{ key: 'createTime', title: '截止时间', visible: true }, { key: 'expectedFinishTime', title: '截止时间', visible: true },
{ key: 'createTime', title: '执行周期', visible: true }, { key: 'cycleType', title: '执行周期', width: '100px', visible: true },
{ key: '_value', title: '下次执行', visible: true }, { key: 'nextExecuteTime', title: '下次执行', width: '150px', visible: true },
{ key: 'remark', title: '巡检设备数', visible: true }, { key: 'count', title: '巡检设备数', width: '100px', visible: true },
]) ])
.setRowOperate([ .setRowOperate([
{ {
@ -75,11 +75,9 @@ export class PlanListComponent {
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
return this.api.getPlanPage({ ...p, ...q, platType: this.type }) return this.api.getPlanPage({ ...p, ...q, planType: this.type })
} }
onCopy(data: NzSafeAny) {}
onCreate(data?: NzSafeAny, preview?: boolean) { onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑计划' : '添加计划' let nzTitle = data ? '编辑计划' : '添加计划'
if (preview) { if (preview) {

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

@ -68,13 +68,18 @@ export class TaskFormComponent {
}) })
this.formGroup = this.fb.group({ this.formGroup = this.fb.group({
teamId: this.fb.control(null, []),
name: this.fb.control(null, [FormValidators.required('请输入')]), name: this.fb.control(null, [FormValidators.required('请输入')]),
remark: this.fb.control(null, []), remark: this.fb.control(null, []),
plannedDate: this.fb.control(null, [FormValidators.required('请选择')]), // plannedDate: this.fb.control(null, [FormValidators.required('请选择')]),
actualStartTime: this.fb.control(null, []),
businessId: this.fb.control(null, []), businessId: this.fb.control(null, []),
attachment: this.fb.control(null, []), attachment: this.fb.control(null, []),
duration: this.fb.control(null, []),
order: this.fb.control(false, []),
limit: this.fb.control(false, []),
img: this.fb.control(null, []), img: this.fb.control(null, []),
assetIdList: this.fb.control([], []), assetIdList: this.fb.control([], []),

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

@ -10,10 +10,48 @@
<ng-template #renderColumnTpl let-data let-key="key" let-row="row"> <ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) { @switch (key) {
@case ('status') { @case ('status') {
<app-status-tag [status]="data" /> @switch (data) {
<!-- APPROVAL,COMPLETED,DISCARDED,DRAFTING,EXCEPTION,REJECTED,SUSPENDED,TO_BE_ASSIGNED -->
@case ('APPROVAL') {
<span class="text-blue-500">待处理</span>
} }
@case ('_value') { @case ('COMPLETED') {
{{ data?.length ?? 0 }} <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 ('SUSPENDED') {
<span class="text-yellow-500">已挂起</span>
}
@case ('TO_BE_ASSIGNED') {
<span class="text-yellow-500">待分配</span>
}
@default {
{{ data }}
}
}
}
@case ('finished') {
{{ (row.total ?? 0) - (row.unfinished ?? 0) }}
}
@case ('unfinished') {
{{ data ?? '-' }}
}
@case ('total') {
{{ data ?? '-' }}
}
@case ('actualFinishTime') {
{{ data ?? '-' }}
} }
@default { @default {

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

@ -48,17 +48,17 @@ export class TaskListComponent {
this.table this.table
.setColumn([ .setColumn([
{ key: 'teamKey', title: '任务名称', visible: true }, { key: 'name', title: '任务名称', visible: true },
{ key: 'teamName', title: '任务状态', visible: true }, { key: 'status', title: '任务状态', width: '120px', visible: true },
{ key: 'status', title: '任务来源', visible: true }, { key: 'createType', title: '任务来源', width: '120px', visible: true },
{ key: 'createUser', title: '开始时间', visible: true }, { key: 'actualStartTime', title: '开始时间', visible: true },
{ key: 'createTime', title: '任务时长', visible: true }, { key: 'duration', title: '任务时长', width: '80px', visible: true },
{ key: 'createTime', title: '完成时间', visible: true }, { key: 'actualFinishTime', title: '完成时间', visible: true },
{ key: 'createTime', title: '设备总数', visible: true }, { key: 'total', title: '设备总数', width: '100px', visible: true },
{ key: '_value', title: '待处理设备数', visible: true }, { key: 'unfinished', title: '待处理设备数', width: '100px', visible: true },
{ key: 'remark', title: '已处理设备数', visible: true }, { key: 'finished', title: '已处理设备数', width: '100px', visible: true },
{ key: 'remark', title: '执行班组', visible: true }, { key: 'teamName', title: '执行班组', visible: true },
]) ])
.setRowOperate([ .setRowOperate([
{ {

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

@ -1,4 +1,4 @@
@switch (status) { @switch (s) {
@case (0) { @case (0) {
<nz-badge nzText="停用" nzStatus="default"></nz-badge> <nz-badge nzText="停用" nzStatus="default"></nz-badge>
} }

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

@ -11,7 +11,11 @@ import { NzBadgeModule } from 'ng-zorro-antd/badge'
export class StatusTagComponent { export class StatusTagComponent {
constructor() {} constructor() {}
@Input() status: number = 0 @Input() status: number | string = 0
get s() {
return Number(this.status)
}
ngOnInit() {} ngOnInit() {}
} }

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

@ -127,3 +127,38 @@ export const taskTypeTitle = new Map<PlanTaskType, string>([
['repair', '报修'], ['repair', '报修'],
['stocktaking', '盘点'], ['stocktaking', '盘点'],
]) ])
// 业务类型:ALLOCATE-资产调拨,BORROW-资产借用,COLLECTION-资产领用,OUTBOUND-资产出库,
// RETURN-资产归还,RETURN_INVENTORY-资产退库,STORAGE-资产入库"),\n TRANSFER("transfer", "资产转移"),
// REPAIR_FAULT("repair_fault", "故障登记"),\n REPAIR("repair", "设备报修"),\n
// RETIREMENT("retirement", "资产报废"),\n
// CLEAN("clean", "资产清理"),\n
// UNKNOWN("null", "未知操作");
export const businessType = new Map([
['ALLOCATE', '资产调拨'],
['BORROW', '资产借用'],
['COLLECTION', '资产领用'],
['OUTBOUND', '资产出库'],
['RETURN', '资产归还'],
['RETURN_INVENTORY', '资产退库'],
['STORAGE', '资产入库'],
['TRANSFER', '资产转移'],
['REPAIR_FAULT', '故障登记'],
['REPAIR', '设备报修'],
['RETIREMENT', '资产报废'],
['CLEAN', '资产清理'],
['UNKNOWN', '未知操作'],
])
// APPROVAL,COMPLETED,DISCARDED,DRAFTING,EXCEPTION,REJECTED,SUSPENDED,TO_BE_ASSIGNED
export const flowStatus = new Map([
['APPROVAL', '审批中'],
['COMPLETED', '已完成'],
['DISCARDED', '已废弃'],
['DRAFTING', '起草中'],
['EXCEPTION', '流程异常'],
['REJECTED', '已驳回'],
['SUSPENDED', '已挂起'],
['TO_BE_ASSIGNED', '待分配'],
])

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

@ -1,9 +1,22 @@
<app-page> <app-page>
<ng-template #actionTpl> <ng-template #actionTpl>
<nz-space> <nz-space>
<button *nzSpaceItem nz-button nzType="primary" (click)="onCreate()"> <button *nzSpaceItem nz-button nzType="primary" nz-dropdown [nzDropdownMenu]="menu">
<span>新建流程</span> <span>新建流程</span>
<span nz-icon nzType="down" nzTheme="outline"></span>
</button> </button>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li nz-menu-item (click)="onEntry()">资产入库</li>
<li nz-menu-item (click)="onDistribution()">资产领用</li>
<li nz-menu-item (click)="onReturn()">资产退库</li>
<li nz-menu-item (click)="onBorrow()">资产借用</li>
<li nz-menu-item (click)="onRevert()">资产归还</li>
<li nz-menu-item (click)="onAllot()">资产调拨</li>
<li nz-menu-item (click)="onTransfer()">资产转移</li>
<li nz-menu-item (click)="onScrap()">资产报废</li>
</ul>
</nz-dropdown-menu>
</nz-space> </nz-space>
</ng-template> </ng-template>
<div class="flex-1 overflow-hidden"> <div class="flex-1 overflow-hidden">
@ -20,8 +33,10 @@
{{ ASSET_STATUS_MAP[data] }} {{ ASSET_STATUS_MAP[data] }}
</nz-tag> </nz-tag>
} }
@case ('_useUser') { @case ('type') {
{{ data?.userName ?? '-' }} <nz-tag>
{{ businessType.get(data) }}
</nz-tag>
} }
@case ('_warehouse') { @case ('_warehouse') {
{{ data?.name ?? '-' }} {{ data?.name ?? '-' }}
@ -54,7 +69,7 @@
nzPlacement="bottomRight" nzPlacement="bottomRight"
class="!w-24" class="!w-24"
[nzDropdownMatchSelectWidth]="false" [nzDropdownMatchSelectWidth]="false"
formControlName="model" formControlName="type"
nzAllowClear nzAllowClear
> >
<nz-option nzLabel="所有分类" nzValue=""></nz-option> <nz-option nzLabel="所有分类" nzValue=""></nz-option>
@ -65,7 +80,7 @@
<input nz-input placeholder="请输入" formControlName="assetCode" /> <input nz-input placeholder="请输入" formControlName="assetCode" />
</app-query-item> </app-query-item>
<app-query-item label="流程名称"> <app-query-item label="流程名称">
<input nz-input placeholder="请输入" formControlName="model" /> <input nz-input placeholder="请输入" formControlName="name" />
</app-query-item> </app-query-item>
</ng-container> </ng-container>
</app-server-paginated-table> </app-server-paginated-table>

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

@ -6,11 +6,23 @@ import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module' import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns' import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs' import { lastValueFrom, of } from 'rxjs'
import { AssetFormComponent, ManufacturerSelectComponent, PositionSelectComponent } from 'app/components' import {
AssetBusinessAllotFormComponent,
AssetBusinessBorrowFormComponent,
AssetBusinessCollectionComponent,
AssetBusinessRetirementComponent,
AssetBusinessReturnFormComponent,
AssetBusinessRevertFormComponent,
AssetBusinessStorageFormComponent,
AssetBusinessTransferFormComponent,
AssetFormComponent,
ManufacturerSelectComponent,
PositionSelectComponent,
} from 'app/components'
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal' import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message' import { NzMessageService } from 'ng-zorro-antd/message'
import { NzSafeAny } from 'ng-zorro-antd/core/types' import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP, ASSET_TYPE } from 'app/constants' import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP, ASSET_TYPE, businessType } from 'app/constants'
import { Utils } from 'app/utils' import { Utils } from 'app/utils'
@Component({ @Component({
@ -29,7 +41,7 @@ export class AssetManagementComponent {
queryForm = new FormGroup({ queryForm = new FormGroup({
name: new FormControl(), name: new FormControl(),
model: new FormControl(), type: new FormControl(),
status: new FormControl(), status: new FormControl(),
assetCode: new FormControl(), assetCode: new FormControl(),
serialNumber: new FormControl(), serialNumber: new FormControl(),
@ -48,6 +60,8 @@ export class AssetManagementComponent {
ASSET_TYPE = ASSET_TYPE ASSET_TYPE = ASSET_TYPE
businessType = businessType
ngOnInit(): void { ngOnInit(): void {
this.table this.table
.setConfig({ .setConfig({
@ -55,44 +69,115 @@ export class AssetManagementComponent {
rowKey: 'assetId', rowKey: 'assetId',
}) })
.setColumn([ .setColumn([
{ key: 'assetCode', title: '业务编号', visible: true }, { key: 'businessId', title: '业务编号', visible: true },
{ key: 'name', title: '流程名称', visible: true }, { key: 'name', title: '流程名称', visible: true },
{ key: '_category', title: '流程类型', visible: true }, { key: 'type', title: '流程类型', visible: true },
{ key: 'status', title: '流程状态', visible: true }, { key: 'status', title: '流程状态', visible: true },
{ key: '_ownCompany', title: '紧急程度', visible: true }, { key: '_ownCompany', title: '紧急程度', visible: true },
{ key: '_useOrganization', title: '发起人', visible: true }, { key: '_useOrganization', title: '发起人', visible: true },
{ key: '_position', title: '创建时间', visible: true }, { key: 'createTime', title: '创建时间', visible: true },
{ key: '_position', title: '当前节点', visible: true }, { key: '_position', title: '当前节点', visible: true },
{ key: '_position', title: '备注', visible: true }, { key: '_position', title: '备注', visible: true },
]) ])
.setRowOperate([ // .setRowOperate([
{ // { title: '二维码', onClick: this.qrcode.bind(this) },
title: '查看', // { title: '删除', onClick: this.deleteItem.bind(this) },
onClick: (v) => { // ])
this.onCreate(v, true)
},
},
{ title: '修改', onClick: this.onCreate.bind(this) },
{ title: '复制', onClick: this.onCopy.bind(this) },
{ title: '二维码', onClick: this.qrcode.bind(this) },
{ title: '删除', onClick: this.deleteItem.bind(this) },
])
} }
fetchData(p: {}, q: AnyObject) { fetchData(p: {}, q: AnyObject) {
return this.api.getAssetManagerPage({ ...p, ...q }) return this.api.getAssetManagerPage({ ...p, ...q })
} }
onCopy(data: NzSafeAny) {} onEntry(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产入库' : '添加资产入库'
if (preview) {
nzTitle = '预览资产入库'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessStorageFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
preview,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(this.api.saveBusinessStorage(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
})
}
onDistribution(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产领用' : '添加资产领用'
if (preview) {
nzTitle = '预览资产领用'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessCollectionComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
preview,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(this.api.saveBusinessCollection(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
})
}
onReturn(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产退库' : '添加资产退库'
if (preview) {
nzTitle = '预览资产退库'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessReturnFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
preview,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(this.api.saveBusinessReturnInventory(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
onCreate(data?: NzSafeAny, preview?: boolean) { return false
let nzTitle = data ? '编辑资产' : '添加资产' },
})
}
onBorrow(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产借用' : '添加资产借用'
if (preview) { if (preview) {
nzTitle = '预览资产' nzTitle = '预览资产借用'
} }
this.modal.create({ this.modal.create({
nzTitle, nzTitle,
nzContent: AssetFormComponent, nzContent: AssetBusinessBorrowFormComponent,
nzWidth: '80vw', nzWidth: '80vw',
nzWrapClassName: 'modal-lg', nzWrapClassName: 'modal-lg',
nzData: { nzData: {
@ -102,7 +187,7 @@ export class AssetManagementComponent {
nzOnOk: async (e) => { nzOnOk: async (e) => {
const vals = e.getValues() const vals = e.getValues()
if (vals) { if (vals) {
const res = await lastValueFrom(this.api.saveAsset(vals)) const res = await lastValueFrom(this.api.saveBusinessBorrow(vals))
this.msg.success(res.desc) this.msg.success(res.desc)
this.table.ref.reload() this.table.ref.reload()
return true return true
@ -112,7 +197,117 @@ export class AssetManagementComponent {
}, },
}) })
} }
onAllot(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产调拨' : '添加资产调拨'
if (preview) {
nzTitle = '预览资产调拨'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessAllotFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
preview,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(this.api.saveBusinessAllocate(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
})
}
onTransfer(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产转移' : '添加资产转移'
if (preview) {
nzTitle = '预览资产转移'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessTransferFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
preview,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(this.api.saveBusinessTransfer(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
})
}
onScrap(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产报废' : '添加资产报废'
if (preview) {
nzTitle = '预览资产报废'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessRetirementComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
preview,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(this.api.saveBusinessRetirement(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
})
}
onRevert(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑资产归还' : '添加资产归还'
if (preview) {
nzTitle = '预览资产归还'
}
this.modal.create({
nzTitle,
nzContent: AssetBusinessRevertFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
preview,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(this.api.saveBusinessRevert(vals))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
})
}
deleteItem(item?: NzSafeAny) { deleteItem(item?: NzSafeAny) {
const ids = item ? [item.assetId] : Array.from(this.table.ref.selected) const ids = item ? [item.assetId] : Array.from(this.table.ref.selected)
this.modal.confirm({ this.modal.confirm({

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

@ -343,15 +343,7 @@
> >
维修类型 维修类型
</li> </li>
<li
*appPermission="['fixed-asset-repair-type:view']"
nz-menu-item
[nzPaddingLeft]="24"
[routerLink]="['/fixed-asset/basic/repair-type']"
nzMatchRouter
>
维修类型
</li>
<li <li
*appPermission="['fixed-asset-repair-type:view']" *appPermission="['fixed-asset-repair-type:view']"
nz-menu-item nz-menu-item

2
web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-calendar/maintenance-calendar.component.html

@ -1 +1 @@
<p>maintenance-calendar works!</p> <app-calendar-list type="maintenance" />

12
web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-calendar/maintenance-calendar.component.ts

@ -1,12 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core'
import { CalendarListComponent } from 'app/components/plan-task/calendar-list/calendar-list.component'
import { SharedModule } from 'app/shared/shared.module'
@Component({ @Component({
selector: 'app-maintenance-calendar', selector: 'app-maintenance-calendar',
standalone: true, standalone: true,
imports: [], imports: [SharedModule, CalendarListComponent],
templateUrl: './maintenance-calendar.component.html', templateUrl: './maintenance-calendar.component.html',
styleUrl: './maintenance-calendar.component.less' styleUrl: './maintenance-calendar.component.less',
}) })
export class MaintenanceCalendarComponent { export class MaintenanceCalendarComponent {}
}

2
web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-plan/maintenance-plan.component.html

@ -1 +1 @@
<p>maintenance-plan works!</p> <app-plan-list type="maintenance" />

12
web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-plan/maintenance-plan.component.ts

@ -1,12 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core'
import { PlanListComponent } from 'app/components/plan-task/plan-list/plan-list.component'
import { SharedModule } from 'app/shared/shared.module'
@Component({ @Component({
selector: 'app-maintenance-plan', selector: 'app-maintenance-plan',
standalone: true, standalone: true,
imports: [], imports: [SharedModule, PlanListComponent],
templateUrl: './maintenance-plan.component.html', templateUrl: './maintenance-plan.component.html',
styleUrl: './maintenance-plan.component.less' styleUrl: './maintenance-plan.component.less',
}) })
export class MaintenancePlanComponent { export class MaintenancePlanComponent {}
}

2
web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-task/maintenance-task.component.html

@ -1 +1 @@
<p>maintenance-task works!</p> <app-task-list type="maintenance" />

12
web-admin-app/src/app/pages/fixed-asset/plan-task/maintenance-task/maintenance-task.component.ts

@ -1,12 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core'
import { TaskListComponent } from 'app/components/plan-task/task-list/task-list.component'
import { SharedModule } from 'app/shared/shared.module'
@Component({ @Component({
selector: 'app-maintenance-task', selector: 'app-maintenance-task',
standalone: true, standalone: true,
imports: [], imports: [SharedModule, TaskListComponent],
templateUrl: './maintenance-task.component.html', templateUrl: './maintenance-task.component.html',
styleUrl: './maintenance-task.component.less' styleUrl: './maintenance-task.component.less',
}) })
export class MaintenanceTaskComponent { export class MaintenanceTaskComponent {}
}

2
web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-calendar/stocktaking-calendar.component.html

@ -1 +1 @@
<p>stocktaking-calendar works!</p> <app-calendar-list type="stocktaking" />

12
web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-calendar/stocktaking-calendar.component.ts

@ -1,12 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core'
import { CalendarListComponent } from 'app/components/plan-task/calendar-list/calendar-list.component'
import { SharedModule } from 'app/shared/shared.module'
@Component({ @Component({
selector: 'app-stocktaking-calendar', selector: 'app-stocktaking-calendar',
standalone: true, standalone: true,
imports: [], imports: [SharedModule, CalendarListComponent],
templateUrl: './stocktaking-calendar.component.html', templateUrl: './stocktaking-calendar.component.html',
styleUrl: './stocktaking-calendar.component.less' styleUrl: './stocktaking-calendar.component.less',
}) })
export class StocktakingCalendarComponent { export class StocktakingCalendarComponent {}
}

2
web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-plan/stocktaking-plan.component.html

@ -1 +1 @@
<p>stocktaking-plan works!</p> <app-plan-list type="stocktaking" />

12
web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-plan/stocktaking-plan.component.ts

@ -1,12 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core'
import { PlanListComponent } from 'app/components/plan-task/plan-list/plan-list.component'
import { SharedModule } from 'app/shared/shared.module'
@Component({ @Component({
selector: 'app-stocktaking-plan', selector: 'app-stocktaking-plan',
standalone: true, standalone: true,
imports: [], imports: [SharedModule, PlanListComponent],
templateUrl: './stocktaking-plan.component.html', templateUrl: './stocktaking-plan.component.html',
styleUrl: './stocktaking-plan.component.less' styleUrl: './stocktaking-plan.component.less',
}) })
export class StocktakingPlanComponent { export class StocktakingPlanComponent {}
}

2
web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-task/stocktaking-task.component.html

@ -1 +1 @@
<p>stocktaking-task works!</p> <app-task-list type="stocktaking" />

12
web-admin-app/src/app/pages/fixed-asset/plan-task/stocktaking-task/stocktaking-task.component.ts

@ -1,12 +1,12 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core'
import { TaskListComponent } from 'app/components/plan-task/task-list/task-list.component'
import { SharedModule } from 'app/shared/shared.module'
@Component({ @Component({
selector: 'app-stocktaking-task', selector: 'app-stocktaking-task',
standalone: true, standalone: true,
imports: [], imports: [SharedModule, TaskListComponent],
templateUrl: './stocktaking-task.component.html', templateUrl: './stocktaking-task.component.html',
styleUrl: './stocktaking-task.component.less' styleUrl: './stocktaking-task.component.less',
}) })
export class StocktakingTaskComponent { export class StocktakingTaskComponent {}
}

18
web-admin-app/src/app/pages/flow/flow-layout/flow-layout.component.html

@ -38,6 +38,24 @@
> >
我已处理 我已处理
</li> </li>
<li
*appPermission="['asset-flow-my-finished:view']"
nz-menu-item
[nzPaddingLeft]="12"
[routerLink]="['/asset-flow/management']"
nzMatchRouter
>
流程管理
</li>
<li
*appPermission="['asset-flow-my-finished:view']"
nz-menu-item
[nzPaddingLeft]="12"
[routerLink]="['/asset-flow/report']"
nzMatchRouter
>
工作报表
</li>
</ul> </ul>
</div> </div>

5
web-admin-app/src/app/pages/flow/flow-main/flow-main.component.ts

@ -110,7 +110,10 @@ export class FlowMainComponent implements OnInit {
console.log('vals', vals) console.log('vals', vals)
if (vals) { if (vals) {
if (type === 'repair') { if (type === 'repair') {
const res = await lastValueFrom(this.api.createRapairTask(vals)) const res = await lastValueFrom(this.api.createRapairTask({ ...vals }))
this.msg.success(res.desc)
} else {
const res = await lastValueFrom(this.api.createTask({ ...vals, jobType: type }))
this.msg.success(res.desc) this.msg.success(res.desc)
} }

1
web-admin-app/src/app/pages/flow/flow-management/flow-management.component.html

@ -0,0 +1 @@
<p>flow-management works!</p>

0
web-admin-app/src/app/pages/flow/flow-management/flow-management.component.less

12
web-admin-app/src/app/pages/flow/flow-management/flow-management.component.ts

@ -0,0 +1,12 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-flow-management',
standalone: true,
imports: [],
templateUrl: './flow-management.component.html',
styleUrl: './flow-management.component.less'
})
export class FlowManagementComponent {
}

1
web-admin-app/src/app/pages/flow/flow-report/flow-report.component.html

@ -0,0 +1 @@
<p>flow-report works!</p>

0
web-admin-app/src/app/pages/flow/flow-report/flow-report.component.less

12
web-admin-app/src/app/pages/flow/flow-report/flow-report.component.ts

@ -0,0 +1,12 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-flow-report',
standalone: true,
imports: [],
templateUrl: './flow-report.component.html',
styleUrl: './flow-report.component.less'
})
export class FlowReportComponent {
}

44
web-admin-app/src/app/pages/msg/flow-msg/flow-msg.component.html

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

0
web-admin-app/src/app/pages/msg/flow-msg/flow-msg.component.less

57
web-admin-app/src/app/pages/msg/flow-msg/flow-msg.component.ts

@ -0,0 +1,57 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-flow-msg',
standalone: true,
imports: [SharedModule],
templateUrl: './flow-msg.component.html',
styleUrl: './flow-msg.component.less',
})
export class FlowMsgComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
@ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}>
queryForm = new FormGroup({
logContent: new FormControl(''),
logType: new FormControl(''),
createTime: new FormControl(''),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: 'logId', title: '序号', visible: true },
{ key: 'createTime', title: '时间', visible: true },
{ key: 'logType', title: '类型', visible: true },
{ key: 'logContent', title: '内容', visible: true },
{ key: 'logContent', title: '待我处理', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getAlarmMsg({ ...p, ...q })
}
}

67
web-admin-app/src/app/pages/msg/msg-layout/msg-layout.component.html

@ -0,0 +1,67 @@
<div
class="menu bg-white shadow fixed left-0 top-12 bottom-0 z-20 w-48 flex-shrink-0 py-3 overflow-y-auto overflow-x-hidden"
>
<ul nz-menu nzMode="inline">
<li
*appPermission="['asset-flow-home:view']"
nz-menu-item
[nzPaddingLeft]="12"
[routerLink]="['/msg/flow']"
nzMatchRouter
>
流程消息
</li>
<li
nzMatchRouter
[nzPaddingLeft]="12"
nz-submenu
nzTitle="预警中心"
[nzOpen]="openedSubmenu.startsWith('/msg/alert')"
*appPermission="['stocktaking-plan:view', 'stocktaking-job:view']"
>
<ul>
<li
*appPermission="['stocktaking-plan:view']"
nz-menu-item
[nzPaddingLeft]="24"
[routerLink]="['/msg/alert/borrow']"
nzMatchRouter
>
借用超期预警
</li>
<li
*appPermission="['stocktaking-job:view']"
nz-menu-item
[nzPaddingLeft]="24"
[routerLink]="['/msg/alert/maintenance']"
nzMatchRouter
>
维保到期预警
</li>
<li
*appPermission="['stocktaking-job:view']"
nz-menu-item
[nzPaddingLeft]="24"
[routerLink]="['/msg/alert/inventory']"
nzMatchRouter
>
库存安全预警
</li>
</ul>
</li>
<li
*appPermission="['asset-flow-my-finished:view']"
nz-menu-item
[nzPaddingLeft]="12"
[routerLink]="['/msg/log']"
nzMatchRouter
>
系统日志
</li>
</ul>
</div>
<div class="pl-48 overflow-hidden">
<router-outlet></router-outlet>
</div>

0
web-admin-app/src/app/pages/msg/msg-layout/msg-layout.component.less

24
web-admin-app/src/app/pages/msg/msg-layout/msg-layout.component.ts

@ -0,0 +1,24 @@
import { Component } from '@angular/core'
import { Router } from '@angular/router'
import { SharedModule } from 'app/shared/shared.module'
@Component({
selector: 'app-flow-layout',
standalone: true,
imports: [SharedModule],
templateUrl: './msg-layout.component.html',
styleUrl: './msg-layout.component.less',
})
export class MsgLayoutComponent {
constructor(private router: Router) {
this.openedSubmenu = this.router.url
}
openedSubmenu = ''
ngOnInit(): void {}
onMenuOpenChange(open: boolean) {
this.openedSubmenu = open ? this.router.url : ''
}
}

44
web-admin-app/src/app/pages/msg/system-log/system-log.component.html

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

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

56
web-admin-app/src/app/pages/msg/system-log/system-log.component.ts

@ -0,0 +1,56 @@
import { Component, TemplateRef, ViewChild } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { format } from 'date-fns'
import { lastValueFrom, of } from 'rxjs'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { BUSINESS_STATUS_MAP } from 'app/constants'
import { FormValidators } from 'app/utils'
@Component({
selector: 'app-alert-borrow',
standalone: true,
imports: [SharedModule],
templateUrl: './system-log.component.html',
styleUrl: './system-log.component.less',
})
export class SystemLogComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
@ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}>
queryForm = new FormGroup({
logContent: new FormControl(''),
logType: new FormControl(''),
createTime: new FormControl(''),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: 'logId', title: '序号', visible: true },
{ key: 'createTime', title: '时间', visible: true },
{ key: 'logType', title: '类型', visible: true },
{ key: 'logContent', title: '内容', visible: true },
])
}
fetchData(p: {}, q: AnyObject) {
return this.api.getSysLog({ ...p, ...q })
}
}

6
web-admin-app/src/app/pages/system/system-address/system-address.component.html

@ -1,7 +1,11 @@
<app-page class="p-3"> <app-page class="p-3">
<div class="flex flex-1"> <div class="flex flex-1">
<nz-card [nzBordered]="false" class="org shadow" nzSize="small"> <nz-card [nzBordered]="false" class="org shadow" nzSize="small">
<app-component-basic-category-tree #treeEl (onSelectedChange)="onSelectedChange($event)" /> <app-component-basic-category-tree
#treeEl
[defaultName]="'新地址'"
(onSelectedChange)="onSelectedChange($event)"
/>
</nz-card> </nz-card>
<div class="flex-1 pl-3"> <div class="flex-1 pl-3">
<nz-card [nzBordered]="false" nzTitle="地址信息"> <nz-card [nzBordered]="false" nzTitle="地址信息">

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

@ -667,4 +667,14 @@ export class ApiService {
createRapairTask(data: {}) { createRapairTask(data: {}) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/start/repair`, data) return this.http.post<JwResponse>(`/api/v2/flowable/device/start/repair`, data)
} }
createTask(data: {}) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/start`, data)
}
getSysLog(data: {}) {
return this.http.post<JwResponse>('/api/v2/sysLog/list', data)
}
getAlarmMsg(data: {}) {
return this.http.post<JwResponse>('/api/v2/alarm/list', data)
}
} }

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

@ -65,7 +65,7 @@
<a routerLink="/system" routerLinkActive="active">系统管理</a> <a routerLink="/system" routerLinkActive="active">系统管理</a>
</li> </li>
<li class="nav-item" *appPermission="['system-user:view', 'system-role:view', 'system-flow-form:view']"> <li class="nav-item" *appPermission="['system-user:view', 'system-role:view', 'system-flow-form:view']">
<a routerLink="/system" routerLinkActive="active">消息中心</a> <a routerLink="/msg" routerLinkActive="active">消息中心</a>
</li> </li>
</ul> </ul>

26
web-admin-app/src/app/shared/components/upload/upload.component.html

@ -1,4 +1,5 @@
@if (drag) { @if (!disabled) {
@if (drag) {
<div <div
class="dropUpload flex justify-center items-center h-full" class="dropUpload flex justify-center items-center h-full"
(drop)="handleDrop($event)" (drop)="handleDrop($event)"
@ -11,23 +12,40 @@
<div>{{ placeholder }}</div> <div>{{ placeholder }}</div>
</div> </div>
</div> </div>
} @else { } @else {
<button nz-button class="upload-btn"> <button nz-button class="upload-btn">
<i nz-icon nzType="upload"></i> <i nz-icon nzType="upload"></i>
{{ placeholder }} {{ placeholder }}
<input type="file" (change)="onFileChange($event)" /> <input type="file" (change)="onFileChange($event)" />
</button> </button>
}
} }
@if (preview) { @if (preview) {
<ul class="mt-2"> <ul class="mt-2">
<li> <li>
<nz-card [nzBordered]="true" nzSize="small"> <nz-card [nzBordered]="true" nzSize="small">
<div class="flex"> <a class="flex items-center" [href]="preview.url" target="_blank">
<div> <div class="w-16 h-16 overflow-hidden flex-shrink-0 flex items-center justify-center">
@if (isImage(preview.name)) {
<img class="h-full object-cover" [src]="preview.url" />
} @else {
<i nz-icon nzType="file" class="text-4xl"></i>
}
</div>
<div class="flex-1 pl-2">
<div>{{ preview.name || preview.url }}</div> <div>{{ preview.name || preview.url }}</div>
</div> </div>
<div class="flex-shrink-0">
<a (click)="remove()">
<i nz-icon nzType="delete"></i>
</a>
</div> </div>
</a>
</nz-card> </nz-card>
</li> </li>
</ul> </ul>
} @else {
@if (disabled) {
<nz-empty></nz-empty>
}
} }

22
web-admin-app/src/app/shared/components/upload/upload.component.ts

@ -4,6 +4,7 @@ import { ApiService } from 'app/services'
import { JwResponse } from 'app/types' import { JwResponse } from 'app/types'
import { NzButtonModule } from 'ng-zorro-antd/button' import { NzButtonModule } from 'ng-zorro-antd/button'
import { NzCardModule } from 'ng-zorro-antd/card' import { NzCardModule } from 'ng-zorro-antd/card'
import { NzEmptyModule } from 'ng-zorro-antd/empty'
import { NzIconModule } from 'ng-zorro-antd/icon' import { NzIconModule } from 'ng-zorro-antd/icon'
import { NzMessageService } from 'ng-zorro-antd/message' import { NzMessageService } from 'ng-zorro-antd/message'
import { Observable } from 'rxjs' import { Observable } from 'rxjs'
@ -11,7 +12,7 @@ import { Observable } from 'rxjs'
@Component({ @Component({
selector: 'app-upload', selector: 'app-upload',
standalone: true, standalone: true,
imports: [NzIconModule, NzButtonModule, NzCardModule], imports: [NzIconModule, NzButtonModule, NzCardModule, NzEmptyModule],
templateUrl: './upload.component.html', templateUrl: './upload.component.html',
styleUrl: './upload.component.less', styleUrl: './upload.component.less',
providers: [ providers: [
@ -31,7 +32,9 @@ export class UploadComponent implements ControlValueAccessor {
@Input() placeholder = '选择文件' @Input() placeholder = '选择文件'
@Input() uploadFn: (data: FormData) => Observable<JwResponse> = this.api.upload @Input() uploadFn: (data: FormData) => Observable<JwResponse> = (d) => {
return this.api.upload(d)
}
@Output() onUpload = new EventEmitter() @Output() onUpload = new EventEmitter()
@ -39,6 +42,8 @@ export class UploadComponent implements ControlValueAccessor {
ngOnInit(): void {} ngOnInit(): void {}
disabled = false
preview: { preview: {
name: string name: string
url: string url: string
@ -72,10 +77,12 @@ export class UploadComponent implements ControlValueAccessor {
// this.createForm.get('avatar')?.setValue(res.body.fileName) // this.createForm.get('avatar')?.setValue(res.body.fileName)
this.onChange(res.body.fileName ?? file.name) this.onChange(res.body.fileName ?? file.name)
this.onUpload.emit(res.body) this.onUpload.emit(res.body)
if (!this.isImage(file.name)) {
this.preview = { this.preview = {
name: res.body.fileName ?? file.name, name: res.body.fileName ?? file.name,
url: res.body.url, url: res.body.url,
} }
}
}) })
} }
onFileChange(e: Event) { onFileChange(e: Event) {
@ -113,9 +120,14 @@ export class UploadComponent implements ControlValueAccessor {
} }
} }
remove() {
this.preview = null
this.onChange(null)
this.onUpload.emit(null)
}
onTouched = () => {} onTouched = () => {}
onChange(v: string) { onChange(v: string | null) {
console.log('upload', v) console.log('upload', v)
} }
registerOnChange(fn: any): void { registerOnChange(fn: any): void {
@ -126,5 +138,7 @@ export class UploadComponent implements ControlValueAccessor {
this.onTouched = fn this.onTouched = fn
} }
setDisabledState?(isDisabled: boolean): void {} setDisabledState?(isDisabled: boolean): void {
this.disabled = isDisabled
}
} }

Loading…
Cancel
Save