|
|
|
|
@ -16,14 +16,26 @@ |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@on-load="onLoad" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
:beforeOpen="beforeOpen" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="danger" @click="handleDelete">删除</el-button> |
|
|
|
|
<el-button type="danger" v-if="permission.workCenter_del" @click="handleDelete"> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu="{ row }"> |
|
|
|
|
<el-button type="text" @click="setTeam(row)">设置班组</el-button> |
|
|
|
|
<el-button type="text" @click="setCapability(row)">设置工艺能力</el-button> |
|
|
|
|
<el-button type="text" v-if="permission.workCenter_setTeam" @click="setTeam(row)"> |
|
|
|
|
设置班组 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
v-if="permission.workCenter_setCapability" |
|
|
|
|
@click="setCapability(row)" |
|
|
|
|
> |
|
|
|
|
设置工艺能力 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
<el-dialog title="设置班组" append-to-body v-model="teamDialog" width="700"> |
|
|
|
|
@ -131,6 +143,7 @@ import { |
|
|
|
|
deleteWorkCenter, |
|
|
|
|
getAllUser, |
|
|
|
|
} from '@/api/basicData/workCenter'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -465,6 +478,15 @@ export default { |
|
|
|
|
checkId: '', |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(['permission']), |
|
|
|
|
permissionList() { |
|
|
|
|
return { |
|
|
|
|
addBtn: this.validData(this.permission.workCenter_add, false), |
|
|
|
|
editBtn: this.validData(this.permission.workCenter_edit, false), |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getAbilityData(); |
|
|
|
|
}, |
|
|
|
|
@ -699,6 +721,20 @@ export default { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 排序 |
|
|
|
|
sortChange({ prop, order }) { |
|
|
|
|
if (!prop) { |
|
|
|
|
// 如果取消排序,清空排序参数 |
|
|
|
|
this.query.orderByField = undefined; |
|
|
|
|
this.query.isAsc = undefined; |
|
|
|
|
} else { |
|
|
|
|
const orderByField = prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); |
|
|
|
|
this.query.orderByField = orderByField; |
|
|
|
|
this.query.isAsc = order === 'ascending' ? true : false; |
|
|
|
|
} |
|
|
|
|
// 重新加载数据 |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
getList({ |
|
|
|
|
current: this.page.currentPage, |
|
|
|
|
|