+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ 可选机台
+
+
+
+
+
+
+
+
+
+
+
+ 添加>>
+
+
+ 删除<<
+
+
+
+ 已有机台
+
+
+
+
+
+
+
+
+
+
+
+ 关闭
+
+
@@ -529,6 +629,9 @@ import {
getBusinessRoleList,
addUserBusinessRole,
delUserBusinessRole,
+ getMachineResourceList,
+ addUserMachineResource,
+ delUserMachineResource,
} from '@/api/factory/site.js'
import AddOrUpdate from './user-add-or-update'
import {throttle} from "../../../utils/common";
@@ -557,6 +660,7 @@ export default {
buAuthorization: 'BU授权',
deptAuthorization: '部门授权',
businessRoleAuthorization: '岗位角色',
+ machineResourceAuthorization: '机台授权',
createTime: '创建时间',
username: '用户账号',
userDisplay: '用户名',
@@ -606,6 +710,13 @@ export default {
active: '',
username: ''
},
+ machineResourceData: {
+ site: '',
+ buNo: '',
+ resourceID: '',
+ resourceDesc: '',
+ username: ''
+ },
siteList1:[],
siteList2:[],
buList1:[],
@@ -614,6 +725,8 @@ export default {
deptList2:[],
businessRoleList1:[],
businessRoleList2:[],
+ machineResourceList1:[],
+ machineResourceList2:[],
siteSelections1: [],
siteSelections2: [],
buSelections1: [],
@@ -622,10 +735,13 @@ export default {
deptSelections2: [],
businessRoleSelections1: [],
businessRoleSelections2: [],
+ machineResourceSelections1: [],
+ machineResourceSelections2: [],
siteAddModal: false,
buAddModal: false,
deptAddModal: false,
businessRoleAddModal: false,
+ machineResourceAddModal: false,
}
},
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() {
// this.getFunctionButtonList()