|
|
|
|
import { Component } 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'
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-fixed-asset-manage-distribution',
|
|
|
|
|
standalone: true,
|
|
|
|
|
imports: [SharedModule],
|
|
|
|
|
templateUrl: './fixed-asset-manage-distribution.component.html',
|
|
|
|
|
styleUrl: './fixed-asset-manage-distribution.component.less',
|
|
|
|
|
})
|
|
|
|
|
export class FixedAssetManageDistributionComponent {
|
|
|
|
|
constructor(private api: ApiService) {}
|
|
|
|
|
|
|
|
|
|
queryForm = new FormGroup({
|
|
|
|
|
name: new FormControl(''),
|
|
|
|
|
type: new FormControl(''),
|
|
|
|
|
status: new FormControl(''),
|
|
|
|
|
date: new FormControl(''),
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
table = new TableOption(this.fetchData.bind(this))
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
|
this.table
|
|
|
|
|
.setConfig({
|
|
|
|
|
selectable: true,
|
|
|
|
|
})
|
|
|
|
|
.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: false },
|
|
|
|
|
{ key: '制单人', title: '制单人', visible: true },
|
|
|
|
|
{ key: '业务日期', title: '业务日期', visible: false },
|
|
|
|
|
{ key: '选择数据', title: '选择数据', visible: true },
|
|
|
|
|
|
|
|
|
|
{ key: '创建时间', title: '创建时间', visible: true },
|
|
|
|
|
])
|
|
|
|
|
.setRowOperate([
|
|
|
|
|
{ title: '查看', premissions: [] },
|
|
|
|
|
{ title: '修改' },
|
|
|
|
|
{ title: '确认' },
|
|
|
|
|
{ title: '单据' },
|
|
|
|
|
{ title: '删除' },
|
|
|
|
|
])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fetchData(p: {}, q: AnyObject) {
|
|
|
|
|
if (Array.isArray(q['createTime'])) {
|
|
|
|
|
const createTimeStart = q['createTime']?.[0]
|
|
|
|
|
const createTimeEnd = q['createTime']?.[1]
|
|
|
|
|
|
|
|
|
|
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',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
return this.api.getEntityPage(p, q)
|
|
|
|
|
}
|
|
|
|
|
}
|