¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="车é´"> |
| | | <a-select v-model="queryParam.productionId" placeholder="è¯·éæ©è½¦é´"> |
| | | <a-select-option v-for="item in workshopTreeData" :key="item.id"> |
| | | {{ item.productionName }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="æ°æ§ç³»ç»ç±»å«"> |
| | | <a-input placeholder="请è¾å
¥æ°æ§ç³»ç»ç±»å«" v-model="queryParam.deviceManagementName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" style="border-top: 5px"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ·»å 设å¤ç±»</a-button> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('设å¤ç±»ä¿¡æ¯')">导åº</a-button>--> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay" @click="handleMenuClick"> |
| | | <a-menu-item key="1"> |
| | | <a-icon type="delete" @click="batchDel"/> |
| | | å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> |
| | | æ¹éæä½ |
| | | <a-icon type="down"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i>已鿩 <a style="font-weight: 600">{{ |
| | | selectedRowKeys.length |
| | | }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :scroll="{y:465}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | <template slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical"/> |
| | | |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <DeviceCustomTypeManagementModal ref="modalForm" :workshopTreeData="workshopTreeData" @ok="loadData"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import dncApi from '@/api/dnc' |
| | | import DeviceCustomTypeManagementModal |
| | | from '@views/dnc/base/modules/DeviceCustomTypeManagement/DeviceCustomTypeManagementModal.vue' |
| | | |
| | | export default { |
| | | name: 'DeviceCustomTypeManagement', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | DeviceCustomTypeManagementModal |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '车é´', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'productionId_dictText' |
| | | }, |
| | | { |
| | | title: 'è½´æ°', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'deviceManagementCode' |
| | | }, |
| | | { |
| | | title: 'æ°æ§ç³»ç»ç±»å«', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'deviceManagementName' |
| | | }, |
| | | { |
| | | title: '设å¤ç»ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentIds', |
| | | width: 400, |
| | | ellipsis: true |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' }, |
| | | align: 'center', |
| | | width: 80 |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/nc/deviceManagement/query', |
| | | delete: '/nc/deviceManagement/delete', |
| | | deleteBatch: '/nc/deviceManagement/deleteBatch' |
| | | }, |
| | | workshopTreeData: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getWorkshopListByApi() |
| | | }, |
| | | methods: { |
| | | // è°ç¨æ¥å£è·åæ¥è¯¢åºåè½¦é´æ å表 |
| | | getWorkshopListByApi() { |
| | | dncApi.getHasPermissionWorkshopTreeApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.workshopTreeData = res.result |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleAdd: function() { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = 'æ°å¢' |
| | | this.$refs.modalForm.disabledEdit = false |
| | | }, |
| | | |
| | | handleEdit: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | this.$refs.modalForm.disabledEdit = true |
| | | }, |
| | | |
| | | handleMenuClick(e) { |
| | | if (e.key == 1) { |
| | | this.batchDel() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |