| | |
| | | :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> |
| | |
| | | </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 --> |
| | | |
| | |
| | | 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 { |
| | |
| | | importExcelUrl: 'eam/maintenanceStandard/importExcel' |
| | | }, |
| | | fileUrl: '', |
| | | standardId: '-1', |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | 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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table |
| | | ref="detailTable" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import '@/assets/less/TableExpand.less' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { getAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'EamMaintenanceStandardDetailList', |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | standardId: { |
| | | type: String, |
| | | required: true, |
| | | default: '-1' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'ä¿å
»æ åæç»ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'åºå·', |
| | | align: 'center', |
| | | dataIndex: 'itemCode' |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹', |
| | | align: 'center', |
| | | dataIndex: 'itemName' |
| | | }, |
| | | { |
| | | title: 'å项ç®', |
| | | align: 'center', |
| | | dataIndex: 'subItemName' |
| | | }, |
| | | { |
| | | title: 'ä¿å
»è¦æ±', |
| | | align: 'center', |
| | | dataIndex: 'itemDemand' |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/eam/eamMaintenanceStandardDetail/list' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | standardId: { |
| | | immediate: true, |
| | | handler(val) { |
| | | if(val) { |
| | | this.loadData(1) |
| | | }else { |
| | | this.clearList(); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | if(this.standardId && this.standardId === '-1'){ |
| | | this.clearList(); |
| | | return; |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | let params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | if (!params) { |
| | | return false |
| | | } |
| | | this.dataSource = [] |
| | | params.standardId = this.standardId |
| | | this.loading = true |
| | | 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 (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 forï¼éé
ä¸åé¡µçæ°æ®å表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | clearList() { |
| | | this.dataSource = [] |
| | | this.selectedRowKeys = [] |
| | | this.ipagination.current = 1 |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |