Browse Source

计划&任务

main
kely 1 year ago
parent
commit
663c9589d6
  1. 36
      web-admin-app/README.md
  2. 144
      web-admin-app/src/app/components/flow-form-v2/flow-form-v2.component.html
  3. 0
      web-admin-app/src/app/components/flow-form-v2/flow-form-v2.component.less
  4. 137
      web-admin-app/src/app/components/flow-form-v2/flow-form-v2.component.ts
  5. 68
      web-admin-app/src/app/components/plan-task/calendar-list/calendar-list.component.html
  6. 110
      web-admin-app/src/app/components/plan-task/calendar-list/calendar-list.component.ts
  7. 135
      web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.html
  8. 0
      web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.less
  9. 181
      web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.ts
  10. 208
      web-admin-app/src/app/components/plan-task/handle-task/handle-task.component.html
  11. 0
      web-admin-app/src/app/components/plan-task/handle-task/handle-task.component.less
  12. 180
      web-admin-app/src/app/components/plan-task/handle-task/handle-task.component.ts
  13. 3
      web-admin-app/src/app/components/plan-task/plan-form/plan-form.component.ts
  14. 40
      web-admin-app/src/app/components/plan-task/plan-list/plan-list.component.ts
  15. 33
      web-admin-app/src/app/components/plan-task/task-form/task-form.component.html
  16. 46
      web-admin-app/src/app/components/plan-task/task-form/task-form.component.ts
  17. 30
      web-admin-app/src/app/components/plan-task/task-list/task-list.component.html
  18. 8
      web-admin-app/src/app/components/plan-task/task-list/task-list.component.less
  19. 257
      web-admin-app/src/app/components/plan-task/task-list/task-list.component.ts
  20. 26
      web-admin-app/src/app/constants/index.ts
  21. 39
      web-admin-app/src/app/pages/fixed-asset/asset-management/asset-management.component.ts
  22. 23
      web-admin-app/src/app/pages/flow/flow-main/flow-main.component.html
  23. 41
      web-admin-app/src/app/pages/flow/flow-main/flow-main.component.ts
  24. 48
      web-admin-app/src/app/pages/flow/flow-management/flow-management.component.html
  25. 183
      web-admin-app/src/app/pages/flow/flow-management/flow-management.component.ts
  26. 2
      web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.html
  27. 4
      web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.ts
  28. 2
      web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.html
  29. 4
      web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.ts
  30. 2
      web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.html
  31. 4
      web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.ts
  32. 8
      web-admin-app/src/app/pages/msg/flow-msg/flow-msg.component.ts
  33. 34
      web-admin-app/src/app/services/api.service.ts
  34. 4
      web-admin-app/src/styles.less

36
web-admin-app/README.md

@ -90,6 +90,38 @@
# v2
## 10-10
- 日历 月份 & 类型
- 任务创建方式
- 流程首页 资管流程分析 & 资管流程 数量
- 任务处置数据 接口
- 工作报表 接口
- 流程管理 自动指派
- 消息中心 流程消息? 告警?
- 资产管理 审批 & 编辑
- 检查项 & 查看
# 修改
- 创建巡检任务 任务反馈
- 创建任务 验证
- procInsId
- 处置 & 提交审核 /api/flowable/task/complete
- 任务状态 status:
- 受理 TO_BE_ASSIGNED
- 指派 TO_BE_ASSIGNED
- 处置 DISPOSE
- 报表 COMPLETED
- 计划 停用 & 启用 /api/v2/plan/changeStatus
- 自动指派 /api/flForm/update
# 10.20
提交审核 /api/flowable/task/complete 之前必须全部执行 保存:整个任务数据
执行接口 /api/v2/flowable/device/update/{id}
<!-- defectStatus 巡检状态:0-待检,1-正常(完成),2-异常,3-取消。 盘点状态:0-待盘点,1-正常(完成),2-盘赢,3-盘亏 -->
-

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

@ -0,0 +1,144 @@
<div class="modal-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div class="text-lg mb-2">基本信息</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>流程标识</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="formKey" placeholder="请输入" />
</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">
<input nz-input formControlName="name" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>流程ID</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="deployId" placeholder="请输入" />
</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">
<input nz-input formControlName="type" placeholder="请输入" />
</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="status">
<label nz-radio [nzValue]="0">启用 </label>
<label nz-radio [nzValue]="1">禁用 </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-switch formControlName="autoAssign" />
</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">
<input nz-input formControlName="remark" placeholder="请输入" />
</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">
<nz-table nzTemplateMode nzSize="small" [nzBordered]="true">
<thead>
<tr>
<th nzWidth="100px">序号</th>
<th>流程节点</th>
<th nzWidth="250px">权限角色</th>
<th nzWidth="250px">权限人员</th>
<th>备注</th>
<th>操作</th>
</tr>
</thead>
<tbody formArrayName="nodes">
<tr *ngFor="let item of nodes.controls; let i = index" [formGroupName]="i">
<td>
<input nz-input formControlName="id" placeholder="请输入" />
</td>
<td>
<input nz-input formControlName="name" placeholder="请输入" />
</td>
<td>
<nz-select
class="!w-full"
nzMode="multiple"
formControlName="roleIds"
nzPlaceHolder="请选择"
>
<nz-option
*ngFor="let r of roles"
[nzValue]="r.roleId"
[nzLabel]="r.roleName"
></nz-option>
</nz-select>
</td>
<td>
<app-select-user-by-org formControlName="userIds" />
</td>
<td>
<input nz-input formControlName="remark" placeholder="请输入" />
</td>
<td>
<button
[disabled]="!!item.get('isDefault')?.value"
nz-button
nzDanger
nzType="text"
(click)="removeNode(i)"
>
<span nz-icon nzType="delete" nzTheme="outline"></span>
</button>
</td>
</tr>
<tr>
<td colspan="6">
<button nz-button nzBlock nzType="dashed" (click)="addNode()">
<i nz-icon nzType="plus"></i>
新增节点
</button>
</td>
</tr>
</tbody>
</nz-table>
</nz-form-control>
</nz-form-item>
</div>
</div>
</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/flow-form-v2/flow-form-v2.component.less

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

@ -0,0 +1,137 @@
import { Component, Input, OnInit, inject } from '@angular/core'
import { FormArray, 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 { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal'
import { ActivatedRoute } from '@angular/router'
import { MAX_PAGE_SIZE, STOCKTAKING_JOB_STATUS_MAP } from 'app/constants'
import {
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
SelectUserByOrgComponent,
SupplierSelectComponent,
} from 'app/components'
@Component({
selector: 'app-stocktaking-detail-form',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
],
templateUrl: './flow-form-v2.component.html',
styleUrl: './flow-form-v2.component.less',
})
export class FlowFormV2Component {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
private route: ActivatedRoute,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
roles: NzSafeAny[] = []
ngOnInit(): void {
this.api.getRolePage({ pageSize: MAX_PAGE_SIZE, pageNum: 1 }).subscribe((res) => {
this.roles = res.body.rows
})
this.formGroup = this.fb.group({
status: this.fb.control(null, [FormValidators.required('请选择')]),
autoAssign: this.fb.control(null, [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('请输入')]),
deployId: this.fb.control({ value: null, disabled: true }, [FormValidators.required('请输入')]),
type: this.fb.control({ value: null, disabled: true }, [FormValidators.required('请输入')]),
nodes: this.fb.array([]),
})
this.patchValues()
}
get nodes(): FormArray {
return this.formGroup.get('nodes') as FormArray
}
removeNode(idx: number) {
this.nodes.removeAt(idx)
}
addNode() {
this.nodes.push(
this.fb.group({
id: this.fb.control(null, [FormValidators.required('请输入')]),
isDefault: this.fb.control(false),
name: this.fb.control(null, [FormValidators.required('请输入')]),
remark: this.fb.control(null),
roleIds: this.fb.control([], [FormValidators.required('请输入')]),
userIds: this.fb.control([], [FormValidators.required('请输入')]),
}),
)
}
patchValues() {
const { value: data, preview } = this.data
if (data) {
const nodes = data?.nodes ?? []
this.nodes.clear()
nodes.forEach((node: NzSafeAny) => {
const fg = this.fb.group({
id: this.fb.control(node.id),
isDefault: this.fb.control(node.isDefault),
name: this.fb.control(node.name),
remark: this.fb.control(node.remark),
roleIds: this.fb.control(node.roleIds),
userIds: this.fb.control(node.userIds),
})
if (node.isDefault === 1) {
// fg.disable()
}
this.nodes.push(fg)
})
this.formGroup.patchValue({
...data,
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
// const nodes = this.nodes.value ?? []
// if (nodes.some((i: NzSafeAny) => !i.roleIds?.length || !i.userIds?.length || !i.name || !i.id)) {
// this.msg.error('请完善节点信息')
// return
// }
const v = this.formGroup.value
values = {
...v,
nodes: v.nodes.map((i: NzSafeAny) => {
return {
...i,
isDefault: i.isDefault ? 1 : 0,
}
}),
// assetId
}
}
return values
}
}

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

@ -1,5 +1,5 @@
<app-page>
<form nz-form>
<form nz-form [formGroup]="queryForm" (ngSubmit)="onQuery()">
<div class="flex mt-2">
<div class="flex-1">
<div nz-row [nzGutter]="12">
@ -7,13 +7,17 @@
<nz-form-item>
<nz-form-label>任务状态</nz-form-label>
<nz-form-control>
<nz-select nzShowSearch nzPlaceHolder="请选择" nzAllowClear>
<nz-select formControlName="status" 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="已结束/" />
<!-- (1-起草 2-审批中 3-已结束 4-已驳回 5-已废弃 6-流程异常 7-待指派 8-已挂起) -->
<nz-option nzLabel="起草" [nzValue]="1" />
<nz-option nzLabel="审批中" [nzValue]="2" />
<nz-option nzLabel="已结束" [nzValue]="3" />
<nz-option nzLabel="已驳回" [nzValue]="4" />
<nz-option nzLabel="已废弃" [nzValue]="5" />
<nz-option nzLabel="流程异常" [nzValue]="6" />
<nz-option nzLabel="待指派" [nzValue]="7" />
<nz-option nzLabel="已挂起" [nzValue]="8" />
</nz-select>
</nz-form-control>
</nz-form-item>
@ -22,7 +26,7 @@
<nz-form-item>
<nz-form-label>计划名称</nz-form-label>
<nz-form-control>
<input nz-input placeholder="请输入" />
<input nz-input formControlName="name" placeholder="请输入" />
</nz-form-control>
</nz-form-item>
</div>
@ -30,10 +34,15 @@
<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
nzShowSearch
formControlName="createType"
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>
@ -42,44 +51,31 @@
</div>
<div class="">
<nz-space>
<button *nzSpaceItem nz-button type="button" nzType="primary">查询</button>
<button *nzSpaceItem nz-button>重置</button>
<button *nzSpaceItem nz-button type="submit" nzType="primary">查询</button>
<button *nzSpaceItem nz-button type="reset">重置</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)"
(nzSelectChange)="nzSelectChange($event)"
>
<ul *nzDateCell="let date" class="events">
@switch (date.getDate()) {
@case (8) {
@for (item of listDataMap.eight; track $index) {
<li>
<nz-badge [nzStatus]="item.type" [nzText]="item.content"></nz-badge>
</li>
}
}
@case (10) {
@for (item of listDataMap.ten; track $index) {
@for (item of getDateData(date); track $index) {
<li>
<nz-badge [nzStatus]="item.type" [nzText]="item.content"></nz-badge>
<nz-badge [nzColor]="item.color" [nzText]="item.createType + ' ' + item.name"></nz-badge>
</li>
}
}
@case (11) {
@for (item of listDataMap.eleven; track $index) {
<li>
<nz-badge [nzStatus]="item.type" [nzText]="item.content"></nz-badge>
</li>
}
}
}
</ul>
<ng-container *nzMonthCell="let month">
@if (getMonthData(month); as monthData) {
<div class="notes-month">
<section>{{ monthData }}</section>
<span>Backlog number</span>
<span>任务</span>
</div>
}
</ng-container>

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

@ -1,7 +1,11 @@
import { Component, Input } from '@angular/core'
import { Component, inject, Input, OnInit } from '@angular/core'
import { FormControl, FormGroup } from '@angular/forms'
import { ApiService } from 'app/services'
import { SharedModule } from 'app/shared/shared.module'
import { PlanTaskType } from 'app/types'
import { NzCalendarMode } from 'ng-zorro-antd/calendar'
import { format } from 'date-fns'
import { NzSafeAny } from 'ng-zorro-antd/core/types'
@Component({
selector: 'app-calendar-list',
@ -10,45 +14,101 @@ import { NzCalendarMode } from 'ng-zorro-antd/calendar'
templateUrl: './calendar-list.component.html',
styleUrl: './calendar-list.component.less',
})
export class CalendarListComponent {
export class CalendarListComponent implements OnInit {
constructor() {}
@Input() type: PlanTaskType = 'inspection'
date = new Date(2012, 11, 21)
date = new Date()
mode: NzCalendarMode = 'month'
OnInit() {}
api = inject(ApiService)
queryForm = new FormGroup({
createType: new FormControl(),
status: new FormControl(),
name: new FormControl(),
})
ngOnInit() {
this.getData()
}
getData() {
this.api
.getCalendarData({
...this.queryForm.value,
month: this.date,
jobtype: this.type,
})
.subscribe((res) => {
this.listDataMap = res.body.map((i: NzSafeAny) => {
let color = ''
switch (i.status) {
// 1-起草 2-审批中 3-已结束 4-已驳回 5-已废弃 6-流程异常 7-待指派 8-已挂起
case 1:
color = '#ffc53d'
break
case 2:
color = '#ffc53d'
break
case 3:
color = '#52c41a'
break
case 4:
color = '#ff4d4f'
break
case 5:
color = '#ff4d4f'
break
case 6:
color = '#ff4d4f'
break
case 7:
color = '#ffc53d'
break
case 8:
color = '#ffc53d'
break
}
return {
...i,
date: format(new Date(i.createTime), 'yyyy-MM-dd'),
month: format(new Date(i.createTime), 'yyyy-MM'),
color,
}
})
})
}
panelChange(change: { date: Date; mode: string }): void {
console.log(change.date, change.mode)
}
nzSelectChange(change: NzSafeAny): void {
console.log(change)
this.getData()
}
listDataMap = []
onQuery() {
this.getData()
}
listDataMap = {
eight: [
{ type: 'warning', content: 'This is warning event.' },
{ type: 'success', content: 'This is usual event.' },
],
ten: [
{ type: 'warning', content: 'This is warning event.' },
{ type: 'success', content: 'This is usual event.' },
{ type: 'error', content: 'This is error event.' },
],
eleven: [
{ type: 'warning', content: 'This is warning event' },
{ type: 'success', content: 'This is very long usual event........' },
{ type: 'error', content: 'This is error event 1.' },
{ type: 'error', content: 'This is error event 2.' },
{ type: 'error', content: 'This is error event 3.' },
{ type: 'error', content: 'This is error event 4.' },
],
getDateData(date: Date): NzSafeAny[] {
return this.listDataMap.filter((f: NzSafeAny) => format(date, 'yyyy-MM-dd') === f.date)
}
getMonthData(date: Date): number | null {
if (date.getMonth() === 8) {
return 1394
return (
this.listDataMap.reduce((a: number, f: NzSafeAny) => {
if (format(date, 'yyyy-MM') === f.month) {
return a + 1
} else {
return a
}
return null
}, 0) || null
)
}
}

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

@ -0,0 +1,135 @@
<div class="asset-form">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label nzRequired>设备编号</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
{{ data.asset.assetCode }}
</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">
{{ data.asset.name }}
</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">
{{ data.asset.assetCode }}
</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="defectStatus">
<label nz-radio [nzValue]="0">{{ statusText[type][0] }}</label>
<label nz-radio [nzValue]="1">{{ statusText[type][1] }}</label>
<label nz-radio [nzValue]="2">{{ statusText[type][2] }}</label>
<label nz-radio [nzValue]="3">{{ statusText[type][3] }}</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-switch />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label nzRequired>{{ data.title }}总结</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="notes" placeholder="请输入总结内容" />
</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="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="attachment" />
</nz-form-control>
</nz-form-item>
</div>
</div>
<div formArrayName="_extInfo">
@if (extraFields.length > 0) {
<div class="text-lg mb-6">{{ data.title }}项目</div>
<div nz-row [nzGutter]="24">
@for (item of extraFields; track item.key) {
<div nz-col nzSpan="8" [formGroupName]="$index">
<nz-form-item>
<nz-form-label>{{ item.name }}</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
@switch (item.type) {
@case ('DATE') {
<nz-date-picker
class="!w-full"
placeholder="请输入"
[formControlName]="'value'"
/>
}
@case ('RADIO') {
<ng-container *ngIf="item?.value?.fields as fields">
<nz-radio-group [formControlName]="'value'" class="radio">
<label
*ngFor="let f of fields; let i = index"
nz-radio
[nzValue]="f"
>
{{ f }}
</label>
</nz-radio-group>
</ng-container>
}
@case ('NUMBER') {
<nz-input-number
class="!w-full"
nz-input
placeholder="请输入"
[formControlName]="'value'"
/>
}
@default {
<input
class="w-full"
nz-input
placeholder="请输入"
[formControlName]="'value'"
/>
}
}
</nz-form-control>
</nz-form-item>
</div>
}
</div>
}
</div>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>
</form>
</div>

0
web-admin-app/src/app/components/plan-task/handle-task-asset-item/handle-task-asset-item.component.less

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

@ -0,0 +1,181 @@
import { Component, Input, OnInit, ViewChild, inject } from '@angular/core'
import { FormArray, 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, MAX_PAGE_SIZE } 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 { UploadComponent } from 'app/shared/components/upload/upload.component'
import { AssetCategorySelectComponent } from 'app/components/asset-category-select/asset-category-select.component'
import { PlanTaskType } from 'app/types'
// import { AssetOperationRecordsComponent } from '../asset-operation-records/asset-operation-records.component'
// import { AssetRepairRecordsComponent } from '../asset-repair-records/asset-repair-records.component'
// import { UploadComponent } from '../../shared/components/upload/upload.component'
export const defectStatusText: Record<PlanTaskType, string[]> = {
inspection: ['待检', '正常', '异常', '取消'],
stocktaking: ['待盘点', '正常', '盘赢', '盘亏'],
maintenance: ['待保养', '正常', '异常', '取消'],
repair: [],
}
@Component({
selector: 'app-asset-form',
standalone: true,
imports: [
SharedModule,
// AssetCategorySelectComponent,
// OrgSelectComponent,
// SelectUserByOrgComponent,
// ManufacturerSelectComponent,
// PositionSelectComponent,
// MaintenanceSelectComponent,
// AssetOperationRecordsComponent,
// AssetRepairRecordsComponent,
UploadComponent,
],
templateUrl: './handle-task-asset-item.component.html',
styleUrl: './handle-task-asset-item.component.less',
})
export class HandleTaskAssetItemComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
) {}
@ViewChild('assetCategorySelect') assetCategorySelect!: AssetCategorySelectComponent
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
groupIndex = 0
ASSET_STATUS = ASSET_STATUS
ASSET_SOURCE_MAP = ASSET_SOURCE_MAP
MAINTENANCE_STATUS = MAINTENANCE_STATUS
MAINTENANCE_TYPE = MAINTENANCE_TYPE
financialCategory: NzSafeAny[] = []
flowForms: NzSafeAny[] = []
extraFields: NzSafeAny[] = []
statusText = defectStatusText
type: PlanTaskType = 'inspection'
ngOnInit(): void {
// this.api.getFlowFormList().subscribe((res) => {
// this.flowForms = res.body
// })
this.formGroup = this.fb.group({
defectStatus: this.fb.control(null, [FormValidators.required('请选择')]),
img: this.fb.control(null, []),
attachment: this.fb.control(null, []),
notes: this.fb.control(null, []),
_extInfo: this.fb.array([]),
})
this.patchValues()
this.api.getBasicFinancialCategory({}).subscribe((res) => {
this.financialCategory = res.body
})
}
get extInfo(): FormArray {
return this.formGroup.get('_extInfo') as FormArray
}
onExtraChange(v: any) {
let extraFields: NzSafeAny[] = []
try {
const formValue = this.assetCategorySelect.originTreeData.find((f) => f.categoryId === Number(v))
?._assetExtTemp
extraFields = formValue ?? []
} catch (error) {}
this.setExtraFields(extraFields)
}
ext = null
setExtraFields(fields: NzSafeAny[]) {
this.extInfo.clear()
this.extraFields = fields
.sort((a, b) => a.sort - b.sort)
.map((i) => {
let val = i.value
if (i.type === 'RADIO') {
val = i.value?.value
} else if (i.type === 'DATE') {
val = i.value ? new Date(i.value) : null
}
this.extInfo.push(
this.fb.group({
key: this.fb.control(i.key),
name: this.fb.control(i.name),
remark: this.fb.control(i.remark),
sort: this.fb.control(i.sort),
type: this.fb.control(i.type),
value: this.fb.control(val),
fields: this.fb.control(i.type === 'RADIO' ? i.value?.fields : []),
}),
)
return i
})
}
patchValues() {
const { asset: data, preview, type } = this.data
if (data) {
this.type = type
this.formGroup.patchValue({
...data,
})
this.setExtraFields(data._formValue)
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.getRawValue()
values = {
...v,
_extInfo: this.extInfo.value.map((v: any) => {
if (v.type === 'RADIO') {
return {
...v,
value: {
value: v.value,
fields: v.fields.map((i: string) => i),
},
}
}
return v
}),
}
}
return values
}
}

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

@ -0,0 +1,208 @@
<div class="modal-lg-container">
<form nz-form [formGroup]="formGroup" nzLayout="vertical">
<div class="overflow-hidden">
<div class="text-lg mb-2">基本信息</div>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>任务名称</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input formControlName="name" placeholder="请输入" />
</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">
<input nz-input formControlName="businessId" placeholder="请输入" />
</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-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]="8">
<nz-form-item>
<nz-form-label>预计开始</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<nz-date-picker class="!w-full" nzShowTime formControlName="expectedStartTime" />
</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-date-picker class="!w-full" nzShowTime formControlName="expectedFinishTime" />
</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-input-group nzAddOnAfter="天">
<nz-input-number class="!w-full" [nzMin]="0" formControlName="duration" />
</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-control [nzErrorTip]="errorTpl">
<nz-date-picker class="!w-full" nzShowTime formControlName="actualStartTime" />
</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-date-picker class="!w-full" nzShowTime formControlName="actualStartTime" />
</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">
@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 }}
}
}
</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">
<input nz-input placeholder="请输入" formControlName="feedback" />
</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">
<input nz-input placeholder="请输入" formControlName="remark" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="24">
<div class="text-lg mb-2">{{ title }}设备</div>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>
<!-- <nz-form-label>资产列表</nz-form-label> -->
<nz-form-control [nzErrorTip]="errorTpl">
<nz-table nzTemplateMode [nzBordered]="true" nzSize="small">
<thead>
<tr>
<th>序号</th>
<th>设备编号</th>
<th>设备名称</th>
<th>设备分类</th>
<th nzWidth="100px">{{ title }}状态</th>
<th nzWidth="100px">操作</th>
</tr>
</thead>
<tbody>
@for (item of data.value.defects; track $index) {
<tr>
<td>
{{ item.assetId }}
</td>
<td>
{{ item.assetCode }}
</td>
<td>
{{ item.name }}
</td>
<td>
{{ item.categoryName }}
</td>
<td>
<nz-badge
[nzText]="defectStatusTextOnThis[item.defectStatus]"
[nzStatus]="defectStatus[item.defectStatus]"
/>
</td>
<td>
<nz-space>
@if (item.defectStatus == 0) {
<a
*nzSpaceItem
nz-button
nzType="link"
(click)="handleItem(item)"
>执行</a
>
} @else {
<a
*nzSpaceItem
nz-button
nzType="link"
(click)="handlePreview(item)"
>查看</a
>
}
</nz-space>
</td>
</tr>
}
</tbody>
</nz-table>
</nz-form-control>
</nz-form-item>
</div>
</div>
</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/plan-task/handle-task/handle-task.component.less

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

@ -0,0 +1,180 @@
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 { NzSafeAny } from 'ng-zorro-antd/core/types'
import { NZ_MODAL_DATA, NzModalService } from 'ng-zorro-antd/modal'
import { ActivatedRoute } from '@angular/router'
import { STOCKTAKING_JOB_STATUS_MAP, taskTypeTitle } from 'app/constants'
import {
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
SelectUserByOrgComponent,
SupplierSelectComponent,
} from 'app/components'
import { UploadComponent } from '../../../shared/components/upload/upload.component'
import {
defectStatusText,
HandleTaskAssetItemComponent,
} from '../handle-task-asset-item/handle-task-asset-item.component'
import { lastValueFrom } from 'rxjs'
import { PlanTaskType } from 'app/types'
@Component({
selector: 'app-stocktaking-detail-form',
standalone: true,
imports: [
SharedModule,
SelectUserByOrgComponent,
SupplierSelectComponent,
AssetSelectComponent,
OrgSelectComponent,
PositionSelectComponent,
UploadComponent,
],
templateUrl: './handle-task.component.html',
styleUrl: './handle-task.component.less',
})
export class HandleTaskComponent {
constructor(
private fb: FormBuilder,
private api: ApiService,
private msg: NzMessageService,
private route: ActivatedRoute,
) {}
readonly data: NzSafeAny = inject(NZ_MODAL_DATA)
formGroup!: FormGroup
flowForms: NzSafeAny[] = []
teamList: NzSafeAny[] = []
ngOnInit(): void {
this.api.getAssetTeamAll().subscribe((res) => {
this.teamList = res.body
})
this.api.getFlowFormList().subscribe((res) => {
this.flowForms = res.body
})
this.formGroup = this.fb.group({
teamId: this.fb.control(null, []),
name: this.fb.control({ value: null, disabled: true }, [FormValidators.required('请输入')]),
remark: this.fb.control(null, []),
feedback: this.fb.control(null, []),
// plannedDate: this.fb.control(null, [FormValidators.required('请选择')]),
actualStartTime: this.fb.control(null, []),
businessId: this.fb.control({ value: null, disabled: true }, []),
duration: this.fb.control(null, []),
expectedStartTime: this.fb.control({ value: null, disabled: true }, []),
expectedFinishTime: this.fb.control({ value: null, disabled: true }, []),
order: this.fb.control(false, []),
limit: this.fb.control(false, []),
img: this.fb.control(null, []),
assetIdList: this.fb.control([], []),
})
this.patchValues()
}
title?: string
defectStatusText = defectStatusText
defectStatusTextOnThis: string[] = []
defectStatus = {
0: 'processing',
1: 'success',
2: 'warning',
3: 'error',
} as any
handlePreview(asset: NzSafeAny) {}
modal = inject(NzModalService)
handleItem(asset: NzSafeAny) {
this.modal.create({
nzTitle: this.title + '执行详情',
nzContent: HandleTaskAssetItemComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
asset,
task: this.data.value,
title: this.title,
type: this.data.type,
},
nzOnOk: async (e) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(
this.api.handleTaskAssetItem(
{
...this.data.value,
defects: this.data.value.defects.map((i: NzSafeAny) => {
if (i.assetId === asset.assetId) {
return {
...asset,
_formValue: vals._extInfo,
...vals,
}
}
return i
}),
},
this.data.value.id,
),
)
this.msg.success(res.desc)
// this.table.ref.reload()
return true
}
return false
},
})
}
patchValues() {
const { value: data, preview, type } = this.data
this.title = taskTypeTitle.get(type)
this.defectStatusTextOnThis = this.defectStatusText[type as PlanTaskType]
if (data) {
this.formGroup.patchValue({
...data,
})
}
if (preview) {
this.formGroup.disable()
}
}
public getValues() {
let values = null
console.log('this.formGroup', this.formGroup)
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
assetIdList: v.assetIdList.map((i: NzSafeAny) => {
return {
...i,
// assetId: i,
}
}),
// assetId
}
}
return values
}
}

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

@ -108,11 +108,12 @@ export class PlanFormComponent {
public getValues() {
let values = null
console.log('this.formGroup', this.formGroup)
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
values = {
...v,
teamName: this.teamList.find((i) => i.teamId === v.teamId).teamName,
assetIdList: v.assetIdList.map((i: NzSafeAny) => {
return {
...i,

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

@ -68,8 +68,20 @@ export class PlanListComponent {
},
{ title: '修改', onClick: this.onCreate.bind(this) },
{ title: '删除', onClick: this.deleteItem.bind(this) },
{ title: '停用', onClick: this.deleteItem.bind(this) },
{ title: '启用', onClick: this.deleteItem.bind(this) },
{
title: '停用',
onClick: this.changeStatus.bind(this),
visible(v) {
return v.status === '0'
},
},
{
title: '启用',
onClick: this.changeStatus.bind(this),
visible(v) {
return v.status === '1'
},
},
{ title: '报表', onClick: this.deleteItem.bind(this) },
])
}
@ -78,6 +90,24 @@ export class PlanListComponent {
return this.api.getPlanPage({ ...p, ...q, planType: this.type })
}
changeStatus(d: NzSafeAny) {
const action = d.status === '0' ? '停用' : '启用'
this.modal.confirm({
nzTitle: '警告',
nzContent: `是否要${action}该计划?`,
nzOnOk: async () => {
const res = await lastValueFrom(
this.api.changePlanStatus({
...d,
status: d.status === '0' ? '1' : '0',
}),
)
this.msg.success(res.desc)
this.table.ref.reload()
},
})
}
onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑计划' : '添加计划'
if (preview) {
@ -98,6 +128,7 @@ export class PlanListComponent {
const res = await lastValueFrom(
this.api.savePlan({
...vals,
planType: this.type,
}),
)
@ -112,12 +143,11 @@ export class PlanListComponent {
}
deleteItem(item?: NzSafeAny) {
const ids = item ? [item.teamId] : Array.from(this.table.ref.selected)
this.modal.confirm({
nzTitle: '警告',
nzContent: `是否要删除${ids.length}计划?`,
nzContent: `是否要删除计划?`,
nzOnOk: async () => {
const res = await lastValueFrom(this.api.deleteUserTeam(ids))
const res = await lastValueFrom(this.api.deletePlan(item))
this.msg.success(res.desc)
this.table.ref.reload()
},

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

@ -33,22 +33,24 @@
</div>
<div nz-col [nzSpan]="8">
<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" nzShowTime formControlName="actualStartTime" />
</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-input-group nzAddOnAfter="">
<nz-input-group nzAddOnAfter="">
<nz-input-number class="!w-full" [nzMin]="0" formControlName="duration" />
</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>
@ -66,16 +68,39 @@
</nz-form-control>
</nz-form-item>
</div>
<!-- @if(handle){
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label>任务备注</nz-form-label>
<nz-form-label>任务反馈</nz-form-label>
<nz-form-control [nzErrorTip]="errorTpl">
<input nz-input placeholder="请输入" />
</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">
<input nz-input placeholder="请输入" formControlName="remark" />
</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">
<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">选择设备</div>
<div class="text-lg mb-2">{{ title }}设备</div>
</div>
<div nz-col [nzSpan]="24">
<nz-form-item>

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

@ -59,6 +59,8 @@ export class TaskFormComponent {
flowForms: NzSafeAny[] = []
teamList: NzSafeAny[] = []
handle = false
ngOnInit(): void {
this.api.getAssetTeamAll().subscribe((res) => {
this.teamList = res.body
@ -68,10 +70,12 @@ export class TaskFormComponent {
})
this.formGroup = this.fb.group({
teamId: this.fb.control(null, []),
teamId: this.fb.control(null, [FormValidators.required('请选择')]),
name: this.fb.control(null, [FormValidators.required('请输入')]),
remark: this.fb.control(null, []),
formTempId: this.fb.control(null, [FormValidators.required('请选择')]),
// plannedDate: this.fb.control(null, [FormValidators.required('请选择')]),
actualStartTime: this.fb.control(null, []),
@ -93,6 +97,7 @@ export class TaskFormComponent {
patchValues() {
const { value: data, preview, type } = this.data
this.title = taskTypeTitle.get(type)
if (data) {
this.formGroup.patchValue({
...data,
@ -105,14 +110,18 @@ export class TaskFormComponent {
public getValues() {
let values = null
console.log('this.formGroup', this.formGroup)
if (FormValidators.validateFormGroup(this.formGroup)) {
const v = this.formGroup.value
const form = this.flowForms.find((i) => i.formTempId === v.formTempId)
values = {
...v,
formName: form.formName,
formValue: form.formValue,
teamName: this.teamList.find((i) => i.teamId === v.teamId).teamName,
assetIdList: v.assetIdList.map((i: NzSafeAny) => {
return {
...i,
// assetId: i,
}
}),
@ -121,37 +130,4 @@ export class TaskFormComponent {
}
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('attachment')?.setValue(res.body.fileName)
})
}
onImgChange(e: Event) {
const target = e.target as HTMLInputElement
const file = target.files![0]
target.value = ''
if (file.size / 1024 / 1024 >= 2) {
this.msg.error('图片大小不能超过2M')
return
}
const fileReader = new FileReader()
fileReader.onload = () => {
const base64 = fileReader.result as string
this.iconPreview = base64
}
fileReader.readAsDataURL(file)
const formdata = new FormData()
formdata.append('file', file)
this.api.upload(formdata).subscribe((res) => {
this.formGroup.get('img')?.setValue(res.body.fileName)
})
}
}

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

@ -13,7 +13,7 @@
@switch (data) {
<!-- APPROVAL,COMPLETED,DISCARDED,DRAFTING,EXCEPTION,REJECTED,SUSPENDED,TO_BE_ASSIGNED -->
@case ('APPROVAL') {
<span class="text-blue-500">待处理</span>
<span class="text-blue-500">审批中</span>
}
@case ('COMPLETED') {
<span class="text-green-500">已完成</span>
@ -30,6 +30,9 @@
@case ('REJECTED') {
<span class="text-red-500">已驳回</span>
}
@case ('DISPOSE') {
<span class="text-blue-500">待处置</span>
}
@case ('SUSPENDED') {
<span class="text-yellow-500">已挂起</span>
}
@ -68,3 +71,28 @@
</app-server-paginated-table>
</div>
</app-page>
<ng-template #zhipaiTpl>
<div nz-form nzLayout="vertical">
<nz-form-item>
<nz-form-label nzRequired> 任务处置人员 </nz-form-label>
<nz-form-control>
<nz-cascader [nzOptions]="teamList" [(ngModel)]="assignee" />
</nz-form-control>
</nz-form-item>
</div>
</ng-template>
<ng-template #shenheTpl>
<div nz-form nzLayout="vertical">
<nz-form-item>
<nz-form-label nzRequired> {{ shenhe ? '审批意见' : '驳回意见' }} </nz-form-label>
<nz-form-control>
<textarea
nz-input
[(ngModel)]="comment"
[placeholder]="'请输入' + shenhe ? '审批理由' : '驳回理由'"
></textarea>
</nz-form-control>
</nz-form-item>
</div>
</ng-template>

8
web-admin-app/src/app/components/plan-task/task-list/task-list.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;
}
}

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

@ -15,6 +15,8 @@ import { ASSET_TYPE } from 'app/constants'
import { AssetBasicTeamFormComponent } from 'app/components/asset-basic-team-form/asset-basic-team-form.component'
import { StatusTagComponent } from 'app/components/status-tag/status-tag.component'
import { PlanFormComponent } from '../plan-form/plan-form.component'
import { TaskFormComponent } from '../task-form/task-form.component'
import { HandleTaskComponent } from '../handle-task/handle-task.component'
@Component({
selector: 'app-task-list',
@ -32,6 +34,9 @@ export class TaskListComponent {
@Input() type: PlanTaskType = 'inspection'
@ViewChild('zhipaiTpl') zhipaiTpl!: TemplateRef<NzSafeAny>
@ViewChild('shenheTpl') shenheTpl!: TemplateRef<NzSafeAny>
queryForm = new FormGroup({
name: new FormControl(),
@ -44,6 +49,7 @@ export class TaskListComponent {
ASSET_TYPE = ASSET_TYPE
teamList: NzSafeAny[] = []
ngOnInit(): void {
this.table
@ -67,87 +73,268 @@ export class TaskListComponent {
this.onCreate(v, true)
},
},
{ title: '受理', onClick: this.shouli.bind(this) },
{ title: '指派', onClick: this.zhipai.bind(this) },
{ title: '处置', onClick: this.chuzhi.bind(this) },
{ title: '报表', onClick: this.deleteItem.bind(this) },
{
title: '受理',
onClick: this.shouli.bind(this),
visible(v) {
return v.status === 'TO_BE_ASSIGNED'
},
},
{
title: '指派',
onClick: this.zhipai.bind(this),
premissions: ['ROOT'],
visible(v) {
return v.status === 'TO_BE_ASSIGNED'
},
},
{
title: '处置',
onClick: this.onHandle.bind(this, true),
visible(v) {
return v.status === 'DISPOSE'
},
},
{
title: '审批',
onClick: this.onHandle.bind(this, false),
visible(v) {
return true
return v.status === 'APPROVAL'
},
},
{
title: '报表',
onClick: this.deleteItem.bind(this),
visible(v) {
return v.status === 'COMPLETED'
},
},
])
this.api.getAssetTeamAll().subscribe((res) => {
this.teamList = res.body.map((i: NzSafeAny) => {
let users = []
try {
users = JSON.parse(i.value)
} catch (error) {}
return {
...i,
label: i.teamName,
value: i.teamId,
children: users.map((c: NzSafeAny) => {
return {
label: c.userName,
value: c.userId,
isLeaf: true,
}
}),
}
})
})
}
fetchData(p: {}, q: AnyObject) {
return this.api.getTaskPage({ ...p, ...q, jobType: this.type })
}
onShenpi(item: NzSafeAny) {
const nzTitle = this.shenhe ? '请填写审批意见' : '请填写驳回意见'
this.modal.create({
nzTitle,
nzContent: this.shenheTpl,
nzOnOk: async () => {
if (!this.comment) {
this.msg.error(nzTitle)
return false
}
if (this.shenhe) {
const res = await lastValueFrom(
this.api.completeProcessFlow({
instanceId: item.procInsId,
taskId: item.taskId,
assignee: this.assignee,
comment: this.comment,
}),
)
this.msg.success(res.desc)
} else {
const res = await lastValueFrom(
this.api.rejectProcessFlow({
instanceId: item.procInsId,
taskId: item.taskId,
assignee: this.assignee,
comment: this.comment,
}),
)
this.msg.success(res.desc)
}
this.table.ref.reload()
return true
},
})
}
shouli(item?: NzSafeAny) {
const ids = item ? [item.teamId] : Array.from(this.table.ref.selected)
this.modal.confirm({
nzTitle: '是否确定受理当前设备流程?',
nzContent: `受理后你将作为该任务的责任人,其他人员无法受理!`,
nzOnOk: async () => {
const res = await lastValueFrom(this.api.deleteUserTeam(ids))
const res = await lastValueFrom(this.api.takeTask({ instanceId: item.procInsId, taskId: item.taskId }))
this.msg.success(res.desc)
this.table.ref.reload()
},
})
}
assignee?: string
comment?: string
shenhe = false
zhipai(item?: NzSafeAny) {
const ids = item ? [item.teamId] : Array.from(this.table.ref.selected)
this.modal.confirm({
nzTitle: '请选择设备任务处置人员',
nzContent: ``,
this.modal.create({
nzTitle: '任务指派',
nzContent: this.zhipaiTpl,
nzOnOk: async () => {
const res = await lastValueFrom(this.api.deleteUserTeam(ids))
if (!this.assignee) {
this.msg.error('请选择处理人')
return false
}
const res = await lastValueFrom(
this.api.assignTask({ instanceId: item.procInsId, taskId: item.taskId, assignee: this.assignee }),
)
this.msg.success(res.desc)
this.table.ref.reload()
return true
},
})
}
chuzhi(data: NzSafeAny) {}
onCreate(data?: NzSafeAny, preview?: boolean) {
let nzTitle = data ? '编辑任务' : '添加任务'
if (preview) {
nzTitle = '预览任务'
}
let nzTitle = '查看任务'
this.modal.create({
nzTitle,
nzContent: PlanFormComponent,
nzContent: TaskFormComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg',
nzData: {
value: data,
value: {
...data,
assetIdList: data.defects,
},
preview,
type: this.type,
},
nzOnOk: async (e) => {
// nzOnOk: async (e) => {
// const vals = e.getValues()
// if (vals) {
// const res = await lastValueFrom(
// this.api.savePlan({
// ...vals,
// planType: this.type,
// }),
// )
// this.msg.success(res.desc)
// this.table.ref.reload()
// return true
// }
// return false
// },
})
}
onHandle(chuzhi: boolean, data: NzSafeAny) {
console.log('chuzhi', chuzhi, data)
let nzTitle = chuzhi ? '处置任务' : '任务审批'
const footer: NzSafeAny[] = chuzhi
? [
{
label: '提交审核',
type: 'reject',
onClick: async (e: HandleTaskComponent) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(
this.api.savePlan({
this.api.completeProcessFlow({
variables: {
...data,
...vals,
planType: this.type,
},
taskId: data.taskId,
instanceId: data.procInsId,
}),
)
this.msg.success(res.desc)
this.table.ref.reload()
return true
ref.close()
}
return false
},
})
}
deleteItem(item?: NzSafeAny) {
const ids = item ? [item.teamId] : Array.from(this.table.ref.selected)
this.modal.confirm({
nzTitle: '警告',
nzContent: `是否要删除${ids.length}个任务?`,
nzOnOk: async () => {
const res = await lastValueFrom(this.api.deleteUserTeam(ids))
},
{
label: '保存',
type: 'primary',
onClick: async (e: HandleTaskComponent) => {
const vals = e.getValues()
if (vals) {
const res = await lastValueFrom(
this.api.handleTaskAssetItem(
{
variables: {
...data,
...vals,
},
taskId: data.taskId,
instanceId: data.procInsId,
},
data.id,
),
)
this.msg.success(res.desc)
this.table.ref.reload()
ref.close()
}
},
},
]
: [
{
label: '驳回',
type: 'reject',
onClick: async (e: HandleTaskComponent) => {
this.shenhe = false
this.onShenpi(data)
},
},
{
label: '通过',
type: 'primary',
onClick: async (e: HandleTaskComponent) => {
this.shenhe = true
this.onShenpi(data)
},
},
]
const ref = this.modal.create({
nzTitle,
nzContent: HandleTaskComponent,
nzWidth: '80vw',
nzWrapClassName: 'modal-lg modal-for-btn',
nzData: {
value: data,
chuzhi,
type: this.type,
},
nzFooter: footer.concat({
label: '取消',
onClick: () => {
ref.close()
},
}),
})
}
deleteItem(item?: NzSafeAny) {}
}

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

@ -153,7 +153,7 @@ export const businessType = new Map([
// APPROVAL,COMPLETED,DISCARDED,DRAFTING,EXCEPTION,REJECTED,SUSPENDED,TO_BE_ASSIGNED
export const flowStatus = new Map([
['APPROVAL', '审批中'],
['APPROVAL', '审批中'], //
['COMPLETED', '已完成'],
['DISCARDED', '已废弃'],
['DRAFTING', '起草中'],
@ -161,4 +161,28 @@ export const flowStatus = new Map([
['REJECTED', '已驳回'],
['SUSPENDED', '已挂起'],
['TO_BE_ASSIGNED', '待分配'],
['DISPOSE', '待处置'],
])
// DRAFTING(1, "起草"),
// APPROVAL(2, "审批中"),
// COMPLETED(3, "已结束"),
// REJECTED(4, "已驳回"),
// DISCARDED(5, "已废弃"),
// EXCEPTION(6, "流程异常"),
// TO_BE_ASSIGNED(7,"待指派"),
// SUSPENDED(8,"已挂起"),
// //
// DISPOSE(9,"待处置"),
// ;
export const flowIntStatus = new Map([
[1, '起草'],
[2, '审批中'],
[3, '已结束'],
[4, '已驳回'],
[5, '已废弃'],
[6, '流程异常'],
[7, '待指派'],
[8, '已挂起'],
[9, '待处置'],
])

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

@ -79,10 +79,41 @@ export class AssetManagementComponent {
{ key: '_position', title: '当前节点', visible: true },
{ key: '_position', title: '备注', visible: true },
])
// .setRowOperate([
// { title: '二维码', onClick: this.qrcode.bind(this) },
// { title: '删除', onClick: this.deleteItem.bind(this) },
// ])
.setRowOperate([
{ title: '查看', onClick: this.itemAction.bind(this, 'preview') },
{ title: '修改', onClick: this.itemAction.bind(this, 'edit') },
{ title: '删除', onClick: this.deleteItem.bind(this) },
])
}
itemAction(type: 'preview' | 'edit', data: NzSafeAny) {
switch (data.type) {
case 'ALLOCATE':
this.onAllot(data, type === 'preview')
break
case 'BORROW':
this.onBorrow(data, type === 'preview')
break
case 'COLLECTION':
this.onDistribution(data, type === 'preview')
break
case 'RETURN_INVENTORY':
this.onReturn(data, type === 'preview')
break
case 'STORAGE':
this.onEntry(data, type === 'preview')
break
case 'RETURN':
this.onRevert(data, type === 'preview')
break
case 'TRANSFER':
this.onTransfer(data, type === 'preview')
break
case 'RETIREMENT':
this.onScrap(data, type === 'preview')
break
}
}
fetchData(p: {}, q: AnyObject) {

23
web-admin-app/src/app/pages/flow/flow-main/flow-main.component.html

@ -4,13 +4,13 @@
<nz-card [nzBordered]="false" nzTitle="资管流程分析">
<div nz-row nzGutter="12">
<div nz-col nzSpan="8">
<nz-statistic nzTitle="累计流程总数" nzValue="15666" />
<nz-statistic nzTitle="累计流程总数" [nzValue]="assetcounter.count" />
</div>
<div nz-col nzSpan="8">
<nz-statistic nzTitle="当日新增流程" nzValue="11" />
<nz-statistic nzTitle="当日新增流程" [nzValue]="assetcounter.increase" />
</div>
<div nz-col nzSpan="8">
<nz-statistic nzTitle="待我处理流程" nzValue="2" />
<nz-statistic nzTitle="待我处理流程" [nzValue]="assetcounter.todo" />
</div>
</div>
</nz-card>
@ -19,13 +19,13 @@
<nz-card [nzBordered]="false" nzTitle="设备流程统计">
<div nz-row nzGutter="12">
<div nz-col nzSpan="8">
<nz-statistic nzTitle="累计流程总数" nzValue="15666" />
<nz-statistic nzTitle="累计流程总数" [nzValue]="devicecounter.count" />
</div>
<div nz-col nzSpan="8">
<nz-statistic nzTitle="当日新增流程" nzValue="11" />
<nz-statistic nzTitle="当日新增流程" [nzValue]="devicecounter.increase" />
</div>
<div nz-col nzSpan="8">
<nz-statistic nzTitle="待我处理流程" nzValue="2" />
<nz-statistic nzTitle="待我处理流程" [nzValue]="devicecounter.todo" />
</div>
</div>
</nz-card>
@ -61,7 +61,8 @@
<nz-card [nzBordered]="false" nzTitle="设备流程">
<nz-spin [nzSpinning]="loading">
<div nz-row [nzGutter]="[24, 24]">
<div nz-col nzSpan="8" [nzXl]="4" class="cursor-pointer" (click)="createTask('repair')">
@for (item of deviceFlows; track $index) {
<div nz-col nzSpan="8" [nzXl]="4" class="cursor-pointer" (click)="createTask(item.formType)">
<div>
<div class="h-22 flex flex-col items-center justify-center text-center overflow-hidden">
<div class="flex-shrink-0">
@ -70,12 +71,14 @@
</div>
</div>
<div class="flex-1 pt-3 text-base overflow-hidden">
<div>报修维修</div>
<div>{{ item.name }}</div>
</div>
</div>
</div>
</div>
<div nz-col nzSpan="8" [nzXl]="4" class="cursor-pointer" (click)="createTask('inspection')">
}
<!-- <div nz-col nzSpan="8" [nzXl]="4" class="cursor-pointer" (click)="createTask('inspection')">
<div>
<div class="h-22 flex flex-col items-center justify-center text-center overflow-hidden">
<div class="flex-shrink-0">
@ -116,7 +119,7 @@
</div>
</div>
</div>
</div>
</div> -->
</div>
</nz-spin>
</nz-card>

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

@ -47,10 +47,23 @@ export class FlowMainComponent implements OnInit {
assetFlows: NzSafeAny[] = []
deviceFlows: NzSafeAny[] = []
loading = false
assetcounter: any = {
count: 0,
increase: 0,
todo: 0,
}
devicecounter: any = {
count: 0,
increase: 0,
todo: 0,
}
ngOnInit(): void {
this.loading = true
this.getCounter()
this.api
.getFlowForms({})
.pipe(
@ -59,10 +72,27 @@ export class FlowMainComponent implements OnInit {
}),
)
.subscribe((res) => {
this.assetFlows = res.body.map((i: NzSafeAny) => {
return {
...i,
enabled: Boolean(comsMap[i.formKey as keyof typeof comsMap]),
res.body.forEach((i: NzSafeAny) => {
const enabled = Boolean(comsMap[i.formKey as keyof typeof comsMap])
const formType = (i.formKey as string).split('_').splice(-1)[0]
console.log('formType', formType)
const item = { ...i, enabled, formType }
if (i.type === '设备流程') {
this.deviceFlows.push(item)
} else {
this.assetFlows.push(item)
}
})
})
}
getCounter() {
this.api.getFlowHomeData().subscribe((res) => {
res.body?.forEach((i: NzSafeAny) => {
if (i.type === '设备流程') {
this.devicecounter = i
} else {
this.assetFlows = i
}
})
})
@ -83,6 +113,7 @@ export class FlowMainComponent implements OnInit {
if (vals) {
const res = await lastValueFrom(this.api.startFlow(vals, model.formKey))
this.msg.success(res.desc)
this.getCounter()
return true
}
return false
@ -116,7 +147,7 @@ export class FlowMainComponent implements OnInit {
const res = await lastValueFrom(this.api.createTask({ ...vals, jobType: type }))
this.msg.success(res.desc)
}
this.getCounter()
return true
}
return false

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

@ -1 +1,47 @@
<p>flow-management works!</p>
<app-page>
<div class="flex-1 overflow-hidden">
<app-server-paginated-table [options]="table" [renderColumn]="renderColumnTpl">
<ng-template #renderColumnTpl let-data let-key="key" let-row="row">
@switch (key) {
@case ('checkRequire') {
{{ data ? '是' : '否' }}
}
@case ('status') {
@if (data === 0) {
<nz-badge nzText="启用" nzColor="green" />
} @else {
<nz-badge nzText="停用" nzColor="red" />
}
}
@case ('autoAssign') {
@if (row.type !== '资管流程') {
<span class="cursor-pointer" (click)="updateAutoAssign(row)">
<nz-switch [ngModel]="data" class="pointer-events-none" />
</span>
} @else {
/
}
}
@default {
{{ data }}
}
}
</ng-template>
</app-server-paginated-table>
</div>
</app-page>
<ng-template #createFormTpl>
<form nz-form [formGroup]="createForm">
<nz-form-item>
<nz-form-label [nzSpan]="6" [nzRequired]="true">审批人</nz-form-label>
<nz-form-control [nzSpan]="12" [nzErrorTip]="errorTpl">
<app-select-user-by-org formControlName="userId" />
</nz-form-control>
</nz-form-item>
</form>
</ng-template>
<ng-template #errorTpl let-control>
<form-error-tips [control]="control"></form-error-tips>
</ng-template>

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

@ -1,12 +1,187 @@
import { Component } from '@angular/core';
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 { lastValueFrom, map, 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 { FormValidators } from 'app/utils'
import { SelectUserByOrgComponent } from 'app/components'
import { MAX_PAGE_SIZE, taskTypeTitle } from 'app/constants'
import { FlowFormV2Component } from 'app/components/flow-form-v2/flow-form-v2.component'
@Component({
selector: 'app-flow-management',
selector: 'app-flow-form',
standalone: true,
imports: [],
imports: [SharedModule, SelectUserByOrgComponent],
templateUrl: './flow-management.component.html',
styleUrl: './flow-management.component.less'
styleUrl: './flow-management.component.less',
})
export class FlowManagementComponent {
constructor(
private api: ApiService,
private modal: NzModalService,
private msg: NzMessageService,
) {}
@ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}>
createForm = new FormGroup({
formId: new FormControl(''),
userId: new FormControl<NzSafeAny[]>([], [FormValidators.required('请选择')]),
})
table = new TableOption(this.fetchData.bind(this))
ngOnInit(): void {
this.table
// .setConfig({
// selectable: true,
// rowKey: 'id',
// })
.setColumn([
{ key: 'formId', title: '主键', width: '100px', visible: true },
{ key: 'formKey', title: '标识', width: '250px', visible: true },
{ key: 'name', title: '名称', visible: true },
{ key: 'deployId', title: '流程ID', width: '100px', visible: true },
{ key: 'type', title: '流程分类', visible: true },
{ key: 'status', title: '流程状态', visible: true },
{ key: 'checkRequire', title: '验收要求', visible: true },
{ key: 'autoAssign', title: '自动指派', visible: true },
// { key: '_assignee', title: '审批人', visible: true },
// { key: 'createTime', title: '创建时间', visible: true },
])
.setRowOperate([
{ title: '编辑', onClick: this.onEdit.bind(this) },
{
title: '禁用',
onClick: this.onStop.bind(this),
visible(v) {
return v.status === 0
},
},
{
title: '启用',
onClick: this.onStop.bind(this),
visible(v) {
return v.status === 1
},
},
])
}
updateAutoAssign(d: any) {
this.modal.confirm({
nzTitle: '警告',
nzContent: `是否要${d.autoAssign ? '关闭' : '开启'}自动指派?`,
nzOkText: '确定',
nzCancelText: '取消',
nzOnOk: async () => {
const res = await lastValueFrom(
this.api.flowFormUpdate({
...d,
autoAssign: !d.autoAssign,
}),
)
this.msg.success(res.desc)
this.table.ref.reload()
},
})
}
fetchData(p: {}, q: AnyObject) {
return this.api.getFlowForms({ ...p, ...q }).pipe(
map((r) => {
return {
body: {
rows: r.body,
total: r.body.length,
},
}
}),
)
}
onEdit(d: NzSafeAny) {
const nzTitle = '编辑' + d.type
this.modal.create({
nzTitle,
nzContent: FlowFormV2Component,
nzWrapClassName: 'modal-lg',
nzWidth: '80vw',
nzData: {
value: d,
preview: false,
type: d.type,
},
nzOnOk: async (e: NzSafeAny) => {
const vals = e.getValues()
console.log('vals', vals)
if (vals) {
const res = await lastValueFrom(this.api.flowFormUpdate({ ...d, ...vals }))
this.msg.success(res.desc)
this.table.ref.reload()
return true
}
return false
},
nzOnCancel: () => {
console.log('Cancel')
},
})
}
onStop(d: NzSafeAny) {
this.modal.confirm({
nzTitle: '警告',
nzContent: `是否要${d.status ? '启用' : '禁用'}流程?`,
nzOnOk: async () => {
const res = await lastValueFrom(
this.api.flowFormUpdate({
...d,
status: d.status === 1 ? 0 : 1,
}),
)
this.msg.success(res.desc)
this.table.ref.reload()
},
})
}
onSetApprover(data?: NzSafeAny) {
if (data) {
this.createForm.patchValue({
formId: data.formId,
userId: data._assignee.userId ? [data._assignee.userId] : [],
})
}
this.modal.create({
nzTitle: '设置审批人',
nzContent: this.createFormTpl,
nzOnOk: async () => {
if (FormValidators.validateFormGroup(this.createForm)) {
const vals = this.createForm.value
const res = await lastValueFrom(
this.api.setFlowFormsAssignee({
...vals,
userId: vals.userId?.[0],
}),
)
this.msg.success(res.desc)
this.table.ref.reload()
this.createForm.reset()
return true
}
return false
},
nzOnCancel: () => {
this.createForm.reset()
},
})
}
}

2
web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.html

@ -12,7 +12,7 @@
<nz-tag> {{ data.userName }} </nz-tag>
}
@case ('procVars') {
{{ data?.title }}
{{ data?.title ?? data?.name ?? '-' }}
}
@case ('status') {
<nz-tag nzColor="blue">

4
web-admin-app/src/app/pages/flow/flow-my-apply/flow-my-apply.component.ts

@ -12,7 +12,7 @@ import { NzMessageService } from 'ng-zorro-antd/message'
import { FormValidators } from 'app/utils'
import { AssetEmployeeApplyComponent } from 'app/components'
import { comsMap } from '../flow-main/flow-main.component'
import { FLOW_STATUS } from 'app/constants'
import { FLOW_STATUS, flowIntStatus } from 'app/constants'
@Component({
selector: 'app-flow-my-apply',
@ -41,7 +41,7 @@ export class FlowMyApplyComponent {
name: new FormControl(''),
})
FLOW_STATUS = FLOW_STATUS
FLOW_STATUS = flowIntStatus
ngOnInit(): void {
this.table
// .setConfig({

2
web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.html

@ -12,7 +12,7 @@
<nz-tag> {{ data.userName }} </nz-tag>
}
@case ('procVars') {
{{ data.title }}
{{ data?.title ?? data?.name ?? '-' }}
}
@case ('status') {
<nz-tag nzColor="blue">

4
web-admin-app/src/app/pages/flow/flow-my-finished/flow-my-finished.component.ts

@ -11,7 +11,7 @@ import { NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { FormValidators } from 'app/utils'
import { comsMap } from '../flow-main/flow-main.component'
import { FLOW_STATUS } from 'app/constants'
import { FLOW_STATUS, flowIntStatus } from 'app/constants'
@Component({
selector: 'app-flow-my-finished',
@ -40,7 +40,7 @@ export class FlowMyFinishedComponent {
name: new FormControl(''),
})
FLOW_STATUS = FLOW_STATUS
FLOW_STATUS = flowIntStatus
ngOnInit(): void {
this.table

2
web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.html

@ -12,7 +12,7 @@
<nz-tag> {{ data.userName }} </nz-tag>
}
@case ('procVars') {
{{ data.title }}
{{ data?.title ?? data?.name ?? '-' }}
}
@case ('status') {
<nz-tag nzColor="blue">

4
web-admin-app/src/app/pages/flow/flow-my-todo/flow-my-todo.component.ts

@ -11,7 +11,7 @@ import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'
import { NzMessageService } from 'ng-zorro-antd/message'
import { FormValidators } from 'app/utils'
import { comsMap } from '../flow-main/flow-main.component'
import { FLOW_STATUS } from 'app/constants'
import { FLOW_STATUS, flowIntStatus } from 'app/constants'
@Component({
selector: 'app-flow-my-todo',
@ -44,7 +44,7 @@ export class FlowMyTodoComponent {
name: new FormControl(''),
})
FLOW_STATUS = FLOW_STATUS
FLOW_STATUS = flowIntStatus
ngOnInit(): void {
this.table
// .setConfig({

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

@ -29,9 +29,9 @@ export class FlowMsgComponent {
@ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}>
queryForm = new FormGroup({
logContent: new FormControl(''),
logType: new FormControl(''),
createTime: new FormControl(''),
logContent: new FormControl(null),
logType: new FormControl(null),
createTime: new FormControl(null),
})
table = new TableOption(this.fetchData.bind(this))
@ -52,6 +52,6 @@ export class FlowMsgComponent {
}
fetchData(p: {}, q: AnyObject) {
return this.api.getAlarmMsg({ ...p, ...q })
return this.api.getFlowMsg({ ...p, ...q })
}
}

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

@ -584,11 +584,16 @@ export class ApiService {
return this.http.post<JwResponse>(`/api/flowable/task/revokeProcess`, data)
}
rejectProcessFlow(data: {}) {
// 驳回
return this.http.post<JwResponse>(`/api/flowable/task/reject`, data)
}
completeProcessFlow(data: {}) {
// 通过
return this.http.post<JwResponse>(`/api/flowable/task/complete`, data)
}
handleTaskAssetItem(data: {}, id: string) {
return this.http.post<JwResponse>(`/api/v2/flowable/device/update/${id}`, { variables: data })
}
cancelFlow(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/stopProcess`, data)
}
@ -661,15 +666,30 @@ export class ApiService {
getPlanPage(data: {}) {
return this.http.post<JwResponse>(`/api/v2/plan/list`, data)
}
savePlan(data: {}) {
savePlan(data: NzSafeAny) {
if (Utils.isEmpty(data.jobId)) {
return this.http.post<JwResponse>(`/api/v2/plan/add`, data)
}
return this.http.post<JwResponse>('/api/v2/plan/update', data)
}
deletePlan(data: {}) {
return this.http.post<JwResponse>(`/api/v2/plan/delete`, data)
}
changePlanStatus(data: {}) {
return this.http.post<JwResponse>(`/api/v2/plan/changeStatus`, data)
}
createRapairTask(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)
}
takeTask(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/claim`, data)
}
assignTask(data: {}) {
return this.http.post<JwResponse>(`/api/flowable/task/assignTask`, data)
}
getSysLog(data: {}) {
return this.http.post<JwResponse>('/api/v2/sysLog/list', data)
@ -677,4 +697,16 @@ export class ApiService {
getAlarmMsg(data: {}) {
return this.http.post<JwResponse>('/api/v2/alarm/list', data)
}
getFlowMsg(data: {}) {
return this.http.post<JwResponse>('/api/flowable/task/todoListMSG ', data)
}
getCalendarData(data: {}) {
return this.http.post<JwResponse>('/api/flFormItem/calendar', data)
}
getFlowHomeData() {
return this.http.post<JwResponse>('/api/flFormItem/home', null)
}
flowFormUpdate(d: {}) {
return this.http.post<JwResponse>('/api/flForm/update', d)
}
}

4
web-admin-app/src/styles.less

@ -45,6 +45,7 @@ body {
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
@ -72,7 +73,8 @@ body {
// }
}
.modal-lg-container {
.modal-lg-container,
.ant-modal-body {
height: 70vh;
overflow: auto;
}

Loading…
Cancel
Save