127 changed files with 2414 additions and 2261 deletions
@ -1,59 +0,0 @@ |
|||||
<div class="modal-lg-container"> |
|
||||
<form nz-form [formGroup]="formGroup" nzLayout="vertical"> |
|
||||
<div class="overflow-hidden"> |
|
||||
<div nz-row [nzGutter]="24"> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>流程标题</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入流程标题" formControlName="title" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请部门</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-org-select formControlName="applyDepartmentId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入申请人" formControlName="applicant" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>紧急程度</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="urgency"> |
|
||||
<label nz-radio [nzValue]="1">普通</label> |
|
||||
<label nz-radio [nzValue]="2">紧急</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label [nzRequired]="true">原因</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
</div> |
|
||||
@if (data?.value) { |
|
||||
<app-flow-result [flow]="data.value" /> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<ng-template #errorTpl let-control> |
|
||||
<form-error-tips [control]="control"></form-error-tips> |
|
||||
</ng-template> |
|
||||
</div> |
|
||||
@ -1,104 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
import { FlowResultComponent } from '../flow-result/flow-result.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-asset-employee-apply', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
FlowResultComponent, |
|
||||
], |
|
||||
templateUrl: './asset-employee-apply.component.html', |
|
||||
styleUrl: './asset-employee-apply.component.less', |
|
||||
}) |
|
||||
export class AssetEmployeeApplyComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [ |
|
||||
FormValidators.required('请选择'), |
|
||||
]), |
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
notes: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
applyDepartmentId: data.procVars?.applyDepartmentId + '', |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
|
|
||||
applyDepartmentId: Number(v.applyDepartmentId), |
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('attach')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -1,67 +0,0 @@ |
|||||
<div class="modal-lg-container"> |
|
||||
<form nz-form [formGroup]="formGroup" nzLayout="vertical"> |
|
||||
<div class="overflow-hidden"> |
|
||||
<div nz-row [nzGutter]="24"> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>流程标题</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入流程标题" formControlName="title" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请部门</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-org-select formControlName="applyDepartmentId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入申请人" formControlName="applicant" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>紧急程度</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="urgency"> |
|
||||
<label nz-radio [nzValue]="1">普通</label> |
|
||||
<label nz-radio [nzValue]="2">紧急</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label [nzRequired]="true">原因</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>资产列表</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-asset-select formControlName="assetIdList" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
</div> |
|
||||
<!-- @if (data?.preview) { |
|
||||
<app-flow-result /> |
|
||||
} --> |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<ng-template #errorTpl let-control> |
|
||||
<form-error-tips [control]="control"></form-error-tips> |
|
||||
</ng-template> |
|
||||
</div> |
|
||||
@ -1,103 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-asset-employee-loss', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
], |
|
||||
templateUrl: './asset-employee-loss.component.html', |
|
||||
styleUrl: './asset-employee-loss.component.less', |
|
||||
}) |
|
||||
export class AssetEmployeeLossComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [ |
|
||||
FormValidators.required('请选择'), |
|
||||
]), |
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
notes: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
assetIdList: this.fb.control([], []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
applyDepartmentId: data.procVars?.applyDepartmentId + '', |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
|
|
||||
applyDepartmentId: Number(v.applyDepartmentId?.[0]), |
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('attach')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -1,91 +0,0 @@ |
|||||
<div class="modal-lg-container"> |
|
||||
<form nz-form [formGroup]="formGroup" nzLayout="vertical"> |
|
||||
<div class="overflow-hidden"> |
|
||||
<div nz-row [nzGutter]="24"> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>流程标题</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入流程标题" formControlName="title" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>紧急程度</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="urgency"> |
|
||||
<label nz-radio [nzValue]="1">普通</label> |
|
||||
<label nz-radio [nzValue]="2">紧急</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请部门</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-org-select formControlName="applyDepartmentId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入申请人" formControlName="applicant" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>交接部门</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-org-select formControlName="handoverDepartmentId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>交接人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-select-user-by-org formControlName="handoverUserId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label [nzRequired]="true">内容</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入内容" formControlName="content"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>备注</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入备注" formControlName="notes"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>资产列表</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-asset-select formControlName="assetIdList" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
</div> |
|
||||
@if (data?.value) { |
|
||||
<app-flow-result [flow]="data.value" /> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<ng-template #errorTpl let-control> |
|
||||
<form-error-tips [control]="control"></form-error-tips> |
|
||||
</ng-template> |
|
||||
</div> |
|
||||
@ -1,110 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
import { FlowResultComponent } from '../flow-result/flow-result.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-eam-asset-employee-handover', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
FlowResultComponent, |
|
||||
], |
|
||||
templateUrl: './eam-asset-employee-handover.component.html', |
|
||||
styleUrl: './eam-asset-employee-handover.component.less', |
|
||||
}) |
|
||||
export class EamAssetEmployeeHandoverComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
handoverDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
handoverUserId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [ |
|
||||
FormValidators.required('请选择'), |
|
||||
]), |
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
content: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
notes: this.fb.control(null, []), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
assetIdList: this.fb.control([], []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
handoverUserId: data.procVars?.handoverUserId ? [data.procVars?.handoverUserId] : [], |
|
||||
applyDepartmentId: data.procVars?.applyDepartmentId + '', |
|
||||
handoverDepartmentId: data.procVars?.handoverDepartmentId + '', |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
handoverUserId: Number(v.handoverUserId?.[0]), |
|
||||
applyDepartmentId: Number(v.applyDepartmentId?.[0]), |
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('attach')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -1,83 +0,0 @@ |
|||||
<div class="modal-lg-container"> |
|
||||
<form nz-form [formGroup]="formGroup" nzLayout="vertical"> |
|
||||
<div class="overflow-hidden"> |
|
||||
<div nz-row [nzGutter]="24"> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>流程标题</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入流程标题" formControlName="title" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请部门</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-org-select formControlName="applyDepartmentId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入申请人" formControlName="applicant" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>紧急程度</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="urgency"> |
|
||||
<label nz-radio [nzValue]="1">普通</label> |
|
||||
<label nz-radio [nzValue]="2">紧急</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label [nzRequired]="true">原因</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>图片</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input type="hidden" nz-input formControlName="img" /> |
|
||||
<div class="mb-2" *ngIf="iconPreview"> |
|
||||
<img [src]="iconPreview" class="h-20 w-20" /> |
|
||||
</div> |
|
||||
<button class="upload-btn" nz-button [nzLoading]="uploadLoading"> |
|
||||
<i nz-icon nzType="upload"></i> |
|
||||
上传图片 |
|
||||
<input type="file" (change)="onFileChange($event)" accept=".jpg,.jpeg,.png" /> |
|
||||
</button> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>资产列表</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-asset-select formControlName="assetIdList" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
</div> |
|
||||
@if (data?.value) { |
|
||||
<app-flow-result [flow]="data.value" /> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<ng-template #errorTpl let-control> |
|
||||
<form-error-tips [control]="control"></form-error-tips> |
|
||||
</ng-template> |
|
||||
</div> |
|
||||
@ -1,109 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
import { FlowResultComponent } from '../flow-result/flow-result.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-eam-asset-employee-repair', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
FlowResultComponent, |
|
||||
], |
|
||||
templateUrl: './eam-asset-employee-repair.component.html', |
|
||||
styleUrl: './eam-asset-employee-repair.component.less', |
|
||||
}) |
|
||||
export class EamAssetEmployeeRepairComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
iconPreview = '' |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [ |
|
||||
FormValidators.required('请选择'), |
|
||||
]), |
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
notes: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
assetIdList: this.fb.control([], []), |
|
||||
img: this.fb.control(null, []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.iconPreview = data.procVars?.img |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
applyDepartmentId: data.procVars?.applyDepartmentId + '', |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
|
|
||||
applyDepartmentId: Number(v.applyDepartmentId?.[0]), |
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('img')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -1,110 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
import { FlowResultComponent } from '../flow-result/flow-result.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-eam-asset-employee-scrap', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
FlowResultComponent, |
|
||||
], |
|
||||
templateUrl: './eam-asset-employee-scrap.component.html', |
|
||||
styleUrl: './eam-asset-employee-scrap.component.less', |
|
||||
}) |
|
||||
export class EamAssetEmployeeScrapComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
iconPreview = '' |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
scrapType: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
scrapTime: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [ |
|
||||
FormValidators.required('请选择'), |
|
||||
]), |
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
notes: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
assetIdList: this.fb.control([], []), |
|
||||
attach: this.fb.control(null, []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.iconPreview = data.procVars?.img |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
applyDepartmentId: data.procVars?.applyDepartmentId + '', |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
|
|
||||
// applyDepartmentId: Number(v.applyDepartmentId?.[0]),
|
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('attach')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -1,108 +0,0 @@ |
|||||
<div class="modal-lg-container"> |
|
||||
<form nz-form [formGroup]="formGroup" nzLayout="vertical"> |
|
||||
<div class="overflow-hidden"> |
|
||||
<div nz-row [nzGutter]="24"> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>流程标题</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入流程标题" formControlName="title" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>紧急程度</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="urgency"> |
|
||||
<label nz-radio [nzValue]="1">普通</label> |
|
||||
<label nz-radio [nzValue]="2">紧急</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>报修部门</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-org-select formControlName="repairDepartmentId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>报修人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-select-user-by-org formControlName="repairer" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>维修类型</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="repairType"> |
|
||||
<label nz-radio [nzValue]="1">自修</label> |
|
||||
<label nz-radio [nzValue]="2">外部维修</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>计划完成时间</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-date-picker |
|
||||
class="w-full" |
|
||||
nzPlaceHolder="请选择计划完成时间" |
|
||||
formControlName="planCompleteTime" |
|
||||
/> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label [nzRequired]="true">报修内容</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入报修内容" formControlName="content"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>图片</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input type="hidden" nz-input formControlName="img" /> |
|
||||
<div class="mb-2" *ngIf="iconPreview"> |
|
||||
<img [src]="iconPreview" class="h-20 w-20" /> |
|
||||
</div> |
|
||||
<button class="upload-btn" nz-button [nzLoading]="uploadLoading"> |
|
||||
<i nz-icon nzType="upload"></i> |
|
||||
上传图片 |
|
||||
<input type="file" (change)="onFileChange($event)" accept=".jpg,.jpeg,.png" /> |
|
||||
</button> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>资产列表</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-asset-select formControlName="assetIdList" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
</div> |
|
||||
@if (data?.value) { |
|
||||
<app-flow-result [flow]="data.value" /> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<ng-template #errorTpl let-control> |
|
||||
<form-error-tips [control]="control"></form-error-tips> |
|
||||
</ng-template> |
|
||||
</div> |
|
||||
@ -1,115 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
import { FlowResultComponent } from '../flow-result/flow-result.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-eam-asset-equipment-repair', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
FlowResultComponent, |
|
||||
], |
|
||||
templateUrl: './eam-asset-equipment-repair.component.html', |
|
||||
styleUrl: './eam-asset-equipment-repair.component.less', |
|
||||
}) |
|
||||
export class EamAssetEquipmentRepairComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
iconPreview = '' |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
|
|
||||
repairDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [ |
|
||||
FormValidators.required('请选择'), |
|
||||
]), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
assetIdList: this.fb.control([], []), |
|
||||
img: this.fb.control(null, []), |
|
||||
planCompleteTime: this.fb.control(null), |
|
||||
content: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
repairer: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
repairType: this.fb.control(1, [FormValidators.required('请选择')]), |
|
||||
|
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
notes: this.fb.control(null, []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.iconPreview = data.procVars?.img |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
repairDepartmentId: data.procVars?.repairDepartmentId + '', |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
|
|
||||
repairer: Number(v.repairer?.[0]), |
|
||||
applyDepartmentId: Number(v.applyDepartmentId?.[0]), |
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('img')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -1,142 +0,0 @@ |
|||||
<div class="modal-lg-container"> |
|
||||
<form nz-form [formGroup]="formGroup" nzLayout="vertical"> |
|
||||
<div class="overflow-hidden"> |
|
||||
<div nz-row [nzGutter]="24"> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>流程标题</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入流程标题" formControlName="title" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请部门</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-org-select formControlName="applyDepartmentId" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>申请人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入申请人" formControlName="applicant" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>紧急程度</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="urgency"> |
|
||||
<label nz-radio [nzValue]="1">普通</label> |
|
||||
<label nz-radio [nzValue]="2">紧急</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>业务名称</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入业务名称" formControlName="businessName" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>采购人</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-select-user-by-org formControlName="purchase" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>采购日期</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-date-picker |
|
||||
class="w-full" |
|
||||
nzPlaceHolder="请选择采购日期" |
|
||||
formControlName="purchaseTime" |
|
||||
/> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>供应商</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-supplier-select formControlName="supplier" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>到货日期</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-date-picker |
|
||||
class="w-full" |
|
||||
nzPlaceHolder="请选择到货日期" |
|
||||
formControlName="arrivalTime" |
|
||||
/> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label [nzRequired]="true">说明</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入说明" formControlName="desc"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>备注</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入原因" formControlName="notes"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>附件</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<button class="upload-btn" nz-button [nzLoading]="uploadLoading"> |
|
||||
<i nz-icon nzType="upload"></i> |
|
||||
选择文件 |
|
||||
<input type="file" (change)="onFileChange($event)" /> |
|
||||
</button> |
|
||||
@if (formGroup.get('attach')?.value) { |
|
||||
<div class="mt-1"> |
|
||||
<nz-tag class="break-words w-full !whitespace-pre-wrap"> |
|
||||
{{ formGroup.get('attach')?.value }} |
|
||||
</nz-tag> |
|
||||
</div> |
|
||||
} |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>资产列表</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-asset-select formControlName="assetIdList" [buy]="true" [storage]="true" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
</div> |
|
||||
@if (data?.value) { |
|
||||
<app-flow-result [flow]="data.value" /> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<ng-template #errorTpl let-control> |
|
||||
<form-error-tips [control]="control"></form-error-tips> |
|
||||
</ng-template> |
|
||||
</div> |
|
||||
@ -1,117 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
import { FlowResultComponent } from '../flow-result/flow-result.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-eam-asset-purchase-apply', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
FlowResultComponent, |
|
||||
], |
|
||||
templateUrl: './eam-asset-purchase-apply.component.html', |
|
||||
styleUrl: './eam-asset-purchase-apply.component.less', |
|
||||
}) |
|
||||
export class EamAssetPurchaseApplyComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
iconPreview = '' |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
businessName: this.fb.control('', [FormValidators.required('请输入')]), |
|
||||
applyDepartmentId: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
purchaseTime: this.fb.control(null, []), |
|
||||
purchase: this.fb.control(null, []), |
|
||||
arrivalTime: this.fb.control(null), |
|
||||
supplier: this.fb.control(null), |
|
||||
applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [ |
|
||||
FormValidators.required('请选择'), |
|
||||
]), |
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
desc: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
notes: this.fb.control(null, []), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
assetIdList: this.fb.control([], []), |
|
||||
|
|
||||
attach: this.fb.control(null, []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.iconPreview = data.procVars?.img |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
applyDepartmentId: data.procVars?.applyDepartmentId ? data.procVars?.applyDepartmentId + '' : null, |
|
||||
purchase: data.procVars?.purchase ? [data.procVars?.purchase + ''] : null, |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
purchase: Number(v.purchase?.[0]) ? Number(v.purchase?.[0]) : null, |
|
||||
applyDepartmentId: Number(v.applyDepartmentId?.[0]), |
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('attach')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -1,60 +0,0 @@ |
|||||
<div class="modal-lg-container"> |
|
||||
<form nz-form [formGroup]="formGroup" nzLayout="vertical"> |
|
||||
<div class="overflow-hidden"> |
|
||||
<div nz-row [nzGutter]="24"> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>流程标题</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<input nz-input placeholder="请输入流程标题" formControlName="title" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>业务日期</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-date-picker class="w-full" formControlName="businessDate"></nz-date-picker> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="6"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label nzRequired>紧急程度</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<nz-radio-group formControlName="urgency"> |
|
||||
<label nz-radio [nzValue]="1">普通</label> |
|
||||
<label nz-radio [nzValue]="2">紧急</label> |
|
||||
</nz-radio-group> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
|
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label [nzRequired]="true">领用说明</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<textarea nz-input placeholder="请输入领用说明" formControlName="notes"></textarea> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
<div nz-col [nzSpan]="24"> |
|
||||
<nz-form-item> |
|
||||
<nz-form-label>资产列表</nz-form-label> |
|
||||
<nz-form-control [nzErrorTip]="errorTpl"> |
|
||||
<app-asset-select formControlName="assetIdList" /> |
|
||||
</nz-form-control> |
|
||||
</nz-form-item> |
|
||||
</div> |
|
||||
</div> |
|
||||
@if (data?.value) { |
|
||||
<app-flow-result [flow]="data.value" /> |
|
||||
} |
|
||||
</div> |
|
||||
</form> |
|
||||
|
|
||||
<ng-template #errorTpl let-control> |
|
||||
<form-error-tips [control]="control"></form-error-tips> |
|
||||
</ng-template> |
|
||||
</div> |
|
||||
@ -1,106 +0,0 @@ |
|||||
import { Component, Input, OnInit, inject } from '@angular/core' |
|
||||
import { FormBuilder, FormGroup } from '@angular/forms' |
|
||||
import { ApiService } from 'app/services' |
|
||||
import { SharedModule } from 'app/shared/shared.module' |
|
||||
import { FormValidators, Utils } from 'app/utils' |
|
||||
import { NzMessageService } from 'ng-zorro-antd/message' |
|
||||
import { OrgSelectComponent } from '../../org-select/org-select.component' |
|
||||
import { SelectUserByOrgComponent } from '../../select-user-by-org/select-user-by-org.component' |
|
||||
import { PositionSelectComponent } from '../../position-select/position-select.component' |
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
|
||||
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
|
||||
import { SupplierSelectComponent } from '../../supplier-select/supplier-select.component' |
|
||||
import { AssetSelectComponent } from '../../asset-select/asset-select.component' |
|
||||
import { WarehouseSelectComponent } from '../../warehouse-select/warehouse-select.component' |
|
||||
import { FlowResultComponent } from '../flow-result/flow-result.component' |
|
||||
|
|
||||
@Component({ |
|
||||
selector: 'app-eam-asset-stock-goods-use', |
|
||||
standalone: true, |
|
||||
imports: [ |
|
||||
SharedModule, |
|
||||
SelectUserByOrgComponent, |
|
||||
SupplierSelectComponent, |
|
||||
AssetSelectComponent, |
|
||||
OrgSelectComponent, |
|
||||
PositionSelectComponent, |
|
||||
WarehouseSelectComponent, |
|
||||
FlowResultComponent, |
|
||||
], |
|
||||
templateUrl: './eam-asset-stock-goods-use.component.html', |
|
||||
styleUrl: './eam-asset-stock-goods-use.component.less', |
|
||||
}) |
|
||||
export class EamAssetStockGoodsUseComponent { |
|
||||
constructor( |
|
||||
private fb: FormBuilder, |
|
||||
private api: ApiService, |
|
||||
private msg: NzMessageService, |
|
||||
) {} |
|
||||
|
|
||||
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
|
||||
|
|
||||
formGroup!: FormGroup |
|
||||
|
|
||||
groupIndex = 0 |
|
||||
|
|
||||
uploadLoading = false |
|
||||
|
|
||||
ngOnInit(): void { |
|
||||
console.log('this.data', this.data) |
|
||||
this.formGroup = this.fb.group({ |
|
||||
id: this.fb.control(null, []), |
|
||||
title: this.fb.control(this.data.value?.name, [FormValidators.required('请输入')]), |
|
||||
// useUserId: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
businessDate: this.fb.control(null, [FormValidators.required('请选择')]), |
|
||||
// applicant: this.fb.control({ value: this.api.authInfo?.userName, disabled: true }, [
|
|
||||
// FormValidators.required('请选择'),
|
|
||||
// ]),
|
|
||||
// businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]),
|
|
||||
|
|
||||
notes: this.fb.control(null, [FormValidators.required('请输入')]), |
|
||||
urgency: this.fb.control(1, []), |
|
||||
assetIdList: this.fb.control([], []), |
|
||||
}) |
|
||||
|
|
||||
this.patchValues() |
|
||||
} |
|
||||
|
|
||||
patchValues() { |
|
||||
const { value: data, preview } = this.data |
|
||||
if (data) { |
|
||||
this.formGroup.patchValue({ |
|
||||
...data.procVars, |
|
||||
applyDepartmentId: data.procVars?.applyDepartmentId + '', |
|
||||
}) |
|
||||
} |
|
||||
if (preview) { |
|
||||
this.formGroup.disable() |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public getValues() { |
|
||||
let values = null |
|
||||
if (FormValidators.validateFormGroup(this.formGroup)) { |
|
||||
const v = this.formGroup.value |
|
||||
|
|
||||
values = { |
|
||||
...v, |
|
||||
|
|
||||
applyDepartmentId: Number(v.applyDepartmentId?.[0]), |
|
||||
} |
|
||||
} |
|
||||
return values |
|
||||
} |
|
||||
|
|
||||
onFileChange(e: Event) { |
|
||||
const target = e.target as HTMLInputElement |
|
||||
const file = target.files![0] |
|
||||
target.value = '' |
|
||||
|
|
||||
const formdata = new FormData() |
|
||||
formdata.append('file', file) |
|
||||
this.api.upload(formdata).subscribe((res) => { |
|
||||
this.formGroup.get('attach')?.setValue(res.body.fileName) |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,122 @@ |
|||||
|
import { Component, Input, OnInit, inject } from '@angular/core' |
||||
|
import { FormBuilder, FormGroup } from '@angular/forms' |
||||
|
import { ApiService } from 'app/services' |
||||
|
import { SharedModule } from 'app/shared/shared.module' |
||||
|
import { FormValidators, Utils } from 'app/utils' |
||||
|
import { NzMessageService } from 'ng-zorro-antd/message' |
||||
|
import { AssetCategorySelectComponent } from '../asset-category-select/asset-category-select.component' |
||||
|
import { OrgSelectComponent } from '../org-select/org-select.component' |
||||
|
import { ASSET_SOURCE_MAP, ASSET_STATUS, MAINTENANCE_STATUS, MAINTENANCE_TYPE } from 'app/constants' |
||||
|
import { SelectUserByOrgComponent } from '../select-user-by-org/select-user-by-org.component' |
||||
|
import { ManufacturerSelectComponent } from '../manufacturer-select/manufacturer-select.component' |
||||
|
import { PositionSelectComponent } from '../position-select/position-select.component' |
||||
|
import { MaintenanceSelectComponent } from '../maintenance-select/maintenance-select.component' |
||||
|
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
||||
|
import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' |
||||
|
import { SupplierSelectComponent } from '../supplier-select/supplier-select.component' |
||||
|
import { AssetSelectComponent } from '../asset-select/asset-select.component' |
||||
|
import { WarehouseSelectComponent } from '../warehouse-select/warehouse-select.component' |
||||
|
import { FlowResultComponent } from '../apply-asset-flow/flow-result/flow-result.component' |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'app-asset-business-outbound-form', |
||||
|
standalone: true, |
||||
|
imports: [ |
||||
|
SharedModule, |
||||
|
SelectUserByOrgComponent, |
||||
|
SupplierSelectComponent, |
||||
|
AssetSelectComponent, |
||||
|
WarehouseSelectComponent, |
||||
|
FlowResultComponent, |
||||
|
], |
||||
|
templateUrl: './asset-business-outbound-form.component.html', |
||||
|
styleUrl: './asset-business-outbound-form.component.less', |
||||
|
}) |
||||
|
export class AssetBusinessOutboundFormComponent { |
||||
|
constructor( |
||||
|
private fb: FormBuilder, |
||||
|
private api: ApiService, |
||||
|
private msg: NzMessageService, |
||||
|
) {} |
||||
|
|
||||
|
readonly data: NzSafeAny = inject(NZ_MODAL_DATA) |
||||
|
|
||||
|
formGroup!: FormGroup |
||||
|
|
||||
|
groupIndex = 0 |
||||
|
|
||||
|
uploadLoading = false |
||||
|
|
||||
|
ngOnInit(): void { |
||||
|
this.formGroup = this.fb.group({ |
||||
|
id: this.fb.control(null, []), |
||||
|
name: this.fb.control(this.api.genFlowName('出库'), [FormValidators.required('请输入')]), |
||||
|
|
||||
|
useUserId: this.fb.control(null, []), |
||||
|
manager: this.fb.control(null, []), |
||||
|
urgency: this.fb.control(1, []), |
||||
|
businessGeneratedDate: this.fb.control(null, []), |
||||
|
supplierVendorId: this.fb.control(null, []), |
||||
|
notes: this.fb.control(null, []), |
||||
|
assetIdList: this.fb.control([], []), |
||||
|
attach: this.fb.control('', []), |
||||
|
}) |
||||
|
|
||||
|
this.patchValues() |
||||
|
} |
||||
|
|
||||
|
patchValues() { |
||||
|
const { value: data, preview } = this.data |
||||
|
if (data) { |
||||
|
this.formGroup.patchValue({ |
||||
|
...data, |
||||
|
|
||||
|
useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], |
||||
|
manager: data._manager?.userId ? [data._manager?.userId] : [], |
||||
|
// responsiblePerson: data._responsiblePerson?.userId ? [data._responsiblePerson?.userId] : [],
|
||||
|
// categoryId: data._category?.categoryId + '',
|
||||
|
// positionId: data._position?.positionId + '',
|
||||
|
// ownCompanyId: data._ownCompany?.organizationId + '',
|
||||
|
// useOrganizationId: data._useOrganization?.organizationId + '',
|
||||
|
maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId, |
||||
|
warehouseId: data._warehouse?.warehouseId, |
||||
|
// manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId,
|
||||
|
}) |
||||
|
} |
||||
|
if (preview) { |
||||
|
this.formGroup.disable() |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public getValues() { |
||||
|
let values = null |
||||
|
if (FormValidators.validateFormGroup(this.formGroup)) { |
||||
|
const v = this.formGroup.value |
||||
|
|
||||
|
values = { |
||||
|
...v, |
||||
|
useUserId: v.useUserId?.[0], |
||||
|
manager: v.manager?.[0], |
||||
|
categoryId: v.categoryId?.[0], |
||||
|
ownCompanyId: v.ownCompanyId?.[0], |
||||
|
positionId: v.positionId, |
||||
|
useOrganizationId: v.useOrganizationId?.[0], |
||||
|
responsiblePerson: v.responsiblePerson?.[0], |
||||
|
assetIdList: v.assetIdList, |
||||
|
} |
||||
|
} |
||||
|
return values |
||||
|
} |
||||
|
|
||||
|
onFileChange(e: Event) { |
||||
|
const target = e.target as HTMLInputElement |
||||
|
const file = target.files![0] |
||||
|
target.value = '' |
||||
|
|
||||
|
const formdata = new FormData() |
||||
|
formdata.append('file', file) |
||||
|
this.api.upload(formdata).subscribe((res) => { |
||||
|
this.formGroup.get('attach')?.setValue(res.body.fileName) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
@ -1,4 +0,0 @@ |
|||||
.modal { |
|
||||
height: 70vh; |
|
||||
overflow-y: auto; |
|
||||
} |
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,62 @@ |
|||||
|
@switch (status) { |
||||
|
@case ('APPROVAL') { |
||||
|
<nz-tag nzColor="blue" data-color="text-blue-500">待审批</nz-tag> |
||||
|
} |
||||
|
@case (2) { |
||||
|
<nz-tag nzColor="blue" data-color="text-blue-500">待审批</nz-tag> |
||||
|
} |
||||
|
@case ('TO_BE_ASSIGNED') { |
||||
|
<nz-tag nzColor="blue" data-color="text-yellow-500">待指派</nz-tag> |
||||
|
} |
||||
|
@case (7) { |
||||
|
<nz-tag nzColor="blue" data-color="text-yellow-500">待指派</nz-tag> |
||||
|
} |
||||
|
@case ('DISPOSE') { |
||||
|
<nz-tag nzColor="blue" data-color="text-blue-500">待处置</nz-tag> |
||||
|
} |
||||
|
@case (9) { |
||||
|
<nz-tag nzColor="blue" data-color="text-blue-500">待处置</nz-tag> |
||||
|
} |
||||
|
@case ('COMPLETED') { |
||||
|
<nz-tag nzColor="green" data-color="text-green-500">已完结</nz-tag> |
||||
|
} |
||||
|
@case (3) { |
||||
|
<nz-tag nzColor="green" data-color="text-green-500">已完结</nz-tag> |
||||
|
} |
||||
|
@case ('EXCEPTION') { |
||||
|
<nz-tag nzColor="red" data-color="text-red-500">异常</nz-tag> |
||||
|
} |
||||
|
@case (6) { |
||||
|
<nz-tag nzColor="red" data-color="text-red-500">异常</nz-tag> |
||||
|
} |
||||
|
@case ('SUSPENDED') { |
||||
|
<nz-tag nzColor="red" data-color="text-yellow-500">已挂起</nz-tag> |
||||
|
} |
||||
|
@case (8) { |
||||
|
<nz-tag nzColor="red" data-color="text-yellow-500">已挂起</nz-tag> |
||||
|
} |
||||
|
|
||||
|
@case ('DISCARDED') { |
||||
|
<nz-tag class="dark" data-color="text-gray-500">废弃</nz-tag> |
||||
|
} |
||||
|
@case (5) { |
||||
|
<nz-tag class="dark" data-color="text-gray-500">废弃</nz-tag> |
||||
|
} |
||||
|
@case ('DRAFTING') { |
||||
|
<nz-tag class="dark" data-color="text-yellow-500">草稿</nz-tag> |
||||
|
} |
||||
|
@case (1) { |
||||
|
<nz-tag class="dark" data-color="text-yellow-500">草稿</nz-tag> |
||||
|
} |
||||
|
|
||||
|
@case ('REJECTED') { |
||||
|
<nz-tag class="dark" data-color="text-red-500">被驳回</nz-tag> |
||||
|
} |
||||
|
@case (4) { |
||||
|
<nz-tag class="dark" data-color="text-red-500">被驳回</nz-tag> |
||||
|
} |
||||
|
|
||||
|
@default { |
||||
|
{{ status }} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,5 @@ |
|||||
|
.dark { |
||||
|
background-color: transparent !important; |
||||
|
color: #333; |
||||
|
border-color: #333; |
||||
|
} |
||||
@ -0,0 +1,17 @@ |
|||||
|
import { Component, Input } from '@angular/core' |
||||
|
import { SharedModule } from 'app/shared/shared.module' |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'app-flow-status-tag', |
||||
|
standalone: true, |
||||
|
imports: [SharedModule], |
||||
|
templateUrl: './flow-status-tag.component.html', |
||||
|
styleUrl: './flow-status-tag.component.less', |
||||
|
}) |
||||
|
export class FlowStatusTagComponent { |
||||
|
constructor() {} |
||||
|
|
||||
|
@Input() status!: string | number |
||||
|
|
||||
|
ngOnInit() {} |
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
<button nz-button nzBlock (click)="onTriggerClick(selectUserModalTpl)" [disabled]="disabled"> |
||||
|
@if (selected || defaultValue) { |
||||
|
<span class="text-left !w-full"> |
||||
|
{{ selected.name || defaultValue?.name }} |
||||
|
</span> |
||||
|
} @else { |
||||
|
<i nz-icon nzType="plus"></i> |
||||
|
请选择 |
||||
|
} |
||||
|
</button> |
||||
|
|
||||
|
<ng-template #selectUserModalTpl> |
||||
|
<app-server-paginated-table [options]="table" [formGroup]="queryForm" [renderColumn]="renderColumnTpl"> |
||||
|
<ng-template #renderColumnTpl let-data let-key="key" let-row="row"> |
||||
|
@switch (key) { |
||||
|
@case ('status') { |
||||
|
<nz-tag> |
||||
|
{{ ASSET_STATUS_V2_MAP(data) }} |
||||
|
</nz-tag> |
||||
|
} |
||||
|
@case ('type') { |
||||
|
<nz-tag nzColor="teal"> |
||||
|
{{ businessType.get(data) }} |
||||
|
</nz-tag> |
||||
|
} |
||||
|
@case ('urgency') { |
||||
|
<nz-tag [nzColor]="data === 2 ? 'error' : ''"> |
||||
|
{{ data === 2 ? '紧急' : '普通' }} |
||||
|
</nz-tag> |
||||
|
} |
||||
|
|
||||
|
@default { |
||||
|
{{ data }} |
||||
|
} |
||||
|
} |
||||
|
</ng-template> |
||||
|
|
||||
|
<ng-container *appTableForm> |
||||
|
<app-query-item label="流程状态"> |
||||
|
<nz-select |
||||
|
nzPlaceHolder="请选择" |
||||
|
nzPlacement="bottomRight" |
||||
|
class="!w-24" |
||||
|
[nzDropdownMatchSelectWidth]="false" |
||||
|
formControlName="status" |
||||
|
nzAllowClear |
||||
|
> |
||||
|
<nz-option *ngFor="let item of ASSET_STATUS" [nzLabel]="item.label" [nzValue]="item.value" /> |
||||
|
</nz-select> |
||||
|
</app-query-item> |
||||
|
<app-query-item label="流程名称"> |
||||
|
<input nz-input placeholder="请输入" formControlName="name" /> |
||||
|
</app-query-item> |
||||
|
</ng-container> |
||||
|
</app-server-paginated-table> |
||||
|
</ng-template> |
||||
@ -0,0 +1,125 @@ |
|||||
|
import { Component, EventEmitter, forwardRef, inject, Input, OnInit, Output, TemplateRef } from '@angular/core' |
||||
|
import { ControlValueAccessor, FormControl, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms' |
||||
|
import { ASSET_STATUS_MAP, ASSET_STATUS_V2, businessType } from 'app/constants' |
||||
|
import { ApiService } from 'app/services' |
||||
|
import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' |
||||
|
import { SharedModule } from 'app/shared/shared.module' |
||||
|
import { NzSafeAny } from 'ng-zorro-antd/core/types' |
||||
|
import { NzModalService } from 'ng-zorro-antd/modal' |
||||
|
import { tap } from 'rxjs' |
||||
|
|
||||
|
@Component({ |
||||
|
selector: 'app-select-asset-flow', |
||||
|
standalone: true, |
||||
|
imports: [SharedModule], |
||||
|
templateUrl: './select-asset-flow.component.html', |
||||
|
styleUrl: './select-asset-flow.component.less', |
||||
|
providers: [ |
||||
|
{ |
||||
|
provide: NG_VALUE_ACCESSOR, |
||||
|
multi: true, |
||||
|
useExisting: forwardRef(() => SelectAssetFlowComponent), |
||||
|
}, |
||||
|
], |
||||
|
}) |
||||
|
export class SelectAssetFlowComponent implements ControlValueAccessor, OnInit { |
||||
|
constructor(private api: ApiService) {} |
||||
|
|
||||
|
@Input() type: 'tuiku' | 'guihuan' = 'tuiku' // 退库 | 归还
|
||||
|
|
||||
|
@Input() defaultValue: any |
||||
|
|
||||
|
@Output() onSelect = new EventEmitter() |
||||
|
|
||||
|
queryForm = new FormGroup({ |
||||
|
name: new FormControl(), |
||||
|
type: new FormControl(), |
||||
|
status: new FormControl(), |
||||
|
}) |
||||
|
|
||||
|
modal = inject(NzModalService) |
||||
|
|
||||
|
selected: NzSafeAny | null |
||||
|
|
||||
|
disabled = false |
||||
|
|
||||
|
ASSET_STATUS_MAP = ASSET_STATUS_MAP() |
||||
|
|
||||
|
ASSET_STATUS = ASSET_STATUS_V2 |
||||
|
|
||||
|
businessType = businessType |
||||
|
|
||||
|
allData = [] |
||||
|
|
||||
|
ASSET_STATUS_V2_MAP(v: number) { |
||||
|
return ASSET_STATUS_V2.find((f) => f.value === v)?.label ?? '-' |
||||
|
} |
||||
|
|
||||
|
table = new TableOption(this.fetchData.bind(this), { |
||||
|
cacheKey: 'accccc', |
||||
|
}) |
||||
|
|
||||
|
ngOnInit() { |
||||
|
this.table |
||||
|
.setConfig({ |
||||
|
selectable: true, |
||||
|
radio: true, |
||||
|
disbale(v) { |
||||
|
console.log('v', v) |
||||
|
return v.logStatus === 1 |
||||
|
}, |
||||
|
}) |
||||
|
.setColumn([ |
||||
|
{ key: 'businessId', title: '业务编号', visible: true }, |
||||
|
{ key: 'name', title: '流程名称', visible: true }, |
||||
|
{ key: 'status', title: '流程状态', visible: true, width: '100px' }, |
||||
|
{ key: 'urgency', title: '紧急程度', visible: true, width: '100px' }, |
||||
|
{ key: 'applicant', title: '发起人', visible: true }, |
||||
|
{ key: 'createTime', title: '创建时间', visible: true }, |
||||
|
]) |
||||
|
} |
||||
|
|
||||
|
fetchData(p: {}, q: AnyObject) { |
||||
|
const type = this.type === 'tuiku' ? 'COLLECTION' : 'BORROW' |
||||
|
return this.api.getAssetManagerPage({ ...p, ...q, type }).pipe( |
||||
|
tap((res) => { |
||||
|
this.allData = this.allData.concat(...(res.body?.rows ?? [])) |
||||
|
}), |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
onTriggerClick(nzContent: TemplateRef<NzSafeAny>) { |
||||
|
const title = this.type === 'tuiku' ? '领用流程' : '借用流程' |
||||
|
this.modal.create({ |
||||
|
nzTitle: `选择${title}流程`, |
||||
|
nzContent, |
||||
|
nzWidth: '80vw', |
||||
|
nzOnOk: () => { |
||||
|
this.selected = this.allData.find((f: any) => this.table.ref.selected.has(String(f.id))) |
||||
|
this.onChange(this.selected?.id) |
||||
|
this.onSelect.emit(this.selected) |
||||
|
}, |
||||
|
nzOnCancel: () => { |
||||
|
this.selected = null |
||||
|
}, |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
onTouched = () => {} |
||||
|
|
||||
|
onChange(v: NzSafeAny[]) {} |
||||
|
writeValue(obj: any): void { |
||||
|
this.selected = obj |
||||
|
} |
||||
|
registerOnChange(fn: any): void { |
||||
|
this.onChange = fn |
||||
|
} |
||||
|
|
||||
|
registerOnTouched(fn: any): void { |
||||
|
this.onTouched = fn |
||||
|
} |
||||
|
|
||||
|
setDisabledState?(isDisabled: boolean): void { |
||||
|
this.disabled = isDisabled |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
::ng-deep { |
||||
|
.pdfPreview { |
||||
|
width: 100%; |
||||
|
height: 80vh; |
||||
|
overflow: hidden; |
||||
|
|
||||
|
// .pdfIframe { |
||||
|
// margin-top: -58px; |
||||
|
// } |
||||
|
} |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue