diff --git a/web-admin-app/README.md b/web-admin-app/README.md index 40b5073..2307098 100644 --- a/web-admin-app/README.md +++ b/web-admin-app/README.md @@ -42,5 +42,25 @@ - 【资产入库】 需要添加一个接口,前端提交资产id列表,后端返回对应的资产数据列表 ## 05-05 -- 【维修登记】 新增接口报错 500 +-【分页】还是有问题 +-【维修登记】 新增接口报错 500 - 业务编号 需不需要输入? + +-【角色】新增、修改报错 提示操作错误 但是能保存 +-【维保到期预警接口】 500 +-【登录】 需要返回用户头像地址 + +-【businessGeneratedDate】 是否是领用日期 + +-【申请人】 + + +# 待解决问题 + +流程列表 不需要展示 + +处理流程 +- 审批 +- 驳回 +- 取消 + diff --git a/web-admin-app/src/app/app.routes.ts b/web-admin-app/src/app/app.routes.ts index 8b011c1..4305b8c 100644 --- a/web-admin-app/src/app/app.routes.ts +++ b/web-admin-app/src/app/app.routes.ts @@ -45,6 +45,12 @@ import { StockakingPlanComponent } from './pages/fixed-asset/stocktaking/stockak import { RepairTypeComponent } from './pages/fixed-asset/repair/repair-type/repair-type.component' import { RepairListComponent } from './pages/fixed-asset/repair/repair-list/repair-list.component' import { RepairFaultComponent } from './pages/fixed-asset/repair/repair-fault/repair-fault.component' +import { SystemRoleComponent } from './pages/system/system-role/system-role.component' +import { AlertBorrowComponent } from './pages/fixed-asset/alert/alert-borrow/alert-borrow.component' +import { AlertMaintenanceComponent } from './pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component' +import { AlertInventorySafetyComponent } from './pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component' +import { AlertInventoryUpComponent } from './pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component' +import { AlertInventoryDownComponent } from './pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component' export const routes: Routes = [ { @@ -73,7 +79,7 @@ export const routes: Routes = [ { path: 'profile', component: ProfileComponent, - + title: '个人中心', children: [ { path: '', @@ -83,16 +89,19 @@ export const routes: Routes = [ { path: 'basic', component: ProfileBasicComponent, + title: '基础信息', }, { path: 'account', component: ProfileAccountComponent, + title: '账号密码', }, ], }, { path: 'system', component: SystemComponent, + title: '系统管理', children: [ { path: '', @@ -101,36 +110,42 @@ export const routes: Routes = [ }, { path: 'user', - component: SystemUserComponent, - canActivate: [permissionGuard], - data: { - permission: 'user', - }, - }, - ], - }, - { - path: 'org', - component: OrgComponent, - title: '人事管理', - children: [ - { - path: '', - pathMatch: 'full', - redirectTo: 'setting', - }, - { - path: 'setting', component: OrgSettingComponent, + canActivate: [permissionGuard], title: '组织架构', + data: {}, }, { - path: 'employee', - component: OrgEmployeeComponent, - title: '员工管理', + path: 'role', + component: SystemRoleComponent, + canActivate: [permissionGuard], + title: '角色管理', + data: {}, }, ], }, + // { + // path: 'org', + // component: OrgComponent, + // title: '人事管理', + // children: [ + // { + // path: '', + // pathMatch: 'full', + // redirectTo: 'setting', + // }, + // { + // path: 'setting', + // component: OrgSettingComponent, + // title: '组织架构', + // }, + // { + // path: 'employee', + // component: OrgEmployeeComponent, + // title: '员工管理', + // }, + // ], + // }, { path: 'fixed-asset', title: '固资管理', @@ -337,6 +352,52 @@ export const routes: Routes = [ }, ], }, + { + path: 'alert', + title: '预警中心', + children: [ + { + path: '', + pathMatch: 'full', + redirectTo: 'borrow', + }, + { + path: 'borrow', + component: AlertBorrowComponent, + title: '借用预警', + }, + { + path: 'maintenance', + component: AlertMaintenanceComponent, + title: '维保到期预警', + }, + { + path: 'inventory', + children: [ + { + path: '', + pathMatch: 'full', + redirectTo: 'safety', + }, + { + path: 'safety', + component: AlertInventorySafetyComponent, + title: '安全库存预警', + }, + { + path: 'up', + component: AlertInventoryUpComponent, + title: '安全库存上限', + }, + { + path: 'down', + component: AlertInventoryDownComponent, + title: '安全库存下限', + }, + ], + }, + ], + }, ], }, ], diff --git a/web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.html b/web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.html index 0b2b9f9..adbc56b 100644 --- a/web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.html +++ b/web-admin-app/src/app/components/asset-business-allot-form/asset-business-allot-form.component.html @@ -26,6 +26,14 @@ +
+ + 申请人 + + + + +
+
+ + 申请人 + + + +
diff --git a/web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.ts b/web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.ts index 32df8de..5e6395d 100644 --- a/web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.ts +++ b/web-admin-app/src/app/components/asset-business-return-form/asset-business-return-form.component.ts @@ -11,6 +11,7 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types' import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' import { 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-business-return-form', @@ -22,6 +23,7 @@ import { AssetSelectComponent } from '../asset-select/asset-select.component' AssetSelectComponent, OrgSelectComponent, PositionSelectComponent, + WarehouseSelectComponent, ], templateUrl: './asset-business-return-form.component.html', styleUrl: './asset-business-return-form.component.less', @@ -45,9 +47,10 @@ export class AssetBusinessReturnFormComponent { this.formGroup = this.fb.group({ id: this.fb.control(null, []), name: this.fb.control('', [FormValidators.required('请输入')]), - useUserId: this.fb.control(null, [FormValidators.required('请选择')]), + // useUserId: this.fb.control(null, [FormValidators.required('请选择')]), useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]), businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]), + warehouseId: this.fb.control(null, [FormValidators.required('请选择')]), notes: this.fb.control(null, []), positionId: this.fb.control(null, []), @@ -55,6 +58,8 @@ export class AssetBusinessReturnFormComponent { positionDetail: this.fb.control('', []), assetIdList: this.fb.control([], []), + + applicant: this.fb.control({ value: '', disabled: true }, []), }) this.patchValues() @@ -67,8 +72,16 @@ export class AssetBusinessReturnFormComponent { ...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, + applicant: data._applicant?.userName, }) } if (preview) { @@ -89,7 +102,7 @@ export class AssetBusinessReturnFormComponent { ownCompanyId: v.ownCompanyId?.[0], positionId: Number(v.positionId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]), - assetIdList: JSON.stringify(v.assetIdList), + assetIdList: v.assetIdList, } } return values diff --git a/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.html b/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.html index 6606b5c..2b2e6c2 100644 --- a/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.html +++ b/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.html @@ -19,13 +19,21 @@
+ + 申请人 + + + + +
+
管理人 diff --git a/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.ts b/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.ts index e3c3c95..f566d95 100644 --- a/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.ts +++ b/web-admin-app/src/app/components/asset-business-revert-form/asset-business-revert-form.component.ts @@ -48,7 +48,7 @@ export class AssetBusinessRevertFormComponent { businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]), manager: this.fb.control(null, []), useUserId: this.fb.control(null, []), - useOrganizationId: this.fb.control(null, []), + // useOrganizationId: this.fb.control(null, []), notes: this.fb.control(null, []), positionId: this.fb.control(null, []), @@ -56,6 +56,7 @@ export class AssetBusinessRevertFormComponent { positionDetail: this.fb.control('', []), assetIdList: this.fb.control([], []), + applicant: this.fb.control({ value: '', disabled: true }, []), }) this.patchValues() @@ -68,8 +69,16 @@ export class AssetBusinessRevertFormComponent { ...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, + applicant: data._applicant?.userName, }) } if (preview) { @@ -90,7 +99,7 @@ export class AssetBusinessRevertFormComponent { ownCompanyId: v.ownCompanyId?.[0], positionId: Number(v.positionId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]), - assetIdList: JSON.stringify(v.assetIdList), + assetIdList: v.assetIdList, } } return values diff --git a/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.html b/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.html index 6ccaf6c..14f940e 100644 --- a/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.html +++ b/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.html @@ -10,6 +10,14 @@
+
+ + 仓库 + + + + +
管理人员 diff --git a/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.ts b/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.ts index 5c3e6a4..6d860d2 100644 --- a/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.ts +++ b/web-admin-app/src/app/components/asset-business-storage-form/asset-business-storage-form.component.ts @@ -15,11 +15,18 @@ import { NzSafeAny } from 'ng-zorro-antd/core/types' import { NZ_MODAL_DATA } from 'ng-zorro-antd/modal' import { 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-business-storage', standalone: true, - imports: [SharedModule, SelectUserByOrgComponent, SupplierSelectComponent, AssetSelectComponent], + imports: [ + SharedModule, + SelectUserByOrgComponent, + SupplierSelectComponent, + AssetSelectComponent, + WarehouseSelectComponent, + ], templateUrl: './asset-business-storage-form.component.html', styleUrl: './asset-business-storage-form.component.less', }) @@ -42,6 +49,7 @@ export class AssetBusinessStorageFormComponent { this.formGroup = this.fb.group({ id: this.fb.control(null, []), name: this.fb.control('', [FormValidators.required('请输入')]), + warehouseId: this.fb.control('', [FormValidators.required('请输入')]), manager: this.fb.control(null, []), createTime: this.fb.control(null, []), supplierVendorId: this.fb.control(null, []), @@ -67,6 +75,7 @@ export class AssetBusinessStorageFormComponent { ownCompanyId: data._ownCompany?.organizationId + '', useOrganizationId: data._useOrganization?.organizationId + '', maintenanceVendor: data._maintenanceVendor?.maintenanceVendorId, + warehouseId: data._warehouse?.warehouseId, manufacturersVendorId: data._manufacturersVendor?.manufacturersVendorId, }) } @@ -89,7 +98,7 @@ export class AssetBusinessStorageFormComponent { positionId: v.positionId?.[0], useOrganizationId: v.useOrganizationId?.[0], responsiblePerson: v.responsiblePerson?.[0], - assetIdList: JSON.stringify(v.assetIdList), + assetIdList: v.assetIdList, } } return values diff --git a/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.html b/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.html index 4012d6e..a3651ee 100644 --- a/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.html +++ b/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.html @@ -36,12 +36,20 @@
- 使用人员 + 使用人员
+
+ + 申请人 + + + + +
存放位置 diff --git a/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.ts b/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.ts index e9ff588..8d8a68c 100644 --- a/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.ts +++ b/web-admin-app/src/app/components/asset-business-transfer-form/asset-business-transfer-form.component.ts @@ -47,7 +47,7 @@ export class AssetBusinessTransferFormComponent { this.formGroup = this.fb.group({ id: this.fb.control(null, []), name: this.fb.control('', [FormValidators.required('请输入')]), - useUserId: this.fb.control(null, []), + useUserId: this.fb.control(null, [FormValidators.required('请选择')]), // useOrganizationId: this.fb.control(null, [FormValidators.required('请选择')]), // businessGeneratedDate: this.fb.control(null, [FormValidators.required('请选择')]), @@ -61,6 +61,7 @@ export class AssetBusinessTransferFormComponent { positionDetail: this.fb.control('', []), assetIdList: this.fb.control([], []), + applicant: this.fb.control({ value: '', disabled: true }, []), }) this.patchValues() @@ -75,6 +76,7 @@ export class AssetBusinessTransferFormComponent { useUserId: data._useUser?.userId ? [data._useUser?.userId] : [], positionId: data._position?.positionId + '', useOrganizationId: data._useOrganization?.organizationId + '', + applicant: data._applicant?.userName, }) } if (preview) { @@ -90,12 +92,14 @@ export class AssetBusinessTransferFormComponent { values = { ...v, useUserId: v.useUserId?.[0], - manager: v.manager?.[0], + managerId: v.managerId?.[0], categoryId: v.categoryId?.[0], ownCompanyId: v.ownCompanyId?.[0], positionId: Number(v.positionId?.[0]), useOrganizationId: Number(v.useOrganizationId?.[0]), - assetIdList: JSON.stringify(v.assetIdList), + inUseOrganizationId: Number(v.inUseOrganizationId?.[0]), + outUseOrganizationId: Number(v.outUseOrganizationId?.[0]), + assetIdList: v.assetIdList, } } return values diff --git a/web-admin-app/src/app/components/asset-select/asset-select.component.ts b/web-admin-app/src/app/components/asset-select/asset-select.component.ts index dff8417..34f095f 100644 --- a/web-admin-app/src/app/components/asset-select/asset-select.component.ts +++ b/web-admin-app/src/app/components/asset-select/asset-select.component.ts @@ -142,6 +142,7 @@ export class AssetSelectComponent { onRemove() { this.selectedDataList = this.selectedDataList.filter((i) => !this.setOfCheckedId.has(i.assetId)) this.refreshCheckedStatus() + this.onChange(this.selectedDataList.map((i) => i.assetId)) } updateCheckedSet(id: number, checked: boolean): void { @@ -176,7 +177,20 @@ export class AssetSelectComponent { onChange(v: NzSafeAny[]) {} writeValue(v: NzSafeAny): void { - this.selectedDataList = [] + let vals = [] + if (typeof v === 'string') { + try { + vals = JSON.parse(v) ?? [] + } catch (error) {} + } + if (Array.isArray(vals) && vals.length > 0) { + this.api.getAssetListByIds(vals).subscribe((res) => { + this.selectedDataList = res.body.map((item: NzSafeAny) => { + this.allGetedDataMap.set(item.assetId, item) + return item + }) + }) + } } registerOnChange(fn: any): void { diff --git a/web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.html b/web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.html index b5dddd9..e86ef16 100644 --- a/web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.html +++ b/web-admin-app/src/app/components/component-basic-category-tree/component-basic-category-tree.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/web-admin-app/src/app/components/component-org-tree/component-org-tree.component.ts b/web-admin-app/src/app/components/component-org-tree/component-org-tree.component.ts index fce2f29..4d6f8df 100644 --- a/web-admin-app/src/app/components/component-org-tree/component-org-tree.component.ts +++ b/web-admin-app/src/app/components/component-org-tree/component-org-tree.component.ts @@ -2,54 +2,13 @@ import { Component, EventEmitter, Input, OnInit, Output, TemplateRef } from '@an import { FormBuilder, FormGroup } from '@angular/forms' import { ApiService } from 'app/services' import { SharedModule } from 'app/shared/shared.module' -import { FormValidators } from 'app/utils' +import { FormValidators, Utils } from 'app/utils' import { NzSafeAny } from 'ng-zorro-antd/core/types' import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer' import { NzMessageService } from 'ng-zorro-antd/message' import { NzModalService } from 'ng-zorro-antd/modal' import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree' -interface Organization { - depth: string - orderNum: number - organizationId: number - organizationName: string - organizationType: string - parentId: number - status: string -} -function buildTree(organizations: Organization[]): NzTreeNodeOptions[] { - const map: { [parentId: number]: NzTreeNodeOptions[] } = {} - - organizations.forEach((org) => { - if (!map[org.parentId]) { - map[org.parentId] = [] - } - const treeNode: NzTreeNodeOptions = { - ...org, - title: org.organizationName, - key: org.organizationId.toString(), - } - map[org.parentId].push(treeNode) - }) - - const build = (parentId: number): NzTreeNodeOptions[] => { - if (!map[parentId]) { - return [] - } - return map[parentId].map((node) => { - const children = build(parseInt(node.key)) - return { - ...node, - isLeaf: children.length === 0, - children, - } - }) - } - - return build(0) -} - @Component({ selector: 'app-component-org-tree', standalone: true, @@ -68,6 +27,10 @@ export class ComponentOrgTreeComponent implements OnInit { @Input() createable = true + @Input() company: boolean = false + + @Input() companyAndOrg: boolean = false + @Output() onOrgSelectedChange = new EventEmitter() drawerRef?: NzDrawerRef @@ -78,6 +41,8 @@ export class ComponentOrgTreeComponent implements OnInit { parentId?: number + originTreeData: NzSafeAny[] = [] + nodes: NzSafeAny[] = [] expandedKeys: string[] = [] @@ -95,7 +60,26 @@ export class ComponentOrgTreeComponent implements OnInit { initTree() { this.api.getOrgTree().subscribe((res) => { - this.nodes = buildTree(res.body) + this.originTreeData = res.body + let c: NzSafeAny[] = res.body + if (this.company) { + c = [] + res.body.forEach((i: NzSafeAny) => { + if (i.organizationType === '0') { + c.push(i) + } + }) + } + if (this.companyAndOrg) { + c = [] + res.body.forEach((i: NzSafeAny) => { + if (['1', '0'].includes(i.organizationType)) { + c.push(i) + } + }) + } + + this.nodes = Utils.buildTree(c, 'organizationId', 'organizationName') this.expandedKeys = [...this.expandedKeys] }) } diff --git a/web-admin-app/src/app/components/index.ts b/web-admin-app/src/app/components/index.ts index d8aac2e..0dd2bf7 100644 --- a/web-admin-app/src/app/components/index.ts +++ b/web-admin-app/src/app/components/index.ts @@ -22,3 +22,5 @@ export * from './asset-business-transfer-form/asset-business-transfer-form.compo export * from './repair-form/repair-form.component' export * from './repair-fault-form/repair-fault-form.component' + +export * from './position-tree/position-tree.component' diff --git a/web-admin-app/src/app/components/org-select/org-select.component.ts b/web-admin-app/src/app/components/org-select/org-select.component.ts index 3ed4a8a..fc4a5fe 100644 --- a/web-admin-app/src/app/components/org-select/org-select.component.ts +++ b/web-admin-app/src/app/components/org-select/org-select.component.ts @@ -48,7 +48,6 @@ export class OrgSelectComponent implements ControlValueAccessor, OnInit { ngOnInit(): void { this.api.getOrgTree().subscribe((res) => { this.originTreeData = res.body - const c: NzSafeAny[] = [] res.body.forEach((i: NzSafeAny) => { if (this.company) { diff --git a/web-admin-app/src/app/components/position-tree/position-tree.component.html b/web-admin-app/src/app/components/position-tree/position-tree.component.html new file mode 100644 index 0000000..4bbf2b9 --- /dev/null +++ b/web-admin-app/src/app/components/position-tree/position-tree.component.html @@ -0,0 +1,37 @@ +
+
+
+ + + + + + +
+
+
+ + +
+
+ {{ node.title }} +
+ @if (createable) { + + } +
+
+
+
+
diff --git a/web-admin-app/src/app/components/position-tree/position-tree.component.less b/web-admin-app/src/app/components/position-tree/position-tree.component.less new file mode 100644 index 0000000..e69de29 diff --git a/web-admin-app/src/app/components/position-tree/position-tree.component.ts b/web-admin-app/src/app/components/position-tree/position-tree.component.ts new file mode 100644 index 0000000..92cbe60 --- /dev/null +++ b/web-admin-app/src/app/components/position-tree/position-tree.component.ts @@ -0,0 +1,73 @@ +import { Component, EventEmitter, Input, OnInit, Output, TemplateRef } from '@angular/core' +import { FormBuilder, FormGroup } from '@angular/forms' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' +import { FormValidators, Utils } from 'app/utils' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer' +import { NzMessageService } from 'ng-zorro-antd/message' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzFormatEmitEvent, NzTreeNodeOptions } from 'ng-zorro-antd/tree' + +@Component({ + selector: 'app-position-tree', + standalone: true, + imports: [SharedModule], + templateUrl: './position-tree.component.html', + styleUrl: './position-tree.component.less', +}) +export class PositionTreeComponent { + constructor( + private api: ApiService, + private drawer: NzDrawerService, + private fb: FormBuilder, + private msg: NzMessageService, + private modal: NzModalService, + ) {} + + @Input() createable = true + + @Output() onSelectedChange = new EventEmitter() + + drawerRef?: NzDrawerRef + + searchValue = '' + + parentId?: number + + originTreeData: NzSafeAny[] = [] + + nodes: NzSafeAny[] = [] + + expandedKeys: string[] = [] + + form!: FormGroup + + initTree() { + this.api.getBasicPositionTree().subscribe((res) => { + this.originTreeData = res.body + + this.nodes = Utils.buildTree(res.body, 'positionId', 'name') + this.expandedKeys = [...this.expandedKeys] + }) + } + + ngOnInit(): void { + this.initTree() + } + + nzEvent(event: NzFormatEmitEvent): void { + if (event.eventName === 'click') { + const { node } = event + this.onSelectedChange.emit(event.keys?.length === 0 ? null : node?.origin) + } + } + + onExpandChange(e: NzFormatEmitEvent) { + this.expandedKeys = e.keys ?? [] + } + + onSelectedKeysChange(e: string[]) { + console.log('e', e) + } +} diff --git a/web-admin-app/src/app/components/repair-fault-form/repair-fault-form.component.ts b/web-admin-app/src/app/components/repair-fault-form/repair-fault-form.component.ts index 731a42e..c569e35 100644 --- a/web-admin-app/src/app/components/repair-fault-form/repair-fault-form.component.ts +++ b/web-admin-app/src/app/components/repair-fault-form/repair-fault-form.component.ts @@ -96,7 +96,7 @@ export class RepairFaultFormComponent { positionId: v.positionId?.[0], useOrganizationId: v.useOrganizationId?.[0], responsiblePerson: v.responsiblePerson?.[0], - assetIdList: JSON.stringify(v.assetIdList), + assetIdList: v.assetIdList, } } return values diff --git a/web-admin-app/src/app/components/repair-form/repair-form.component.ts b/web-admin-app/src/app/components/repair-form/repair-form.component.ts index e297d73..052d40d 100644 --- a/web-admin-app/src/app/components/repair-form/repair-form.component.ts +++ b/web-admin-app/src/app/components/repair-form/repair-form.component.ts @@ -93,7 +93,7 @@ export class RepairFormComponent { positionId: v.positionId?.[0], useOrganizationId: v.useOrganizationId?.[0], responsiblePerson: v.responsiblePerson?.[0], - assetIdList: JSON.stringify(v.assetIdList), + assetIdList: v.assetIdList, } } return values diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.html b/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.html new file mode 100644 index 0000000..aca9648 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.html @@ -0,0 +1,33 @@ + +
+ + + @switch (key) { + @case ('status') { + @switch (data) { + @case ('0') { + + } + @case ('1') { + + } + } + } + @default { + {{ data }} + } + } + + + + + + + + + + + + +
+
diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.less b/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.less new file mode 100644 index 0000000..e69de29 diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.ts b/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.ts new file mode 100644 index 0000000..331a9fa --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-borrow/alert-borrow.component.ts @@ -0,0 +1,61 @@ +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' +import { format } from 'date-fns' +import { lastValueFrom, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { BUSINESS_STATUS_MAP } from 'app/constants' +import { FormValidators } from 'app/utils' + +@Component({ + selector: 'app-alert-borrow', + standalone: true, + imports: [SharedModule], + templateUrl: './alert-borrow.component.html', + styleUrl: './alert-borrow.component.less', +}) +export class AlertBorrowComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + @ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}> + + queryForm = new FormGroup({ + roleName: new FormControl(''), + status: new FormControl(''), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: 'roleId', title: '主键', visible: false }, + + { key: 'roleName', title: '资产分类', visible: true }, + { key: 'roleSort', title: '资产编号', visible: true }, + { key: 'roleSort', title: '名称', visible: true }, + { key: 'roleSort', title: '规格型号', visible: true }, + + { key: 'status', title: '状态', visible: true }, + { key: 'remark', title: '备注', visible: true }, + // { key: 'createTime', title: '创建时间', visible: true }, + ]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getAlertBorrow({ ...p, ...q }) + } +} diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.html b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.html new file mode 100644 index 0000000..524bc28 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.html @@ -0,0 +1,44 @@ + +
+ + + @switch (key) { + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + + + + + + + + + + + +
+
diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.less b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.less new file mode 100644 index 0000000..e69de29 diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.ts b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.ts new file mode 100644 index 0000000..9d40e78 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-down/alert-inventory-down.component.ts @@ -0,0 +1,56 @@ +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' +import { format } from 'date-fns' +import { lastValueFrom, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { BUSINESS_STATUS_MAP } from 'app/constants' +import { FormValidators } from 'app/utils' + +@Component({ + selector: 'app-alert-inventory-down', + standalone: true, + imports: [SharedModule], + templateUrl: './alert-inventory-down.component.html', + styleUrl: './alert-inventory-down.component.less', +}) +export class AlertInventoryDownComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + queryForm = new FormGroup({ + roleName: new FormControl(''), + status: new FormControl(''), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: '_category', title: '资产分类', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '名称', visible: true }, + { key: 'model', title: '规格型号', visible: true }, + + { key: '_warehouse', title: '仓库', visible: true }, + // { key: 'createTime', title: '创建时间', visible: true }, + ]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getAlertSafetyDown({ ...p, ...q }) + } +} diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.html b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.html new file mode 100644 index 0000000..524bc28 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.html @@ -0,0 +1,44 @@ + +
+ + + @switch (key) { + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + + + + + + + + + + + +
+
diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.less b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.less new file mode 100644 index 0000000..e69de29 diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.ts b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.ts new file mode 100644 index 0000000..f53fe48 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-safety/alert-inventory-safety.component.ts @@ -0,0 +1,56 @@ +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' +import { format } from 'date-fns' +import { lastValueFrom, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { BUSINESS_STATUS_MAP } from 'app/constants' +import { FormValidators } from 'app/utils' + +@Component({ + selector: 'app-alert-inventory-safety', + standalone: true, + imports: [SharedModule], + templateUrl: './alert-inventory-safety.component.html', + styleUrl: './alert-inventory-safety.component.less', +}) +export class AlertInventorySafetyComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + queryForm = new FormGroup({ + roleName: new FormControl(''), + status: new FormControl(''), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: '_category', title: '资产分类', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '名称', visible: true }, + { key: 'model', title: '规格型号', visible: true }, + + { key: '_warehouse', title: '仓库', visible: true }, + // { key: 'createTime', title: '创建时间', visible: true }, + ]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getAlertSafety({ ...p, ...q }) + } +} diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.html b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.html new file mode 100644 index 0000000..524bc28 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.html @@ -0,0 +1,44 @@ + +
+ + + @switch (key) { + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + + + + + + + + + + + +
+
diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.less b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.less new file mode 100644 index 0000000..e69de29 diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.ts b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.ts new file mode 100644 index 0000000..612c2a2 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-inventory-up/alert-inventory-up.component.ts @@ -0,0 +1,56 @@ +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' +import { format } from 'date-fns' +import { lastValueFrom, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { BUSINESS_STATUS_MAP } from 'app/constants' +import { FormValidators } from 'app/utils' + +@Component({ + selector: 'app-alert-inventory-up', + standalone: true, + imports: [SharedModule], + templateUrl: './alert-inventory-up.component.html', + styleUrl: './alert-inventory-up.component.less', +}) +export class AlertInventoryUpComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + queryForm = new FormGroup({ + roleName: new FormControl(''), + status: new FormControl(''), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: '_category', title: '资产分类', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '名称', visible: true }, + { key: 'model', title: '规格型号', visible: true }, + + { key: '_warehouse', title: '仓库', visible: true }, + // { key: 'createTime', title: '创建时间', visible: true }, + ]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getAlertSafetyUp({ ...p, ...q }) + } +} diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.html b/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.html new file mode 100644 index 0000000..524bc28 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.html @@ -0,0 +1,44 @@ + +
+ + + @switch (key) { + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + + + + + + + + + + + +
+
diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.less b/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.less new file mode 100644 index 0000000..e69de29 diff --git a/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.ts b/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.ts new file mode 100644 index 0000000..c9fe1f1 --- /dev/null +++ b/web-admin-app/src/app/pages/fixed-asset/alert/alert-maintenance/alert-maintenance.component.ts @@ -0,0 +1,55 @@ +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' +import { format } from 'date-fns' +import { lastValueFrom, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { BUSINESS_STATUS_MAP } from 'app/constants' +import { FormValidators } from 'app/utils' +@Component({ + selector: 'app-alert-maintenance', + standalone: true, + imports: [SharedModule], + templateUrl: './alert-maintenance.component.html', + styleUrl: './alert-maintenance.component.less', +}) +export class AlertMaintenanceComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + queryForm = new FormGroup({ + roleName: new FormControl(''), + status: new FormControl(''), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: '_category', title: '资产分类', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '名称', visible: true }, + { key: 'model', title: '规格型号', visible: true }, + + { key: '_warehouse', title: '仓库', visible: true }, + // { key: 'createTime', title: '创建时间', visible: true }, + ]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getAlertMaintenance({ ...p, ...q }) + } +} diff --git a/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html b/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html index c62e685..3316b33 100644 --- a/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.html @@ -5,8 +5,7 @@
  • 固资台账
  • @@ -69,7 +68,13 @@
  • --> -
  • +
    • 维修类型 @@ -82,22 +87,83 @@
  • -
  • 固资流程
  • -
  • 库存物品
  • -
  • + +
    • -
    • - 盘点任务 -
    • 盘点计划
    • +
    • + 盘点任务 +
  • -
  • 预警中心
  • +
  • +
      +
    • + 借用预警 +
    • +
    • + 维保到期预警 +
    • +
    • +
        +
      • + 安全库存 +
      • +
      • + 安全库存上限 +
      • +
      • + 安全库存下限 +
      • +
      +
    • +
    +
  • -
  • +
    • 物品档案 @@ -123,7 +189,7 @@
  • -
  • 系统设置
  • +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.ts b/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.ts index 3559c4a..8c41b3a 100644 --- a/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/fixed-asset.component.ts @@ -11,7 +11,7 @@ import { SharedModule } from 'app/shared/shared.module' }) export class FixedAssetComponent implements OnInit { constructor(private router: Router) { - this.openedSubmenu = this.router.url.split('/')[2] ?? '' + this.openedSubmenu = this.router.url } openedSubmenu = '' @@ -20,7 +20,7 @@ export class FixedAssetComponent implements OnInit { console.log('this.openedSubmenu', this.openedSubmenu) } - onMenuOpenChange(open: boolean, v: string) { - this.openedSubmenu = open ? v : '' + onMenuOpenChange(open: boolean) { + this.openedSubmenu = open ? this.router.url : '' } } diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.html b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.html index 27d6b06..560dbb1 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.html @@ -1,74 +1,198 @@ -
    +
    - +
    -
    - +
    + + + @switch (key) { + @case ('status') { + + {{ ASSET_STATUS_MAP[data] }} + + } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + - - - - - - - - - - - - - - - - + - - + + - + - + - - - + + + @for (item of ASSET_STATUS_MAP | keyvalue; track $index) { + + } - - - + + + @for (item of ASSET_SOURCE_MAP | keyvalue; track $index) { + + } - - - - - - - - - - - - + + - - - - - - - - - + + + +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.ts index 13e06f3..e3128e1 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-belong/fixed-asset-belong.component.ts @@ -1,77 +1,110 @@ -import { Component } from '@angular/core' +import { Component, TemplateRef, ViewChild } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' + import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' -import { ComponentOrgTreeComponent } from 'app/components/component-org-tree/component-org-tree.component' import { ApiService } from 'app/services' import { SharedModule } from 'app/shared/shared.module' import { format } from 'date-fns' -import { of } from 'rxjs' +import { lastValueFrom, of } from 'rxjs' +import { + AssetFormComponent, + ComponentOrgTreeComponent, + ManufacturerSelectComponent, + PositionSelectComponent, +} from 'app/components' +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants' +import { Utils } from 'app/utils' @Component({ selector: 'app-fixed-asset-belong', standalone: true, - imports: [SharedModule, ComponentOrgTreeComponent], + imports: [ + SharedModule, + AssetFormComponent, + ComponentOrgTreeComponent, + PositionSelectComponent, + ManufacturerSelectComponent, + ], templateUrl: './fixed-asset-belong.component.html', styleUrl: './fixed-asset-belong.component.less', }) export class FixedAssetBelongComponent { - constructor(private api: ApiService) {} + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + queryForm = new FormGroup({ - name: new FormControl(''), - type: new FormControl(''), - status: new FormControl(''), - date: new FormControl(''), + name: new FormControl(), + model: new FormControl(), + status: new FormControl(), + assetCode: new FormControl(), + serialNumber: new FormControl(), + sourceId: new FormControl(), + positionId: new FormControl(), + manufacturersVendorId: new FormControl(), }) + @ViewChild('copyTpl') copyTpl!: TemplateRef + + ASSET_STATUS_MAP = ASSET_STATUS_MAP() + + ASSET_SOURCE_MAP = ASSET_SOURCE_MAP + table = new TableOption(this.fetchData.bind(this)) + organizationId: number | null = null + + copyNum = 1 + ngOnInit(): void { this.table .setConfig({ - selectable: true, + rowKey: 'assetId', }) .setColumn([ - { key: '资产编号', title: '资产编号', visible: true }, - { key: '资产分类', title: '资产分类', visible: true }, - { key: '资产状态', title: '资产状态', visible: true }, - { key: '资产名称', title: '资产名称', visible: true }, - { key: '规格型号', title: '规格型号', visible: true }, - { key: '序列号', title: '序列号', visible: true }, - { key: '使用人员', title: '使用人员', visible: true }, - { key: '所属公司', title: '所属公司', visible: true }, - { key: '使用组织', title: '使用组织', visible: true }, - { key: '存放位置', title: '存放位置', visible: true }, - { key: '资产标签', title: '资产标签', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '资产名称', visible: true }, + { key: '_category', title: '资产分类', visible: true }, + { key: 'status', title: '资产状态', visible: true }, + { key: '_ownCompany', title: '所属公司', visible: true }, + { key: '_useOrganization', title: '使用组织', visible: true }, + { key: '_position', title: '存放位置', visible: true }, + ]) + .setRowOperate([ + { + title: '查看', + onClick: (v) => { + this.onCreate(v, true) + }, + }, ]) - .setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }]) } fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] + return this.api.getAssetPage({ ...p, ...q, ownCompanyId: this.organizationId }) + } - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return of({ - data: { - total: 5, - records: [ - { - id: 1, - name: '沙滩', - price: 590, - type: 0, - lifespan: 6, - number: 20, - max: 20, - status: 1, - createTime: '2024-05-01', - }, - ], + onCreate(data?: NzSafeAny, preview?: boolean) { + this.modal.create({ + nzTitle: '查看资产', + nzContent: AssetFormComponent, + nzWidth: '80vw', + nzWrapClassName: 'modal-lg', + nzData: { + value: data, + preview, }, + nzFooter: null, }) - return this.api.getEntityPage(p, q) + } + + onOrgSelectedChange(e: NzSafeAny) { + this.organizationId = e ? e.organizationId : null + this.table.ref.search() } } diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.html b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.html index b21a8c2..b67c57c 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.html @@ -1,81 +1,194 @@ -
    +
    -
    - - +
    +
    -
    - +
    + + + @switch (key) { + @case ('status') { + + {{ ASSET_STATUS_MAP[data] }} + + } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + - - - - - - - - - - - - - - - - + - - + + - + - + - - - + + + @for (item of ASSET_STATUS_MAP | keyvalue; track $index) { + + } - - - + + + @for (item of ASSET_SOURCE_MAP | keyvalue; track $index) { + + } - - - - - - - - - - - - - - - - - - - - - - + + + + +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.ts index 3d5ebbe..3766b6d 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-category/fixed-asset-category.component.ts @@ -1,115 +1,111 @@ -import { Component } from '@angular/core' +import { Component, TemplateRef, ViewChild } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' + import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { ApiService } from 'app/services' import { SharedModule } from 'app/shared/shared.module' import { format } from 'date-fns' -import { NzFormatEmitEvent } from 'ng-zorro-antd/tree' -import { of } from 'rxjs' +import { lastValueFrom, of } from 'rxjs' +import { + AssetFormComponent, + ComponentBasicCategoryTreeComponent, + ComponentOrgTreeComponent, + ManufacturerSelectComponent, + PositionTreeComponent, +} from 'app/components' +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants' @Component({ selector: 'app-fixed-asset-category', standalone: true, - imports: [SharedModule], + imports: [ + SharedModule, + AssetFormComponent, + ComponentOrgTreeComponent, + PositionTreeComponent, + ManufacturerSelectComponent, + ComponentBasicCategoryTreeComponent, + ], templateUrl: './fixed-asset-category.component.html', styleUrl: './fixed-asset-category.component.less', }) export class FixedAssetCategoryComponent { - constructor(private api: ApiService) {} + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + queryForm = new FormGroup({ - name: new FormControl(''), - type: new FormControl(''), - status: new FormControl(''), - date: new FormControl(''), + name: new FormControl(), + model: new FormControl(), + status: new FormControl(), + assetCode: new FormControl(), + serialNumber: new FormControl(), + sourceId: new FormControl(), + positionId: new FormControl(), + manufacturersVendorId: new FormControl(), }) + @ViewChild('copyTpl') copyTpl!: TemplateRef + + ASSET_STATUS_MAP = ASSET_STATUS_MAP() + + ASSET_SOURCE_MAP = ASSET_SOURCE_MAP + table = new TableOption(this.fetchData.bind(this)) - nodes = [ - { - title: '数据中心设备', - key: '0-0', - children: [ - { - title: '组织1', - key: '0-0-0', - isLeaf: true, - }, - ], - }, - { - title: '办公设备', - key: '0-1', - isLeaf: true, - }, - { - title: '办公家具', - key: '0-2', - isLeaf: true, - }, - { - title: '特种设备', - key: '0-21', - isLeaf: true, - }, - { - title: '车辆资产', - key: '0-21', - isLeaf: true, - }, - ] + categoryId: number | null = null - nzEvent(event: NzFormatEmitEvent): void { - console.log(event) - } + copyNum = 1 ngOnInit(): void { this.table .setConfig({ - selectable: true, + rowKey: 'assetId', }) .setColumn([ - { key: '资产编号', title: '资产编号', visible: true }, - { key: '资产分类', title: '资产分类', visible: true }, - { key: '资产状态', title: '资产状态', visible: true }, - { key: '资产名称', title: '资产名称', visible: true }, - { key: '规格型号', title: '规格型号', visible: true }, - { key: '序列号', title: '序列号', visible: true }, - { key: '使用人员', title: '使用人员', visible: true }, - { key: '所属公司', title: '所属公司', visible: false }, - { key: '使用组织', title: '使用组织', visible: false }, - { key: '存放位置', title: '存放位置', visible: false }, - { key: '资产标签', title: '资产标签', visible: false }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '资产名称', visible: true }, + { key: '_category', title: '资产分类', visible: true }, + { key: 'status', title: '资产状态', visible: true }, + { key: '_ownCompany', title: '所属公司', visible: true }, + { key: '_useOrganization', title: '使用组织', visible: true }, + { key: '_position', title: '存放位置', visible: true }, + ]) + .setRowOperate([ + { + title: '查看', + onClick: (v) => { + this.onCreate(v, true) + }, + }, ]) - .setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }]) } fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] + return this.api.getAssetPage({ ...p, ...q, categoryId: this.categoryId }) + } - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return of({ - data: { - total: 5, - records: [ - { - id: 1, - name: '沙滩', - price: 590, - type: 0, - lifespan: 6, - number: 20, - max: 20, - status: 1, - createTime: '2024-05-01', - }, - ], + onCreate(data?: NzSafeAny, preview?: boolean) { + this.modal.create({ + nzTitle: '查看资产', + nzContent: AssetFormComponent, + nzWidth: '80vw', + nzWrapClassName: 'modal-lg', + nzData: { + value: data, + preview, }, + nzFooter: null, }) - return this.api.getEntityPage(p, q) + } + + onSelectedChange(e: NzSafeAny) { + this.categoryId = e ? e.categoryId : null + this.table.ref.search() } } diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-employee/fixed-asset-employee.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-employee/fixed-asset-employee.component.ts index da794c7..50044c2 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-employee/fixed-asset-employee.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-employee/fixed-asset-employee.component.ts @@ -98,6 +98,6 @@ export class FixedAssetEmployeeComponent { ], }, }) - return this.api.getEntityPage(p, q) + // return this.api.getEntityPage(p, q) } } diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.html b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.html index 82dbb76..2e19388 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.html @@ -1,10 +1,22 @@ - +
    - + + +
      + @for (t of tabs; track $index) { +
    • + +
    • + } +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.less b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.less index e69de29..8e51fe7 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.less +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.less @@ -0,0 +1,22 @@ +.tabs { + li { + border-bottom: 2px solid transparent; + } + + .active { + border-color: #40a9ff; + + button { + color: #40a9ff; + } + + } +} + +.ledger { + ::ng-deep { + .formgroup-container { + padding: 12px 12px 0; + } + } +} \ No newline at end of file diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.ts index 5348189..e89bfae 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-ledger/fixed-asset-ledger.component.ts @@ -21,10 +21,10 @@ const tabs = [ path: 'asset-position', title: '存放位置台账', }, - { - path: 'asset-employee', - title: '员工查询台账', - }, + // { + // path: 'asset-employee', + // title: '员工查询台账', + // }, { path: 'asset-category', title: '分类查询台账', diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.html b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.html index bb9abe5..8b64f0e 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.html @@ -1,26 +1,188 @@ -
    - +
    + + + @switch (key) { + @case ('status') { + + {{ ASSET_STATUS_MAP[data] }} + + } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + + + + + + + + + + + + + + - - - - - - - + + @for (item of ASSET_STATUS_MAP | keyvalue; track $index) { + + } - - - + + + @for (item of ASSET_SOURCE_MAP | keyvalue; track $index) { + + } + - - + + + - - + + + +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.ts index 69d2a0e..d668503 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-myown/fixed-asset-myown.component.ts @@ -1,77 +1,92 @@ -import { Component } from '@angular/core' +import { Component, TemplateRef, ViewChild } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' + import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { ApiService } from 'app/services' import { SharedModule } from 'app/shared/shared.module' import { format } from 'date-fns' -import { of } from 'rxjs' +import { lastValueFrom, of } from 'rxjs' +import { AssetFormComponent, ManufacturerSelectComponent, PositionSelectComponent } from 'app/components' +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants' +import { Utils } from 'app/utils' @Component({ selector: 'app-fixed-asset-myown', standalone: true, - imports: [SharedModule], + imports: [SharedModule, AssetFormComponent, PositionSelectComponent, ManufacturerSelectComponent], templateUrl: './fixed-asset-myown.component.html', styleUrl: './fixed-asset-myown.component.less', }) export class FixedAssetMyownComponent { - constructor(private api: ApiService) {} + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} queryForm = new FormGroup({ - name: new FormControl(''), - type: new FormControl(''), - status: new FormControl(''), - date: new FormControl(''), + name: new FormControl(), + model: new FormControl(), + status: new FormControl(), + assetCode: new FormControl(), + serialNumber: new FormControl(), + sourceId: new FormControl(), + positionId: new FormControl(), + manufacturersVendorId: new FormControl(), }) + @ViewChild('copyTpl') copyTpl!: TemplateRef + + ASSET_STATUS_MAP = ASSET_STATUS_MAP() + + ASSET_SOURCE_MAP = ASSET_SOURCE_MAP + table = new TableOption(this.fetchData.bind(this)) + copyNum = 1 + ngOnInit(): void { this.table .setConfig({ - selectable: true, + rowKey: 'assetId', }) .setColumn([ - { key: '资产编号', title: '资产编号', visible: true }, - { key: '资产分类', title: '资产分类', visible: true }, - { key: '资产状态', title: '资产状态', visible: true }, - { key: '资产名称', title: '资产名称', visible: true }, - { key: '规格型号', title: '规格型号', visible: true }, - { key: '序列号', title: '序列号', visible: true }, - { key: '使用人员', title: '使用人员', visible: true }, - { key: '所属公司', title: '所属公司', visible: true }, - { key: '使用组织', title: '使用组织', visible: true }, - { key: '存放位置', title: '存放位置', visible: true }, - { key: '资产标签', title: '资产标签', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '资产名称', visible: true }, + { key: '_category', title: '资产分类', visible: true }, + { key: 'status', title: '资产状态', visible: true }, + { key: '_ownCompany', title: '所属公司', visible: true }, + { key: '_useOrganization', title: '使用组织', visible: true }, + { key: '_position', title: '存放位置', visible: true }, + ]) + .setRowOperate([ + { + title: '查看', + onClick: (v) => { + this.onCreate(v, true) + }, + }, ]) - .setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }]) } fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] + return this.api.getAssetPage({ ...p, ...q }) + } - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return of({ - data: { - total: 5, - records: [ - { - id: 1, - name: '沙滩', - price: 590, - type: 0, - lifespan: 6, - number: 20, - max: 20, - status: 1, - createTime: '2024-05-01', - }, - ], + onCreate(data?: NzSafeAny, preview?: boolean) { + this.modal.create({ + nzTitle: '查看资产', + nzContent: AssetFormComponent, + nzWidth: '80vw', + nzWrapClassName: 'modal-lg', + nzData: { + value: data, + preview, }, + nzFooter: null, }) - return this.api.getEntityPage(p, q) } } diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.html b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.html index b21a8c2..560dbb1 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.html @@ -1,81 +1,198 @@ -
    +
    - - +
    -
    - +
    + + + @switch (key) { + @case ('status') { + + {{ ASSET_STATUS_MAP[data] }} + + } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + - - - - - - - - - - - - - - - - + - - + + - + - + - - - + + + @for (item of ASSET_STATUS_MAP | keyvalue; track $index) { + + } - - - + + + @for (item of ASSET_SOURCE_MAP | keyvalue; track $index) { + + } - - - - - - - - - - - - + + - - - - - - - - - + + + +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.ts index 939825d..9bc54cc 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-org/fixed-asset-org.component.ts @@ -1,105 +1,109 @@ -import { Component } from '@angular/core' +import { Component, TemplateRef, ViewChild } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' + import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { ApiService } from 'app/services' import { SharedModule } from 'app/shared/shared.module' import { format } from 'date-fns' -import { NzFormatEmitEvent } from 'ng-zorro-antd/tree' -import { of } from 'rxjs' +import { lastValueFrom, of } from 'rxjs' +import { + AssetFormComponent, + ComponentOrgTreeComponent, + ManufacturerSelectComponent, + PositionSelectComponent, +} from 'app/components' +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants' @Component({ selector: 'app-fixed-asset-org', standalone: true, - imports: [SharedModule], + imports: [ + SharedModule, + AssetFormComponent, + ComponentOrgTreeComponent, + PositionSelectComponent, + ManufacturerSelectComponent, + ], templateUrl: './fixed-asset-org.component.html', styleUrl: './fixed-asset-org.component.less', }) export class FixedAssetOrgComponent { - constructor(private api: ApiService) {} + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + queryForm = new FormGroup({ - name: new FormControl(''), - type: new FormControl(''), - status: new FormControl(''), - date: new FormControl(''), + name: new FormControl(), + model: new FormControl(), + status: new FormControl(), + assetCode: new FormControl(), + serialNumber: new FormControl(), + sourceId: new FormControl(), + positionId: new FormControl(), + manufacturersVendorId: new FormControl(), }) + @ViewChild('copyTpl') copyTpl!: TemplateRef + + ASSET_STATUS_MAP = ASSET_STATUS_MAP() + + ASSET_SOURCE_MAP = ASSET_SOURCE_MAP + table = new TableOption(this.fetchData.bind(this)) - nodes = [ - { - title: '科技部', - key: '0-0', - children: [ - { - title: '组织1', - key: '0-0-0', - isLeaf: true, - }, - ], - }, - { - title: '组织2', - key: '0-1', - isLeaf: true, - }, - { - title: '组织3', - key: '0-2', - isLeaf: true, - }, - ] + organizationId: number | null = null - nzEvent(event: NzFormatEmitEvent): void { - console.log(event) - } + copyNum = 1 ngOnInit(): void { this.table .setConfig({ - selectable: true, + rowKey: 'assetId', }) .setColumn([ - { key: '资产编号', title: '资产编号', visible: true }, - { key: '资产分类', title: '资产分类', visible: true }, - { key: '资产状态', title: '资产状态', visible: true }, - { key: '资产名称', title: '资产名称', visible: true }, - { key: '规格型号', title: '规格型号', visible: true }, - { key: '序列号', title: '序列号', visible: true }, - { key: '使用人员', title: '使用人员', visible: true }, - { key: '所属公司', title: '所属公司', visible: true }, - { key: '使用组织', title: '使用组织', visible: true }, - { key: '存放位置', title: '存放位置', visible: true }, - { key: '资产标签', title: '资产标签', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '资产名称', visible: true }, + { key: '_category', title: '资产分类', visible: true }, + { key: 'status', title: '资产状态', visible: true }, + { key: '_ownCompany', title: '所属公司', visible: true }, + { key: '_useOrganization', title: '使用组织', visible: true }, + { key: '_position', title: '存放位置', visible: true }, + ]) + .setRowOperate([ + { + title: '查看', + onClick: (v) => { + this.onCreate(v, true) + }, + }, ]) - .setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }]) } fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] + return this.api.getAssetPage({ ...p, ...q, ownCompanyId: this.organizationId }) + } - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return of({ - data: { - total: 5, - records: [ - { - id: 1, - name: '沙滩', - price: 590, - type: 0, - lifespan: 6, - number: 20, - max: 20, - status: 1, - createTime: '2024-05-01', - }, - ], + onCreate(data?: NzSafeAny, preview?: boolean) { + this.modal.create({ + nzTitle: '查看资产', + nzContent: AssetFormComponent, + nzWidth: '80vw', + nzWrapClassName: 'modal-lg', + nzData: { + value: data, + preview, }, + nzFooter: null, }) - return this.api.getEntityPage(p, q) + } + + onOrgSelectedChange(e: NzSafeAny) { + this.organizationId = e ? e.organizationId : null + this.table.ref.search() } } diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.html b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.html index b21a8c2..1f84e6b 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.html @@ -1,81 +1,194 @@ -
    +
    - - +
    -
    - +
    + + + @switch (key) { + @case ('status') { + + {{ ASSET_STATUS_MAP[data] }} + + } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + - - - - - - - - - - - - - - - - + - - + + - + - + - - - + + + @for (item of ASSET_STATUS_MAP | keyvalue; track $index) { + + } - - - + + + @for (item of ASSET_SOURCE_MAP | keyvalue; track $index) { + + } - - - - - - - - - - - - - - - - - - - - - - + + + + +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.ts index 5cef505..d68b100 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-position/fixed-asset-position.component.ts @@ -1,105 +1,108 @@ -import { Component } from '@angular/core' +import { Component, TemplateRef, ViewChild } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' + import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { ApiService } from 'app/services' import { SharedModule } from 'app/shared/shared.module' import { format } from 'date-fns' -import { NzFormatEmitEvent } from 'ng-zorro-antd/tree' -import { of } from 'rxjs' - +import { lastValueFrom, of } from 'rxjs' +import { + AssetFormComponent, + ComponentOrgTreeComponent, + ManufacturerSelectComponent, + PositionTreeComponent, +} from 'app/components' +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants' @Component({ selector: 'app-fixed-asset-position', standalone: true, - imports: [SharedModule], + imports: [ + SharedModule, + AssetFormComponent, + ComponentOrgTreeComponent, + PositionTreeComponent, + ManufacturerSelectComponent, + ], templateUrl: './fixed-asset-position.component.html', styleUrl: './fixed-asset-position.component.less', }) export class FixedAssetPositionComponent { - constructor(private api: ApiService) {} + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + queryForm = new FormGroup({ - name: new FormControl(''), - type: new FormControl(''), - status: new FormControl(''), - date: new FormControl(''), + name: new FormControl(), + model: new FormControl(), + status: new FormControl(), + assetCode: new FormControl(), + serialNumber: new FormControl(), + sourceId: new FormControl(), + positionId: new FormControl(), + manufacturersVendorId: new FormControl(), }) + @ViewChild('copyTpl') copyTpl!: TemplateRef + + ASSET_STATUS_MAP = ASSET_STATUS_MAP() + + ASSET_SOURCE_MAP = ASSET_SOURCE_MAP + table = new TableOption(this.fetchData.bind(this)) - nodes = [ - { - title: '位置1', - key: '0-0', - children: [ - { - title: '位置1-1', - key: '0-0-0', - isLeaf: true, - }, - ], - }, - { - title: '位置2', - key: '0-1', - isLeaf: true, - }, - { - title: '位置3', - key: '0-2', - isLeaf: true, - }, - ] + positionId: number | null = null - nzEvent(event: NzFormatEmitEvent): void { - console.log(event) - } + copyNum = 1 ngOnInit(): void { this.table .setConfig({ - selectable: true, + rowKey: 'assetId', }) .setColumn([ - { key: '资产编号', title: '资产编号', visible: true }, - { key: '资产分类', title: '资产分类', visible: true }, - { key: '资产状态', title: '资产状态', visible: true }, - { key: '资产名称', title: '资产名称', visible: true }, - { key: '规格型号', title: '规格型号', visible: true }, - { key: '序列号', title: '序列号', visible: true }, - { key: '使用人员', title: '使用人员', visible: true }, - { key: '所属公司', title: '所属公司', visible: true }, - { key: '使用组织', title: '使用组织', visible: true }, - { key: '存放位置', title: '存放位置', visible: true }, - { key: '资产标签', title: '资产标签', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '资产名称', visible: true }, + { key: '_category', title: '资产分类', visible: true }, + { key: 'status', title: '资产状态', visible: true }, + { key: '_ownCompany', title: '所属公司', visible: true }, + { key: '_useOrganization', title: '使用组织', visible: true }, + { key: '_position', title: '存放位置', visible: true }, + ]) + .setRowOperate([ + { + title: '查看', + onClick: (v) => { + this.onCreate(v, true) + }, + }, ]) - .setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }]) } fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] + return this.api.getAssetPage({ ...p, ...q, positionId: this.positionId }) + } - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return of({ - data: { - total: 5, - records: [ - { - id: 1, - name: '沙滩', - price: 590, - type: 0, - lifespan: 6, - number: 20, - max: 20, - status: 1, - createTime: '2024-05-01', - }, - ], + onCreate(data?: NzSafeAny, preview?: boolean) { + this.modal.create({ + nzTitle: '查看资产', + nzContent: AssetFormComponent, + nzWidth: '80vw', + nzWrapClassName: 'modal-lg', + nzData: { + value: data, + preview, }, + nzFooter: null, }) - return this.api.getEntityPage(p, q) + } + + onSelectedChange(e: NzSafeAny) { + this.positionId = e ? e.positionId : null + this.table.ref.search() } } diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.html b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.html index 64fa766..8b64f0e 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.html @@ -1,68 +1,188 @@ -
    - +
    + + + @switch (key) { + @case ('status') { + + {{ ASSET_STATUS_MAP[data] }} + + } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_warehouse') { + {{ data?.name ?? '-' }} + } + @case ('_position') { + {{ data?.name ?? '-' }} + } + @case ('_head') { + {{ data?.userName ?? '-' }} + } + @case ('_ownCompany') { + {{ data?.organizationName ?? '-' }} + } + @case ('_useOrganization') { + {{ data?.organizationName ?? '-' }} + } + @case ('_category') { + {{ data?.categoryName ?? '-' }} + } + @default { + {{ data }} + } + } + + - - - - - - - - - - - - - - - - + - - + + - + - + - - - + + + @for (item of ASSET_STATUS_MAP | keyvalue; track $index) { + + } - - - + + + @for (item of ASSET_SOURCE_MAP | keyvalue; track $index) { + + } - - - - - - - - - - - - - - - - - + + - - - - + + + +
    diff --git a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.ts b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.ts index a843f10..3b30010 100644 --- a/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/ledger/fixed-asset-search/fixed-asset-search.component.ts @@ -1,77 +1,92 @@ -import { Component } from '@angular/core' +import { Component, TemplateRef, ViewChild } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' + import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' import { ApiService } from 'app/services' import { SharedModule } from 'app/shared/shared.module' import { format } from 'date-fns' -import { of } from 'rxjs' +import { lastValueFrom, of } from 'rxjs' +import { AssetFormComponent, ManufacturerSelectComponent, PositionSelectComponent } from 'app/components' +import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { ASSET_SOURCE_MAP, ASSET_STATUS, ASSET_STATUS_MAP } from 'app/constants' +import { Utils } from 'app/utils' @Component({ selector: 'app-fixed-asset-search', standalone: true, - imports: [SharedModule], + imports: [SharedModule, AssetFormComponent, PositionSelectComponent, ManufacturerSelectComponent], templateUrl: './fixed-asset-search.component.html', styleUrl: './fixed-asset-search.component.less', }) export class FixedAssetSearchComponent { - constructor(private api: ApiService) {} + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} queryForm = new FormGroup({ - name: new FormControl(''), - type: new FormControl(''), - status: new FormControl(''), - date: new FormControl(''), + name: new FormControl(), + model: new FormControl(), + status: new FormControl(), + assetCode: new FormControl(), + serialNumber: new FormControl(), + sourceId: new FormControl(), + positionId: new FormControl(), + manufacturersVendorId: new FormControl(), }) + @ViewChild('copyTpl') copyTpl!: TemplateRef + + ASSET_STATUS_MAP = ASSET_STATUS_MAP() + + ASSET_SOURCE_MAP = ASSET_SOURCE_MAP + table = new TableOption(this.fetchData.bind(this)) + copyNum = 1 + ngOnInit(): void { this.table .setConfig({ - selectable: true, + rowKey: 'assetId', }) .setColumn([ - { key: '资产编号', title: '资产编号', visible: true }, - { key: '资产分类', title: '资产分类', visible: true }, - { key: '资产状态', title: '资产状态', visible: true }, - { key: '资产名称', title: '资产名称', visible: true }, - { key: '规格型号', title: '规格型号', visible: true }, - { key: '序列号', title: '序列号', visible: true }, - { key: '使用人员', title: '使用人员', visible: true }, - { key: '所属公司', title: '所属公司', visible: true }, - { key: '使用组织', title: '使用组织', visible: true }, - { key: '存放位置', title: '存放位置', visible: true }, - { key: '资产标签', title: '资产标签', visible: true }, + { key: 'assetCode', title: '资产编号', visible: true }, + { key: 'name', title: '资产名称', visible: true }, + { key: '_category', title: '资产分类', visible: true }, + { key: 'status', title: '资产状态', visible: true }, + { key: '_ownCompany', title: '所属公司', visible: true }, + { key: '_useOrganization', title: '使用组织', visible: true }, + { key: '_position', title: '存放位置', visible: true }, + ]) + .setRowOperate([ + { + title: '查看', + onClick: (v) => { + this.onCreate(v, true) + }, + }, ]) - .setRowOperate([{ title: '查看', premissions: [] }, { title: '变更明细' }]) } fetchData(p: {}, q: AnyObject) { - if (Array.isArray(q['createTime'])) { - const createTimeStart = q['createTime']?.[0] - const createTimeEnd = q['createTime']?.[1] + return this.api.getAssetPage({ ...p, ...q }) + } - q['createTimeStart'] = createTimeStart ? format(new Date(createTimeStart), 'yyyy-MM-dd HH:mm:ss') : '' - q['createTimeEnd'] = createTimeEnd ? format(new Date(createTimeEnd), 'yyyy-MM-dd HH:mm:ss') : '' - } - return of({ - data: { - total: 5, - records: [ - { - id: 1, - name: '沙滩', - price: 590, - type: 0, - lifespan: 6, - number: 20, - max: 20, - status: 1, - createTime: '2024-05-01', - }, - ], + onCreate(data?: NzSafeAny, preview?: boolean) { + this.modal.create({ + nzTitle: '查看资产', + nzContent: AssetFormComponent, + nzWidth: '80vw', + nzWrapClassName: 'modal-lg', + nzData: { + value: data, + preview, }, + nzFooter: null, }) - return this.api.getEntityPage(p, q) } } diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-allot/fixed-asset-manage-allot.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-allot/fixed-asset-manage-allot.component.ts index 5839160..cea4ce3 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-allot/fixed-asset-manage-allot.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-allot/fixed-asset-manage-allot.component.ts @@ -52,7 +52,7 @@ export class FixedAssetManageAllotComponent { { key: 'inWarehouseId', title: '调入仓库', visible: true }, // { key: '_manager', title: '管理人员', visible: true }, // { key: '_position', title: '存放位置', visible: true }, - // { key: '_position', title: '详细位置', visible: true }, + // { key: 'positionDetail', title: '详细位置', visible: true }, { key: 'businessGeneratedDate', title: '调拨日期', visible: true }, { key: 'notes', title: '备注', visible: true }, ]) @@ -75,8 +75,13 @@ export class FixedAssetManageAllotComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产调拨' : '添加资产调拨' + if (preview) { + nzTitle = '预览资产调拨' + } + this.modal.create({ - nzTitle: data ? '编辑资产调拨' : '添加资产调拨', + nzTitle, nzContent: AssetBusinessAllotFormComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.html b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.html index df5116d..6d531a5 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.html @@ -38,6 +38,9 @@ @case ('_useOrganization') { {{ data?.organizationName ?? '-' }} } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } @case ('_category') { {{ data?.categoryName ?? '-' }} } diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.ts index 567ea39..329a454 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-borrow/fixed-asset-manage-borrow.component.ts @@ -48,10 +48,9 @@ export class FixedAssetManageBorrowComponent { { key: 'businessId', title: '业务编号', visible: true, width: '350px' }, { key: 'name', title: '业务名称', visible: true }, { key: 'status', title: '办理状态', visible: true }, - { key: '_supplierVendor', title: '借用人', visible: true }, - { key: '_manager', title: '借出时间', visible: true }, - { key: '_manager', title: '预计归还时间', visible: true }, - { key: '_manager', title: '归还时间', visible: true }, + { key: '_useUser', title: '借用人', visible: true }, + { key: 'businessGeneratedDate', title: '借出时间', visible: true }, + { key: 'returnTime', title: '预计归还时间', visible: true }, { key: 'notes', title: '备注', visible: true }, ]) @@ -74,8 +73,12 @@ export class FixedAssetManageBorrowComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产借用' : '添加资产借用' + if (preview) { + nzTitle = '预览资产借用' + } this.modal.create({ - nzTitle: data ? '编辑资产借用' : '添加资产借用', + nzTitle, nzContent: AssetBusinessBorrowFormComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.html b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.html index df5116d..cc75a81 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.html +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.html @@ -35,6 +35,12 @@ @case ('_ownCompany') { {{ data?.organizationName ?? '-' }} } + @case ('_useUser') { + {{ data?.userName ?? '-' }} + } + @case ('_applicant') { + {{ data?.userName ?? '-' }} + } @case ('_useOrganization') { {{ data?.organizationName ?? '-' }} } diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.ts index a07cd20..7c245ff 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-distribution/fixed-asset-manage-distribution.component.ts @@ -51,7 +51,7 @@ export class FixedAssetManageDistributionComponent { { key: '_useOrganization', title: '领用后公司/部门', visible: true }, { key: '_useUser', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true }, - { key: '_position', title: '详细位置', visible: true }, + { key: 'positionDetail', title: '详细位置', visible: true }, { key: 'businessGeneratedDate', title: '领用日期', visible: true }, { key: 'notes', title: '备注', visible: true }, ]) @@ -74,8 +74,12 @@ export class FixedAssetManageDistributionComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产领用' : '添加资产领用' + if (preview) { + nzTitle = '预览资产领用' + } this.modal.create({ - nzTitle: data ? '编辑资产领用' : '添加资产领用', + nzTitle, nzContent: AssetBusinessCollectionComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-entry/fixed-asset-manage-entry.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-entry/fixed-asset-manage-entry.component.ts index facaed3..7e46302 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-entry/fixed-asset-manage-entry.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-entry/fixed-asset-manage-entry.component.ts @@ -74,8 +74,12 @@ export class FixedAssetManageEntryComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产入库' : '添加资产入库' + if (preview) { + nzTitle = '预览资产入库' + } this.modal.create({ - nzTitle: data ? '编辑资产入库' : '添加资产入库', + nzTitle, nzContent: AssetBusinessStorageFormComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-return/fixed-asset-manage-return.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-return/fixed-asset-manage-return.component.ts index a4504be..967264a 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-return/fixed-asset-manage-return.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-return/fixed-asset-manage-return.component.ts @@ -51,7 +51,7 @@ export class FixedAssetManageReturnComponent { { key: '_useOrganization', title: '退库后公司/部门', visible: true }, { key: '_manager', title: '管理人员', visible: true }, { key: '_position', title: '存放位置', visible: true }, - { key: '_position', title: '详细位置', visible: true }, + { key: 'positionDetail', title: '详细位置', visible: true }, { key: 'businessGeneratedDate', title: '退库日期', visible: true }, { key: 'notes', title: '备注', visible: true }, ]) @@ -74,8 +74,12 @@ export class FixedAssetManageReturnComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产退库' : '添加资产退库' + if (preview) { + nzTitle = '预览资产退库' + } this.modal.create({ - nzTitle: data ? '编辑资产退库' : '添加资产退库', + nzTitle, nzContent: AssetBusinessReturnFormComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-revert/fixed-asset-manage-revert.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-revert/fixed-asset-manage-revert.component.ts index ae937c2..4061306 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-revert/fixed-asset-manage-revert.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-revert/fixed-asset-manage-revert.component.ts @@ -48,10 +48,10 @@ export class FixedAssetManageRevertComponent { { key: 'businessId', title: '业务编号', visible: true, width: '350px' }, { key: 'name', title: '业务名称', visible: true }, { key: 'status', title: '办理状态', visible: true }, - { key: '_useOrganization', title: '归还后公司/部门', visible: true }, + // { key: '_useOrganization', title: '归还后公司/部门', visible: true }, { key: '_manager', title: '管理人员', visible: true }, { key: '_position', title: '存放位置', visible: true }, - { key: '_position', title: '详细位置', visible: true }, + { key: 'positionDetail', title: '详细位置', visible: true }, { key: 'businessGeneratedDate', title: '归还日期', visible: true }, { key: 'notes', title: '备注', visible: true }, ]) @@ -74,8 +74,12 @@ export class FixedAssetManageRevertComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产归还' : '添加资产归还' + if (preview) { + nzTitle = '预览资产归还' + } this.modal.create({ - nzTitle: data ? '编辑资产归还' : '添加资产归还', + nzTitle, nzContent: AssetBusinessRevertFormComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-scrap/fixed-asset-manage-scrap.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-scrap/fixed-asset-manage-scrap.component.ts index 2733c91..01773b9 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-scrap/fixed-asset-manage-scrap.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-scrap/fixed-asset-manage-scrap.component.ts @@ -81,6 +81,6 @@ export class FixedAssetManageScrapComponent { ], }, }) - return this.api.getEntityPage(p, q) + // return this.api.getEntityPage(p, q) } } diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-transfer/fixed-asset-manage-transfer.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-transfer/fixed-asset-manage-transfer.component.ts index 0defb22..7411304 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-transfer/fixed-asset-manage-transfer.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage-transfer/fixed-asset-manage-transfer.component.ts @@ -53,7 +53,7 @@ export class FixedAssetManageTransferComponent { { key: '_manager', title: '管理人员', visible: true }, { key: '_useUser', title: '使用人员', visible: true }, { key: '_position', title: '存放位置', visible: true }, - { key: '_position', title: '详细位置', visible: true }, + { key: 'positionDetail', title: '详细位置', visible: true }, { key: 'businessGeneratedDate', title: '转移日期', visible: true }, { key: 'notes', title: '备注', visible: true }, ]) @@ -76,8 +76,12 @@ export class FixedAssetManageTransferComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产转移' : '添加资产转移' + if (preview) { + nzTitle = '预览资产转移' + } this.modal.create({ - nzTitle: data ? '编辑资产转移' : '添加资产转移', + nzTitle, nzContent: AssetBusinessTransferFormComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage/fixed-asset-manage.component.ts b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage/fixed-asset-manage.component.ts index 83ebba1..7771ccf 100644 --- a/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage/fixed-asset-manage.component.ts +++ b/web-admin-app/src/app/pages/fixed-asset/manage/fixed-asset-manage/fixed-asset-manage.component.ts @@ -100,8 +100,12 @@ export class FixedAssetManageComponent { } onCreate(data?: NzSafeAny, preview?: boolean) { + let nzTitle = data ? '编辑资产' : '添加资产' + if (preview) { + nzTitle = '预览资产' + } this.modal.create({ - nzTitle: data ? '编辑资产' : '添加资产', + nzTitle, nzContent: AssetFormComponent, nzWidth: '80vw', nzWrapClassName: 'modal-lg', diff --git a/web-admin-app/src/app/pages/org-setting/org-setting.component.html b/web-admin-app/src/app/pages/org-setting/org-setting.component.html index 9436ede..c69a883 100644 --- a/web-admin-app/src/app/pages/org-setting/org-setting.component.html +++ b/web-admin-app/src/app/pages/org-setting/org-setting.component.html @@ -71,8 +71,7 @@ - - - - {{ api.authInfo?.loginName }} - - - {{ api.authInfo?.userName }} - - - -
    -
    - - -
    - -
    -
    -
    + +
    + + + + {{ api.authInfo?.loginName }} + + + {{ api.authInfo?.userName }} + + + +
    +
    + + +
    + +
    +
    +
    +
    diff --git a/web-admin-app/src/app/pages/system/index/system.component.html b/web-admin-app/src/app/pages/system/index/system.component.html index 7634b59..19a7052 100644 --- a/web-admin-app/src/app/pages/system/index/system.component.html +++ b/web-admin-app/src/app/pages/system/index/system.component.html @@ -1,2 +1,12 @@ -
    ad
    - + + +
    + +
    diff --git a/web-admin-app/src/app/pages/system/index/system.component.ts b/web-admin-app/src/app/pages/system/index/system.component.ts index 34d330f..91991bd 100644 --- a/web-admin-app/src/app/pages/system/index/system.component.ts +++ b/web-admin-app/src/app/pages/system/index/system.component.ts @@ -13,13 +13,14 @@ const pathTabs = ['/system/global-config', '/system/log', '/system/bill'] }) export class SystemComponent { constructor(private router: Router) { - this.tab = pathTabs.findIndex((path) => this.router.url.includes(path)) + this.openedSubmenu = this.router.url.split('/')[2] ?? '' } - tab = 0 + openedSubmenu = '' - onTabChange(i: number) { - const url = pathTabs[i] - this.router.navigate([url]) + ngOnInit(): void {} + + onMenuOpenChange(open: boolean, v: string) { + this.openedSubmenu = open ? v : '' } } diff --git a/web-admin-app/src/app/pages/system/system-role/system-role.component.html b/web-admin-app/src/app/pages/system/system-role/system-role.component.html new file mode 100644 index 0000000..b73b302 --- /dev/null +++ b/web-admin-app/src/app/pages/system/system-role/system-role.component.html @@ -0,0 +1,97 @@ + + + + + + +
    + + + @switch (key) { + @case ('status') { + @switch (data) { + @case ('0') { + + } + @case ('1') { + + } + } + } + @default { + {{ data }} + } + } + + + + + + + + + + + + + + + + + + +
    +
    + + +
    + + 名称 + + + + + + 权限菜单 + 《权限菜单》 + + + + 显示顺序 + + + + + + 状态 + + + + + + + + + 备注 + + + + +
    +
    + + + + diff --git a/web-admin-app/src/app/pages/system/system-role/system-role.component.less b/web-admin-app/src/app/pages/system/system-role/system-role.component.less new file mode 100644 index 0000000..e69de29 diff --git a/web-admin-app/src/app/pages/system/system-role/system-role.component.ts b/web-admin-app/src/app/pages/system/system-role/system-role.component.ts new file mode 100644 index 0000000..061a0a1 --- /dev/null +++ b/web-admin-app/src/app/pages/system/system-role/system-role.component.ts @@ -0,0 +1,107 @@ +import { Component, TemplateRef, ViewChild } from '@angular/core' +import { FormControl, FormGroup } from '@angular/forms' + +import { AnyObject, TableOption } from 'app/shared/components/server-paginated-table' +import { ApiService } from 'app/services' +import { SharedModule } from 'app/shared/shared.module' +import { format } from 'date-fns' +import { lastValueFrom, of } from 'rxjs' +import { NzSafeAny } from 'ng-zorro-antd/core/types' +import { NzModalService } from 'ng-zorro-antd/modal' +import { NzMessageService } from 'ng-zorro-antd/message' +import { BUSINESS_STATUS_MAP } from 'app/constants' +import { FormValidators } from 'app/utils' + +@Component({ + selector: 'app-system-role', + standalone: true, + imports: [SharedModule], + templateUrl: './system-role.component.html', + styleUrl: './system-role.component.less', +}) +export class SystemRoleComponent { + constructor( + private api: ApiService, + private modal: NzModalService, + private msg: NzMessageService, + ) {} + + @ViewChild('createFormTpl') createFormTpl!: TemplateRef<{}> + + queryForm = new FormGroup({ + roleName: new FormControl(''), + status: new FormControl(''), + }) + + createForm = new FormGroup({ + roleId: new FormControl(), + roleName: new FormControl('', [FormValidators.required('请输入')]), + roleKey: new FormControl(''), + roleSort: new FormControl(0), + status: new FormControl('0'), + remark: new FormControl(''), + menuIdList: new FormControl([]), + }) + + table = new TableOption(this.fetchData.bind(this)) + + ngOnInit(): void { + this.table + // .setConfig({ + // selectable: true, + // rowKey: 'id', + // }) + .setColumn([ + { key: 'roleId', title: '主键', visible: false }, + + { key: 'roleName', title: '名称', visible: true }, + { key: 'roleSort', title: '显示顺序', visible: true }, + + { key: 'status', title: '状态', visible: true }, + { key: 'remark', title: '备注', visible: true }, + // { key: 'createTime', title: '创建时间', visible: true }, + ]) + .setRowOperate([ + { title: '修改', onClick: this.onCreate.bind(this) }, + + { title: '删除', onClick: this.deleteItem.bind(this) }, + ]) + } + + fetchData(p: {}, q: AnyObject) { + return this.api.getRolePage({ ...p, ...q }) + } + + onCreate(data?: NzSafeAny) { + if (data) { + this.createForm.patchValue(data) + } + this.modal.create({ + nzTitle: data ? '编辑角色' : '添加角色', + nzContent: this.createFormTpl, + nzOnOk: async () => { + if (FormValidators.validateFormGroup(this.createForm)) { + const vals = this.createForm.value + const res = await lastValueFrom(this.api.saveRole(vals)) + this.msg.success(res.desc) + this.table.ref.reload() + return true + } + return false + }, + }) + } + + deleteItem(item?: NzSafeAny) { + const ids = [item.roleId] + this.modal.confirm({ + nzTitle: '警告', + nzContent: `是否要删除${ids.length}个角色?`, + nzOnOk: async () => { + const res = await lastValueFrom(this.api.deleteRole(ids)) + this.msg.success(res.desc) + this.table.ref.reload() + }, + }) + } +} diff --git a/web-admin-app/src/app/services/api.dto.ts b/web-admin-app/src/app/services/api.dto.ts index 5615f20..8b9677e 100644 --- a/web-admin-app/src/app/services/api.dto.ts +++ b/web-admin-app/src/app/services/api.dto.ts @@ -4,7 +4,7 @@ export type AuthDTO = { permissions: string[] roles: string[] userName: string -} +} & Record export type AuthorityDTO = { authority: string } diff --git a/web-admin-app/src/app/services/api.service.ts b/web-admin-app/src/app/services/api.service.ts index f6c1035..a175c6e 100644 --- a/web-admin-app/src/app/services/api.service.ts +++ b/web-admin-app/src/app/services/api.service.ts @@ -1,23 +1,9 @@ -import { HttpClient, HttpParams } from '@angular/common/http' +import { HttpClient } from '@angular/common/http' import { Injectable } from '@angular/core' -import { JwResponse, NullableProps } from 'app/types' +import { JwResponse } from 'app/types' import { Utils } from 'app/utils' -import { NzTreeNodeOptions } from 'ng-zorro-antd/tree' -import { BehaviorSubject, map, of, tap } from 'rxjs' -import { - AuthDTO, - AuthorizeItemDTO, - ConsoleClientTopDTO, - ConsoleCountDTO, - ConsoleExpireDTO, - EntityDTO, - EntityDetailDTO, - PermissionDTO, - ProductDTO, - RoleFormDTO, - RoleListDTO, - UserDTO, -} from './api.dto' +import { of, tap } from 'rxjs' +import { AuthDTO } from './api.dto' import { PermissionService } from 'app/shared/permission/permission.service' import { NzSafeAny } from 'ng-zorro-antd/core/types' @@ -103,10 +89,29 @@ export class ApiService { } return this.http.post('/api/umsUser/update', data) } + getRolePage(data: {}) { + return this.http.post('/api/umsRole/list', data) + } + getRoleDetail(id: number) { + return this.http.post(`/api/umsRole/query?roleId=${id}`, null) + } + + deleteRole(ids: number[]) { + return this.http.post(`/api/umsRole/delete`, ids) + } + saveRole(data: NzSafeAny) { + if (Utils.isEmpty(data.roleId)) { + return this.http.post('/api/umsRole/add', data) + } + return this.http.post('/api/umsRole/update', data) + } getAssetPage(data: {}) { return this.http.post('/api/eamAsset/list', data) } + getAssetListByIds(ids: number[]) { + return this.http.post('/api/eamAsset/queryByIds', ids) + } getAssetLog(data: {}) { return this.http.post('/api/eamAssetLog/list', data) } @@ -147,6 +152,22 @@ export class ApiService { return this.http.post('/api/eamAsset/update', data) } + getAlertBorrow(data: {}) { + return this.http.post('/api/eamAsset/warning/borrow', data) + } + getAlertMaintenance(data: {}) { + return this.http.post('/api/eamAsset/warning/maintenance', data) + } + getAlertSafety(data: {}) { + return this.http.post('/api/eamAsset/warning/safety', data) + } + getAlertSafetyUp(data: {}) { + return this.http.post('/api/eamAsset/warning/up', data) + } + getAlertSafetyDown(data: {}) { + return this.http.post('/api/eamAsset/warning/down', data) + } + getBasicPositionPage(data: {}) { return this.http.post('/api/eamBasicPosition/list', data) } @@ -409,17 +430,4 @@ export class ApiService { deleteRepairFault(ids: number[]) { return this.http.post(`/api/eamRepairFault/delete`, ids) } - - /** - * - * - * ------------------------------- - * - * - */ - - getEntityPage(p: {}, q: {}) { - const params = Utils.objectToURLSearchParams({ ...p, ...q }) - return this.http.get(`/api/client/pages?${params}`) - } } diff --git a/web-admin-app/src/app/services/local-http-interceptor.service.ts b/web-admin-app/src/app/services/local-http-interceptor.service.ts index 9441b00..c779460 100644 --- a/web-admin-app/src/app/services/local-http-interceptor.service.ts +++ b/web-admin-app/src/app/services/local-http-interceptor.service.ts @@ -3,6 +3,7 @@ import { HttpEvent, HttpHandler, HttpInterceptor, + HttpParams, HttpRequest, HttpResponse, } from '@angular/common/http' @@ -12,6 +13,7 @@ import { catchError, filter, tap } from 'rxjs/operators' import { ActivatedRoute, NavigationEnd, Router } from '@angular/router' import { NzMessageService } from 'ng-zorro-antd/message' import { ApiService } from './api.service' +import { Utils } from 'app/utils' function uintToString(uintArray: Uint8Array) { const encodedString = String.fromCharCode.apply(null, uintArray as any) @@ -86,11 +88,17 @@ export class LocalHttpInterceptorService implements HttpInterceptor { } const Authorization: Record = token ? { Authorization: token } : {} + const params = Object.create(null) + if (!Utils.isEmpty(req.body?.pageSize) && !Utils.isEmpty(req.body?.pageNum)) { + params['pageSize'] = req.body.pageSize + params['pageNum'] = req.body.pageNum + } const newRequest = req.clone({ ...req, setHeaders: Authorization, url, + setParams: params, }) return this.handleResult(next, newRequest) } diff --git a/web-admin-app/src/app/shared/components/header/header.component.html b/web-admin-app/src/app/shared/components/header/header.component.html index 0195dff..e7066b3 100644 --- a/web-admin-app/src/app/shared/components/header/header.component.html +++ b/web-admin-app/src/app/shared/components/header/header.component.html @@ -12,9 +12,9 @@ - @@ -64,7 +64,11 @@