diff --git a/src/views/workLicense/personnelEquipment.vue b/src/views/workLicense/personnelEquipment.vue
index f089e8e6..f9f8f84d 100644
--- a/src/views/workLicense/personnelEquipment.vue
+++ b/src/views/workLicense/personnelEquipment.vue
@@ -17,14 +17,17 @@
@refresh-change="refreshChange"
@on-load="onLoad"
:row-class-name="rowClassName"
+ @sort-change="sortChange"
>
- 设备维护
- 批量删除
+
+ 设备维护
+
+ 批量删除
- 导 入
+ 导 入
{{ scope.row.equipmentDate ? scope.row.equipmentDate.substring(0, 10) : '' }}
@@ -64,7 +67,7 @@
import equipmentDialog from './components/equipmentDialog.vue';
import basicImport from '@/components/basic-import/main.vue';
import { getList, remove, add, update } from '@/api/workLicense/personnelEquipment';
-
+import { mapGetters } from 'vuex';
export default {
components: {
equipmentDialog,
@@ -96,7 +99,7 @@ export default {
currentPage: 1,
total: 0,
},
-
+ query: {},
selectionList: [],
spanArr: [
{ prop: 'userName', span: [] },
@@ -170,6 +173,7 @@ export default {
labelWidth: 140,
overflow: true,
search: true,
+ sortable: 'custom',
fixed: 'left',
},
{
@@ -179,6 +183,7 @@ export default {
width: 150,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '所属岗位',
@@ -187,7 +192,7 @@ export default {
width: 150,
overflow: true,
search: false,
-
+ sortable: 'custom',
},
{
label: '所属岗位',
@@ -195,6 +200,7 @@ export default {
span: 8,
labelWidth: 150,
search: true,
+ sortable: 'custom',
width: 170,
hide: true,
filterable: true,
@@ -213,6 +219,7 @@ export default {
span: 8,
labelWidth: 150,
search: true,
+ sortable: 'custom',
width: 200,
dicUrl: '/blade-system/dict/dictionary?code=skill_level',
props: {
@@ -227,6 +234,7 @@ export default {
width: 150,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '最高学历',
@@ -235,6 +243,7 @@ export default {
width: 150,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '出生年月',
@@ -243,6 +252,7 @@ export default {
width: 150,
overflow: true,
search: false,
+ sortable: 'custom',
},
// {
@@ -262,6 +272,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '设备编号',
@@ -271,6 +282,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '设备时间',
@@ -280,6 +292,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '设备有效期(天)',
@@ -289,6 +302,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '设备到期日期',
@@ -298,6 +312,7 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
+ sortable: 'custom',
},
{
label: '状态',
@@ -308,11 +323,24 @@ export default {
labelWidth: 140,
overflow: true,
search: false,
+ sortable: 'custom',
},
],
},
};
},
+ computed: {
+ ...mapGetters(['permission']),
+ equipmentMaintenancePermission() {
+ return this.validData(this.permission.personnelEquipment_equipmentMaintenance, false);
+ },
+ deletePermission() {
+ return this.validData(this.permission.personnelEquipment_del, false);
+ },
+ importPermission() {
+ return this.validData(this.permission.personnelEquipment_import, false);
+ },
+ },
mounted() {},
methods: {
// 点击导入按钮
@@ -469,6 +497,15 @@ export default {
refreshChange() {
this.onLoad(this.page, this.query);
},
+ // 排序
+ sortChange({ prop, order }) {
+ this.query.descs = undefined;
+ this.query.ascs = undefined;
+ let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs';
+ this.query[orderByFieldKey] = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase();
+ // 重新加载数据
+ this.onLoad(this.page, this.query);
+ },
searchReset() {
this.query = {};
this.treeDeptId = '';