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