|
|
|
|
@ -17,11 +17,12 @@ |
|
|
|
|
@on-load="onLoad" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> </template> |
|
|
|
|
<template #menu-right> </template> |
|
|
|
|
<template #menu="{ row }"> </template> |
|
|
|
|
|
|
|
|
|
<template #heatTreat="scope"> </template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</basic-container> |
|
|
|
|
@ -29,6 +30,7 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getList, remove, add, update } from '@/api/workLicense/certificateType'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
export default { |
|
|
|
|
components: {}, |
|
|
|
|
data() { |
|
|
|
|
@ -62,7 +64,6 @@ export default { |
|
|
|
|
delBtn: true, |
|
|
|
|
editBtnText: '修改', |
|
|
|
|
labelWidth: 120, |
|
|
|
|
|
|
|
|
|
dialogWidth: 900, |
|
|
|
|
dialogClickModal: false, |
|
|
|
|
searchEnter: true, |
|
|
|
|
@ -90,14 +91,14 @@ export default { |
|
|
|
|
label: '证书名称', |
|
|
|
|
prop: 'name', |
|
|
|
|
search: true, |
|
|
|
|
sortable: true, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
span: 12, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '证书有效期(年)', |
|
|
|
|
prop: 'validityPeriod', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
type: 'number', |
|
|
|
|
span: 12, |
|
|
|
|
}, |
|
|
|
|
@ -105,7 +106,7 @@ export default { |
|
|
|
|
label: '适航有效期(年)', |
|
|
|
|
prop: 'airworthinessValidityPeriod', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
type: 'number', |
|
|
|
|
span: 12, |
|
|
|
|
}, |
|
|
|
|
@ -113,7 +114,7 @@ export default { |
|
|
|
|
label: '宇航有效期(年)', |
|
|
|
|
prop: 'astronautValidityPeriod', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
type: 'number', |
|
|
|
|
span: 12, |
|
|
|
|
}, |
|
|
|
|
@ -123,6 +124,16 @@ export default { |
|
|
|
|
data: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(['permission']), |
|
|
|
|
permissionList() { |
|
|
|
|
return { |
|
|
|
|
addBtn: this.validData(this.permission.certificateType_add, false), |
|
|
|
|
delBtn: this.validData(this.permission.certificateType_del, false), |
|
|
|
|
editBtn: this.validData(this.permission.certificateType_edit, false), |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
add(row).then( |
|
|
|
|
@ -185,7 +196,6 @@ export default { |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
currentChange(currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
}, |
|
|
|
|
@ -195,7 +205,17 @@ 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 |
|
|
|
|
? undefined |
|
|
|
|
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); |
|
|
|
|
// 重新加载数据 |
|
|
|
|
this.onLoad(this.page, this.query); |
|
|
|
|
}, |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
this.loading = true; |
|
|
|
|
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
|
|
|
|
|