| | |
| | | type: Object, |
| | | default: () => { |
| | | } |
| | | }, |
| | | filterKey: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | description: '保养标准明细管理页面', |
| | | // 表头 |
| | | columns: [], |
| | | defaultColumns: [ |
| | | inspectionColumns: [ |
| | | { |
| | | title: '序号', |
| | | align: 'center', |
| | | dataIndex: 'itemCode', |
| | | width: 60 |
| | | }, |
| | | { |
| | | title: '部位', |
| | | align: 'center', |
| | | dataIndex: 'itemPart', |
| | | ellipsis: true |
| | | }, |
| | | { |
| | | title: '保养项分类', |
| | |
| | | ellipsis: true |
| | | } |
| | | ], |
| | | secondMaintenanceColumns: [ |
| | | { |
| | | title: '序号', |
| | | align: 'center', |
| | | dataIndex: 'itemCode', |
| | | width: 60 |
| | | }, |
| | | { |
| | | title: '保养项分类', |
| | | align: 'center', |
| | | dataIndex: 'itemCategory_dictText', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: '保养项目', |
| | | align: 'center', |
| | | dataIndex: 'itemName', |
| | | ellipsis: true |
| | | } |
| | | ], |
| | | thirdMaintenanceColumns: [ |
| | | { |
| | | title: '序号', |
| | | align: 'center', |
| | | dataIndex: 'itemCode', |
| | | width: 60 |
| | | }, |
| | | { |
| | | title: '保养部位', |
| | | align: 'center', |
| | | dataIndex: 'itemPart', |
| | | ellipsis: true |
| | | }, |
| | | { |
| | | title: '保养内容', |
| | | align: 'center', |
| | | dataIndex: 'itemName', |
| | | ellipsis: true |
| | | }, |
| | | { |
| | | title: '验收标准', |
| | | align: 'center', |
| | | dataIndex: 'itemDemand', |
| | | ellipsis: true |
| | | } |
| | | ], |
| | | disableMixinCreated: true, |
| | | url: { |
| | | list: '/eam/eamMaintenanceStandardDetail/list' |
| | | } |
| | |
| | | immediate: true, |
| | | handler(val) { |
| | | if (val) { |
| | | this.loadData(1) |
| | | console.log('val---------------------', val) |
| | | this.$nextTick(() => this.loadData(1)) |
| | | } else { |
| | | this.clearList() |
| | | } |
| | | } |
| | | }, |
| | | pageSelectionRow: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if (val) { |
| | | if (val.maintenanceCategory != 'THIRD_MAINTENANCE') this.columns = [...this.defaultColumns.filter(item => item.dataIndex != 'itemPart')] |
| | | else this.columns = [...this.defaultColumns.filter(item => item.dataIndex != 'itemCategory_dictText')] |
| | | switch (val.maintenanceCategory) { |
| | | case 'POINT_INSPECTION': |
| | | this.columns = this.inspectionColumns |
| | | break |
| | | case 'SECOND_MAINTENANCE': |
| | | this.columns = this.secondMaintenanceColumns |
| | | break |
| | | case 'THIRD_MAINTENANCE': |
| | | this.columns = this.thirdMaintenanceColumns |
| | | break |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list属性!') |
| | | return |
| | | } |
| | | if (this.standardId && this.standardId === '-1') { |
| | | this.clearList() |
| | | return |
| | |
| | | this.dataSource = [] |
| | | params.standardId = this.standardId |
| | | this.loading = true |
| | | console.log('----------------------', this.filterKey) |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | // console.log(res) |
| | | //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
| | | this.dataSource = res.result.records || res.result |
| | | if (this.filterKey) this.dataSource = res.result.records.filter(item => item.itemCategory == this.filterKey) |
| | | else this.dataSource = res.result.records |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |