员工概管理修改2
This commit is contained in:
parent
328fd3aefc
commit
be6fb0e208
|
|
@ -305,6 +305,12 @@
|
|||
size="mini" v-if="accessAuthorityList.length>1"
|
||||
@click="delDevice(index)"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
size="mini" v-if="accessAuthorityList.length==1"
|
||||
@click="clearDevice(index)"
|
||||
>清空</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
|
@ -446,33 +452,42 @@ export default {
|
|||
simpleCabinetStatus:1,
|
||||
// 表单校验
|
||||
rules: {
|
||||
staffName: [
|
||||
{ required: true, message: "员工名称不能为空", trigger: "blur" }
|
||||
],
|
||||
staffNo: [
|
||||
{ required: true, message: "员工编号不能为空", trigger: "blur" }
|
||||
],
|
||||
sex: [
|
||||
{ required: true, message: "员工性别不能为空", trigger: "change" }
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
required: true,
|
||||
message: '手机号不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
canteenId: [
|
||||
{ required: true, message: "关联食堂不能为空", trigger: "change" }
|
||||
],
|
||||
postName: [
|
||||
{ required: true, message: "员工岗位名称不能为空", trigger: "blur" }
|
||||
],
|
||||
staffName: [
|
||||
{ required: true, message: "员工名称不能为空", trigger: "blur" }
|
||||
],
|
||||
staffNo: [
|
||||
{ required: true, message: "员工编号不能为空", trigger: "blur" }
|
||||
],
|
||||
sex: [
|
||||
{ required: true, message: "员工性别不能为空", trigger: "change" }
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
required: true,
|
||||
message: '手机号不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: '请输入正确的手机号码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
canteenId: [
|
||||
{ required: true, message: "关联食堂不能为空", trigger: "change" }
|
||||
],
|
||||
postName: [
|
||||
{ required: true, message: "员工岗位名称不能为空", trigger: "blur" }
|
||||
],
|
||||
faceUrl: [
|
||||
{ required: true, message: "人脸照片不能为空", trigger: "change" }
|
||||
],
|
||||
healthCertExpire: [
|
||||
{ required: true, message: "健康证到期日期不能为空", trigger: "change" }
|
||||
],
|
||||
healthCertFrontImg: [
|
||||
{ required: true, message: "健康证照片不能为空", trigger: "change" }
|
||||
],
|
||||
},
|
||||
fileList0: [],//图片
|
||||
checkUrlList0: [],//图片
|
||||
|
|
@ -575,17 +590,22 @@ export default {
|
|||
}
|
||||
console.log(this.form)
|
||||
if(this.form.accessAuthorityList&&this.form.accessAuthorityList.length>0){
|
||||
console.log(this.form.accessAuthorityList)
|
||||
this.accessAuthorityList = []
|
||||
this.form.accessAuthorityList.forEach(item=>{
|
||||
if(item.deviceType==3){
|
||||
this.accessAuthorityList.push(item)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
if(item.deviceType==7){
|
||||
this.simpleCabinetStatus = Number(item.privilegeValue)
|
||||
}
|
||||
})
|
||||
console.log(this.form.accessAuthorityList)
|
||||
let index = this.form.accessAuthorityList.findIndex(v=>v.deviceType==3)
|
||||
if(index==-1){
|
||||
this.simpleCabinetStatus = Number(this.form.accessAuthorityList[0].privilegeValue)
|
||||
}else{
|
||||
this.accessAuthorityList = []
|
||||
this.form.accessAuthorityList.forEach(item=>{
|
||||
if(item.deviceType==3){
|
||||
this.accessAuthorityList.push(item)
|
||||
this.$forceUpdate()
|
||||
}
|
||||
if(item.deviceType==7){
|
||||
this.simpleCabinetStatus = Number(item.privilegeValue)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log(this.accessAuthorityList)
|
||||
this.open = true;
|
||||
|
|
@ -657,7 +677,18 @@ export default {
|
|||
//删除设备
|
||||
delDevice(index){
|
||||
this.accessAuthorityList.splice(index,1)
|
||||
},
|
||||
this.setDisabled()
|
||||
},
|
||||
clearDevice(index){
|
||||
if(index==0){
|
||||
this.accessAuthorityList.splice(index,1)
|
||||
this.accessAuthorityList.push({
|
||||
deviceId:"",
|
||||
location:""
|
||||
})
|
||||
this.setDisabled()
|
||||
}
|
||||
},
|
||||
chosenDevice(e){
|
||||
let index = this.devicesOptions.findIndex(v=>v.deviceId==e)
|
||||
let index2 = this.accessAuthorityList.findIndex(v=>v.deviceId==e)
|
||||
|
|
@ -691,7 +722,17 @@ export default {
|
|||
privilegeValue:this.simpleCabinetStatus,
|
||||
location:""
|
||||
}]
|
||||
this.form.accessAuthorityList = this.accessAuthorityList.concat(arr)
|
||||
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)
|
||||
}
|
||||
})
|
||||
console.log(this.accessAuthorityList)
|
||||
console.log(this.form)
|
||||
if (this.form.staffId != undefined) {
|
||||
editKitchenStaffApi(this.form).then(response => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue