| | |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | :customRow='clickThenSelect' |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="referenceFile" slot-scope="text, record, index"> |
| | | <a v-if="text && text !== ''" @click="handlePreview(record)">预览</a> |
| | | </template> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">编辑</a> |
| | | |
| | |
| | | </span> |
| | | |
| | | </a-table> |
| | | |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane |
| | | tab='保养标准明细项' |
| | | key="1" |
| | | > |
| | | <div |
| | | class="table-operator" |
| | | style="margin:-16px" |
| | | > |
| | | <eam-maintenance-standard-detail-list :standardId="standardId" /> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | </a-tabs> |
| | | </div> |
| | | <!-- table区域-end --> |
| | | |
| | | <!-- 表单区域 --> |
| | | <eamMaintenanceStandard-modal ref="modalForm" @ok="modalFormOk"></eamMaintenanceStandard-modal> |
| | | <lx-file-preview ref="lxFilePreview" :fileUrl="fileUrl"></lx-file-preview> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import '@/assets/less/TableExpand.less' |
| | | import EamMaintenanceStandardModal from './modules/EamMaintenanceStandardModal' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import EamMaintenanceStandardDetailList from '@views/eam/base/modules/EamMaintenanceStandardDetailList' |
| | | |
| | | |
| | | export default { |
| | | name: 'EamMaintenanceStandardList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamMaintenanceStandardModal |
| | | EamMaintenanceStandardModal, |
| | | EamMaintenanceStandardDetailList |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | dataIndex: 'standardName' |
| | | }, |
| | | { |
| | | title: '保养周期', |
| | | title: '文件编号', |
| | | align: 'center', |
| | | dataIndex: 'fileCode' |
| | | }, |
| | | { |
| | | title: '保养周期(天)', |
| | | align: 'center', |
| | | dataIndex: 'maintenancePeriod' |
| | | }, |
| | | { |
| | | title: '初始日期', |
| | | align: 'center', |
| | | dataIndex: 'initialDate' |
| | | }, |
| | | { |
| | | title: '保养分类', |
| | | align: 'center', |
| | | dataIndex: 'maintenanceCategory' |
| | | dataIndex: 'maintenanceCategory_dictText' |
| | | }, |
| | | { |
| | | title: '设备编号', |
| | | align: 'center', |
| | | dataIndex: 'equipmentCode' |
| | | dataIndex: 'equipmentId_dictText' |
| | | }, |
| | | { |
| | | title: '标准状态', |
| | | align: 'center', |
| | | dataIndex: 'standardStatus' |
| | | dataIndex: 'standardStatus_dictText' |
| | | }, |
| | | { |
| | | title: '标准版本', |
| | | title: '版本', |
| | | align: 'center', |
| | | dataIndex: 'standardVersion' |
| | | }, |
| | | { |
| | | title: '参考文件', |
| | | align: 'center', |
| | | dataIndex: 'referenceFile', |
| | | scopedSlots: { customRender: 'referenceFile' } |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | deleteBatch: '/eam/maintenanceStandard/deleteBatch', |
| | | exportXlsUrl: 'eam/maintenanceStandard/exportXls', |
| | | importExcelUrl: 'eam/maintenanceStandard/importExcel' |
| | | } |
| | | }, |
| | | fileUrl: '', |
| | | standardId: '-1', |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: {} |
| | | methods: { |
| | | handlePreview: function (record) { |
| | | if(record.referenceFile) { |
| | | try { |
| | | let file = JSON.parse(record.referenceFile); |
| | | this.$refs.lxFilePreview.preview(file.filePath); |
| | | }catch (e) { |
| | | console.error(e); |
| | | this.$message.error(e.message); |
| | | } |
| | | }else { |
| | | this.$message.warning("参考文件为空!"); |
| | | } |
| | | }, |
| | | clickThenSelect(record) { |
| | | return { |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange(record.id.split(','), [record]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | onClearSelected() { |
| | | this.selectedRowKeys = []; |
| | | this.selectionRows = []; |
| | | this.standardId = '-1'; |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | if (selectedRowKeys.length === 1) { |
| | | this.standardId = selectionRows[0]['id'] |
| | | } else { |
| | | this.standardId = '-1' |
| | | } |
| | | }, |
| | | searchReset() { |
| | | this.standardId = '-1'; |
| | | this.queryParam = {} |
| | | this.loadData(1); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |