houzhongjian
2024-07-23 8501060c4f921d1e744c477e4dc08eb47b52693c
提交 | 用户 | 时间
850106 1 <template>
H 2   <el-card shadow="never" class="aui-card--fill">
3     <div class="mod-device__device-account}">
4       <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
5         <el-form-item>
6           <el-input v-model="dataForm.deviceCode" placeholder="设备编号" clearable></el-input>
7         </el-form-item>
8         <el-form-item>
9           <el-input v-model="dataForm.deviceName" placeholder="设备名称" clearable></el-input>
10         </el-form-item>
11         <el-form-item>
12           <el-button @click="getDataList()">{{ $t('query') }}</el-button>
13         </el-form-item>
14         <el-form-item>
15           <el-button v-if="$hasPermission('device:device-account:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
16         </el-form-item>
17         <el-form-item>
18           <el-button v-if="$hasPermission('device:device-account:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
19         </el-form-item>
20       </el-form>
21       <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
22         <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
23         <el-table-column prop="deviceId" label="设备ID" header-align="center" align="center"></el-table-column>
24         <el-table-column prop="deviceCode" label="设备编号" header-align="center" align="center"></el-table-column>
25         <el-table-column prop="deviceName" label="设备名称" header-align="center" align="center"></el-table-column>
26         <el-table-column prop="workshop" label="所属车间" header-align="center" align="center"></el-table-column>
27         <el-table-column prop="specification" label="规格型号" header-align="center" align="center"></el-table-column>
28         <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
29           <template slot-scope="scope">
30             <el-button v-if="$hasPermission('device:device-account:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
31             <el-button v-if="$hasPermission('device:device-account:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
32           </template>
33         </el-table-column>
34       </el-table>
35       <el-pagination
36         :current-page="page"
37         :page-sizes="[10, 20, 50, 100]"
38         :page-size="limit"
39         :total="total"
40         layout="total, sizes, prev, pager, next, jumper"
41         @size-change="pageSizeChangeHandle"
42         @current-change="pageCurrentChangeHandle">
43       </el-pagination>
44       <!-- 弹窗, 新增 / 修改 -->
45       <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
46     </div>
47   </el-card>
48 </template>
49
50 <script>
51 import mixinViewModule from '@/mixins/view-module'
52 import AddOrUpdate from './device-account-add-or-update'
53 export default {
54   mixins: [mixinViewModule],
55   data () {
56     return {
57       mixinViewModuleOptions: {
58         getDataListURL: '/iailab-ntt-model/device/device-account/page',
59         getDataListIsPage: true,
60         exportURL: '/iailab-ntt-model/device/device-account/export',
61         deleteURL: '/iailab-ntt-model/device/device-account',
62         deleteIsBatch: true
63       },
64       dataForm: {
65         deviceCode: '',
66         deviceName: ''
67       }
68     }
69   },
70   components: {
71     AddOrUpdate
72   }
73 }
74 </script>