员工概管理修改2

This commit is contained in:
zzyuan 2025-06-25 10:55:31 +08:00
parent 328fd3aefc
commit be6fb0e208
1 changed files with 81 additions and 40 deletions

View File

@ -305,6 +305,12 @@
size="mini" v-if="accessAuthorityList.length>1" size="mini" v-if="accessAuthorityList.length>1"
@click="delDevice(index)" @click="delDevice(index)"
>删除</el-button> >删除</el-button>
<el-button
type="info"
plain
size="mini" v-if="accessAuthorityList.length==1"
@click="clearDevice(index)"
>清空</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
@ -473,6 +479,15 @@ export default {
postName: [ postName: [
{ required: true, message: "员工岗位名称不能为空", trigger: "blur" } { required: true, message: "员工岗位名称不能为空", trigger: "blur" }
], ],
faceUrl: [
{ required: true, message: "人脸照片不能为空", trigger: "change" }
],
healthCertExpire: [
{ required: true, message: "健康证到期日期不能为空", trigger: "change" }
],
healthCertFrontImg: [
{ required: true, message: "健康证照片不能为空", trigger: "change" }
],
}, },
fileList0: [],// fileList0: [],//
checkUrlList0: [],// checkUrlList0: [],//
@ -576,6 +591,10 @@ export default {
console.log(this.form) console.log(this.form)
if(this.form.accessAuthorityList&&this.form.accessAuthorityList.length>0){ if(this.form.accessAuthorityList&&this.form.accessAuthorityList.length>0){
console.log(this.form.accessAuthorityList) 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.accessAuthorityList = []
this.form.accessAuthorityList.forEach(item=>{ this.form.accessAuthorityList.forEach(item=>{
if(item.deviceType==3){ if(item.deviceType==3){
@ -587,6 +606,7 @@ export default {
} }
}) })
} }
}
console.log(this.accessAuthorityList) console.log(this.accessAuthorityList)
this.open = true; this.open = true;
this.title = "修改"; this.title = "修改";
@ -657,6 +677,17 @@ export default {
// //
delDevice(index){ delDevice(index){
this.accessAuthorityList.splice(index,1) 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){ chosenDevice(e){
let index = this.devicesOptions.findIndex(v=>v.deviceId==e) let index = this.devicesOptions.findIndex(v=>v.deviceId==e)
@ -691,7 +722,17 @@ export default {
privilegeValue:this.simpleCabinetStatus, privilegeValue:this.simpleCabinetStatus,
location:"" 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) console.log(this.form)
if (this.form.staffId != undefined) { if (this.form.staffId != undefined) {
editKitchenStaffApi(this.form).then(response => { editKitchenStaffApi(this.form).then(response => {