员工管理添加权限
This commit is contained in:
parent
aa096f1026
commit
77af2e00a7
|
|
@ -336,7 +336,7 @@
|
|||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div style="font-size: 18px;font-weight: bold;border-left: 4px solid #1890FF;padding-left: 4px;margin-bottom: 20px;">
|
||||
留样柜权限
|
||||
留样权限
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
|
|
@ -347,6 +347,22 @@
|
|||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="留样称权限:" prop="simpleCabinetStatus2">
|
||||
<el-switch v-model="simpleCabinetStatus2"
|
||||
active-text="开启" inactive-text="关闭"
|
||||
:active-value="1" :inactive-value="2">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="智能出入库秤权限:" prop="simpleCabinetStatus3">
|
||||
<el-switch v-model="simpleCabinetStatus3"
|
||||
active-text="开启" inactive-text="关闭"
|
||||
:active-value="1" :inactive-value="2">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -402,6 +418,22 @@
|
|||
:active-value="1" :inactive-value="2">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="留样称权限:" prop="simpleCabinetStatus2">
|
||||
<el-switch v-model="simpleCabinetStatus2"
|
||||
active-text="开启" inactive-text="关闭"
|
||||
:active-value="1" :inactive-value="2">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="智能出入库秤权限:" prop="simpleCabinetStatus3">
|
||||
<el-switch v-model="simpleCabinetStatus3"
|
||||
active-text="开启" inactive-text="关闭"
|
||||
:active-value="1" :inactive-value="2">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
|
@ -473,6 +505,8 @@ export default {
|
|||
}
|
||||
],
|
||||
simpleCabinetStatus:1,
|
||||
simpleCabinetStatus2:1,
|
||||
simpleCabinetStatus3:1,
|
||||
// 表单校验
|
||||
rules: {
|
||||
staffName: [
|
||||
|
|
@ -645,6 +679,17 @@ export default {
|
|||
console.log(this.form.accessAuthorityList)
|
||||
let index = this.form.accessAuthorityList.findIndex(v=>v.deviceType==3)
|
||||
if(index==-1){
|
||||
this.form.accessAuthorityList.forEach(item=>{
|
||||
if(item.deviceType==7){
|
||||
this.simpleCabinetStatus = Number(item.privilegeValue)
|
||||
}
|
||||
if(item.deviceType==21){
|
||||
this.simpleCabinetStatus2 = Number(item.privilegeValue)
|
||||
}
|
||||
if(item.deviceType==51){
|
||||
this.simpleCabinetStatus3 = Number(item.privilegeValue)
|
||||
}
|
||||
})
|
||||
this.simpleCabinetStatus = Number(this.form.accessAuthorityList[0].privilegeValue)
|
||||
}else{
|
||||
this.accessAuthorityList = []
|
||||
|
|
@ -656,6 +701,12 @@ export default {
|
|||
if(item.deviceType==7){
|
||||
this.simpleCabinetStatus = Number(item.privilegeValue)
|
||||
}
|
||||
if(item.deviceType==21){
|
||||
this.simpleCabinetStatus2 = Number(item.privilegeValue)
|
||||
}
|
||||
if(item.deviceType==51){
|
||||
this.simpleCabinetStatus3 = Number(item.privilegeValue)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -683,6 +734,8 @@ export default {
|
|||
location:""
|
||||
}]
|
||||
this.simpleCabinetStatus=1
|
||||
this.simpleCabinetStatus2=1
|
||||
this.simpleCabinetStatus3=1
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
@ -711,6 +764,12 @@ export default {
|
|||
if(item.deviceType==7){
|
||||
this.simpleCabinetStatus = Number(item.privilegeValue)
|
||||
}
|
||||
if(item.deviceType==21){
|
||||
this.simpleCabinetStatus2 = Number(item.privilegeValue)
|
||||
}
|
||||
if(item.deviceType==51){
|
||||
this.simpleCabinetStatus3 = Number(item.privilegeValue)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log(this.accessAuthorityList)
|
||||
|
|
@ -767,22 +826,33 @@ export default {
|
|||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
let arr = [{
|
||||
deviceId:"",
|
||||
deviceName:"",
|
||||
deviceType:7,
|
||||
privilegeValue:this.simpleCabinetStatus,
|
||||
location:""
|
||||
}]
|
||||
let arr = [
|
||||
{
|
||||
deviceId:"",
|
||||
deviceName:"",
|
||||
deviceType:7,
|
||||
privilegeValue:this.simpleCabinetStatus,
|
||||
location:""
|
||||
},
|
||||
{
|
||||
deviceId:"",
|
||||
deviceName:"",
|
||||
deviceType:21,
|
||||
privilegeValue:this.simpleCabinetStatus2,
|
||||
location:""
|
||||
},
|
||||
{
|
||||
deviceId:"",
|
||||
deviceName:"",
|
||||
deviceType:51,
|
||||
privilegeValue:this.simpleCabinetStatus3,
|
||||
location:""
|
||||
}
|
||||
]
|
||||
let arr2 = this.accessAuthorityList.concat(arr)
|
||||
this.form.accessAuthorityList=[]
|
||||
arr2.forEach(item=>{
|
||||
if(item.deviceType==3){
|
||||
this.form.accessAuthorityList.push(item)
|
||||
}
|
||||
if(item.deviceType==7){
|
||||
this.form.accessAuthorityList.push(item)
|
||||
}
|
||||
this.form.accessAuthorityList.push(item)
|
||||
})
|
||||
console.log(this.accessAuthorityList)
|
||||
console.log(this.form)
|
||||
|
|
|
|||
Loading…
Reference in New Issue