|
|
@ -14,6 +14,7 @@ |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="buAuthorize()">{{ buttons.buAuthorization || 'BU授权' }}</el-button> |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="buAuthorize()">{{ buttons.buAuthorization || 'BU授权' }}</el-button> |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="deptAuthorize()">{{ buttons.deptAuthorization || '部门授权' }}</el-button> |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="deptAuthorize()">{{ buttons.deptAuthorization || '部门授权' }}</el-button> |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="businessRoleAuthorize()">{{ buttons.businessRoleAuthorization || '岗位角色' }}</el-button> |
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="businessRoleAuthorize()">{{ buttons.businessRoleAuthorization || '岗位角色' }}</el-button> |
|
|
|
|
|
<el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="machineResourceAuthorize()">{{ buttons.machineResourceAuthorization || '机台授权' }}</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
@ -508,6 +509,105 @@ |
|
|
<el-button type="primary" @click="businessRoleAddModal = false">关闭</el-button> |
|
|
<el-button type="primary" @click="businessRoleAddModal = false">关闭</el-button> |
|
|
</el-footer> |
|
|
</el-footer> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 机台授权弹窗 --> |
|
|
|
|
|
<el-dialog title="机台授权" :close-on-click-modal="false" v-drag :visible.sync="machineResourceAddModal" width="900px"> |
|
|
|
|
|
<div style="font-size: 12px"> |
|
|
|
|
|
<el-form :inline="true" label-position="top" :model="machineResourceData"> |
|
|
|
|
|
<el-form-item :label="'工厂编码'"> |
|
|
|
|
|
<el-input v-model="machineResourceData.site" clearable style="width: 120px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="'机台编码'"> |
|
|
|
|
|
<el-input v-model="machineResourceData.resourceID" clearable style="width: 120px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="'机台描述'"> |
|
|
|
|
|
<el-input v-model="machineResourceData.resourceDesc" clearable style="width: 200px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="' '"> |
|
|
|
|
|
<el-button type="primary" @click="getMachineResource()">查询</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-container style="margin-top: 0px;"> |
|
|
|
|
|
<el-main style="width: 400px; padding: 1px"> |
|
|
|
|
|
<span style="font-size: 12px" >可选机台</span> |
|
|
|
|
|
<el-table |
|
|
|
|
|
height="400px" |
|
|
|
|
|
:data="machineResourceList1" |
|
|
|
|
|
border |
|
|
|
|
|
ref="machineResourceTable1" |
|
|
|
|
|
@row-click="machineResourceClickRow1" |
|
|
|
|
|
@selection-change="selectionMachineResource1" |
|
|
|
|
|
highlight-current-row |
|
|
|
|
|
style="width: 100%"> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
type="selection" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
width="50"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="resourceID" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
min-width="80" |
|
|
|
|
|
label="机台编码"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="resourceDesc" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
min-width="120" |
|
|
|
|
|
label="机台描述"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-main> |
|
|
|
|
|
<el-main style="width: 111px;padding: 1px"> |
|
|
|
|
|
<div style="margin-top: 182px;margin-left: 18px"> |
|
|
|
|
|
<el-button type="primary" @click="addMachineResource()">添加>></el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div style="margin-top: 15px;margin-left: 18px"> |
|
|
|
|
|
<el-button type="primary" @click="deleteMachineResource()">删除<<</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-main> |
|
|
|
|
|
<el-main style="width: 400px;padding: 1px"> |
|
|
|
|
|
<span style="font-size: 12px" >已有机台</span> |
|
|
|
|
|
<el-table |
|
|
|
|
|
height="400px" |
|
|
|
|
|
:data="machineResourceList2" |
|
|
|
|
|
border |
|
|
|
|
|
ref="machineResourceTable2" |
|
|
|
|
|
@row-click="machineResourceClickRow2" |
|
|
|
|
|
@selection-change="selectionMachineResource2" |
|
|
|
|
|
highlight-current-row |
|
|
|
|
|
style="width: 100%"> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
type="selection" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
width="50"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="resourceID" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
min-width="80" |
|
|
|
|
|
label="机台编码"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="resourceDesc" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
min-width="120" |
|
|
|
|
|
label="机台描述"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-main> |
|
|
|
|
|
</el-container> |
|
|
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
|
|
<el-button type="primary" @click="machineResourceAddModal = false">关闭</el-button> |
|
|
|
|
|
</el-footer> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -529,6 +629,9 @@ import { |
|
|
getBusinessRoleList, |
|
|
getBusinessRoleList, |
|
|
addUserBusinessRole, |
|
|
addUserBusinessRole, |
|
|
delUserBusinessRole, |
|
|
delUserBusinessRole, |
|
|
|
|
|
getMachineResourceList, |
|
|
|
|
|
addUserMachineResource, |
|
|
|
|
|
delUserMachineResource, |
|
|
} from '@/api/factory/site.js' |
|
|
} from '@/api/factory/site.js' |
|
|
import AddOrUpdate from './user-add-or-update' |
|
|
import AddOrUpdate from './user-add-or-update' |
|
|
import {throttle} from "../../../utils/common"; |
|
|
import {throttle} from "../../../utils/common"; |
|
|
@ -557,6 +660,7 @@ export default { |
|
|
buAuthorization: 'BU授权', |
|
|
buAuthorization: 'BU授权', |
|
|
deptAuthorization: '部门授权', |
|
|
deptAuthorization: '部门授权', |
|
|
businessRoleAuthorization: '岗位角色', |
|
|
businessRoleAuthorization: '岗位角色', |
|
|
|
|
|
machineResourceAuthorization: '机台授权', |
|
|
createTime: '创建时间', |
|
|
createTime: '创建时间', |
|
|
username: '用户账号', |
|
|
username: '用户账号', |
|
|
userDisplay: '用户名', |
|
|
userDisplay: '用户名', |
|
|
@ -606,6 +710,13 @@ export default { |
|
|
active: '', |
|
|
active: '', |
|
|
username: '' |
|
|
username: '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
machineResourceData: { |
|
|
|
|
|
site: '', |
|
|
|
|
|
buNo: '', |
|
|
|
|
|
resourceID: '', |
|
|
|
|
|
resourceDesc: '', |
|
|
|
|
|
username: '' |
|
|
|
|
|
}, |
|
|
siteList1:[], |
|
|
siteList1:[], |
|
|
siteList2:[], |
|
|
siteList2:[], |
|
|
buList1:[], |
|
|
buList1:[], |
|
|
@ -614,6 +725,8 @@ export default { |
|
|
deptList2:[], |
|
|
deptList2:[], |
|
|
businessRoleList1:[], |
|
|
businessRoleList1:[], |
|
|
businessRoleList2:[], |
|
|
businessRoleList2:[], |
|
|
|
|
|
machineResourceList1:[], |
|
|
|
|
|
machineResourceList2:[], |
|
|
siteSelections1: [], |
|
|
siteSelections1: [], |
|
|
siteSelections2: [], |
|
|
siteSelections2: [], |
|
|
buSelections1: [], |
|
|
buSelections1: [], |
|
|
@ -622,10 +735,13 @@ export default { |
|
|
deptSelections2: [], |
|
|
deptSelections2: [], |
|
|
businessRoleSelections1: [], |
|
|
businessRoleSelections1: [], |
|
|
businessRoleSelections2: [], |
|
|
businessRoleSelections2: [], |
|
|
|
|
|
machineResourceSelections1: [], |
|
|
|
|
|
machineResourceSelections2: [], |
|
|
siteAddModal: false, |
|
|
siteAddModal: false, |
|
|
buAddModal: false, |
|
|
buAddModal: false, |
|
|
deptAddModal: false, |
|
|
deptAddModal: false, |
|
|
businessRoleAddModal: false, |
|
|
businessRoleAddModal: false, |
|
|
|
|
|
machineResourceAddModal: false, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
components: { |
|
|
components: { |
|
|
@ -1131,6 +1247,104 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// ========================== 机台授权 ========================== |
|
|
|
|
|
|
|
|
|
|
|
// 机台授权 |
|
|
|
|
|
machineResourceAuthorize () { |
|
|
|
|
|
this.machineResourceData = { |
|
|
|
|
|
site: '', |
|
|
|
|
|
buNo: '', |
|
|
|
|
|
resourceID: '', |
|
|
|
|
|
resourceDesc: '', |
|
|
|
|
|
username: '' |
|
|
|
|
|
} |
|
|
|
|
|
this.machineResourceSelections1 = null |
|
|
|
|
|
this.machineResourceSelections2 = null |
|
|
|
|
|
getMachineResourceList(this.selectUser).then(({data}) => { |
|
|
|
|
|
this.machineResourceList1 = data.row1 |
|
|
|
|
|
this.machineResourceList2 = data.row2 |
|
|
|
|
|
}) |
|
|
|
|
|
this.machineResourceAddModal = true |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 查询可用机台 |
|
|
|
|
|
getMachineResource () { |
|
|
|
|
|
this.machineResourceData.username = this.selectUser.username |
|
|
|
|
|
getMachineResourceList(this.machineResourceData).then(({data}) => { |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
this.machineResourceList1 = data.row1 |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 可选机台 |
|
|
|
|
|
machineResourceClickRow1 (row) { |
|
|
|
|
|
this.$refs.machineResourceTable1.toggleRowSelection(row) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 已有机台 |
|
|
|
|
|
machineResourceClickRow2 (row) { |
|
|
|
|
|
this.$refs.machineResourceTable2.toggleRowSelection(row) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
selectionMachineResource1 (val) { |
|
|
|
|
|
this.machineResourceSelections1 = val |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
selectionMachineResource2 (val) { |
|
|
|
|
|
this.machineResourceSelections2 = val |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 添加机台 |
|
|
|
|
|
addMachineResource () { |
|
|
|
|
|
if (this.machineResourceSelections1 == null || this.machineResourceSelections1.length === 0) { |
|
|
|
|
|
this.$message.warning('请选择可选机台!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
let inData = { |
|
|
|
|
|
username: this.selectUser.username, |
|
|
|
|
|
resourceList: this.machineResourceSelections1 |
|
|
|
|
|
} |
|
|
|
|
|
addUserMachineResource(inData).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
getMachineResourceList(this.selectUser).then(({data}) => { |
|
|
|
|
|
this.machineResourceList1 = data.row1 |
|
|
|
|
|
this.machineResourceList2 = data.row2 |
|
|
|
|
|
}) |
|
|
|
|
|
this.machineResourceSelections1 = [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 删除机台 |
|
|
|
|
|
deleteMachineResource () { |
|
|
|
|
|
if (this.machineResourceSelections2 == null || this.machineResourceSelections2.length === 0) { |
|
|
|
|
|
this.$message.warning('请选择已有机台!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
let inData = { |
|
|
|
|
|
username: this.selectUser.username, |
|
|
|
|
|
resourceList: this.machineResourceSelections2 |
|
|
|
|
|
} |
|
|
|
|
|
delUserMachineResource(inData).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
getMachineResourceList(this.selectUser).then(({data}) => { |
|
|
|
|
|
this.machineResourceList1 = data.row1 |
|
|
|
|
|
this.machineResourceList2 = data.row2 |
|
|
|
|
|
}) |
|
|
|
|
|
this.machineResourceSelections2 = [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
// this.getFunctionButtonList() |
|
|
// this.getFunctionButtonList() |
|
|
|