| | |
| | | pageSize:10, |
| | | showSizeChanger: true, |
| | | showQuickJumper: true, |
| | | pageSizeOptions: ['10', '30', '60', '100'], |
| | | showTotal: (total:number) => `共有 ${this.pagination.total} 条数据`, //分页中显示总的数据 |
| | | }; |
| | | |
| | |
| | | |
| | | private title: any = null; |
| | | |
| | | private columns: any[] = [{ |
| | | title: '名称', |
| | | private columns: any[] = [ |
| | | { |
| | | title: "序号", |
| | | dataIndex: "key", |
| | | key: "key", |
| | | align: "center", |
| | | customRender: (text,record,index) => `${index+1}`, |
| | | width: 60, |
| | | }, |
| | | { |
| | | title: '名称', |
| | | align: "center", |
| | | dataIndex: 'unitName', |
| | | }, |
| | | { |
| | | title: '上级区域', |
| | | title: '上级区域', |
| | | align: "center", |
| | | dataIndex: 'parentName', |
| | | }, |
| | | { |
| | | title: '所属区域', |
| | | title: '所属区域', |
| | | align: "center", |
| | | dataIndex: 'areaName', |
| | | }, |
| | | { |
| | |
| | | dataIndex: 'updateTime', |
| | | }, |
| | | { |
| | | title: '操作人', |
| | | title: '操作人', |
| | | align: "center", |
| | | dataIndex: 'createName', |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'state', |
| | | dataIndex: 'state', |
| | | align: "center", |
| | | customRender: this.progressStateRender, |
| | | }, |
| | | { |
| | | title: '是否作废', |
| | | dataIndex: 'isInvalid', |
| | | align: "center", |
| | | customRender: this.progressIsInvalidRender, |
| | | }, |
| | | { |
| | | title: '操作', |
| | | title: '操作', |
| | | align: "center", |
| | | customRender: this.opRender, |
| | | }, |
| | | ]; |
| | |
| | | console.log(this.serch) |
| | | const data = this.serch.parentCode |
| | | let code =data[data.length-1] |
| | | |
| | | get("unit/selectUint",{ |
| | | name:this.serch.name, |
| | | parentCode:code, |
| | | parentCodeList:this.serch.parentCode, |
| | | areaCode:this.serch.areaCode, |
| | | current: this.pagination.current, |
| | | page:1, |
| | | page:this.pagination.current, |
| | | size: this.pagination.pageSize |
| | | }).then(res=>{ |
| | | this.dataSource = res.data.data.item |
| | |
| | | } |
| | | |
| | | private handlerTableChange(pagination: any, filter: any, sorter: any): void { |
| | | console.log(pagination) |
| | | console.log('pagination',pagination) |
| | | this.pagination.current = pagination.current |
| | | this.pagination.pageSize = pagination.pageSize |
| | | this.pagination.total = pagination.total |
| | |
| | | }); |
| | | } |
| | | |
| | | private progressStateRender(text: string) { |
| | | private progressIsInvalidRender(text: Number) { |
| | | if (text === 0) { |
| | | return <a-badge status = 'success' text = '未作废' />; |
| | | } |
| | | return <a-badge status = 'error' text = '已作废' />; |
| | | } |
| | | |
| | | private progressStateRender(text: string) { |
| | | if (text === '0') { |
| | | return <a-badge status = 'success' text = '生效' />; |
| | | } |
| | | return <a-badge status = 'processing' text = '未生效' />; |
| | | } |
| | | |
| | | private async handleUpdateModalVisible(visible: boolean, record: any): void { |
| | | this.visibleCreateModal = true; |
| | | await this.positionLevel(record.parentCodeList) |
| | |
| | | } |
| | | private opRender(text: string, record: any, index: number) { |
| | | // 生效console |
| | | console.log('1111',text) |
| | | console.log('2222',record) |
| | | console.log('333', index) |
| | | if (record.state ==='0') { |
| | | return <div> |
| | | console.log('record',record) |
| | | if (record.state === '0') { |
| | | if (Number(record.isInvalid) === 0) { |
| | | return <div> |
| | | <a onClick = { |
| | | () => this.handleDetailModalVisible(true, record) |
| | | } > 详情 </a> |
| | | <a-divider type = 'vertical' /> |
| | | <a v-show="record.isInvalid !=='0'" onClick = { |
| | | <a onClick = { |
| | | () => this.handleInvalidity(record) |
| | | } >作废</a> |
| | | </div> |
| | | } else { |
| | | return <div> |
| | | <a onClick = { |
| | | () => this.handleDetailModalVisible(true, record) |
| | | } > 详情 </a> |
| | | </div> |
| | | } |
| | | } else { |
| | | return <div> |
| | | <a onClick = { |